/* AITrafficAnalytics design system.
   Multify look: Krona One wordmark, Instrument Sans body, monochrome tokens,
   1px borders, sharp corners, no shadows, no gradients, one yellow highlighter.
   Loaded after Tailwind + DaisyUI so it re-skins every DaisyUI component the
   older pages still use, and adds the ata-* components the new pages use. */

/* ===== 1. Tokens ===== */
:root,
[data-theme="light"] {
  --sc-bg: #ffffff;
  --sc-card: #f7f7f7;
  --sc-card2: #efefef;
  --sc-text: #0f0f0f;
  --sc-muted: #666666;
  --sc-accent: #555555;
  --sc-accent-hover: #333333;
  --sc-border: #e0e0e0;
  --sc-success: #16a34a;
  --sc-warning: #d97706;
  --sc-danger: #dc2626;
  --sc-hl: rgba(255, 206, 51, 0.85);
  --sc-hl-top: 50%;

  /* DaisyUI 3 palette remap (HSL triplets). Keeps legacy pages on-brand. */
  --b1: 0 0% 100%;
  --b2: 0 0% 96.9%;
  --b3: 0 0% 93.7%;
  --bc: 0 0% 5.9%;
  --p: 0 0% 5.9%;
  --pf: 0 0% 20%;
  --pc: 0 0% 100%;
  --s: 0 0% 33.3%;
  --sf: 0 0% 20%;
  --sc: 0 0% 100%;
  --a: 0 0% 40%;
  --af: 0 0% 30%;
  --ac: 0 0% 100%;
  --n: 0 0% 5.9%;
  --nf: 0 0% 20%;
  --nc: 0 0% 100%;
  --in: 0 0% 40%;
  --inc: 0 0% 100%;
  --su: 142 72% 29%;
  --suc: 0 0% 100%;
  --wa: 32 95% 44%;
  --wac: 0 0% 100%;
  --er: 0 72% 51%;
  --erc: 0 0% 100%;
  --rounded-box: 0;
  --rounded-btn: 0;
  --rounded-badge: 0;
  --tab-radius: 0;
  --animation-btn: 0;
  --animation-input: 0;
  --btn-text-case: none;
  --border-btn: 1px;
  --tab-border: 1px;
  color-scheme: light;
}

[data-theme="dark"] {
  --sc-bg: #0f0f0f;
  --sc-card: #1a1a1a;
  --sc-card2: #252525;
  --sc-text: #ffffff;
  --sc-muted: #a0a0a0;
  --sc-accent: #808080;
  --sc-accent-hover: #cccccc;
  --sc-border: #333333;
  --sc-success: #22c55e;
  --sc-warning: #f59e0b;
  --sc-danger: #ef4444;
  --sc-hl: rgba(255, 196, 38, 0.92);
  --sc-hl-top: 66%;

  --b1: 0 0% 5.9%;
  --b2: 0 0% 10.2%;
  --b3: 0 0% 14.5%;
  --bc: 0 0% 100%;
  --p: 0 0% 100%;
  --pf: 0 0% 80%;
  --pc: 0 0% 5.9%;
  --s: 0 0% 62.7%;
  --sf: 0 0% 80%;
  --sc: 0 0% 5.9%;
  --a: 0 0% 50%;
  --af: 0 0% 60%;
  --ac: 0 0% 5.9%;
  --n: 0 0% 100%;
  --nf: 0 0% 80%;
  --nc: 0 0% 5.9%;
  --in: 0 0% 62.7%;
  --inc: 0 0% 5.9%;
  --su: 142 71% 45%;
  --suc: 0 0% 5.9%;
  --wa: 38 92% 50%;
  --wac: 0 0% 5.9%;
  --er: 0 84% 60%;
  --erc: 0 0% 5.9%;
  color-scheme: dark;
}

