/* ==========================================================================
   LuminaVantage — design system
   Dark terminal aesthetic: near-black canvas, a single acid-lime accent used
   only for things that matter (price up, live state, primary action), thin
   hairlines, monospace numerals, and generous negative space broken into
   dense data cards.
   ========================================================================== */

:root {
  --bg: #08090d;
  --bg-1: #0b0d13;
  --bg-2: #10131b;
  --bg-3: #161a24;
  --panel: rgba(18, 21, 30, 0.72);
  --panel-solid: #12151e;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --ink: #eef1f6;
  --ink-2: #a7b0c0;
  --ink-3: #6d7688;
  --ink-4: #4a5262;

  --lime: #c8f76a;
  --lime-dim: rgba(200, 247, 106, 0.14);
  --lime-line: rgba(200, 247, 106, 0.32);
  --red: #ff6b6b;
  --red-dim: rgba(255, 107, 107, 0.13);
  --amber: #ffc46b;
  --amber-dim: rgba(255, 196, 107, 0.13);
  --cyan: #6bd8ff;
  --cyan-dim: rgba(107, 216, 255, 0.12);
  --violet: #b58cff;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  /* Layout scales with the device rather than snapping at one breakpoint. */
  --side-w: clamp(196px, 16vw, 240px);
  --side-w-rail: 70px;
  --topbar-h: clamp(52px, 5vh, 60px);
  --gutter: clamp(12px, 1.6vw, 22px);
  --bottom-bar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.8);
  --shadow-2: 0 28px 70px -24px rgba(0, 0, 0, 0.9);
  --glow-lime: 0 0 0 1px rgba(200, 247, 106, 0.3), 0 0 32px -6px rgba(200, 247, 106, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='light'] {
  --bg: #f4f5f2;
  --bg-1: #ffffff;
  --bg-2: #fafbf8;
  --bg-3: #eef0ea;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(12, 16, 24, 0.09);
  --line-strong: rgba(12, 16, 24, 0.18);
  --ink: #0d1117;
  --ink-2: #414b5c;
  --ink-3: #6b7484;
  --ink-4: #9aa3b2;
  --lime: #4f8a00;
  --lime-dim: rgba(79, 138, 0, 0.1);
  --lime-line: rgba(79, 138, 0, 0.3);
  --red: #cf2f2f;
  --amber: #b46a00;
  --cyan: #0a7ea4;
  --shadow-1: 0 1px 2px rgba(12, 16, 24, 0.06), 0 8px 24px -16px rgba(12, 16, 24, 0.4);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient light: one warm lime bloom, one cold blue, both very low opacity */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(200, 247, 106, 0.07), transparent 60%),
    radial-gradient(50rem 40rem at 100% 0%, rgba(107, 216, 255, 0.06), transparent 55%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.4));
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--lime);
  text-decoration: none;
}

::selection {
  background: var(--lime);
  color: #07080b;
}

/* scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ink-4);
  background-clip: content-box;
}

/* ============================== typography ============================== */

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(28px, 4vw, 40px);
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
}

.dim {
  color: var(--ink-3);
}
.small {
  font-size: 12px;
}
.tiny {
  font-size: 11px;
}
.up {
  color: var(--lime);
}
.down {
  color: var(--red);
}
.neutral {
  color: var(--ink-2);
}

/* ================================ layout ================================ */

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas:
    'brand topbar'
    'side  main';
  transition: grid-template-columns 0.24s var(--ease);
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
}

.brand-name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-name span {
  color: var(--lime);
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-1) 80%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 30;
}

.side {
  grid-area: side;
  border-right: 1px solid var(--line);
  background: var(--bg-1);
  padding: 16px 12px calc(24px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
}

.main {
  grid-area: main;
  padding: var(--gutter);
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
  max-width: 1560px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* ---------- tier 2: tablet / small laptop — collapse the sidebar to icons ---------- */
@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--side-w-rail) minmax(0, 1fr);
  }
  .side {
    padding-left: 8px;
    padding-right: 8px;
    align-items: stretch;
  }
  .side .nav-label,
  .side .side-section-label,
  .side .side-foot {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 11px 0;
  }
  .nav-item[aria-current='page']::before {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .nav-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    margin: 0;
  }
  .brand {
    justify-content: center;
    padding: 0 8px;
  }
  .brand .brand-name {
    display: none;
  }
  /* the topbar keeps its identity and actions, drops the secondary stats */
  .topbar .topbar-stats {
    display: none;
  }
}

