/*
  Base and components. Tokens live in tokens.css, motion in motion.css, screens in
  screens.css. RTL: logical properties only (inline-start is the right edge in Hebrew).
  Mixed runs: Latin, numbers and codes sit in <bdi dir="ltr">, kept inline.
*/

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: var(--w-regular);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: var(--w-semi);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
/* The brand's rounded display face (Rubik, the logo's own soft corners): headings, the
   wordmark, buttons and big figures. Body copy, labels and inputs stay Heebo. */
h1,
h2,
h3,
.brand,
.btn,
.kpi-value {
  font-family: var(--font-display);
}
p {
  text-wrap: pretty;
}
a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
img,
svg {
  display: block;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
::selection {
  background: var(--highlight);
}
bdi[dir="ltr"],
.ltr {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline;
}
bdi.run {
  white-space: nowrap;
}
.num {
  font-variant-numeric: tabular-nums;
}
.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;
}
.skip-link {
  position: absolute;
  inset-inline-start: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--pill);
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus {
  top: var(--s-3);
}
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}
.icon-flip {
  transform: scaleX(-1);
}
.muted {
  color: var(--text-2);
}
.subtle {
  color: var(--text-3);
  font-size: var(--t-sm);
}
.stack {
  display: grid;
  gap: var(--s-4);
}
.stack-lg {
  display: grid;
  gap: var(--s-6);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ brand + voice wave */
/* the lockup: the tile, then the name in the logo's heavy rounded teal */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1;
}
/* The brand mark: the BaliBot app icon on its rounded teal tile (macros/ui.html). */
.brand-mark {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
/* The bot's face: the logo's "b" with the smile on a warm cream circle, wherever the bot
   is the one speaking (its chat turns, its presence on a hero card). Decorative; the turn's
   text says who speaks. Sizes: .face (36px), .face-sm (28px), .face-lg (64px). */
.face {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-cream);
  box-shadow: inset 0 0 0 1px rgb(18 102 92 / 0.12);
}
.face img {
  width: 74%;
  height: 74%;
}
.face-sm {
  width: 28px;
  height: 28px;
}
.face-lg {
  width: 64px;
  height: 64px;
  box-shadow:
    inset 0 0 0 1px rgb(18 102 92 / 0.12),
    0 10px 24px -12px rgb(8 40 36 / 0.55);
}
.glow .face {
  box-shadow: 0 10px 24px -12px rgb(8 40 36 / 0.6);
}
/* a wave on a teal tile keeps its own pill visible */
.glow .wave {
  background: rgb(255 248 238 / 0.16);
}

/* The voice wave: five rounded bars in an accent pill, Speechify's voice motif, for who is
   talking or working. It "speaks" (bars bounce) on hover and wherever .is-speaking is set. */
.wave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--accent);
}
.wave i {
  display: block;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--on-accent);
  transform-origin: center;
}
.wave i:nth-child(1),
.wave i:nth-child(5) {
  height: 6px;
}
.wave i:nth-child(2),
.wave i:nth-child(4) {
  height: 11px;
}
.wave-lg {
  height: 56px;
  gap: 4px;
  padding: 0 18px;
  border-radius: var(--pill);
}
.wave-lg i {
  width: 4px;
  height: 26px;
}
.wave-lg i:nth-child(1),
.wave-lg i:nth-child(5) {
  height: 10px;
}
.wave-lg i:nth-child(2),
.wave-lg i:nth-child(4) {
  height: 18px;
}
.wave-round {
  width: 36px;
  height: 36px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
}
.wave-round i {
  width: 2.5px;
}

