/* Vault Docs client frontend. Mobile-first (360px), no build step. Palette is provisional (CLAUDE.md §8). */
:root {
  --navy: #12345B; --blue: #1769AA; --blue-dark: #0F4F82; --pale: #EEF5FB; --white: #FFFFFF;
  --text: #12345B; --muted: #4A6582; --line: #D3E1EE;
  --ok: #17663A; --ok-bg: #E5F4EA; --warn: #7A4B00; --warn-bg: #FFF3D6; --bad: #A3192B; --bad-bg: #FDE8EB; --info-bg: #E3EEF9;
  --radius: 14px; --shadow: 0 1px 2px rgba(18,52,91,.06), 0 4px 16px rgba(18,52,91,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pale); color: var(--text); font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { height: 30px; display: block; }
@media (min-width: 400px) { .top img { height: 34px; } }
.nav { display: flex; gap: 4px; }
.nav a, .nav button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--navy); font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a[aria-current="page"] { background: var(--pale); font-weight: 600; }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 16px; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 16px; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.break { overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }

/* Badges */
.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--info-bg); color: var(--navy); }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-bad { background: var(--bad-bg); color: var(--bad); }
.pill { display: inline-block; min-width: 22px; text-align: center; font-size: .8rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--blue); color: #fff; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--blue); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--blue-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); }
.btn-ghost:hover { background: var(--pale); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: .95rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text], input[inputmode=numeric], select, textarea {
  width: 100%; min-height: 48px; font: inherit; font-size: 16px; color: var(--text); padding: 10px 12px; border: 1.5px solid #9DB4CB; border-radius: 10px; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input[type=file] { width: 100%; font: inherit; padding: 10px 0; }
.hint { font-size: .9rem; color: var(--muted); margin: 6px 0 0; }
.error { color: var(--bad); font-size: .95rem; margin: 6px 0 0; }
.flash { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.alert { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.code-input { letter-spacing: .4em; text-align: center; font-size: 1.4rem !important; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Auth screens */
.auth { max-width: 420px; margin: 0 auto; padding: 32px 16px; }
.auth .logo { display: block; height: 52px; margin: 0 auto 24px; }
.qr { display: block; width: 220px; height: 220px; margin: 12px auto; background: #fff; padding: 8px; border-radius: 12px; }
.codes { display: grid; grid-template-columns: 1fr; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--pale); padding: 12px; border-radius: 10px; }

/* Stage tracker */
.stages { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.stages li { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--muted); }
.stages li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9DB4CB; background: #fff; flex: none; }
.stages li.done { color: var(--navy); } .stages li.done::before { background: var(--blue); border-color: var(--blue); }
.stages li.now { color: var(--navy); font-weight: 700; } .stages li.now::before { background: #fff; border: 4px solid var(--blue); }

/* AIP */
.aip { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; }
.aip .muted { color: #D9E7F5; }
.aip .btn { background: #fff; color: var(--navy); }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; margin-bottom: 12px; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 14px; background: var(--pale); overflow-wrap: anywhere; white-space: pre-line; }
.bubble.mine { align-self: flex-end; background: var(--blue); color: #fff; }
.bubble .meta { display: block; font-size: .78rem; opacity: .85; margin-top: 4px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--blue); width: 0; transition: width .2s; }

@media (min-width: 640px) {
  h1 { font-size: 1.8rem; }
  .codes { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Renewal countdown */
.countdown { display: flex; gap: 10px; margin: 4px 0 10px; }
.countdown span { flex: 1; text-align: center; background: var(--pale); border-radius: 12px; padding: 10px 4px; font-size: .85rem; color: var(--muted); }
.countdown strong { display: block; font-size: 1.6rem; color: var(--navy); font-variant-numeric: tabular-nums; }

/* FAQs (native <details>: keyboard and screen-reader friendly with no script) */
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--blue); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 0 14px; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }

/* Three nav items + logo must fit a 360px screen */
@media (max-width: 399px) {
  .top-in { gap: 6px; padding: 10px 12px; }
  .top img { height: 26px; }
  .nav { gap: 0; }
  .nav a, .nav button { padding: 0 9px; }
}

/* ===== Hub redesign (approved mockups, 1 Dec 2026) ===== */
body.has-tabs main { padding-bottom: 110px; }
.top-help { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: .95rem; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; background: var(--white); border-top: 1px solid var(--line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 12px; }
.tabbar a[aria-current="page"] { color: var(--blue); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.3; }

.main-hub { padding-top: 0; }
.hero { background: var(--navy); color: #fff; margin: 0 -16px; padding: 18px 20px 72px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: #fff; text-decoration: none; }
.hero-logo span { color: #9CC6EA; font-weight: 600; }
.hero p { margin: 16px 0 0; color: #BCD5EC; font-size: .9rem; }
.hero h1 { margin: 2px 0 0; font-size: 1.75rem; color: #fff; }
.hero-help { color: #fff; text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.1); }
.float-card { position: relative; margin: -56px 0 0; background: #fff; border-radius: 22px; padding: 18px; box-shadow: 0 8px 28px rgba(18,52,91,.14); display: flex; gap: 16px; align-items: center; }
.wheel-label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.section-h { font-size: 1rem; font-weight: 700; margin: 22px 0 10px; }
.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.strip-item { flex: none; min-width: 210px; max-width: 260px; background: #fff; border-radius: 16px; padding: 14px; text-decoration: none; color: var(--navy); display: flex; gap: 12px; align-items: center; border: 1.5px solid #F2D9A8; }
.strip-item strong { display: block; font-size: .92rem; }
.strip-item span.s { font-size: .78rem; color: var(--muted); }

.ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--pale); color: var(--blue); flex: none; }
.ico-warn { background: var(--warn-bg); color: var(--warn); }
.ico-dark { background: var(--navy); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #fff; border-radius: 20px; text-decoration: none; color: var(--navy); box-shadow: var(--shadow); min-height: 112px; }
.tile:hover { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.tile .tname { font-weight: 700; font-size: .95rem; }
.tile .tsub { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.tile-dark { background: var(--navy); color: #fff; }
.tile-dark .ico { background: rgba(255,255,255,.12); color: #fff; }
.tile-dark .big { font-weight: 800; font-size: 1.4rem; }
.person { display: flex; gap: 14px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }

.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.page-h h1 { margin: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip-btn { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); margin: 0 0 14px; }

.folder { background: #fff; border-radius: 18px; margin: 0 0 10px; box-shadow: var(--shadow); }
.folder > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; min-height: 64px; box-sizing: border-box; }
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary .grow strong { display: block; }
.folder-body { padding: 0 16px 14px; }
.folder.attn { border: 1.5px solid #F2D9A8; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #E1ECF6; }
.ftype { width: 36px; height: 36px; border-radius: 10px; background: var(--pale); color: var(--blue); font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; text-transform: uppercase; }
.req { background: #FFF8E8; border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.picker { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.picker button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; cursor: pointer; }
.picker button:hover { border-color: var(--blue); }

.wheel-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.wheel-steps li { display: flex; gap: 12px; align-items: center; font-size: .92rem; color: var(--muted); }
.wheel-steps .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #A9C3DA; box-sizing: border-box; flex: none; display: flex; align-items: center; justify-content: center; }
.wheel-steps li.done { color: var(--navy); } .wheel-steps li.done .dot { background: var(--navy); border-color: var(--navy); }
.wheel-steps li.now { color: var(--navy); font-weight: 700; } .wheel-steps li.now .dot { border: 5px solid var(--blue); }
.menu { list-style: none; margin: 0; padding: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 52px; width: 100%; text-decoration: none; color: var(--navy); border: 0; border-top: 1px solid #E1ECF6; background: none; font: inherit; text-align: left; cursor: pointer; }
.menu li:first-child a, .menu li:first-child button { border-top: 0; }
.chat-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions form { margin: 0; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--bad); cursor: pointer; }
.icon-btn:hover { background: var(--bad-bg); }
.hero .icon-btn { color: #fff; background: rgba(255,255,255,.1); }
.hero .icon-btn:hover { background: rgba(255,255,255,.2); }
.menu .danger, .menu .danger strong { color: var(--bad); }
.menu .danger .ico { background: var(--bad-bg); color: var(--bad); }