/* ---------- tier 3: phone — bottom navigation, compact header ---------- */
@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr) calc(var(--bottom-bar-h) + var(--safe-b));
    grid-template-areas:
      'brand'
      'main'
      'side';
  }
  .brand {
    border-right: 0;
    padding: 0 calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
    justify-content: flex-start;
    gap: 9px;
    padding-top: var(--safe-t);
    height: calc(var(--topbar-h) + var(--safe-t));
  }
  .brand .brand-name {
    display: block;
  }
  /* on a phone the topbar would need a second row, so its essential status
     moves into the brand bar instead of disappearing */
  .topbar {
    display: none;
  }
  .side {
    position: fixed;
    inset: auto 0 0 0;
    height: calc(var(--bottom-bar-h) + var(--safe-b));
    padding: 0 4px var(--safe-b);
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: color-mix(in srgb, var(--bg-1) 92%, transparent);
    backdrop-filter: blur(20px) saturate(140%);
    z-index: 40;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    font-size: 9.5px;
    width: auto;
    min-width: 58px;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }
  .side .nav-label {
    display: block;
    font-size: 9.5px;
    letter-spacing: 0.01em;
  }
  .nav-item[aria-current='page']::before {
    top: auto;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
  }
  .nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    margin: 0;
    font-size: 9px;
    padding: 0 5px;
  }
  .main {
    padding: 12px calc(12px + var(--safe-r)) calc(18px + var(--safe-b)) calc(12px + var(--safe-l));
  }
}

/* the compact header only exists on phones */
.mobile-status {
  display: none;
}

/* On the icon rail the brand is centred, so the mode chip cannot push off it. */
@media (max-width: 1180px) {
  .brand > .chip {
    margin-left: 0;
    position: absolute;
    right: 6px;
    top: 6px;
    font-size: 8px;
    padding: 1px 4px;
  }
}

/* On a phone the header status already shows the mode, so drop the duplicate. */
@media (max-width: 760px) {
  .brand > .chip {
    display: none;
  }
}

@media (max-width: 760px) {
  .mobile-status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
  }
}

/* ---------- very narrow phones: shrink type, not layout ---------- */
@media (max-width: 380px) {
  .nav-item {
    min-width: 50px;
    font-size: 9px;
    padding: 7px 3px;
  }
  .side .nav-label {
    font-size: 9px;
  }
  .brand .brand-name {
    font-size: 11px;
    letter-spacing: 0.1em;
  }
  .main {
    padding-left: calc(9px + var(--safe-l));
    padding-right: calc(9px + var(--safe-r));
  }
  .kpi-value {
    font-size: 19px;
  }
  .mobile-status .chip {
    display: none;
  }
}

/* ---------- landscape phone: horizontal space is scarce, vertical is tiny ---------- */
@media (max-height: 460px) and (orientation: landscape) {
  .app-shell {
    grid-template-columns: var(--side-w-rail) minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr);
    grid-template-areas:
      'brand topbar'
      'side  main';
  }
  .topbar {
    display: flex;
  }
  .topbar .topbar-stats {
    display: none;
  }
  .brand {
    justify-content: center;
    padding: 0 6px;
    border-right: 1px solid var(--line);
    padding-top: 0;
    height: auto;
  }
  .brand .brand-name,
  .mobile-status {
    display: none;
  }
  .side {
    position: sticky;
    inset: auto;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px 6px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: var(--bg-1);
    backdrop-filter: none;
  }
  .nav-item {
    flex-direction: row;
    justify-content: center;
    min-width: 0;
    padding: 9px 0;
  }
  .side .nav-label {
    display: none;
  }
  .main {
    padding: 10px 12px;
  }
}

/* ============================== navigation ============================== */

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  width: 100%;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-3);
  color: var(--ink);
}

