/* HSFiles demo — theme from the product spec (safety green, clean white, slate, amber, red) */
:root {
  --green: #075B39;
  --green-700: #05472c;
  --green-100: #d6e9df;
  --green-50: #e9f3ee;
  --bg: #F3F5F4;
  --card: #ffffff;
  --slate: #243746;
  --slate-900: #152430;
  --muted: #5d6b77;
  --line: #dfe5e2;
  --amber: #E7B64B;
  --amber-50: #fcf4e1;
  --amber-700: #8a6411;
  --red: #C94D42;
  --red-50: #f9e7e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36, 55, 70, .05), 0 4px 14px rgba(36, 55, 70, .06);
  --font: "Segoe UI", Inter, Roboto, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--slate);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
:focus-visible { outline: 3px solid rgba(7, 91, 57, .35); outline-offset: 2px; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none;
  background: var(--slate); color: #fff;
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 800; font-size: 23px; letter-spacing: -.02em;
  padding: 4px 8px 24px;
}
.brand .logo { width: 32px; height: 38px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  color: #c9d3da; padding: 11px 12px; border-radius: 10px; font-weight: 600;
}
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: var(--green); color: #fff; }
.side-foot {
  margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 14px 4px 0; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--amber); color: var(--slate);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.avatar.green { background: var(--green-50); color: var(--green); }
