/* Monks Pit — mobile-first stylesheet */
:root {
  --green: #1f4d3a;
  --green-dark: #163a2c;
  --green-soft: #e4efe8;
  --stone: #f4f1ea;
  --bg: #f6f5f1;
  --card: #ffffff;
  --text: #1d1f1c;
  --muted: #6b6f68;
  --line: #e2e0d8;
  --accent: #c8912e;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #2f7a4f;
  --ok-soft: #e3f2e8;
  --warn-soft: #fff3d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 20, .06), 0 4px 14px rgba(20, 30, 20, .05);
  --tab-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #2f7a58;
    --green-dark: #1f5a40;
    --green-soft: #1c2e25;
    --stone: #23262a;
    --bg: #141614;
    --card: #1e211f;
    --text: #ecebe6;
    --muted: #a3a79f;
    --line: #2f332f;
    --danger-soft: #3a1f1d;
    --ok-soft: #1c3326;
    --warn-soft: #3a2f16;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
body.bare { padding-bottom: 0; }
a { color: var(--green); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--stone); padding: .1em .35em; border-radius: 4px; }
code.wrap { display: block; word-break: break-all; padding: .6rem; margin-bottom: .75rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem;
  background: var(--green); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; display: flex; align-items: center; min-height: 44px; }
.topnav { display: none; gap: .25rem; margin-left: auto; }
.topnav a { color: rgba(255,255,255,.85); text-decoration: none; padding: .35rem .7rem; border-radius: 8px; font-weight: 500; }
.topnav a.is-active, .topnav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar-logout { margin-left: auto; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }

