/* ==========================================================================
   defl.at — Design System
   10RUPTiV private file/secret/short-link sharing
   System fonts only · No external resources · CSP strict compliant
   ========================================================================== */

/* ----- Tokens -------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-navy: #0a3a66;
  --brand-navy-700: #082c4e;
  --brand-navy-300: #4d7fa8;
  --brand-cyan: #2dabd1;

  /* Semantic surfaces */
  --bg: #f7f9fc;
  --bg-elevated: #ffffff;
  --fg: #0f1d2e;
  --fg-strong: #03101f;
  --muted: #5a6b80;
  --border: #d8e0ec;
  --border-strong: #b9c5d6;

  /* Accent system */
  --accent: var(--brand-navy);
  --accent-hover: var(--brand-navy-700);
  --accent-fg: #ffffff;
  --accent-soft: #e8f0f9;

  /* Status palette */
  --ok: #157a4a;
  --ok-soft: #e3f4ec;
  --info: #1e6fb4;
  --info-soft: #e4f0fa;
  --warn: #b56500;
  --warn-soft: #fef4e3;
  --danger: #b6253c;
  --danger-soft: #fbe7eb;
  --pending: #5a6b80;
  --pending-soft: #eef1f6;

  /* Code / mono */
  --code-bg: #eef2f8;
  --code-fg: #0f1d2e;

  /* Geometry */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(10, 30, 60, 0.04), 0 1px 3px rgba(10, 30, 60, 0.06);
  --shadow: 0 4px 12px rgba(10, 30, 60, 0.08), 0 1px 3px rgba(10, 30, 60, 0.05);
  --shadow-lg: 0 12px 32px rgba(10, 30, 60, 0.12), 0 2px 6px rgba(10, 30, 60, 0.06);
  --focus-ring: 0 0 0 3px rgba(45, 171, 209, 0.35);

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --container-max: 1100px;
  --gap: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08111f;
    --bg-elevated: #0f1d2e;
    --fg: #e6edf6;
    --fg-strong: #ffffff;
    --muted: #93a3b8;
    --border: #233247;
    --border-strong: #34465f;

    --accent: #5fb1de;
    --accent-hover: #7cc1e8;
    --accent-fg: #07172a;
    --accent-soft: #11304a;

    --ok: #5fd99c;
    --ok-soft: #0f3525;
    --info: #6cb4ee;
    --info-soft: #102a44;
    --warn: #f5b561;
    --warn-soft: #3a2710;
    --danger: #f47c8e;
    --danger-soft: #391422;
    --pending: #93a3b8;
    --pending-soft: #1a2638;

    --code-bg: #0a1828;
    --code-fg: #d6e2ef;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
    --focus-ring: 0 0 0 3px rgba(95, 177, 222, 0.4);
  }
}

/* ----- Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle gradient backdrop on auth/landing pages */
body.public {
  background:
    radial-gradient(1200px 600px at 80% -20%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--accent-soft) 0%, transparent 55%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--accent-hover); border-bottom-color: currentColor; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 3px; }

h1, h2, h3, h4 {
  color: var(--fg-strong);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  font-weight: 650;
}
h1 { font-size: 1.7rem; line-height: 1.25; }
h2 { font-size: 1.25rem; margin-top: 28px; }
h3 { font-size: 1.05rem; margin-top: 20px; }

p { margin: 0 0 12px; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

::selection { background: var(--accent-soft); color: var(--fg-strong); }

/* ----- Layout -------------------------------------------------------------- */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
header img { height: 30px; display: block; color: var(--accent); }
header .brand {
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--fg-strong);
  font-size: 1.05rem;
}
header .brand-sub {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: 4px;
}

main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: 560px; }
.container--wide { max-width: 1280px; }

.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }

.row { display: flex; flex-direction: row; gap: var(--gap); flex-wrap: wrap; align-items: center; }
.row-tight { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end { justify-content: flex-end; }
.row-between { justify-content: space-between; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

section {
  margin-bottom: 28px;
}
section + section {
  padding-top: 8px;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.note { color: var(--muted); font-style: italic; font-size: 0.9rem; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.text-strong { color: var(--fg-strong); font-weight: 600; }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }

/* ----- Hero / centered auth ----------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 16px 24px;
  gap: 12px;
}
.hero__mark {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-cyan) 130%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.hero__mark svg { width: 32px; height: 32px; color: #fff; }
.hero h1 { font-size: 2rem; margin: 0; }
.hero__brand {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--accent);
}
.hero__tagline {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

.center-card {
  max-width: 460px;
  margin: 32px auto;
}

/* ----- Cards --------------------------------------------------------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-elevated {
  box-shadow: var(--shadow);
}
.card-warning {
  border-color: var(--warn);
  border-left: 4px solid var(--warn);
  background: var(--warn-soft);
}
.card-danger {
  border-color: var(--danger);
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}
.card-info {
  border-color: var(--info);
  border-left: 4px solid var(--info);
  background: var(--info-soft);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -24px -24px 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-header h2,
.card-header h3 { margin: 0; }

.card-body { /* default content area */ }

.card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 16px -24px -24px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ----- Badges -------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--pending-soft);
  color: var(--pending);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.6;
}
.badge-ok      { background: var(--ok-soft);      color: var(--ok); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-warn    { background: var(--warn-soft);    color: var(--warn); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-pending { background: var(--pending-soft); color: var(--pending); }

.badge-dot::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 2px;
}

.count {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 6px;
  line-height: 1.6;
}

/* ----- Buttons ------------------------------------------------------------- */
button, .btn {
  appearance: none;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
button:hover, .btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
button[disabled], .btn[disabled],
button:disabled, .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary { /* alias */ }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #951c30; border-color: #951c30; color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 12px 22px;
  font-size: 1rem;
}

.btn-loading {
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  color: var(--accent-fg);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* primary class on btn for legacy template */
.btn.primary { font-weight: 650; }

/* ----- Forms --------------------------------------------------------------- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-row label,
label.form-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.form-row label > .required,
.required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="url"],
select,
textarea,
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

textarea { resize: vertical; min-height: 90px; }

input[type="file"] {
  background: transparent;
  border: 0;
  padding: 0;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin: 0 6px 0 0;
  accent-color: var(--accent);
}

label.checkbox-row,
label.radio-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
label.checkbox-row:hover, label.radio-row:hover { border-color: var(--border-strong); }
label.checkbox-row input, label.radio-row input { margin: 0; }

.form-help {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: -4px;
}
.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
}

/* form container (legacy compat) */
form {
  margin: 0;
}
form.form-stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* TTL preset radios */
.ttl-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ttl-presets label {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--muted);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ttl-presets label:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ttl-presets input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ttl-presets input[type="radio"]:checked + span,
.ttl-presets label:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ----- Tables -------------------------------------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table, .table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.92rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td, .table th, .table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th, .table th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-strong);
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--accent-soft); }

