/* ============================================================
   RidgeFile — ACRA, State of Ridgeway
   Design system inspired by warm-cream government portal style.
   ============================================================ */

:root {
  /* Palette */
  --cream-25: #fdf9ef;
  --cream-50: #fbf2dc;
  --cream-100: #f8e9c6;
  --cream-200: #f3dca6;
  --peach-300: #f2c078;
  --orange-400: #f09d4a;
  --orange-500: #ea8531;
  --orange-600: #d9711f;
  --orange-700: #b95c14;
  --teal-900: #223946;
  --teal-800: #2f4d5d;
  --teal-700: #3a5b6e;
  --teal-600: #48708a;
  --teal-100: #e3edf2;
  --link: #2f6787;
  --link-hover: #1d4c68;
  --brown-900: #4f4031;
  --brown-800: #6d5a44;
  --brown-700: #7d6a52;
  --ink: #3f3a33;
  --ink-soft: #6a635a;
  --ink-faint: #8d857a;
  --line: #e7ddc9;
  --line-soft: #f0e9d9;
  --white: #ffffff;
  --bg: #faf5ea;
  --green-700: #2f7d4f;
  --green-bg: #e2f2e7;
  --red-600: #b3261e;
  --red-bg: #fbe7e5;
  --amber-700: #946200;
  --amber-bg: #fdf1d3;
  --gray-600: #6b7280;
  --gray-bg: #ececec;
  --blue-bg: #e8f1f6;
  /* Effects */
  --shadow-sm: 0 1px 3px rgba(87, 63, 20, 0.08);
  --shadow-md: 0 6px 24px rgba(87, 63, 20, 0.10);
  --shadow-lg: 0 16px 48px rgba(87, 63, 20, 0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--brown-800); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2.6rem; font-weight: 800; }
h2 { font-size: 1.9rem; font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img, svg { max-width: 100%; }
strong { color: var(--brown-900); }
hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* Guard against CSS-grid/flex "min-content blowout": wide tables, <pre> blocks
   and long unbreakable strings must scroll inside their column, never widen the page. */
.layout-side > *, .grid-2 > *, .grid-3 > *, .form-grid > *, .link-grid > *,
.stat-tiles > *, .hero .container > *, .flex > *, .flex-between > * { min-width: 0; }
pre { max-width: 100%; overflow-x: auto; }
.card, .folder-card, .table td, .kv > dd { overflow-wrap: break-word; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; } .mt-5 { margin-top: 56px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 36px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

/* ---------------- Government banner ---------------- */
.gov-banner {
  background: #f4ecda;
  border-bottom: 1px solid #eadfc6;
  font-size: 0.85rem;
  color: #574c3c;
}
.gov-banner .container { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 24px; flex-wrap: wrap; }
.gov-banner .crest { width: 18px; height: 18px; flex: none; }
.gov-banner button.gov-how {
  background: none; border: none; font: inherit; color: var(--link);
  text-decoration: underline; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 2px;
  white-space: nowrap;
}
.gov-banner button.gov-how .caret { width: 14px; height: 14px; flex: none; }
.gov-banner-panel {
  display: none; background: #efe6d0; border-bottom: 1px solid #e2d5b8; font-size: 0.85rem;
}
.gov-banner-panel.open { display: block; }
.gov-banner-panel .container { display: flex; gap: 40px; padding: 16px 24px; }
.gov-banner-panel .col { display: flex; gap: 10px; max-width: 460px; }
.gov-banner-panel .col svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--teal-700); }
.gov-banner-panel strong { display: block; color: var(--brown-900); }