/* ===== 2. Base ===== */
html { overflow-x: clip; }
html, body {
  font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sc-bg);
  color: var(--sc-text);
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--sc-text); outline-offset: 2px; }
::selection { background: var(--sc-hl); color: #0f0f0f; }

/* Kill rounding, shadows and gradients that legacy markup still asks for. */
.rounded, .rounded-sm, .rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl, .rounded-box,
.card, .btn, .badge, .input, .select, .textarea, .alert, .modal-box, .menu li > *, .dropdown-content, .stat, .stats, .tab, .tabs-boxed, .collapse, .toast .alert, .table, .kbd, .mockup-code, .avatar > div
{ border-radius: 0 !important; }
.shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl, .card, .dropdown-content, .stats, .alert, .modal-box
{ box-shadow: none !important; }
.bg-gradient-to-r, .bg-gradient-to-l, .bg-gradient-to-t, .bg-gradient-to-b, .bg-gradient-to-br, .bg-gradient-to-bl, .bg-gradient-to-tr, .bg-gradient-to-tl, .btn-gradient
{ background-image: none !important; }

/* Legacy panels: a white box that used to float on a shadow becomes a bordered panel. */
.bg-base-100.shadow-lg, .bg-base-100.shadow-xl, .bg-base-100.shadow-md,
.card.bg-base-100, .card.bg-base-200, .card.bg-base-300 {
  border: 1px solid var(--sc-border);
}
.card.bg-base-300 { background: var(--sc-card2); }
.text-gray-500, .text-gray-600, .text-gray-400, .text-gray-700 { color: var(--sc-muted) !important; }
.text-primary { color: var(--sc-text) !important; }
.link-primary { color: var(--sc-text); text-decoration: underline; text-underline-offset: 3px; }
.link-hover:hover { text-decoration: underline; text-underline-offset: 3px; }
.bg-white { background-color: var(--sc-bg) !important; }
.border { border-color: var(--sc-border); }
.divider::before, .divider::after { background-color: var(--sc-border); height: 1px; }
.prose { color: var(--sc-text); }
.prose pre, pre.bg-base-200 { background: var(--sc-card) !important; border: 1px solid var(--sc-border); color: var(--sc-text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===== 3. Typography ===== */
.ata-wordmark {
  font-family: 'Krona One', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--sc-text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-transform: uppercase;
}
.ata-wordmark img { width: 1.35rem; height: 1.35rem; display: block; }
.ata-wordmark:hover { color: var(--sc-text); }
.ata-wordmark-accent { color: var(--sc-muted); }
.ata-wordmark-short { display: none; }
@media (max-width: 575.98px) { .ata-wordmark-full { display: none; } .ata-wordmark-short { display: inline; } }
.ata-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sc-muted);
}
.ata-heading {
  font-family: 'Krona One', sans-serif;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--sc-text);
}
.ata-h1 { font-family: 'Instrument Sans', sans-serif; font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -0.01em; }
.ata-h2 { font-family: 'Instrument Sans', sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.ata-lede { color: var(--sc-muted); font-size: 1rem; line-height: 1.6; }
.ata-page-head .ata-h1, .ata-page-head .ata-lede, .ata-auth-card .ata-lede { margin: 0; }
.ata-muted { color: var(--sc-muted); }
.ata-small { font-size: 0.8rem; color: var(--sc-muted); }
.ata-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

/* The highlighter. A hard-stop image, not a gradient: it paints a band of
   yellow under the lower half of the text, like a marker on paper. */
.hl, .sub-hl {
  --hl: var(--sc-hl);
  --hl-top: var(--sc-hl-top);
  background-image: linear-gradient(transparent var(--hl-top), var(--hl) var(--hl-top), var(--hl) 94%, transparent 94%);
  background-repeat: no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.1em;
  margin: 0 -0.1em;
  color: inherit;
}
.hl { background-size: 100% 100%; }
.sub-hl { background-size: 0% 100%; }
.is-in > .sub-hl, .sub-hl.is-in { animation: sub-hl 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.18s forwards; }
@keyframes sub-hl { to { background-size: 100% 100%; } }
mark.hl { background-color: transparent; }

/* ===== 4. Buttons ===== */
.btn-ata, .btn {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.4;
  padding: 0.625rem 1.25rem;
  min-height: 0;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
  animation: none;
}
.btn-ata:focus, .btn:focus { outline: none; box-shadow: none; }
.btn-ata:focus-visible, .btn:focus-visible { outline: 2px solid var(--sc-text); outline-offset: 2px; }
.btn-ata-primary, .btn-primary, .btn-secondary, .btn-accent, .btn-neutral, .btn-info, .btn-success {
  background: var(--sc-text) !important;
  color: var(--sc-bg) !important;
  border-color: var(--sc-text) !important;
}
.btn-ata-primary:hover, .btn-primary:hover, .btn-secondary:hover, .btn-accent:hover, .btn-neutral:hover, .btn-info:hover, .btn-success:hover {
  background: var(--sc-accent-hover) !important;
  border-color: var(--sc-accent-hover) !important;
  color: var(--sc-bg) !important;
}
.btn-ata-ghost, .btn-outline, .btn-ghost {
  background: transparent !important;
  color: var(--sc-muted) !important;
  border-color: var(--sc-border) !important;
}
.btn-ghost { border-color: transparent !important; }
.btn-ata-ghost:hover, .btn-outline:hover, .btn-ghost:hover {
  color: var(--sc-text) !important;
  border-color: var(--sc-accent) !important;
  background: var(--sc-card) !important;
}
.btn-ghost:hover { border-color: transparent !important; }
.btn-error, .btn-outline.btn-error, .btn-ata-danger {
  background: transparent !important;
  color: var(--sc-danger) !important;
  border-color: var(--sc-border) !important;
}
.btn-error:hover, .btn-outline.btn-error:hover, .btn-ata-danger:hover { border-color: var(--sc-danger) !important; background: var(--sc-card) !important; }
.btn-outline.btn-success, .btn-outline.btn-info { color: var(--sc-muted) !important; }
.btn-outline.btn-success:hover, .btn-outline.btn-info:hover { color: var(--sc-text) !important; }
.btn-link { background: transparent !important; color: var(--sc-text) !important; border-color: transparent !important; text-decoration: underline; text-underline-offset: 3px; padding-left: 0; padding-right: 0; }
.btn-warning { background: transparent !important; color: var(--sc-warning) !important; border-color: var(--sc-border) !important; }
.btn-ata-lg, .btn-lg { font-size: 1rem; padding: 0.875rem 2rem; }
.btn-ata-sm, .btn-sm { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
.btn-xs { font-size: 0.72rem; padding: 0.25rem 0.55rem; }
.btn-circle, .btn-square { padding: 0; width: 2.4rem; height: 2.4rem; }
.btn-circle.btn-sm, .btn-square.btn-sm { width: 2rem; height: 2rem; }
.btn-circle.btn-xs, .btn-square.btn-xs { width: 1.6rem; height: 1.6rem; }
.btn-block { width: 100%; }
.btn-ata-icon { padding: 0; width: 2.4rem; height: 2.4rem; }
.btn-ata svg, .btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-disabled, .btn[disabled], .btn-ata[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-ata-link { background: transparent; border: 0; padding: 0; color: var(--sc-muted); font-weight: 600; border-bottom: 1px solid var(--sc-border); }
.btn-ata-link:hover { color: var(--sc-text); border-bottom-color: var(--sc-text); }

/* Theme toggle */
.btn-theme {
  background: transparent;
  border: 1px solid var(--sc-border);
  color: var(--sc-muted);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  padding: 0;
  transition: color 0.2s, border-color 0.2s;
}
.btn-theme:hover { color: var(--sc-text); border-color: var(--sc-text); }
.btn-theme svg { width: 1rem; height: 1rem; }
.btn-theme .ata-icon-sun { display: none; }
[data-theme="dark"] .btn-theme .ata-icon-sun { display: block; }
[data-theme="dark"] .btn-theme .ata-icon-moon { display: none; }

/* ===== 5. Forms ===== */
.ata-field { display: block; margin-bottom: 1.1rem; }
.ata-field > .ata-label { margin-bottom: 0.45rem; }
.ata-input, .ata-select, .ata-textarea,
.input, .select, .textarea, .file-input {
  width: 100%;
  background: var(--sc-card);
  border: 1px solid var(--sc-border);
  border-radius: 0;
  color: var(--sc-text);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.7rem 0.875rem;
  height: auto;
  min-height: 0;
  transition: border-color 0.2s;
}
.ata-input:focus, .ata-select:focus, .ata-textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--sc-text);
  box-shadow: none;
}
.input-bordered, .select-bordered, .textarea-bordered { border-color: var(--sc-border); }
.ata-input::placeholder, .input::placeholder, .textarea::placeholder { color: var(--sc-muted); opacity: 0.8; }
.ata-textarea, .textarea { min-height: 7rem; resize: vertical; }
.ata-help { font-size: 0.8rem; color: var(--sc-muted); margin-top: 0.4rem; }
.label { padding-left: 0; padding-right: 0; }
.label-text { color: var(--sc-text); font-weight: 500; font-size: 0.875rem; }
.label-text-alt { color: var(--sc-muted); }
.toggle { --tglbg: var(--sc-card2); border-color: var(--sc-border); background-color: var(--sc-muted); border-radius: 999px !important; }
.toggle:checked, .toggle-primary:checked, .toggle-success:checked { background-color: var(--sc-text); border-color: var(--sc-text); --tglbg: var(--sc-bg); }
.checkbox, .radio { border-color: var(--sc-accent); }
.checkbox:checked, .checkbox-primary:checked { background-color: var(--sc-text); border-color: var(--sc-text); }
.radio { border-radius: 999px !important; }
.radio:checked { background-color: var(--sc-text); border-color: var(--sc-text); }
.ata-otp {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.75rem;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 0.9rem 0 0.9rem 0.5em;
}

/* ===== 6. Surfaces ===== */
.ata-card {
  background: var(--sc-card);
  border: 1px solid var(--sc-border);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.ata-card--bg { background: var(--sc-bg); }
.ata-card--hover:hover { border-color: var(--sc-accent); }
.ata-card-title { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.4rem; }
.ata-card-desc { font-size: 0.875rem; color: var(--sc-muted); line-height: 1.6; margin: 0; }
.ata-panel { border: 1px solid var(--sc-border); background: var(--sc-bg); }
.ata-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--sc-border);
}
.ata-panel-head h2, .ata-panel-head h3 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.ata-panel-body { padding: 1.25rem; }
.ata-panel-body--flush { padding: 0; }
/* 1px grid of tiles, like Multify's feature strip. */
.ata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--sc-border);
  border: 1px solid var(--sc-border);
}
.ata-grid > * { background: var(--sc-bg); padding: 1.4rem 1.4rem 1.5rem; min-width: 0; }
.ata-grid--card > * { background: var(--sc-card); }
.ata-tile-icon { display: block; width: 1.3rem; height: 1.3rem; color: var(--sc-text); margin-bottom: 0.9rem; }
.ata-tile h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; margin: 0 0 0.4rem; }
.ata-tile p { color: var(--sc-muted); font-size: 0.9rem; line-height: 1.55; margin: 0; }