.nav-item[aria-current='page'] {
  background: linear-gradient(90deg, var(--lime-dim), transparent 85%);
  color: var(--ink);
  border-color: var(--line);
}

.nav-item[aria-current='page']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--lime);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.8;
}

.nav-item[aria-current='page'] svg {
  opacity: 1;
  color: var(--lime);
}

.nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--lime);
  color: #0a0c11;
  font-weight: 700;
}

.side-section-label {
  padding: 16px 11px 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.side-foot {
  margin-top: auto;
  padding: 12px 11px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Old bottom-bar rules kept only for the icon-rail tier's selected marker. */
@media (max-width: 1180px) {
  .nav-item[aria-current='page']::before {
    left: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 2px;
    height: 18px;
  }
}

/* =============================== controls =============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-3);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  white-space: nowrap;
  user-select: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-2);
  border-color: var(--ink-4);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--lime);
  color: #08090d;
  border-color: transparent;
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: #d7ff85;
  border-color: transparent;
  box-shadow: var(--glow-lime);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-danger {
  background: var(--red-dim);
  border-color: rgba(255, 107, 107, 0.32);
  color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.22);
  border-color: var(--red);
}

.btn-sm {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 7px;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 14px;
  border-radius: var(--radius);
}

.btn-block {
  width: 100%;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--lime-line);
  box-shadow: 0 0 0 3px var(--lime-dim);
}

input::placeholder {
  color: var(--ink-4);
}

label.field {
  display: block;
  margin-bottom: 12px;
}

label.field > span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}

.seg button {
  padding: 5px 10px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.seg button[aria-pressed='true'] {
  background: var(--bg-3);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch .track {
  width: 38px;
  height: 21px;
  border-radius: 99px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  flex: none;
}

.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: transform 0.22s var(--ease), background 0.2s var(--ease);
}

.switch input:checked + .track {
  background: var(--lime-dim);
  border-color: var(--lime-line);
}

.switch input:checked + .track::after {
  transform: translateX(17px);
  background: var(--lime);
}

.switch input:focus-visible + .track {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

/* ================================= card ================================= */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(130%);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.card-head h2,
.card-head h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card-head .card-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 16px;
}

.card-body.tight {
  padding: 10px 12px;
}

.card-body.flush {
  padding: 0;
}

/* =============================== dashboard ============================== */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: clamp(22px, 3vw, 30px);
}

.page-head .sub {
  color: var(--ink-3);
  font-size: 13px;
  max-width: 62ch;
  margin-top: 5px;
}

