/**
 * @file        sg.css
 * @description SynthGlobe styles: design tokens from the Stitch mockups and BrandIdentity (light and dark), mobile-first layout, header, footer, cards, forms, landing page, install banner
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         c58bde9c-8190-4c82-8cb1-dcf0ee92a32f
 * @version     0.4.2.10
 * @created     2026-11-30
 * @updated     2026-12-02
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* Tokens (SynthGlobe-DesignNotes.md). Orange is for the primary action and the current pin only. */
:root {
  --navy: #1C2C37;
  --orange: #FA5800;
  --bg: #F2F4F6;
  --beige: #EADDD3;
  --mahogany: #6B2D19;
  --ink: #1C2C37;
  --ink-muted: #50606D;
  --border: #DFE3E7;
  --border-strong: #C3C7CB;
  --border-warm: #D1C4BB;
  --focus: #394955;
  --surface: #FBFCFF;
  --accent: #A83900;
  --on-orange: #1C2C37;
  --warm-ink: #6B2D19;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-head: Sora, "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

/* Dark tokens: system preference unless the visitor chose light; or an explicit dark choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14212A;
    --ink: #F2F4F6;
    --ink-muted: #AEB8C1;
    --border: #2E3E4A;
    --border-strong: #44535F;
    --border-warm: #4A3A31;
    --focus: #C3CDD6;
    --surface: #22323D;
    --accent: #FF8C5F;
    --beige: #2A2420;
    --warm-ink: #EADDD3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14212A;
  --ink: #F2F4F6;
  --ink-muted: #AEB8C1;
  --border: #2E3E4A;
  --border-strong: #44535F;
  --border-warm: #4A3A31;
  --focus: #C3CDD6;
  --surface: #22323D;
  --accent: #FF8C5F;
  --beige: #2A2420;
  --warm-ink: #EADDD3;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: clamp(1.6rem, 4vw + 0.6rem, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2vw + 0.7rem, 1.8rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 16px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.sg-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sg-narrow { max-width: 760px; }
.sg-main { flex: 1; padding: 32px 0 48px; }
.sg-page-landing .sg-main { padding-top: 0; }
.sg-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 16px; z-index: 10; }
.sg-skip:focus { left: 16px; }
.sg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sg-icon { width: 24px; height: 24px; flex: none; }
.sg-mono, .sg-code { font-family: var(--font-mono); font-weight: 500; }
.sg-code { color: var(--ink-muted); font-size: 0.9rem; }
.sg-hint { color: var(--ink-muted); font-size: 0.9rem; margin: 4px 0 0; }
.sg-lead { color: var(--ink-muted); font-size: 1.05rem; }
.sg-right { text-align: right; margin: -4px 0 16px; }
.sg-inline { display: inline; margin: 0; }

/* Header */
.sg-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.sg-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.sg-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 600 1.15rem var(--font-head); }
.sg-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.sg-nav a { color: var(--ink); font-weight: 500; text-decoration: none; }
.sg-nav a:hover { text-decoration: underline; }
.sg-nav__name { color: var(--ink-muted); font-size: 0.9rem; }
.sg-lang { font-family: var(--font-mono); font-size: 0.85rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px 8px; }
/* WHY: on 360 px the primary button and sign-in link must fit next to the logo without wrapping under it. */
@media (max-width: 479px) {
  .sg-nav .sg-button--primary { display: none; }
}