/* DaisyUI card re-skin */
.card { background: var(--sc-card); border: 1px solid var(--sc-border); }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 600; }
.stat { background: var(--sc-card); border: 1px solid var(--sc-border); padding: 1.1rem 1.25rem; }
.stats { border: 1px solid var(--sc-border); background: var(--sc-card); }
.stats .stat { border: 0; border-bottom: 1px solid var(--sc-border); }
.stat-title { color: var(--sc-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-value { font-family: 'Krona One', sans-serif; font-weight: 400; font-size: 1.75rem; color: var(--sc-text); }
.stat-desc { color: var(--sc-muted); }
.stat-value.\!text-base, .stat-value.text-base { font-family: 'Instrument Sans', sans-serif; font-weight: 600; font-size: 1rem; }
.collapse { border: 1px solid var(--sc-border); background: var(--sc-bg); }
.collapse-title { font-weight: 600; }
.collapse-content { color: var(--sc-muted); }
.tabs-boxed { background: var(--sc-card); border: 1px solid var(--sc-border); padding: 0; }
.tab { color: var(--sc-muted); font-weight: 500; }
.tab-active, .tabs-boxed .tab-active { background: var(--sc-text) !important; color: var(--sc-bg) !important; }
.mockup-code { background: var(--sc-card); color: var(--sc-text); border: 1px solid var(--sc-border); }
.loading { color: var(--sc-text); }
.progress { background: var(--sc-card2); border-radius: 0; }
.progress::-webkit-progress-value { background: var(--sc-text); }
.progress-primary::-moz-progress-bar { background: var(--sc-text); }
.bg-primary { background-color: var(--sc-text) !important; color: var(--sc-bg); }
.bg-primary\/10 { background-color: var(--sc-card) !important; }
.text-primary-content { color: var(--sc-bg) !important; }

/* ===== 7. Tables ===== */
.ata-table, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ata-table th, .table th,
.ata-table td, .table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--sc-border);
  text-align: left;
  vertical-align: middle;
  background: transparent;
}
.ata-table thead th, .table thead th, .table :where(thead, tfoot) :where(th, td) {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sc-muted);
  background: var(--sc-card);
  border-bottom: 1px solid var(--sc-border);
}
.ata-table tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: 0; }
.ata-table tbody tr:hover, .table tbody tr:hover, .table tr.hover:hover, .table tbody tr.hover\:bg-base-200:hover { background: var(--sc-card); }
.table-zebra tbody tr:nth-child(even) { background: var(--sc-card); }
.ata-row-link { cursor: pointer; }
.ata-row-link td a { text-decoration: none; }

