/* Volumx design tokens and shared components (all redesigned pages, body.vx).
   Plain CSS so it works next to both the compiled app.css and the Tailwind CDN pages.
   Load it BEFORE the Tailwind styles: component selectors use :where(.vx) so their
   specificity equals one class, and Tailwind utilities (hidden, sm:inline-flex, bg-*)
   still override them, the same way Tailwind's own components layer behaves. */
:root {
  --bg: #0c0d10;
  --panel: #14161b;
  --raised: #1b1d23;
  --field: #0f1014;
  --line: #23262e;
  --line2: #33373f;
  --muted: #8b909c;
  --text: #e8e9ec;
  --accent: #6d6af0;
  --accent2: #7c79f3;
  --gold: #e9b949;
  --gold-hover: #f0c55e;
  --silver: #c9ced8;
  --bronze: #d29a6a;
  --red: #f08a8a;
  --green: #6fcf97;
}

html { color-scheme: dark; }
body.vx {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
:where(.vx) .mono { font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
:where(.vx) .muted { color: var(--muted); }

/* Surfaces */
:where(.vx) .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
:where(.vx) .divide-line > * + * { border-top: 1px solid var(--line); }

/* Header */
:where(.vx) .vx-header { border-bottom: 1px solid var(--line); background: var(--bg); }
:where(.vx) .vx-header-inner { max-width: 72rem; margin: 0 auto; height: 4rem; padding: 0 1rem; display: flex; align-items: center; gap: 2rem; }
@media (min-width: 640px) { :where(.vx) .vx-header-inner { padding: 0 1.5rem; } }
:where(.vx) .vx-brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; letter-spacing: -.01em; color: var(--text); cursor: pointer; }
:where(.vx) .vx-brand img { height: 1.5rem; width: 1.5rem; }
:where(.vx) .vx-nav { display: none; align-items: center; gap: .25rem; }
@media (min-width: 640px) { :where(.vx) .vx-nav { display: flex; } }
:where(.vx) .vx-mobile-nav { display: flex; gap: .25rem; padding: .5rem 1rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
@media (min-width: 640px) { :where(.vx) .vx-mobile-nav { display: none; } }
:where(.vx) .nav-link { padding: .4rem .75rem; border-radius: .55rem; color: var(--muted); font-size: .875rem; white-space: nowrap; }
:where(.vx) .nav-link:hover { color: var(--text); }
:where(.vx) .nav-link.active { background: var(--raised); color: var(--text); }
:where(.vx) .vx-header-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
:where(.vx) .pill { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border-radius: .6rem; border: 1px solid var(--line); color: var(--text); cursor: pointer; background: transparent; }
:where(.vx) .pill:hover { border-color: var(--line2); }
:where(.vx) .account-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--line); color: var(--text); }
:where(.vx) .account-pill:hover { border-color: var(--line2); }
:where(.vx) .avatar { height: 1.75rem; width: 1.75rem; border-radius: 999px; background: var(--line); display: grid; place-items: center; font-size: .75rem; font-weight: 600; color: var(--text); }

/* Plan badge (text only, colored by plan) */
:where(.vx) .tier-badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; }
:where(.vx) .tier-free { color: var(--muted); }
:where(.vx) .tier-bronze { color: var(--bronze); }
:where(.vx) .tier-silver { color: var(--silver); }
:where(.vx) .tier-gold { color: var(--gold); }