.who { flex: 1; min-width: 0; }
.who strong { display: block; font-size: 14px; }
.who small { display: block; color: #9fb0bc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .icon-btn { color: #c9d3da; }
.side-foot .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  background: rgba(243, 245, 244, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand { display: none; color: var(--green); font-size: 20px; padding: 0; }
.topbar .brand .logo { width: 26px; height: 31px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--slate);
}
.icon-btn:hover { background: rgba(36, 55, 70, .07); }
.content {
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 28px 32px 32px;
  display: flex; flex-direction: column; gap: 20px;
}
.content.narrow { max-width: 760px; }
.disclaimer { padding: 0 32px 24px; text-align: center; color: var(--muted); font-size: 12.5px; }
.bottomnav { display: none; }

/* ---------- Building blocks ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card > h3, .section-title { font-size: 16px; font-weight: 700; }
.card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h3 { font-size: 16px; }
.card-head a { font-size: 14px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.grid-2 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font-weight: 700; font-size: 15px; border: 1.5px solid transparent;
  transition: background .15s, border-color .15s;
  text-align: center;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-primary:disabled { background: #9db5aa; cursor: not-allowed; }
.btn-outline { border-color: var(--green); color: var(--green); background: #fff; }
.btn-outline:hover { background: var(--green-50); }
.btn-light { background: #fff; color: var(--slate); border-color: var(--line); }
.btn-light:hover { background: #f7f9f8; }
.btn-ghost { background: transparent; color: var(--slate); }
.btn-ghost:hover { background: rgba(36, 55, 70, .06); }
.btn-danger { background: #fff; color: var(--red); border-color: #efc5c0; }
.btn-danger:hover { background: var(--red-50); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.link-btn { border: 0; background: none; color: var(--green); font-weight: 700; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--green-50); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: var(--red-50); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip-green { background: var(--green-50); color: var(--green); }
.chip-amber { background: var(--amber-50); color: var(--amber-700); }
.chip-red { background: var(--red-50); color: var(--red); }
.chip-grey { background: #eef1f0; color: var(--muted); }
.chip-light { background: rgba(255, 255, 255, .16); color: #fff; }

.bar { display: block; height: 7px; background: #e3e9e6; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .3s; }
.bar.amber i { background: var(--amber); }
.bar.red i { background: var(--red); }
.progress-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.progress-line strong { font-size: 15px; }
.progress-line span { color: var(--muted); font-size: 14px; }

.tile {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--green-50); color: var(--green);
}
.tile.red { background: var(--red-50); color: var(--red); }
.tile.amber { background: var(--amber-50); color: var(--amber-700); }
.tile.slate { background: #e9edf0; color: var(--slate); }
.tile.lg { width: 52px; height: 52px; border-radius: 14px; }
.tile.lg .ic { width: 26px; height: 26px; }

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
  color: var(--slate); width: 100%;
}
button.row { border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.row:last-child { border-bottom: 0; }
a.row:hover, button.row:hover { background: #f6f8f7; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-main strong { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small, .row-end small { color: var(--muted); font-size: 13px; }
.row-main .bar { margin-top: 5px; max-width: 320px; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.row-actions { display: flex; gap: 4px; flex: none; }
.chev { color: #9aa7b1; }
summary::-webkit-details-marker { display: none; }
details[open] > summary .chip { outline: 1.5px solid currentColor; }
.status-ok { color: var(--green); }
.status-none { color: #b7c1c8; }
.status-ok .ic, .status-none .ic { width: 26px; height: 26px; }
.group-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 16px 6px 4px;
}
.group-title:first-child { padding-top: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 36px; height: 36px; color: #a9b6bf; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  background: var(--amber-50); color: #6b4e0e; border: 1px solid #f0d797;
}
.notice.info { background: var(--green-50); border-color: var(--green-100); color: var(--green-700); }
.notice.danger { background: var(--red-50); border-color: #efc5c0; color: #8e2f26; }
.notice .ic { margin-top: 1px; }
.notice p + p { margin-top: 4px; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.actions.start { justify-content: flex-start; }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .label { font-weight: 650; font-size: 14px; }
.field .req { color: var(--red); }
.field small { color: var(--muted); font-size: 12.5px; }
.input {
  min-height: 48px; width: 100%;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 0 14px; font: inherit; color: var(--slate); background: #fff;
}
select.input { padding-right: 8px; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(7, 91, 57, .15); }
.input.invalid { border-color: var(--red); }
.input-wrap { position: relative; }
.input-wrap > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap .input { padding-left: 42px; }
.input-wrap .toggle-pw { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px;
  font-weight: 650; cursor: pointer; background: #fff;
}
.seg input:checked + span { border-color: var(--green); background: var(--green-50); color: var(--green); }
.seg input:focus-visible + span { outline: 3px solid rgba(7, 91, 57, .35); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.Low { background: var(--green); } .dot.Medium { background: var(--amber); } .dot.High { background: var(--red); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--green); margin-top: 1px; }

.search-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-bar .input-wrap { flex: 1; min-width: 220px; }

.tabs {
  display: flex; gap: 4px; background: #e6ebe9; padding: 4px; border-radius: 12px;
  width: max-content; max-width: 100%; overflow-x: auto;
}
.tabs a { padding: 8px 14px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs a.active { background: #fff; color: var(--green); box-shadow: var(--shadow); }

/* ---------- Login / register ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 72% 78%, rgba(231, 182, 75, .55), transparent 42%),
    linear-gradient(170deg, var(--slate-900) 0%, var(--slate) 55%, #4d4a3c 100%);
  padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.auth-hero .skyline { position: absolute; left: 0; bottom: 0; width: 100%; height: 52%; }
.auth-hero > *:not(.skyline) { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo .logo { width: 62px; height: 72px; }
.auth-logo span { font-size: 54px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.auth-hero h2 { font-size: 30px; font-weight: 700; max-width: 18ch; line-height: 1.25; }
.auth-hero .tagline { color: #d3dce2; font-size: 17px; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 0; list-style: none; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #e7edf1; }
.auth-points .ic { color: var(--amber); }
.auth-panel { display: grid; place-items: center; padding: 40px 20px; background: var(--bg); }
.auth-card { width: min(100%, 420px); display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 27px; font-weight: 800; letter-spacing: -.01em; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.auth-row a { font-weight: 650; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; }
.auth-foot strong { color: var(--green); }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 9px; background: #dfe5e2; }
.steps i.on { background: var(--green); }
.pw-meter { display: flex; gap: 4px; margin-top: 2px; }
.pw-meter i { flex: 1; height: 4px; border-radius: 4px; background: #e3e7ea; }
.pw-meter[data-s="1"] i:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-s="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-s="3"] i:nth-child(-n+3) { background: var(--green); }
.pw-meter[data-s="4"] i { background: var(--green); }

/* ---------- Dashboard ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.stat .num { font-size: 32px; font-weight: 800; color: var(--green); line-height: 1.15; }
.stat.red .num { color: var(--red); }
.stat.amber .num { color: var(--amber-700); }
.stat small { color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 12px; font-weight: 650; color: var(--slate); text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.qa:hover { border-color: var(--green); transform: translateY(-1px); }

/* ---------- Site ---------- */
.site-hero {
  position: relative; overflow: hidden; color: #fff;
  min-height: 200px; border-radius: var(--radius);
  background:
    radial-gradient(circle at 75% 85%, rgba(231, 182, 75, .5), transparent 45%),
    linear-gradient(170deg, var(--slate-900), var(--slate) 60%, #4d4a3c);
  display: flex; align-items: flex-end; padding: 22px;
}
.site-hero .skyline { position: absolute; left: 0; bottom: 0; width: 100%; height: 75%; }
.site-hero .hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.site-hero h2 { font-size: 26px; font-weight: 800; }
.site-hero p { display: flex; align-items: center; gap: 6px; color: #d9e1e6; }
.site-head { display: flex; align-items: center; gap: 14px; }
.site-head .row-main strong { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
.preview-box { background: var(--green-50); border: 1px solid var(--green-100); border-radius: 12px; padding: 14px 16px; }
.preview-box .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.preview-box .chips .chip { background: #fff; }

/* ---------- Upload ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 38px 16px; border: 2px dashed #b4c9be; border-radius: var(--radius);
  background: var(--green-50); cursor: pointer; text-align: center; color: var(--slate);
  transition: background .15s, border-color .15s;
}
.dropzone > .ic { width: 42px; height: 42px; color: var(--green); stroke-width: 1.6; }
.dropzone strong { font-size: 16px; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dropzone:hover, .dropzone.drag { border-color: var(--green); background: var(--green-100); }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ---------- File viewer ---------- */
.preview {
  background: #e7ecea; border-radius: var(--radius); padding: 24px;
  display: grid; place-items: center; min-height: 420px;
}
.preview img { max-width: 100%; max-height: 70vh; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.preview iframe { width: 100%; height: 70vh; border: 0; border-radius: 6px; background: #fff; }
.paper {
  width: min(100%, 360px); aspect-ratio: 1 / 1.35; background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 30px 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.paper-title { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 12.5px; letter-spacing: .06em; margin-bottom: 10px; text-transform: uppercase; }
.paper-title .logo { width: 22px; height: 26px; }
.paper i { display: block; height: 7px; background: #e3e7ea; border-radius: 4px; }
.paper i.h { height: 10px; width: 55%; background: #cfd6db; margin-top: 8px; }
.paper-note { margin-top: auto; font-size: 12px; color: var(--muted); text-align: center; }
.viewer-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  font-weight: 650; color: var(--slate);
}
.act:hover { border-color: var(--green); color: var(--green); }
.act.danger { color: var(--red); }
.act.danger:hover { border-color: var(--red); background: var(--red-50); }

/* ---------- Export ---------- */
.option {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; background: #fff;
}
.option + .option { margin-top: 10px; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .tick { margin-left: auto; color: #c7d0d6; }
.option:has(input:checked) { border-color: var(--green); background: var(--green-50); }
.option:has(input:checked) .tick { color: var(--green); }
.option:has(input:focus-visible) { outline: 3px solid rgba(7, 91, 57, .35); }
.ready { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px; }
.ready h2 { font-size: 26px; font-weight: 800; }
.big-check {
  width: 78px; height: 78px; border-radius: 50%; margin-bottom: 8px;
  background: var(--green); color: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 10px var(--green-50);
  animation: pop .35s ease-out;
}
.big-check .ic { width: 40px; height: 40px; stroke-width: 2.6; }
.ready .dl { margin-top: 10px; text-align: left; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}

/* ---------- Subscription, checkout & account ---------- */
.auth-card.wide { width: min(100%, 560px); }
.seg.cycle { max-width: 420px; min-width: min(100%, 340px); }
.seg.cycle span { padding: 0 12px; white-space: nowrap; }
.seg.cycle em { font-style: normal; font-size: 11px; padding: 2px 8px; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-list .option + .option { margin-top: 0; }
.price { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; flex: none; }
.price strong { font-size: 19px; font-weight: 800; color: var(--green); line-height: 1.1; }
.price small { color: var(--muted); font-size: 12.5px; }
.option .price + .tick { margin-left: 4px; }
.summary {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff;
  display: flex; flex-direction: column; gap: 8px;
}
.summary-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.summary-row small { display: block; color: var(--muted); font-size: 13px; }
.summary-row.total { border-top: 1px solid var(--line); padding-top: 10px; font-size: 16px; }
.summary-row.total strong { color: var(--green); font-size: 18px; }
.card-brand {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate); background: #eef1f0; padding: 3px 8px; border-radius: 6px;
}
.card-brand:empty { display: none; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; text-align: center; }
.secure-note .ic { width: 16px; height: 16px; color: var(--green); }
.price-lg { color: var(--muted); }
.price-lg strong { font-size: 30px; font-weight: 800; color: var(--green); letter-spacing: -.01em; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; gap: 12px; }
.plan-card.popular { border-color: var(--green-100); }
.plan-card.current { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-100), var(--shadow); }
.plan-card .btn { margin-top: auto; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .ic { width: 18px; height: 18px; color: var(--green); margin-top: 1px; }
.checks.loss .ic { color: var(--red); }
.plan-switch { display: flex; align-items: center; gap: 16px; }
.plan-switch > div { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #f6f8f7; }
.plan-switch > div:last-child { background: var(--green-50); }
.plan-switch strong { font-size: 18px; }
.plan-switch > .ic { color: var(--muted); }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-list label {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600;
}
.radio-list input { width: 18px; height: 18px; accent-color: var(--green); }
.radio-list label:has(input:checked) { border-color: var(--green); background: var(--green-50); }
textarea.input { min-height: 90px; padding: 12px 14px; resize: vertical; }
.notice > .btn { align-self: center; flex: none; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(92vw, 440px);
}
.toast {
  background: var(--slate); color: #fff; padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); display: flex; gap: 10px; align-items: center;
  animation: pop .2s ease-out;
}
.toast .ic { color: #8fd3b3; }
.toast.error { background: var(--red); }
.toast.error .ic { color: #fff; }

@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dialog / bottom sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(21, 36, 48, .45);
  display: grid; place-items: center; padding: 16px;
  opacity: 0; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: min(100%, 420px); background: #fff; border-radius: 18px;
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  transform: translateY(12px) scale(.98); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet h2 { font-size: 19px; font-weight: 800; }
.sheet-grip { display: none; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #b23f35; }
.btn-danger-solid:disabled { background: #e2a9a3; cursor: not-allowed; }

/* ---------- Floating action button & helpers ---------- */
.fab { display: none; }
.mobile-only { display: none !important; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Phones & small tablets: native-app layout */
@media (max-width: 900px) {
  body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
  .sidebar, .desk-only { display: none !important; }
  .mobile-only { display: grid !important; }
  .main { overflow-x: clip; }

  /* App bar */
  .topbar {
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0 16px;
    background: rgba(255, 255, 255, .97); gap: 6px;
  }
  .is-sub .topbar { padding-left: 4px; }
  .topbar h1 { font-size: 18px; }
  .topbar .brand { display: none; }
  .is-home .topbar .brand { display: flex; }
  .is-home .topbar h1 { display: none; }
  .topbar .avatar.sm { margin-right: 4px; }
  .back-btn .ic { width: 24px; height: 24px; }

  /* Content */
  .content { padding: 16px 16px 24px; gap: 16px; }
  .is-top .content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .disclaimer { display: none; }
  .card { border-radius: 16px; box-shadow: 0 1px 2px rgba(36, 55, 70, .05); }
  .grid-2, .grid-2.even { grid-template-columns: 1fr; gap: 16px; }
  .plan-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; text-align: center; }
  .is-sub .site-hero { margin: -16px -16px 0; border-radius: 0; min-height: 220px; }

  /* Touch-sized controls (16px inputs stop iOS zooming in) */
  .btn { min-height: 50px; border-radius: 12px; }
  .input { min-height: 50px; font-size: 16px; }
  .row { min-height: 60px; }
  .btn:active:not(:disabled) { transform: scale(.98); }
  a.row:active, button.row:active, label.row:active { background: #eef2f0; }
  .qa:active, .act:active, .option:active { transform: scale(.97); }
  .qa:hover { transform: none; }

  /* Sub-pages hide the tab bar; their final action row becomes a sticky bottom bar */
  .is-sub .content > .actions:last-child:not(.start) {
    position: sticky; bottom: 0; z-index: 4; flex-wrap: nowrap;
    margin: 4px -16px -24px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(36, 55, 70, .06);
  }
  .is-sub .content > .actions:last-child:not(.start) .btn { flex: 1; }
  .is-sub .content > .actions:last-child:not(.start) .btn-ghost { flex: 0 0 auto; }

  /* Tab bar */
  .is-sub .bottomnav { display: none; }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(36, 55, 70, .05);
    user-select: none;
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 2px 0;
  }
  .bottomnav a .ic {
    width: 22px; height: 22px; padding: 4px 16px; box-sizing: content-box;
    border-radius: 999px; transition: background .2s, color .2s;
  }
  .bottomnav a.active { color: var(--green); font-weight: 700; }
  .bottomnav a.active .ic { background: var(--green-50); }

  /* Floating action button */
  .fab {
    display: grid; place-items: center; position: fixed; z-index: 9;
    right: 16px; bottom: calc(88px + env(safe-area-inset-bottom));
    width: 58px; height: 58px; border-radius: 18px;
    background: var(--green); color: #fff;
    box-shadow: 0 8px 22px rgba(7, 91, 57, .35);
  }
  .fab .ic { width: 26px; height: 26px; stroke-width: 2.4; }
  .fab:active { transform: scale(.94); }

  /* Toasts drop in under the app bar */
  .toasts { top: calc(64px + env(safe-area-inset-top)); bottom: auto; }

  /* Dashboard */
  .hello h2 { font-size: 26px; }
  .stats { gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat .num { font-size: 26px; }
  .quick { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .qa { padding: 12px 4px; gap: 8px; font-size: 12px; line-height: 1.25; border-radius: 14px; }
  .qa .tile.lg { width: 42px; height: 42px; border-radius: 12px; }
  .qa .tile.lg .ic { width: 22px; height: 22px; }

  /* Bottom sheet */
  .sheet-backdrop { place-items: end stretch; padding: 0; }
  .sheet {
    width: 100%; border-radius: 22px 22px 0 0;
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 9px; background: #d5dcd9; margin: 0 auto 8px; }

  /* Login splash & auth sheet */
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .auth-hero {
    padding: calc(28px + env(safe-area-inset-top)) 24px 64px;
    align-items: center; text-align: center; gap: 10px;
  }
  .auth-hero .skyline { height: 60%; }
  .auth-logo { flex-direction: column; gap: 6px; }
  .auth-logo .logo { width: 54px; height: 63px; }
  .auth-logo span { font-size: 38px; }
  .auth-hero h2 { font-size: 20px; max-width: 22ch; }
  .auth-hero .tagline { font-size: 15px; }
  .auth-points { display: none; }
  .auth.splash .auth-hero { min-height: 44vh; justify-content: center; }
  .auth.compact .auth-hero { padding: calc(18px + env(safe-area-inset-top)) 20px 48px; }
  .auth.compact .auth-hero h2, .auth.compact .auth-hero .tagline { display: none; }
  .auth.compact .auth-logo { flex-direction: row; }
  .auth.compact .auth-logo .logo { width: 34px; height: 40px; }
  .auth.compact .auth-logo span { font-size: 28px; }
  .auth-panel {
    position: relative; z-index: 2; margin-top: -28px;
    border-radius: 24px 24px 0 0; place-items: start center;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
  }
}

@media (max-width: 600px) {
  .form { grid-template-columns: 1fr; }
  .actions .btn { flex: 1; }
  .viewer-actions { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .act { padding: 12px 4px; font-size: 12.5px; }
  .preview { padding: 14px; min-height: 320px; }
  .card { padding: 16px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .row-main .bar { max-width: none; }
  .notice:has(> .btn) { flex-wrap: wrap; }
  .plan-switch { gap: 8px; }
  .option .tick { display: none; }
}

/* Screen transitions (phones only, respecting reduced motion) */
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .anim-push { animation: pushIn .3s cubic-bezier(.2, .8, .2, 1); }
  .anim-pop { animation: popIn .3s cubic-bezier(.2, .8, .2, 1); }
  .anim-fade { animation: fadeIn .2s ease-out; }
}
@keyframes pushIn { from { transform: translateX(30%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes popIn { from { transform: translateX(-20%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