/* ===== 8. Badges ===== */
.ata-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--sc-border);
  background: var(--sc-card);
  color: var(--sc-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-primary, .badge-secondary, .badge-accent, .badge-neutral, .ata-badge--solid { background: var(--sc-text); color: var(--sc-bg); border-color: var(--sc-text); }
.badge-outline, .badge-info, .badge-ghost { background: transparent; color: var(--sc-muted); border-color: var(--sc-border); }
.badge-success, .ata-badge--ok { background: transparent; color: var(--sc-success); border-color: var(--sc-success); }
.badge-error, .ata-badge--bad { background: transparent; color: var(--sc-danger); border-color: var(--sc-danger); }
.badge-warning { background: transparent; color: var(--sc-warning); border-color: var(--sc-warning); }
.badge-sm { font-size: 0.65rem; padding: 0.1rem 0.4rem; }
.ata-badge--hl { background: var(--sc-hl); color: #0f0f0f; border-color: transparent; }

/* ===== 9. Alerts / flash ===== */
.ata-alert, .alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--sc-border);
  border-left: 3px solid var(--sc-text);
  background: var(--sc-card);
  color: var(--sc-text);
  font-size: 0.9rem;
  line-height: 1.5;
}
.alert > div, .alert > span { display: flex; align-items: center; gap: 0.6rem; }
.alert svg, .ata-alert svg { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 0.1rem; }
.alert-success, .ata-alert--success { border-left-color: var(--sc-success); }
.alert-error, .ata-alert--error { border-left-color: var(--sc-danger); }
.alert-warning, .ata-alert--warning { border-left-color: var(--sc-warning); }
.alert-info, .ata-alert--info { border-left-color: var(--sc-accent); }
.toast { z-index: 9999; }

