/* ==========================================================================
   After Court - design system
   1. Tokens   2. Base   3. Layout   4. Buttons   5. Forms   6. Components
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ink: #0b1411;
  --ink-2: #14201b;
  --court: #0c3a2c;
  --court-2: #0f4d3a;
  --lime: #d7ff18;
  --lime-deep: #b5db00;
  --lime-soft: #f3ffb8;

  --bg: #f4f5ef;
  --surface: #ffffff;
  --surface-2: #eef0e7;
  --line: #dde1d3;
  --line-strong: #c3c9b6;
  --text: #0f1a15;
  --muted: #5a645c;
  --faint: #8a938b;

  --ok: #0f7a4a;      --ok-bg: #dff5e8;
  --warn: #8a5a00;    --warn-bg: #fdf0cf;
  --bad: #b3261e;     --bad-bg: #fde4e1;
  --info: #1d4ed8;    --info-bg: #e3ebff;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 20, 17, .06), 0 1px 1px rgba(11, 20, 17, .04);
  --shadow: 0 8px 24px -8px rgba(11, 20, 17, .18), 0 2px 6px rgba(11, 20, 17, .05);
  --shadow-lg: 0 24px 60px -20px rgba(11, 20, 17, .35);
  --focus: 0 0 0 3px rgba(29, 78, 216, .35);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1200px;
  --header-h: 68px;
  /* Phone notch / status bar / rounded corners. 0 in a normal browser; the real size when installed as an app. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a100d;
  --surface: #111a16;
  --surface-2: #17221d;
  --line: #24312a;
  --line-strong: #34443a;
  --text: #eef3ec;
  --muted: #9aa69d;
  --faint: #6f7b72;
  --ok: #5fdc9a;      --ok-bg: rgba(95, 220, 154, .13);
  --warn: #f2c15d;    --warn-bg: rgba(242, 193, 93, .13);
  --bad: #ff8a80;     --bad-bg: rgba(255, 138, 128, .13);
  --info: #8fb0ff;    --info-bg: rgba(143, 176, 255, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --focus: 0 0 0 3px rgba(143, 176, 255, .45);
  color-scheme: dark;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
small { font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--lime); color: var(--ink); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
body.modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* 3. Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.container-mid { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.page { padding: 40px 0 72px; }
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-dark { background: var(--ink); color: #eef3ec; }
.section-dark .muted { color: #9fb0a5; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 56ch; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.eyebrow.lime, .section-dark .eyebrow { color: var(--lime); }
.eyebrow.accent { color: var(--ok); }
:root[data-theme="dark"] .eyebrow.accent { color: var(--lime); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .page { padding: 28px 0 56px; }
  .container, .container-narrow, .container-mid { padding: 0 16px; }
}

/* 4. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid transparent; font-weight: 700; font-size: .95rem; line-height: 1;
  letter-spacing: -.005em; text-align: center; white-space: nowrap;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--lime); color: var(--ink); box-shadow: 0 6px 18px -8px rgba(160, 200, 0, .9); }
.btn-primary:hover { background: #e6ff4d; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1c2c25; }
:root[data-theme="dark"] .btn-dark { background: #eef3ec; color: var(--ink); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-on-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .16); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.link { color: var(--ok); font-weight: 700; }
:root[data-theme="dark"] .link { color: var(--lime); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--text); position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* 5. Forms ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > .label { font-size: .82rem; font-weight: 700; color: var(--text); letter-spacing: .005em; }
.field small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date],
input[type=time], input[type=datetime-local], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: .97rem; transition: border-color .15s ease, box-shadow .15s ease;
}
/* Phones zoom into any field whose text is under 16px; keep form text at 16px there */
@media (max-width: 900px) {
  input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date],
  input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea { font-size: 16px; }
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--info); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235a645c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input[type=file] { padding: 9px 12px; background: var(--surface-2); }
input[type=file]::file-selector-button { margin-right: 12px; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
:root[data-theme="dark"] input[type=checkbox], :root[data-theme="dark"] input[type=radio] { accent-color: var(--lime); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-grid .full, .field-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .94rem; cursor: pointer; }
.check input { margin-top: 3px; }
.check small { display: block; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s ease; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { box-shadow: var(--focus); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toggle-row strong { display: block; font-size: .95rem; }
.toggle-row span.hint { color: var(--muted); font-size: .84rem; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-wrap .show-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.password-wrap .show-pass:hover { background: var(--surface-2); }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.form-note { color: var(--muted); font-size: .86rem; }

/* 6. Components ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 28px; }
.card-pad-sm { padding: 20px; }
@media (max-width: 640px) { .card-pad { padding: 20px; } }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 800; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-lime { background: var(--lime); color: var(--ink); }
.pill-dark { background: var(--ink); color: #fff; }
.chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--text); }

.flash-stack { position: fixed; z-index: 90; top: calc(var(--header-h) + var(--safe-top) + 12px); right: 16px; left: 16px; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.flash {
  pointer-events: auto; max-width: 460px; width: 100%; padding: 14px 16px 14px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--info); box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: flex-start; font-size: .94rem; font-weight: 600; animation: flash-in .25s ease;
}
.flash.success { border-left-color: var(--ok); } .flash.error { border-left-color: var(--bad); }
.flash button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 2px; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.notice.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.notice.info { background: var(--info-bg); border-color: transparent; color: var(--info); }
.notice.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.notice strong { display: block; }
.notice > div { flex: 1; min-width: 0; }

.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .tab.active { background: var(--lime); color: var(--ink); }
.tab-panel { display: none; } .tab-panel.active { display: block; animation: flash-in .2s ease; }

.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .4s ease; }
.meter.urgent > span { background: #e08a00; } .meter.full > span { background: var(--bad); }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--lime); font-weight: 800; font-size: .9rem; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.kv > div small { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.kv > div strong { font-size: 1rem; word-break: break-word; }

.empty { padding: 44px 24px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: transparent; }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* Modal (native <dialog>) */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.modal::backdrop { background: rgba(7, 12, 10, .62); backdrop-filter: blur(3px); }
dialog.modal[open] { display: flex; flex-direction: column; animation: flash-in .2s ease; }
dialog.modal.modal-lg { width: min(880px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.25rem; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface); }
.modal-close { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; line-height: 1; flex: none; }
@media (max-width: 640px) { .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; } }

/* Dropdown menu (<details>) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 60; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; font-size: .92rem; text-align: left; color: var(--text); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop hr { margin: 6px 0; }
.menu-pop form { margin: 0; }

/* Admin to-do: the shield (and the admin menu button) glows when something is waiting */
.icon-btn.has-todo { position: relative; border-color: var(--lime-deep); background: var(--lime-soft); color: var(--ink); animation: todo-glow 2.2s ease-in-out infinite; }
.icon-btn .todo-n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--ink); color: var(--lime); font-size: .7rem; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.todo-n { display: inline-block; margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--lime); color: var(--ink); font-size: .72rem; font-weight: 800; line-height: 22px; text-align: center; }
@keyframes todo-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(215, 255, 24, .0), 0 0 0 0 rgba(181, 219, 0, .55); } 50% { box-shadow: 0 0 14px 2px rgba(215, 255, 24, .75), 0 0 0 5px rgba(181, 219, 0, .25); } }
@media (prefers-reduced-motion: reduce) { .icon-btn.has-todo { animation: none; box-shadow: 0 0 0 4px rgba(181, 219, 0, .35); } }
:root[data-theme="dark"] .icon-btn.has-todo { background: var(--lime); }

