/* MEC Site Evidence Online — prototype styles.
   MEC palette (Graphics- Logo/mec_colour_palette.html), same tokens as the phone app.
   Light and dark follow the system setting; the header bar is forest green in both. */

:root {
  --forest: #173E32;
  --forest-deep: #112E26;
  --green: #39734C;
  --lime: #D3E6A4;
  --lime-light: #E4EFC9;
  --sage: #E0E9DC;
  --amber: #B16B22;
  --warm-tint: #FFF4E9;
  --warm-dark: #763A1F;

  --bg: #F8F8F2;
  --surface: #FFFFFF;
  --surface-2: #EEF0E6;
  --surface-3: #E6E9DE;
  --text: #24392F;
  --muted: #5D6A60;
  --line: #D9DFD2;
  --primary: #39734C;
  --link: #2F6B43;
  --on-primary: #FFFFFF;
  --primary-soft: #E4EFC9;
  --on-primary-soft: #173E32;
  --ok: #2E7D4F;
  --ok-soft: #E3F1E6;
  --warn: #8A4E14;
  --warn-soft: #FFF4E9;
  --bad: #B3261E;
  --bad-soft: #FCE8E6;
  --focus: #B16B22;
  --shadow: 0 1px 2px rgba(23, 62, 50, .08), 0 4px 16px rgba(23, 62, 50, .06);
  --radius: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #112E26;
    --surface: #173E32;
    --surface-2: #14352B;
    --surface-3: #1D473A;
    --text: #F8F8F2;
    --muted: #AEC2A1;
    --line: #2C4A3D;
    --primary: #D3E6A4;
    --link: #D3E6A4;
    --on-primary: #112E26;
    --primary-soft: #395648;
    --on-primary-soft: #E4EFC9;
    --ok: #9FD7AE;
    --ok-soft: #1F4A36;
    --warn: #F0C9A2;
    --warn-soft: #5A2E18;
    --bad: #FFB4A9;
    --bad-soft: #5C1F18;
    --focus: #CAA587;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .2);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #112E26;
  --surface: #173E32;
  --surface-2: #14352B;
  --surface-3: #1D473A;
  --text: #F8F8F2;
  --muted: #AEC2A1;
  --line: #2C4A3D;
  --primary: #D3E6A4;
  --link: #D3E6A4;
  --on-primary: #112E26;
  --primary-soft: #395648;
  --on-primary-soft: #E4EFC9;
  --ok: #9FD7AE;
  --ok-soft: #1F4A36;
  --warn: #F0C9A2;
  --warn-soft: #5A2E18;
  --bad: #FFB4A9;
  --bad-soft: #5C1F18;
  --focus: #CAA587;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .2);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.icon { width: 20px; height: 20px; fill: currentColor; flex: none; vertical-align: -4px; }

/* ---------------------------------------------------------------- shell */

.demo-banner {
  background: var(--warm-tint);
  color: var(--warm-dark);
  font-size: .85rem;
  padding: 6px 16px;
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  text-align: center;
}
.demo-banner .btn { font-size: .8rem; padding: 2px 10px; min-height: 0; color: var(--warm-dark); }
.demo-banner .btn:hover { background: rgba(118, 58, 31, .1); }

.topbar {
  background: var(--forest);
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 60px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo { height: 30px; display: block; }
.topbar .product { font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.topbar .product small { color: var(--lime); font-weight: 500; display: block; font-size: .72rem; line-height: 1; }
.topbar .spacer { flex: 1; }
.topbar .who {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px; padding: 4px 6px 4px 12px; color: #fff; cursor: pointer; font: inherit;
}
.topbar .who .org { font-size: .78rem; color: var(--lime); display: block; line-height: 1.1; }
.topbar .who .name { font-size: .88rem; display: block; line-height: 1.2; text-align: left; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--forest);
  display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none;
}
.topbar .menu-btn { display: none; }

.layout { display: flex; min-height: calc(100vh - 60px); }
.sidenav {
  width: 232px; flex: none; padding: 16px 10px; border-right: 1px solid var(--line);
  background: var(--surface-2);
}
.sidenav .nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 12px 6px; }
.sidenav a {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.sidenav a:hover { background: var(--surface-3); }
.sidenav a.active { background: var(--primary-soft); color: var(--on-primary-soft); }
.sidenav a .count { margin-left: auto; background: var(--amber); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; }

.main { flex: 1; min-width: 0; padding: 24px 28px 64px; }
.container { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 640px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .topbar .product { display: none; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .who .org, .topbar .who .name { display: none; }
  .topbar .who { padding: 3px; }
  .sidenav {
    position: fixed; top: 60px; left: 0; bottom: 0; z-index: 30; transform: translateX(-100%);
    transition: transform .2s; box-shadow: var(--shadow); overflow-y: auto;
  }
  body.nav-open .sidenav { transform: none; }
  .main { padding: 16px 16px 64px; }
}

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.tonal { background: var(--primary-soft); color: var(--on-primary-soft); border-color: transparent; }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
:root[data-theme="dark"] .btn.danger { color: #3b0d08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #3b0d08; } }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: 12px 22px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(127, 127, 127, .15); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
label.field > small { display: block; margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=search], input[type=password], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }

.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { left: 19px; }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch.radio input { appearance: auto; width: 18px; height: 18px; background: none; margin-top: 3px; accent-color: var(--green); }
.switch.radio input::after { content: none; }
.switch .txt b { display: block; font-weight: 600; }
.switch .txt small { display: block; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 180px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } .grid4 { gap: 10px; } .stat .value { font-size: 1.4rem; } }

/* ---------------------------------------------------------------- cards, chips, tables */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin-top: 0; }
.card .card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card .card-head h2, .card .card-head h3 { margin: 0; flex: 1; }
.stack > * + * { margin-top: 16px; }
/* Report pages always look like paper, in light and dark mode. */
.card.paper { background: #fff; color: #24392F; border-color: #D9DFD2; color-scheme: light; }
.card.paper .muted, .card.paper .kv dt, .card.paper small { color: #5D6A60; }

.stat { padding: 16px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .82rem; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text); font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.chip .icon { width: 15px; height: 15px; vertical-align: -3px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.brand { background: var(--primary-soft); color: var(--on-primary-soft); }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px;
}
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice .grow { flex: 1; }
.notice p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }

.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); border-radius: 999px; }
:root[data-theme="dark"] .progress-bar { background: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .progress-bar { background: var(--lime); } }
.progress-label { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent;
  white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--green); }
