/* Visual styles: the Appearance setting "Style" picks one of these on <html data-style>. Classic is the base in tokens.css and
   needs no rules here. Orbital and Cyber HUD take their palettes from the chit_2 style guide (values converted from its oklch
   tokens). Each style has a dark and a light block; the light block is more specific, so it wins in light mode. */

/* ---------- Orbital: flat, neutral, square-cornered, no glass or glow ---------- */
[data-style='orbital'] .backdrop { display: none; }
[data-style='orbital'] *, [data-style='orbital'] *::before, [data-style='orbital'] *::after {
  backdrop-filter: none;
  box-shadow: none;
}

/* ---------- Cyber HUD: cyan-on-black instrument look, thin borders, corner marks, a bright left edge on the active module ---------- */
[data-style='cyber'] .card, [data-style='cyber'] .panel {
  position: relative;
  border-color: var(--line-strong);
}
[data-style='cyber'] .card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 14px;
  height: 2px;
  background: var(--cyan);
  pointer-events: none;
}
[data-style='cyber'] .navitem { border-radius: 2px; border-left: 2px solid transparent; }
[data-style='cyber'] .navitem.active { border-left-color: var(--cyan); box-shadow: none; }
[data-style='cyber'] .eyebrow { letter-spacing: 0.12em; }

/* Orbital layout, from the chit_2 style guide: one hairline per division, no boxes, numbered navigation,
   light titles, and panels that sit on a rule instead of a card. */
[data-style='orbital'] .chit-mark [fill='var(--amber)'] { fill: var(--cyan); }
[data-style='orbital'] .chit-mark [stroke='var(--amber)'] { stroke: var(--cyan); }

[data-style='orbital'] .sidenav { gap: 0; padding: 28px 16px; background: var(--bg-void); border-right: 1px solid var(--line); }
[data-style='orbital'] .sidenav__brand { padding: 0 8px 28px; }
[data-style='orbital'] .sidenav__word { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
[data-style='orbital'] .sidenav__household {
  font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em;
}
[data-style='orbital'] .sidenav__list { counter-reset: nav; border-top: 1px solid var(--line); }
[data-style='orbital'] .sidenav__item {
  gap: 12px; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 0.85rem;
}
[data-style='orbital'] .sidenav__item:hover { background: transparent; color: var(--text); }
[data-style='orbital'] .sidenav__item.active { background: transparent; color: var(--text); box-shadow: inset 2px 0 0 var(--cyan); }
[data-style='orbital'] .sidenav__code { display: inline-block; counter-increment: nav; width: 18px; font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-faint); }
[data-style='orbital'] .sidenav__code::before { content: counter(nav, decimal-leading-zero); }
[data-style='orbital'] .sidenav__item--settings { margin-top: auto; border-top: 1px solid var(--line); border-bottom: 0; }

[data-style='orbital'] .topbar { background: var(--bg-void); backdrop-filter: none; padding: 16px 28px; min-height: 0; }
[data-style='orbital'] .topbar h1 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 400; letter-spacing: 0; }
[data-style='orbital'] .topbar h1 em { font-style: normal; font-weight: 600; }
[data-style='orbital'] .main { gap: 28px; padding: 24px 28px 48px; }
[data-style='orbital'] .rail { gap: 28px; padding: 24px 24px 24px 20px; border-left: 1px solid var(--line); background: transparent; }

[data-style='orbital'] .card {
  padding: 14px 2px 12px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
}
[data-style='orbital'] .card::before { display: none; }
[data-style='orbital'] .card__icon { border-radius: 3px; }
[data-style='orbital'] button { border-radius: 3px; }

/* Cyber HUD layout: every box, button, field and badge has square 90 degree corners. The HUD look comes from hairline
   borders, corner brackets, mono labels and a bright edge on the active module. Avatars stay round (they are people). */
[data-style='cyber'] *:not([class*='avatar']) { border-radius: 0; }
[data-style='cyber'] .person-ring, [data-style='cyber'] .person-ring * { border-radius: 50%; }
[data-style='cyber'] input, [data-style='cyber'] select, [data-style='cyber'] textarea { border: 1px solid var(--line-strong); }