/* ===== 10. Modals / menus ===== */
.modal { background: rgba(0, 0, 0, 0.6); }
.modal-box {
  background: var(--sc-bg);
  color: var(--sc-text);
  border: 1px solid var(--sc-border);
  padding: 1.75rem;
  max-width: 36rem;
}
.modal-box h3 { font-weight: 700; }
.modal-backdrop { background: rgba(0, 0, 0, 0.6); }
.modal-action { margin-top: 1.5rem; gap: 0.6rem; }
dialog.modal .modal-box { background: var(--sc-bg) !important; border-radius: 0 !important; min-height: 0 !important; box-shadow: none !important; }
.menu li > *, .menu :where(li:not(.menu-title)) > :where(*:not(ul)) { border-radius: 0; color: var(--sc-text); }
.menu li > *:hover, .menu :where(li:not(.menu-title)) > :where(*:not(ul)):hover { background: var(--sc-card); }
.menu li > *.active, .menu :where(li) > :where(*:not(ul)).active { background: var(--sc-text); color: var(--sc-bg); }
.menu-title { color: var(--sc-muted); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dropdown-content, .ata-menu {
  background: var(--sc-bg);
  border: 1px solid var(--sc-border);
  padding: 0.35rem;
  min-width: 12rem;
  z-index: 9999 !important;
}
.ata-menu a, .ata-menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: var(--sc-text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.ata-menu a:hover, .ata-menu button:hover { background: var(--sc-card); }
.ata-menu hr { border: 0; border-top: 1px solid var(--sc-border); margin: 0.35rem 0; }
.ata-menu svg { width: 1rem; height: 1rem; color: var(--sc-muted); }

/* ===== 11. Header ===== */
.ata-header {
  border-bottom: 1px solid var(--sc-border);
  background: var(--sc-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex: none;
}
.ata-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}
.ata-header .ata-wordmark { margin-right: auto; }
.ata-nav { display: flex; align-items: center; gap: 1.5rem; margin-right: 1rem; }
.ata-nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sc-muted);
  padding: 0.25rem 0;
  transition: color 0.2s;
  white-space: nowrap;
}
.ata-nav-link:hover, .ata-nav-link.is-active { color: var(--sc-text); }
.ata-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sc-border);
  background: var(--sc-text);
  color: var(--sc-bg);
  font-family: 'Krona One', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.ata-avatar:hover { border-color: var(--sc-text); }