/* Buttons */
.sg-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer; transition: background-color 150ms, border-color 150ms;
}
.sg-button--primary { background: var(--orange); color: var(--on-orange); }
.sg-button--primary:hover { background: #E04F00; }
.sg-button--ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.sg-button--ghost:hover { border-color: var(--ink); }
.sg-button--google { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
/* Sign in with Apple: black with white text in both themes (Apple's button guidelines). */
.sg-button--apple { background: #000; color: #fff; border-color: #000; }
.sg-button--small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.sg-button--block { width: 100%; margin-top: 8px; }
.sg-link-button { background: none; border: 0; padding: 4px; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sg-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }

/* Cards */
.sg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px 16px; margin: 0 auto; width: calc(100% - 32px); }
.sg-card--auth { max-width: 460px; }
.sg-card--wide { max-width: 720px; }
.sg-card--center { max-width: 520px; text-align: center; }
.sg-card__head { margin-bottom: 24px; }
.sg-card__head h1 { font-size: 1.6rem; }
.sg-card__foot { margin: 24px 0 0; text-align: center; color: var(--ink-muted); }
.sg-card__icon { display: inline-flex; padding: 12px; border-radius: 50%; background: var(--bg); color: var(--ink); margin-bottom: 16px; }
.sg-card__icon .sg-icon { width: 32px; height: 32px; }
.sg-tone-success .sg-card__icon { color: #1E7A46; }
.sg-tone-warning .sg-card__icon { color: var(--accent); }
.sg-card--center h1 { font-size: 1.6rem; }
@media (min-width: 600px) { .sg-card { padding: 32px; } }

/* Forms */
.sg-field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.sg-field label, .sg-field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.sg-field input[type="text"], .sg-field input[type="email"], .sg-field input[type="password"], .sg-field input[type="url"], .sg-field input[type="date"], .sg-field input[type="datetime-local"], .sg-field input[type="number"], .sg-field input[type="search"], .sg-field textarea, .sg-field select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: 400 1rem var(--font-body);
}
.sg-field--error input, .sg-field--error textarea { border-color: var(--accent); }
.sg-error { color: var(--accent); font-size: 0.9rem; margin: 6px 0 0; font-weight: 500; }
.sg-password { position: relative; }
.sg-password input { padding-right: 96px; }
.sg-password .sg-link-button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; }
.sg-field .sg-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.sg-check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--navy); }
.sg-choices { display: grid; gap: 12px; }
@media (min-width: 480px) { .sg-choices { grid-template-columns: 1fr 1fr; } }
.sg-field .sg-choice { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); cursor: pointer; font-weight: 400 !important; }
.sg-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sg-choice input { margin-top: 4px; accent-color: var(--navy); }
.sg-choice__body { display: flex; flex-direction: column; gap: 2px; }
.sg-choice__body span { color: var(--ink-muted); font-size: 0.9rem; }
.sg-grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .sg-grid-2 { grid-template-columns: 1fr 1fr; } }
.sg-turnstile { margin: 8px 0 16px; min-height: 65px; }
.sg-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); margin: 16px 0; }
.sg-divider::before, .sg-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.sg-alert { padding: 12px 14px; border-radius: var(--radius); margin: 0 0 16px; border: 1px solid; }
.sg-alert--error { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sg-alert--info { border-color: var(--border-strong); color: var(--ink); background: var(--bg); }

/* Banner (C-10 unverified email) */
.sg-banner { background: var(--beige); color: var(--warm-ink); border-bottom: 1px solid var(--border-warm); }
.sg-banner__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.sg-banner form { margin: 0; }
.sg-banner .sg-link-button { color: var(--warm-ink); }

/* Landing (P-01) */
.sg-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 32px 0 48px; }
.sg-hero__inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .sg-hero__inner { grid-template-columns: 1.05fr 1fr; padding-top: 32px; } }
.sg-eyebrow { font: 500 0.85rem var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.sg-hero-svg { width: 100%; height: auto; max-width: 560px; display: block; margin: 0 auto; }
.sg-svg-panel { fill: var(--bg); stroke: var(--border); }
.sg-svg-land { fill: none; stroke: var(--border-strong); stroke-width: 40; stroke-linecap: round; opacity: 0.45; }
.sg-svg-route { fill: none; stroke: var(--navy); stroke-width: 3; stroke-dasharray: 6 6; }
:root[data-theme="dark"] .sg-svg-route { stroke: var(--ink-muted); }
.sg-svg-pin circle { fill: var(--navy); stroke: var(--surface); stroke-width: 3; }
.sg-svg-pin text { fill: #F2F4F6; font: 600 13px var(--font-body); text-anchor: middle; }
.sg-svg-pin--current circle { fill: var(--orange); }
.sg-svg-pin--current text { fill: var(--navy); }
.sg-svg-card { fill: var(--surface); stroke: var(--border); }
.sg-svg-country { fill: var(--border); stroke: var(--surface); stroke-width: 2; }
.sg-svg-country--visited { fill: var(--mahogany); }
.sg-svg-caption { font: 500 14px var(--font-mono); fill: var(--ink-muted); }
.sg-section { padding: 48px 0; }
.sg-section--warm { background: var(--beige); color: var(--warm-ink); }
.sg-features { display: grid; gap: 16px; }
@media (min-width: 760px) { .sg-features { grid-template-columns: repeat(3, 1fr); } }
.sg-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.sg-feature__icon { color: var(--ink); margin-bottom: 12px; }
.sg-feature p { color: var(--ink-muted); margin: 0; }
.sg-split { display: grid; gap: 16px; align-items: center; }
@media (min-width: 760px) { .sg-split { grid-template-columns: 1.4fr 1fr; } }
.sg-note { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.sg-faq { margin-bottom: 24px; }
.sg-faq__item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.sg-faq__item summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.sg-faq__item p { margin: 8px 0 4px; color: var(--ink-muted); }

/* Long text (P-08): about 70 characters per line */
.sg-prose { max-width: 72ch; }
.sg-prose p { font-size: 1.05rem; }

/* Footer */
.sg-footer { background: var(--navy); color: #F2F4F6; padding: 32px 0; }
.sg-footer a { color: #F2F4F6; }
.sg-footer__inner { display: grid; gap: 16px; }
.sg-footer__brand { font-family: var(--font-head); font-weight: 600; margin: 0; }
.sg-footer__links, .sg-footer__prefs { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.sg-footer__prefs a[aria-current="true"] { font-weight: 600; text-decoration: none; }
.sg-footer .sg-lang { border-color: #50606D; }

/* Sign-in link landing (A-07) */
.sg-spinner { width: 32px; height: 32px; margin: 0 auto 16px; border: 3px solid var(--border); border-top-color: var(--ink); border-radius: 50%; animation: sg-spin 900ms linear infinite; }
@keyframes sg-spin { to { transform: rotate(360deg); } }

/* Install prompt (P-13) */
.sg-install {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; box-shadow: 0 8px 24px rgba(28, 44, 55, 0.18);
}
.sg-install[hidden] { display: none; }
.sg-install__text { flex: 1 1 160px; display: flex; flex-direction: column; font-size: 0.95rem; }
.sg-install__text span { color: var(--ink-muted); font-size: 0.85rem; }

/* Reduced motion (FR-9): instant changes or short fades only. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ── Admin area (D-): left menu, tables, figures ─────────────────────────── */
.sg-admin { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 16px; display: grid; gap: 24px; }
@media (min-width: 900px) { .sg-admin { grid-template-columns: 220px 1fr; } }
.sg-admin__menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
@media (min-width: 900px) { .sg-admin__menu ul { flex-direction: column; } }
.sg-admin__menu a { display: block; padding: 8px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.sg-admin__menu a:hover { background: var(--surface); }
.sg-admin__menu a[aria-current="page"] { background: var(--surface); border-left: 3px solid var(--accent); font-weight: 600; }
.sg-admin__label { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); margin: 0 0 8px; }
.sg-admin__content { min-width: 0; }
.sg-admin__content h1 { font-family: var(--font-head); font-size: 1.5rem; margin: 0 0 16px; }
.sg-stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.sg-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.sg-stat__value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 600; }
.sg-stat__label { color: var(--ink-muted); font-size: 0.9rem; }
.sg-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.sg-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sg-table th, .sg-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sg-table th { font-weight: 600; color: var(--ink-muted); }
.sg-table tr:last-child td { border-bottom: 0; }
.sg-audit-value { font-family: var(--font-mono); font-size: 0.8rem; word-break: break-all; max-width: 320px; }
.sg-badge { display: inline-block; font-size: 0.75rem; padding: 0 6px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); color: var(--ink-muted); }

/* ── D-08 email editor ───────────────────────────────────────────────────── */
.sg-mail-langs { display: grid; gap: 16px; }
@media (min-width: 1100px) { .sg-mail-langs { grid-template-columns: 1fr 1fr; } }
.sg-mail-lang { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin: 0; background: var(--surface); min-width: 0; }
.sg-mail-lang legend { font-weight: 600; padding: 0 4px; }
.sg-placeholders ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.sg-placeholders code, .sg-code-input { font-family: var(--font-mono); }
.sg-code-input { width: 100%; font-size: 0.85rem; }
.sg-editor { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.sg-editor__bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); }
.sg-editor__bar button, .sg-editor__image { font: inherit; font-size: 0.85rem; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.sg-editor__bar button[aria-pressed="true"] { border-color: var(--accent); }
.sg-editor__image input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sg-editor__image:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg-editor__area { min-height: 220px; padding: 12px; background: #FFFFFF; color: #1C2C37; overflow-wrap: anywhere; }
.sg-editor__area img { max-width: 100%; height: auto; }
.sg-editor__area:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.sg-mail-preview { width: 100%; min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #F2F4F6; margin: 16px 0; }
.sg-mail-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── App shell T-01 ──────────────────────────────────────────────────────── */
html[data-text-size="115"] { font-size: 115%; }
html[data-text-size="130"] { font-size: 130%; }
html[data-reduce-motion="1"] *, html[data-reduce-motion="1"] *::before, html[data-reduce-motion="1"] *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
.sg-shell-body { padding-bottom: 72px; }
.sg-shell { display: flex; min-height: 100vh; }
.sg-shell__side { display: none; }
.sg-shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-topbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.sg-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sg-search { flex: 1; max-width: 420px; display: none; }
.sg-search input { width: 100%; min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 12px; background: var(--bg); color: var(--ink); font: inherit; }
.sg-bell { position: relative; display: inline-flex; padding: 8px; color: var(--ink); border-radius: var(--radius); }
.sg-bell__count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 0.7rem; display: grid; place-items: center; }
.sg-avatar { position: relative; }
.sg-avatar summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.sg-avatar summary::-webkit-details-marker { display: none; }
.sg-avatar__initial { width: 32px; height: 32px; border-radius: 50%; background: var(--beige); color: var(--warm-ink); display: grid; place-items: center; font-weight: 600; }
.sg-avatar__name { display: none; }
.sg-avatar__menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(28, 44, 55, 0.12); z-index: 30; }
.sg-avatar__menu a, .sg-avatar__menu .sg-link-button { display: block; text-align: left; padding: 8px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; width: 100%; }
.sg-avatar__menu a:hover, .sg-avatar__menu .sg-link-button:hover { background: var(--bg); }
.sg-offline-note { margin: 0; font-size: 0.85rem; color: var(--ink-muted); }
.sg-app-main { padding: 24px 16px 48px; width: 100%; max-width: 1100px; margin: 0 auto; }
.sg-bottom { position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center; z-index: 25; }
.sg-bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; color: var(--ink-muted); text-decoration: none; padding: 4px 8px; min-width: 56px; }
.sg-bottom a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.sg-bottom__add { background: var(--orange); color: var(--on-orange) !important; border-radius: 50%; width: 52px; height: 52px; min-width: 52px !important; justify-content: center; margin-top: -24px; box-shadow: 0 4px 12px rgba(250, 88, 0, 0.35); }
@media (min-width: 900px) {
  .sg-shell-body { padding-bottom: 0; }
  .sg-bottom, .sg-topbar__brand { display: none; }
  .sg-search { display: block; }
  .sg-avatar__name { display: inline; }
  .sg-shell__side { display: flex; flex-direction: column; gap: 16px; width: 240px; flex-shrink: 0; padding: 16px; border-right: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; height: 100vh; }
  .sg-shell__nav { display: flex; flex-direction: column; gap: 4px; }
  .sg-shell__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
  .sg-shell__nav a:hover { background: var(--bg); }
  .sg-shell__nav a[aria-current="page"] { background: var(--bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
  .sg-shell__add { justify-content: center; gap: 8px; }
  .sg-shell__mode { margin-top: auto; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
}

/* ── App pages: panels, chips, trips, timeline, trash, toasts ─────────────── */
.sg-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 20px 16px; margin: 0 0 16px; }
.sg-panel h1 { font-family: var(--font-head); font-size: 1.5rem; margin: 0 0 16px; }
.sg-panel h2 { font-size: 1.1rem; margin: 16px 0 8px; }
.sg-panel--form { max-width: 760px; }
@media (min-width: 600px) { .sg-panel { padding: 24px; } }
.sg-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.sg-page-head h1 { font-family: var(--font-head); font-size: 1.6rem; margin: 0; }
.sg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.sg-muted { color: var(--ink-muted); margin: 4px 0; }
.sg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.sg-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--ink-muted); background: var(--surface); }
.sg-chip .sg-icon { width: 14px; height: 14px; }
.sg-chip--published { border-color: var(--ink); color: var(--ink); }
.sg-chip--scheduled { border-color: var(--accent); color: var(--accent); }
.sg-chip--delay { border-style: dashed; }
.sg-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.sg-tabs a { padding: 8px 12px; color: var(--ink-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.sg-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.sg-trip-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sg-trip-card a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; color: var(--ink); text-decoration: none; height: 100%; }
.sg-trip-card a:hover { border-color: var(--border-strong); }
.sg-trip-card img, .sg-trip-card__placeholder { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: grid; place-items: center; }
.sg-trip-card__placeholder .sg-icon { width: 40px; height: 40px; color: #fff; }
.sg-trip-card__body { padding: 12px 16px 16px; }
.sg-trip-card h2 { font-size: 1.05rem; margin: 0 0 4px; }
.sg-color-orange { background: #FA5800; } .sg-color-navy { background: #1C2C37; } .sg-color-mahogany { background: #6B2D19; }
.sg-color-teal { background: #1F6F75; } .sg-color-olive { background: #5E6B2E; } .sg-color-plum { background: #5B3A63; }
.sg-swatches, .sg-iconpicks, .sg-typepicks, .sg-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-swatch { width: 36px; height: 36px; border-radius: 50%; position: relative; cursor: pointer; }
.sg-swatch input, .sg-iconpick input, .sg-typepick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-swatch:has(input:checked) { outline: 3px solid var(--focus); outline-offset: 2px; }
.sg-swatch:focus-within, .sg-iconpick:focus-within, .sg-typepick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg-iconpick, .sg-typepick { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.sg-iconpick:has(input:checked), .sg-typepick:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sg-radio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.sg-grid-3 { display: grid; gap: 0 16px; }
@media (min-width: 700px) { .sg-grid-3 { grid-template-columns: 2fr 2fr 1fr; } }
.sg-publish { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.sg-publish input[type="datetime-local"] { min-height: 36px; }
.sg-trip-desc { max-width: 720px; }
.sg-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); margin: 16px 0; }
.sg-bulk__label { margin: 0; font-weight: 600; width: 100%; }
.sg-bulk__group { display: inline-flex; gap: 6px; align-items: center; }
.sg-bulk input[type="number"] { width: 90px; min-height: 36px; }
.sg-bulk select { min-height: 36px; max-width: 200px; }
.sg-timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.sg-step-row { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; }
.sg-step-row__select { padding-top: 4px; }
.sg-step-row__select input { width: 20px; height: 20px; }
.sg-step-row h3 { margin: 0 0 4px; font-size: 1.05rem; }
.sg-step-row .sg-icon { width: 16px; height: 16px; vertical-align: -3px; }
.sg-danger { margin-top: 32px; }
.sg-list { padding-left: 20px; }
.sg-list li { margin: 6px 0; }
.sg-trash { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.sg-trash-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; }
.sg-trash-row p { margin: 2px 0; }
.sg-empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-xl); }
.sg-empty__art .sg-icon { width: 48px; height: 48px; color: var(--ink-muted); }
.sg-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 40; display: flex; gap: 16px; align-items: center; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--navy); color: #F2F4F6; box-shadow: 0 8px 24px rgba(28, 44, 55, 0.25); max-width: calc(100% - 32px); }
.sg-toast .sg-link-button { color: #FF8C5F; font-weight: 600; }
@media (min-width: 900px) { .sg-toast { bottom: 24px; } }
.sg-counter--over { color: var(--accent); font-weight: 600; }
.sg-map-slot:empty { display: none; }

/* ── Photos: upload T-07, thumbnails, editing T-08, bulk T-09 ─────────────── */
.sg-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius-xl); cursor: pointer; text-align: center; margin: 8px 0 16px; background: var(--bg); }
.sg-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sg-drop:focus-within, .sg-drop--over { border-color: var(--accent); }
.sg-drop__title { font-weight: 600; font-size: 1.05rem; }
.sg-upload__total { margin: 12px 0; display: flex; align-items: center; gap: 8px; }
.sg-upload__total progress, .sg-upload__item progress { width: 100%; max-width: 280px; height: 8px; accent-color: var(--navy); }
.sg-upload__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sg-upload__item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-upload__name { font-weight: 600; overflow-wrap: anywhere; }
.sg-upload__size, .sg-upload__state { color: var(--ink-muted); font-size: 0.85rem; }
.sg-upload__item[data-state="failed"] .sg-upload__state { color: var(--accent); }
.sg-upload__item[data-state="done"] .sg-upload__state { color: var(--ink); font-weight: 600; }
.sg-upload__summary { font-weight: 600; margin-top: 12px; }
.sg-subpanel { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.sg-thumbs { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.sg-thumb { position: relative; }
.sg-thumb img, .sg-thumb__state { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border); font-size: 0.8rem; color: var(--ink-muted); }
.sg-thumb .sg-chip { position: absolute; left: 4px; bottom: 4px; }
.sg-thumb--cover img { outline: 2px solid var(--accent); outline-offset: 1px; }
.sg-thumbs--select label { display: block; cursor: pointer; }
.sg-thumbs--select input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; z-index: 1; }
.sg-thumbs--select input:checked + img, .sg-thumbs--select input:checked + .sg-thumb__state { outline: 3px solid var(--navy); outline-offset: 1px; }
.sg-photo-edit { display: grid; gap: 24px; }
@media (min-width: 1000px) { .sg-photo-edit { grid-template-columns: 3fr 2fr; } }
.sg-photo-edit__image { position: relative; margin: 0; }
.sg-photo-edit__image img { width: 100%; height: auto; border-radius: var(--radius-lg); cursor: crosshair; display: block; }
.sg-focal { position: absolute; left: calc(var(--fx, 0.5) * 100%); top: calc(var(--fy, 0.5) * 100%); width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--navy); pointer-events: none; }
.sg-photo-edit__image:not(:has(img)) .sg-focal { display: none; }
input[type="range"] { width: 100%; accent-color: var(--navy); }

/* ── Maps: trip map, pin picker, scratch map T-12 ────────────────────────── */
.sg-trip-map { height: 360px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; margin: 16px 0; position: relative; background: var(--bg); }
@media (min-width: 900px) { .sg-trip-map { height: 440px; } }
.sg-map-pick { height: 280px; border-radius: var(--radius); border: 1px solid var(--border-strong); overflow: hidden; margin-bottom: 8px; }
.sg-map-error { position: absolute; left: 8px; right: 8px; bottom: 8px; margin: 0; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; z-index: 2; }
.sg-pin { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--navy); color: #fff; font: 600 0.8rem var(--font-body); cursor: pointer; box-shadow: 0 2px 6px rgba(28, 44, 55, 0.35); }
.sg-pin:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sg-photo-marker { position: relative; display: block; width: 44px; height: 44px; border-radius: var(--radius); border: 2px solid #fff; overflow: visible; box-shadow: 0 2px 6px rgba(28, 44, 55, 0.35); background: #fff; }
.sg-photo-marker img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.sg-photo-marker span { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 0.72rem; display: grid; place-items: center; padding: 0 4px; }
.maplibregl-popup-content { font-family: var(--font-body); color: #1C2C37; }
.sg-stats--map { margin-bottom: 16px; }
.sg-scratch { display: grid; gap: 16px; }
@media (min-width: 1000px) { .sg-scratch--panel { grid-template-columns: 1fr 300px; } }
.sg-scratch__map { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 12px; }
.sg-world { width: 100%; height: auto; display: block; }
.sg-world .sg-c { fill: var(--bg); stroke: var(--border-strong); stroke-width: 0.4; transition: fill 0.2s; }
.sg-world a:hover .sg-c, .sg-world a:focus .sg-c { fill: var(--border); }
.sg-world a:focus { outline: none; }
.sg-world a:focus .sg-c { stroke: var(--focus); stroke-width: 1.2; }
.sg-world .sg-c--visited { fill: url(#sg-hatch-visited); stroke: #6B2D19; }
.sg-world .sg-c--new { fill: url(#sg-hatch-new); stroke: #A83900; animation: sg-scratch 3s ease-out 1; }
.sg-world .sg-c--selected { stroke: var(--focus); stroke-width: 1.4; }
@keyframes sg-scratch { 0% { fill-opacity: 0.1; } 60% { fill-opacity: 0.6; } 100% { fill-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sg-world .sg-c--new { animation: none; } }
html[data-reduce-motion="1"] .sg-world .sg-c--new { animation: none; }
.sg-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-muted); }
.sg-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.sg-swatch-mini { width: 16px; height: 12px; border: 1px solid var(--border-strong); background: var(--bg); display: inline-block; }
.sg-swatch-mini--visited { background: repeating-linear-gradient(45deg, #6B2D19 0 3px, #8A4A33 3px 5px); border-color: #6B2D19; }
.sg-swatch-mini--new { background: radial-gradient(#FFD6BF 1px, #FA5800 1.5px) 0 0 / 4px 4px; border-color: #A83900; }
.sg-country-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 16px; }
.sg-country-panel h2 { font-family: var(--font-head); margin: 0 0 8px; }
.sg-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 16px; }
.sg-facts dt { color: var(--ink-muted); }
.sg-facts dd { margin: 0; font-weight: 600; }
.sg-backfill { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.sg-backfill .sg-field { min-width: 140px; }
.sg-celebrate { position: fixed; inset: auto 16px 88px 16px; z-index: 45; max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 20px; box-shadow: 0 16px 40px rgba(28, 44, 55, 0.3); }
.sg-celebrate img { max-width: 100%; height: auto; border-radius: var(--radius); }
@media (min-width: 900px) { .sg-celebrate { bottom: 32px; } }

/* ── Social and public pages: profile P-02, trip P-03, feed T-02, comments C-09 ─ */
.sg-profile { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.sg-app-main .sg-profile { padding: 0; }
.sg-profile__head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; position: relative; }
.sg-profile__head h1 { font-family: var(--font-head); margin: 0; font-size: 1.7rem; }
.sg-profile__bio { max-width: 640px; }
.sg-profile__links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.sg-profile__links .sg-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.sg-profile__map { margin: 16px 0 24px; }
.sg-profile__map h2 { font-size: 1.1rem; margin: 0 0 8px; }
.sg-avatar-img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sg-avatar-img--initial { display: grid; place-items: center; background: var(--beige); color: var(--warm-ink); font-size: 2.6rem; font-weight: 600; }
.sg-trip-head__by .sg-avatar-img, .sg-trip-head__by .sg-avatar-img--initial { width: 32px; height: 32px; font-size: 1rem; vertical-align: middle; display: inline-grid; }
.sg-profile-pic { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.sg-menu { position: relative; display: inline-block; }
.sg-menu summary { list-style: none; cursor: pointer; }
.sg-menu summary::-webkit-details-marker { display: none; }
.sg-menu__body { position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 30; box-shadow: 0 8px 24px rgba(28, 44, 55, 0.12); }
.sg-menu__body a, .sg-menu__body .sg-link-button { display: block; padding: 6px 8px; text-align: left; }
.sg-profile__head > .sg-menu { margin-left: auto; }
.sg-follow-prompt { border: 1px solid var(--border-warm); background: var(--beige); color: var(--warm-ink); border-radius: var(--radius-lg); padding: 16px; margin: 16px 0; }
.sg-trip-head { max-width: 1100px; margin: 0 auto 16px; }
.sg-trip-head h1 { font-family: var(--font-head); margin: 4px 0 8px; font-size: 1.8rem; }
.sg-trip-head__cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius-xl); margin-bottom: 12px; }
.sg-trip-view { display: grid; gap: 24px; max-width: 1200px; margin: 0 auto; }
@media (min-width: 1000px) { .sg-trip-view { grid-template-columns: 5fr 6fr; align-items: start; } .sg-trip-view__map { position: sticky; top: 72px; } .sg-trip-view__map .sg-trip-map { height: calc(100vh - 120px); margin: 0; } }
.sg-timeline-public { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.sg-tl-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; scroll-margin-top: 80px; }
.sg-tl-step h2 { margin: 4px 0 8px; font-size: 1.2rem; }
.sg-tl-step .sg-icon { width: 16px; height: 16px; vertical-align: -3px; }
.sg-tl-step__n { font-family: var(--font-mono); font-weight: 600; }
.sg-tl-step__text { white-space: normal; }
.sg-tl-step__report { font-size: 0.8rem; margin: 8px 0 0; }
.sg-tl-prompt { list-style: none; }
.sg-gallery { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sg-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: block; }
.sg-viewer { position: fixed; inset: 0; z-index: 60; background: rgba(12, 18, 24, 0.94); display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; }
.sg-viewer[hidden] { display: none; }
.sg-viewer__figure { margin: 0; text-align: center; color: #F2F4F6; }
.sg-viewer__figure img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.sg-viewer button { background: transparent; border: 0; color: #F2F4F6; font-size: 2.2rem; cursor: pointer; padding: 8px; }
.sg-viewer__close { position: absolute; top: 8px; right: 12px; }
body.sg-viewer-open { overflow: hidden; }
.sg-interact { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.sg-reactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.sg-react { border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 2px 10px; font-size: 0.95rem; cursor: pointer; color: var(--ink); }
.sg-react--mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sg-comments { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.sg-comments--replies { margin-left: 20px; border-left: 2px solid var(--border); padding-left: 12px; }
.sg-comment p { margin: 2px 0; }
.sg-comment--pending { opacity: 0.75; }
.sg-comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.sg-comment-form textarea, .sg-comment textarea { flex: 1; width: 100%; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 8px; font: inherit; background: var(--bg); color: var(--ink); }
.sg-reply summary, .sg-comment details summary { list-style: none; display: inline; cursor: pointer; }
.sg-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.sg-feed-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.sg-feed-card h2 { font-size: 1.15rem; margin: 8px 0; }
.sg-feed-card__meta { margin: 0; color: var(--ink-muted); font-size: 0.9rem; }
.sg-feed-card__meta strong { color: var(--ink); }
.sg-feed-card__img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin-top: 8px; }
.sg-chip--new { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sg-feed-head { margin: 0 0 12px; }
.sg-draft p { margin: 4px 0; }
.sg-people { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sg-person { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-person input:not([type]), .sg-person input[type="text"] { min-height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; background: var(--bg); color: var(--ink); }
.sg-check--inline { display: inline-flex; margin-right: 8px; }
.sg-notices { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-notice { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-notice--unread { border-left: 3px solid var(--accent); }
.sg-banner--preview { background: var(--navy); color: #F2F4F6; }
.sg-banner--preview .sg-link-button { color: #FF8C5F; }
.sg-radios--stack { flex-direction: column; align-items: flex-start; }
.sg-copy { width: 100%; font-family: var(--font-mono); min-height: 40px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--ink); }
.sg-mono { font-family: var(--font-mono); }

/* ── Account: storage meter, consent C-01, onboarding A-06, danger button ── */
.sg-meter { height: 12px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; margin: 12px 0; }
.sg-meter__bar { display: block; height: 100%; width: 0; background: var(--navy); }
.sg-meter__bar--warn { background: var(--accent); }
.sg-meter__bar--full { background: #B3261E; }
.sg-banner--warn { background: var(--beige); color: var(--warm-ink); }
.sg-consent { position: fixed; left: 16px; right: 16px; bottom: 80px; z-index: 50; max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 16px 20px; box-shadow: 0 16px 40px rgba(28, 44, 55, 0.25); }
.sg-consent h2 { margin: 0 0 8px; font-size: 1.1rem; }
@media (min-width: 900px) { .sg-consent { bottom: 24px; } }
.sg-dots { display: flex; gap: 6px; }
.sg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.sg-dot--on { background: var(--navy); }
.sg-button--danger { background: #B3261E; color: #fff; border-color: #B3261E; }
.sg-mt { margin-top: 16px; }

/* ── Admin part 2 ─────────────────────────────────────────────────────────── */
.sg-row-warn td { background: rgba(250, 88, 0, 0.08); }
.sg-stat--warn { border-color: var(--accent); }
.sg-stat__value--small { font-size: 1rem; }
.sg-catalog-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sg-catalog-row input:not([type]) { min-height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 6px; background: var(--bg); color: var(--ink); max-width: 180px; }
.sg-quote { border-left: 3px solid var(--border-strong); margin: 12px 0; padding: 4px 12px; color: var(--ink); }
.sg-report-photo { max-width: 320px; border-radius: var(--radius); }
.sg-table input:not([type]), .sg-table input[type="number"] { min-height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 6px; background: var(--bg); color: var(--ink); max-width: 180px; }

.sg-drop--small { padding: 16px; }
/* Phase 2 travel layers (W-01, M-11): legend, leg badges, "currently here" marker, leg editor */
.sg-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--ink-muted); }
.sg-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sg-legend svg { width: 16px; height: 16px; }
.sg-legend__line { display: inline-block; width: 24px; height: 0; border-top: 3px solid var(--navy); }
.sg-legend__line--flight { border-top-width: 2px; border-radius: 12px 12px 0 0; height: 6px; border-left: 0; }
.sg-legend__line--boat { border-top-style: dashed; }
.sg-legend__line--track { border-top: 2px solid #5B6B78; }
.sg-legend__here { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--navy); }
.sg-leg-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface, #fff); color: var(--navy); border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(28, 44, 55, 0.25); }
.sg-leg-badge svg { width: 16px; height: 16px; }
.sg-here { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--orange); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--navy), 0 2px 6px rgba(28, 44, 55, 0.35); }
.sg-here--paused { background: #8A9BA8; }
.sg-here--pulse { animation: sg-here-pulse 2s ease-out infinite; }
@keyframes sg-here-pulse { 0% { box-shadow: 0 0 0 1px var(--navy), 0 0 0 0 rgba(250, 88, 0, 0.45); } 100% { box-shadow: 0 0 0 1px var(--navy), 0 0 0 14px rgba(250, 88, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .sg-here--pulse { animation: none; } }
.sg-travel .sg-leg-form, .sg-travel .sg-track-form { margin-top: 12px; }
.sg-leg-flight { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 8px; min-width: 0; }
.sg-leg-flight[hidden] { display: none; }
/* T-08 free crop box (FR-41) */
.sg-photo-edit__image { position: relative; }
.sg-cropbox { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid var(--navy); box-shadow: 0 0 0 9999px rgba(28, 44, 55, 0.45); cursor: move; touch-action: none; z-index: 2; }
.sg-cropbox[hidden] { display: none; }
.sg-cropbox:focus-visible { outline: 3px solid var(--orange); }
.sg-cropbox__handle { position: absolute; width: 24px; height: 24px; margin: -12px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); touch-action: none; }
.sg-cropbox__handle--nw { left: 0; top: 0; cursor: nwse-resize; }
.sg-cropbox__handle--ne { right: 0; top: 0; cursor: nesw-resize; }
.sg-cropbox__handle--sw { left: 0; bottom: 0; cursor: nesw-resize; }
.sg-cropbox__handle--se { right: 0; bottom: 0; cursor: nwse-resize; }
/* D-01 admin menu groups (collapsible, collapsed by default) */
.sg-admin__filter { margin: 0 0 8px; }
.sg-admin__filter input { width: 100%; }
.sg-admin__group { border-top: 1px solid var(--border); }
.sg-admin__group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 4px; min-height: 44px; font-weight: 600; }
.sg-admin__group > summary::-webkit-details-marker { display: none; }
.sg-admin__group > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 150ms; flex: none; }
.sg-admin__group[open] > summary::after { transform: rotate(45deg); }
.sg-admin__group > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sg-admin__group ul { margin: 0 0 8px; padding: 0; list-style: none; }
.sg-admin__count { margin-left: auto; font: 500 0.75rem var(--font-mono, monospace); color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .sg-admin__group > summary::after { transition: none; } }
/* Account settings link groups (collapsible, closed by default) */
.sg-settings__filter { margin: 0 0 8px; }
.sg-settings__filter input { width: 100%; }
.sg-settings__group { border-top: 1px solid var(--border); }
.sg-settings__group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 4px; min-height: 44px; font-weight: 600; }
.sg-settings__group > summary::-webkit-details-marker { display: none; }
.sg-settings__group > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 150ms; flex: none; }
.sg-settings__group[open] > summary::after { transform: rotate(45deg); }
.sg-settings__group > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sg-settings__group ul { margin: 0 0 8px; }
.sg-settings__count { margin-left: auto; font: 500 0.75rem var(--font-mono, monospace); color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .sg-settings__group > summary::after { transition: none; } }

/* Floating footer on every page (Tom, 2026-12-02): tool, year, company link, version, admin letter.
   Mobile first: sits above the bottom navigation (64 px) of the app shell; the page keeps room for it. */
body { padding-bottom: 40px; }
.sg-shell-body { padding-bottom: 112px; }
.sg-credit { position: fixed; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 15; max-width: calc(100% - 16px); margin: 0; padding: 3px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted); font-size: 0.68rem; line-height: 1.35; text-align: center;
  box-shadow: 0 2px 8px rgba(28, 44, 55, 0.12); pointer-events: auto; }
.sg-credit p { margin: 0; }
.sg-credit a { color: inherit; font-weight: 600; text-decoration: none; }
.sg-credit a:hover, .sg-credit a:focus-visible { text-decoration: underline; }
.sg-credit .sg-credit__k { font-weight: inherit; }
.sg-credit .sg-credit__k:hover { text-decoration: none; }
.sg-shell-body .sg-credit { bottom: 70px; }
@media (min-width: 900px) {
  .sg-shell-body { padding-bottom: 40px; }
  .sg-shell-body .sg-credit { bottom: 6px; }
}
@media print { .sg-credit { display: none; } }
