/* Greenline design system: one look for every signed-in page, taken from the public front page (landing.html).
   Pages link this first, then keep only their own layout rules. See docs/ui/design-system.md. */

/* ---- tokens ---- */
:root {
  --bg: #f7f8f6; --warm: #f3f1ec; --card: #ffffff; --text: #17201a; --muted: #4d5a51;
  --line: #d5dcd6; --line-soft: #e6eae6; --accent: #1f7a45; --accent-ink: #ffffff; --soft: #e6f1ea;
  --bad: #a3271f; --warn: #7a5600; --warn-bg: #fff6dc; --focus: #0b57d0; --mark: #fff1b8;
  --shadow: 0 12px 32px rgba(23, 32, 26, 0.10); --shadow-sm: 0 1px 2px rgba(23, 32, 26, 0.06), 0 4px 14px rgba(23, 32, 26, 0.05);
  --radius: 16px; --radius-sm: 10px;
  --wrap: 1360px;
  /* the dark bands (header, page heads, footer) look the same in both themes */
  --ink: #0c1511; --ink-2: #111d17; --ink-3: #18261f; --ink-text: #eef3f0; --ink-muted: #b4c2b9; --ink-line: rgba(238, 243, 240, 0.10);
  --ink-accent: #4cc27f; --ink-accent-ink: #0c1a12; --ink-focus: #8ab4f8;
  --viewer-bg: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #eef2ee 70%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --warm: #171c19; --card: #1b211e; --text: #e6ece8; --muted: #a9b5ad;
    --line: #34403a; --line-soft: #2a332e; --accent: #4cc27f; --accent-ink: #0c1a12; --soft: #1a2a21;
    --bad: #ff8a80; --warn: #f2c260; --warn-bg: #2b2412; --focus: #8ab4f8; --mark: #4a4220;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.45); --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
    --viewer-bg: radial-gradient(ellipse at 50% 35%, #25302a 0%, #161c19 75%);
  }
}

/* ---- base ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- type ---- */
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 800; color: var(--accent); margin: 0 0 8px; }
.display { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 900; margin: 0; }
.display em { font-style: italic; color: var(--ink-accent); }
.title-lg { font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.1; letter-spacing: -0.025em; font-weight: 900; margin: 0 0 12px; }
.title-md { font-size: 1.15rem; letter-spacing: -0.01em; font-weight: 800; margin: 0 0 10px; }
.muted { color: var(--muted); }
.num-xl { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }

/* ---- header (same as the front page's solid header) ---- */
.appbar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: var(--ink-text); box-shadow: 0 1px 0 var(--ink-line); }
.appbar :focus-visible { outline-color: var(--ink-focus); }
.appbar-in { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; min-height: 64px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink-text); text-decoration: none; font-weight: 900; font-size: 1.3rem; letter-spacing: -0.035em; flex: none; }
.brand-mark { flex: none; width: 28px; height: 28px; background: var(--ink-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Cpath d='M2 10H10.5L20 15.5 29.5 10 20 4.5 10.5 10V21.5L20 27 29.5 21.5V10' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Cpath d='M2 10H10.5L20 15.5 29.5 10 20 4.5 10.5 10V21.5L20 27 29.5 21.5V10' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.brand .wm b, .brand b { color: var(--ink-accent); font-weight: inherit; }
.app-nav { margin-left: auto; }
.app-nav > ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.app-nav a, .app-nav .dd-btn { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink-text); text-decoration: none; text-transform: uppercase;
  letter-spacing: 0.06em; font: inherit; font-size: 0.82rem; font-weight: 700; padding: 8px 12px; border-radius: 6px; background: none; border: 0; margin: 0; cursor: pointer; }
.app-nav a:hover, .app-nav .dd-btn:hover { background: rgba(238, 243, 240, 0.08); }
.app-nav > ul > li > a[aria-current="page"], .app-nav .dd-btn.current { color: var(--ink-accent); box-shadow: inset 0 -2px 0 var(--ink-accent); border-radius: 6px 6px 0 0; }
.dd { position: relative; }
.dd-btn::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); opacity: 0.8; }
.dd-btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.dd-menu { position: absolute; left: 0; top: calc(100% + 8px); min-width: 280px; margin: 0; padding: 8px; list-style: none; background: var(--ink-2);
  border: 1px solid var(--ink-line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); display: none; }