.ata-user { position: relative; }
.ata-user .ata-menu { position: absolute; right: 0; top: calc(100% + 0.5rem); display: none; }
.ata-user.is-open .ata-menu { display: block; }
.ata-user-email { display: block; padding: 0.5rem 0.75rem 0.35rem; font-size: 0.75rem; color: var(--sc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
@media (max-width: 767.98px) { .ata-nav { display: none; } }

/* ===== 12. App shell ===== */
.ata-shell {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
}
.ata-shell--side { grid-template-columns: 240px minmax(0, 1fr); }
.ata-main { padding: 1.75rem 1rem 3rem; min-width: 0; }
.ata-main--narrow { max-width: 56rem; margin: 0 auto; width: 100%; }
.ata-side {
  border-right: 1px solid var(--sc-border);
  padding: 1.25rem 0;
  position: sticky;
  top: 63px;
  align-self: start;
  max-height: calc(100vh - 63px);
  overflow-y: auto;
}
.ata-side-group { margin-bottom: 1.25rem; }
.ata-side-group > .ata-label { padding: 0 1.25rem; margin-bottom: 0.4rem; }
.ata-side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sc-muted);
  border-left: 2px solid transparent;
  transition: color 0.15s, background-color 0.15s;
}
.ata-side-link svg { width: 1rem; height: 1rem; flex: none; }
.ata-side-link:hover { color: var(--sc-text); background: var(--sc-card); }
.ata-side-link.is-active { color: var(--sc-text); border-left-color: var(--sc-text); background: var(--sc-card); }
@media (max-width: 991.98px) {
  .ata-shell--side { grid-template-columns: 1fr; }
  .ata-side {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--sc-border);
    padding: 0;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .ata-side::-webkit-scrollbar { display: none; }
  .ata-side-group { display: flex; margin: 0; }
  .ata-side-group > .ata-label { display: none; }
  .ata-side-link { border-left: 0; border-bottom: 2px solid transparent; padding: 0.75rem 0.9rem; white-space: nowrap; }
  .ata-side-link.is-active { border-bottom-color: var(--sc-text); background: transparent; }
  .ata-side-link svg { display: none; }
}

/* ===== 13. Page pieces ===== */
.ata-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ata-page-head .ata-lede { margin-top: 0.4rem; max-width: 60ch; }
.ata-page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ata-breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--sc-muted); margin-bottom: 0.75rem; }
.ata-breadcrumb a:hover { color: var(--sc-text); }
.ata-section { margin-bottom: 2rem; }
.ata-section + .ata-section { margin-top: 2rem; }

