/* StewardLink — palette drawn from the app icon:
   teal gradient #92DCC2 → #1F9AA2 → #0E6A85, shield navy #1A4F7C, door navy #0B3556,
   dome amber #FEAB1C, status red #E8412C / amber #FEAB1C / green #5DA955, cream #F9F2EA */
:root {
  --teal-light: #92DCC2;
  --teal: #1F9AA2;
  --teal-mid: #137A8F;
  --teal-deep: #0E6A85;
  --navy: #1A4F7C;
  --navy-deep: #0B3556;
  --amber: #FEAB1C;
  --amber-deep: #C77F00;
  --cream: #F9F2EA;
  --s-r: #E8412C; --s-y: #FEAB1C; --s-g: #5DA955; --s-u: #9AAAB4;

  --bg: #EEF6F5;
  --surface: #FFFFFF;
  --surface-2: #F5FAF9;
  --border: #D3E6E4;
  --text: #0B3556;
  --text-2: #456A80;
  --primary: var(--navy);
  --primary-hover: var(--navy-deep);
  --primary-text: #fff;
  --link: #0E6A85;
  --focus: var(--amber);
  --shadow: 0 1px 2px rgba(11, 53, 86, .06), 0 6px 18px rgba(11, 53, 86, .07);
  --radius: 16px;
  --header-grad: radial-gradient(120% 160% at 0% 0%, rgba(146, 220, 194, .85) 0%, rgba(146, 220, 194, 0) 55%),
                 linear-gradient(120deg, #2AA6A6 0%, #137A8F 55%, #0B5E7E 100%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #072536; --surface: #0C3249; --surface-2: #0F3A54; --border: #1C4D69; --text: #E6F3F1; --text-2: #9CC3C8;
    --primary: #2BB0AE; --primary-hover: #49C7BF; --primary-text: #062233; --link: #7FD7C6; --cream: #123F57;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #072536; --surface: #0C3249; --surface-2: #0F3A54; --border: #1C4D69; --text: #E6F3F1; --text-2: #9CC3C8;
  --primary: #2BB0AE; --primary-hover: #49C7BF; --primary-text: #062233; --link: #7FD7C6; --cream: #123F57;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .15rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0; }
h3.sub { font-size: .95rem; margin: 1.1rem 0 .5rem; color: var(--text-2); }
p { margin: .4rem 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: .1rem .35rem; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: var(--navy-deep); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.err { color: var(--s-r); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: .75rem; } .gap-xs { gap: .35rem; }
.center { justify-content: center; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) .6rem calc(1rem + env(safe-area-inset-left));
  background: var(--header-grad); color: #fff; box-shadow: 0 2px 12px rgba(11, 53, 86, .25); }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 2px 6px rgba(11, 53, 86, .35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.2rem; letter-spacing: .01em; }
.brand-text small { font-size: .72rem; opacity: .85; letter-spacing: .06em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }

.sync-badge { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid rgba(255, 255, 255, .35); background: rgba(11, 53, 86, .28);
  color: #fff; font: inherit; font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; cursor: pointer; min-height: 32px; }
.sb-dot { width: 9px; height: 9px; border-radius: 50%; background: #c9d6dc; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.sb-synced .sb-dot { background: var(--s-g); } .sb-pending .sb-dot, .sb-syncing .sb-dot { background: var(--s-y); }
.sb-error .sb-dot { background: var(--s-r); } .sb-offline .sb-dot { background: #8aa; }
.sb-syncing .sb-dot { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.card .sync-badge { background: var(--navy); border-color: transparent; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); }
.sidenav { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); padding: 1rem .75rem; display: flex; flex-direction: column; gap: .2rem;
  background: var(--surface); border-right: 1px solid var(--border); }
.sidenav a { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 12px; color: var(--text); font-weight: 600; position: relative; min-height: 46px; }
.sidenav a:hover { background: var(--surface-2); text-decoration: none; }
.sidenav a.active { background: var(--navy); color: #fff; }
.sidenav a.active::before { content: ""; position: absolute; left: -.75rem; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--amber); }
.ni { width: 1.4rem; text-align: center; font-size: 1.1rem; color: var(--teal); }
.sidenav a.active .ni { color: var(--amber); }
.sidenav-foot { margin-top: auto; font-size: .75rem; color: var(--text-2); display: flex; align-items: center; gap: .5rem; padding: .5rem; }
.legend-mini { display: inline-flex; gap: 3px; }
.view { padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 3rem; max-width: 1240px; width: 100%; outline: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidenav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; justify-content: space-around;
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(11, 53, 86, .08); }
  .sidenav a { flex-direction: column; gap: .1rem; padding: .35rem .2rem; font-size: .7rem; flex: 1; justify-content: center; min-height: 54px; border-radius: 10px; }
  .sidenav a.active { background: transparent; color: var(--teal-mid); }
  .sidenav a.active::before { left: 30%; right: 30%; top: -.36rem; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .ni { font-size: 1.3rem; }
  .sidenav-foot { display: none; }
  .view { padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  .hide-sm { display: none !important; }
  .sync-badge .sb-label { display: none; }
  .sync-badge { padding: .3rem .55rem; }
  .brand-text small { display: none; }
  h1 { font-size: 1.35rem; }
}

/* ---------- common blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.link { font-weight: 600; font-size: .9rem; }
.grid-2, .dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.span-2 { grid-column: span 2; }
@media (max-width: 860px) { .grid-2, .dash-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--text-2); margin-bottom: .4rem; }
.toolbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }

.hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 1.5rem; margin-bottom: 1rem;
  border-radius: 20px; color: #fff; background: var(--header-grad); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border: 18px solid rgba(26, 79, 124, .35);
  border-radius: 50% 50% 46% 46% / 40% 40% 60% 60%; pointer-events: none; }
.hero h1 { color: #fff; }
.hero p { opacity: .92; margin: 0; }
.hero-stats { display: flex; gap: .6rem; flex-wrap: wrap; position: relative; z-index: 1; }
.stat { background: rgba(255, 255, 255, .95); color: var(--navy-deep); border-radius: 14px; padding: .55rem .9rem; min-width: 84px; text-align: center; box-shadow: 0 2px 8px rgba(11, 53, 86, .15); }
.stat:hover { text-decoration: none; }
.stat b { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: 1.35rem; line-height: 1.1; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #456A80; }
@media (max-width: 560px) { .hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; gap: .4rem; } .stat { min-width: 0; padding: .5rem .2rem; } .stat span { font-size: .62rem; } }

.notice { display: grid; gap: .5rem; margin-bottom: 1rem; }
.notice-item { display: flex; gap: .6rem; align-items: center; padding: .75rem 1rem; border-radius: 14px; background: #FFF4DD; border: 1px solid #F7D592; color: #6B4600; }
.notice-item:hover { text-decoration: none; filter: brightness(.98); }

/* ---------- status dots (raised, like the icon) ---------- */
.dot { display: inline-block; flex: none; border-radius: 50%; background: var(--s-u); vertical-align: middle;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 1px 3px rgba(11, 53, 86, .3); border: 2px solid #fff; }
.s-r { background: var(--s-r); } .s-y { background: var(--s-y); } .s-g { background: var(--s-g); } .s-u { background: var(--s-u); }
.dot-xs { width: 11px; height: 11px; border-width: 1.5px; } .dot-sm { width: 14px; height: 14px; }
.dot-md { width: 20px; height: 20px; } .dot-lg { width: 26px; height: 26px; border-width: 3px; } .dot-xl { width: 40px; height: 40px; border-width: 4px; }
button.dot { cursor: pointer; padding: 0; position: relative; transition: transform .12s; }
button.dot::after { content: ""; position: absolute; inset: -10px; }
button.dot:hover { transform: scale(1.12); }
button.dot.dot-md, button.dot.dot-sm { width: 24px; height: 24px; border-width: 3px; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .5rem 1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: .3rem .75rem; font-size: .84rem; border-radius: 10px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--navy-deep); }
.btn-amber:hover { background: #ffbd47; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--s-r); color: #fff; border-color: var(--s-r); }
.btn-danger:hover { background: #c73320; }
.btn-danger-ghost { background: transparent; color: var(--s-r); border-color: transparent; margin-right: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.copy-btn { font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .2rem .5rem; margin-left: .35rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--teal-deep); cursor: pointer; vertical-align: middle; min-height: 26px; }
.copy-btn:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
:root[data-theme="dark"] .copy-btn { color: var(--link); }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px; padding: .6rem .75rem; width: 100%; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 154, 162, .25); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--navy); }
.search { max-width: 340px; flex: 1; min-width: 180px; }
.status-select { width: auto; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.lbl { font-size: .82rem; font-weight: 700; color: var(--text-2); }
.req { color: var(--s-r); }
.help { font-size: .78rem; color: var(--text-2); }
.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; min-height: 36px; }
.multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .1rem .75rem; max-height: 220px; overflow: auto; padding: .4rem .6rem; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.status-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.status-opt { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .6rem .3rem; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .85rem; background: var(--surface); }
.status-opt input { position: absolute; opacity: 0; pointer-events: none; }
.status-opt:has(input:checked) { border-color: var(--navy); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(26, 79, 124, .15); }
.status-opt:has(input:focus-visible) { outline: 3px solid var(--focus); }
.status-opt .dot { width: 28px; height: 28px; border-width: 3px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- pills / chips ---------- */
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.pill-new { background: #E4F1FA; color: #1A4F7C; border-color: #BFD8EA; }
.pill-open { background: #FFF1D6; color: #7A4F00; border-color: #F7D592; }
.pill-done { background: #E5F3E2; color: #2F6B27; border-color: #C3E1BD; }
.pill-p-urgent { background: var(--s-r); color: #fff; border-color: var(--s-r); }
.pill-p-high { background: #FDE3DF; color: #A92B19; border-color: #F6BDB4; }
.pill-p-normal { background: var(--surface-2); }
.pill-p-low { background: transparent; }
.pill-temp { background: #F9F2EA; color: #7A5A2E; border-color: #EADCC8; }
.pill-alert { background: #FDE3DF; color: #A92B19; border-color: #F6BDB4; }
.pill-kind { background: #E2F4F2; color: #0E6A85; border-color: #BDE3DE; }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; }
.fir-num { font-weight: 700; color: var(--teal-deep); font-size: 1rem; }
:root[data-theme="dark"] .fir-num { color: var(--link); }

/* ---------- lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: .25rem 1rem; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row a.grow, .list-row .linklike { color: var(--text); }
.list-row.faded { opacity: .55; }
.preview { display: block; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--navy)); flex: none; }
.mail-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #E4F1FA; color: var(--navy); flex: none; }
.all-good { display: flex; gap: .5rem; align-items: center; color: var(--text-2); }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); padding: .6rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.table td a { color: var(--text); }

/* ---------- sites ---------- */
.site-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.site-tiles.big { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.site-tile { display: flex; flex-direction: column; gap: .7rem; padding: 1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: transform .12s, box-shadow .12s; }
.site-tiles.big .site-tile { background: var(--surface); box-shadow: var(--shadow); }
.site-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--teal); }
.site-tile-top { display: flex; gap: .75rem; align-items: flex-start; }
.site-tile-counts { display: flex; align-items: center; gap: .8rem; font-size: .85rem; font-weight: 600; flex-wrap: wrap; }
.site-tile-counts > span { display: inline-flex; align-items: center; gap: .3rem; }

.tabs { display: flex; gap: .25rem; overflow-x: auto; overflow-y: hidden; margin: 0 0 1.1rem; padding-bottom: 2px; border-bottom: 2px solid var(--border); scrollbar-width: thin; }
.tab { padding: .65rem 1rem; font-weight: 600; color: var(--text-2); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -4px; min-height: 44px; display: flex; align-items: center; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--navy); border-bottom-color: var(--amber); }
:root[data-theme="dark"] .tab.active { color: var(--link); }

.kv { margin: 0 0 .9rem; display: grid; gap: .55rem; }
.kv > div { display: grid; grid-template-columns: 140px 1fr; gap: .75rem; align-items: center; }
.kv.inline { display: flex; gap: 2rem; margin-top: .8rem; }
.kv.inline > div { display: block; }
.kv dt { font-size: .8rem; font-weight: 700; color: var(--text-2); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 480px) { .kv > div { grid-template-columns: 1fr; gap: .1rem; } }
.cnm-card { border-top: 5px solid var(--navy); }

.status-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: .4rem 0 .8rem; gap: 2px; }
.status-note { padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; border-left: 6px solid var(--s-u); background: var(--surface); box-shadow: var(--shadow); }
.status-note.s-r { border-left-color: var(--s-r); background: #FDEDEA; color: #8A2414; }
.status-note.s-y { border-left-color: var(--s-y); background: #FFF5E0; color: #6B4600; }
.status-note.s-g { border-left-color: var(--s-g); background: #EDF6EB; color: #2F6B27; }
.note-r { color: #B8301D; } .note-y { color: #8A5A00; }
:root[data-theme="dark"] .note-r { color: #FF8C7A; } :root[data-theme="dark"] .note-y { color: #FFC965; }

.dev-list { display: grid; gap: .6rem; }
.dev-row { display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.dev-main { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--text); }
.dev-main:hover { text-decoration: none; }
.dev-main:hover b { text-decoration: underline; }
.dev-ids { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .dev-row { flex-wrap: wrap; } .dev-ids { width: 100%; justify-content: flex-start; padding-left: 2.6rem; } }

.rotation { display: flex; flex-direction: column; padding: .9rem 1rem; border-radius: 12px; margin-bottom: .8rem; }
.rotation.ok { background: #EDF6EB; color: #2F6B27; } .rotation.soon { background: #FFF5E0; color: #6B4600; } .rotation.over { background: #FDEDEA; color: #8A2414; }
.rotation b { font-size: 1.1rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .75rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.tl-dots { display: inline-flex; align-items: center; gap: .25rem; color: var(--text-2); flex: none; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.photo { padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-full { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; }

/* ---------- flowchart ---------- */
.flow-wrap { height: min(68vh, 640px); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; touch-action: none; box-shadow: var(--shadow);
  background-color: #F3F9F8; background-image: radial-gradient(rgba(26, 79, 124, .14) 1px, transparent 1px); background-size: 22px 22px; }
:root[data-theme="dark"] .flow-wrap { background-color: #DDEFEC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flow-wrap { background-color: #DDEFEC; } }
.flow-svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.fnode:active { cursor: grabbing; }
.fdot:hover circle:last-child { stroke-width: 4; }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .75rem; font-size: .85rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius); }
.empty img { border-radius: 14px; opacity: .95; }
.empty h3 { margin: .75rem 0 .25rem; }
.empty p { color: var(--text-2); max-width: 460px; margin: 0 auto 1rem; }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: 20px; width: min(640px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 64px rgba(11, 53, 86, .35); }
.modal-wide { width: min(900px, calc(100vw - 1.5rem)); }
.modal::backdrop { background: rgba(7, 37, 54, .55); backdrop-filter: blur(2px); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--header-grad); color: #fff; }
.modal-head h2 { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .icon-btn { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .3); }
.modal-body { padding: 1.1rem 1.25rem; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .85rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-inner { max-height: 92vh; }
  .modal-foot { padding-bottom: calc(.85rem + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}
.mail-results { margin-top: 1rem; min-height: 120px; }
.mail-body iframe { width: 100%; min-height: 50vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%); bottom: calc(1.25rem + env(safe-area-inset-bottom)); display: grid; gap: .5rem; width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
@media (max-width: 860px) { .toasts { bottom: calc(5.5rem + env(safe-area-inset-bottom)); } }
.toast { background: var(--navy-deep); color: #fff; padding: .75rem 1rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-weight: 600; font-size: .92rem;
  border-left: 5px solid var(--teal-light); transition: opacity .3s, transform .3s; }
.toast-ok { border-left-color: var(--s-g); } .toast-err { border-left-color: var(--s-r); }
.toast.out { opacity: 0; transform: translateY(8px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