.page-head .spacer {
  flex: 1;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-dash {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.span-3 {
  grid-column: span 3;
}
.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-6 {
  grid-column: span 6;
}
.span-7 {
  grid-column: span 7;
}
.span-8 {
  grid-column: span 8;
}
.span-9 {
  grid-column: span 9;
}
.span-12 {
  grid-column: span 12;
}

@media (max-width: 1240px) {
  .span-3 {
    grid-column: span 6;
  }
  .span-4,
  .span-5,
  .span-7,
  .span-8,
  .span-9,
  .span-6 {
    grid-column: span 12;
  }
}

/* two-up KPIs stay readable down to the smallest phone */
@media (max-width: 760px) {
  .grid {
    gap: 10px;
  }
  .span-3 {
    grid-column: span 6;
  }
}

@media (max-width: 460px) {
  .span-3 {
    grid-column: span 12;
  }
}

/* KPI */
.kpi {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 106px;
  justify-content: space-between;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.kpi-value {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.spark {
  height: 34px;
  width: 100%;
  display: block;
  overflow: visible;
}

/* ================================ tables ================================ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.data th {
  text-align: left;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: color-mix(in srgb, var(--bg-1) 55%, transparent);
  position: sticky;
  top: 0;
  z-index: 2;
}

table.data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}

table.data tbody tr {
  transition: background 0.14s var(--ease);
}

table.data tbody tr:hover {
  background: color-mix(in srgb, var(--bg-3) 60%, transparent);
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data td.num,
table.data th.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.clickable {
  cursor: pointer;
}

/* ================================= chips ================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  background: var(--bg-3);
  white-space: nowrap;
}

.chip.long {
  color: var(--lime);
  background: var(--lime-dim);
  border-color: var(--lime-line);
}
.chip.short {
  color: var(--red);
  background: var(--red-dim);
  border-color: rgba(255, 107, 107, 0.3);
}
.chip.warn {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: rgba(255, 196, 107, 0.3);
}
.chip.info {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: rgba(107, 216, 255, 0.28);
}
.chip.live {
  color: var(--lime);
  background: var(--lime-dim);
  border-color: var(--lime-line);
}
.chip.live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(200, 247, 106, 0.5);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 4px rgba(200, 247, 106, 0);
  }
}

/* =============================== features =============================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.feature {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.feature h4 {
  font-size: 12.5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.feature p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ============================== confidence ============================== */

.conf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.conf-bar {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: var(--bg-3);
  overflow: hidden;
  flex: none;
}

.conf-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--lime);
  transition: width 0.5s var(--ease);
}

.conf-bar.mid > i {
  background: var(--amber);
}
.conf-bar.low > i {
  background: var(--red);
}

/* =============================== factors ================================ */

.factor {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 4px 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  align-items: center;
}

.factor:last-child {
  border-bottom: 0;
}

.factor-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: space-between;
}

.factor-name {
  font-size: 12.5px;
  font-weight: 500;
}

.factor-points {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}

.factor-note {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

.factor-bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 99px;
  background: var(--bg-3);
  overflow: hidden;
}

.factor-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--lime-line), var(--lime));
  border-radius: 99px;
}

/* ================================= chart ================================ */

.chart-shell {
  position: relative;
  width: 100%;
  /* height follows the viewport so the chart is never a fixed 380px slab
     that overflows a phone in landscape or wastes space on a desktop */
  height: clamp(240px, 42vh, 420px);
}

@media (max-width: 760px) {
  .chart-shell {
    height: clamp(210px, 34vh, 280px);
  }
}

@media (max-height: 460px) and (orientation: landscape) {
  .chart-shell {
    height: 200px;
  }
}

.chart-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(8, 9, 13, 0.94);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  white-space: pre;
  box-shadow: var(--shadow-2);
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 0.12s;
}

.chart-tooltip.show {
  opacity: 1;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 2px;
  margin-right: 5px;
  vertical-align: middle;
  border-radius: 2px;
}

/* =============================== AI chat ================================ */

.chat {
  display: flex;
  flex-direction: column;
  height: min(66vh, 640px);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
  animation: rise 0.24s var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  background: var(--bg-3);
  color: var(--ink-2);
}

.msg.assistant .msg-avatar {
  background: var(--lime-dim);
  border-color: var(--lime-line);
  color: var(--lime);
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 4px;
}

.msg-text {
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink);
  word-break: break-word;
}

.msg-text p {
  margin: 0 0 8px;
}
.msg-text p:last-child {
  margin-bottom: 0;
}
.msg-text strong {
  color: var(--ink);
  font-weight: 600;
}
.msg-text code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-3);
  color: var(--lime);
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-1) 70%, transparent);
}

.chat-input input {
  flex: 1;
}

.suggestions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0 12px 12px;
}

.suggestion {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}

.suggestion:hover {
  border-color: var(--lime-line);
  color: var(--ink);
  background: var(--lime-dim);
}

/* ============================== positions =============================== */

.pos-card {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.pos-card:last-child {
  border-bottom: 0;
}

.pos-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.pos-symbol {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.pos-levels {
  display: flex;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.pos-levels b {
  color: var(--ink-2);
  font-weight: 500;
}

.r-scale {
  position: relative;
  height: 4px;
  border-radius: 99px;
  background: var(--bg-3);
  overflow: hidden;
}

.r-scale > i {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--lime);
  border-radius: 99px;
  transition: all 0.4s var(--ease);
}

/* ============================== marketing =============================== */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 30px 0 60px;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding: 24px 0 40px;
  }
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: normal;
  color: var(--lime);
}

