@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #172554;
  --muted: #475569;
  --border: #dbe7f5;
  --accent: #1e40af;
  --accent-dark: #1e3a8a;
  --accent-soft: #dbeafe;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --violet: #7c3aed;
  --ink: #0f172a;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --shadow-soft: 0 24px 70px rgba(30, 64, 175, 0.12);
  --danger-bg: #fff1f0;
  --danger-text: #9f1d1d;
  --focus: #2b7cff;
  --scrollbar-track: rgba(219, 231, 245, 0.34);
  --scrollbar-thumb: rgba(100, 116, 139, 0.42);
  --scrollbar-thumb-hover: rgba(30, 64, 175, 0.68);
}

/* Social Approval review bundles */
.social-bundle-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 20px;
  margin-bottom: 20px;
}

.social-bundle-builder-main,
.social-bundle-builder-side {
  min-width: 0;
}

.social-bundle-builder-side {
  position: sticky;
  top: 18px;
}

.social-bundle-content-field {
  padding: 0;
  border: 0;
  margin: 20px 0 0;
}

.social-bundle-content-field legend {
  margin-bottom: 10px;
  font-weight: 800;
  color: var(--ink);
}

.social-bundle-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.social-bundle-choice[hidden] {
  display: none !important;
}

.social-bundle-choice {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.social-bundle-choice:hover {
  border-color: rgba(59, 130, 246, 0.56);
  box-shadow: 0 12px 28px rgba(30, 64, 175, 0.1);
}

.social-bundle-choice:has(input:checked) {
  border-color: #3b82f6;
  background: rgba(219, 234, 254, 0.66);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.social-bundle-choice:has(input:focus-visible) {
  outline: 3px solid rgba(59, 130, 246, 0.34);
  outline-offset: 2px;
}

.social-bundle-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.social-bundle-choice-check {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #94a3b8;
  border-radius: 9px;
  color: transparent;
  background: #ffffff;
}

.social-bundle-choice-check svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.social-bundle-choice input:checked + .social-bundle-choice-check {
  color: #ffffff;
  border-color: #1e40af;
  background: #1e40af;
}

.social-bundle-choice strong,
.social-bundle-choice small,
.social-bundle-choice em {
  display: block;
}

.social-bundle-choice strong {
  color: #0f172a;
  font-size: 1rem;
}

.social-bundle-choice small,
.social-bundle-choice em {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
  font-style: normal;
}

.social-page .social-bundle-builder .social-bundle-builder-side button {
  min-height: 44px;
  margin-top: 4px;
}

.social-page .social-bundle-builder .social-bundle-builder-side button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.social-bundle-history {
  margin-top: 20px;
}

.social-bundle-shell {
  max-width: 1240px;
}

.social-bundle-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: end;
  gap: 24px;
}

.social-bundle-progress {
  padding: 18px;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(145deg, #172554, #1e40af);
  box-shadow: 0 18px 46px rgba(30, 64, 175, 0.2);
}

.social-bundle-progress strong,
.social-bundle-progress span {
  display: block;
}

.social-bundle-progress strong {
  font-size: 1.45rem;
}

.social-bundle-progress span {
  margin-top: 2px;
  color: #dbeafe;
  font-size: 0.82rem;
}

.social-bundle-progress-track {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.social-bundle-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f59e0b;
}

.social-bundle-expired,
.social-bundle-complete {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin: 20px 0;
  border-radius: 18px;
}

.social-bundle-expired {
  color: #991b1b;
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.social-bundle-expired span {
  color: #7f1d1d;
}

.social-bundle-complete {
  color: #065f46;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
}

.social-bundle-complete > span {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: #059669;
}

.social-bundle-complete svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.social-bundle-complete p {
  margin: 3px 0 0;
}

.social-bundle-list {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.social-bundle-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  align-items: start;
  gap: 20px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.1);
}

.social-bundle-item-number {
  position: absolute;
  z-index: 2;
  top: -12px;
  left: -10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 4px solid #f8fafc;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 900;
  background: #1e40af;
}

.social-bundle-preview {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbe7f5;
  border-radius: 18px;
  background: #ffffff;
}

.social-bundle-preview .social-post-placeholder {
  min-height: 300px;
}

.social-bundle-preview .social-post-media img,
.social-bundle-preview .social-post-media video {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #0f172a;
}

.social-bundle-decision {
  min-width: 0;
  padding: 22px;
  border-radius: 18px;
  color: #e2e8f0;
  background: linear-gradient(145deg, #172554, #0f172a);
}

.social-bundle-decision h3 {
  margin: 10px 0 8px;
  color: #ffffff;
  font-size: 1.28rem;
}

.social-bundle-decision > p:not(.eyebrow) {
  color: #cbd5e1;
}

.social-bundle-decision .eyebrow {
  color: #93c5fd;
}

.social-bundle-decision label {
  color: #ffffff;
}

.social-bundle-decision textarea {
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.09);
}

.social-bundle-decision textarea::placeholder {
  color: #94a3b8;
}

.social-review-bundle-public .social-bundle-decision .social-review-actions button {
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 980px) {
  .social-bundle-builder,
  .social-bundle-item {
    grid-template-columns: 1fr;
  }

  .social-bundle-builder-side {
    position: static;
  }
}

@media (max-width: 759px) {
  .social-bundle-choice-grid,
  .social-bundle-intro {
    grid-template-columns: 1fr;
  }

  .social-bundle-progress {
    width: 100%;
  }

  .social-bundle-item {
    padding: 12px;
    border-radius: 18px;
  }

  .social-bundle-item-number {
    top: -10px;
    left: -6px;
  }

  .social-bundle-decision {
    padding: 18px;
  }

  .social-review-bundle-public .social-bundle-decision .social-review-actions button {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-bundle-choice {
    transition: none;
  }
}

/* Social Approval module: content planning and secure client review. */
.page.social-page {
  width: min(100% - 40px, 1320px);
}

.social-page input[type="email"],
.social-review-public input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
}

.social-subnav {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 18px 0 22px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(16px);
}

.social-subnav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.social-subnav a:hover,
.social-subnav a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.social-subnav a.active {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.social-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.social-metrics > div {
  display: grid;
  gap: 5px;
  min-height: 118px;
  align-content: center;
  padding: 18px;
}

.social-metrics strong {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1;
}

.social-metrics small {
  color: var(--muted);
  font-size: 0.8rem;
}

.social-page .social-planning-panel {
  padding: 0;
  overflow: hidden;
}

.social-planning-head {
  gap: 18px;
  align-items: end;
  padding: 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.social-planning-head h2,
.social-planning-head .eyebrow {
  margin-bottom: 0;
}

.social-filter-row {
  display: flex;
  gap: 9px;
  align-items: end;
  margin-left: auto;
}

.social-filter-row label {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.social-filter-row label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.social-filter-row select {
  min-height: 42px;
  padding-block: 8px;
}

.social-filter-row button {
  width: auto;
  min-height: 42px;
}

.social-content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: rgba(248, 250, 252, 0.58);
}

.social-content-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.social-content-card:hover {
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: 0 20px 44px rgba(30, 64, 175, 0.14);
  transform: translateY(-2px);
}

.social-card-media {
  position: relative;
  display: grid;
  min-height: 162px;
  place-items: center;
  overflow: hidden;
  background: var(--accent-soft);
  background:
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.5), transparent 32%),
    linear-gradient(145deg, color-mix(in srgb, var(--client-color) 28%, white), color-mix(in srgb, var(--client-color) 66%, #dbeafe));
}

.social-card-media img {
  width: 100%;
  height: 100%;
  min-height: 162px;
  object-fit: cover;
}

.social-media-placeholder {
  display: grid;
  max-width: 80%;
  gap: 4px;
  color: var(--ink);
  text-align: center;
}

.social-media-placeholder strong {
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.social-media-placeholder small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-platform-stack {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
}

.social-platform-stack i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-left: -5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: #334155;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.social-platform-stack i:first-child {
  margin-left: 0;
}

.social-platform-stack .platform-instagram { background: linear-gradient(135deg, #7c3aed, #db2777, #f59e0b); }
.social-platform-stack .platform-facebook { background: #1877f2; }
.social-platform-stack .platform-linkedin { background: #0a66c2; }
.social-platform-stack .platform-tiktok { background: #111827; }

.social-card-body {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.social-client-name {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.social-card-body h3 {
  min-height: 2.65em;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.32;
}

.social-card-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.74rem;
}

.social-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.social-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.social-status.approved { color: #0b6148; background: #ecfbf5; }
.social-status.review { color: #8a5200; background: #fff7dd; }
.social-status.changes { color: #9f1d1d; background: #fff1f0; }
.social-status.draft { color: #475569; background: #eef2f6; }

.social-empty-state {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 54px 22px;
  color: var(--muted);
  text-align: center;
}

.social-empty-state > span {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 18px;
  color: var(--accent);
  background: var(--accent-soft);
}

.social-empty-state svg { width: 30px; height: 30px; }
.social-empty-state h2,
.social-empty-state h3,
.social-empty-state p { margin: 0; }
.social-empty-state .button-link { width: auto; margin-top: 8px; }

.social-client-layout,
.social-editor-layout,
.social-detail-layout,
.social-history-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.social-client-list,
.social-history-list {
  display: grid;
  gap: 0;
}

.social-client-list article,
.social-history-list article {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.social-client-list article:last-child,
.social-history-list article:last-child { border-bottom: 0; }
.social-client-list article > div,
.social-history-list article > div { min-width: 0; flex: 1; }
.social-client-list strong,
.social-client-list small,
.social-history-list strong,
.social-history-list small { display: block; }
.social-client-list small,
.social-history-list small,
.social-client-list article > span:last-child { color: var(--muted); font-size: 0.78rem; }
.social-history-list p { margin: 6px 0 0; color: var(--muted); font-size: 0.86rem; white-space: pre-wrap; }

.social-client-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: #ffffff;
  background: var(--client-color, var(--accent));
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.social-count-chip,
.social-version-chip {
  display: inline-flex;
  min-width: 30px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.social-editor-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.75fr);
}

.social-editor-settings {
  position: sticky;
  top: 108px;
}

.social-platform-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.social-platform-field legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.social-platform-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.social-platform-choices label {
  display: flex;
  min-height: 48px;
  gap: 9px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.82);
  cursor: pointer;
}

.social-platform-choices input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.social-schedule-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.social-existing-media {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.82);
}

.social-existing-media span { color: var(--muted); font-size: 0.74rem; font-weight: 850; }
.social-existing-media strong { overflow-wrap: anywhere; }

.social-editor-actions,
.social-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 20px;
}

.social-detail-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.65fr);
}

.social-detail-sidebar {
  display: grid;
  gap: 18px;
}

.social-page .social-preview-panel { padding: 0; overflow: hidden; }

.social-preview-account,
.social-post-account {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
}

.social-preview-account > span:nth-child(2),
.social-post-account > span:nth-child(2) { min-width: 0; flex: 1; }
.social-preview-account strong,
.social-preview-account small,
.social-post-account strong,
.social-post-account small { display: block; }
.social-preview-account small,
.social-post-account small { color: var(--muted); font-size: 0.76rem; }

.social-detail-media,
.social-post-media {
  display: grid;
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  background: #0f172a;
}

.social-detail-media img,
.social-detail-media video,
.social-post-media img,
.social-post-media video {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
}

.social-post-placeholder {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.65), transparent 28%),
    linear-gradient(145deg, var(--accent-soft), #fde9bd);
  text-align: center;
}

.social-post-placeholder span {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 24px;
  color: #ffffff;
  background: var(--accent);
  font-size: 1.4rem;
  font-weight: 900;
}

.social-post-placeholder strong { max-width: 420px; font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.05; }

.social-preview-caption,
.social-post-copy {
  padding: 18px;
}

.social-preview-caption p,
.social-post-copy p { margin: 0; line-height: 1.65; white-space: pre-wrap; }
.social-post-copy h2 { margin-bottom: 12px; }
.social-post-copy small { display: block; margin-top: 16px; color: var(--muted); }

.social-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 15px;
}

.social-inline-form button { width: auto; }
.social-review-request > p { color: var(--muted); }

.social-history-layout {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.social-history-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.14);
}

.social-history-dot.approved { background: #0f9f75; box-shadow: 0 0 0 5px rgba(15, 159, 117, 0.12); }
.social-history-dot.review { background: var(--amber); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.13); }
.social-history-dot.changes { background: #dc2626; box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.1); }

.social-link-result {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(255, 255, 255, 0.92));
  box-shadow: 0 18px 42px rgba(30, 64, 175, 0.1);
}

.social-link-result h2,
.social-link-result p { margin: 0; }
.social-link-result > div:first-child { display: grid; gap: 6px; }
.social-link-result > div:first-child > p:last-child { color: var(--muted); }

.social-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
}

.social-copy-row input { min-width: 0; }
.social-copy-row button,
.social-copy-row .button-link { width: auto; }

/* Public content review uses the same Clarivo color and type tokens without the internal app navigation. */
.social-review-public {
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(219, 234, 254, 0.72), transparent 32%),
    radial-gradient(circle at 90% 90%, rgba(253, 230, 138, 0.38), transparent 30%),
    #f8fafc;
}

.social-review-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 76px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 12px max(20px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

.social-review-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.social-review-brand .brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
}

.social-review-brand svg { width: 27px; height: 27px; }
.social-review-brand svg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.social-review-brand > span:last-child { display: grid; gap: 1px; }
.social-review-brand small { color: var(--muted); font-size: 0.76rem; font-weight: 800; }

.social-secure-label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.social-secure-label svg,
.social-review-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-review-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 38px 0 64px;
}

.social-review-intro {
  max-width: 780px;
  margin-bottom: 24px;
}

.social-review-intro h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.social-review-intro > p:last-child { margin: 0; color: var(--muted); font-size: 1.05rem; }

.social-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.72fr);
  gap: 22px;
  align-items: start;
}

.social-post-preview,
.social-review-decision,
.social-review-empty {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.social-post-account .social-version-chip { margin-left: auto; }

.social-review-decision {
  position: sticky;
  top: 98px;
  padding: 24px;
  color: #ffffff;
  border-color: rgba(30, 64, 175, 0.24);
  background:
    radial-gradient(circle at 90% 0, rgba(59, 130, 246, 0.32), transparent 38%),
    linear-gradient(145deg, #172554, #0f172a);
}

.social-review-decision h2 { color: #ffffff; font-size: 1.65rem; }
.social-review-decision > p:not(.eyebrow) { color: #cbd5e1; }
.social-review-decision .eyebrow { color: #93c5fd; }
.social-review-decision label { color: #ffffff; }
.social-review-decision textarea { color: #ffffff; border-color: rgba(148, 163, 184, 0.45); background: rgba(255, 255, 255, 0.09); }
.social-review-decision textarea::placeholder { color: #94a3b8; }
.social-review-form { margin-top: 18px; }
.social-review-actions { grid-template-columns: 1fr; }

.social-review-public .social-review-decision .social-review-actions button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-approve-button {
  color: #ffffff;
  background: #0f9f75;
  box-shadow: 0 14px 34px rgba(15, 159, 117, 0.22);
}

.social-approve-button:hover { background: #087a5a; box-shadow: 0 18px 42px rgba(15, 159, 117, 0.26); }
.social-review-decision .button-secondary { color: #ffffff; border-color: rgba(147, 197, 253, 0.28); background: rgba(59, 130, 246, 0.18); }
.social-review-decision .button-secondary:hover { background: rgba(59, 130, 246, 0.3); }

.social-review-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 18px;
  color: #ffffff;
  background: #dc2626;
  font-size: 1.8rem;
  font-weight: 900;
}

.social-review-state-icon.approved { background: #0f9f75; }
.social-review-state-icon.warning { color: #111827; background: var(--amber); }

.social-review-comment {
  margin: 16px 0;
  padding: 13px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 12px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  white-space: pre-wrap;
}

.social-review-empty {
  display: grid;
  max-width: 680px;
  justify-items: center;
  gap: 8px;
  margin: 70px auto;
  padding: 48px 24px;
  text-align: center;
}

.social-review-empty h1,
.social-review-empty p { margin: 0; }
.social-review-empty > p:last-child { color: var(--muted); }

@media (max-width: 1080px) {
  .social-content-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .social-planning-head { align-items: start; flex-direction: column; }
  .social-filter-row { width: 100%; margin-left: 0; }
  .social-filter-row label { min-width: 0; flex: 1; }
}

@media (max-width: 900px) {
  .social-content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-editor-layout,
  .social-detail-layout,
  .social-review-layout { grid-template-columns: 1fr; }
  .social-editor-settings,
  .social-review-decision { position: static; }
  .social-history-layout { grid-template-columns: 1fr; }
}

@media (max-width: 759px) {
  .page.social-page { width: min(100% - 20px, 100%); padding-top: 18px; }
  .social-subnav { margin-top: 0; }
  .social-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .social-metrics > div { min-height: 104px; padding: 14px; }
  .social-content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .social-card-media,
  .social-card-media img { min-height: 130px; }
  .social-card-body { padding: 11px; }
  .social-card-body h3 { font-size: 0.9rem; }
  .social-card-meta { align-items: flex-start; flex-direction: column; }
  .social-filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .social-filter-row button { grid-column: 1 / -1; width: 100%; }
  .social-client-layout { grid-template-columns: 1fr; }
  .social-editor-actions,
  .social-copy-row { grid-template-columns: 1fr; }
  .social-copy-row button,
  .social-copy-row .button-link { width: 100%; }
}

@media (max-width: 560px) {
  .social-review-topbar { min-height: 66px; padding: 10px 12px; }
  .social-review-brand .brand-mark { width: 38px; height: 38px; }
  .social-secure-label { font-size: 0; }
  .social-secure-label svg { width: 22px; height: 22px; }
  .social-review-shell { width: min(100% - 20px, 1180px); padding-top: 24px; }
  .social-review-intro h1 { font-size: 2rem; }
  .social-post-preview,
  .social-review-decision { border-radius: 16px; }
  .social-review-decision { padding: 18px; }
  .social-content-grid { grid-template-columns: 1fr; }
  .social-card-media,
  .social-card-media img { min-height: 190px; }
  .social-platform-choices,
  .social-schedule-row,
  .social-inline-form { grid-template-columns: 1fr; }
  .social-inline-form button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .social-content-card,
  .social-subnav a { transition: none; }
  .social-content-card:hover { transform: none; }
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: content-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    var(--bg);
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

.page,
.dashboard-page,
.finance-page,
.page-narrow {
  width: min(100% - 24px, 560px);
  margin: 0 auto;
  padding: 24px 0;
}

.panel,
.visual,
.auth-panel,
.tool-card,
.metric-strip > div,
.metric-grid > div,
.document-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(25, 40, 57, 0.07);
}

.panel,
.tool-card,
.status-tile,
.feed-sidebar,
.field-chip,
.preview-card,
.import-sample-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.panel {
  padding: 20px;
}

.shell,
.account-layout,
.split-layout,
.form-grid,
.tool-grid,
.upload-grid,
.metric-grid,
.metric-strip,
.line-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.visual {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 24px;
  background: #101820;
  order: -1;
}

.qr-mark {
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.qr-mark span {
  display: block;
  border-radius: 2px;
  background: #ffffff;
}

.qr-mark span:nth-child(3n + 2),
.qr-mark span:nth-child(5n) {
  background: transparent;
}

h1,
h2 {
  line-height: 1.14;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 20px;
  font-size: 1.65rem;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label,
.legend {
  font-weight: 700;
  color: #243242;
}

input[type="url"],
input[type="text"],
input[type="password"],
input[type="file"],
input[type="date"],
input[type="time"],
input[type="color"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

input[type="file"] {
  min-height: auto;
  padding: 10px;
  font-size: 0.92rem;
}

input[type="color"] {
  padding: 6px;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

select {
  appearance: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(43, 124, 255, 0.26);
  outline-offset: 2px;
  border-color: var(--focus);
}

.choice-grid,
.choice-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  cursor: pointer;
}

.choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.error,
.success,
.notice,
.recovery-code,
.conversion-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 6px;
}

.error {
  border: 1px solid #ffd2cf;
  color: var(--danger-text);
  background: var(--danger-bg);
}

.success,
.recovery-code {
  border: 1px solid #bfe6d8;
  color: #0b6148;
  background: #ecfbf5;
}

.notice,
.conversion-note {
  border: 1px solid var(--border);
  color: var(--muted);
  background: #ffffff;
}

.recovery-code {
  display: grid;
  gap: 8px;
}

.recovery-code span {
  font-size: 0.85rem;
  font-weight: 800;
}

.recovery-code code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.actions {
  margin-top: 22px;
}

button,
.button-link,
.button-secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button,
.button-link {
  color: #ffffff;
  background: var(--accent);
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.button-link.secondary,
.button-secondary {
  color: var(--text);
  background: #eef2f6;
}

.button-link.secondary:hover,
.button-secondary:hover {
  background: #e0e7ef;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.icon-button:hover {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.icon-button.small {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.danger-button {
  color: #9f1d1d;
}

.danger-icon-button {
  color: var(--danger-text);
  border-color: rgba(159, 29, 29, 0.16);
  background: rgba(255, 241, 240, 0.76);
}

.danger-icon-button:hover {
  color: #ffffff;
  border-color: var(--danger-text);
  background: var(--danger-text);
}

.inline-form {
  margin: 0;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-screen {
  display: grid;
  place-items: center;
  padding: 18px 12px;
  background:
    linear-gradient(135deg, rgba(14, 111, 92, 0.12), rgba(36, 84, 214, 0.08)),
    var(--bg);
}

.auth-wrap {
  width: min(100%, 430px);
}

.auth-panel {
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(17, 24, 39, 0.13);
}

.auth-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--accent);
  font-weight: 900;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
}

.auth-panel .actions {
  justify-content: center;
}

.brand-mark,
.tool-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: var(--accent);
}

.brand-mark svg,
.tool-icon svg {
  width: 24px;
  height: 24px;
}

.brand-mark path,
.tool-icon path,
.tool-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(220, 228, 232, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(25, 40, 57, 0.07);
  backdrop-filter: blur(18px);
  color: var(--muted);
  font-size: 0.95rem;
}

.brand-link {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  gap: 10px 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.text-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.table-action-button {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--accent);
  background: transparent !important;
  box-shadow: none !important;
  font: inherit;
  font-weight: 800;
}

.table-action-button:hover {
  color: var(--accent-dark);
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: underline;
  transform: none !important;
}

.dashboard-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  margin: 20px 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-head h1 {
  margin-bottom: 0;
}

.dashboard-head > .icon-button {
  align-self: start;
  flex: 0 0 auto;
}

.dashboard-head.action-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.dashboard-head.action-head > div {
  min-width: 0;
}

.dashboard-head.action-head > .icon-button,
.dashboard-head.action-head > .header-action-button {
  margin-left: auto;
}

.dashboard-head .button-link,
.dashboard-head .button-secondary,
.dashboard-head .header-action-button {
  min-height: 40px;
  padding-block: 8px;
  line-height: 1;
}

.metric-strip > div,
.metric-grid > div {
  padding: 16px;
}

.metric-grid > div {
  min-height: 98px;
}

.metric-value,
.metric-grid strong {
  display: block;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.metric-value {
  font-size: 1.65rem;
}

.metric-grid strong {
  margin-top: 12px;
  font-size: 1.15rem;
  line-height: 1.16;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tool-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 138px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
}

.tool-card:hover {
  border-color: rgba(14, 111, 92, 0.42);
}

.tool-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 1.15rem;
}

.tool-card small {
  color: var(--muted);
  font-size: 0.95rem;
}

.tool-icon {
  width: 56px;
  height: 56px;
}

.qr-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.qr-icon path {
  fill: currentColor;
  stroke: none;
}

.image-icon {
  color: var(--blue);
  background: #edf2ff;
}

.finance-icon {
  color: var(--violet);
  background: #f1edff;
}

.planner-icon {
  color: #0f766e;
  background: #ccfbf1;
}

.feed-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.folder-icon {
  color: var(--amber);
  background: #fff7e8;
}

.finance-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.finance-nav a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.finance-nav a:hover,
.finance-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.finance-actions,
.compact-actions,
.document-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h1,
.modal-head h2,
.modal-head h3 {
  margin: 0;
}

.customer-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  gap: 8px;
  align-items: end;
}

.finance-tools {
  margin-top: 20px;
}

.settings-panel,
.converter-panel {
  width: 100%;
  margin: 0 auto;
}

.settings-form {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.support-panel .panel-title-row {
  align-items: flex-start;
}

.support-message-field textarea {
  min-height: 150px;
}

.document-price-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 16px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.document-price-mode .eyebrow {
  margin-bottom: 4px;
}

.document-price-mode strong {
  display: block;
  color: var(--ink);
}

.price-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 360px);
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
}

.price-mode-options label {
  position: relative;
  cursor: pointer;
}

.price-mode-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.price-mode-options span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.price-mode-options input:checked + span {
  color: #111827;
  background: var(--amber);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.18);
}

.price-mode-options input:focus-visible + span {
  outline: 3px solid rgba(43, 124, 255, 0.26);
  outline-offset: 2px;
}

.line-head {
  display: none;
}

.line-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.line-row input,
.line-row select {
  min-height: 44px;
}

.line-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.line-field::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.line-field-wide,
.line-row-actions {
  grid-column: 1 / -1;
}

.line-discount-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 6px;
}

.line-price-field {
  display: grid;
  min-width: 0;
}

.line-currency-badge {
  display: none;
}

.document-line-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.line-remove-button {
  justify-self: start;
}

.line-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  visibility: hidden;
}

.discount-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.modal-dialog {
  width: min(100% - 24px, 760px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.modal-box {
  display: grid;
  gap: 16px;
  width: 100%;
  max-height: min(86vh, 820px);
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}

.modal-box::-webkit-scrollbar {
  width: 8px;
}

.modal-box::-webkit-scrollbar-thumb {
  border-width: 2px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.payment-summary {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.payment-summary .panel-title-row {
  margin-bottom: 0;
}

.payment-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.payment-metrics > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.payment-metrics span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.payment-metrics strong {
  color: var(--text);
  font-size: 1rem;
}

.document-actions {
  margin: 18px 0;
}

.document-preview {
  overflow-x: auto;
  background: #ffffff;
}

.document-preview[data-fit-preview] {
  overflow: hidden;
  position: relative;
}

.document-preview[data-fit-preview] .doc {
  width: 900px !important;
  max-width: none !important;
  margin: 0 !important;
}

.upload-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
}

.upload-card strong {
  display: block;
  margin-bottom: 5px;
}

.upload-card small {
  color: var(--muted);
  font-size: 0.9rem;
}

.account-layout .panel:first-child {
  grid-row: auto;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.feed-form,
.feed-rule-list,
.status-list,
.feed-stack,
.feed-project-list,
.feed-log-list,
.preview-card-list,
.import-sample-list {
  display: grid;
  gap: 14px;
}

.feed-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  margin: 20px 0;
}

.feed-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.feed-app-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.feed-sidebar,
.status-tile,
.field-chip,
.quiet-panel,
.preview-card,
.import-sample-card,
.feed-modal {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 42px rgba(25, 40, 57, 0.07);
  backdrop-filter: blur(16px);
}

.feed-sidebar {
  padding: 16px;
}

.feed-sidebar-head,
.section-split {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.feed-sidebar-head strong,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  background: var(--accent-soft);
}

.feed-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.feed-project-card:hover,
.feed-project-card.active {
  border-color: rgba(14, 111, 92, 0.28);
  background: var(--panel-soft);
}

.feed-project-card:hover {
  transform: translateY(-1px);
}

.feed-project-card strong,
.feed-project-card small {
  display: block;
}

.feed-project-card strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.feed-project-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #aeb8c4;
}

.health-dot.live {
  background: #12a36b;
}

.health-dot.broken {
  background: #d64545;
}

.feed-status-grid,
.feed-main-grid,
.feed-two-col,
.field-chip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.feed-status-grid {
  margin-bottom: 14px;
}

.status-tile {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
}

.status-tile span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-tile strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.05;
}

.status-tile small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-tile.live {
  border-color: #bfe6d8;
}

.status-tile.live strong {
  color: #0b6148;
}

.status-tile.broken {
  border-color: #ffd2cf;
}

.status-tile.broken strong {
  color: var(--danger-text);
}

.logbook-filter-panel {
  display: grid;
  gap: 16px;
}

.period-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.period-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 900;
  text-decoration: none;
  background: rgba(248, 251, 255, 0.76);
}

.period-tabs a:hover,
.period-tabs a.active {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.24);
  background: rgba(219, 234, 254, 0.85);
}

.logbook-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.logbook-filter .field,
.logbook-filter .actions {
  margin: 0;
}

.logbook-metrics {
  margin: 16px 0;
}

.logbook-table td {
  vertical-align: top;
}

.log-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(219, 234, 254, 0.8);
}

.log-status.success {
  color: #047857;
  background: rgba(209, 250, 229, 0.88);
}

.log-status.failed {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.feed-rule-head {
  display: none;
}

.feed-rule-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.feed-rule-row .field {
  margin-bottom: 0;
}

.feed-remove {
  align-self: end;
}

.feed-preview-table {
  margin-top: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  background: #eef2f6;
}

.status-badge.changed {
  color: var(--accent-dark);
  font-weight: 850;
  background: var(--accent-soft);
}

.output-box {
  display: flex;
  gap: 10px 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.output-box.compact {
  min-height: 48px;
  margin-bottom: 0;
}

.output-box code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 850;
}

.field-chip-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-chip {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--panel-soft);
  box-shadow: none;
}

.field-chip strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.field-chip span {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 900;
}

.field-chip small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.feed-data-table table {
  min-width: 0;
}

.feed-preview-table table {
  min-width: 0;
}

.preview-card,
.import-sample-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--panel-soft);
  box-shadow: none;
}

.preview-card > div {
  display: grid;
  gap: 4px;
}

.preview-card strong,
.import-sample-card h3 {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.preview-card span,
.preview-card dt,
.import-sample-card dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.preview-card dl,
.import-sample-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.preview-card dl > div,
.import-sample-card dl > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preview-card dd,
.import-sample-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 32, 41, 0.28);
  backdrop-filter: blur(8px);
}

.feed-modal {
  width: min(100%, 980px);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  padding: 18px;
}

.modal-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin-bottom: 0;
}

.modal-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.modal-metrics > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.modal-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-metrics strong {
  color: var(--ink);
}

.feed-log-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-log-list li {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left: 4px solid #bfe6d8;
  border-radius: 6px;
  background: var(--panel-soft);
}

.feed-log-list li.error {
  border-left-color: #d64545;
  background: var(--danger-bg);
}

.feed-log-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.feed-log-list strong {
  color: var(--ink);
}

.feed-log-list p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-list {
  margin: 0;
}

.status-list > div {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.status-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.status-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 800;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.planner-page {
  width: min(100% - 40px, 1240px);
}

.planner-metrics {
  margin-bottom: 20px;
}

.planner-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.planner-stack,
.planner-agenda-list,
.agenda-items {
  display: grid;
  gap: 14px;
}

.planner-mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.planner-task-choice {
  margin-bottom: 16px;
}

.agenda-day {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.agenda-day:first-child {
  border-top: 0;
  padding-top: 0;
}

.agenda-day > time {
  color: var(--ink);
  font-weight: 900;
}

.agenda-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.agenda-item strong,
.planner-table strong {
  display: block;
  color: var(--ink);
  line-height: 1.25;
}

.agenda-item small,
.planner-table small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.agenda-type,
.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.agenda-type {
  color: #0f766e;
  background: #ccfbf1;
}

.agenda-item.ticket .agenda-type,
.priority-pill.urgent {
  color: #991b1b;
  background: #fee2e2;
}

.agenda-item.event .agenda-type {
  color: #1e40af;
  background: #dbeafe;
}

.priority-pill.low {
  color: #166534;
  background: #dcfce7;
}

.priority-pill.normal {
  color: #334155;
  background: #e2e8f0;
}

.priority-pill.high {
  color: #92400e;
  background: #fef3c7;
}

.planner-table td:first-child {
  min-width: 240px;
}

.planner-status-form {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.planner-status-form select {
  min-height: 40px;
  padding-block: 8px;
}

.planner-status-form button {
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
}

@media (min-width: 720px) {
  .planner-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1020px) {
  .planner-board {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  }

  .planner-agenda-panel {
    min-height: 320px;
  }
}

@media (min-width: 560px) {
  .page,
  .dashboard-page,
  .finance-page {
    width: min(100% - 32px, 720px);
    padding: 32px 0;
  }

  .choice-row,
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-actions,
  .compact-actions,
  .document-actions,
  .feed-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .button-link,
  .button-secondary,
  .document-actions button,
  .inline-form button {
    width: auto;
  }

  .feed-hero {
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
  }

  .feed-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feed-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logbook-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .page {
    width: min(100% - 40px, 980px);
    padding: 42px 0;
  }

  .dashboard-page {
    width: min(100% - 40px, 1060px);
  }

  .finance-page {
    width: min(100% - 40px, 1180px);
  }

  .panel {
    padding: 28px;
  }

  h1 {
    font-size: 2rem;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: stretch;
  }

  .visual {
    min-height: auto;
    order: initial;
  }

  .qr-mark {
    width: 196px;
    gap: 8px;
  }

  .topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .dashboard-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin: 24px 0;
  }

  .tool-grid,
  .upload-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discount-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .payment-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-card {
    min-height: 170px;
    padding: 22px;
  }

  .line-head,
  .line-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.25fr) minmax(70px, 0.45fr) minmax(82px, 0.5fr) minmax(90px, 0.55fr) minmax(134px, 0.8fr) minmax(72px, 0.45fr) 40px;
    gap: 8px;
  }

  .line-row {
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .line-head {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .line-field::before {
    display: none;
  }

  .line-field-wide,
  .line-row-actions {
    grid-column: auto;
  }

  .payment-row {
    grid-template-columns: 140px 120px 1fr 1fr 120px;
  }

  .feed-rule-head,
  .feed-rule-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) minmax(130px, 1fr) minmax(180px, 1.05fr) 122px;
    gap: 10px;
    align-items: end;
  }

  .feed-rule-head {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .feed-rule-row {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .feed-rule-row label {
    display: none;
  }

  .feed-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .logbook-filter {
    grid-template-columns: minmax(150px, 0.65fr) minmax(180px, 0.9fr) minmax(180px, 0.9fr) auto;
  }
}

@media (min-width: 980px) {
  .account-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 20px;
  }

  .account-layout .panel:first-child {
    grid-row: span 2;
  }

  .split-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 20px;
    align-items: start;
  }

  .metric-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .converter-panel {
    width: min(100%, 780px);
  }

  .settings-panel {
    width: min(100%, 900px);
  }

  .feed-page {
    width: min(100% - 40px, 1380px);
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }

  .feed-page > .topbar {
    position: sticky;
    top: 18px;
    grid-column: 1;
    grid-row: 1 / span 20;
    flex-direction: column;
    align-items: stretch;
    min-height: calc(100vh - 84px);
    margin-bottom: 0;
    padding: 16px;
    border-radius: 18px;
  }

  .feed-page > :not(.topbar) {
    grid-column: 2;
    min-width: 0;
  }

  .feed-page .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-content: stretch;
  }

  .feed-page .text-link {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
  }

  .feed-page .text-link:hover {
    color: var(--accent);
    background: rgba(231, 245, 241, 0.78);
    text-decoration: none;
  }

  .feed-app-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
  }

  .feed-sidebar {
    position: sticky;
    top: 18px;
  }

  .feed-main-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    align-items: start;
  }

  .modal-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tool-card:hover {
    transform: translateY(-1px);
  }
}