/* ------------------------------------------------------------------ app shell */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-4);
  overflow-y: auto;
  view-transition-name: sidebar;
}
.sidebar > .brand {
  padding-inline: var(--s-2);
}
.business-chip {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.business-chip .avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-weight: var(--w-semi);
  font-size: var(--t-sm);
}
.business-chip .who {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}
.business-chip strong {
  font-size: var(--t-sm);
  font-weight: var(--w-semi);
}
.business-chip span {
  font-size: var(--t-xs);
  color: var(--text-3);
}
/* the business card opens the business menu (switch, add a business); see layouts/app.html */
.biz-switch {
  position: relative;
}
.biz-switch-toggle {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-std), box-shadow var(--t-med) var(--ease-std);
}
.biz-switch-toggle:hover,
.biz-switch-toggle[aria-expanded="true"] {
  border-color: var(--accent-soft-2);
}
.biz-switch-toggle .who {
  flex: 1;
}
.business-chip .biz-switch-caret {
  flex: none;
  color: var(--text-3);
  transition: transform var(--t-med) var(--ease);
}
.biz-switch-toggle[aria-expanded="true"] .biz-switch-caret {
  transform: rotate(180deg);
}
.biz-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + var(--s-2));
  z-index: 40;
  display: grid;
  gap: 2px;
  max-height: min(60dvh, 420px);
  overflow-y: auto;
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--lift);
}
.biz-menu[hidden] {
  display: none;
}
/* inside the mobile menu sheet the list opens in place (the sheet already scrolls) */
.menu-sheet .biz-menu {
  position: static;
  margin-block-start: var(--s-2);
  box-shadow: none;
}
.biz-menu-label {
  padding: var(--s-1) var(--s-3);
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  color: var(--text-3);
}
.biz-menu-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.biz-menu-list form {
  display: contents;
}
.biz-menu-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 44px;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.biz-menu-item:hover,
.biz-menu-item:focus-visible {
  background: var(--surface-2);
}
.biz-menu-item.is-current {
  background: var(--accent-soft);
}
.biz-menu-item .avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: var(--t-sm);
  font-weight: var(--w-semi);
}
.biz-menu-body {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.biz-menu-name {
  font-size: var(--t-sm);
  font-weight: var(--w-semi);
  overflow-wrap: anywhere;
}
.biz-menu-role {
  font-size: var(--t-xs);
  color: var(--text-3);
}
.biz-menu-check {
  flex: none;
  color: var(--accent);
}
.biz-menu-settings {
  margin-block-start: var(--s-1);
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--text-2);
}
.biz-menu-add {
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  color: var(--text-2);
}
.biz-menu-settings .avatar,
.biz-menu-add .avatar {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav {
  display: grid;
  gap: var(--s-5);
}
.nav-group {
  display: grid;
  gap: 2px;
}
.nav-group-label {
  padding-inline: var(--s-3);
  margin-block-end: var(--s-1);
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  color: var(--text-3);
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 42px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--pill);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: var(--w-medium);
  transition: color var(--t-fast) var(--ease-std), background-color var(--t-fast) var(--ease-std);
}
.nav a > * {
  position: relative;
  z-index: 1;
}
.nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}
.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: var(--w-semi);
}
.nav a[aria-current="page"] .icon {
  color: var(--accent);
}
/* the active pill slides between pages (view transitions, see motion.css) */
.nav-pill {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  view-transition-name: nav-pill;
}
/* open questions waiting for the owner: the brand's peach, its one "needs you" signal */
.nav .count {
  margin-inline-start: auto;
  min-width: 22px;
  padding: 0 7px;
  border-radius: var(--pill);
  background: var(--peach);
  color: var(--on-peach);
  font-size: var(--t-xs);
  font-weight: var(--w-semi);
  line-height: 22px;
  text-align: center;
}
.sidebar-foot {
  display: grid;
  gap: var(--s-2);
  margin-top: auto;
}
.linklike {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--pill);
  background: none;
  color: var(--text-2);
  font-size: var(--t-sm);
  cursor: pointer;
  text-decoration: none;
}
.linklike:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* theme switch: three-way segmented control, server-set (no inline script) */
.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: var(--pill);
  background: var(--surface-2);
}
.theme-switch button {
  display: grid;
  place-items: center;
  height: 30px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.theme-switch .icon {
  width: 16px;
  height: 16px;
}

.topbar {
  display: none;
}
.main {
  min-width: 0;
  padding: var(--s-7) clamp(var(--s-4), 4vw, var(--s-8)) var(--s-9);
  outline: none;
}
.main-panel {
  min-height: calc(100dvh - var(--s-5));
}
.page {
  max-width: 1040px;
  margin-inline: auto;
}
.page-narrow {
  max-width: 780px;
  margin-inline: auto;
}
.page-head {
  display: grid;
  gap: var(--s-3);
  margin-block-end: var(--s-7);
}
.page-head h1 {
  font-size: var(--t-3xl);
  font-weight: var(--w-semi);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.page-head p {
  max-width: 60ch;
  color: var(--text-2);
  font-size: var(--t-lg);
  line-height: 1.55;
}

@media (max-width: 899px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    view-transition-name: topbar;
  }
  .main {
    padding: var(--s-5) var(--s-4) var(--s-8);
  }
  .page-head {
    margin-block-end: var(--s-5);
    gap: var(--s-2);
  }
  .page-head p {
    font-size: var(--t-md);
  }
}

/* mobile menu (details/summary, no JS) */
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu-sheet {
  position: fixed;
  inset: 64px var(--s-3) auto;
  z-index: 30;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift);
}

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-size: var(--t-md);
  font-weight: var(--w-medium);
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease-std),
    border-color var(--t-fast) var(--ease-std),
    color var(--t-fast) var(--ease-std),
    transform var(--t-fast) var(--ease-std),
    box-shadow var(--t-med) var(--ease-std);
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 8px 24px -10px var(--accent-glow);
}
.btn-dark {
  background: var(--text);
  color: var(--bg);
}
.btn-light {
  background: #ffffff;
  color: #0f0f12;
}
.btn-light:hover {
  background: #ececf2;
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--text-3);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
/* the one irreversible action (erase the knowledge base): solid danger */
.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 88%, #000000);
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--danger) 60%, transparent);
}
.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}
.btn-danger-ghost:hover {
  background: var(--danger-soft);
}
.btn-sm {
  min-height: 36px;
  padding: 0 var(--s-4);
  font-size: var(--t-sm);
}
.btn-lg {
  min-height: 54px;
  padding: 0 var(--s-6);
  font-size: var(--t-lg);
}
.btn-block {
  width: 100%;
}
.btn .icon {
  width: 18px;
  height: 18px;
}
/* arrows nudge forward (to the left in RTL) on hover */
.btn .icon-go {
  transition: transform var(--t-med) var(--ease);
}
.btn:hover .icon-go {
  transform: translateX(-3px);
}