/* ---------------- Site header ---------------- */
.site-header { background: var(--white); box-shadow: 0 1px 0 rgba(0,0,0,0.06); position: relative; z-index: 40; }
.site-header .container { display: flex; align-items: center; gap: 18px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .wordmark { height: 34px; width: auto; display: block; }
.brand .tagline { color: var(--ink-soft); font-size: 0.9rem; padding-bottom: 2px; }
.header-actions { margin-left: auto; display: flex; align-items: center; }
.header-actions > * { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-700); font-weight: 600; padding: 6px 14px; background: none; border: none; font: inherit; cursor: pointer; text-decoration: none; }
.header-actions > *:hover { color: var(--orange-600); text-decoration: none; }
.header-actions .divider { width: 1px; height: 26px; background: var(--line); padding: 0; cursor: default; }
.header-actions svg { width: 22px; height: 22px; }
.cart-count {
  background: var(--orange-500); color: #fff; font-size: 0.7rem; font-weight: 800;
  border-radius: 999px; min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; margin-left: -10px; margin-top: -14px;
}
.user-chip { position: relative; padding: 0 !important; }
.user-chip > button {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: none;
  font: inherit; font-weight: 600; color: var(--teal-700); cursor: pointer; padding: 6px 10px; white-space: nowrap;
}
.user-chip > button:hover { color: var(--orange-600); }
.user-chip > button .avatar, .user-chip > button img { flex: none; }
.user-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 12px;
  box-shadow: var(--shadow-lg); min-width: 230px; padding: 8px; z-index: 60;
}
.user-menu.open { display: block; }
.user-menu a, .user-menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--ink); background: none; border: none; font: inherit; cursor: pointer; text-align: left; text-decoration: none;
}
.user-menu a:hover, .user-menu button:hover { background: var(--cream-50); text-decoration: none; }
.user-menu .um-head { padding: 10px 12px 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.user-menu .um-head .name { font-weight: 800; color: var(--brown-900); }
.user-menu svg { width: 18px; height: 18px; color: var(--teal-600); }

/* ---------------- Main nav ---------------- */
.main-nav { background: var(--teal-700); position: relative; z-index: 30; }
.main-nav .container { display: flex; align-items: stretch; justify-content: center; gap: 4px; flex-wrap: wrap; padding: 0 12px; }
.nav-item { position: relative; }
.nav-item > a, .nav-item > button {
  display: flex; align-items: center; gap: 6px; color: #fff; font: inherit; font-weight: 600; font-size: 1.02rem;
  padding: 15px 20px; background: none; border: none; cursor: pointer; text-decoration: none; height: 100%;
}
.nav-item > a:hover, .nav-item > button:hover { background: rgba(255,255,255,0.09); text-decoration: none; color: #fff; }
.nav-item.active > a, .nav-item.active > button { box-shadow: inset 0 -3px 0 var(--orange-400); }
.nav-item .caret { width: 16px; height: 16px; transition: transform 0.15s; }
.nav-item.open .caret { transform: rotate(180deg); }
.nav-sep { width: 1px; background: rgba(255,255,255,0.28); margin: 12px 6px; }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 300px;
  border-radius: 0 0 14px 14px; box-shadow: var(--shadow-lg); padding: 12px; z-index: 50;
}
.nav-item.open .nav-menu { display: block; }
.nav-menu a {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 8px; color: var(--ink);
  font-weight: 500; text-decoration: none;
}
.nav-menu a:hover { background: var(--cream-50); text-decoration: none; }
.nav-menu a svg { width: 20px; height: 20px; color: var(--teal-600); flex: none; margin-top: 2px; }
.nav-menu .nav-menu-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 700; padding: 10px 12px 4px; }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #f9ecce 0%, #f9efd9 60%, var(--bg) 100%); }
.hero::before {
  content: ""; position: absolute; right: -140px; top: -220px; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 192, 120, 0.55), rgba(242, 192, 120, 0) 65%);
}
.hero::after {
  content: ""; position: absolute; left: -180px; bottom: -260px; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 157, 74, 0.28), rgba(240, 157, 74, 0) 65%);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 32px; padding-top: 64px; padding-bottom: 40px; z-index: 1; }