/* Image converter workspace */
.converter-page .converter-workspace {
  width: min(100% - 24px, 1180px);
}

.converter-page .converter-panel {
  width: 100%;
  padding: clamp(18px, 3vw, 32px);
}

.converter-header,
.converter-section-head,
.converter-progress-head,
.converter-log-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.converter-header {
  margin-bottom: 24px;
}

.converter-header h1 {
  margin: 6px 0 8px;
  font-size: 2rem;
}

.converter-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.converter-capability {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.converter-capability > span,
.converter-file-status > span,
.converter-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.converter-capability.available {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.28);
  background: #ecfdf5;
}

.converter-capability.available > span {
  background: #10b981;
}

.converter-capability.unavailable {
  color: var(--danger-text);
  border-color: rgba(220, 38, 38, 0.2);
  background: var(--danger-bg);
}

.converter-capability.unavailable > span {
  background: #dc2626;
}

.converter-dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 250px;
  padding: clamp(24px, 5vw, 44px);
  border: 2px dashed #b8cbea;
  border-radius: 8px;
  text-align: center;
  background: #f8fbff;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.converter-dropzone.is-dragging {
  border-color: var(--blue);
  background: #eff6ff;
  box-shadow: inset 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.converter-dropzone > input[type="file"][hidden] {
  display: none;
}

