:root {
  --navy: #1d3557;
  --navy-dark: #14263f;
  --navy-soft: #eef2f7;
  --navy-mid: #c9d3e1;
  --ink: #1b1714;
  --ink-soft: #5d5650;
  --rule: #e6e6e6;
  --surface: #ffffff;
  --bg: #ffffff;
  --panel: #f7f8fa;
  --black: #0d0c0b;
  --ok: #1f7a46;
  --ok-bg: #e7f5ed;
  --err: #b4232c;
  --err-bg: #fdecec;
  --radius: 12px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 1280px; }
main { flex: 1; width: 100%; }
#adminView, #detailView { padding-top: 36px; padding-bottom: 56px; }

/* Wordmark (matches J. DEAN FINANCIAL GROUP) */
.wordmark { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--navy); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; line-height: 1; }
.wordmark-lg { font-size: 1.32rem; text-align: center; }

/* Top bar */
.topbar { background: rgba(255,255,255,0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 68px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); border-left: 1px solid var(--rule); padding-left: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { font-size: 0.82rem; color: var(--ink-soft); }

/* Type */
h1, h2 { font-family: var(--serif); font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 8px; }
h3 { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); margin: 24px 0 8px; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy); margin: 0 0 8px; }
.eyebrow.center { text-align: center; margin: 10px 0 26px; color: var(--ink-soft); }
.lead { font-size: 1.05rem; color: var(--ink-soft); margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86rem; margin-top: 0; }
.loading { color: var(--ink-soft); padding: 60px 0; text-align: center; }
.label-like { font-size: 0.85rem; font-weight: 600; margin: 18px 0 8px; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 0.92rem var(--sans); padding: 11px 20px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-sm { padding: 8px 14px; font-size: 0.84rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 0.98rem; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-ghost { background: var(--surface); border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { background: var(--navy-soft); border-color: var(--navy-mid); }
.btn-danger { background: #fff; border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--navy); font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.quiet { color: var(--ink-soft); font-size: 0.8rem; }
label { font-size: 0.85rem; font-weight: 600; }
input, select, textarea { font: inherit; font-size: 0.95rem; padding: 10px 12px; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
input[readonly], textarea[readonly], select:disabled { background: var(--panel); color: var(--ink); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .link-btn:focus-visible, .yn:focus-visible, .side a:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
select { width: 100%; }
.page-head select { width: auto; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--navy); }

/* Layout */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .stack { flex: 1 1 200px; }
.row > .stack.narrow { flex: 0 1 130px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
#detailView .grid-2 { grid-template-columns: 1.1fr 1fr; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.link-btn + .page-head { margin-top: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* Sign in */
body.signin { background: var(--panel); }
body.signin .topbar, body.signin .site-footer { display: none; }
.signin-wrap { display: grid; place-items: center; padding: 64px 20px; min-height: 100vh; }
.signin-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 44px 44px 32px; text-align: center; box-shadow: 0 10px 40px rgba(29,53,87,.08); }
.signin-card h1 { font-size: 1.6rem; }
.signin-card > .muted { font-size: 0.93rem; margin: 0; }
.signin-card form, .signin-card #verifyBox { margin: 26px 0 8px; text-align: left; }
.signin-card label { margin-top: 4px; }
.signin-card .notice { text-align: left; }
.secure-note { font-size: 0.76rem; color: var(--ink-soft); margin: 22px 0 6px; }
.secure-note::before { content: "🔒 "; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.auth-links .link-btn { font-size: 0.84rem; }
.hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: -4px; }

/* Client shell */
.client-shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 68px); }
.side { border-right: 1px solid var(--rule); padding: 22px 0; background: #fff; position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 12px; padding: 11px 24px; color: var(--ink); text-decoration: none; font-size: 0.93rem; font-weight: 500; border-left: 3px solid transparent; }
.side a:hover { background: var(--panel); }
.side a.active { background: var(--navy-soft); border-left-color: var(--navy); color: var(--navy); font-weight: 600; }
.ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.nav-count { margin-left: auto; background: var(--navy); color: #fff; font-size: 0.7rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }
.side-rule { display: block; height: 1px; background: var(--rule); margin: 12px 0; }
.client-main { background: var(--panel); padding: 36px clamp(16px, 4vw, 48px) 56px; min-width: 0; }
.client-main > .tab, .client-main > .notice { max-width: 980px; margin: 0 auto; }
.tab-head { margin-bottom: 22px; }
.tab-head .muted { margin: 0; }
.back-link { display: inline-block; margin-bottom: 14px; }

/* Home */
.welcome { text-align: center; margin: 8px 0 28px; }
.welcome h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 4px; }
.welcome-meta { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; font-size: 0.88rem; color: var(--ink-soft); flex-wrap: wrap; }
.tasks-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px; }
.tasks-card h2 { margin-bottom: 2px; }
.tasks { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.task { display: grid; grid-template-columns: 44px minmax(150px, 220px) 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.task-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; }
.task-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.task-title strong { font-size: 0.97rem; }
.task-text { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.task-action .btn { min-width: 150px; }
.task.is-done { background: #fbfcfb; }
.task.is-done .task-ico { background: var(--ok-bg); color: var(--ok); }
.task.is-done .task-title strong { color: var(--ink-soft); }
.done-tag { color: var(--ok); font-weight: 600; font-size: 0.9rem; display: inline-block; min-width: 150px; text-align: center; }
.wait-tag { color: var(--ink-soft); font-size: 0.85rem; display: inline-block; min-width: 150px; text-align: center; border: 1px dashed var(--rule); border-radius: 8px; padding: 8px 10px; }

/* Forms */
.form-card { padding: 28px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.field.half { grid-column: span 1; }
.fields > h3.form-heading, .form-heading { grid-column: 1 / -1; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--navy); margin: 14px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.fields > h3.form-heading:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.form-card > .form-heading { margin-top: 26px; }
.form-note { grid-column: 1 / -1; margin: 0; font-size: 0.88rem; color: var(--navy); background: var(--navy-soft); border-radius: 8px; padding: 10px 14px; }
.req { color: var(--err); }
.field-err { color: var(--err); font-size: 0.8rem; }
.field.has-err input, .field.has-err select, .field.has-err textarea, .field.has-err .yn { border-color: var(--err); }
.yn-group { display: flex; gap: 8px; }
.yn { font: 600 0.9rem var(--sans); padding: 9px 22px; border-radius: 8px; border: 1px solid #d6d6d6; background: #fff; color: var(--ink); cursor: pointer; }
.yn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.yn:disabled { cursor: default; }
.yn:disabled:not(.on) { opacity: 0.55; }
.money { display: flex; align-items: center; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; overflow: hidden; }
.money span { padding: 0 4px 0 12px; color: var(--ink-soft); }
.money input { border: none; padding-left: 4px; }
.money input:focus { outline: none; }
.money:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.secret { display: flex; gap: 6px; }
.eye { font: 600 0.8rem var(--sans); border: 1px solid #d6d6d6; background: #fff; border-radius: 8px; padding: 0 12px; cursor: pointer; color: var(--navy); }
.dep-box { border: 1px solid var(--rule); border-radius: 10px; padding: 18px; margin-bottom: 14px; background: var(--panel); }
.dep-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* Questionnaire cards */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.q-card { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.q-card:hover { border-color: var(--navy-mid); box-shadow: 0 4px 16px rgba(29,53,87,.08); }
.q-card strong { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.q-card p { margin: 6px 0 0; }
.q-card-foot { display: flex; justify-content: space-between; align-items: center; }
.q-state { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--panel); color: var(--ink-soft); }
.q-state.in-progress { background: #fff4e0; color: #8a5a00; }
.q-state.submitted { background: var(--ok-bg); color: var(--ok); }
.q-go { font-weight: 600; font-size: 0.88rem; color: var(--navy); }

/* Payment */
.pay-card { max-width: 520px; text-align: center; padding: 40px 32px; }
.amount { font-family: var(--serif); font-size: 3.4rem; font-weight: 700; color: var(--navy); line-height: 1; }
.pay-card .btn { margin-top: 18px; }
.pay-note { margin-top: 18px; }
.pay-done h2 { margin-top: 10px; }
.big-check { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 1.5rem; font-weight: 700; }
.setting-value { font-weight: 600; font-size: 1.02rem; margin: 4px 0 10px; word-break: break-all; }

/* Notices */
.notice { padding: 12px 14px; border-radius: 8px; font-size: 0.9rem; margin: 0 0 16px; }
.signin-card .notice { margin: 12px 0; }
.notice-ok { background: var(--ok-bg); color: var(--ok); }
.notice-err { background: var(--err-bg); color: var(--err); }
.notice-info { background: var(--navy-soft); color: var(--navy); }

/* Status */
.status-pill { display: inline-block; background: var(--navy-soft); color: var(--navy); border: 1px solid var(--navy-mid); font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.badge-new { display: inline-block; background: var(--navy); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

/* Progress */
.progress { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; margin: 10px 0 8px; }
.progress span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }

/* Dropzone & uploads */
.dropzone { display: block; border: 2px dashed #d6d6d6; border-radius: var(--radius); padding: 28px 16px; text-align: center; color: var(--ink-soft); font-weight: 400; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; margin: 12px 0; }
.dropzone strong { color: var(--navy); }
.dropzone.drag { border-color: var(--navy); background: var(--navy-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.uploads { display: flex; flex-direction: column; gap: 6px; }
.upload-row { font-size: 0.85rem; display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; }
.upload-row .bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.upload-row .bar span { display: block; height: 100%; background: var(--navy); width: 0; transition: width .2s; }
.upload-row.done .bar span { background: var(--ok); }
.upload-row.fail { color: var(--err); }
.upload-row.busy .bar span { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* File list */
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.file-list li:first-child { border-top: none; }
.file-name { word-break: break-word; }
.file-meta { display: block; font-size: 0.78rem; color: var(--ink-soft); }
.file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty { color: var(--ink-soft); font-size: 0.88rem; padding: 6px 0; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 0.92rem; }
.checklist li:first-child { border-top: none; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d6d6d6; display: grid; place-items: center; flex-shrink: 0; font-size: 0.7rem; color: #fff; }
.checklist li.done .check { background: var(--ok); border-color: var(--ok); }
.checklist li.done .label { color: var(--ink-soft); }
.checklist .label { flex: 1; }
.checklist .state { font-size: 0.74rem; font-weight: 700; color: #8a5a00; background: #fff4e0; padding: 3px 9px; border-radius: 999px; }
.checklist li.done .state { color: var(--ok); background: var(--ok-bg); }
.checklist.editable li { cursor: pointer; }
.checklist.editable li.done .label { text-decoration: line-through; }
.checklist .remove { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 1rem; }
.inline-add { margin-top: 12px; flex-wrap: nowrap; }
.suggest { background: var(--navy-soft); border-radius: 10px; padding: 14px 16px; margin-top: 12px; }
.suggest p { margin: 0 0 6px; }
.suggest ul { margin: 0 0 12px; padding-left: 18px; font-size: 0.88rem; }

/* Admin */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); padding: 0 8px 10px; border-bottom: 1px solid var(--rule); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .sub { display: block; font-size: 0.78rem; color: var(--ink-soft); }
.add-client { margin-bottom: 20px; }
.add-client .row-actions { margin-top: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.danger-zone { border-color: #f1d2d4; }
.task-chips { list-style: none; padding: 0; margin: -8px 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.task-chips li { font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--rule); color: var(--ink-soft); }
.task-chips li.done { background: var(--ok-bg); border-color: #cde8d7; color: var(--ok); }
.q-admin { list-style: none; margin: 8px 0 0; padding: 0; }
.q-admin li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.q-admin li:first-child { border-top: none; }
.q-meta { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--ink-soft); }
.q-meta .link-btn { font-size: 0.82rem; }
.answers { margin: 0; }
.ans-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.88rem; }
.ans-row dt { color: var(--ink-soft); }
.ans-row dd { margin: 0; font-weight: 600; word-break: break-word; }
.ans-heading { font-family: var(--serif); font-weight: 600; color: var(--navy); margin: 14px 0 4px; }

/* Toast & dialog */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 0.9rem; box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 50; max-width: 90vw; }
dialog { border: none; border-radius: var(--radius); padding: 24px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.wide-dlg { max-width: 640px; max-height: 85vh; }
dialog::backdrop { background: rgba(13,12,11,0.45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg-head h2 { margin: 0; }
.dlg-close { border: 0; background: var(--navy-soft); color: var(--navy); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }

/* Footer (matches jdeanfinancialgroup.com) */
.site-footer { background: var(--black); color: rgba(255,255,255,0.75); padding: 64px 0 28px; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; }
.site-footer .wordmark { color: #fff; }
.footer-col h3 { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin: 28px 0 8px; }
.footer-col h3.first { margin-top: 0; }
.footer-col p { margin: 0; max-width: 460px; }
.footer-col a { color: rgba(255,255,255,0.85); }
.footer-bottom { border-top: 1px solid #2a2725; margin-top: 48px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.footer-bottom a { color: rgba(255,255,255,0.6); text-decoration: none; }

/* Messages */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.msg-card { display: flex; flex-direction: column; gap: 14px; }
.thread { list-style: none; margin: 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; }
.thread-admin { max-height: 340px; }
.thread .empty { text-align: center; padding: 24px 0; }
.msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-bubble { padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; background: var(--panel); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.msg.mine .msg-bubble { background: var(--navy); border-color: var(--navy); color: #fff; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg-meta { font-size: 0.74rem; color: var(--ink-soft); }
.msg-form { border-top: 1px solid var(--rule); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.msg-foot .hint { margin: 0; }
.badge-msg { display: inline-block; background: #fff4e0; color: #8a5a00; font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }


@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; gap: 0; }
  .msg { max-width: 92%; }
  .client-shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 68px; z-index: 15; height: auto; display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid var(--rule); }
  .side a { flex-shrink: 0; padding: 14px 16px; border-left: none; border-bottom: 3px solid transparent; font-size: 0.88rem; gap: 8px; }
  .side a.active { border-bottom-color: var(--navy); }
  .side-rule { display: none; }
  .nav-count { margin-left: 4px; }
  .task { grid-template-columns: 40px 1fr; gap: 6px 14px; }
  .task-ico { grid-row: span 2; }
  .task-text { grid-column: 2; }
  .task-action { grid-column: 2; margin-top: 8px; }
  .grid-2, #detailView .grid-2 { grid-template-columns: 1fr; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}
@media (max-width: 560px) {
  .brand-badge, .whoami { display: none; }
  .signin-card { padding: 34px 22px 26px; }
  .wordmark-lg { font-size: 1.04rem; letter-spacing: 0.04em; }
  .fields { grid-template-columns: 1fr; }
  .field.half { grid-column: 1 / -1; }
  .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .ans-row { grid-template-columns: 1fr; gap: 2px; }
}

/* Files tab folders */
.files-grid { grid-template-columns: 1.35fr 1fr; }
.card-head .btn .ico svg { width: 16px; height: 16px; }
.upload-to { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.upload-to label { white-space: nowrap; margin: 0; }
.upload-to select { flex: 1; }
.folders { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.folder { border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.folder summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; font-size: 0.93rem; }
.folder summary::-webkit-details-marker { display: none; }
.folder summary::after { content: "›"; margin-left: 8px; color: var(--ink-soft); font-size: 1.1rem; transition: transform .15s; }
.folder[open] summary::after { transform: rotate(90deg); }
.folder summary .ico { color: var(--navy); }
.folder-name { flex: 1; }
.folder-count { font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); }
.folder .file-list { padding: 0 14px 6px; border-top: 1px solid var(--rule); }
.folder .file-list li:first-child { border-top: none; }
.tight { margin: 0; }
.reset-note { margin: 14px 0 0; }
#emailForm .setting-value { margin: 0 0 6px; }
@media (max-width: 900px) { .files-grid { grid-template-columns: 1fr; } }