:root[data-theme="dark"] .tabs a.active { border-bottom-color: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs a.active { border-bottom-color: var(--lime); } }
.tabs .badge { background: var(--amber); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .empty-icon { width: 48px; height: 48px; color: var(--green); }
.empty h3 { color: var(--text); margin-top: 8px; }

/* ---------------------------------------------------------------- projects */

.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { display: block; text-decoration: none; color: inherit; transition: transform .1s, border-color .1s; }
.project-card:hover { border-color: var(--green); transform: translateY(-1px); }
.project-card .top { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.project-card h3 { flex: 1; margin: 0; }
.project-card .meta { font-size: .85rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.project-card .meta span { display: inline-flex; gap: 4px; align-items: center; }
.project-card .meta .icon { width: 16px; height: 16px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search .icon { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--primary-soft); color: var(--on-primary-soft); }

/* Checklist editor */
.section-block { margin-bottom: 18px; }
.section-block h3 { display: flex; gap: 10px; align-items: baseline; }
.section-block h3 small { font-weight: 500; }
.item-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.item-row + .item-row { margin-top: 8px; }
.item-row .ref { font-weight: 700; color: var(--green); width: 3.2em; }
:root[data-theme="dark"] .item-row .ref { color: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .item-row .ref { color: var(--lime); } }
.item-row .t { font-weight: 600; }
.item-row .h { font-size: .85rem; color: var(--muted); }
.item-row .examples { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.item-row .examples img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; }
.item-row .switch { padding: 0; }
@media (max-width: 560px) {
  .item-row { grid-template-columns: 1fr auto; }
  .item-row .ref { display: none; }
}
.credit { font-size: .8rem; color: var(--muted); }

/* Progress board */
.board-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 70vh; }
.board { border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.board th, .board td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; text-align: center; }
.board thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: .75rem; min-width: 46px; }
.board thead th span { display: block; font-weight: 500; color: var(--muted); max-width: 90px; white-space: normal; line-height: 1.2; }
.board th.addr, .board td.addr { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 180px; white-space: nowrap; }
.board thead th.addr { z-index: 3; background: var(--surface-2); }
.cell {
  width: 30px; height: 30px; border-radius: 6px; display: inline-grid; place-items: center; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .75rem;
}
.cell .icon { width: 18px; height: 18px; }
.cell.done { background: var(--ok-soft); color: var(--ok); }
.cell.missing { background: var(--warn-soft); color: var(--warn); }
.cell.check { background: var(--bad-soft); color: var(--bad); }
.cell.optional { background: transparent; color: var(--muted); cursor: default; }
.cell.n-a { background: transparent; color: var(--line); cursor: default; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 10px 0; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .cell { width: 20px; height: 20px; cursor: default; }
.legend .cell .icon { width: 14px; height: 14px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.photo-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; display: block; width: 100%; }
.photo-tile:hover { border-color: var(--green); }
.photo-tile .img { aspect-ratio: 4 / 3; background: var(--surface-3); position: relative; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .flag { position: absolute; top: 6px; right: 6px; }
.photo-tile .cap { padding: 8px 10px; font-size: .82rem; }
.photo-tile .cap b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-tile .cap span { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.viewer { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; }
@media (max-width: 900px) { .viewer { grid-template-columns: minmax(0, 1fr); } }
.viewer .photo-main { background: #0b1612; border-radius: var(--radius); overflow: hidden; }
.viewer .photo-main img { width: 100%; display: block; }
.viewer .switcher { margin: 10px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.checks { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.checks li { display: flex; gap: 8px; padding: 5px 0; align-items: center; }
.checks .code { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--muted); width: 2.2em; }
.checks .res { margin-left: auto; font-weight: 700; font-size: .75rem; }
.checks .PASS { color: var(--ok); }
.checks .NOTE { color: var(--warn); }
.checks .FAIL { color: var(--bad); }
.minimap { height: 220px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); }
.bigmap { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); }

/* Share */
.qr { width: 184px; height: 184px; padding: 8px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); display: grid; place-items: center; }
.qr-fallback { font-size: .8rem; color: #5D6A60; text-align: center; padding: 8px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* Landing / public pages */
.public { min-height: calc(100vh - 60px); }
.hero { background: var(--forest); color: #fff; padding: 48px 16px 56px; }
.hero .inner { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero p { color: #d8e6d6; font-size: 1.05rem; }
.hero .card { color: var(--text); }
.hero .card p { color: var(--muted); font-size: inherit; }
@media (max-width: 860px) { .hero .inner { grid-template-columns: 1fr; } .hero h1 { font-size: 1.7rem; } }
.persona {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.persona:hover { border-color: var(--green); background: var(--surface-2); }
.persona .grow { flex: 1; }
.persona b { display: block; }
.persona small { display: block; }
.features { max-width: 1040px; margin: 0 auto; padding: 32px 16px; }
.feature .icon { width: 32px; height: 32px; color: var(--green); }
:root[data-theme="dark"] .feature .icon { color: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feature .icon { color: var(--lime); } }

.checkout { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 60px); }
.checkout .summary { background: var(--surface-2); padding: 40px; border-right: 1px solid var(--line); }
.checkout .payform { padding: 40px; max-width: 520px; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } .checkout .summary, .checkout .payform { padding: 24px 16px; } }
.price-lines { width: 100%; font-size: .95rem; }
.price-lines td { padding: 6px 0; border: 0; }
.price-lines tr.total td { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 12px; }
.sandbox { border: 2px dashed var(--amber); border-radius: var(--radius); padding: 10px 12px; color: var(--warn); background: var(--warn-soft); font-size: .85rem; margin-bottom: 16px; }

/* Emails outbox */
.email { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; }
.email + .email { margin-top: 10px; }
.email .subj { font-weight: 700; }
.email pre { white-space: pre-wrap; font: inherit; margin: 8px 0; color: var(--muted); }

/* Dialogs & toasts */
dialog.dialog {
  border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog.dialog.wide { width: min(920px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(10, 25, 20, .55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 6px 20px; }
.dialog-head h2 { flex: 1; margin: 0; font-size: 1.15rem; }
.dialog-body { padding: 8px 20px 12px; overflow-y: auto; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
.dialog-body img.zoom { width: 100%; border-radius: var(--radius); }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast {
  background: var(--forest); color: #fff; padding: 10px 18px; border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: all .25s; max-width: 520px; text-align: center;
}
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: #8c1d17; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; background: var(--surface-2);
  cursor: pointer;
}
.drop.over { border-color: var(--green); background: var(--primary-soft); }
.drop .icon { width: 36px; height: 36px; color: var(--green); }

.hide-sm { }
@media (max-width: 620px) { .hide-sm { display: none !important; } }

.phone-mock {
  width: 260px; border-radius: 28px; border: 8px solid #10241d; background: var(--bg); overflow: hidden; box-shadow: var(--shadow);
  margin: 0 auto;
}
.phone-mock .bar { background: var(--forest); color: #fff; padding: 10px 14px; font-weight: 600; font-size: .9rem; }
.phone-mock .body { padding: 14px; font-size: .85rem; }
