/* Hook Stitcher — same look and feel as the vznry Studio OS (os.vznry.com).
   Tokens copied from vznry-os/src/app/globals.css: Inter + Instrument Serif italic
   accents, warm near-black / cool near-white neutrals, coral for primary actions,
   IKB for links and progress, gold for highlights. Signal lights = dot + label. */

:root {
  color-scheme: light;
  --page: #f3f4f6; --surface: #fbfafa;
  --ink: #110f0e; --ink-2: #47433f; --muted: #868079;
  --hairline: #dddfe4; --border: rgba(17, 15, 14, 0.10);
  --good: #00c437; --warning: #ffc400; --serious: #ff7a1a; --critical: #ff4344;
  --accent: #ff4344; --accent-hot: #ff2c33; --accent-ink: #ffffff;
  --ikb: #002fa7; --ikb-ink: #ffffff;
  --gold: #d4af37; --gold-tint: rgba(212, 175, 55, 0.12);
  --good-text: #006300;
  --gray-light: #a39d96;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e0d0c; --surface: #1b1a18;
    --ink: #fdfcfc; --ink-2: #c7c2bc; --muted: #9f9993;
    --hairline: #2b2927; --border: rgba(253, 252, 252, 0.10);
    --accent: #ff5455; --critical: #ff5455;
    --ikb: #4b6fe8; --ikb-ink: #ffffff;
    --gold: #d4af37; --gold-tint: rgba(212, 175, 55, 0.14);
    --good-text: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0d0c; --surface: #1b1a18;
  --ink: #fdfcfc; --ink-2: #c7c2bc; --muted: #9f9993;
  --hairline: #2b2927; --border: rgba(253, 252, 252, 0.10);
  --accent: #ff5455; --critical: #ff5455;
  --ikb: #4b6fe8; --ikb-ink: #ffffff;
  --gold: #d4af37; --gold-tint: rgba(212, 175, 55, 0.14);
  --good-text: #0ca30c;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page); color: var(--ink);
  font-size: 14px; line-height: 1.45;
}
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; }
a { color: var(--ikb); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ikb); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { max-width: 820px; margin: 0 auto; padding: 28px 20px 60px; }

/* topbar — Vizzy, name, wordmark like vznry.com (Visionary Studios + pronunciation), OS theme toggle */
.topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.topbar .vizzy { flex: none; }
.topbar .vizzy img { height: 96px; width: auto; display: block; }
.topbar .titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.topbar .lede { color: var(--ink-2); font-size: 18px; margin-top: 2px; }
.topbar .right { flex: none; display: flex; align-items: center; gap: 14px; }
.wordmark { text-align: right; }
.wordmark .brand { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.wordmark .pron { margin-top: 3px; font-size: 9px; font-weight: 500; letter-spacing: 0.18em; color: var(--muted); white-space: nowrap; line-height: 1.2; }
.wordmark .pron span + span { margin-left: 8px; }
.theme-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; width: 30px; height: 30px; font-size: 14px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit; }
.theme-toggle:hover { color: var(--ink); }
.says {
  margin: 0 0 22px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); font-size: 13.5px;
  display: flex; align-items: center; gap: 8px;
}
.says .who { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* section headings + blocks */
h2.sect { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); margin: 24px 0 10px; }
h2.sect .opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--gray-light); margin-left: 6px; }
.block { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.count { color: var(--ink-2); font-size: 12.5px; margin-top: 10px; }
.warn { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px;
  background: rgba(255, 196, 0, 0.14); border: 1px solid var(--warning); color: var(--ink); }

/* buttons — Studio OS `.a` */
.buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button.a, a.a {
  border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--ink); padding: 9px 14px; font-size: 13px; cursor: pointer; font-weight: 550;
  font-family: inherit; display: inline-block; line-height: 1.2;
}
button.a:hover:not(:disabled) { background: var(--page); }
button.a.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.a.primary:hover:not(:disabled) { background: var(--accent-hot); border-color: var(--accent-hot); }
button.a.ghost { border-style: dashed; color: var(--ink-2); }
button.a.big { font-size: 15px; padding: 13px 22px; font-weight: 600; border-radius: 10px; }
button.a:disabled { opacity: 0.5; cursor: default; }
input[type="file"] { display: none; }

/* file lists */
.filelist { list-style: none; padding: 0; margin: 10px 0 0; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--hairline); }
.filelist li:first-child { border-top: none; padding-top: 4px; }
.filelist .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; color: var(--ink); }
.filelist .fsize { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.filelist .rm { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 6px;
  width: 24px; height: 24px; cursor: pointer; font-size: 14px; line-height: 1; font-family: inherit; }
.filelist .rm:hover { color: var(--critical); border-color: var(--critical); }

/* name pattern */
.pattern { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pattern label { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.pattern input { font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 220px;
  background: var(--page); color: var(--ink); }
.pattern input.bad { border-color: var(--serious); }
.pattern .presets { font-size: 12.5px; color: var(--muted); }
.pattern .hint { flex-basis: 100%; margin: 0; }

/* progress */
.statusline { font-size: 15px; font-weight: 600; color: var(--ink); }
.bar { height: 6px; background: var(--hairline); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.bar > div { height: 100%; width: 0; background: var(--ikb); transition: width 0.4s ease; }
.meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-bottom: 12px; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
table.data { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 520px; }
table.data th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--hairline); color: var(--ink-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data td.name { color: var(--ink); font-weight: 550; word-break: break-all; }
table.data tr.prep td.name { color: var(--ink-2); font-weight: 500; }
table.data td.size { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.act { white-space: nowrap; }
table.data td.act a { margin-left: 10px; }
table.data tr.failed td.state .lbl { color: var(--critical); }

/* pills — always dot + label */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--hairline); color: var(--ink-2);
  white-space: nowrap; max-width: 100%; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--gray-light); }
.pill.ok .dot { background: var(--good); }
.pill.warn .dot { background: var(--warning); animation: pulse 1s ease-in-out infinite; }
.pill.crit .dot { background: var(--critical); }
.pill.neutral .dot { background: var(--gray-light); }
.pill .lbl { overflow: hidden; text-overflow: ellipsis; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* results */
.results-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.highlight { background: var(--gold-tint); border: 1px solid var(--gold); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.uploadlog { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.uploadlog div { padding: 3px 0; border-top: 1px solid var(--hairline); }
.uploadlog div:first-child { border-top: none; }

footer { margin-top: 40px; color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  .shell { padding: 18px 14px 40px; }
  .topbar { gap: 12px; }
  .topbar .vizzy img { height: 72px; }
  .topbar h1 { font-size: 20px; }
  .topbar .lede { font-size: 16px; }
  .wordmark { display: none; }
  .buttons button.a { flex: 1 1 auto; text-align: center; }
  table.data th:nth-child(3), table.data td.size { display: none; }
}