.converter-drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--accent);
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.1);
}

.converter-drop-icon svg,
.converter-actions svg,
.converter-download svg,
.converter-clear svg,
.converter-remove svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.converter-dropzone strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.converter-dropzone p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.converter-pick-actions,
.converter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.converter-file-button {
  cursor: pointer;
}

.converter-selection,
.converter-settings,
.converter-progress,
.converter-results {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.converter-validation-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 6px;
  color: var(--danger-text);
  background: var(--danger-bg);
  font-size: 0.8rem;
  font-weight: 700;
}

.converter-section-head {
  align-items: center;
  margin-bottom: 14px;
}

.converter-label {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.converter-section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.converter-clear {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.82rem;
  cursor: pointer;
}

.converter-clear svg {
  width: 17px;
  height: 17px;
}

.converter-summary,
.converter-result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.converter-summary > div,
.converter-result-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: #fff;
}

.converter-summary span,
.converter-result-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.converter-summary strong,
.converter-result-summary strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.93rem;
}

.converter-file-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 3px;
}

.converter-file-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 36px;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: #fff;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.converter-file-card.is-success {
  border-color: rgba(16, 185, 129, 0.34);
  background: #f7fffb;
}

.converter-file-card.is-error {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fffafa;
}

.converter-file-preview {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #eef4fb;
}