.hero h1 { font-size: 3.4rem; font-weight: 900; color: #6b573d; margin-bottom: 18px; }
.hero .hero-sub { font-size: 1.45rem; color: #5d5240; max-width: 560px; }
.hero-art { justify-self: end; width: 100%; max-width: 430px; }

/* ---------------- Cards ---------------- */
.card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 34px 40px; }
.card-soft { background: var(--cream-25); border: 1px solid var(--line-soft); box-shadow: none; }
.card + .card { margin-top: 28px; }

/* Folder-tab card (eService intro) */
.folder-wrap { position: relative; padding-top: 40px; }
.folder-tab {
  position: absolute; top: 0; left: 0; height: 44px; width: min(620px, 78%);
  background: linear-gradient(90deg, #f6b45b, #ef9a3e);
  border-radius: 18px 18px 0 0;
  clip-path: polygon(0 0, calc(100% - 56px) 0, 100% 100%, 0 100%);
}
.folder-card { position: relative; background: var(--white); border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-md); padding: 40px 48px; }

/* ---------------- Page head (teal band) ---------------- */
.page-head { background: var(--teal-700); color: #fff; padding: 44px 0 40px; }
.page-head h1 { color: #fff; font-size: 2.5rem; margin-bottom: 8px; }
.page-head p { color: #d4e2ea; margin: 0; max-width: 720px; font-size: 1.05rem; }
.breadcrumbs { font-size: 0.85rem; margin-bottom: 14px; color: #b7cbd6; }
.breadcrumbs a { color: #d4e2ea; }

/* ---------------- Side-tab layout ---------------- */
.layout-side { display: grid; grid-template-columns: 290px 1fr; gap: 44px; align-items: start; }
.side-tabs { background: #f2efe6; border-radius: 0 0 12px 12px; overflow: hidden; padding-bottom: 8px; }
.side-tabs a {
  display: block; padding: 16px 22px; color: var(--teal-700); font-weight: 600; border-left: 4px solid transparent;
  text-decoration: none; line-height: 1.35;
}
.side-tabs a:hover { background: #faf7ee; text-decoration: none; }
.side-tabs a.active { background: #fff; border-left-color: var(--orange-500); color: var(--brown-900); font-weight: 800; }

/* ---------------- Tabs (horizontal) ---------------- */
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 16px 26px; font-weight: 700; font-size: 1.05rem; color: var(--ink-soft); cursor: pointer;
  background: none; border: none; font-family: inherit; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--brown-800); }
.tab.active { color: var(--brown-900); border-bottom-color: var(--orange-500); background: linear-gradient(180deg, rgba(246, 180, 91, 0.10), rgba(246, 180, 91, 0)); }

/* ---------------- Search box ---------------- */
.search-box {
  display: flex; align-items: center; gap: 14px; border: 2px solid var(--teal-600); border-radius: 10px;
  padding: 4px 8px 4px 20px; background: #fff;
}
.search-box svg { width: 24px; height: 24px; color: var(--ink-faint); flex: none; }
.search-box input { flex: 1; border: none; outline: none; font: inherit; font-size: 1.25rem; padding: 14px 0; color: var(--ink); background: transparent; min-width: 0; }
.search-box input::placeholder { color: #a89f90; }
.search-box .btn { flex: none; }

/* ---------------- Icon link lists ---------------- */
.link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 48px; }
.link-group h3 { margin-bottom: 18px; font-size: 1.2rem; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.link-list li { display: flex; gap: 12px; align-items: flex-start; }
.link-list svg { width: 22px; height: 22px; color: var(--teal-600); flex: none; margin-top: 1px; }
.link-list a { color: var(--link); font-weight: 500; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1rem; border-radius: 10px; cursor: pointer;
  padding: 12px 26px; border: 2px solid transparent; text-decoration: none; transition: all 0.15s; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, #f09a3e, var(--orange-600)); color: #fff; box-shadow: 0 2px 6px rgba(217, 113, 31, 0.35); }
.btn-primary:hover { background: linear-gradient(180deg, #e8891f, var(--orange-700)); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--teal-600); color: var(--teal-700); }
.btn-secondary:hover { background: var(--teal-100); color: var(--teal-800); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #921b14; color: #fff; }
.btn-danger-outline { background: #fff; border-color: var(--red-600); color: var(--red-600); }
.btn-danger-outline:hover { background: var(--red-bg); }
.btn-ghost { background: none; color: var(--link); padding-left: 10px; padding-right: 10px; }
.btn-lg { font-size: 1.1rem; padding: 15px 34px; }
.btn-sm { font-size: 0.88rem; padding: 7px 16px; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 22px; }
.field label { display: block; font-weight: 700; color: var(--brown-900); margin-bottom: 7px; }
.field .req { color: var(--red-600); }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field input[type="email"], .field input[type="tel"], .field input[type="password"],
.field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid #cfc4ad; border-radius: 8px; font: inherit;
  color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal-600); outline: 3px solid rgba(72, 112, 138, 0.18);
}
.field .hint { font-size: 0.85rem; color: var(--ink-soft); margin-top: 5px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red-600); background: #fffafa; }
.field .err-msg { display: none; color: var(--red-600); font-size: 0.85rem; font-weight: 600; margin-top: 5px; }
.field.invalid .err-msg { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.form-grid .span2 { grid-column: span 2; }
.radio-row, .check-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.radio-row input, .check-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--orange-600); flex: none; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-card { border: 2px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: pointer; display: block; background: #fff; }
.radio-card:hover { border-color: var(--teal-600); }
.radio-card.selected { border-color: var(--orange-500); background: #fffaf2; box-shadow: 0 0 0 1px var(--orange-500); }
.radio-card .rc-title { font-weight: 800; color: var(--brown-900); display: flex; align-items: center; gap: 8px; }
.radio-card .rc-desc { font-size: 0.88rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------------- Meta list (intro pages) ---------------- */
.meta-list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin: 24px 0; }
.meta-row { display: grid; grid-template-columns: 230px 1fr; gap: 16px; padding: 12px 0; }
.meta-row .meta-label { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); font-weight: 600; }
.meta-row .meta-label svg { width: 21px; height: 21px; flex: none; margin-top: 2px; color: var(--ink-soft); }

/* ---------------- Numbered steps list ---------------- */
.steps-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps-list > li { counter-increment: step; position: relative; padding: 0 0 26px 52px; }
.steps-list > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brown-800); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.steps-list > li > strong { display: block; font-size: 1.15rem; color: var(--brown-900); margin-bottom: 6px; }

/* ---------------- Section heading w/ rule ---------------- */
.section-title { border-bottom: 2px solid var(--peach-300); padding-bottom: 10px; margin: 40px 0 22px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th {
  text-align: left; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brown-700);
  padding: 12px 14px; background: var(--cream-25); border-bottom: 2px solid var(--line);
}
.table td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr:hover td { background: var(--cream-25); }
.table .row-link { font-weight: 700; }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.badge-live, .badge-active, .badge-approved, .badge-filed, .badge-paid { background: var(--green-bg); color: var(--green-700); }
.badge-pending { background: var(--amber-bg); color: var(--amber-700); }
.badge-suspended, .badge-expiring, .badge-due { background: #ffe9d1; color: #a34c00; }
.badge-ceased, .badge-struck, .badge-expired, .badge-lapsed { background: var(--gray-bg); color: var(--gray-600); }
.badge-revoked, .badge-rejected, .badge-overdue { background: var(--red-bg); color: var(--red-600); }
.badge-info { background: var(--blue-bg); color: var(--teal-700); }

/* ---------------- Notices ---------------- */
.notice { display: flex; gap: 12px; border-radius: 12px; padding: 15px 18px; margin: 18px 0; align-items: flex-start; }
.notice svg { width: 21px; height: 21px; flex: none; margin-top: 2px; }
.notice-info { background: var(--blue-bg); color: #2b5871; }
.notice-warn { background: var(--amber-bg); color: #7a5200; }
.notice-error { background: var(--red-bg); color: #8f1d16; }
.notice-success { background: var(--green-bg); color: #205a39; }
.notice p { margin: 0; }
.notice a { font-weight: 700; }

/* ---------------- Key-value display ---------------- */
.kv { display: grid; grid-template-columns: 260px 1fr; gap: 0; }
.kv > dt { padding: 11px 0; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--line-soft); margin: 0; }
.kv > dd { padding: 11px 0; margin: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.kv > dt:last-of-type, .kv > dd:last-of-type { border-bottom: none; }

/* ---------------- Wizard ---------------- */
.wsteps { display: flex; margin: 6px 0 34px; }
.wstep { flex: 1; text-align: center; position: relative; font-size: 0.85rem; color: var(--ink-faint); padding-top: 44px; font-weight: 600; }
.wstep::before {
  content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid #d4c9b2; background: #fff; color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center; font-weight: 800; z-index: 1;
}
.wstep::after { content: ""; position: absolute; top: 17px; left: calc(-50% + 17px); right: calc(50% + 17px); height: 2px; background: #d4c9b2; }
.wstep:first-child::after { display: none; }
.wstep.active { color: var(--orange-700); }
.wstep.active::before { border-color: var(--orange-500); color: var(--orange-600); background: #fff7ec; }
.wstep.done { color: var(--ink-soft); }
.wstep.done::before { content: "✓"; background: var(--orange-500); border-color: var(--orange-500); color: #fff; }
.wstep.done::after, .wstep.active::after { background: var(--orange-400); }
.wizard-body { min-height: 180px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.wizard-actions .spacer { flex: 1; }

/* Fee table */
.fee-rows { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 18px 0; }
.fee-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.fee-row:last-child { border-bottom: none; }
.fee-row.fee-total { background: var(--cream-25); font-weight: 800; color: var(--brown-900); }

/* Review summary blocks */
.review-block { border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-bottom: 16px; background: #fffdf8; }
.review-block h4 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-block h4 .edit-link { font-size: 0.85rem; font-weight: 600; }

/* ---------------- Success panel ---------------- */
.success-panel { text-align: center; padding: 30px 20px; }
.success-panel .success-icon {
  width: 74px; height: 74px; border-radius: 50%; background: var(--green-bg); color: var(--green-700);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.success-panel .success-icon svg { width: 38px; height: 38px; }
.ren-chip {
  display: inline-block; background: var(--cream-50); border: 1px dashed var(--peach-300); border-radius: 10px;
  font-size: 1.35rem; font-weight: 800; color: var(--brown-900); letter-spacing: 0.08em; padding: 10px 26px; margin: 10px 0 4px;
}

/* ---------------- Stat tiles ---------------- */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-tile { background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft); padding: 18px 22px; }
.stat-tile .stat-num { font-size: 2rem; font-weight: 900; color: var(--brown-900); line-height: 1.1; }
.stat-tile .stat-label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.stat-tile.stat-warn .stat-num { color: var(--orange-600); }
.stat-tile.stat-danger .stat-num { color: var(--red-600); }

/* ---------------- Accordion ---------------- */
.accordion { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.accordion details { border-bottom: 1px solid var(--line-soft); background: #fff; }
.accordion details:last-child { border-bottom: none; }
.accordion summary { padding: 16px 20px; font-weight: 700; color: var(--brown-900); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.accordion summary::after { content: "+"; font-size: 1.3rem; color: var(--orange-600); }
.accordion details[open] summary::after { content: "–"; }
.accordion .acc-body { padding: 0 20px 18px; color: var(--ink-soft); }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(43, 33, 15, 0.5); display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); max-width: 600px; width: 100%; max-height: 88vh; overflow: auto; padding: 30px 34px; }
.modal h3 { margin-bottom: 14px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--teal-900); color: #fff; padding: 13px 24px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 120; transition: all 0.25s; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.toast-error { background: var(--red-600); }
.toast.toast-success { background: var(--green-700); }

/* ---------------- Floating buttons ---------------- */
.fab { position: fixed; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; z-index: 90; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(60, 40, 10, 0.28); }
.fab svg { width: 28px; height: 28px; }
.fab-chat { right: 26px; bottom: 26px; background: radial-gradient(circle at 35% 30%, #f6a94f, var(--orange-600)); color: #fff; }
.fab-top { right: 26px; bottom: 98px; background: var(--orange-500); color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.fab-top.show { opacity: 1; pointer-events: auto; }
.fab-smiley { left: 26px; bottom: 26px; background: #ffd333; color: #232323; }

/* Assistant panel */
.assistant-panel {
  position: fixed; right: 26px; bottom: 96px; width: 360px; max-width: calc(100vw - 40px); background: #fff;
  border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 95; overflow: hidden; display: none;
}
.assistant-panel.open { display: block; }
.assistant-head { background: var(--teal-700); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.assistant-head .close-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 1.2rem; }
.assistant-body { padding: 18px 20px; max-height: 380px; overflow: auto; }
.assistant-body .qa-links { display: flex; flex-direction: column; gap: 8px; }
.assistant-body .qa-links a { background: var(--cream-25); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 14px; font-weight: 600; }

/* ---------------- Footer ---------------- */
.footer { background: var(--teal-900); color: #c9d8e1; margin-top: 90px; font-size: 0.92rem; }
.footer a { color: #dce8ef; }
.footer a:hover { color: #fff; }
.footer .footer-main { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 48px 0 36px; }
.footer h4 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer .footer-brand .wordmark { height: 30px; margin-bottom: 12px; }
.footer .footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding: 18px 0 26px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 0.84rem; color: #9db4c1; }

/* ---------------- Login page (RidgePass) ---------------- */
.pass-panel { max-width: 520px; margin: 0 auto; }
.pass-header { background: linear-gradient(135deg, #c8102e, #8f0a20); border-radius: 16px 16px 0 0; color: #fff; padding: 22px 30px; display: flex; align-items: center; gap: 12px; }
.pass-header .pass-logo { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; }
.pass-body { background: #fff; border-radius: 0 0 16px 16px; box-shadow: var(--shadow-md); padding: 30px 34px; }
.persona-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; border: 2px solid var(--line);
  border-radius: 14px; padding: 16px 20px; background: #fff; cursor: pointer; font: inherit; margin-bottom: 12px;
}
.persona-card:hover { border-color: var(--teal-600); background: #fbfdfe; }
.persona-card .avatar {
  width: 46px; height: 46px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.persona-card .p-name { font-weight: 800; color: var(--brown-900); }
.persona-card .p-desc { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------------- Print/report ---------------- */
@media print {
  .gov-banner, .gov-banner-panel, .site-header, .main-nav, .footer, .fab, .assistant-panel, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  .card, .folder-card { box-shadow: none; border: none; }
}

/* ---------------- Responsive ---------------- */

/* Laptop: tighten the nav so it stays on one row */
@media (max-width: 1280px) {
  .nav-item > a, .nav-item > button { padding: 15px 13px; font-size: 0.98rem; }
  .nav-sep { margin: 12px 3px; }
}

/* Below 1100px: the nav becomes a single scrollable row; dropdowns span the viewport */
@media (max-width: 1100px) {
  .main-nav { position: relative; }
  .main-nav .container {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 0 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .main-nav .container::-webkit-scrollbar { display: none; }
  .nav-item { position: static; flex: none; }
  .nav-item > a, .nav-item > button { white-space: nowrap; }
  .nav-menu { left: 10px; right: 10px; min-width: 0; }
}

/* Tablet */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 2.5rem; }
  .link-grid { grid-template-columns: 1fr 1fr; gap: 30px 32px; }
  .layout-side { grid-template-columns: 1fr; gap: 24px; }
  .side-tabs {
    display: flex; overflow-x: auto; border-radius: 12px; padding: 0;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .side-tabs a { border-left: none; border-bottom: 4px solid transparent; white-space: nowrap; flex: none; }
  .side-tabs a.active { border-bottom-color: var(--orange-500); }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .footer .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv > dt { padding-bottom: 0; border-bottom: none; }
  .radio-cards { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Any table scrolls inside its card rather than widening the page */
@media (max-width: 760px) {
  table.table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Phone */
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 16px; }
  .card, .folder-card { padding: 22px 18px; }
  .card + .card { margin-top: 20px; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }

  .gov-banner { font-size: 0.78rem; }
  .gov-banner .container { padding: 6px 12px; gap: 6px; }
  .gov-banner-panel .container { flex-direction: column; gap: 12px; }

  .site-header .container { padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .brand .wordmark { height: 26px; }
  .brand .tagline { display: none; }
  .header-actions > * { padding: 6px 7px; }
  .header-actions svg { width: 20px; height: 20px; }
  .header-actions .divider { height: 22px; }

  .page-head { padding: 30px 0 26px; }
  .page-head h1 { font-size: 1.8rem; }
  .breadcrumbs { font-size: 0.8rem; margin-bottom: 10px; }

  .hero .container { padding-top: 30px; padding-bottom: 28px; }
  .hero h1 { font-size: 2rem; }
  .hero .hero-sub { font-size: 1.1rem; }

  .tabs .tab, .tab { padding: 12px 15px; font-size: 0.98rem; }
  .search-box { padding: 4px 6px 4px 12px; gap: 8px; }
  .search-box input { font-size: 1rem; padding: 11px 0; }
  .search-box .btn { padding: 10px 14px; }
  .search-box svg { width: 20px; height: 20px; }

  .link-grid { grid-template-columns: 1fr; gap: 24px; }
  .stat-tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-tile { padding: 14px 16px; }
  .stat-tile .stat-num { font-size: 1.6rem; }

  .wizard-actions { flex-wrap: wrap; gap: 10px; }
  .wizard-actions .spacer { display: none; }
  .wizard-actions .btn { flex: 1 1 auto; }

  .meta-list { margin: 18px 0; }
  .steps-list > li { padding-left: 46px; }
  .section-title { margin: 28px 0 16px; }

  .modal { padding: 22px 18px; }
  .modal .modal-actions { flex-wrap: wrap; }

  .fab { width: 48px; height: 48px; }
  .fab svg { width: 23px; height: 23px; }
  .fab-chat { right: 14px; bottom: 14px; }
  .fab-top { right: 14px; bottom: 70px; }
  .fab-smiley { left: 14px; bottom: 14px; }
  .assistant-panel { right: 14px; bottom: 70px; }

  .footer { margin-top: 56px; }
  .footer .footer-main { grid-template-columns: 1fr; gap: 22px; padding: 34px 0 26px; }
  .footer .footer-bottom { flex-direction: column; gap: 6px; }

  .wstep { font-size: 0; }
  .wstep.active { font-size: 0.75rem; }
  .fee-row { padding: 11px 14px; }
  .ren-chip { font-size: 1.1rem; padding: 8px 18px; }
}

/* Small phone */
@media (max-width: 480px) {
  .user-chip > button > span:not(.avatar) { display: none; }  /* avatar + caret only */
  .wstep { padding-top: 36px; }
  .wstep::before { width: 28px; height: 28px; font-size: 0.8rem; }
  .wstep::after { top: 14px; left: calc(-50% + 14px); right: calc(50% + 14px); }
  .btn-lg { font-size: 1rem; padding: 13px 22px; }
  .persona-card { padding: 12px 14px; gap: 12px; }
}