/* Buttons */
:where(.vx) .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.5rem; padding: 0 1rem; border-radius: .6rem; font-weight: 500; font-size: .9rem; transition: background-color .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap; cursor: pointer; }
:where(.vx) .btn:active:not(:disabled) { transform: scale(.98); }
:where(.vx) .btn:disabled { opacity: .45; cursor: not-allowed; }
:where(.vx) .btn-primary { background: var(--accent); color: #fff; }
:where(.vx) .btn-primary:hover:not(:disabled) { background: var(--accent2); }
:where(.vx) .btn-ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }
:where(.vx) .btn-ghost:hover:not(:disabled) { border-color: var(--line2); }
:where(.vx) .btn-gold { background: var(--gold); color: #17140c; }
:where(.vx) .btn-gold:hover:not(:disabled) { background: var(--gold-hover); }
:where(.vx) .btn-danger { background: #b4383b; color: #fff; }
:where(.vx) .btn-danger:hover:not(:disabled) { background: #c64144; }
:where(.vx) .btn-lg { height: 3rem; padding: 0 1.4rem; font-size: 1rem; border-radius: .75rem; }
:where(.vx) .btn-sm { height: 2.25rem; padding: 0 .8rem; font-size: .85rem; }
:where(.vx) .icon-btn { height: 2.25rem; width: 2.25rem; display: inline-grid; place-items: center; border-radius: .5rem; color: var(--muted); background: transparent; cursor: pointer; }
:where(.vx) .icon-btn:hover { background: var(--raised); color: var(--text); }
:where(.vx) .link { color: var(--accent2); }
:where(.vx) .link:hover { text-decoration: underline; }

/* Form controls */
:where(.vx) .field { display: block; width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: .6rem; padding: .6rem .75rem; font-size: .9rem; color: var(--text); }
:where(.vx) .field::placeholder { color: #5d626d; }
:where(.vx) .field:focus { outline: none; border-color: var(--accent); }
:where(.vx) select.field { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' stroke='%238b909c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; }
:where(.vx) .field:disabled { opacity: .5; }
:where(.vx) .label { display: block; font-size: .875rem; margin-bottom: .5rem; color: var(--text); }
:where(.vx) input[type=range].range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 4px; border-radius: 9px; background: linear-gradient(to right, var(--accent) var(--p, 0%), #2a2d35 var(--p, 0%)); }
:where(.vx) input[type=range].range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
:where(.vx) input[type=range].range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
:where(.vx) input[type=range].range:disabled { opacity: .45; }
:where(.vx) input[type=range].range:disabled::-webkit-slider-thumb { cursor: default; }
:where(.vx) input[type=checkbox] { accent-color: var(--accent); }

/* Segmented control (radio labels or aria-pressed buttons) */
:where(.vx) .seg { display: grid; gap: .25rem; padding: .25rem; border-radius: .75rem; background: var(--field); border: 1px solid var(--line); font-size: .875rem; }
:where(.vx) .seg > * { position: relative; padding: .5rem .75rem; border-radius: .55rem; color: var(--muted); text-align: center; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .4rem; }
:where(.vx) .seg > *:hover { color: var(--text); }
:where(.vx) .seg > [aria-pressed="true"], :where(.vx) .seg > label:has(input:checked) { background: var(--line); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
:where(.vx) .seg > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
:where(.vx) .seg input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
:where(.vx) .seg .seg-help { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); color: var(--muted); opacity: .6; font-size: .8rem; }
:where(.vx) .seg .seg-help:hover { opacity: 1; color: var(--text); }

/* Tags */
:where(.vx) .tag { display: inline-flex; align-items: center; gap: .3rem; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: .15rem .45rem; border-radius: .35rem; white-space: nowrap; }
:where(.vx) .tag-plain { background: var(--raised); color: var(--text); }
:where(.vx) .tag-gold { color: var(--gold); background: rgba(233,185,73,.1); }
:where(.vx) .tag-silver { color: var(--silver); background: rgba(201,206,216,.1); }

/* Task rows */
:where(.vx) .task-row { display: flex; align-items: center; gap: .75rem; padding: .75rem; position: relative; }
@media (min-width: 640px) { :where(.vx) .task-row { gap: 1rem; padding: 1rem; } }
:where(.vx) .task-row:hover { background: #181a20; }
:where(.vx) .task-row:first-child { border-top-left-radius: 13px; border-top-right-radius: 13px; }
:where(.vx) .task-row:last-child { border-bottom-left-radius: 13px; border-bottom-right-radius: 13px; }
:where(.vx) .task-thumb { display: block; height: 3.5rem; width: 6rem; flex: none; border-radius: .5rem; object-fit: cover; background: var(--raised); }
@media (max-width: 639px) { :where(.vx) .task-thumb { height: 3rem; width: 4.5rem; } }
:where(.vx) .progress { height: 4px; flex: 1; max-width: 20rem; border-radius: 99px; background: var(--line); overflow: hidden; }
:where(.vx) .progress > div { height: 100%; background: var(--accent); transition: width .4s ease; }
:where(.vx) .progress.fast > div { background: var(--gold); }
:where(.vx) .menu { position: absolute; right: .75rem; top: calc(100% - .5rem); z-index: 30; min-width: 12rem; padding: .375rem; background: var(--panel); border: 1px solid var(--line2); border-radius: .75rem; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
:where(.vx) .menu button, :where(.vx) .menu a { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .75rem; border-radius: .45rem; font-size: .875rem; color: var(--text); text-align: left; }
:where(.vx) .menu button:hover, :where(.vx) .menu a:hover { background: var(--raised); }
:where(.vx) .menu .danger { color: var(--red); }
:where(.vx) .menu i { width: 1rem; color: var(--muted); }
:where(.vx) .menu .danger i { color: var(--red); }

/* Modals */
:where(.vx) .modal-backdrop { background: rgba(0,0,0,.7); }
:where(.vx) .modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.6); color: var(--text); }
:where(.vx) dialog.modal { padding: 1.5rem; }
:where(.vx) dialog.modal::backdrop { background: rgba(0,0,0,.7); }

/* Upload drop area */
:where(.vx) .dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; width: 100%; border: 1px dashed var(--line2); border-radius: 10px; color: var(--muted); cursor: pointer; transition: border-color .15s, background-color .15s; }
:where(.vx) .dropzone:hover, :where(.vx) .dropzone.dragging { border-color: var(--accent); background: rgba(109,106,240,.06); color: var(--text); }

/* Bridge for markup that scripts still build with the old gray/indigo utilities
   (share dialog, help lists, messages). Higher specificity on purpose. */
.vx .bg-gray-900 { background-color: var(--field); }
.vx .bg-gray-800 { background-color: var(--panel); }
.vx .bg-gray-700 { background-color: var(--raised); }
.vx .border-gray-700 { border-color: var(--line); }
.vx .border-gray-600 { border-color: var(--line2); }
.vx .text-gray-300, .vx .text-gray-200 { color: #c5c8cf; }
.vx .text-gray-400, .vx .text-gray-500 { color: var(--muted); }
.vx .text-indigo-300, .vx .text-indigo-400 { color: var(--accent2); }
.vx .bg-indigo-600 { background-color: var(--accent); }
.vx .hover\:bg-indigo-700:hover, .vx .hover\:bg-indigo-500:hover { background-color: var(--accent2); }
.vx .focus\:ring-indigo-600:focus, .vx .focus\:ring-indigo-500:focus { --tw-ring-color: var(--accent); }

/* Font Awesome sets display on its icons, which would beat Tailwind's .hidden. */
:where(.vx) i.hidden { display: none; }

/* Phones: tighter header so credits, Get credits and the account pill fit at 360px. */
@media (max-width: 639px) {
  :where(.vx) .vx-header-inner { gap: 1rem; }
  :where(.vx) .vx-header-right { gap: .5rem; }
}
:where(.vx) .vx-brand { flex: none; }
@media (max-width: 399px) {
  :where(.vx) .vx-brand-name { display: none; }
}

/* Credits count and Get credits read as one control: outlined count, light button attached. */
:where(.vx) .btn-light { background: var(--text); color: var(--bg); }
:where(.vx) .btn-light:hover:not(:disabled) { background: #fff; }
:where(.vx) .credit-group { display: inline-flex; align-items: stretch; }
:where(.vx) .credit-group > .pill { height: 2.25rem; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
:where(.vx) .credit-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
:where(.vx) .credit-group > .pill.hidden + .btn { border-radius: .6rem; }