.table-compact th, .table-compact td { padding: 6px 10px; font-size: 0.86rem; }

/* ----- Tabs ---------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 2px;
  margin: 16px 0 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  color: var(--muted);
  padding: 12px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.tab:hover {
  color: var(--fg-strong);
  background: var(--bg);
  border-color: var(--accent);
  border-bottom-color: var(--border-strong);
}
.tab.active {
  color: var(--accent);
  background: var(--bg-elevated);
  border-bottom-color: var(--accent);
}
.tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.tab-panel {
  padding: 24px 0 4px;
}
.tab-panel:not(.active) { display: none; }

/* ----- Dropzone ------------------------------------------------------------ */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--focus-ring);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone__hint {
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.dropzone__hint strong {
  color: var(--accent);
  font-weight: 650;
}
.dropzone__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: 0.7;
}
.dropzone__filelist {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dropzone__filelist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.dropzone__filelist .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropzone__filelist .file-size {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.dropzone__filelist .file-remove {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 1.05rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.dropzone__filelist .file-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ----- Toast --------------------------------------------------------------- */
.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  color: var(--fg);
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  font-size: 0.92rem;
  min-width: 240px;
  max-width: 360px;
  pointer-events: auto;
  animation: toast-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-ok    { border-left-color: var(--ok); }
.toast-warn  { border-left-color: var(--warn); }
.toast-error { border-left-color: var(--danger); }
.toast strong { display: block; margin-bottom: 2px; color: var(--fg-strong); }

@keyframes toast-slide {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ----- Code / URL display -------------------------------------------------- */
code {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border);
  margin: 0 0 12px;
}

.code-block {
  position: relative;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 16px 56px 16px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  word-break: break-all;
  white-space: pre-wrap;
  margin: 0 0 12px;
}
.code-block__copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-sans);
}
.code-block__copy:hover { background: var(--accent-soft); border-color: var(--accent); }
.code-block__copy.copied { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }

/* ----- Status / alerts (legacy compat) ------------------------------------ */
.warn {
  background: var(--warn-soft);
  color: var(--warn);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warn);
  font-size: 0.92rem;
}
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  margin: 0 0 12px;
}
.alert-info    { background: var(--info-soft);    color: var(--info);    border-color: var(--info); }
.alert-ok      { background: var(--ok-soft);      color: var(--ok);      border-color: var(--ok); }
.alert-warn    { background: var(--warn-soft);    color: var(--warn);    border-color: var(--warn); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger); }
.alert strong  { color: inherit; }

/* ----- Spinner ------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

/* ----- Reveal animation ---------------------------------------------------- */
.reveal {
  animation: reveal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- Footer / chrome ----------------------------------------------------- */
.page-footer {
  margin: 48px auto 24px;
  max-width: var(--container-max);
  padding: 16px 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.page-footer a { color: var(--muted); border-bottom-color: transparent; }
.page-footer a:hover { color: var(--accent); }
.page-footer p { margin: 0 0 8px; }
.page-footer p:last-child { margin-bottom: 0; }
.footer-disclaimer { max-width: 720px; margin: 0 auto 12px !important; line-height: 1.5; }
.footer-disclaimer strong { color: var(--text); }
.footer-brand { opacity: 0.7; font-size: 0.78rem; }

/* ----- Utility ------------------------------------------------------------- */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.flex-1 { flex: 1; }

/* ----- Mobile -------------------------------------------------------------- */
@media (max-width: 768px) {
  main { padding: 20px 16px 48px; }
  header { padding: 12px 16px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; }
  .card { padding: 18px; }
  .card-header { margin: -18px -18px 14px; padding: 14px 18px; }
  .card-footer { margin: 14px -18px -18px; padding: 14px 18px; }
  .hero { padding: 32px 12px 16px; }
  .hero h1 { font-size: 1.5rem; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { padding: 10px 14px; font-size: 0.9rem; }
  table { font-size: 0.82rem; }
  th, td { padding: 7px 8px; }
  .toast-host { left: 16px; right: 16px; }
  .toast { max-width: none; }
}