.hero .lede {
  font-size: 15.5px;
  color: var(--ink-2);
  max-width: 52ch;
  line-height: 1.62;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.trust {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.trust-item .v {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.trust-item .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.terminal-preview {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.6s var(--ease);
}

.terminal-preview:hover {
  transform: perspective(1400px) rotateY(-2deg) rotateX(0deg);
}

@media (max-width: 980px) {
  .terminal-preview {
    transform: none;
  }
}

.tp-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.tp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.tp-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.tp-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.tp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  font-size: 12px;
}

.feature-section {
  padding: 64px 0 20px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -0.03em;
  margin: 8px 0 10px;
}

.section-head p {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.6;
}

/* ================================= auth ================================= */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

@media (max-width: 940px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }
  .auth-aside {
    display: none;
  }
  .auth-form-side {
    padding: max(28px, env(safe-area-inset-top, 0px)) calc(20px + var(--safe-r)) calc(28px + var(--safe-b)) calc(20px + var(--safe-l));
    min-height: 100dvh;
    justify-content: center;
  }
  .auth-card h1 {
    font-size: 23px;
  }
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px clamp(24px, 7vw, 80px);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.auth-aside {
  border-left: 1px solid var(--line);
  background:
    radial-gradient(40rem 30rem at 80% 10%, rgba(200, 247, 106, 0.08), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--bg));
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.auth-card {
  width: 100%;
}

.auth-card h1 {
  font-size: 27px;
  margin-bottom: 8px;
}

.auth-card .sub {
  color: var(--ink-3);
  font-size: 13.5px;
  margin-bottom: 26px;
}

.auth-alt {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.auth-alt button {
  background: none;
  border: 0;
  color: var(--lime);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg-3);
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.alert.error {
  border-color: rgba(255, 107, 107, 0.35);
  background: var(--red-dim);
  color: #ffb3b3;
}

.alert.warn {
  border-color: rgba(255, 196, 107, 0.35);
  background: var(--amber-dim);
  color: var(--amber);
}

.alert.ok {
  border-color: var(--lime-line);
  background: var(--lime-dim);
  color: var(--lime);
}

/* ================================ toasts ================================ */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 32px));
}

@media (max-width: 760px) {
  .toast-stack {
    bottom: calc(var(--bottom-bar-h) + var(--safe-b) + 10px);
    right: calc(10px + var(--safe-r));
    left: calc(10px + var(--safe-l));
    max-width: none;
  }
}

/* phone form controls: 16px stops iOS Safari from zooming on focus */
@media (max-width: 760px) {
  input[type='text'],
  input[type='email'],
  input[type='password'],
  input[type='number'],
  input[type='search'],
  select,
  textarea {
    font-size: 16px;
    padding: 11px 12px;
  }

  /* touch targets */
  .btn {
    min-height: 38px;
  }
  .btn-sm {
    min-height: 32px;
  }
  .seg button {
    min-height: 32px;
    padding: 6px 11px;
  }
}

/* tables become horizontally scrollable with a hint shadow instead of
   squeezing columns until the numbers wrap */
@media (max-width: 760px) {
  .table-wrap {
    position: relative;
  }
  table.data {
    min-width: 560px;
  }
  table.data th,
  table.data td {
    padding: 8px 10px;
  }
  .card-body {
    padding: 12px;
  }
  .card-head {
    padding: 11px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-head .card-actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }
  .page-head {
    gap: 10px;
    margin-bottom: 14px;
  }
  .kpi-value {
    font-size: 21px;
  }
  .kpi {
    min-height: 92px;
    padding: 12px;
  }
  .chat {
    height: min(58vh, 520px);
  }
}