/* ------------------------------------------------------------------ cards and panels */
.card {
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.card-tight {
  padding: var(--s-4) var(--s-5);
}
.card h2 {
  font-size: var(--t-xl);
}
.card h3 {
  font-size: var(--t-lg);
}
.panel {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.section-title {
  font-size: var(--t-lg);
  font-weight: var(--w-semi);
  margin-block-end: var(--s-4);
}
/* Speechify's glow panel: deep surface with an accent light rising from the bottom */
.glow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--glow-bg);
  color: var(--glow-fg);
}
.glow::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 50% 120%, rgb(46 160 142 / 0.7) 0%, rgb(30 130 116 / 0.3) 45%, transparent 75%),
    radial-gradient(60% 50% at 85% 0%, rgb(255 248 238 / 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.glow .muted,
.glow .subtle {
  color: rgb(240 250 247 / 0.86);
}

/* ------------------------------------------------------------------ tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  white-space: nowrap;
}
.tag .icon {
  width: 14px;
  height: 14px;
}
.tag-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ------------------------------------------------------------------ forms */
.field {
  display: grid;
  gap: var(--s-2);
}
.label {
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  color: var(--text);
}
.help {
  font-size: var(--t-sm);
  color: var(--text-3);
}
.error {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--danger);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
}
.input,
.textarea,
.select {
  width: 100%;
  min-height: 50px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--t-md);
  transition: border-color var(--t-fast) var(--ease-std), box-shadow var(--t-fast) var(--ease-std);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}