[data-style='cyber'] .sidenav { background: var(--bg-void); border-right: 1px solid var(--line-strong); }
[data-style='cyber'] .sidenav__brand { gap: 14px; }
[data-style='cyber'] .sidenav__beta { border-radius: 0; }
[data-style='cyber'] .sidenav__word { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
[data-style='cyber'] .sidenav__household { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--cyan); white-space: nowrap; }
[data-style='cyber'] .sidenav__list { counter-reset: nav; }
[data-style='cyber'] .sidenav__item { border: 1px solid transparent; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
[data-style='cyber'] .sidenav__item.active { color: var(--text); background: var(--accent-soft); border-color: var(--line-strong); border-left: 2px solid var(--cyan); }
[data-style='cyber'] .sidenav__code { display: inline-block; counter-increment: nav; font-size: 0.6rem; color: var(--cyan); }
[data-style='cyber'] .sidenav__code::before { content: '[' counter(nav, decimal-leading-zero) ']'; }
[data-style='cyber'] .sidenav__item--settings { margin-top: auto; }

[data-style='cyber'] .topbar { background: var(--bg-void); backdrop-filter: none; border-bottom: 1px solid var(--line-strong); }
[data-style='cyber'] .topbar h1 { margin: 0; font-family: var(--font-mono); font-size: clamp(1rem, 1.8vw, 1.25rem); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
[data-style='cyber'] .topbar h1 em { font-style: normal; color: var(--cyan); }
[data-style='cyber'] .card { border: 1px solid var(--line-strong); }

/* Cyber HUD: the weather, the viewer and the clock sit open in the top bar, without boxes */
[data-style='cyber'] .topbar__tools > :not(.wx) { border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }   /* the weather keeps its frame, as in Orbital */

/* the Now and leaderboard headings take the same look as the other widget titles */
[data-style='cyber'] .card__title, [data-style='cyber'] .now__head h2 { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cyan); }
[data-style='orbital'] .card__title, [data-style='orbital'] .now__head h2 { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); }

/* Orbital: text fields are a rule under the words, not a box. The focus is a heavier rule in the accent colour. */
[data-style='orbital'] input[type='text'], [data-style='orbital'] input[type='email'], [data-style='orbital'] input[type='password'],
[data-style='orbital'] input[type='number'], [data-style='orbital'] input[type='search'], [data-style='orbital'] textarea,
[data-style='orbital'] select, [data-style='orbital'] .input, [data-style='orbital'] .field input[type='text'], [data-style='orbital'] .field input[type='email'] {
  background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 4px; box-shadow: none; padding-left: 0; padding-right: 0;
}
[data-style='orbital'] input[type='text']:focus, [data-style='orbital'] input[type='email']:focus, [data-style='orbital'] input[type='password']:focus,
[data-style='orbital'] textarea:focus, [data-style='orbital'] select:focus, [data-style='orbital'] .input:focus, [data-style='orbital'] .field input:focus {
  outline: none; border-bottom: 2px solid var(--accent); box-shadow: none;
}

/* Orbital: every boxed element has a small radius, so nothing is a pill or a hard square. The page's own edges (top bar, side bar, bottom bar) stay flush. */
:root[data-style='orbital'] :is(button, input, select, textarea, .card, .now, .bubble, .wx, .cw-strip, .gr-fact, .htype__card, .meals__day, .toggle__track, .themeswitch, .sidenav__appearance, .pill, .chip, .btn, .sidenav__item, .moment) { border-radius: 4px; }
/* the household-type cards and the strip that holds the two-way switch: their own radii are calc()s of the token, so they are set here */
:root[data-style='orbital'] .htype__grid .htype__card, :root[data-style='orbital'] .hh-strip, :root[data-style='orbital'] .savebar { border-radius: 4px; }
:root[data-style='orbital'] .hh-strip button { border-radius: 0; }
/* the remaining boxed parts of the pages: card footers, the segmented switch, badges and the money and grid tiles */
:root[data-style='orbital'] :is(.card__foot, .seg, .badge, .fn-stat, .fn-owe, .gr-kpi, .gr-fact, .meals__day, .lbside__row, .lb__bar) { border-radius: 4px; }
:root[data-style='orbital'] :is(.gr-ins, .gr-dev, .gr-dev__bar) { border-radius: 4px; }
:root[data-style='orbital'] :is(.pill-next, .gr-tag, .gr-auto li) { border-radius: 4px; }