/* Keep page content clear of the notch when a phone is turned sideways (0 everywhere else). */
body { padding-left: var(--safe-left); padding-right: var(--safe-right); }

/* Pull down to refresh (app.js, installed app only) */
.ptr { position: fixed; z-index: 400; left: 50%; top: calc(var(--safe-top, 0px) + 8px); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transform: translate(-50%, -46px); opacity: 0; pointer-events: none; transition: color .15s, background .15s; }
.ptr svg { width: 22px; height: 22px; }
.ptr.ready { color: var(--ink, #0b1411); background: var(--lime, #d7ff18); }
.ptr.spin svg { animation: ptr-spin .7s linear infinite; }
.ptr.gone { transition: opacity .2s, transform .2s; opacity: 0 !important; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (display-mode: standalone) { html, body { overscroll-behavior-y: contain; } }

/* Back buttons: one clear, easy-to-tap style everywhere */
a.back-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px 8px 12px; margin: 0 0 14px;
  border-radius: 999px; background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong, var(--line));
  font-weight: 800; font-size: .92rem; line-height: 1; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
a.back-btn:hover { border-color: var(--text); }
a.back-btn:active { transform: scale(.97); }
a.back-btn.back-btn-icon { width: 40px; height: 40px; padding: 0; margin: 0; justify-content: center; flex: none; font-size: 1.1rem; }