/* Page */
.page { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 1.5rem; }
.page-bare { max-width: 440px; padding-top: 2.5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.page-head .page-title { margin: 0; }
.page-title { margin: .25rem 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.link { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
/* Header links sit in a flex row; the tall tap area must not stretch the row. */
.card-head .link, .page-head .link { margin: -.6rem 0; }
.danger-text { color: var(--danger); }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.card-accent { border-left: 5px solid var(--accent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.card-auth { margin-top: 1rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.notice { background: var(--warn-soft); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: 1rem; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--green-soft); color: var(--green); }

/* Forms */
.stack > * + * { margin-top: .9rem; }
.stack h2 { margin-top: 1.5rem; }
label { display: block; font-weight: 600; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
label.check input { width: 22px; height: 22px; margin: 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; margin-top: .3rem;
  font: inherit; color: var(--text);
  /* Never below 16px: iOS Safari zooms the page on focus when a field is smaller. */
  font-size: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; min-height: 46px;
}
input[type=file] { padding: .5rem; }
textarea { resize: vertical; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .3rem; }
/* minmax(0,1fr) lets the columns shrink; a bare 1fr keeps a date input's
   intrinsic width and pushes the page sideways on a narrow phone. */
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }
.filter-input { margin-bottom: .75rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .3rem; }
.segmented { display: block; }
.segmented > label { display: inline-block; margin: .3rem .5rem .3rem 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: flex; flex-direction: column; align-items: center; padding: .7rem 1.4rem; border: 2px solid var(--line); border-radius: 12px; font-weight: 600; cursor: pointer; }
.segmented span small { font-weight: 400; color: var(--muted); }
.segmented input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.segmented input:focus-visible + span { outline: 2px solid var(--green); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: .7rem 1.1rem; min-height: 46px; border-radius: 12px;
  background: var(--stone); color: var(--text); border: 1px solid var(--line);
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-block { display: flex; width: 100%; margin-top: .75rem; }
.btn-sm { padding: .4rem .8rem; min-height: 44px; font-size: .875rem; border-radius: 9px; }
.btn-lg { min-height: 56px; font-size: 1.1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.btn .icon { width: 20px; height: 20px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li, .list > li + li > .list-row { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; color: inherit; text-decoration: none; }
.list-compact .list-row { padding: .5rem 0; }
.card-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 1rem; margin-bottom: 1rem; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.list-main small { color: var(--muted); font-size: .82rem; }
.list-main strong { overflow: hidden; text-overflow: ellipsis; }
.date-chip { flex: none; width: 52px; text-align: center; background: var(--green-soft); color: var(--green); border-radius: 10px; padding: .3rem 0; line-height: 1.1; font-size: .7rem; text-transform: uppercase; display: flex; flex-direction: column; }
.date-chip strong { font-size: 1.25rem; }
.swim-pill { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.swim-row.is-free .swim-pill { background: var(--ok); }
.swim-row.is-booked .swim-pill { background: var(--muted); }
.swim-row.is-closed .swim-pill { background: var(--danger); }
.swim-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 1rem; }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; background: var(--stone) center/cover no-repeat; }
.capture-row .thumb { width: 64px; height: 64px; }

/* Badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .25rem .5rem; border-radius: 999px; background: var(--stone); color: var(--muted); white-space: nowrap; }
.badge-lg { font-size: .85rem; padding: .35rem .7rem; margin-bottom: .75rem; }
.badge-booked { background: var(--green-soft); color: var(--green); }
.badge-arrived { background: var(--ok-soft); color: var(--ok); }
.badge-completed { background: var(--stone); color: var(--muted); }
.badge-cancelled { background: var(--stone); color: var(--muted); text-decoration: line-through; }
.badge-no_show { background: var(--danger-soft); color: var(--danger); }
.badge-best { background: var(--accent); color: #fff; font-size: .65rem; vertical-align: middle; }
.badge-admin { background: var(--accent); color: #fff; font-size: .65rem; vertical-align: middle; }

/* Facts */
.facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font-weight: 500; }
.admin-tools { margin-top: 1rem; }
details summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }

/* Week strip */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.week-day { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: inherit; background: var(--ok-soft); border-radius: 10px; padding: .45rem .1rem; min-height: 68px; font-size: .72rem; line-height: 1.2; }
.week-day strong { font-size: 1.1rem; }
.week-day small { color: var(--muted); font-size: .65rem; }
.week-day.is-full { background: var(--danger-soft); }

/* Calendar */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.month-nav h2, .month-nav h1 { margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; padding-bottom: .25rem; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px; border-radius: 9px; text-decoration: none; color: inherit; background: var(--ok-soft); line-height: 1.15; }
.cal-day.is-empty { background: transparent; }
.cal-num { font-weight: 600; }
.cal-free { font-size: .62rem; color: var(--muted); }
.cal-day.is-low { background: var(--warn-soft); }
.cal-day.is-full, .cal-day.is-closed { background: var(--danger-soft); }
.cal-day.is-past { background: var(--stone); color: var(--muted); opacity: .6; }
.cal-day.is-far { opacity: .55; }
.cal-day.is-today .cal-num { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 .45rem; }
.cal-day.is-mine { box-shadow: inset 0 0 0 2px var(--green); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: .75rem 0 .25rem; font-size: .78rem; color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .25rem; }
.swatch-free { background: var(--ok-soft); }
.swatch-low { background: var(--warn-soft); }
.swatch-full { background: var(--danger-soft); }
.swatch-mine { box-shadow: inset 0 0 0 2px var(--green); }

/* Fish */
.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.fish-card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; }
.fish-card.is-lost, .fish-card.is-unknown { opacity: .7; }
.fish-photo { position: relative; aspect-ratio: 4 / 3; background: var(--green-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--green); }
.fish-photo .icon { width: 48px; height: 48px; opacity: .5; }
.fish-status { position: absolute; top: .4rem; left: .4rem; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: .15rem .45rem; border-radius: 6px; }
.fish-body { display: flex; flex-direction: column; padding: .6rem .75rem .75rem; }
.fish-body small { color: var(--muted); font-size: .78rem; }
.fish-weight { color: var(--accent); font-weight: 700; margin-top: .25rem; }
.fish-hero { border-radius: var(--radius); min-height: 220px; background: var(--green) center/cover no-repeat; display: flex; align-items: flex-end; margin-bottom: 1rem; overflow: hidden; }
.fish-hero-text { width: 100%; padding: 2.5rem 1rem .9rem; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; }
.fish-hero-text h1, .fish-hero-text p { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.stat-row-wrap { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.stat { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: .7rem; text-align: center; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.stat small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 1.3rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.photo { margin: 0; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.photo figcaption { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.swim-photo { border-radius: 10px; max-height: 200px; object-fit: cover; }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 12px; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; }
.chart-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }

/* Prose (rules) */
.prose h2 { margin-top: 1.25rem; font-size: 1.15rem; color: var(--green); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1rem; margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .35rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* Admin */
.admin-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
.admin-menu a { display: block; background: var(--card); box-shadow: var(--shadow); border-radius: 12px; padding: .8rem; text-decoration: none; font-weight: 600; color: var(--text); }
.segmented-links { display: flex; gap: .35rem; margin-bottom: .75rem; }
.segmented-links a { flex: 1; text-align: center; padding: .5rem; border-radius: 10px; background: var(--card); text-decoration: none; color: var(--muted); font-weight: 600; box-shadow: var(--shadow); }
.segmented-links a.is-active { background: var(--green); color: #fff; }

/* QR print sheet */
.qr-page { max-width: 900px; margin: 0 auto; }
.qr-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.qr-card { background: #fff; color: #000; border: 2px solid #000; border-radius: 12px; padding: 1.25rem; text-align: center; page-break-inside: avoid; break-inside: avoid; }
.qr-code { display: flex; justify-content: center; margin-bottom: .75rem; }
.qr-code img, .qr-code canvas { max-width: 100%; }
.qr-card h2 { font-size: 1.5rem; margin: 0; }
.qr-card p { margin: .25rem 0 0; color: #333; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; }
.tab .icon { width: 24px; height: 24px; }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab { min-width: 0; padding: 0 2px; }
.tab.is-active { color: var(--green); }

/* Desktop */
@media (min-width: 760px) {
  body { padding-bottom: 2rem; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .topbar-logout { margin-left: 0; }
  .page { padding-top: 1.5rem; }
  .admin-menu { grid-template-columns: repeat(4, 1fr); }
  .cal-day { min-height: 64px; }
}

@media print {
  .no-print, .topbar, .tabbar { display: none !important; }
  body { background: #fff; padding: 0; }
  .page { max-width: none; padding: 0; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Auth screens (sign in, reset, invite, first-run setup)
   Deliberately dark in both colour schemes: a full-bleed entrance screen that
   reads as one considered surface rather than a form on a page.
   ========================================================================== */
.auth-screen {
  --auth-ink: #eaf2ed;
  --auth-dim: #8fa89b;
  --auth-line: rgba(160, 205, 180, .16);
  --auth-field: rgba(9, 24, 18, .5);
  --auth-gold: #d8a63f;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  color: var(--auth-ink);
  background: #071410;
  -webkit-font-smoothing: antialiased;
}
/* Depth: two soft light sources over a deep green ground, plus contour lines
   that read as a lake survey map without ever becoming a picture. */
.auth-screen::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(47, 122, 88, .45), transparent 70%),
    radial-gradient(70% 50% at 100% 100%, rgba(20, 70, 55, .5), transparent 70%),
    linear-gradient(180deg, #0a1b15 0%, #071410 55%, #050f0c 100%);
}
.auth-screen::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .75;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%232f7a58' stroke-opacity='.45' stroke-width='1'%3E%3Cellipse cx='210' cy='210' rx='40' ry='26'/%3E%3Cellipse cx='210' cy='210' rx='78' ry='52'/%3E%3Cellipse cx='210' cy='210' rx='120' ry='80'/%3E%3Cellipse cx='210' cy='210' rx='166' ry='112'/%3E%3Cellipse cx='210' cy='210' rx='214' ry='146'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center -60px;
  background-repeat: no-repeat;
  background-size: 140% auto;
  mask-image: radial-gradient(70% 55% at 50% 22%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 55% at 50% 22%, #000 0%, transparent 78%);
}
.auth-wrap {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 1.25rem;
  width: 100%; max-width: 420px; margin: 0 auto;
  padding: calc(2rem + env(safe-area-inset-top)) 1.25rem calc(2rem + env(safe-area-inset-bottom));
}

/* Identity */
.auth-head { text-align: center; margin-bottom: .25rem; }
.auth-head h1 {
  margin: 0; font-size: 2.6rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.02; color: #fff;
}
.auth-kicker {
  display: inline-flex; align-items: center; gap: .6rem;
  margin: .85rem 0 0; font-size: .7rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--auth-dim);
}
/* Hairline rules either side, in place of a logo. */
.auth-kicker::before, .auth-kicker::after {
  content: ""; width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 166, 63, .55));
}
.auth-kicker::after { background: linear-gradient(90deg, rgba(216, 166, 63, .55), transparent); }

/* The card */
.auth-card {
  background: rgba(13, 34, 26, .66);
  border: 1px solid var(--auth-line);
  border-radius: 18px;
  padding: 1.5rem 1.25rem 1.35rem;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.auth-card h1 { font-size: 1.3rem; color: #fff; margin-bottom: .35rem; }
.auth-card > p { color: var(--auth-dim); margin: 0 0 1.15rem; font-size: .92rem; }

/* Fields */
.auth-field { display: block; margin-bottom: 1rem; }
.auth-field > span {
  display: block; margin-bottom: .4rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--auth-dim);
}
.auth-screen input:not([type=checkbox]):not([type=radio]) {
  width: 100%; margin: 0; min-height: 52px;
  padding: .85rem 1rem;
  font-size: 16px; line-height: 1.2; color: var(--auth-ink);
  background: var(--auth-field);
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-screen input::placeholder { color: rgba(143, 168, 155, .55); }
.auth-screen input:focus {
  outline: none;
  border-color: rgba(216, 166, 63, .7);
  background: rgba(9, 24, 18, .75);
  box-shadow: 0 0 0 4px rgba(216, 166, 63, .14);
}
.auth-screen input:-webkit-autofill {
  -webkit-text-fill-color: var(--auth-ink);
  -webkit-box-shadow: 0 0 0 1000px #0d2a20 inset;
}

/* Show / hide password */
.auth-pw { position: relative; }
.auth-pw input { padding-right: 4.6rem; }
.auth-pw button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 40px; padding: 0 .7rem;
  font: inherit; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--auth-dim); background: transparent;
  border: 0; border-radius: 8px; cursor: pointer;
}
.auth-pw button:hover, .auth-pw button:focus-visible { color: var(--auth-gold); background: rgba(216, 166, 63, .1); }

/* Submit */
.auth-submit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 54px; margin-top: 1.35rem;
  font: inherit; font-size: 1rem; font-weight: 700; letter-spacing: .01em;
  color: #06120e; cursor: pointer;
  background: linear-gradient(180deg, #f0d48a 0%, var(--auth-gold) 55%, #b7842a 100%);
  border: 0; border-radius: 12px;
  box-shadow: 0 8px 22px rgba(216, 166, 63, .26), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.04); }
.auth-submit:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(216, 166, 63, .22); }
.auth-submit[disabled] { opacity: .6; cursor: default; }

/* Footers and messages */
.auth-foot { margin: 1.1rem 0 0; text-align: center; }
.auth-foot a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem;
  color: var(--auth-dim); text-decoration: none; font-size: .88rem; font-weight: 500;
}
.auth-foot a:hover, .auth-foot a:focus-visible { color: var(--auth-gold); }
.auth-note { margin: 0; text-align: center; font-size: .75rem; color: rgba(143, 168, 155, .65); }
.auth-screen .flash {
  border-radius: 12px; border: 1px solid transparent;
  font-size: .9rem; margin-bottom: 1rem;
}
.auth-screen .flash-error { background: rgba(179, 38, 30, .18); border-color: rgba(255, 138, 128, .35); color: #ffc9c4; }
.auth-screen .flash-success { background: rgba(47, 122, 88, .2); border-color: rgba(120, 220, 170, .3); color: #b7f0d2; }
.auth-screen .flash code { background: rgba(0, 0, 0, .3); color: inherit; }

@media (min-width: 760px) { .auth-wrap { max-width: 440px; } }
@media (prefers-reduced-motion: reduce) { .auth-submit { transition: none; } }

/* ==========================================================================
   Account
   ========================================================================== */
.identity {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.1rem; margin-bottom: 1rem;
  border-radius: var(--radius);
  color: #eaf2ed;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(47, 122, 88, .55), transparent 60%),
    linear-gradient(135deg, #123125 0%, #0b2119 100%);
  box-shadow: var(--shadow);
}
.identity-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; color: #eaf2ed;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(216, 166, 63, .45);
}
.identity-main { min-width: 0; }
.identity-main strong { display: block; font-size: 1.15rem; line-height: 1.25; }
.identity-email { display: block; font-size: .85rem; color: #9dbaab; overflow: hidden; text-overflow: ellipsis; }
.identity-tags { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .35rem; margin-top: .45rem; }
.tag {
  display: inline-block; font-size: .66rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #cfe3d8;
}
.tag-ok { background: rgba(120, 220, 170, .2); color: #a9ecc9; }
.tag-warn { background: rgba(216, 166, 63, .22); color: #f0d48a; }
.tag-gold { background: rgba(216, 166, 63, .22); color: #f0d48a; }

.section-label {
  display: block; margin: 1.5rem 0 .5rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.section-label:first-child { margin-top: 0; }

.help-row {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; min-height: 48px; padding: .5rem 0;
  font: inherit; text-align: left; color: var(--text);
  background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer;
}
.help-row:first-of-type { border-top: 0; }
.help-row .icon { flex: none; width: 20px; height: 20px; color: var(--muted); }
details.help > summary { list-style: none; min-height: 48px; display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; font-size: .92rem; border-top: 1px solid var(--line); }
details.help:first-of-type > summary { border-top: 0; }
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 1.2rem; }
details.help[open] > summary::after { content: "−"; }
details.help p { margin: 0 0 .75rem; color: var(--muted); font-size: .9rem; }

/* Shareable link (member invites) */
.share { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.share .section-label { margin-top: 0; }
.share-link {
  width: 100%; margin: 0 0 .5rem; padding: .7rem .8rem; min-height: 46px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
  color: var(--text); background: var(--stone);
  border: 1px solid var(--line); border-radius: 10px;
}