.converter-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.converter-format-preview {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

.converter-file-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.converter-file-copy strong,
.converter-file-copy span,
.converter-file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.converter-file-copy strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.converter-file-copy span,
.converter-file-copy small {
  color: var(--muted);
  font-size: 0.74rem;
}

.converter-file-copy .converter-output-detail {
  margin-top: 2px;
  color: #047857;
  font-weight: 800;
}

.converter-file-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.converter-file-status.success {
  color: #047857;
}

.converter-file-status.success > span {
  background: #10b981;
}

.converter-file-status.error {
  color: var(--danger-text);
}

.converter-file-status.error > span {
  background: #dc2626;
}

.converter-file-status.converting > span {
  background: var(--blue);
  animation: converter-pulse 1s ease-in-out infinite;
}

.converter-remove {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.converter-remove:hover {
  color: var(--danger-text);
  border-color: rgba(220, 38, 38, 0.16);
  background: var(--danger-bg);
  box-shadow: none;
  transform: none;
}

.converter-setting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.converter-setting-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: #f8fbff;
}

.converter-setting-card > span {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.converter-setting-card > span strong {
  color: var(--accent);
}

.converter-setting-card select {
  width: 100%;
  min-height: 42px;
}

.converter-setting-card input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.converter-setting-card small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.converter-progress {
  padding: 16px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 6px;
  background: #f8fbff;
}

.converter-progress-head {
  align-items: end;
  margin-bottom: 10px;
}

.converter-progress-head > div {
  display: grid;
  gap: 2px;
}

.converter-progress-head strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.converter-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.converter-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.converter-actions {
  margin-top: 20px;
}

.converter-actions button,
.converter-download {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.converter-actions button:disabled,
.converter-clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.converter-actions button.is-loading svg {
  animation: converter-spin 1s linear infinite;
}

.converter-results {
  scroll-margin-top: 20px;
}

.converter-result-error {
  grid-column: 1 / -1;
  border-color: rgba(220, 38, 38, 0.28) !important;
  background: var(--danger-bg) !important;
}

.converter-result-error strong {
  color: var(--danger-text);
}

.converter-download[hidden] {
  display: none;
}

.converter-log {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: #fff;
}

.converter-log-head {
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}

.converter-log-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
}

.converter-log-head > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.converter-log ol {
  display: grid;
  gap: 0;
  max-height: 300px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.converter-log li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 14px;
  border-bottom: 1px solid #edf2f7;
}

.converter-log li:last-child {
  border-bottom: 0;
}

.converter-log-dot {
  margin-top: 5px;
}

.converter-log li.success .converter-log-dot {
  background: #10b981;
}

.converter-log li.error .converter-log-dot {
  background: #dc2626;
}

.converter-log li.warning .converter-log-dot {
  background: var(--amber);
}

.converter-log li.info .converter-log-dot {
  background: var(--blue);
}

.converter-log li strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.converter-log li p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

@keyframes converter-pulse {
  50% { opacity: 0.3; }
}

@keyframes converter-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 639px) {
  .converter-header {
    display: grid;
  }

  .converter-capability {
    justify-self: start;
  }

  .converter-dropzone {
    min-height: 230px;
  }

  .converter-pick-actions,
  .converter-pick-actions .converter-file-button {
    width: 100%;
  }

  .converter-file-card {
    grid-template-columns: 44px minmax(0, 1fr) 34px;
    gap: 9px;
  }

  .converter-file-preview {
    width: 44px;
    height: 44px;
  }

  .converter-file-status {
    grid-column: 2;
  }

  .converter-remove {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .converter-results .converter-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .converter-download {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .converter-progress-track > span,
  .converter-dropzone,
  .converter-file-card {
    transition: none;
  }

  .converter-file-status.converting > span,
  .converter-actions button.is-loading svg {
    animation: none;
  }
}

/* SaaS analytics refresh */
body {
  font-family: "Fira Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.72) 0%, rgba(248, 250, 252, 0.92) 42%, rgba(255, 247, 237, 0.58) 100%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(30, 64, 175, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 64, 175, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 86%);
}

.page,
.dashboard-page,
.finance-page,
.page-narrow {
  width: min(100% - 28px, 1180px);
}

.dashboard-page {
  width: min(100% - 28px, 1240px);
}

.panel,
.visual,
.auth-panel,
.tool-card,
.metric-strip > div,
.metric-grid > div,
.document-preview,
.feed-sidebar,
.status-tile,
.field-chip,
.quiet-panel,
.preview-card,
.import-sample-card,
.feed-modal {
  border-color: rgba(148, 163, 184, 0.28);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.panel,
.auth-panel {
  border-radius: 18px;
}

h1,
h2,
.metric-value,
.metric-grid strong,
.tool-card strong,
.brand-link,
.preview-card strong,
.import-sample-card h3 {
  color: var(--ink);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.25rem;
}

.dashboard-intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.eyebrow {
  color: var(--blue);
  letter-spacing: 0.08em;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  gap: 14px;
  border-color: rgba(148, 163, 184, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(20px);
}

.brand-link {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  min-width: max-content;
}

.brand-copy,
.auth-showcase-head > span:last-child,
.user-chip > span:last-child {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.brand-copy small,
.auth-showcase-head small,
.user-chip small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.brand-mark {
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--blue) 58%, var(--amber));
  box-shadow: 0 14px 34px rgba(30, 64, 175, 0.24);
}

.brand-mark svg,
.tool-link svg,
.account-link svg,
.tool-icon svg {
  width: 22px;
  height: 22px;
}

.brand-mark path,
.tool-link path,
.tool-link rect,
.tool-link circle,
.tool-link ellipse,
.account-link path,
.account-link circle,
.tool-icon path,
.tool-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-actions {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.tool-link,
.account-link {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.tool-link:hover,
.tool-link.active,
.account-link:hover,
.account-link.active {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.18);
  background: rgba(219, 234, 254, 0.76);
  text-decoration: none;
}

.tool-link.active,
.account-link.active {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.account-dock {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.dashboard-homebar {
  justify-content: space-between;
}

.dashboard-homebar .account-dock {
  width: auto;
  min-width: max-content;
  padding-top: 0;
  border-top: 0;
}

.user-chip {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-dark), var(--blue));
}

.account-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.logout-link {
  color: #9f1d1d;
}

.logout-link:hover {
  color: #7f1d1d;
  border-color: rgba(248, 113, 113, 0.2);
  background: rgba(254, 226, 226, 0.78);
}

button,
.button-link {
  color: #111827;
  background: var(--amber);
  box-shadow: 0 14px 34px rgba(245, 158, 11, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

button:hover,
.button-link:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(245, 158, 11, 0.28);
}

.button-link.secondary,
.button-secondary {
  color: var(--accent-dark);
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: rgba(219, 234, 254, 0.75);
  box-shadow: none;
}

.button-link.secondary:hover,
.button-secondary:hover {
  background: rgba(191, 219, 254, 0.9);
}

input[type="url"],
input[type="text"],
input[type="password"],
input[type="file"],
input[type="date"],
input[type="color"],
select,
textarea {
  border-color: rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

label,
.legend {
  color: var(--ink);
}

.choice,
.upload-card,
.feed-rule-row,
.output-box,
.modal-metrics > div,
.feed-log-list li {
  border-color: rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.82);
}

.choice input {
  accent-color: var(--blue);
}

.metric-strip,
.metric-grid {
  gap: 14px;
}

.metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric-strip > div,
.metric-grid > div,
.status-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.metric-strip > div::after,
.metric-grid > div::after,
.status-tile::after {
  position: absolute;
  inset: auto 16px 0 16px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  content: "";
  background: linear-gradient(90deg, var(--blue), var(--amber));
}

.metric-value,
.metric-grid strong {
  color: var(--accent-dark);
}

.tool-grid {
  gap: 16px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.72)),
    var(--panel);
}

.tool-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), transparent 42%, rgba(245, 158, 11, 0.11));
  opacity: 0;
  transition: opacity 180ms ease;
}

.tool-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 28px 72px rgba(30, 64, 175, 0.16);
}

.tool-card:hover::after {
  opacity: 1;
}

.tool-card > * {
  position: relative;
  z-index: 1;
}

.tool-card small,
.metric-label,
.hint,
.notice,
.conversion-note,
.preview-card span,
.preview-card dt,
.import-sample-card dt {
  color: var(--muted);
}

.tool-icon {
  border-radius: 16px;
}

.qr-icon {
  color: var(--accent);
  background: rgba(219, 234, 254, 0.92);
}

.image-icon {
  color: #0f766e;
  background: rgba(204, 251, 241, 0.82);
}

.finance-icon {
  color: #6d28d9;
  background: rgba(237, 233, 254, 0.9);
}

.feed-icon {
  color: #b45309;
  background: rgba(254, 243, 199, 0.9);
}

.folder-icon {
  color: var(--accent-dark);
  background: rgba(219, 234, 254, 0.82);
}

.visual {
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(145deg, #0f172a, #1e3a8a 58%, #0f766e);
}

.qr-mark span {
  border-radius: 4px;
}

.finance-nav {
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 42px rgba(30, 64, 175, 0.08);
  backdrop-filter: blur(18px);
}

.finance-nav a {
  border-radius: 12px;
  color: #334155;
}

.finance-nav a:hover,
.finance-nav a.active {
  color: var(--accent);
  background: rgba(219, 234, 254, 0.85);
}

table {
  color: var(--ink);
}

th {
  color: #475569;
  letter-spacing: 0.04em;
}

td {
  color: #1f2937;
}

.status-tile.live {
  border-color: rgba(18, 163, 107, 0.25);
}

.status-tile.live strong {
  color: #047857;
}

.status-tile.broken {
  border-color: rgba(214, 69, 69, 0.28);
}

.auth-screen {
  min-height: 100vh;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(248, 250, 252, 0.98) 48%, rgba(255, 247, 237, 0.76)),
    var(--bg);
}

.auth-wrap {
  display: grid;
  width: min(100%, 480px);
  gap: 18px;
  align-items: stretch;
}

.auth-showcase,
.auth-panel {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(22px);
}

.auth-showcase {
  display: grid;
  gap: 24px;
  padding: 22px;
  color: var(--ink);
}

.auth-showcase-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-showcase-head strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.auth-orbit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.orbit-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  align-content: center;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.78);
}

.orbit-card.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--blue));
}

.orbit-card span {
  color: inherit;
  opacity: 0.72;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.orbit-card strong {
  color: inherit;
  font-size: 1.5rem;
}

.auth-panel {
  padding: 26px;
}

.auth-panel h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.auth-footer {
  color: var(--muted);
}

@media (min-width: 760px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    padding: 28px;
  }

  .auth-orbit {
    grid-template-columns: 1fr;
    align-content: end;
  }

  .auth-panel {
    padding: 34px;
  }
}

@media (min-width: 980px) {
  .dashboard-page .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    flex-direction: row;
    align-items: center;
    margin-bottom: 30px;
  }

  .dashboard-page .dashboard-homebar {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .dashboard-page .topbar-actions {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    width: auto;
    gap: 6px;
    justify-content: flex-start;
    overflow: visible;
    padding-bottom: 0;
  }

  .dashboard-page .tool-link {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 0.92rem;
  }

  .dashboard-page .account-dock {
    width: auto;
    min-width: max-content;
    padding-top: 0;
    border-top: 0;
    justify-content: flex-end;
  }

  .dashboard-page .account-actions {
    flex-wrap: nowrap;
  }

  .page:not(.dashboard-page) {
    width: min(100% - 40px, 1440px);
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .page:not(.dashboard-page) > .topbar {
    grid-column: 1;
    grid-row: 1 / span 80;
    position: sticky;
    top: 18px;
    flex-direction: column;
    align-items: stretch;
    min-height: calc(100vh - 36px);
    margin-bottom: 0;
    padding: 18px;
  }

  .page:not(.dashboard-page) > :not(.topbar) {
    grid-column: 2;
    min-width: 0;
  }

  .page:not(.dashboard-page) .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    overflow: visible;
    padding-bottom: 0;
  }

  .page:not(.dashboard-page) .tool-link,
  .page:not(.dashboard-page) .account-link {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }

  .page:not(.dashboard-page) .account-dock {
    margin-top: auto;
    display: grid;
    justify-content: stretch;
  }

  .page:not(.dashboard-page) .account-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .feed-page {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .feed-page > .topbar {
    border-radius: 22px;
  }

  .feed-page .text-link {
    padding: 9px 12px;
  }
}

/* Merchant feed responsive polish */
.feed-page,
.feed-page * {
  box-sizing: border-box;
}

.feed-page {
  overflow-x: clip;
  line-height: 1.5;
}

.feed-page h1,
.feed-page h2,
.feed-page h3,
.feed-page p {
  max-width: 100%;
}

.feed-page h2 {
  line-height: 1.15;
}

.feed-page input,
.feed-page select,
.feed-page textarea,
.feed-page button,
.feed-page .button-link,
.feed-page .button-secondary {
  max-width: 100%;
}

.feed-app-layout,
.feed-workspace,
.feed-main-grid,
.feed-stack,
.feed-sidebar,
.panel,
.status-tile,
.field-chip,
.preview-card,
.import-sample-card {
  min-width: 0;
}

.feed-sidebar {
  align-self: start;
}

.feed-sidebar-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.feed-sidebar-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.feed-new-project {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 12px;
  color: var(--accent-dark);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  background: rgba(219, 234, 254, 0.72);
}

.feed-new-project:hover {
  background: rgba(191, 219, 254, 0.9);
}

.feed-project-groups {
  display: grid;
  gap: 14px;
}

.feed-project-group {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.feed-project-group-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.feed-project-group-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-project-group-head strong {
  flex: 0 0 auto;
  min-width: 26px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--accent-dark);
  text-align: center;
  background: rgba(219, 234, 254, 0.8);
}

.feed-project-list {
  gap: 8px;
}

.feed-project-card {
  min-width: 0;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.45);
}

.feed-project-card.draft-card {
  margin-bottom: 14px;
  background: rgba(255, 247, 237, 0.78);
}

.feed-project-card strong {
  line-height: 1.25;
}

.feed-project-card small {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.health-dot.unknown {
  background: #aeb8c4;
}

.feed-hero,
.feed-actions,
.compact-actions,
.modal-head {
  min-width: 0;
}

.feed-actions,
.compact-actions {
  flex-wrap: wrap;
}

.feed-main-grid {
  grid-template-columns: 1fr;
}

.feed-view-shell {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.feed-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  padding: clamp(6px, 1.8vw, 18px) 0;
}

.feed-choice-tile {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 132px;
  min-width: 0;
  padding: 20px;
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  backdrop-filter: blur(14px);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.feed-choice-tile::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  content: "";
}

.feed-choice-tile::after {
  display: none;
}

.feed-route-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  justify-self: start;
  border: 1px solid rgba(30, 64, 175, 0.12);
  border-radius: 8px;
  color: var(--accent-dark);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(219, 234, 254, 0.72)),
    rgba(239, 246, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 24px rgba(30, 64, 175, 0.08);
}

.feed-route-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-route-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
  justify-items: start;
}

.feed-route-copy strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.16;
}

.feed-route-copy small {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.enrichment-tile .feed-route-icon {
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(254, 243, 199, 0.76)),
    rgba(255, 251, 235, 0.92);
}

.feed-choice-tile:hover,
.feed-choice-tile.active {
  border-color: rgba(15, 23, 42, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
}

.feed-choice-tile:hover,
.feed-choice-tile.active {
  transform: translateY(-2px);
}

.feed-screen {
  display: none;
  min-width: 0;
}

.feed-screen.active {
  display: block;
  animation: feed-screen-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feed-editor-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(248, 251, 255, 0.68)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 60px rgba(30, 64, 175, 0.1);
  backdrop-filter: blur(18px);
}

.feed-editor-head h2 {
  margin-bottom: 0;
}

.feed-back-button {
  justify-self: start;
}

.rule-count-badge {
  display: inline-flex;
  width: max-content;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  background: rgba(219, 234, 254, 0.82);
}

.feed-editor-grid {
  display: grid;
  min-width: 0;
  gap: 14px;
}

@keyframes feed-screen-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feed-two-col {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.feed-rule-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.82);
}

.feed-page .feed-rule-head {
  display: none;
}

.feed-page .feed-rule-row label {
  display: block;
}

.feed-rule-row .field,
.feed-rule-row input,
.feed-rule-row select {
  min-width: 0;
}

.field-chip-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}

.output-box code,
.feed-log-list p,
.status-tile small,
.field-chip small,
.preview-card dd,
.import-sample-card dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 980px) {
  .page:not(.dashboard-page) {
    width: min(100% - 32px, 1440px);
    grid-template-columns: minmax(218px, 0.22fr) minmax(0, 1fr);
    gap: clamp(16px, 2vw, 24px);
  }

  .feed-page {
    grid-template-columns: minmax(218px, 0.22fr) minmax(0, 1fr);
  }

  .feed-app-layout {
    grid-template-columns: minmax(210px, 0.28fr) minmax(0, 1fr);
    gap: clamp(14px, 1.4vw, 20px);
  }

  .feed-sidebar {
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .feed-editor-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 16px;
  }

  .feed-main-grid {
    grid-template-columns: 1fr;
  }

  .feed-page .feed-rule-head,
  .feed-page .feed-rule-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.9fr) minmax(160px, 1.1fr) minmax(190px, 0.95fr) 124px;
    gap: 10px;
    align-items: end;
  }

  .feed-page .feed-rule-head {
    margin-bottom: 8px;
    padding: 0 2px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .feed-page .feed-rule-row {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .feed-page .feed-rule-row label {
    display: none;
  }

  .feed-page .feed-remove {
    width: 100%;
    min-height: 44px;
  }
}

@media (min-width: 1280px) {
  .feed-main-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  }
}

