/* Portal- and wizard-specific layout built on brand.css */

/* Setup wizard */
.wizard { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .wizard { grid-template-columns: 1fr; } }
.rail { position: sticky; top: 20px; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--radius); color: var(--ink-3); font-size: 15px; }
.rail li .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--outline); color: var(--ink-2); flex: none; }
.rail li.done { color: var(--ink); }
.rail li.done .n { background: var(--ok); color: #fff; }
.rail li.current { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.rail li.current .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.rail li.done .n { border-color: var(--ok); }
.rail li a { color: inherit; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--outline); align-items: flex-start; }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.checklist .pass .mark { background: var(--ok-bg); color: var(--ok); }
.checklist .warn .mark { background: var(--warn-bg); color: var(--warn); }
.checklist .fail .mark { background: var(--bad-bg); color: var(--bad); }
.checklist .t { font-weight: 700; }
.checklist .d { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.checklist .fix { color: var(--ink-2); font-size: 14px; margin-top: 6px; background: var(--surface-2); border-left: 3px solid var(--brand); padding: 8px 12px; border-radius: 0 8px 8px 0; }
.qr { width: 180px; height: 180px; border: 1px solid var(--outline); border-radius: var(--radius-sm); background: #fff; padding: 8px; }
.qr svg { width: 100%; height: 100%; }
.secret { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; word-break: break-all; }
.actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--outline); }

/* Onboarding */
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span { padding: 7px 14px; border-radius: var(--radius); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; background: var(--surface-2); border: 1px solid var(--outline); color: var(--ink-3); }
.steps span.done { background: #fff; color: var(--ink); border-color: var(--outline); }
.steps span.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: stretch; }
.plan { font-weight: 400; position: relative; background: #fff; border: 1px solid var(--outline); border-radius: var(--radius); padding: 34px 30px; display: flex; flex-direction: column; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.plan.featured { border: 2px solid var(--brand); }
.plan.selected { border: 2px solid var(--brand); box-shadow: 0 0 0 4px rgba(142,25,28,.10); }
.plan .tag { position: absolute; top: -13px; left: 30px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 4px 12px; border-radius: var(--radius); }
.plan h3 { margin-bottom: 6px; font-size: 22px; }
.plan .for { font-size: 15px; color: var(--ink-2); margin: 0 0 20px; line-height: 1.55; }
.plan .price-note { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; min-height: 22px; line-height: 1.5; }
.plan ul { list-style: none; margin: 24px 0 0; padding: 24px 0 0; border-top: 1px solid var(--outline); color: var(--ink); font-size: 16px; }
.plan li { position: relative; padding-left: 28px; margin-bottom: 11px; line-height: 1.5; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.plan li.inc { font-weight: 700; padding-left: 0; }
.plan li.inc::before { display: none; }
.plan input { position: absolute; opacity: 0; }
.plan .pick { margin-top: auto; padding-top: 24px; }
.plan .pick .btn { width: 100%; }
.plan.selected .pick .btn-outline { background: var(--brand); color: #fff; }
.datelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.datelist label { border: 1px solid var(--outline); border-radius: var(--radius); padding: 12px 10px; text-align: center; cursor: pointer; font-weight: 400; background: #fff; font-size: 15px; transition: transform .2s ease, box-shadow .2s ease; }
.datelist label:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.datelist input { position: absolute; opacity: 0; }
.datelist label.selected, .datelist label:has(input:checked) { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 700; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slots label { border: 1px solid var(--outline); border-radius: var(--radius); padding: 12px 10px; text-align: center; cursor: pointer; font-weight: 400; background: #fff; font-size: 15px; transition: transform .2s ease, box-shadow .2s ease; }
.slots label:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.slots input { position: absolute; opacity: 0; }
.slots label:has(input:checked) { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 700; }
.doc { background: #fff; border: 1px solid var(--outline); border-radius: var(--radius); padding: 32px 36px; max-height: 520px; overflow: auto; font-size: 16px; line-height: 1.6; }
.doc h1 { font-size: 28px; } .doc h2 { font-size: 20px; margin-top: 1.6rem; letter-spacing: -.5px; } .doc h3 { font-size: 17px; margin-top: 1.1rem; letter-spacing: -.3px; }
.doc table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.doc td, .doc th { border: 1px solid var(--outline); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); }
.summary-box { background: var(--surface-2); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 24px; }

/* Admin — Material 3 navigation drawer on brand tokens */
.admin-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .sidenav { position: static; height: auto; } }
.sidenav { background: var(--surface-2); border-right: 1px solid var(--outline); padding: 20px 12px 16px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.sidenav .brandmark { padding: 6px 16px 22px; flex-direction: column; align-items: flex-start; gap: 8px; }
.sidenav .brandmark img.logo { max-height: 40px; max-width: 200px; }
.sidenav .brandmark .sub { border: 0; padding: 0; }
.sidenav nav { flex: 1; }
.sidenav .sec { font-family: var(--body); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; color: var(--ink-3); padding: 18px 16px 6px; }
/* M3 navigation drawer item: 56px tall, full-pill active indicator, 8% state layer on hover */
.sidenav a.item { position: relative; display: flex; gap: 12px; align-items: center; height: 52px; padding: 0 16px 0 16px; border-radius: 28px; color: var(--ink-2); font-weight: 700; font-size: 15px; transition: background .2s ease, color .2s ease; overflow: hidden; }
.sidenav a.item::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.sidenav a.item:hover { text-decoration: none; color: var(--ink); }
.sidenav a.item:hover::before { opacity: .08; }
.sidenav a.item:active::before { opacity: .12; }
.sidenav a.item .ms { font-size: 24px; color: var(--ink-2); transition: color .2s ease; }
.sidenav a.item.active { background: rgba(142,25,28,.12); color: var(--brand); }
.sidenav a.item.active .ms { color: var(--brand); }
.sidenav a.item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sidenav-foot { border-top: 1px solid var(--outline); margin-top: 12px; padding-top: 12px; }
.sidenav-foot .who { display: flex; gap: 12px; align-items: center; padding: 6px 16px 10px; font-size: 14px; line-height: 1.3; }
.sidenav-foot .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .5px; flex: none; }
.admin-main { padding: 32px 36px 70px; }
/* M3 data-table row state layer */
table.data tbody tr { transition: background .15s ease; }
table.data tbody tr:hover td { background: rgba(24,24,24,.04); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { padding: 7px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--outline); color: var(--ink-2); font-size: 14px; font-weight: 700; }
.filters a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.toast-area { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: 0 18px 40px -20px rgba(24,24,24,.5); font-size: 15px; animation: fadein .2s ease; }
.toast.ok { background: #1e5a22; } .toast.bad { background: var(--bad); } .toast.warn { background: #6b4a00; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.audit li { font-size: .88rem; padding: 6px 0; border-bottom: 1px dashed var(--outline); }
.login-box { max-width: 440px; margin: 6vh auto; }
.banner { background: var(--warn-bg); color: #6b4a00; border-bottom: 1px solid #f0dca8; padding: 11px 0; font-size: 15px; }
.banner.bad { background: var(--bad-bg); color: #7a1a14; border-color: #f1c7c3; }
.editor textarea { min-height: 420px; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--outline); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 12px 16px; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabpane { display: none; } .tabpane.active { display: block; }
.countdown { font-family: var(--display); font-weight: 800; font-size: 56px; color: var(--brand); line-height: 1; letter-spacing: -1px; }

/* 1.1.3: sign-out is a POST form; the button looks like the surrounding nav links. */
form.signout { display: contents; margin: 0; }
button.navlink { font: inherit; border: 0; background: transparent; cursor: pointer; text-align: left; width: auto; }
.nav button.navlink { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius); color: var(--ink-2); font-weight: 700; font-size: 15px; }
.nav button.navlink:hover { background: var(--brand-light); color: var(--brand); }
.nav button.navlink .ms { font-size: 20px; color: var(--ink-3); }
.sidenav button.navlink.item { position: relative; display: flex; gap: 12px; align-items: center; height: 52px; padding: 0 16px; border-radius: 28px; color: var(--ink-2); font-weight: 700; font-size: 15px; width: 100%; }
.sidenav button.navlink.item:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.sidenav button.navlink.item .ms { font-size: 24px; color: var(--ink-2); }

/* 1.2.0: materials uploader */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2, #e7e3dd); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand, #8e191c); border-radius: 999px; }
ul.files, ul.upload-list { list-style: none; margin: 0 0 12px; padding: 0; }
ul.files li, ul.upload-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line, #e7e3dd); font-size: .92rem; flex-wrap: wrap; }
ul.files li .fname, ul.upload-list li .fname { font-weight: 700; word-break: break-word; flex: 1 1 160px; }
ul.files li .ms { font-size: 20px; color: var(--ink-3, #8a8a8a); }
form.inline { display: inline; margin: 0; }
.uploader label.btn { cursor: pointer; }
ul.upload-list li progress { flex: 1 1 120px; height: 8px; accent-color: var(--brand, #8e191c); }
ul.upload-list li.err { color: var(--bad, #b3261e); }
ul.upload-list li.ok .state { color: var(--ok, #1e7a3b); font-weight: 700; }

/* 1.2.1: phones. Header menu, tables as cards, vertical project tracker. */
.nav-toggle { display: none; }
/* 1.3.1: the tracker shares its row instead of scrolling (narrower beside the sidebar); labels wrap. */
.timeline .st { min-width: 0; padding-left: 2px; padding-right: 2px; overflow-wrap: break-word; }
/* 1.3.1: client portal and admin share the sidebar. Desktop: fixed column. Below 900 px: a top bar with Menu. */
.sidenav-head { display: contents; }
.sidenav-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sidenav-body nav { flex: 1; }
.sidenav-foot a.item { position: relative; display: flex; gap: 12px; align-items: center; height: 52px; padding: 0 16px; border-radius: 28px; color: var(--ink-2); font-weight: 700; font-size: 15px; }
.sidenav-foot a.item:hover { background: rgba(0,0,0,.06); color: var(--ink); text-decoration: none; }
.sidenav-foot a.item.active { background: rgba(142,25,28,.12); color: var(--brand); }
.sidenav-foot a.item .ms { font-size: 24px; }
.sidenav-foot form.signout { display: block; margin: 0; }
.shell-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.shell-main main.page { flex: 1; }
.portal-shell .sidenav .brandmark .sub { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
@media (max-width: 900px) {
  .sidenav { position: sticky; top: 0; z-index: 30; height: auto; max-height: 100vh; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--outline); }
  .sidenav-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .sidenav .brandmark { padding: 0; flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
  .sidenav .brandmark img.logo { max-height: 32px; max-width: min(170px, 46vw); }
  .sidenav .brandmark .sub { white-space: nowrap; font-size: 11px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink-2); background: transparent; border: 1px solid var(--outline); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; min-height: 44px; flex: none; }
  .nav-toggle .ms { font-size: 22px; }
  .sidenav-body { display: none; padding-top: 8px; overflow: auto; }
  .sidenav.nav-open .sidenav-body { display: flex; }
  .shell-main { min-height: 0; }
}
@media (max-width: 420px) { .sidenav .brandmark .sub { display: none; } }
@media (max-width: 760px) {
  .topbar .brandmark img.logo { max-height: 32px; max-width: min(170px, 46vw); }
  .topbar .brandmark .sub { font-size: 11px; letter-spacing: 1.5px; padding-left: 10px; white-space: nowrap; }

  /* Tables → stacked rows (labels come from the headers, added by app.js) */
  table.data.stacks, table.data.stacks tbody, table.data.stacks tr, table.data.stacks td { display: block; width: 100%; }
  table.data.stacks thead { display: none; }
  table.data.stacks tr { padding: 12px 0; border-bottom: 1px solid var(--outline); }
  table.data.stacks tr:last-child { border-bottom: 0; }
  table.data.stacks td { position: relative; border: 0; padding: 5px 0 5px 36%; text-align: left !important; overflow-wrap: anywhere; min-height: 28px; }
  table.data.stacks td::before { content: attr(data-label); position: absolute; left: 0; top: 7px; width: 33%; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); line-height: 1.3; }
  table.data.stacks td.no-label { padding-left: 0; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  table.data.stacks td.no-label::before { display: none; }
  table.data.stacks td .chip { white-space: normal; }
  table.data.stacks tbody tr:hover td { background: transparent; }
  /* Without JavaScript, tables scroll sideways instead of breaking the page. */
  table.data:not(.stacks) { display: block; overflow-x: auto; }

  /* Project tracker → vertical list */
  .timeline { display: block !important; }
  .timeline .st { text-align: left; min-width: 0; padding: 0 0 16px 28px; font-size: 14px; }
  .timeline .st::before { left: 0; top: 3px; margin-left: 0; }
  .timeline .st::after { left: 5px; right: auto; top: 18px; bottom: 0; width: 2px; height: auto; }
  .timeline .st:last-child { padding-bottom: 0; }

  .card-head { flex-wrap: wrap; align-items: center; }
  /* Comfortable cards on small screens */
  .card { padding: 20px 18px; }
  .page-head h1, main.page h1 { overflow-wrap: anywhere; }
}
@media (max-width: 420px) { .topbar .brandmark .sub { display: none; } }

/* 1.5.0: change request conversation */
ul.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
ul.thread li { border: 1px solid var(--outline); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
ul.thread li.from-us { background: var(--surface-2); }
ul.thread .who { font-size: .9rem; margin-bottom: 4px; }

/* 1.6.0: notices */
.notice-option.is-off { opacity: .7; }
pre.notice-text { white-space: pre-wrap; font-family: inherit; font-size: .95rem; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--outline); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 10px; }
ol.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
ol.steps-list li.done strong { color: var(--ok, #1e7a3b); }

/* Waitlist honeypot */
.hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.stat{font-family:"DM Serif Display",serif;font-size:2rem;line-height:1.1;margin:.25rem 0 .35rem}
.nowrap{white-space:nowrap}
.cap-note{width:120px}
.cap-later input{width:auto;flex:0 1 220px}