.ata-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--sc-border); border: 1px solid var(--sc-border); margin-bottom: 1.5rem; }
.ata-stat { position: relative; display: block; background: var(--sc-bg); padding: 1.1rem 1.25rem 1.2rem; min-width: 0; color: inherit; }
.ata-stat--link { cursor: pointer; }
.ata-stat--link:hover, .ata-stat--action:hover { background: var(--sc-card); }
.ata-stat-value { font-family: 'Krona One', sans-serif; font-size: 1.75rem; line-height: 1.1; margin: 0.45rem 0 0.35rem; }
.ata-stat-desc { font-size: 0.8rem; color: var(--sc-muted); }
.ata-stat-add { position: absolute; top: 0.75rem; right: 0.75rem; width: 1.8rem; height: 1.8rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--sc-border); color: var(--sc-muted); }
.ata-stat-add:hover { color: var(--sc-text); border-color: var(--sc-text); }
.ata-stat-add svg { width: 0.9rem; height: 0.9rem; }
.ata-stat--action { cursor: pointer; }
.ata-stat--action .ata-stat-value { font-family: 'Instrument Sans', sans-serif; font-weight: 700; font-size: 1.15rem; }

.ata-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--sc-muted); }
.ata-empty p { margin: 0 0 1rem; font-size: 0.9rem; }
.ata-empty svg { width: 1.5rem; height: 1.5rem; margin: 0 auto 0.75rem; display: block; color: var(--sc-muted); }

.ata-logo-tile { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; padding: 0 0.35rem; border: 1px solid var(--sc-border); background: var(--sc-bg); flex: none; }
.ata-logo-tile img { height: 0.95rem; width: auto; max-width: 4.5rem; object-fit: contain; }
.ata-logo-row { display: inline-flex; gap: 0.3rem; }
[data-theme="dark"] .ata-logo--ink { filter: invert(1) hue-rotate(180deg); }

.ata-list-cards { display: grid; gap: 0.75rem; }
.ata-list-card { border: 1px solid var(--sc-border); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.ata-list-card strong { font-weight: 600; font-size: 0.9rem; }
.ata-list-card .ata-small { font-size: 0.78rem; }
.ata-desktop { display: block; }
.ata-mobile { display: none; }
@media (max-width: 767.98px) { .ata-desktop { display: none; } .ata-mobile { display: block; } }

/* ===== 14. Auth ===== */
.ata-auth { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem 4rem; }
.ata-auth-card { width: 100%; max-width: 26rem; border: 1px solid var(--sc-border); background: var(--sc-bg); padding: 2rem; }
.ata-auth-card h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin: 0.5rem 0 0.6rem; letter-spacing: -0.01em; }
.ata-auth-card .ata-lede { font-size: 0.925rem; margin-bottom: 1.5rem; }
.ata-auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: 0.8rem; }
.ata-auth-links a, .ata-auth-links button { color: var(--sc-muted); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; border-bottom: 1px solid transparent; }
.ata-auth-links a:hover, .ata-auth-links button:hover { color: var(--sc-text); border-bottom-color: var(--sc-text); }
.ata-auth-note { font-size: 0.78rem; color: var(--sc-muted); line-height: 1.55; margin-top: 1rem; }
.ata-auth-note a { text-decoration: underline; text-underline-offset: 3px; }
.ata-auth-dev { margin-top: 1rem; font-size: 0.8rem; border: 1px dashed var(--sc-border); padding: 0.6rem 0.75rem; color: var(--sc-muted); }
.ata-auth-dev code { color: var(--sc-text); font-weight: 600; }
.ata-check { width: 2.75rem; height: 2.75rem; border: 1px solid var(--sc-border); display: inline-flex; align-items: center; justify-content: center; color: var(--sc-success); }
.ata-check svg { width: 1.3rem; height: 1.3rem; }

/* ===== 15. Footer ===== */
.ata-footer { border-top: 1px solid var(--sc-border); padding: 1.1rem 1rem; flex: none; }
.ata-footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; justify-content: space-between; }
.ata-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.ata-footer-link { font-size: 0.85rem; color: var(--sc-muted); white-space: nowrap; transition: color 0.2s; }
.ata-footer-link:hover { color: var(--sc-text); }
.ata-footer-copy { font-size: 0.8rem; color: var(--sc-muted); }
@media (max-width: 575.98px) { .ata-footer-inner { justify-content: center; text-align: center; } }

/* ===== 16. Motion ===== */
.animate-fadeIn { animation: ata-fade 0.4s ease; }
@keyframes ata-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .is-in > .sub-hl, .sub-hl.is-in { background-size: 100% 100%; }
}