@media (min-width: 760px) and (max-width: 979px) {
  .feed-page .feed-rule-head,
  .feed-page .feed-rule-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.9fr) minmax(150px, 1.1fr) minmax(180px, 0.95fr) 118px;
    gap: 10px;
    align-items: end;
  }

  .feed-page .feed-rule-head {
    margin-bottom: 8px;
    padding: 0 2px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .feed-page .feed-rule-row {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .feed-page .feed-rule-row label {
    display: none;
  }

  .feed-page .feed-remove {
    width: 100%;
    min-height: 44px;
  }
}

@media (min-width: 980px) and (max-width: 1180px) {
  .feed-app-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .feed-project-groups {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed-screen.active {
    animation: none;
  }

  .feed-choice-tile,
  .feed-project-card {
    transition: none;
  }
}

.tenant-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.tenant-switcher label,
.tool-permissions legend {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tenant-switcher select {
  min-width: min(100%, 240px);
}

.tenant-switcher-nav {
  width: 100%;
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.tenant-switcher-nav select {
  min-width: 0;
  width: 100%;
}

.tenant-switcher-nav .button-secondary {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
}

/* Projectmap selector in the app navigation. */
.tenant-switcher-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-color: rgba(59, 130, 246, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.9)),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.76), 0 12px 26px rgba(30, 64, 175, 0.08);
}

.tenant-switcher-nav label {
  margin: 0 0 -2px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.tenant-switcher-nav select {
  min-height: 42px;
  padding: 9px 38px 9px 12px;
  border-color: rgba(59, 130, 246, 0.28);
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  text-overflow: ellipsis;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%) right 15px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--accent) 50%, transparent 50%) right 10px center / 7px 7px no-repeat,
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.tenant-switcher-nav select:hover,
.tenant-switcher-nav select:focus-visible {
  border-color: rgba(30, 64, 175, 0.48);
  background-color: #ffffff;
}

.tenant-switcher-nav .button-secondary {
  justify-self: start;
  min-height: 42px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(219, 234, 254, 0.72);
  box-shadow: 0 10px 20px rgba(30, 64, 175, 0.08);
}