.dd.open .dd-menu { display: block; }
.dd-menu a { display: grid !important; grid-template-columns: 22px 1fr; gap: 2px 12px !important; text-transform: none !important; letter-spacing: 0 !important;
  font-size: 0.95rem !important; padding: 10px 12px !important; border-radius: 8px; }
.dd-menu a[aria-current="page"] { background: rgba(76, 194, 127, 0.12); color: var(--ink-accent); }
.dd-menu svg { width: 22px; height: 22px; stroke: var(--ink-accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; grid-row: span 1; align-self: center; }
.app-acts { display: flex; align-items: center; gap: 12px; flex: none; }
.app-acts .credits { color: var(--ink-text); text-decoration: none; font-weight: 700; font-size: 0.88rem; white-space: nowrap; padding: 6px 12px;
  border: 1px solid rgba(76, 194, 127, 0.5); border-radius: 999px; }
.app-acts .credits:hover { border-color: var(--ink-accent); color: var(--ink-accent); }
.acct-menu { position: relative; margin: 0; }
.acct-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; color: var(--ink-text);
  border: 1.5px solid rgba(238, 243, 240, 0.45); border-radius: 8px; padding: 6px 12px; white-space: nowrap; }
.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-menu > summary::after { content: "\25BE"; color: var(--ink-muted); }
.acct-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-accent); }
.acct-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.acct-pop :focus-visible { outline-color: var(--focus); }
.menu-btn { display: none; margin: 0 0 0 auto; background: transparent; border: 1.5px solid rgba(238, 243, 240, 0.5); color: var(--ink-text); border-radius: 8px;
  padding: 6px 12px; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
@media (max-width: 1100px) { .app-nav a, .app-nav .dd-btn { padding: 8px 8px; letter-spacing: 0.04em; } .appbar-in { gap: 12px; } }
@media (max-width: 960px) {
  .appbar-in { flex-wrap: wrap; padding: 0 16px; gap: 10px; }
  .menu-btn { display: inline-block; }
  .app-nav { display: none; order: 5; width: 100%; margin: 0; padding: 0 0 12px; }
  .appbar.open .app-nav { display: block; }
  .app-nav > ul { flex-direction: column; align-items: stretch; }
  .app-nav a, .app-nav .dd-btn { width: 100%; padding: 12px 8px; font-size: 0.9rem; }
  .app-nav > ul > li > a[aria-current="page"], .app-nav .dd-btn.current { box-shadow: inset 3px 0 0 var(--ink-accent); border-radius: 0 6px 6px 0; }
  .dd-menu { position: static; display: block; min-width: 0; border: 0; box-shadow: none; background: transparent; padding: 0 0 0 12px; }
  .dd-btn { pointer-events: none; } .dd-btn::after { display: none; }
  .app-acts { gap: 8px; order: 2; margin-left: auto; }
  .menu-btn { order: 3; margin: 0; }
}
.show-sm { display: none !important; }
@media (max-width: 560px) { .hide-sm { display: none !important; } .show-sm { display: revert !important; } }
@media (max-width: 480px) { .app-acts .credits { max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; } .brand { font-size: 1.15rem; } .brand-mark { width: 24px; height: 24px; } }

/* ---- page band: dark head of every page, like the front page's hero ---- */
.band { position: relative; overflow: hidden; isolation: isolate; background: var(--ink); color: var(--ink-text); padding: 44px 0 40px; }
.band::before { content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(var(--ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 80% 30%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at 80% 30%, #000 10%, transparent 70%); }
.band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 85% 20%, rgba(76, 194, 127, 0.16), transparent 55%); }
.band .kicker, .band .kicker a { color: var(--ink-accent); text-decoration: none; }
.band .kicker a:hover { text-decoration: underline; }
.band :focus-visible { outline-color: var(--ink-focus); }
.band a { color: var(--ink-accent); }
.band-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.band-row > :first-child { min-width: 0; flex: 1 1 420px; }
.band .lede { color: var(--ink-muted); font-size: 1.08rem; max-width: 46em; margin: 14px 0 0; border-left: 3px solid var(--ink-accent); padding-left: 14px; }
.band .muted, .band .hint { color: var(--ink-muted); }
.band-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 22px 0 -40px; }
.band-tabs a { color: var(--ink-muted); text-decoration: none; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 14px; border-radius: 8px 8px 0 0; }
.band-tabs a:hover { color: var(--ink-text); }
.band-tabs a[aria-current="page"] { background: var(--bg); color: var(--text); }
@media (max-width: 560px) { .band { padding: 30px 0 28px; } .band-tabs { margin-bottom: -28px; } .wrap { padding: 0 16px; } }

/* ---- page body ---- */
.page { max-width: var(--wrap); margin: 0 auto; padding: 32px 24px 80px; }
@media (max-width: 560px) { .page { padding: 20px 16px 64px; } }
.ui-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.ui-card + .ui-card { margin-top: 20px; }
@media (max-width: 560px) { .ui-card { padding: 18px 16px; border-radius: 14px; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.section-head h2, .section-head h3 { margin: 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border: 2px solid var(--accent); border-radius: 8px;
  padding: 10px 20px; background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost, .btn.secondary { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 14px; font-size: 0.9rem; }
.band .btn, .appbar .btn { border-color: var(--ink-accent); background: var(--ink-accent); color: var(--ink-accent-ink); }
.band .btn.ghost, .band .btn.secondary, .appbar .btn.ghost { background: transparent; color: var(--ink-text); border-color: rgba(238, 243, 240, 0.55); }
.band .btn.ghost:hover, .band .btn.secondary:hover { border-color: var(--ink-accent); color: var(--ink-accent); filter: none; }
.btn .arrow-r { width: 16px; height: 16px; }

/* ---- small parts ---- */
.pill-tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(76, 194, 127, 0.5); color: var(--ink-accent); font-weight: 700; font-size: 0.82rem;
  border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.pill-tag.bad { border-color: rgba(255, 138, 128, 0.6); color: #ff9d94; }
.pill-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stat { background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .k { text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.stat .v { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; }
.stat .s { font-size: 0.85rem; color: var(--muted); }
.stat.strong { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.stat.strong .k { color: var(--ink-accent); } .stat.strong .s { color: var(--ink-muted); }
.empty-state { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 260px; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); padding: 32px 16px; background: var(--card); }
.empty-state svg { width: 64px; height: 64px; stroke: var(--accent); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.notice-bar { display: flex; gap: 12px; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-bg);
  border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; }
.notice-bar::before { content: "!"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--warn); color: var(--card); font-weight: 900;
  display: grid; place-items: center; font-size: 0.85rem; margin-top: 1px; }

/* ---- dialogs ---- */
dialog.ui-dialog { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text);
  padding: 24px; box-shadow: var(--shadow); }
dialog.ui-dialog::backdrop { background: rgba(8, 14, 11, 0.6); }

/* ---- footer ---- */
.app-foot { background: var(--ink-2); color: var(--ink-muted); font-size: 0.88rem; }
.app-foot .wrap { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.app-foot a { color: var(--ink-text); text-decoration: none; } .app-foot a:hover { text-decoration: underline; }
.app-foot .sp { flex: 1; }
.app-foot :focus-visible { outline-color: var(--ink-focus); }
@media (max-width: 560px) { .band-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .band-tabs a { white-space: nowrap; } }
