:root {
  color-scheme: light;
  --ink: #152b30;
  --muted: #617277;
  --line: #dce6e2;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --navy: #102d34;
  --navy-soft: #173d45;
  --teal: #16846d;
  --teal-light: #dff4ed;
  --amber: #d68b21;
  --amber-light: #fff1d9;
  --coral: #c95d52;
  --coral-light: #fde8e5;
  --blue: #3876b8;
  --blue-light: #e6f0fb;
  --shadow: 0 18px 55px rgba(16, 45, 52, .12);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: inherit; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(22, 132, 109, .34);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.brand strong { color: #62d3ad; }
.brand-light { color: #fff; }
.brand-dark { color: var(--navy); }

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(98, 211, 173, .45);
  border-radius: 11px;
  color: #62d3ad;
  background: rgba(98, 211, 173, .1);
  font-weight: 850;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.eyebrow-light { color: #8ee3c7; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, .9fr) minmax(500px, 1.1fr);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 5vw, 72px);
  color: #fff;
  background:
    radial-gradient(circle at 14% 88%, rgba(98, 211, 173, .18), transparent 26%),
    radial-gradient(circle at 90% 15%, rgba(242, 183, 98, .12), transparent 25%),
    linear-gradient(145deg, #0d252b 0%, #143b43 100%);
}

.auth-story::after {
  position: absolute;
  right: -130px;
  bottom: 90px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 70px rgba(255, 255, 255, .025), 0 0 0 140px rgba(255, 255, 255, .015);
}

.auth-story-copy, .trust-note, .auth-story .brand { position: relative; z-index: 1; }

.auth-story-copy { max-width: 580px; }

.auth-story h1 {
  max-width: 680px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 4.2vw, 68px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.04em;
}

.auth-story-copy p {
  max-width: 540px;
  margin: 24px 0 0;
  color: #c5d6d6;
  font-size: 18px;
}

.story-link {
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 11px;
  padding: 12px 16px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
  font-size: 14px;
  font-weight: 800;
}

.story-link:hover { background: rgba(255, 255, 255, .13); }

.trust-note {
  display: flex;
  max-width: 510px;
  align-items: center;
  gap: 14px;
  color: #d7e4e3;
}

.trust-note p { margin: 0; font-size: 14px; }

.trust-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: #62d3ad;
  font-weight: 900;
}

.auth-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 42px 24px;
  background: #fbfcfb;
}

.auth-card { width: min(100%, 430px); }
.auth-mobile-brand { display: none; margin-bottom: 44px; }

.auth-switch-copy { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 14px; }
.inline-text-button { border: 0; padding: 0; color: var(--teal); background: transparent; font: inherit; font-weight: 850; cursor: pointer; }
.inline-text-button:hover { text-decoration: underline; }
.social-login { display: grid; justify-items: center; gap: 10px; margin-top: 22px; }
.social-auth-buttons { display: grid; width: min(100%, 240px); justify-items: stretch; gap: 9px; }
.social-login button { justify-content: center; }
.social-login button span { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 750; }
.google-login-button, .social-auth-control { width: 100%; height: 40px; min-height: 40px; }
.google-login-button {
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.google-login-button > div,
.google-login-button > div > div { width: 100% !important; height: 100% !important; }
.google-login-button [role="button"] {
  box-sizing: border-box;
  display: flex !important;
  width: 100% !important;
  height: 40px !important;
  min-width: 0 !important;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfd2cc;
  border-radius: 8px;
  color: var(--navy);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.google-login-button [role="button"] > div:last-child {
  display: flex !important;
  height: 100% !important;
  align-items: center;
  justify-content: center;
}
.google-login-button [role="button"] div:has(> svg) {
  width: 18px !important;
  height: 18px !important;
  margin-right: 8px;
  flex: 0 0 18px;
}
.google-login-button [role="button"] svg { display: block !important; width: 18px !important; height: 18px !important; }
.google-login-button [role="button"] .L6cTce {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
.social-login .social-auth-control { height: 40px; min-height: 40px; border-radius: 8px; padding: 7px 14px; }
.social-login-help { width: min(100%, 320px); margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.quick-access-options { display: grid; gap: 9px; margin-top: 18px; padding: 16px; border: 1px solid #cfe5df; border-radius: 13px; background: #f4faf7; }
.quick-access-options p { margin: 0 0 2px; color: var(--navy); font-size: 12px; font-weight: 800; text-align: center; }
.quick-access-state { margin: 14px 0 4px; border-radius: 10px; padding: 10px 12px; color: #365c54; background: #eef7f4; font-size: 12px; line-height: 1.45; }
.danger-text-button { width: 100%; margin-top: 14px; border: 0; padding: 10px; color: #a13b31; background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.danger-text-button:hover { text-decoration: underline; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; }
.check-row a { color: var(--teal); font-weight: 750; }
.advanced-access { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 15px; color: var(--muted); font-size: 13px; }
.advanced-access summary { color: #486064; font-weight: 800; cursor: pointer; }
.advanced-access p { margin: 10px 0 0; line-height: 1.5; }
.advanced-access .standalone-link { margin-top: 12px; }

.auth-card h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 550;
  letter-spacing: -.035em;
}

.form-intro { margin: 11px 0 30px; color: var(--muted); }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

label {
  display: block;
  margin: 19px 0 8px;
  color: #30464b;
  font-size: 14px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.label-row label { margin-bottom: 8px; }

input, select, textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid #ccd9d5;
  border-radius: 11px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}

textarea { resize: vertical; }
select { appearance: auto; }

input::placeholder { color: #99a7a8; }
input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 4px rgba(22, 132, 109, .09); }

.password-field { position: relative; }
.password-field input { padding-right: 76px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  border: 0;
  padding: 7px;
  color: var(--teal);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.text-button, .back-button {
  border: 0;
  padding: 0;
  color: var(--teal);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}

.back-button { margin-bottom: 28px; }
.standalone-link { display: block; margin: 18px auto 0; }
.install-app-button { margin-top: 10px; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 15px; margin-top: 16px; font-size: 12px; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--teal); }

.security-warning, .replace-warning {
  margin: 18px 0 4px;
  border: 1px solid #d8e6e1;
  border-radius: 11px;
  padding: 12px 14px;
  color: #4b6063;
  background: #f3f9f6;
  font-size: 13px;
  line-height: 1.5;
}

.replace-warning { border-color: #eadfbd; background: #fffaf0; }

.primary-button, .secondary-button {
  min-height: 51px;
  border-radius: 11px;
  padding: 12px 18px;
  font-weight: 800;
  transition: transform .14s, box-shadow .14s, background .14s;
}

.primary-button {
  border: 1px solid var(--navy);
  color: #fff;
  background: var(--navy);
  box-shadow: 0 10px 22px rgba(16, 45, 52, .16);
}

.primary-button:hover { background: var(--navy-soft); transform: translateY(-1px); }

.secondary-button {
  border: 1px solid #bfd2cc;
  color: var(--navy);
  background: #fff;
}

.secondary-button:hover { border-color: var(--teal); background: #f5fbf8; }
.full-button { width: 100%; }
button:disabled { cursor: wait; opacity: .65; }

.form-message { min-height: 24px; margin: 11px 0 8px; color: #a3463e; font-size: 14px; }
.form-message.success { color: #13715e; }

.demo-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 18px;
  color: #899697;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.demo-divider::before, .demo-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.privacy-copy { margin: 13px auto 0; color: #7b898b; font-size: 12px; text-align: center; }

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: #d4e0df;
  background: var(--navy);
}

.sidebar-brand { margin: 0 10px 42px; }

.main-nav { display: grid; gap: 7px; }

.nav-item {
  display: grid;
  min-height: 46px;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #b9cbca;
  background: transparent;
  text-align: left;
}

.nav-item > span { color: #7ca39f; font-size: 21px; text-align: center; }
.nav-item small { color: #6d8b89; font-size: 10px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(98, 211, 173, .12); font-weight: 750; }
.nav-item.active > span { color: #62d3ad; }

.sidebar-foot { display: grid; margin-top: auto; gap: 10px; }

.account-button {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 18px 6px 6px;
  color: #fff;
  background: transparent;
  text-align: left;
}

.account-button span:last-child { display: grid; overflow: hidden; }
.account-button strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-button small { color: #8fa8a6; font-size: 11px; }

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(98, 211, 173, .35);
  border-radius: 50%;
  color: #b8f0dc;
  background: rgba(98, 211, 173, .13);
  font-size: 12px;
  font-weight: 850;
}

.backup-button, .logout-button {
  border: 0;
  padding: 9px 6px;
  color: #8fa8a6;
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.backup-button { color: #a9d6c8; }
.backup-button:hover, .logout-button:hover { color: #fff; }
.security-settings-list { display: grid; gap: 10px; margin-top: 20px; }
.security-settings-list > button { display: grid; gap: 4px; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; color: var(--navy); background: #fff; text-align: left; cursor: pointer; }
.security-settings-list > button:hover { border-color: #9ecdc0; background: #f4faf7; }
.security-settings-list strong { font-size: 14px; }
.security-settings-list span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.session-list { display: grid; gap: 10px; margin-top: 18px; }
.session-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; background: #fff; }
.session-card strong, .session-card span, .session-card small { display: block; }
.session-card strong { color: var(--navy); font-size: 14px; }
.session-card span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.session-card small { margin-top: 5px; color: #648079; font-size: 11px; }
.session-current { display: inline-flex; width: fit-content; margin-bottom: 5px; border-radius: 999px; padding: 4px 7px; color: #0d694d; background: #e4f5ed; font-size: 10px; font-weight: 800; }
.session-revoke { border: 1px solid #e2b4ad; border-radius: 9px; padding: 8px 10px; color: #9f3328; background: #fff7f5; font-size: 12px; font-weight: 800; cursor: pointer; }
.session-revoke:hover { background: #fdeae6; }
.session-dialog-actions { margin-top: 18px; }
.session-dialog-actions .secondary-button { width: 100%; }
@media (max-width: 520px) { .session-card { grid-template-columns: 1fr; } .session-revoke { width: 100%; } }
.sidebar-legal { display: flex; flex-wrap: wrap; gap: 5px 10px; padding: 2px 6px; font-size: 10px; }
.sidebar-legal a { color: #7f9b99; }
.sidebar-legal a:hover { color: #fff; }

.app-workspace { min-width: 0; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 10px clamp(20px, 4vw, 56px);
  background: rgba(244, 247, 245, .92);
  backdrop-filter: blur(12px);
}

.workspace-label { margin: 0; color: #31494e; font-size: 14px; font-weight: 800; }
.mobile-wordmark, .mobile-avatar { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.environment-badge {
  border-radius: 999px;
  padding: 6px 10px;
  color: #7b4d10;
  background: var(--amber-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #3c555a;
  background: #fff;
  font-size: 20px;
}

.dashboard { width: min(1420px, 100%); margin: 0 auto; padding: 42px clamp(20px, 4vw, 56px) 64px; }

.welcome-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.welcome-row h1 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 550;
  letter-spacing: -.035em;
}

.welcome-row p { margin: 8px 0 0; color: var(--muted); }

.trial-card {
  display: grid;
  min-width: 210px;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #c8dfd8;
  border-radius: 13px;
  padding: 13px 15px;
  background: #edf8f4;
}

.trial-card > span { color: #527069; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.trial-card strong { grid-row: 2; color: #185f51; font-size: 15px; }
.trial-card button { grid-row: 1 / span 2; grid-column: 2; border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 750; }
.trial-card[data-license-state="grace"] { border-color: #e7c982; background: #fff8e8; }
.trial-card[data-license-state="read_only"],
.trial-card[data-license-state="revoked"],
.trial-card[data-license-state="security_lock"],
.trial-card[data-license-state="plan_required"] { border-color: #efb6aa; background: #fff3f0; }

.license-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #e7c982;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff8e8;
}
.license-banner[hidden] { display: none; }
.license-banner > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: #a96910; font-weight: 900; }
.license-banner strong { color: #6f4508; font-size: 14px; }
.license-banner p { margin: 3px 0 0; color: #765d35; font-size: 13px; }
.license-banner button { min-height: 40px; border: 1px solid #bd842f; border-radius: 10px; padding: 8px 13px; color: #6f4508; background: #fff; font-weight: 800; }

.onboarding-card { margin-top: 18px; border: 1px solid #bddbd1; border-radius: var(--radius); padding: 22px; background: linear-gradient(135deg, #f2fbf7, #fff); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.onboarding-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.onboarding-heading h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 27px; font-weight: 550; }
.onboarding-heading > span { color: #397164; font-size: 13px; font-weight: 800; }
.onboarding-steps { display: grid; gap: 10px; margin-top: 17px; }
.onboarding-steps article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fff; }
.onboarding-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 850; }
.onboarding-steps strong { color: var(--navy); font-size: 14px; }
.onboarding-steps p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.onboarding-steps button { min-height: 40px; white-space: nowrap; }
.onboarding-steps article[data-complete="true"] { background: #f4faf7; }
.onboarding-steps article[data-complete="true"] .onboarding-number { color: #fff; background: var(--teal); font-size: 0; }
.onboarding-steps article[data-complete="true"] .onboarding-number::after { content: "✓"; font-size: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(16, 45, 52, .035);
}

.metric-card::before { position: absolute; top: 0; left: 0; width: 100%; height: 4px; content: ""; }
.metric-card > span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { display: block; margin: 14px 0 4px; color: var(--navy); font-size: clamp(25px, 2.3vw, 34px); line-height: 1; letter-spacing: -.03em; }
.metric-card small { color: #7b898b; }

.insights-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.insights-panel[data-mode="locked"] { background: linear-gradient(135deg, var(--surface), var(--teal-light)); }
.insights-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.insights-header h2 { margin: 1px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 27px; font-weight: 550; }
.insights-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.insights-header .secondary-button { flex: 0 0 auto; }
.insight-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.insight-card { display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: start; border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: #f8faf9; }
.insight-card > span { display: grid; min-height: 34px; place-items: center; border-radius: 10px; color: var(--navy); background: #e6efec; font-size: 12px; font-weight: 900; }
.insight-card strong { color: var(--navy); font-size: 14px; }
.insight-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.insight-urgent > span { color: #8d3523; background: #ffe5dd; }
.insight-attention > span { color: #805b13; background: var(--amber-light); }
.insight-planning > span { color: #14636d; background: #e2f5f6; }
.insight-information > span, .insight-locked > span { color: var(--teal); background: var(--teal-light); }
.insight-positive > span { color: #27624f; background: #e4f5ee; }
.insights-disclaimer { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.accent-teal::before { background: var(--teal); }
.accent-amber::before { background: var(--amber); }
.accent-coral::before { background: var(--coral); }
.accent-blue::before { background: var(--blue); }

.explain-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid #c8e7dd;
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #eaf8f3, #f6fbf9);
}

.explain-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-family: Georgia, serif; font-weight: 900; }
.explain-banner strong { color: #16584c; font-size: 14px; }
.explain-banner p { margin: 2px 0 0; color: #527069; font-size: 13px; }

.local-first-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  border: 1px solid #d8e0ec;
  border-radius: 14px;
  padding: 14px 18px;
  background: #f5f8fc;
}
.local-first-note > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: #315d87; font-weight: 900; }
.local-first-note strong { color: #234b70; font-size: 14px; }
.local-first-note p { margin: 2px 0 0; color: #586d82; font-size: 13px; }

.platform-access-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  border: 1px solid #c4ddd5;
  border-radius: 14px;
  padding: 15px 18px;
  background: linear-gradient(105deg, #f0faf6, #fff);
}
.platform-access-card[data-mode="desktop_follow"] { border-color: #d9cfaa; background: linear-gradient(105deg, #fff9e9, #fff); }
.platform-access-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: var(--navy); font-size: 17px; }
.platform-access-copy { display: grid; gap: 2px; }
.platform-access-copy > span { color: #527069; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.platform-access-copy strong { color: var(--navy); font-size: 15px; }
.platform-access-copy p { margin: 0; color: #586d6a; font-size: 13px; }
.platform-access-card .secondary-button { min-height: 42px; white-space: nowrap; }

.sync-status-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 12px; border: 1px solid #c9d7e2; border-radius: 14px; padding: 15px 18px; background: #f7fafc; }
.sync-status-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: #315d78; font-size: 18px; }
.sync-status-card > div:nth-child(2) { display: grid; gap: 2px; }
.sync-status-card span { color: #526d80; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.sync-status-card strong { color: var(--navy); font-size: 15px; }
.sync-status-card p { margin: 0; color: #586d82; font-size: 13px; }
.sync-status-card .secondary-button { min-height: 42px; white-space: nowrap; }

.queue-panel {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.5vw, 28px);
  background: var(--surface);
  box-shadow: 0 5px 25px rgba(16, 45, 52, .04);
}

.panel-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.panel-header h2 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 550; letter-spacing: -.025em; }

.search-field {
  display: flex;
  width: min(290px, 100%);
  align-items: center;
  gap: 5px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding-left: 12px;
  color: #738284;
  background: #f9fbfa;
}

.search-field input { min-height: 42px; border: 0; padding: 8px 10px; background: transparent; box-shadow: none; }

.filter-row { display: flex; overflow-x: auto; gap: 8px; margin: 22px 0 14px; padding-bottom: 3px; scrollbar-width: thin; }

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  color: #53676b;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.filter-chip.active { border-color: var(--navy); color: #fff; background: var(--navy); }

.queue-list { display: grid; }

.queue-item {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(118px, .75fr) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #e8efec;
  padding: 17px 4px;
}

.queue-person { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; min-width: 0; }

.queue-rank { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; color: #1b6b5b; background: var(--teal-light); font-weight: 850; }
.queue-person-text { min-width: 0; }
.queue-person strong { display: block; overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.queue-person small, .queue-money small, .queue-reason small { display: block; color: #7a898b; font-size: 12px; }
.queue-money strong { color: #263d42; font-size: 15px; }

.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 800; }
.status-overdue_promise { color: #8e392f; background: var(--coral-light); }
.status-overdue { color: #9a5e0e; background: var(--amber-light); }
.status-due_today { color: #145e50; background: var(--teal-light); }
.status-upcoming { color: #295f96; background: var(--blue-light); }
.status-blocked { color: #687678; background: #edf0ef; }

.queue-reason strong { display: block; margin-top: 5px; color: #3c5054; font-size: 13px; font-weight: 650; }

.action-button {
  min-height: 40px;
  border: 1px solid #bcd2cc;
  border-radius: 9px;
  padding: 9px 13px;
  color: var(--teal);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.action-button:hover { border-color: var(--teal); background: #f3faf7; }
.empty-state { padding: 46px 12px 30px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; width: 48px; height: 48px; margin: 0 auto 12px; place-items: center; border-radius: 50%; color: var(--teal); background: var(--teal-light); font-weight: 900; }
.empty-state h3 { margin: 0; color: var(--navy); }
.empty-state p { margin: 5px 0 0; }

.mobile-nav { display: none; }

.clients-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.clients-heading h1 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 550; letter-spacing: -.035em; }
.clients-heading p { max-width: 650px; margin: 8px 0 0; color: var(--muted); }
.clients-heading .primary-button { flex: 0 0 auto; }
.clients-heading-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.client-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.client-summary-grid article { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); }
.client-summary-grid span { display: block; color: var(--muted); font-size: 13px; }
.client-summary-grid strong { display: block; margin-top: 5px; color: var(--navy); font-size: 29px; }
.clients-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.clients-toolbar { margin-bottom: 8px; }
.clients-toolbar h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.client-list { display: grid; }
.client-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(135px, .6fr) auto; gap: 16px; align-items: center; border-top: 1px solid var(--line); padding: 16px 4px; }
.client-row:first-child { border-top: 0; }
.client-identity { display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: center; min-width: 0; }
.client-initials { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--teal); background: var(--teal-light); font-weight: 850; }
.client-identity strong, .client-contact strong { display: block; overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.client-identity small, .client-contact small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.client-status { width: fit-content; border-radius: 999px; padding: 6px 10px; color: #356055; background: #e8f6f1; font-size: 12px; font-weight: 800; }
.client-status.status-paused { color: #815b18; background: var(--amber-light); }
.client-status.status-inactive { color: #687679; background: #edf1f0; }
.client-row .action-button { justify-self: end; }
.client-form { padding-top: 18px; }
.client-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.client-form label span { color: var(--muted); font-size: 12px; font-weight: 500; }
.client-privacy { margin: 16px 0 0; border-radius: 11px; padding: 12px 14px; color: #47615c; background: #eef5f2; font-size: 13px; line-height: 1.5; }
.import-dialog { width: min(900px, calc(100% - 28px)); }
.import-form { padding-top: 16px; }
.import-help { margin: -5px 0 14px; color: var(--muted); font-size: 13px; }
.import-form .section-title h3 { margin: 2px 0 12px; color: var(--navy); font-family: Georgia, serif; font-size: 23px; font-weight: 550; }
.import-mapping-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }
.import-mapping-grid label { margin-top: 0; }
.import-mapping-grid label strong { color: var(--teal); font-size: 11px; }
.import-mapping-grid select { margin-bottom: 0; }
.import-summary { display: flex; justify-content: space-between; gap: 16px; margin-top: 15px; border-radius: 12px; padding: 12px 14px; background: var(--teal-light); }
.import-summary strong { color: var(--navy); }
.import-summary span { color: var(--muted); font-size: 13px; }
.import-preview-wrap { margin-top: 12px; overflow-x: auto; }
.import-preview { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-preview th, .import-preview td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; }
.import-preview th { color: var(--muted); font-size: 12px; }
.import-preview td { color: var(--navy); }
.import-preview .import-ok { color: #27624f; font-weight: 800; }
.import-preview .import-error { color: #9b3f2c; }
.import-template-tools { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.2fr); gap: 4px 12px; margin-top: 14px; border: 1px solid #cde5dd; border-radius: 13px; padding: 13px 14px; background: #f5fbf8; }
.import-template-tools > label { margin: 0; }
.import-template-tools > select { margin: 0; }
.import-template-save { display: grid; grid-template-columns: auto minmax(180px, 1fr); grid-column: 1 / -1; gap: 10px; align-items: center; }
.import-template-save label { display: flex; gap: 7px; align-items: center; margin: 0; color: var(--navy); }
.import-template-save input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.import-template-save input[type="text"] { margin: 0; }
.import-template-locked { margin: 12px 0 0; border-left: 4px solid var(--teal); padding: 9px 11px; color: var(--muted); background: #f4faf7; font-size: 13px; }
.empty-state .secondary-button { margin-top: 18px; }

.simulation-heading h1 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 550; letter-spacing: -.035em; }
.simulation-heading p { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
.simulation-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(380px, 1.15fr); gap: 18px; margin-top: 24px; align-items: start; }
.simulation-form, .simulation-result, .contracts-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.section-title h2, .contracts-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.simulation-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.frequency-fieldset { min-width: 0; margin: 10px 0 0; border: 0; padding: 0; }
.frequency-fieldset legend { margin-bottom: 8px; color: var(--navy); font-size: 14px; font-weight: 800; }
.frequency-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.frequency-options label { margin: 0; cursor: pointer; }
.frequency-options input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.frequency-options span { display: grid; min-height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 8px 5px; color: var(--muted); background: #fff; font-size: 13px; font-weight: 800; text-align: center; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.frequency-options input:checked + span { border-color: var(--teal); color: var(--navy); background: var(--teal-light); box-shadow: inset 0 0 0 1px var(--teal); }
.frequency-options input:focus-visible + span { outline: 3px solid rgba(29, 122, 106, .22); outline-offset: 2px; }
.daily-rule-field { margin-top: 12px; }
.daily-rule-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.money-input { position: relative; display: flex; align-items: center; }
.money-input > span { position: absolute; z-index: 1; color: var(--muted); font-size: 13px; font-weight: 800; }
.money-input > span:first-child { left: 14px; }
.money-input > span:last-child { right: 14px; }
.money-input > span:first-child + input { padding-left: 43px; }
.money-input input:first-child { padding-right: 36px; }
.calculation-note { margin: 18px 0; border-left: 4px solid var(--teal); padding: 10px 12px; color: var(--muted); background: #f4faf7; font-size: 13px; line-height: 1.5; }
.simulation-result { min-height: 420px; }
.result-placeholder { display: grid; min-height: 370px; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.result-placeholder > span { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 18px; color: var(--teal); background: var(--teal-light); font-size: 28px; }
.result-placeholder h2 { margin: 16px 0 4px; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.result-placeholder p { max-width: 380px; margin: 0; }
.simulation-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.simulation-metrics article { border-radius: 13px; padding: 15px; background: #f3f7f5; }
.simulation-metrics span { display: block; color: var(--muted); font-size: 12px; }
.simulation-metrics strong { display: block; margin-top: 5px; color: var(--navy); font-size: 20px; }
.formula-explanation { border-radius: 13px; padding: 15px; color: #3f5954; background: var(--teal-light); }
.formula-explanation p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; }
.installment-preview { margin: 16px 0; }
.installment-preview > strong { color: var(--navy); }
#installment-preview-list { display: grid; max-height: 330px; gap: 6px; margin-top: 9px; overflow: auto; overscroll-behavior: contain; }
.installment-line { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 7px 2px; color: var(--muted); font-size: 13px; }
.installment-line strong { color: var(--navy); }
.simulation-share-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 10px; }
.simulation-share-actions button { width: 100%; min-width: 0; padding-inline: 8px; }
.simulation-print-paper { color: #1d3135; background: #fff; }
.simulation-print-header { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--navy); padding-bottom: 16px; }
.simulation-print-header h1 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; }
.simulation-print-header p { margin: 5px 0 0; color: var(--muted); }
.simulation-print-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.simulation-print-summary div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.simulation-print-summary span { display: block; color: var(--muted); font-size: 12px; }
.simulation-print-summary strong { display: block; margin-top: 4px; color: var(--navy); }
.simulation-print-schedule { width: 100%; border-collapse: collapse; }
.simulation-print-schedule th, .simulation-print-schedule td { border-bottom: 1px solid var(--line); padding: 8px 4px; text-align: left; }
.simulation-print-schedule th:last-child, .simulation-print-schedule td:last-child { text-align: right; }
.simulation-print-note { margin-top: 18px; color: var(--muted); font-size: 12px; }
.contracts-panel { margin-top: 18px; }
.contract-count { color: var(--teal); font-size: 14px; }
.contract-list { display: grid; }
.contract-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(120px, .7fr) minmax(120px, .7fr) minmax(120px, .7fr) auto; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding: 15px 2px; }
.contract-row:first-child { border-top: 0; }
.contract-row span { color: var(--muted); font-size: 12px; }
.contract-row strong { display: block; color: var(--navy); }
.contract-row small { color: var(--muted); }
.contract-status { width: fit-content; border-radius: 999px; padding: 6px 10px; color: #356055; background: #e8f6f1; font-size: 12px; font-weight: 800; }

.collections-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.collection-heading-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.collections-heading h1 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 550; letter-spacing: -.035em; }
.collections-heading p { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
.collection-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.collection-summary-grid article { border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: var(--surface); box-shadow: 0 8px 24px rgba(16,45,52,.04); }
.collection-summary-grid article:first-child { border-top: 4px solid var(--coral); }
.collection-summary-grid article:nth-child(2) { border-top: 4px solid var(--teal); }
.collection-summary-grid article:nth-child(3) { border-top: 4px solid var(--amber); }
.collection-summary-grid article:last-child { border-top: 4px solid var(--blue); }
.collection-summary-grid span, .collection-summary-grid small { display: block; color: var(--muted); font-size: 12px; }
.collection-summary-grid strong { display: block; margin: 6px 0 3px; color: var(--navy); font-size: 24px; }
.collections-panel, .payment-history-panel, .promise-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.collections-panel h2, .payment-history-panel h2, .promise-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.collections-toolbar { margin-bottom: 8px; }
.installment-list, .payment-history-list, .promise-list { display: grid; }
.installment-row { display: grid; grid-template-columns: minmax(170px, 1.15fr) minmax(150px, .9fr) minmax(105px, .65fr) minmax(115px, .7fr) minmax(125px, .75fr) auto; gap: 13px; align-items: center; border-top: 1px solid var(--line); padding: 15px 2px; }
.installment-row:first-child, .payment-history-row:first-child { border-top: 0; }
.installment-row span:not(.status-pill), .payment-history-row span { display: block; color: var(--muted); font-size: 12px; }
.installment-row strong, .payment-history-row strong { display: block; color: var(--navy); }
.installment-row small, .payment-history-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.installment-actions { display: grid; gap: 5px; justify-items: stretch; }
.installment-actions .action-button { justify-self: stretch; }
.text-action { border: 0; padding: 4px 6px; color: var(--teal); background: transparent; font-size: 12px; font-weight: 800; }
.text-action:hover { text-decoration: underline; }
.installment-row .action-button:disabled { cursor: default; color: #718082; background: #edf1f0; opacity: 1; }
.status-paid { color: #27624f; background: #e4f5ee; }
.status-partial { color: #795b13; background: #fff4d7; }
.payment-history-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(110px, .6fr)); gap: 14px; align-items: center; border-top: 1px solid var(--line); padding: 14px 2px; }
.promise-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(120px, .65fr) minmax(120px, .65fr) minmax(170px, .9fr); gap: 14px; align-items: center; border-top: 1px solid var(--line); padding: 14px 2px; }
.promise-row:first-child { border-top: 0; }
.promise-row span:not(.status-pill), .promise-row small { display: block; color: var(--muted); font-size: 12px; }
.promise-row strong { display: block; color: var(--navy); }
.promise-row .status-pill + small { margin-top: 5px; line-height: 1.35; }
.contract-status.status-renegotiated { color: #654c89; background: #f0eafb; }
.contract-status.status-renewed { color: #14636d; background: #e2f5f6; }
.contract-status.status-cancelled { color: #687679; background: #edf1f0; }
.payment-reference { display: grid; gap: 3px; margin-top: 18px; border-radius: 13px; padding: 14px 16px; color: var(--navy); background: var(--teal-light); }
.payment-reference span { color: var(--muted); font-size: 13px; }
.renegotiation-result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.renegotiation-result > p { border-left: 4px solid var(--teal); padding: 10px 12px; color: var(--muted); background: #f4faf7; font-size: 13px; line-height: 1.5; }
.timeline-summary { display: grid; gap: 4px; margin: 18px 0 8px; border-radius: 14px; padding: 15px 17px; color: var(--navy); background: var(--teal-light); }
.timeline-summary span { color: var(--muted); font-size: 13px; }
.contract-timeline-list { position: relative; display: grid; max-height: min(52vh, 520px); overflow-y: auto; padding: 6px 4px 6px 0; }
.timeline-event { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 11px 0; }
.timeline-event::before { position: absolute; top: 30px; bottom: -12px; left: 7px; width: 2px; content: ""; background: #dbe8e4; }
.timeline-event:last-child::before { display: none; }
.timeline-marker { position: relative; z-index: 1; width: 16px; height: 16px; margin-top: 4px; border: 4px solid #d8f0e9; border-radius: 50%; background: var(--teal); }
.timeline-renewal_interest_paid .timeline-marker, .timeline-payment .timeline-marker { border-color: #dff2e5; background: #2d8b58; }
.timeline-contract_renewed .timeline-marker, .timeline-renewal_contract .timeline-marker { border-color: #e2f5f6; background: #14636d; }
.timeline-contact .timeline-marker { border-color: #fce7dd; background: var(--coral); }
.timeline-event time { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.timeline-event strong { display: block; margin-top: 2px; color: var(--navy); }
.timeline-event p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.client-360-dialog { width: min(980px, calc(100% - 28px)); }
.client-360-identity { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) auto; gap: 18px; align-items: center; margin-top: 18px; border-radius: 15px; padding: 16px; background: var(--teal-light); }
.client-360-identity > div:nth-child(2) strong, .client-360-identity > div:nth-child(2) small { display: block; }
.client-360-identity > div:nth-child(2) strong { color: var(--navy); }
.client-360-identity > div:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.client-360-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.client-360-metrics article { border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: var(--surface); }
.client-360-metrics article.has-overdue { border-top: 4px solid var(--coral); }
.client-360-metrics span, .client-360-metrics small { display: block; color: var(--muted); font-size: 12px; }
.client-360-metrics strong { display: block; margin-top: 4px; color: var(--navy); font-size: 20px; }
.risk-score-card { margin-top: 14px; border: 1px solid var(--line); border-left: 5px solid #94a7a3; border-radius: 15px; padding: 16px 18px; background: #f8faf9; }
.risk-score-card[data-level="low"] { border-left-color: #2d8b58; background: #f2faf5; }
.risk-score-card[data-level="attention"] { border-left-color: var(--amber); background: #fffbef; }
.risk-score-card[data-level="moderate"] { border-left-color: #dc7928; background: #fff8f0; }
.risk-score-card[data-level="high"] { border-left-color: var(--coral); background: #fff5f2; }
.risk-score-card[data-level="locked"] { border-left-color: var(--teal); background: var(--teal-light); }
.risk-score-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.risk-score-heading h3 { margin: 2px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 22px; font-weight: 550; }
.risk-score-value { display: grid; min-width: 66px; min-height: 52px; place-items: center; border-radius: 13px; padding: 7px 10px; color: var(--navy); background: rgba(255,255,255,.8); font-size: 25px; font-weight: 900; }
.risk-score-label { display: block; margin-top: 11px; color: var(--navy); font-size: 16px; }
.risk-reason-list { display: grid; gap: 5px; margin: 9px 0 0; padding-left: 20px; color: #405d57; font-size: 13px; line-height: 1.45; }
.risk-score-disclaimer { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.risk-score-card .secondary-button { margin-top: 12px; }
.human-decision-card { margin-top: 14px; border: 1px solid #b8c9c5; border-radius: 15px; padding: 16px 18px; background: #fff; }
.human-decision-card[data-state="locked"] { border-color: #9bcbbc; background: var(--teal-light); }
.human-decision-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.human-decision-heading h3 { margin: 2px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 22px; font-weight: 550; }
.human-decision-heading button { flex: 0 0 auto; }
#human-decision-latest > p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.human-decision-latest { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin-top: 13px; border-left: 4px solid var(--teal); border-radius: 11px; padding: 13px 15px; background: #f4f8f6; }
.human-decision-latest.decision-declined { border-left-color: var(--coral); background: #fff5f2; }
.human-decision-latest.decision-postponed, .human-decision-latest.decision-conditional { border-left-color: var(--amber); background: #fffbef; }
.human-decision-latest span, .human-decision-latest footer { display: block; color: var(--muted); font-size: 12px; }
.human-decision-latest strong { display: block; margin-top: 3px; color: var(--navy); }
.human-decision-latest p, .human-decision-latest small, .human-decision-latest footer { grid-column: 1 / -1; }
.human-decision-latest p { margin: 3px 0 0; color: #354c50; font-size: 14px; line-height: 1.45; }
.human-decision-latest small { color: #5e4e22; font-size: 13px; }
.human-decision-history details { margin-top: 10px; }
.human-decision-history summary { cursor: pointer; color: var(--teal); font-size: 13px; font-weight: 800; }
.human-decision-history article { border-top: 1px solid var(--line); padding: 10px 2px; }
.human-decision-history article strong, .human-decision-history article span { display: block; }
.human-decision-history article strong { color: var(--navy); font-size: 14px; }
.human-decision-history article span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.human-decision-history article p { margin: 4px 0 0; color: #40575b; font-size: 13px; }
.decision-dialog { width: min(680px, calc(100% - 28px)); }
.client-360-actions { flex-wrap: wrap; }
.statement-dialog { width: min(1040px, calc(100% - 28px)); }
.statement-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 12px; }
.statement-summary article { border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: #f6f9f8; }
.statement-summary article.is-reconciled { border-top: 4px solid #2d8b58; }
.statement-summary article.needs-review { border-top: 4px solid var(--coral); }
.statement-summary span, .statement-summary small { display: block; color: var(--muted); font-size: 12px; }
.statement-summary strong { display: block; margin: 4px 0 2px; color: var(--navy); font-size: 20px; }
.statement-toolbar { display: flex; justify-content: flex-end; margin: 8px 0; }
.statement-toolbar label { width: min(250px, 100%); margin-top: 0; }
.statement-toolbar select { margin-bottom: 0; }
.statement-list { max-height: min(48vh, 480px); overflow-y: auto; }
.statement-row { display: grid; grid-template-columns: 125px minmax(220px, 1.4fr) repeat(3, minmax(100px, .65fr)); gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 14px 2px; }
.statement-row:first-child { border-top: 0; }
.statement-row span, .statement-row time { display: block; color: var(--muted); font-size: 12px; }
.statement-row strong { display: block; color: var(--navy); font-size: 14px; }
.statement-date span { margin-top: 3px; }
.statement-description p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.statement-row .cash-effect { color: #197047; }
.statement-row .balance-effect.increase { color: #9a4b31; }
.statement-row .balance-effect.decrease { color: #197047; }
.statement-row .balance-effect.neutral { color: var(--muted); }
.client-360-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.client-360-section { min-width: 0; border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.client-360-section-title h3 { margin: 1px 0 8px; color: var(--navy); font-family: Georgia, serif; font-size: 22px; font-weight: 550; }
.client-360-contract { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 11px 0; }
.client-360-contract:first-child { border-top: 0; }
.client-360-contract strong, .client-360-contract span { display: block; }
.client-360-contract strong { color: var(--navy); }
.client-360-contract span:not(.contract-status) { color: var(--muted); font-size: 12px; }
.client-360-activity { max-height: 310px; overflow-y: auto; }
.client-360-activity article { display: grid; grid-template-columns: 80px 1fr; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }
.client-360-activity article:first-child { border-top: 0; }
.client-360-activity time { color: var(--muted); font-size: 12px; font-weight: 700; }
.client-360-activity strong { color: var(--navy); font-size: 14px; }
.client-360-activity p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.client-360-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.client-360-notes div { border-radius: 13px; padding: 13px 15px; background: #f3f7f5; }
.client-360-notes span { color: var(--muted); font-size: 12px; font-weight: 800; }
.client-360-notes p { margin: 4px 0 0; color: var(--navy); font-size: 13px; line-height: 1.45; }
.client-360-empty { padding: 18px 4px; color: var(--muted); font-size: 13px; text-align: center; }

.reports-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.reports-heading h1 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 550; letter-spacing: -.035em; }
.reports-heading p { max-width: 680px; margin: 8px 0 0; color: var(--muted); }
.reports-heading-actions { display: flex; gap: 10px; align-items: end; }
.reports-heading-actions > .secondary-button { min-height: 46px; white-space: nowrap; }
.report-period-form { display: grid; grid-template-columns: 145px 145px auto; gap: 10px; align-items: end; flex: 0 0 auto; }
.report-period-form label { margin-top: 0; }
.report-period-form input { margin-bottom: 0; }
.report-period-form .primary-button { min-height: 46px; white-space: nowrap; }
.report-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.report-summary-grid article { border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: var(--surface); box-shadow: 0 8px 24px rgba(16,45,52,.04); }
.report-summary-grid span, .report-summary-grid small { display: block; color: var(--muted); font-size: 12px; }
.report-summary-grid strong { display: block; margin: 6px 0 3px; color: var(--navy); font-size: 24px; }
.report-flow-panel, .report-payments-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.report-flow-panel h2, .report-payments-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.report-legend { display: flex; gap: 14px; color: var(--muted); }
.report-legend span::before { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; background: #b7c8c3; content: ""; }
.report-legend span:last-child::before { background: var(--teal); }
.report-flow-list { display: grid; gap: 16px; margin-top: 20px; }
.report-flow-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.report-flow-row > strong { color: var(--navy); font-size: 14px; }
.flow-bars { display: grid; gap: 5px; }
.flow-bar { display: flex; min-height: 28px; min-width: 2px; align-items: center; border-radius: 0 8px 8px 0; padding: 0 8px; background: #dce7e3; }
.flow-bar.received { color: #fff; background: var(--teal); }
.flow-bar b { font-size: 12px; white-space: nowrap; }
.aging-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.aging-panel[data-state="locked"] { border-color: #9bcbbc; background: linear-gradient(135deg, #eff9f5, #f9fcfb); }
.aging-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.aging-panel .panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.aging-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.aging-summary article { border-radius: 13px; padding: 14px 16px; background: #f3f7f5; }
.aging-summary span, .aging-summary small { display: block; color: var(--muted); font-size: 12px; }
.aging-summary strong { display: block; margin: 5px 0 2px; color: var(--navy); font-size: 20px; }
.aging-list { display: grid; gap: 13px; margin-top: 18px; }
.aging-row { display: grid; grid-template-columns: minmax(145px, .8fr) minmax(220px, 2fr) minmax(130px, .7fr); gap: 15px; align-items: center; }
.aging-row strong, .aging-row small { display: block; }
.aging-row strong { color: var(--navy); font-size: 14px; }
.aging-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.aging-row > div:last-child { text-align: right; }
.aging-track { height: 14px; overflow: hidden; border-radius: 999px; background: #e3ebe8; }
.aging-track span { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #d57c59); }
.aging-row.locked { grid-template-columns: 130px 1fr auto; opacity: .62; }
.aging-row.locked > span:last-child { color: var(--teal); font-size: 12px; font-weight: 900; }
.promise-performance-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.promise-performance-panel[data-state="locked"] { border-color: #9bcbbc; background: linear-gradient(135deg, #eff9f5, #f9fcfb); }
.promise-performance-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.promise-performance-panel .panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.promise-performance-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.promise-performance-summary article { border-radius: 13px; padding: 14px 16px; background: #f3f7f5; }
.promise-performance-summary span, .promise-performance-summary small { display: block; color: var(--muted); font-size: 12px; }
.promise-performance-summary strong { display: block; margin: 5px 0 2px; color: var(--navy); font-size: 20px; }
.promise-performance-bar { display: flex; min-height: 18px; overflow: hidden; margin-top: 16px; border-radius: 999px; background: #e3ebe8; }
.promise-performance-bar span { display: block; min-width: 0; }
.promise-performance-bar .kept { background: #2a8068; }
.promise-performance-bar .missed { background: #bd604d; }
.promise-performance-bar .pending { background: #dfb15a; }
.cash-forecast-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.cash-forecast-panel[data-state="locked"] { border-color: #9bcbbc; background: linear-gradient(135deg, #eff9f5, #f9fcfb); }
.cash-forecast-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.cash-forecast-panel .panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.cash-forecast-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.cash-forecast-summary article { border-radius: 13px; padding: 14px 16px; background: #f3f7f5; }
.cash-forecast-summary span, .cash-forecast-summary small { display: block; color: var(--muted); font-size: 12px; }
.cash-forecast-summary strong { display: block; margin: 5px 0 2px; color: var(--navy); font-size: 20px; }
.cash-forecast-list { display: grid; gap: 13px; margin-top: 18px; }
.cash-forecast-row { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(220px, 2fr) minmax(135px, .75fr); gap: 15px; align-items: center; }
.cash-forecast-row strong, .cash-forecast-row small { display: block; }
.cash-forecast-row strong { color: var(--navy); font-size: 14px; }
.cash-forecast-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.cash-forecast-row > div:last-child { text-align: right; }
.cash-forecast-track { height: 14px; overflow: hidden; border-radius: 999px; background: #e3ebe8; }
.cash-forecast-track span { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1f6f7a, var(--teal)); }
.cash-forecast-row.locked { grid-template-columns: 140px 1fr auto; opacity: .62; }
.cash-forecast-row.locked > span:last-child { color: var(--teal); font-size: 12px; font-weight: 900; }
.report-payment-list { display: grid; margin-top: 8px; }
.report-payment-row { display: grid; grid-template-columns: minmax(210px, 1.25fr) minmax(120px, .7fr) minmax(120px, .7fr) auto; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding: 15px 2px; }
.report-payment-row:first-child { border-top: 0; }
.report-payment-row span, .report-payment-row small { display: block; color: var(--muted); font-size: 12px; }
.report-payment-row strong { display: block; color: var(--navy); }
.audit-promo-panel { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 18px; border: 1px solid #a9d2c5; border-radius: var(--radius); padding: 22px; background: linear-gradient(135deg, #eff9f5, #f9fcfb); box-shadow: 0 8px 28px rgba(16,45,52,.05); }
.audit-promo-panel h2 { margin: 2px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 28px; font-weight: 550; }
.audit-promo-panel p { margin: 7px 0 0; color: var(--muted); }
.audit-promo-panel button { flex: 0 0 auto; }
.receipt-dialog { width: min(720px, calc(100% - 28px)); }
.receipt-paper { margin-top: 22px; border: 1px solid #cbd8d4; border-radius: 14px; padding: 28px; color: #24383b; background: #fff; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dbe4e1; padding-bottom: 16px; }
.receipt-head > div { display: flex; gap: 9px; align-items: center; color: var(--navy); }
.receipt-brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: var(--teal); font-weight: 900; }
.receipt-head small { color: var(--muted); }
.receipt-title { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 24px 0; }
.receipt-title span { color: var(--muted); font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.receipt-title strong { color: var(--navy); font-size: 30px; }
.receipt-paper > p { font-size: 16px; line-height: 1.7; }
.receipt-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.receipt-details div { border-radius: 10px; padding: 12px; background: #f3f7f5; }
.receipt-details dt { color: var(--muted); font-size: 12px; }
.receipt-details dd { margin: 4px 0 0; color: var(--navy); font-weight: 800; }
.receipt-notes { border-left: 4px solid var(--teal); padding-left: 12px; }
.receipt-paper footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #dbe4e1; padding-top: 15px; color: var(--muted); font-size: 11px; }
.receipt-warning { border-radius: 11px; padding: 12px 14px; color: #785917; background: var(--amber-light); font-size: 13px; }

.detail-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop { background: rgba(7, 24, 28, .55); backdrop-filter: blur(3px); }
.dialog-shell { padding: 25px; }
.dialog-header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.dialog-header h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 27px; font-weight: 550; }
.dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 24px; line-height: 1; }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.detail-stat { border-radius: 12px; padding: 14px; background: #f3f7f5; }
.detail-stat span { display: block; color: var(--muted); font-size: 12px; }
.export-dialog { width: min(680px, calc(100% - 28px)); }
.export-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0; }
.export-summary article { border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; background: #f3f7f5; text-align: center; }
.export-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.export-summary strong { display: block; margin-top: 5px; color: var(--navy); font-size: 22px; }
.export-warning { border-left: 4px solid #d07a55; border-radius: 10px; padding: 13px 14px; color: #70412f; background: #fff3ed; font-size: 13px; line-height: 1.5; }
.export-confirm { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; color: var(--navy); font-size: 13px; font-weight: 750; line-height: 1.45; }
.export-confirm input { width: 18px; height: 18px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--teal); }
.audit-dialog { width: min(760px, calc(100% - 28px)); }
.audit-toolbar { display: grid; grid-template-columns: 1fr 190px; gap: 12px; margin-top: 18px; }
.audit-toolbar label { margin-top: 0; }
.audit-toolbar input, .audit-toolbar select { margin-bottom: 0; }
.audit-summary { margin: 15px 0 5px; color: var(--muted); font-size: 13px; font-weight: 750; }
.audit-list { max-height: 360px; overflow-y: auto; }
.audit-entry { display: grid; grid-template-columns: 12px 1fr; gap: 11px; border-top: 1px solid var(--line); padding: 14px 2px; }
.audit-entry:first-child { border-top: 0; }
.audit-marker { width: 10px; height: 10px; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 2px #9bcbbc; }
.audit-entry-heading { display: flex; justify-content: space-between; gap: 12px; }
.audit-entry-heading strong { color: var(--navy); }
.audit-entry-heading time, .audit-entry small { color: var(--muted); font-size: 12px; }
.audit-entry p { margin: 4px 0; color: #354c50; font-size: 14px; line-height: 1.45; }
.subscription-copy { padding-top: 20px; }
.subscription-copy > p:first-child { margin: 0 0 18px; color: var(--muted); }
.plan-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-choice { border: 1px solid var(--line); border-radius: 13px; padding: 17px; background: #f8faf9; }
.plan-choice.featured { border-color: #8dc8b7; background: #eff9f5; }
.plan-choice > span { display: block; color: var(--teal); font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.plan-choice strong { display: block; margin-top: 8px; color: var(--navy); font-size: 25px; }
.plan-choice strong small { font-size: 12px; }
.plan-choice p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.data-promise { margin: 16px 0; border-radius: 12px; padding: 14px; color: #47615c; background: #eef5f2; font-size: 13px; line-height: 1.5; }
.desktop-pro-promise { margin: 14px 0 0; border-left: 4px solid var(--teal); padding: 9px 12px; color: var(--navy); background: #f0faf6; }
.subscription-actions { display: flex; gap: 10px; align-items: stretch; }
.subscription-actions > * { flex: 1; }
.primary-link { display: grid; place-items: center; text-decoration: none; text-align: center; }
.about-copy { padding-top: 20px; }
.about-lead { margin: 0 0 20px; color: #40575b; font-size: 16px; line-height: 1.6; }
.about-step-grid { display: grid; gap: 10px; }
.about-step-grid article { display: grid; grid-template-columns: 34px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.about-step-grid article > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-weight: 850; }
.about-step-grid strong { color: var(--navy); }
.about-step-grid p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.about-difference { margin: 18px 0; border-radius: 14px; padding: 18px; color: #fff; background: var(--navy); }
.about-difference .eyebrow { color: #8ee3c7; }
.about-difference h3 { margin: 4px 0 8px; font-family: Georgia, serif; font-size: 22px; font-weight: 550; }
.about-difference p { margin: 0; color: #cbdcda; font-size: 14px; line-height: 1.5; }
.about-promises { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.about-promises p { margin: 0; border-radius: 12px; padding: 14px; color: #47615c; background: #eef5f2; font-size: 13px; line-height: 1.5; }
.about-plan-strip { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; color: var(--muted); font-size: 13px; }
.about-plan-strip strong { display: block; color: var(--navy); font-size: 15px; }
.activation-intro { color: var(--muted); }
.activation-form { display: grid; gap: 10px; margin-top: 20px; }
.activation-form label { color: var(--navy); font-size: 14px; font-weight: 800; }
.activation-form input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); background: #fff; font: inherit; }
.activation-form input:focus { outline: 3px solid rgb(15 140 127 / .18); border-color: var(--teal); }
.activation-form .secondary-button { width: fit-content; min-height: 42px; }
.activation-form .primary-button { width: 100%; margin-top: 4px; }
.install-guide { display: grid; justify-items: center; margin-top: 18px; text-align: center; }
.install-icon { display: grid; width: 72px; height: 72px; place-items: center; border-radius: 18px; color: #62d3ad; background: var(--navy); box-shadow: 0 12px 28px rgba(16,45,52,.2); font-size: 32px; font-weight: 900; }
.install-guide > p { max-width: 520px; color: var(--muted); }
.install-guide ol { width: min(100%, 520px); margin: 8px 0 20px; padding-left: 24px; color: var(--ink); text-align: left; }
.install-guide li { margin: 8px 0; padding-left: 4px; }
.install-guide .primary-button { width: min(100%, 320px); }
.activation-privacy { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.detail-stat strong { display: block; margin-top: 4px; color: var(--navy); }
.reason-box, .message-preview { border: 1px solid var(--line); border-radius: 13px; padding: 16px; }
.reason-box h3, .message-preview h3 { margin: 0 0 10px; color: var(--navy); font-size: 15px; }
.reason-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.reason-list li { display: flex; gap: 9px; color: #4d6266; font-size: 14px; }
.reason-list li::before { color: var(--teal); content: "✓"; font-weight: 900; }
.message-preview { margin-top: 12px; background: #f8fbfa; }
.message-preview p { margin: 0; color: #43585c; font-size: 14px; }
.dialog-action { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 32px));
  border-radius: 11px;
  padding: 13px 16px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 14px;
}

@media (max-width: 1060px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-item { grid-template-columns: minmax(180px, 1.2fr) minmax(110px, .7fr) minmax(145px, 1fr); }
  .queue-item .action-button { grid-column: 3; justify-self: end; }
  .client-row { grid-template-columns: minmax(200px, 1fr) minmax(150px, .8fr) auto; }
  .client-row .client-status { display: none; }
  .simulation-layout { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .auth-shell { display: block; background: #fbfcfb; }
  .auth-story { display: none; }
  .auth-main { min-height: 100svh; align-items: start; padding-top: 34px; }
  .auth-mobile-brand { display: inline-flex; }

  .app-shell { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { min-height: 64px; padding: 8px 18px; }
  .workspace-label { font-size: 12px; }
  .mobile-wordmark { display: block; color: var(--navy); font-size: 15px; font-weight: 700; }
  .mobile-wordmark strong { color: var(--teal); }
  .mobile-avatar { display: grid; border: 0; }
  .dashboard { padding: 30px 16px 24px; }
  .welcome-row { display: grid; align-items: stretch; }
  .trial-card { min-width: 0; width: 100%; }
  .license-banner { grid-template-columns: auto 1fr; }
  .license-banner button { grid-column: 1 / -1; width: 100%; }
  .onboarding-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .onboarding-steps article { grid-template-columns: auto 1fr; }
  .onboarding-steps button { grid-column: 1 / -1; width: 100%; }
  .platform-access-card { grid-template-columns: auto 1fr; }
  .platform-access-card .secondary-button { grid-column: 1 / -1; width: 100%; }
  .sync-status-card { grid-template-columns: auto 1fr; }
  .sync-status-card .secondary-button { grid-column: 1 / -1; width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-list { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; padding: 18px; }
  .metric-card strong { font-size: 26px; }
  .panel-header { display: grid; align-items: stretch; }
  .search-field { width: 100%; }
  .queue-item { grid-template-columns: 1fr auto; gap: 10px; padding: 16px 2px; }
  .queue-money { grid-column: 1; padding-left: 54px; }
  .queue-reason { grid-column: 1 / span 2; padding-left: 54px; }
  .queue-item .action-button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .clients-heading { display: grid; align-items: stretch; }
  .clients-heading .primary-button { width: 100%; }
  .clients-heading-actions { width: 100%; }
  .clients-heading-actions > * { flex: 1; }
  .client-summary-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .client-summary-grid article { padding: 14px 12px; }
  .client-summary-grid strong { font-size: 24px; }
  .clients-panel { padding: 18px 14px; }
  .clients-toolbar { display: grid; }
  .client-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .client-row .client-contact { grid-column: 1; padding-left: 53px; }
  .client-row .action-button { grid-row: 1 / span 2; grid-column: 2; }
  .client-360-identity { grid-template-columns: 1fr auto; }
  .client-360-identity > div:nth-child(2) { grid-column: 1 / -1; }
  .client-360-metrics { grid-template-columns: 1fr 1fr; }
  .client-360-grid, .client-360-notes { grid-template-columns: 1fr; }
  .human-decision-heading { align-items: stretch; flex-direction: column; }
  .human-decision-latest { grid-template-columns: 1fr; }
  .human-decision-latest p, .human-decision-latest small, .human-decision-latest footer { grid-column: 1; }
  .statement-summary { grid-template-columns: 1fr 1fr; }
  .statement-summary article:last-child { grid-column: 1 / -1; }
  .statement-row { grid-template-columns: 1fr 1fr 1fr; align-items: start; }
  .statement-date, .statement-description { grid-column: 1 / -1; }
  .simulation-field-grid { grid-template-columns: 1fr 1fr; }
  .simulation-metrics { grid-template-columns: 1fr; }
  .simulation-metrics article { display: flex; align-items: center; justify-content: space-between; }
  .simulation-metrics strong { margin-top: 0; }
  .contract-row { grid-template-columns: 1fr 1fr; }
  .contract-history-button { grid-column: 2; justify-self: end; }
  .collection-summary-grid { grid-template-columns: 1fr 1fr; }
  .collections-heading { display: grid; align-items: stretch; }
  .collection-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .collection-heading-actions button { width: 100%; }
  .collections-panel, .payment-history-panel, .promise-panel { padding: 18px 14px; }
  .installment-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .installment-row > div:nth-child(4), .installment-row > div:nth-child(5) { grid-row: 2; }
  .installment-actions { grid-row: 1 / span 2; grid-column: 3; }
  .payment-history-row { grid-template-columns: 1fr 1fr; }
  .promise-row { grid-template-columns: 1fr 1fr; }
  .reports-heading { display: grid; align-items: stretch; }
  .reports-heading-actions { display: grid; }
  .reports-heading-actions > .secondary-button { width: 100%; }
  .report-period-form { grid-template-columns: 1fr 1fr auto; }
  .report-summary-grid { grid-template-columns: 1fr 1fr; }
  .report-flow-panel, .report-payments-panel, .aging-panel, .promise-performance-panel, .cash-forecast-panel { padding: 18px 14px; }
  .aging-summary { grid-template-columns: 1fr 1fr; }
  .aging-summary article:last-child { grid-column: 1 / -1; }
  .aging-row { grid-template-columns: 120px 1fr; }
  .aging-row > div:last-child { grid-column: 2; text-align: left; }
  .aging-row.locked { grid-template-columns: 110px 1fr auto; }
  .promise-performance-summary { grid-template-columns: 1fr 1fr; }
  .cash-forecast-summary { grid-template-columns: 1fr 1fr; }
  .cash-forecast-summary article:last-child { grid-column: 1 / -1; }
  .cash-forecast-row { grid-template-columns: 125px 1fr; }
  .cash-forecast-row > div:last-child { grid-column: 2; text-align: left; }
  .cash-forecast-row.locked { grid-template-columns: 115px 1fr auto; }
  .audit-promo-panel { align-items: stretch; flex-direction: column; padding: 18px 14px; }
  .report-payment-row { grid-template-columns: minmax(0, 1fr) minmax(120px, .7fr) auto; }
  .report-payment-row > div:nth-child(3) { grid-row: 2; grid-column: 2; }
  .report-payment-row .action-button { grid-row: 1 / span 2; grid-column: 3; }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: 69px;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    border-top: 1px solid #d5e0dc;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    box-shadow: 0 -8px 24px rgba(16,45,52,.08);
    backdrop-filter: blur(12px);
  }

  .mobile-nav button { display: grid; gap: 2px; place-items: center; border: 0; padding: 3px; color: #718082; background: transparent; font-size: 10px; font-weight: 700; }
  .mobile-nav button > span { font-size: 19px; line-height: 1; }
  .mobile-nav button.active { color: var(--teal); }
  .mobile-nav .mobile-action > span { width: 38px; height: 38px; margin-top: -20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); box-shadow: 0 5px 14px rgba(16,45,52,.22); font-size: 25px; }
  .toast { right: 16px; bottom: calc(85px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .auth-main { padding-right: 19px; padding-left: 19px; }
  .topbar { gap: 7px; padding-right: 12px; padding-left: 12px; }
  .topbar > div:first-child, .topbar-actions { min-width: 0; }
  .topbar-actions { gap: 4px; }
  .workspace-label { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .environment-badge { padding: 5px 7px; font-size: 9px; letter-spacing: .02em; }
  .topbar .icon-button, .topbar .mobile-avatar { width: 34px; min-width: 34px; height: 34px; }
  .label-row { align-items: center; }
  .welcome-row h1 { font-size: 31px; }
  .export-summary { grid-template-columns: repeat(2, 1fr); }
  .audit-toolbar { grid-template-columns: 1fr; }
  .audit-entry-heading { display: grid; gap: 2px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 120px; padding: 16px 14px; }
  .metric-card > span { font-size: 12px; }
  .metric-card strong { font-size: 23px; }
  .metric-card small { font-size: 11px; }
  .insights-header { align-items: stretch; flex-direction: column; }
  .insights-header .secondary-button { width: 100%; }
  .collection-heading-actions { grid-template-columns: 1fr; }
  .explain-banner { align-items: flex-start; }
  .explain-banner p { font-size: 12px; }
  .queue-panel { border-radius: 15px; padding: 17px 14px; }
  .panel-header h2 { font-size: 26px; }
  .queue-person { grid-template-columns: 36px 1fr; gap: 9px; }
  .queue-rank { width: 36px; height: 36px; }
  .queue-money, .queue-reason { padding-left: 45px; }
  .action-button { padding: 8px 10px; font-size: 12px; }
  .detail-summary { grid-template-columns: 1fr; }
  .plan-choice-grid { grid-template-columns: 1fr; }
  .subscription-actions { flex-direction: column; }
  .about-promises { grid-template-columns: 1fr; }
  .about-plan-strip { display: grid; grid-template-columns: 1fr 1fr; }
  .client-summary-grid { grid-template-columns: 1fr; }
  .clients-heading-actions, .import-summary { flex-direction: column; }
  .import-mapping-grid { grid-template-columns: 1fr; }
  .import-template-tools, .import-template-save { grid-template-columns: 1fr; }
  .client-summary-grid article { display: flex; align-items: center; justify-content: space-between; }
  .client-summary-grid strong { margin-top: 0; }
  .client-360-metrics { grid-template-columns: 1fr; }
  .client-360-contract { grid-template-columns: minmax(0, 1fr) auto; }
  .client-360-contract .contract-status { grid-column: 1 / -1; }
  .client-form-grid { grid-template-columns: 1fr; gap: 0; }
  .simulation-field-grid { grid-template-columns: 1fr; }
  .frequency-options { grid-template-columns: 1fr 1fr; }
  .simulation-share-actions { grid-template-columns: 1fr; }
  .simulation-print-header { flex-direction: column; }
  .simulation-print-summary { grid-template-columns: 1fr 1fr; }
  .simulation-form, .simulation-result, .contracts-panel { padding: 18px 14px; }
  .contract-row { grid-template-columns: 1fr; gap: 5px; }
  .contract-history-button { grid-column: 1; width: 100%; margin-top: 8px; justify-self: stretch; }
  .collection-summary-grid { grid-template-columns: 1fr; }
  .collection-summary-grid article { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .collection-summary-grid strong { grid-row: 1 / span 2; grid-column: 2; margin: 0; }
  .installment-row { grid-template-columns: 1fr; gap: 7px; }
  .installment-row > div:nth-child(4), .installment-row > div:nth-child(5), .installment-actions { grid-row: auto; grid-column: 1; }
  .installment-actions { width: 100%; margin-top: 5px; }
  .payment-history-row { grid-template-columns: 1fr; gap: 5px; }
  .promise-row { grid-template-columns: 1fr; gap: 5px; }
  .report-period-form { grid-template-columns: 1fr 1fr; }
  .report-period-form .primary-button { grid-column: 1 / -1; width: 100%; }
  .report-summary-grid { grid-template-columns: 1fr; }
  .report-summary-grid article { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .report-summary-grid strong { grid-row: 1 / span 2; grid-column: 2; margin: 0; }
  .report-flow-row { grid-template-columns: 1fr; gap: 7px; }
  .report-payment-row { grid-template-columns: 1fr; gap: 6px; }
  .report-payment-row > div:nth-child(3), .report-payment-row .action-button { grid-row: auto; grid-column: 1; }
  .report-payment-row .action-button { width: 100%; margin-top: 5px; }
  .receipt-paper { padding: 20px 16px; }
  .receipt-title { align-items: flex-start; flex-direction: column; }
  .receipt-details { grid-template-columns: 1fr; }
  .receipt-paper footer { flex-direction: column; }
  .dialog-shell { padding: 20px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body * { visibility: hidden; }
  #receipt-dialog[open], #receipt-dialog[open] *, #simulation-share-dialog[open], #simulation-share-dialog[open] * { visibility: visible; }
  #receipt-dialog[open], #simulation-share-dialog[open] { position: absolute; inset: 0; width: 100%; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  #receipt-dialog .dialog-shell, #simulation-share-dialog .dialog-shell { padding: 0; }
  #receipt-dialog .no-print, #simulation-share-dialog .no-print { display: none !important; }
  .receipt-paper { margin: 0; border: 0; border-radius: 0; padding: 24px; }
  .simulation-print-paper { padding: 24px; }
  .simulation-print-schedule { break-inside: auto; }
  .simulation-print-schedule tr { break-inside: avoid; }
}