.tenant-switcher-nav .button-secondary:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.tool-permissions {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.permissions-form {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.recovery-choice {
  width: fit-content;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.pagination-page,
.pagination-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
  background: #ffffff;
}

.pagination-page.active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.pagination .disabled {
  pointer-events: none;
  opacity: 0.48;
}

.keyword-page .scanner-panel,
.keyword-page .scanner-result {
  width: 100%;
}

.scanner-results,
.seo-summary-grid,
.keyword-table-section {
  display: grid;
  gap: 14px;
}

.scanner-results {
  margin-top: 18px;
}

.scanner-result h2 {
  overflow-wrap: anywhere;
}

.keyword-metrics {
  margin-bottom: 16px;
}

.seo-summary-grid {
  margin: 16px 0 20px;
}

.seo-summary-grid .output-box {
  display: grid;
  grid-template-columns: minmax(110px, 0.24fr) minmax(0, 1fr);
  align-items: start;
}

.seo-summary-grid strong {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.keyword-table-section + .keyword-table-section {
  margin-top: 22px;
}

.keyword-table-section table {
  min-width: 860px;
}

.search-icon {
  color: #047857;
  background: #ecfdf5;
}

@media (max-width: 560px) {
  .feed-choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feed-choice-tile {
    width: 100%;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    justify-self: stretch;
    min-height: 118px;
    padding: 16px;
  }
}

@media (max-width: 759px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .tool-link,
  .account-link {
    min-width: 0;
    white-space: normal;
    font-size: 0.9rem;
    line-height: 1.15;
  }

  .account-dock {
    display: grid;
    gap: 12px;
    justify-content: stretch;
  }

  .account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-showcase {
    display: none;
  }

  .dashboard-head {
    gap: 12px;
  }

  .tool-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Compact luxury buttons: no full-width primary actions anywhere. */
.actions,
.compact-actions,
.finance-actions,
.document-actions,
.feed-actions,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

button:not(.icon-button):not(.feed-choice-tile),
.button-link,
.button-secondary,
.feed-new-project,
.feed-remove {
  width: fit-content !important;
  max-width: 100%;
  min-height: 38px;
  flex: 0 0 auto;
  justify-self: start;
  align-self: start;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

button:not(.icon-button):not(.feed-choice-tile):hover,
.button-link:hover,
.button-secondary:hover,
.feed-new-project:hover,
.feed-remove:hover {
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.modal-box button:not(.icon-button),
.modal-box .button-link,
.modal-box .button-secondary {
  min-height: 40px;
  padding-inline: 18px;
}

.inline-form {
  display: inline-flex;
  width: fit-content;
}

.auth-panel .actions {
  justify-content: center;
}

@media (min-width: 980px) {
  .account-page {
    width: min(100vw - 32px, 1680px);
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
  }

  .account-page > .topbar {
    padding: 16px;
  }

  .account-page .account-layout,
  .account-page .account-layout .panel:first-child {
    width: 100%;
    max-width: none;
  }

  .account-page .account-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .account-page .account-layout .panel:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .account-page table {
    min-width: 760px;
  }

  .account-page .modal-dialog {
    width: min(100vw - 32px, 980px);
  }

  .account-page .modal-box {
    max-height: calc(100vh - 32px);
  }
}

@media (min-width: 1280px) {
  .account-page {
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 26px;
  }
}

/* Responsive app navigation: mobile hamburger, tablet/desktop fixed-height sidebar. */
.nav-toggle {
  display: inline-flex;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.topbar.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 759px) {
  .page:not(.dashboard-page) {
    width: min(100% - 24px, 720px);
  }

  .page:not(.dashboard-page) > .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .page:not(.dashboard-page) > .topbar .brand-link {
    min-width: 0;
  }

  .page:not(.dashboard-page) > .topbar .topbar-actions,
  .page:not(.dashboard-page) > .topbar .account-dock {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
  }

  .page:not(.dashboard-page) > .topbar.nav-open .topbar-actions,
  .page:not(.dashboard-page) > .topbar.nav-open .account-dock {
    display: grid;
  }

  .page:not(.dashboard-page) > .topbar.nav-open .topbar-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .page:not(.dashboard-page) .tool-link,
  .page:not(.dashboard-page) .account-link {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
  }

  .page:not(.dashboard-page) .account-dock {
    gap: 10px;
    padding-top: 10px;
  }

  .page:not(.dashboard-page) .account-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

@media (min-width: 760px) {
  .nav-toggle {
    display: none;
  }

  .page:not(.dashboard-page) {
    width: min(100vw - 32px, 1440px);
    display: grid;
    grid-template-columns: clamp(220px, 23vw, 264px) minmax(0, 1fr);
    gap: clamp(16px, 2vw, 26px);
    align-items: start;
  }

  .account-page {
    width: min(100vw - 32px, 1680px);
    grid-template-columns: clamp(220px, 20vw, 252px) minmax(0, 1fr);
  }

  .page:not(.dashboard-page) > .topbar {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 16px;
    height: calc(100dvh - 32px);
    min-height: 0;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 0;
    padding: 16px;
  }

  .page:not(.dashboard-page) > :not(.topbar) {
    grid-column: 2;
    min-width: 0;
  }

  .page:not(.dashboard-page) .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 2px 6px 0;
  }

  .page:not(.dashboard-page) .tool-link,
  .page:not(.dashboard-page) .account-link {
    width: 100%;
    justify-content: flex-start;
  }

  .page:not(.dashboard-page) .account-dock {
    margin-top: auto;
    display: grid;
    gap: 12px;
    justify-content: stretch;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
  }

  .page:not(.dashboard-page) .account-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

/* Desktop/tablet app shell correction: fixed sidebar, normal content flow. */
@media (min-width: 760px) {
  :root {
    --app-shell-max: 1440px;
    --app-shell-left: max(16px, calc((100vw - var(--app-shell-max)) / 2));
    --app-sidebar-width: clamp(220px, 22vw, 264px);
    --app-shell-gap: clamp(16px, 2vw, 28px);
  }

  .page:not(.dashboard-page) {
    display: block !important;
    width: min(100vw - 32px, var(--app-shell-max)) !important;
    min-height: 100dvh;
    margin-inline: auto;
    padding: 16px 0 32px calc(var(--app-sidebar-width) + var(--app-shell-gap));
    position: relative;
  }

  .account-page {
    --app-shell-max: 1680px;
    --app-shell-left: max(16px, calc((100vw - var(--app-shell-max)) / 2));
    --app-sidebar-width: clamp(220px, 18vw, 252px);
  }

  .page:not(.dashboard-page) > .topbar {
    position: fixed !important;
    inset: 16px auto 16px var(--app-shell-left);
    z-index: 80;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: var(--app-sidebar-width);
    height: auto;
    min-height: 0 !important;
    max-height: calc(100dvh - 32px);
    margin: 0;
    overflow: hidden;
    padding: 16px;
  }

  .page:not(.dashboard-page) > :not(.topbar) {
    min-width: 0;
  }

  .page:not(.dashboard-page) .topbar-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 2px 6px 0;
  }

  .page:not(.dashboard-page) .tool-link,
  .page:not(.dashboard-page) .account-link {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
  }

  .page:not(.dashboard-page) .account-dock {
    margin-top: auto;
    display: grid !important;
    gap: 12px;
    justify-content: stretch;
    width: 100%;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
  }

  .page:not(.dashboard-page) .account-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .finance-page .finance-nav,
  .finance-page .tenant-switcher,
  .feed-page .feed-hero,
  .feed-page .feed-app-layout,
  .account-page .account-layout,
  .page:not(.dashboard-page) > .dashboard-head,
  .page:not(.dashboard-page) > .panel,
  .page:not(.dashboard-page) > .metric-grid,
  .page:not(.dashboard-page) > .tool-grid,
  .page:not(.dashboard-page) > .table-wrap,
  .page:not(.dashboard-page) > .document-actions,
  .page:not(.dashboard-page) > .document-preview {
    width: 100%;
  }

  .account-page .account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Dashboard mobile header uses the same hamburger interaction as tool pages. */
@media (max-width: 759px) {
  .dashboard-page .dashboard-homebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 12px;
    z-index: 90;
    margin-bottom: 20px;
    padding: 12px;
  }

  .dashboard-page .dashboard-homebar .brand-link {
    min-width: 0;
  }

  .dashboard-page .dashboard-homebar .nav-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .dashboard-page .dashboard-homebar .account-dock {
    grid-column: 1 / -1;
    display: grid;
    width: 100%;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-top: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease, padding 180ms ease, border-color 180ms ease;
  }

  .dashboard-page .dashboard-homebar.nav-open .account-dock {
    max-height: 320px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .dashboard-page .dashboard-homebar .account-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .dashboard-page .dashboard-homebar .account-link {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Mobile-first app navigation: bottom menu + animated sheet. */
@media (max-width: 759px) {
  .page,
  .dashboard-page,
  .finance-page,
  .page-narrow {
    padding-bottom: 118px;
  }

  .topbar,
  .dashboard-page .dashboard-homebar,
  .page:not(.dashboard-page) > .topbar {
    position: fixed;
    inset: auto 12px 12px 12px;
    z-index: 120;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 10px;
    border-radius: 24px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.18);
  }

  .topbar .brand-link,
  .dashboard-page .dashboard-homebar .brand-link {
    min-width: 0;
  }

  .nav-toggle,
  .dashboard-page .dashboard-homebar .nav-toggle {
    order: -1;
    display: inline-grid;
    grid-template-columns: 20px auto;
    width: auto;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
    padding: 0 14px;
  }

  .nav-toggle span {
    grid-column: 1;
  }

  .nav-toggle strong {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    font-size: 0.9rem;
    line-height: 1;
  }

  .topbar .topbar-actions,
  .topbar .account-dock,
  .dashboard-page .dashboard-homebar .account-dock,
  .page:not(.dashboard-page) > .topbar .topbar-actions,
  .page:not(.dashboard-page) > .topbar .account-dock {
    grid-column: 1 / -1;
    display: grid;
    width: 100%;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-top: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(0.98);
    transform-origin: bottom center;
    transition: max-height 260ms ease, opacity 180ms ease, transform 240ms ease, padding 180ms ease, border-color 180ms ease;
  }

  .topbar.nav-open .topbar-actions,
  .topbar.nav-open .account-dock,
  .dashboard-page .dashboard-homebar.nav-open .account-dock,
  .page:not(.dashboard-page) > .topbar.nav-open .topbar-actions,
  .page:not(.dashboard-page) > .topbar.nav-open .account-dock {
    max-height: min(70dvh, 520px);
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .topbar.nav-open .topbar-actions,
  .page:not(.dashboard-page) > .topbar.nav-open .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .topbar .tool-link,
  .topbar .account-link,
  .page:not(.dashboard-page) .tool-link,
  .page:not(.dashboard-page) .account-link,
  .dashboard-page .dashboard-homebar .account-link {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    white-space: normal;
  }

  .topbar .account-actions,
  .dashboard-page .dashboard-homebar .account-actions,
  .page:not(.dashboard-page) .account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar .user-chip,
  .dashboard-page .dashboard-homebar .user-chip {
    margin-bottom: 8px;
  }

  .finance-page .finance-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    padding: 0;
    margin: 12px 0 18px;
  }

  .finance-page .finance-nav a {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    text-align: center;
    white-space: normal;
  }

  .finance-page .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .finance-page .finance-tools {
    display: none;
  }
}

/* Final mobile app pass: bottom menu and administration tiles. */
@media (max-width: 759px) {
  body {
    overflow-x: hidden;
  }

  .dashboard-page,
  .page:not(.dashboard-page) {
    min-height: 100dvh;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .topbar,
  .dashboard-page .dashboard-homebar,
  .page:not(.dashboard-page) > .topbar {
    position: fixed !important;
    inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px !important;
    z-index: 140;
    width: auto !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    overflow: hidden;
    transform: translateZ(0);
  }

  .topbar.nav-open,
  .dashboard-page .dashboard-homebar.nav-open {
    overflow: auto;
  }

  .nav-toggle {
    justify-self: start;
  }

  .topbar .brand-link,
  .dashboard-page .dashboard-homebar .brand-link {
    justify-self: end;
  }

  .topbar .topbar-actions,
  .topbar .account-dock,
  .dashboard-page .dashboard-homebar .account-dock {
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .topbar .topbar-actions::-webkit-scrollbar,
  .topbar .account-dock::-webkit-scrollbar,
  .dashboard-page .dashboard-homebar .account-dock::-webkit-scrollbar {
    width: 8px;
  }

  .topbar .topbar-actions::-webkit-scrollbar-thumb,
  .topbar .account-dock::-webkit-scrollbar-thumb,
  .dashboard-page .dashboard-homebar .account-dock::-webkit-scrollbar-thumb {
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.34);
  }

  .finance-page .finance-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow: visible !important;
    margin: 12px 0 18px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .finance-page .finance-nav a {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
    color: #334155;
    text-align: center;
    white-space: normal;
  }

  .finance-page .finance-nav a.active {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(219, 234, 254, 0.92);
    color: var(--accent);
  }

  .finance-page .dashboard-head {
    gap: 14px;
  }

  .finance-page .finance-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .finance-page .finance-actions .button-link {
    width: auto;
    min-height: 42px;
    padding-inline: 14px;
  }

  .finance-page .metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .finance-page .metric-grid > div {
    min-height: 104px;
    padding: 14px;
  }

  .finance-page .metric-grid strong {
    font-size: clamp(1rem, 4.4vw, 1.2rem);
    overflow-wrap: anywhere;
  }

  .finance-page .finance-tools {
    display: none !important;
  }

  .tenant-switcher-nav {
    grid-column: 1 / -1;
    margin-top: 4px;
  }
}

/* Header action alignment: buttons sit on the h1 row, not on the eyebrow row. */
.dashboard-head,
.dashboard-head.action-head {
  align-items: flex-start;
}

.dashboard-head > .finance-actions,
.dashboard-head > .button-link,
.dashboard-head > .button-secondary,
.dashboard-head > .header-action-button {
  margin-top: 28px;
}

.dashboard-head.action-head > .header-action-button {
  align-self: flex-start;
}

@media (max-width: 759px) {
  .dashboard-head {
    gap: 12px;
  }

  .dashboard-head > .finance-actions,
  .dashboard-head > .button-link,
  .dashboard-head > .button-secondary,
  .dashboard-head > .header-action-button {
    margin-top: 26px;
  }

  .dashboard-head:not(.action-head) {
    flex-direction: column;
  }

  .dashboard-head:not(.action-head) > .finance-actions,
  .dashboard-head:not(.action-head) > .button-link,
  .dashboard-head:not(.action-head) > .button-secondary {
    margin-top: 0;
  }
}

/* PlanPulse final layout overrides. */
.page.planner-page {
  width: min(100% - 40px, 1240px);
}

.planner-page .planner-board {
  grid-template-columns: minmax(0, 1fr);
}

.planner-page .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-page .text-button {
  width: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.planner-page .text-button:hover {
  color: var(--accent-dark);
  background: transparent;
  text-decoration: underline;
}

.planner-page .planner-item-trigger {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.planner-page .planner-item-trigger:hover {
  border-color: rgba(15, 118, 110, 0.36);
  background: #ffffff;
}

.planner-page .planner-title-button {
  display: block;
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.planner-page .planner-title-button:hover {
  color: var(--accent);
  background: transparent;
}

.planner-page .planner-title-button:hover strong {
  text-decoration: underline;
}

.planner-detail-dialog {
  width: min(100% - 24px, 860px);
}

.planner-detail-box {
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(255, 255, 255, 1) 38%),
    #ffffff;
}

.planner-detail-head {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.planner-detail-head h2 {
  margin-top: 0;
}

.planner-page .planner-detail-grid[data-detail-cards] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px;
  width: 100%;
}

.planner-page .planner-detail-card {
  display: grid !important;
  align-content: start;
  gap: 6px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.planner-page .planner-detail-card.status,
.planner-page .planner-detail-card.type {
  border-color: rgba(15, 118, 110, 0.24);
  background: #f0fdfa;
}

.planner-page .planner-detail-card.priority {
  border-color: rgba(245, 158, 11, 0.28);
  background: #fffbeb;
}

.planner-page .planner-detail-card-label,
.planner-note-box h3 {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.planner-page .planner-detail-card-value {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.planner-note-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.planner-note-box h3 {
  margin: 0 0 8px;
}

.planner-note-box p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 1019px) {
  .planner-page .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-page .planner-detail-grid[data-detail-cards] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 759px) {
  .page.planner-page {
    width: min(100% - 24px, 100%);
  }

  .planner-page .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .agenda-day,
  .agenda-item {
    grid-template-columns: 1fr;
  }

  .planner-status-form {
    grid-template-columns: 1fr;
  }

  .planner-status-form button {
    width: 100%;
  }

  .planner-page .planner-detail-grid[data-detail-cards] {
    grid-template-columns: 1fr !important;
  }
}

/* Administration mobile app polish: compact tabs, card lists and thumb-friendly forms. */
.responsive-table {
  min-width: 0;
}

.responsive-table td {
  overflow-wrap: anywhere;
}

@media (min-width: 760px) {
  .responsive-table td::before {
    display: none;
  }
}

@media (max-width: 759px) {
  .page.finance-page {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .finance-page > .dashboard-head {
    margin: 0 0 10px;
    padding-inline: 2px;
  }

  .finance-page .dashboard-head {
    gap: 10px;
    align-items: flex-start;
  }

  .finance-page .dashboard-head h1 {
    font-size: clamp(2rem, 10vw, 3.15rem);
    line-height: 0.96;
    overflow-wrap: anywhere;
  }

  .finance-page .dashboard-head.action-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .finance-page .dashboard-head.action-head > .header-action-button {
    align-self: end;
    margin-top: 0;
  }

  .finance-page .finance-actions {
    gap: 8px;
    margin-top: 0;
  }

  .finance-page .finance-actions .button-link,
  .finance-page .dashboard-head > .button-link,
  .finance-page .dashboard-head > .header-action-button {
    min-height: 42px;
    padding-inline: 14px;
  }

  .finance-page .finance-nav {
    position: sticky;
    top: 10px;
    z-index: 70;
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px;
    overflow-x: auto !important;
    margin: 10px -10px 14px;
    padding: 6px 10px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(238, 246, 255, 0.96), rgba(255, 255, 255, 0.82));
    box-shadow: none;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .finance-page .finance-nav::-webkit-scrollbar {
    display: none;
  }

  .finance-page .finance-nav a {
    flex: 0 0 auto;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    color: #334155;
    line-height: 1;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .finance-page .finance-nav a.active {
    border-color: rgba(37, 99, 235, 0.32);
    background: rgba(219, 234, 254, 0.96);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 12px 28px rgba(37, 99, 235, 0.09);
  }

  .finance-page > .panel {
    margin-top: 12px;
  }

  .finance-page .panel,
  .finance-page .payment-summary,
  .finance-page .discount-card {
    padding: 14px;
    border-radius: 18px;
  }

  .finance-page .panel > h2 {
    margin-bottom: 12px;
    font-size: clamp(1.35rem, 6vw, 2rem);
    line-height: 1.05;
  }

  .finance-page .metric-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .finance-page .metric-grid > div {
    min-height: 88px;
    padding: 12px;
    border-radius: 16px;
  }

  .finance-page .metric-label {
    font-size: 0.78rem;
  }

  .finance-page .metric-grid strong {
    margin-top: 9px;
    font-size: clamp(0.96rem, 4.2vw, 1.15rem);
  }

  .finance-page .table-wrap {
    overflow: visible;
  }

  .finance-page .responsive-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
    font-size: 0.93rem;
  }

  .finance-page .responsive-table thead {
    display: none;
  }

  .finance-page .responsive-table tbody {
    display: grid;
    gap: 10px;
  }

  .finance-page .responsive-table tr {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  }

  .finance-page .responsive-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0;
    border: 0;
    color: var(--ink);
    line-height: 1.35;
  }

  .finance-page .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .finance-page .responsive-table td[data-label="Acties"] {
    display: flex;
    grid-template-columns: none;
    justify-content: flex-start;
    padding-top: 4px;
  }

  .finance-page .responsive-table td[data-label="Acties"]::before {
    display: none;
  }

  .finance-page .responsive-table .row-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .finance-page .table-action-button {
    min-height: 36px !important;
    box-shadow: none !important;
  }

  .finance-page .document-form,
  .finance-page .settings-form {
    display: grid;
    gap: 12px;
  }

  .finance-page .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  .finance-page .document-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .finance-page .document-meta-customer,
  .finance-page .document-meta-subject {
    grid-column: 1 / -1;
  }

  .finance-page .document-form .discount-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-page .customer-select-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }

  .finance-page .document-price-mode {
    align-items: stretch;
    margin: 14px 0;
    padding: 12px;
    border-radius: 16px;
  }

  .finance-page .price-mode-options {
    width: 100%;
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .finance-page .price-mode-options span {
    min-height: 42px;
  }

  .finance-page .line-editor {
    gap: 10px;
  }

  .finance-page .line-editor .line-row {
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 10px 8px;
    padding: 12px;
    border-radius: 16px;
  }

  .finance-page .line-editor .line-field {
    grid-column: span 10;
  }

  .finance-page .line-editor .line-field-item,
  .finance-page .line-editor .line-field-text,
  .finance-page .line-editor .line-row-actions {
    grid-column: 1 / -1;
  }

  .finance-page .line-editor .line-field-quantity {
    grid-column: 1 / span 5;
  }

  .finance-page .line-editor .line-field-unit {
    grid-column: span 5;
  }

  .finance-page .line-editor .line-field-price {
    grid-column: 1 / span 8;
  }

  .finance-page .line-editor .line-field-discount,
  .finance-page .line-editor .line-field-tax {
    grid-column: span 6;
  }

  .finance-page .line-price-field {
    position: relative;
    display: grid;
  }

  .finance-page .line-price-field input {
    padding-right: 68px;
  }

  .finance-page .line-currency-badge {
    display: inline-flex;
    position: absolute;
    inset: 1px 1px 1px auto;
    min-width: 58px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0 13px 13px 0;
    color: var(--ink);
    background: rgba(248, 250, 252, 0.92);
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
  }

  .finance-page .payment-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    border-radius: 16px;
  }

  .finance-page .payment-row .line-field {
    grid-column: span 1;
  }

  .finance-page .payment-row .line-field[data-label="Methode"],
  .finance-page .payment-row .line-field[data-label="Notitie"],
  .finance-page .payment-row .line-row-actions {
    grid-column: 1 / -1;
  }

  .finance-page .document-line-actions {
    margin-top: 8px;
  }

  .finance-page .document-actions,
  .finance-page .compact-actions {
    gap: 8px;
  }

  .finance-page .payment-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-page .modal-dialog {
    width: min(100vw - 16px, 720px);
  }

  .finance-page .modal-box {
    max-height: calc(100dvh - 24px);
    padding: 14px;
    border-radius: 18px;
  }

  .finance-page .modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -14px -14px 0;
    padding: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.96);
  }

  .finance-page .modal-box > .compact-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -14px -14px;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.96);
  }
}

@media (max-width: 420px) {
  .finance-page .dashboard-head.action-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-page .dashboard-head.action-head > .header-action-button {
    margin-left: 0;
    margin-top: 0;
  }

  .finance-page .responsive-table td:not([data-label="Acties"]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .finance-page .payment-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Mobile spreadsheet-style lists for compact master data screens. */
@media (max-width: 759px) {
  .finance-page .items-table,
  .finance-page .customers-table {
    display: grid;
    width: 100%;
    min-width: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
    font-size: clamp(0.74rem, 2.8vw, 0.88rem);
  }

  .finance-page .items-table {
    grid-template-columns: minmax(72px, 1.05fr) minmax(58px, 0.72fr) minmax(76px, 0.95fr) minmax(46px, 0.5fr) minmax(48px, 0.48fr);
  }

  .finance-page .customers-table {
    grid-template-columns: minmax(58px, 0.56fr) minmax(86px, 0.92fr) minmax(118px, 1.2fr) minmax(74px, 0.78fr) minmax(48px, 0.48fr);
  }

  .finance-page .items-table thead,
  .finance-page .items-table tbody,
  .finance-page .items-table tr,
  .finance-page .customers-table thead,
  .finance-page .customers-table tbody,
  .finance-page .customers-table tr {
    display: contents;
  }

  .finance-page .items-table th,
  .finance-page .items-table td,
  .finance-page .customers-table th,
  .finance-page .customers-table td {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    padding: 8px 7px;
    border: 0;
    border-right: 1px solid rgba(226, 232, 240, 0.86);
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
    color: #162033;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .finance-page .items-table th,
  .finance-page .customers-table th {
    min-height: 38px;
    color: #475569;
    background: rgba(248, 250, 252, 0.94);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .finance-page .items-table td::before,
  .finance-page .customers-table td::before {
    display: none !important;
  }

  .finance-page .items-table tbody tr:nth-child(even) td,
  .finance-page .customers-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.58);
  }

  .finance-page .items-table th:last-child,
  .finance-page .items-table td:last-child,
  .finance-page .customers-table th:last-child,
  .finance-page .customers-table td:last-child {
    border-right: 0;
    justify-content: center;
    padding-inline: 5px;
  }

  .finance-page .items-table tbody tr:last-child td,
  .finance-page .customers-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .finance-page .items-table .row-actions,
  .finance-page .customers-table .row-actions {
    width: auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
  }

  .finance-page .items-table .icon-button.small,
  .finance-page .customers-table .icon-button.small {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 10px;
  }

  .finance-page .items-table .inline-form,
  .finance-page .customers-table .inline-form {
    width: auto;
  }

  .finance-page .customers-table th:nth-child(3),
  .finance-page .customers-table td:nth-child(3) {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .finance-page .customers-table {
    grid-template-columns: minmax(54px, 0.58fr) minmax(82px, 0.92fr) minmax(122px, 1.25fr) minmax(46px, 0.42fr);
  }

  .finance-page .customers-table th:nth-child(5),
  .finance-page .customers-table td:nth-child(5) {
    display: none !important;
  }

  .finance-page .items-table {
    grid-template-columns: minmax(68px, 1fr) minmax(54px, 0.68fr) minmax(72px, 0.9fr) minmax(42px, 0.48fr) minmax(44px, 0.42fr);
  }

  .finance-page .items-table th,
  .finance-page .items-table td,
  .finance-page .customers-table th,
  .finance-page .customers-table td {
    padding-inline: 6px;
  }
}

/* Mobile master-detail tables: fit the screen, tap a row for all details. */
@media (max-width: 759px) {
  .finance-page .items-table,
  .finance-page .customers-table {
    table-layout: fixed;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
  }

  .finance-page .items-table {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.66fr) minmax(0, 0.9fr);
  }

  .finance-page .customers-table {
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 0.95fr) minmax(0, 1.18fr);
  }

  .finance-page .items-table th:nth-child(4),
  .finance-page .items-table td:nth-child(4),
  .finance-page .items-table th:nth-child(5),
  .finance-page .items-table td:nth-child(5),
  .finance-page .customers-table th:nth-child(3),
  .finance-page .customers-table td:nth-child(3),
  .finance-page .customers-table th:nth-child(5),
  .finance-page .customers-table td:nth-child(5),
  .finance-page .customers-table th:nth-child(6),
  .finance-page .customers-table td:nth-child(6) {
    display: none !important;
  }

  .finance-page .items-table th,
  .finance-page .items-table td,
  .finance-page .customers-table th,
  .finance-page .customers-table td {
    min-width: 0;
    padding: 9px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .finance-page .items-table th,
  .finance-page .customers-table th {
    min-height: 36px;
    border-bottom-color: rgba(148, 163, 184, 0.22);
  }

  .finance-page .items-table td,
  .finance-page .customers-table td {
    min-height: 46px;
  }

  .finance-page .items-table tr,
  .finance-page .customers-table tr {
    cursor: pointer;
  }

  .finance-page .items-table tr:focus-visible td,
  .finance-page .customers-table tr:focus-visible td,
  .finance-page .items-table tr:hover td,
  .finance-page .customers-table tr:hover td {
    background: rgba(219, 234, 254, 0.44);
  }

  .finance-page .items-table tr:focus-visible td:first-child,
  .finance-page .customers-table tr:focus-visible td:first-child {
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.72);
  }

  .finance-page .data-detail-dialog {
    width: min(100vw - 18px, 620px);
  }

  .finance-page .data-detail-box {
    gap: 14px;
  }

  .finance-page .data-detail-list {
    display: grid;
    gap: 8px;
    margin: 0;
  }

  .finance-page .data-detail-list > div {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px 12px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.78);
  }

  .finance-page .data-detail-list dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .finance-page .data-detail-list dd {
    margin: 0;
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  .finance-page .data-detail-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 380px) {
  .finance-page .items-table,
  .finance-page .customers-table {
    font-size: 0.72rem;
  }

  .finance-page .items-table th,
  .finance-page .items-table td,
  .finance-page .customers-table th,
  .finance-page .customers-table td {
    padding-inline: 6px;
  }
}

/* Finance mobile navigation: no horizontal scrolling, compact app-style popup. */
.finance-mobile-nav {
  display: none;
}

.finance-page .data-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.finance-page .data-detail-list > div {
  display: grid;
  grid-template-columns: minmax(104px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.78);
}

.finance-page .data-detail-list dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.finance-page .data-detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.finance-page .data-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.finance-page .data-detail-actions .inline-form,
.finance-page .data-detail-actions button,
.finance-page .data-detail-actions .button-link,
.finance-page .data-detail-actions .button-secondary {
  width: fit-content !important;
  max-width: 100%;
}

@media (max-width: 759px) {
  .finance-page .finance-mobile-nav {
    position: sticky;
    top: 10px;
    z-index: 95;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 10px 0 14px;
  }

  .finance-page .finance-mobile-nav-button {
    display: inline-flex;
    width: auto !important;
    max-width: calc(100vw - 28px);
    min-height: 44px;
    gap: 9px;
    align-items: center;
    justify-content: flex-start;
    padding: 9px 14px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    color: #162033;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(18px);
    line-height: 1;
  }

  .finance-page .finance-mobile-nav-button span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .finance-page .finance-mobile-nav-button strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .finance-page .finance-mobile-nav-button::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
  }

  .finance-page .finance-mobile-nav.open .finance-mobile-nav-button::after {
    transform: translateY(2px) rotate(225deg);
  }

  .finance-page .finance-mobile-nav-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    width: min(calc(100vw - 28px), 320px);
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 64px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(20px);
  }

  .finance-page .finance-mobile-nav-panel[hidden] {
    display: none !important;
  }

  .finance-page .finance-mobile-nav-panel a {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #334155;
    font-weight: 900;
    text-decoration: none;
  }

  .finance-page .finance-mobile-nav-panel a:hover,
  .finance-page .finance-mobile-nav-panel a.active {
    border-color: rgba(37, 99, 235, 0.24);
    color: var(--accent);
    background: rgba(219, 234, 254, 0.8);
  }

  .finance-page .finance-mobile-nav-panel a.active::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
  }

  .finance-page .finance-nav {
    display: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

@media (min-width: 760px) {
  .finance-mobile-nav {
    display: none !important;
  }
}

/* Match facturen, offertes and kosten to the compact mobile spreadsheet list pattern. */
@media (max-width: 759px) {
  .finance-page .documents-table,
  .finance-page .expenses-table {
    display: grid;
    width: 100%;
    min-width: 0 !important;
    overflow: hidden;
    table-layout: fixed;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
    font-size: clamp(0.74rem, 2.8vw, 0.88rem);
  }

  .finance-page .documents-table {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.15fr) minmax(0, 0.86fr);
  }

  .finance-page .expenses-table {
    grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.16fr) minmax(0, 0.9fr);
  }

  .finance-page .documents-table thead,
  .finance-page .documents-table tbody,
  .finance-page .documents-table tr,
  .finance-page .expenses-table thead,
  .finance-page .expenses-table tbody,
  .finance-page .expenses-table tr {
    display: contents;
  }

  .finance-page .documents-table th,
  .finance-page .documents-table td,
  .finance-page .expenses-table th,
  .finance-page .expenses-table td {
    display: flex;
    min-width: 0;
    min-height: 46px;
    align-items: center;
    padding: 9px 8px;
    border: 0;
    border-right: 1px solid rgba(226, 232, 240, 0.86);
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
    color: #162033;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .finance-page .documents-table th,
  .finance-page .expenses-table th {
    min-height: 36px;
    color: #475569;
    background: rgba(248, 250, 252, 0.94);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .finance-page .documents-table td::before,
  .finance-page .expenses-table td::before {
    display: none !important;
  }

  .finance-page .documents-table tbody tr:nth-child(even) td,
  .finance-page .expenses-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.58);
  }

  .finance-page .documents-table th:nth-child(3),
  .finance-page .documents-table td:nth-child(3),
  .finance-page .documents-table th:nth-child(4),
  .finance-page .documents-table td:nth-child(4),
  .finance-page .documents-table th:nth-child(6),
  .finance-page .documents-table td:nth-child(6),
  .finance-page .expenses-table th:nth-child(3),
  .finance-page .expenses-table td:nth-child(3),
  .finance-page .expenses-table th:nth-child(5),
  .finance-page .expenses-table td:nth-child(5),
  .finance-page .expenses-table th:nth-child(6),
  .finance-page .expenses-table td:nth-child(6),
  .finance-page .expenses-table th:nth-child(7),
  .finance-page .expenses-table td:nth-child(7),
  .finance-page .expenses-table th:nth-child(8),
  .finance-page .expenses-table td:nth-child(8) {
    display: none !important;
  }

  .finance-page .documents-table th:nth-child(5),
  .finance-page .documents-table td:nth-child(5),
  .finance-page .expenses-table th:nth-child(4),
  .finance-page .expenses-table td:nth-child(4) {
    border-right: 0;
  }

  .finance-page .documents-table tbody tr:last-child td,
  .finance-page .expenses-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .finance-page .documents-table tr,
  .finance-page .expenses-table tr {
    cursor: pointer;
  }

  .finance-page .documents-table tr:focus-visible td,
  .finance-page .expenses-table tr:focus-visible td,
  .finance-page .documents-table tr:hover td,
  .finance-page .expenses-table tr:hover td {
    background: rgba(219, 234, 254, 0.44);
  }

  .finance-page .documents-table tr:focus-visible td:first-child,
  .finance-page .expenses-table tr:focus-visible td:first-child {
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.72);
  }
}

@media (max-width: 380px) {
  .finance-page .documents-table,
  .finance-page .expenses-table {
    font-size: 0.72rem;
  }

  .finance-page .documents-table th,
  .finance-page .documents-table td,
  .finance-page .expenses-table th,
  .finance-page .expenses-table td {
    padding-inline: 6px;
  }
}

/* Mobile finance headers: title left, primary create action right. */
@media (max-width: 759px) {
  .finance-page .dashboard-head.action-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px;
    align-items: center !important;
  }

  .finance-page .dashboard-head.action-head > div {
    min-width: 0;
  }

  .finance-page .dashboard-head.action-head h1 {
    font-size: clamp(1.9rem, 8.4vw, 2.75rem);
    line-height: 0.98;
    overflow-wrap: normal;
  }

  .finance-page .dashboard-head.action-head > .header-action-button,
  .finance-page .dashboard-head.action-head > .button-link {
    justify-self: end;
    align-self: center;
    width: fit-content !important;
    max-width: min(46vw, 168px);
    min-height: 42px;
    margin: 0 !important;
    padding: 8px 13px;
    border-radius: 999px;
    line-height: 1.08;
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .finance-page .dashboard-head.action-head {
    gap: 8px;
  }

  .finance-page .dashboard-head.action-head h1 {
    font-size: clamp(1.72rem, 8vw, 2.25rem);
  }

  .finance-page .dashboard-head.action-head > .header-action-button,
  .finance-page .dashboard-head.action-head > .button-link {
    max-width: 48vw;
    min-height: 40px;
    padding-inline: 10px;
    font-size: 0.86rem;
  }
}

/* Social Approval: scalable planning, archive, reports and settings. */
.social-range-label { margin: 6px 0 0; color: var(--muted); font-size: 0.82rem; font-weight: 750; }
.social-range-tools { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.social-segmented { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 12px; background: #f8fafc; }
.social-segmented a { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-size: 0.78rem; font-weight: 850; text-decoration: none; }
.social-segmented a.active { color: #fff; background: var(--accent); box-shadow: 0 5px 14px rgba(30, 64, 175, 0.2); }
.social-date-nav { display: inline-flex; gap: 5px; align-items: center; }
.social-date-nav a { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(148, 163, 184, 0.32); border-radius: 10px; color: var(--accent-dark); background: #fff; font-weight: 900; text-decoration: none; }
.social-date-nav input { width: 145px; min-height: 38px; padding: 6px 8px; }
.social-filter-strip { padding: 14px 20px; border-bottom: 1px solid rgba(148, 163, 184, 0.24); background: rgba(248, 250, 252, 0.72); }
.social-filter-strip .social-filter-row { margin-left: 0; }
.social-search-field { min-width: min(280px, 100%) !important; flex: 1; }
.social-filter-row input[type="search"] { min-height: 42px; padding: 8px 12px; }
.social-client-list article > form { margin: 0; }
.social-client-list article > form button { width: auto; min-height: 36px; padding: 7px 11px; }
.social-danger-button { border: 1px solid #fecaca; color: #9f1d1d; background: #fff7f7; box-shadow: none; }
.social-danger-button:hover { color: #fff; background: #b91c1c; }
.social-safe-delete-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(148, 163, 184, 0.24); }
.social-archive-panel { margin-top: 18px; }
.social-client-avatar.muted { filter: grayscale(0.8); opacity: 0.62; }
.social-approval-filters { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid rgba(148, 163, 184, 0.24); }
.social-approval-list { display: grid; }
.social-approval-list > a { display: flex; gap: 12px; align-items: center; padding: 15px 4px; border-bottom: 1px solid rgba(148, 163, 184, 0.24); color: var(--ink); text-decoration: none; }
.social-approval-list > a:hover strong { color: var(--accent); }
.social-approval-list > a:last-child { border-bottom: 0; }
.social-approval-list > a > span:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 3px; }
.social-approval-list small, .social-approval-list em { overflow: hidden; color: var(--muted); font-size: 0.78rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.social-report-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.social-report-table-wrap { overflow-x: auto; }
.social-report-table { width: 100%; border-collapse: collapse; }
.social-report-table th, .social-report-table td { padding: 13px 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.24); text-align: left; }
.social-report-table thead th { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; }
.social-report-table tbody th { color: var(--ink); }
.social-report-table tbody th small { color: var(--muted); font-weight: 650; }
.social-settings-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.social-input-suffix { display: flex; align-items: center; }
.social-input-suffix input { border-radius: 12px 0 0 12px; }
.social-input-suffix span { align-self: stretch; display: grid; place-items: center; padding: 0 13px; border: 1px solid rgba(148, 163, 184, 0.42); border-left: 0; border-radius: 0 12px 12px 0; color: var(--muted); background: #f8fafc; font-size: .82rem; font-weight: 800; }
.social-mail-health { border-top: 4px solid #f59e0b; }
.social-mail-health.is-ready { border-top-color: #10b981; }
.social-health-badge { padding: 6px 9px; border-radius: 999px; color: #92400e; background: #fff7dd; font-size: .7rem; font-weight: 900; }
.social-mail-health.is-ready .social-health-badge { color: #0b6148; background: #ecfbf5; }
.social-mail-health dl { display: grid; gap: 0; margin: 18px 0; }
.social-mail-health dl > div { display: grid; grid-template-columns: minmax(130px, .7fr) 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.24); }
.social-mail-health dt { color: var(--muted); font-size: .8rem; font-weight: 800; }
.social-mail-health dd { margin: 0; color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .social-range-tools { width: 100%; justify-content: space-between; margin-left: 0; }
  .social-filter-strip .social-filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .social-search-field { grid-column: 1 / -1; }
  .social-report-metrics { grid-template-columns: 1fr 1fr; }
  .social-settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .social-range-tools { align-items: stretch; flex-direction: column; }
  .social-segmented { width: 100%; }
  .social-segmented a { flex: 1; text-align: center; }
  .social-date-nav input { width: auto; flex: 1; }
  .social-filter-strip .social-filter-row { grid-template-columns: 1fr; }
  .social-filter-strip .social-filter-row > * { grid-column: 1; }
  .social-client-list article { align-items: start; flex-wrap: wrap; }
  .social-client-list article > form { width: 100%; padding-left: 54px; }
  .social-client-list article > form button { width: 100%; }
  .social-approval-list > a { align-items: start; flex-wrap: wrap; }
  .social-approval-list .social-status { margin-left: 24px; }
  .social-report-metrics { grid-template-columns: 1fr; }
}

/* Social Approval calendar dashboard. */
.social-calendar-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.social-calendar-metrics > div {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 132px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  background: #fff;
}

.social-calendar-metrics > div::after {
  position: absolute;
  right: -25px;
  bottom: -36px;
  z-index: -1;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #eaf2ff;
  content: "";
}

.social-calendar-metrics .metric-review::after { background: #fff6d9; }
.social-calendar-metrics .metric-approved::after { background: #e2f8ef; }
.social-calendar-metrics .metric-feedback::after { background: #ffe9ec; }
.social-calendar-metrics .metric-label { max-width: calc(100% - 48px); }
.social-calendar-metrics strong { font-size: 1.9rem; }
.social-calendar-metrics small { max-width: calc(100% - 20px); }

.social-metric-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: #2563eb;
  background: #eaf2ff;
}

.social-metric-icon svg,
.social-square-control svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-review .social-metric-icon { color: #d97706; background: #fff7df; }
.metric-approved .social-metric-icon { color: #059669; background: #e8faf3; }
.metric-feedback .social-metric-icon { color: #e11d48; background: #fff0f3; }

.social-calendar-shell { padding: 0; overflow: hidden; }
.social-calendar-toolbar {
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255, 255, 255, .94);
}

.social-period-switcher,
.social-calendar-modes,
.social-calendar-filters { display: flex; gap: 8px; align-items: center; }
.social-period-switcher { min-width: 255px; justify-content: space-between; }
.social-period-switcher strong { color: var(--ink); font-size: .92rem; white-space: nowrap; }

.social-square-control {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 11px;
  color: var(--accent-dark);
  background: #fff;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.social-square-control:hover { border-color: rgba(37, 99, 235, .5); background: #eff6ff; }

.social-calendar-filters { justify-content: center; }
.social-calendar-filters label { min-width: 0; flex: 1; }
.social-calendar-filters input,
.social-calendar-filters select { width: 100%; min-height: 42px; padding: 8px 11px; }
.social-calendar-filters label:first-of-type { flex: 1.2; }
.social-calendar-filters button { width: auto; min-height: 42px; padding-inline: 13px; }
.social-calendar-modes { justify-content: flex-end; }
.social-calendar-modes .social-segmented a { min-width: 54px; }

.social-week-calendar {
  display: grid;
  grid-template-columns: repeat(var(--calendar-columns), minmax(176px, 1fr));
  width: 100%;
  overflow-x: auto;
  background: #f8fafc;
}

.social-calendar-day {
  min-width: 0;
  border-right: 1px solid rgba(148, 163, 184, .26);
  background: rgba(255, 255, 255, .48);
}
.social-calendar-day:last-child { border-right: 0; }
.social-calendar-day > header {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .26);
  background: rgba(255, 255, 255, .9);
}
.social-calendar-day > header time {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--ink);
  background: #eef2f7;
  font-weight: 900;
}
.social-calendar-day.is-today > header time { color: #fff; background: var(--accent); }
.social-calendar-day > header span { display: grid; min-width: 0; gap: 2px; }
.social-calendar-day > header strong { overflow: hidden; color: var(--ink); font-size: .82rem; text-overflow: ellipsis; }
.social-calendar-day > header small { color: var(--muted); font-size: .7rem; }
.social-day-content { display: grid; gap: 10px; align-content: start; min-height: 420px; padding: 10px; }

.social-calendar-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .07);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.social-calendar-card:hover { border-color: rgba(37, 99, 235, .42); box-shadow: 0 14px 28px rgba(30, 64, 175, .13); transform: translateY(-2px); }
.social-calendar-card-media {
  position: relative;
  display: grid;
  height: 108px;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(140deg, color-mix(in srgb, var(--client-color) 24%, white), color-mix(in srgb, var(--client-color) 52%, #dbeafe));
}
.social-calendar-card-media::after {
  position: absolute;
  right: -18px;
  top: -20px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  content: "";
}
.social-calendar-card-media img { width: 100%; height: 100%; object-fit: cover; }
.social-calendar-card-media .social-platform-stack { z-index: 2; }
.social-calendar-initials { color: color-mix(in srgb, var(--client-color) 72%, #0f172a); font-size: 1.55rem; font-weight: 950; letter-spacing: .1em; }
.social-calendar-card-body { display: grid; gap: 6px; padding: 11px; }
.social-calendar-card-body > small { overflow: hidden; color: var(--blue); font-size: .66rem; font-weight: 900; letter-spacing: .035em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.social-calendar-card-body > strong { min-height: 2.65em; font-size: .86rem; line-height: 1.32; }
.social-calendar-card-body > div { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.social-calendar-card-body time { color: var(--muted); font-size: .72rem; font-weight: 800; }
.social-calendar-card-body .social-status { max-width: 108px; padding: 4px 7px; overflow: hidden; font-size: .59rem; text-overflow: ellipsis; }

.social-add-day {
  display: flex;
  gap: 7px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border: 1px dashed rgba(100, 116, 139, .38);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .52);
  font-size: .75rem;
  font-weight: 850;
  text-decoration: none;
}
.social-add-day:hover { border-color: rgba(37, 99, 235, .55); color: var(--accent-dark); background: #eff6ff; }
.social-add-day span { font-size: 1.15rem; font-weight: 500; }

@media (max-width: 1450px) {
  .social-calendar-toolbar { grid-template-columns: 1fr auto; }
  .social-calendar-filters { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; }
}

@media (max-width: 900px) {
  .social-calendar-toolbar { grid-template-columns: 1fr; }
  .social-period-switcher { min-width: 0; }
  .social-calendar-filters { grid-column: 1; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; }
  .social-calendar-filters label:first-of-type { grid-column: 1 / -1; }
  .social-calendar-filters button { grid-column: 1 / -1; width: 100%; }
  .social-calendar-modes { justify-content: space-between; }
  .social-calendar-modes .social-segmented { width: auto; }
}

@media (max-width: 430px) {
  .social-calendar-modes { align-items: stretch; flex-direction: column; }
  .social-calendar-modes .social-segmented { width: 100%; }
  .social-calendar-filters { grid-template-columns: 1fr; }
  .social-calendar-filters label,
  .social-calendar-filters label:first-of-type,
  .social-calendar-filters button { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .social-calendar-card,
  .social-square-control { transition: none; }
  .social-calendar-card:hover { transform: none; }
}

/* Clarivo unified theme
   Visuele laag voor tools.clarivodigital.nl. Functionele layouts en statuskleuren
   blijven intact; merktypografie, oppervlakken en interactiestaten sluiten aan op
   de hoofdwebsite. */
:root {
  --bg: #f5f2ea;
  --panel: #ffffff;
  --panel-soft: #f8f7f2;
  --text: #0c2229;
  --muted: #52676c;
  --border: #d4e0e2;
  --accent: #0d5965;
  --accent-dark: #0c4650;
  --accent-soft: #e8eff0;
  --blue: #0d5965;
  --amber: #0d5965;
  --violet: #356d76;
  --ink: #0c2229;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --shadow-soft: 0 18px 48px rgba(12, 34, 41, 0.08);
  --focus: #0d5965;
  --scrollbar-track: rgba(212, 224, 226, 0.5);
  --scrollbar-thumb: rgba(13, 89, 101, 0.38);
  --scrollbar-thumb-hover: rgba(13, 89, 101, 0.68);
}

html {
  accent-color: var(--accent);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(212, 224, 226, 0.62), transparent 32rem),
    linear-gradient(145deg, #f5f2ea 0%, #fbfaf6 50%, #edf3f3 100%);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  background-image:
    linear-gradient(rgba(13, 89, 101, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 89, 101, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}

h1,
h2,
h3,
.metric-value,
.metric-grid strong,
.tool-card strong,
.preview-card strong,
.import-sample-card h3 {
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 600;
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 600;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-family: "Manrope", sans-serif;
  letter-spacing: 0.13em;
}

.panel,
.visual,
.auth-panel,
.tool-card,
.metric-strip > div,
.metric-grid > div,
.document-preview,
.feed-sidebar,
.status-tile,
.field-chip,
.quiet-panel,
.preview-card,
.import-sample-card,
.feed-modal {
  border-color: rgba(12, 34, 41, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.panel,
.auth-panel,
.tool-card,
.metric-strip > div,
.metric-grid > div,
.status-tile,
.preview-card,
.import-sample-card,
.feed-modal {
  border-radius: 8px;
}

.topbar {
  border-color: rgba(12, 34, 41, 0.12);
  border-radius: 8px;
  background: rgba(245, 242, 234, 0.94);
  box-shadow: 0 14px 38px rgba(12, 34, 41, 0.08);
  backdrop-filter: blur(16px) saturate(125%);
}

.brand-link {
  gap: 10px;
  color: var(--ink);
}

.brand-mark.brand-mark-logo {
  display: block;
  width: 132px;
  height: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-mark-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-copy {
  padding-left: 10px;
  border-left: 1px solid rgba(12, 34, 41, 0.18);
}

.brand-copy strong {
  color: var(--accent);
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy small {
  font-size: 0.7rem;
  font-weight: 600;
}

.tool-link,
.account-link {
  min-height: 44px;
  border-radius: 6px;
  color: #294249;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.tool-link:hover,
.tool-link.active,
.account-link:hover,
.account-link.active {
  color: var(--accent);
  border-color: rgba(13, 89, 101, 0.2);
  background: rgba(212, 224, 226, 0.55);
  box-shadow: none;
}

.website-link {
  border-color: rgba(13, 89, 101, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent);
}

.user-avatar {
  border-radius: 6px;
  background: var(--accent);
  box-shadow: none;
}

button:not(.icon-button):not(.feed-choice-tile),
.button-link,
.button-secondary,
.feed-new-project,
.feed-remove {
  min-height: 44px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: none;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

button:not(.icon-button):not(.feed-choice-tile):hover,
.button-link:hover,
.feed-new-project:hover,
.feed-remove:hover {
  color: #ffffff;
  background: var(--accent-dark);
  box-shadow: none;
  transform: none;
}

.button-link.secondary,
.button-secondary {
  color: var(--accent);
  border-color: rgba(13, 89, 101, 0.24);
  background: #ffffff;
}

.button-link.secondary:hover,
.button-secondary:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  border-color: rgba(13, 89, 101, 0.24);
  border-radius: 6px;
  color: var(--accent);
  background: #ffffff;
  box-shadow: none;
}

input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="color"],
select,
textarea {
  min-height: 44px;
  border-color: rgba(12, 34, 41, 0.2);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 89, 101, 0.16);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13, 89, 101, 0.35);
  outline-offset: 3px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tool-card::after {
  inset: 0 auto 0 0;
  width: 3px;
  height: auto;
  border-radius: 0;
  background: var(--accent);
}

.tool-card:hover {
  border-color: rgba(13, 89, 101, 0.34);
  box-shadow: 0 22px 48px rgba(12, 34, 41, 0.1);
  transform: translateY(-2px);
}

.tool-icon {
  border-radius: 6px;
  color: var(--accent);
  background: rgba(212, 224, 226, 0.58);
}

.choice,
.upload-card,
.feed-rule-row,
.output-box,
.modal-metrics > div,
.feed-log-list li {
  border-color: rgba(12, 34, 41, 0.14);
  border-radius: 6px;
  background: #fbfaf6;
}

.finance-nav a.active,
.finance-mobile-nav a.active {
  color: #ffffff;
  background: var(--accent);
}

table {
  border-color: rgba(12, 34, 41, 0.12);
}

th {
  color: #355159;
  background: #edf3f3;
}

.auth-screen {
  background:
    linear-gradient(90deg, rgba(245, 242, 234, 0.98), rgba(245, 242, 234, 0.78)),
    radial-gradient(circle at 85% 15%, rgba(13, 89, 101, 0.22), transparent 30rem);
}

.auth-panel {
  border-color: rgba(12, 34, 41, 0.14);
  background: rgba(255, 255, 255, 0.97);
}

.auth-brand {
  display: grid;
  gap: 12px;
  justify-items: start;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-brand img {
  width: min(230px, 100%);
  height: auto;
}

.auth-footer {
  display: flex;
  gap: 12px 20px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.auth-footer .text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 759px) {
  .brand-mark.brand-mark-logo {
    width: 118px;
  }

  .brand-copy small {
    display: none;
  }

  .dashboard-homebar .account-dock {
    width: 100%;
  }

  .dashboard-homebar .account-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .dashboard-homebar .account-link {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .brand-mark.brand-mark-logo {
    width: 104px;
  }

  .brand-copy {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card:hover {
    transform: none;
  }
}