.input:hover,
.textarea:hover {
  border-color: var(--text-3);
}
.input:focus-visible,
.textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}
.input-ltr {
  direction: ltr;
  text-align: right;
}
.input-ltr::placeholder {
  text-align: right;
}
.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}
.input-affix .affix {
  position: absolute;
  inset-inline-end: var(--s-4);
  color: var(--text-3);
  font-weight: var(--w-medium);
  pointer-events: none;
}
.input-affix .input {
  padding-inline-end: 48px;
}
.input-big {
  min-height: 64px;
  font-size: var(--t-2xl);
  font-weight: var(--w-semi);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* chips: big tappable options (radio or checkbox inside a label) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.chip {
  position: relative;
  display: inline-flex;
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--text);
  font-weight: var(--w-medium);
  cursor: pointer;
  user-select: none;
  transition:
    border-color var(--t-fast) var(--ease-std),
    background-color var(--t-fast) var(--ease-std),
    color var(--t-fast) var(--ease-std),
    transform var(--t-fast) var(--ease-std);
}
.chip span .icon {
  display: none;
  width: 16px;
  height: 16px;
}
.chip:hover span {
  border-color: var(--text-3);
}
.chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.chip input:checked + span .icon {
  display: block;
}
.chip input:focus-visible + span {
  box-shadow: var(--focus);
}
.chip:active span {
  transform: scale(0.96);
}
.chips-xl .chip span {
  min-height: 56px;
  padding: 0 var(--s-6);
  font-size: var(--t-lg);
}

/* tabs */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 38px;
  padding: 0 var(--s-4);
  border-radius: var(--pill);
  color: var(--text-2);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease-std), background-color var(--t-fast) var(--ease-std);
}
.tabs a:hover {
  color: var(--text);
}
.tabs a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}
.tabs .n {
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--pill);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--t-xs);
  line-height: 20px;
  text-align: center;
}
.tabs a[aria-current="page"] .n {
  background: var(--accent);
  color: var(--on-accent);
}

/* ------------------------------------------------------------------ notices */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--t-sm);
}
.notice .icon {
  margin-top: 3px;
  color: var(--accent-ink);
}
.notice-warn {
  background: var(--warn-soft);
}
.notice-warn .icon {
  color: var(--warn);
}
/* findings still waiting for the owner (partials/findings_waiting.html): the count, why it
   matters, and the way back to the verify step */
.findings-waiting {
  flex-wrap: wrap;
  align-items: center;
  margin-block: var(--s-3);
  background: var(--warn-soft);
}
.findings-waiting > .icon {
  color: var(--warn);
}
.findings-waiting-text {
  display: grid;
  flex: 1 1 18rem;
  gap: 2px;
  margin: 0;
}
.findings-waiting .btn {
  margin-inline-start: auto;
}
.notice-ok {
  background: var(--ok-soft);
}
.notice-ok .icon {
  color: var(--ok);
}
.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-5);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--text-2);
  text-align: center;
}
.empty .icon {
  width: 32px;
  height: 32px;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ meters */
.meter {
  height: 8px;
  border-radius: var(--pill);
  background: var(--surface-3);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: right center;
}
.meter-over > span {
  background: var(--warn);
}

/* Boosted in-app navigation in flight (html.is-navigating, set by static/js/app.js; see
   docs/specs/NAV-SMOOTH-NOTES.md): a thin accent bar at the top of the window. It waits
   150ms (a quick swap never shows it), creeps toward 90%, and when the class goes it
   snaps full and fades out. It lives on body::before, so the body swap never removes it. */
html.is-navigating body {
  cursor: progress;
}
body::before {
  content: "";
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 1000;
  height: 3px;
  border-end-start-radius: 2px;
  border-end-end-radius: 2px;
  background: linear-gradient(to left, var(--accent), color-mix(in srgb, var(--accent) 55%, #9aa6ff));
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scaleX(1);
  transform-origin: right;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-std) 0.1s;
}
html.is-navigating body::before {
  opacity: 1;
  transform: scaleX(0.9);
  transition: opacity 0.2s var(--ease-std) 0.15s;
}
@media (prefers-reduced-motion: no-preference) {
  html.is-navigating body::before {
    animation: nav-creep 6s cubic-bezier(0.1, 0.6, 0.2, 1) 0.15s both;
  }
  @keyframes nav-creep {
    0% {
      transform: scaleX(0);
    }
    15% {
      transform: scaleX(0.45);
    }
    100% {
      transform: scaleX(0.9);
    }
  }
}