.toast {
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 19, 27, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  color: var(--ink);
  animation: toast-in 0.3s var(--ease);
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.toast.out {
  animation: toast-out 0.25s var(--ease) forwards;
}

.toast b {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
  color: var(--ink-3);
}

.toast.trade {
  border-color: var(--lime-line);
}
.toast.trade b {
  color: var(--lime);
}
.toast.error {
  border-color: rgba(255, 107, 107, 0.4);
}
.toast.error b {
  color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* =============================== utilities ============================== */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.wrap {
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.right {
  margin-left: auto;
}
.hide {
  display: none !important;
}
.center {
  text-align: center;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.gap-2 {
  gap: 16px;
}

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty svg {
  width: 28px;
  height: 28px;
  opacity: 0.4;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-2) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.meter {
  height: 6px;
  border-radius: 99px;
  background: var(--bg-3);
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--lime);
  transition: width 0.5s var(--ease);
}

.meter.warn > i {
  background: var(--amber);
}
.meter.crit > i {
  background: var(--red);
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv > span:first-child {
  color: var(--ink-3);
}

.kv > span:last-child {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* backdrop for modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.2s var(--ease);
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  animation: rise 0.26s var(--ease);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-body {
  padding: 18px 20px;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ================================= vault ================================ */

.graph-shell {
  position: relative;
  width: 100%;
  height: clamp(300px, 46vh, 480px);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(200, 247, 106, 0.045), transparent 70%),
    radial-gradient(50% 50% at 80% 80%, rgba(181, 140, 255, 0.05), transparent 70%),
    var(--bg);
  touch-action: none;
}

@media (max-width: 760px) {
  .graph-shell {
    height: clamp(240px, 40vh, 340px);
  }
}

.vault-note {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.vault-note h1,
.vault-note h2,
.vault-note h3 {
  color: var(--ink);
  font-size: 14px;
  margin: 12px 0 6px;
}

.vault-note p {
  margin: 0 0 8px;
}

.vault-note ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.vault-note li {
  margin-bottom: 3px;
}

.vault-note code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--lime);
}

.vault-note strong {
  color: var(--ink);
}

/* wikilinks read like Obsidian: a distinct accent, no underline until hover */
.vault-note .wikilink {
  color: var(--violet);
  border-bottom: 1px dashed rgba(181, 140, 255, 0.4);
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.vault-note .wikilink:hover {
  color: #cdb2ff;
  border-bottom-color: var(--violet);
}

/* ============================ entrance motion =========================== */

/*
 * Views rise into place once. This is deliberately short and cheap: a dashboard
 * that re-runs entrance animation on every live refresh would be unusable, so
 * it only applies to the initial paint of a route.
 */
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.main > .grid,
.main > div > .grid {
  animation: view-in 0.34s var(--ease) both;
}

.main .card {
  animation: view-in 0.4s var(--ease) both;
}

/* stagger the first few cards so the page assembles rather than snapping */
.main .grid > .card:nth-child(1) { animation-delay: 0.02s; }
.main .grid > .card:nth-child(2) { animation-delay: 0.05s; }
.main .grid > .card:nth-child(3) { animation-delay: 0.08s; }
.main .grid > .card:nth-child(4) { animation-delay: 0.11s; }
.main .grid > .card:nth-child(5) { animation-delay: 0.14s; }
.main .grid > .card:nth-child(6) { animation-delay: 0.17s; }
.main .grid > .card:nth-child(n + 7) { animation-delay: 0.2s; }

@keyframes price-tick {
  0% { background-color: transparent; }
  30% { background-color: var(--lime-dim); }
  100% { background-color: transparent; }
}

.price-tick {
  animation: price-tick 0.6s var(--ease);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.chip,
.nav-item {
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease);
}

button.chip:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .main > .grid,
  .main > div > .grid,
  .main .card,
  .chip,
  .nav-item {
    animation: none !important;
    transition: none !important;
  }
}

/* ================================= files ================================ */

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 26px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
  cursor: pointer;
  text-align: center;
  color: var(--ink-2);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.dropzone:hover,
.dropzone.hot {
  border-color: var(--lime-line);
  background: var(--lime-dim);
  color: var(--ink);
}

.dropzone svg {
  color: var(--lime);
  opacity: 0.8;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.14s var(--ease);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: color-mix(in srgb, var(--bg-3) 55%, transparent);
}

.file-badge {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--lime-dim);
  border: 1px solid var(--lime-line);
  color: var(--lime);
}

@media (max-width: 760px) {
  .file-row {
    flex-wrap: wrap;
  }
  .file-row > .row:last-child {
    width: 100%;
    justify-content: flex-start;
  }
}
