/* ==========================================================================
   ZeroRepo · technical dossier theme
   Cool drafting paper, ink typography, cobalt index marks.
   ========================================================================== */

:root {
  color-scheme: light;

  /* surfaces */
  --paper: #eef1f4;
  --paper-deep: #e5eaf0;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #edf2f7;

  /* ink */
  --ink: #102a43;
  --body: #334e68;
  --muted: #627d98;
  --faint: #829ab1;
  --line: #d5dee7;
  --line-soft: #e6ecf2;

  /* accents */
  --blue: #1d4ed8;
  --blue-deep: #1740b4;
  --blue-soft: #e9effc;
  --blue-line: #c9d8f6;
  --orange: #e8590c;
  --orange-soft: #fff1e8;
  --green: #2f9e44;
  --green-soft: #e8f7ed;
  --red: #d64545;
  --red-soft: #fdecec;

  /* code */
  --navy: #0b1b2b;
  --navy-line: rgba(255, 255, 255, 0.1);
  --code-text: #d8e4ee;

  /* type */
  --font-display: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", Consolas, "SFMono-Regular", "Menlo", monospace;

  /* geometry */
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 306px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-panel: 0 22px 48px -38px rgba(16, 42, 67, 0.55);
  --shadow-float: 0 18px 40px -24px rgba(16, 42, 67, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: var(--blue);
}

::selection {
  background: rgba(29, 78, 216, 0.18);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* quiet scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #b9c7d6 transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: #c2cedb;
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #a7b8c9;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   shell
   ========================================================================== */

.shell {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   sidebar · the record index
   ========================================================================== */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: none;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 22px 18px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--blue);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.logo-mark {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.12);
}

.logo-cursor {
  color: #8fb0ff;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.brand-sub {
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 2px 9px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.label-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
}

.side-label .count-pill {
  margin-left: auto;
}

/* stats */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px 11px;
  min-width: 0;
}

.stat + .stat {
  border-left: 1px solid var(--line-soft);
}

.stat b {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

/* quota */

.quota-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--blue-line);
  border-radius: 9px;
  background: var(--blue-soft);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: #3f5f91;
}

.quota-key {
  white-space: nowrap;
}

.quota-line b {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.quota-line b.is-low {
  color: var(--orange);
}

.quota-line.is-limited {
  border-color: #f6c9ab;
  background: var(--orange-soft);
  color: #8a4519;
}

/* search + filter */

.side-search {
  position: relative;
  margin-bottom: 7px;
}

.search-glyph {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  color: var(--faint);
  pointer-events: none;
}

.side-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.side-search input::placeholder {
  color: var(--faint);
}

.side-search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.side-filter {
  margin-bottom: 10px;
}

.side-filter select {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23627d98' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  font-size: 11.5px;
  color: var(--body);
  cursor: pointer;
}

.side-filter select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* history */

.history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px 10px;
}

.hist-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  padding: 9px 8px 9px 11px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.hist-item:hover {
  background: var(--surface-2);
}

.hist-item.is-active {
  background: var(--blue-soft);
  border-left-color: var(--blue);
}

.hist-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hist-name {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-name b {
  font-weight: 600;
  color: var(--ink);
}

.hist-item.is-active .hist-name b {
  color: var(--blue);
}

.hist-sub {
  font-size: 10.5px;
  letter-spacing: 0.01em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-tail {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hist-idx {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
}

.hist-item.is-active .hist-idx {
  color: var(--blue);
}

.hist-del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  color: var(--faint);
  font-size: 14px;
  line-height: 1;
  opacity: 0.45;
  transition: color 0.14s, background 0.14s, opacity 0.14s;
}

.hist-item:hover .hist-del,
.hist-del:focus-visible {
  opacity: 1;
}

.hist-del:hover {
  color: var(--red);
  background: var(--red-soft);
}

.hist-empty {
  padding: 22px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  text-align: left;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--faint);
}

.hist-empty b {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--muted);
}

.sidebar-foot {
  flex: none;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.engine-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--body);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.14);
}

.engine-state {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
}

.engine-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--faint);
}

.sidebar-scrim {
  display: none;
}

/* ==========================================================================
   main column
   ========================================================================== */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 3.4vw, 52px) 34px;
}

.topbar,
.hero,
.workspace,
.page-foot {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
}

/* topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.menu-btn span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb-home {
  font-weight: 600;
  color: var(--ink);
}

.crumb-sep {
  color: var(--faint);
}

.crumb-active {
  color: var(--body);
}

.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: 10.5px;
  color: var(--body);
}

.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* mode visibility + switch */

.simple-only {
  display: none;
}

html.mode-simple .simple-only {
  display: revert;
}

html.mode-simple .pro-only,
html.mode-pro .simple-only {
  display: none !important;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mode-switch button {
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}

.mode-switch button:hover {
  color: var(--ink);
}

.mode-switch button.is-active {
  background: var(--ink);
  color: #fff;
}

.mode-switch button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

html.mode-simple .stats,
html.mode-simple #quota-line,
html.mode-simple .side-filter,
html.mode-simple #source-badge,
html.mode-simple #panels,
html.mode-simple #tab-code,
html.mode-simple #open-preview,
html.mode-simple .lab-tree,
html.mode-simple #open-codesandbox,
html.mode-simple .clock {
  display: none !important;
}

html.mode-simple .deliverables {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

html.mode-simple .lab-body {
  grid-template-columns: minmax(0, 1fr);
}

html.mode-pro .plain-summary,
html.mode-pro .simple-empty {
  display: none !important;
}

/* ==========================================================================
   hero · masthead
   ========================================================================== */

.hero {
  position: relative;
  padding: 54px 0 10px;
}

.hero::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -12px;
  width: min(560px, 70%);
  height: 250px;
  background-image:
    linear-gradient(rgba(16, 42, 67, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 67, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120% 90% at 0% 0%, #000 18%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 0% 0%, #000 18%, transparent 72%);
  pointer-events: none;
}

.eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--blue);
}

.hero h1 {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.grad {
  color: var(--blue);
  background: linear-gradient(transparent 76%, rgba(29, 78, 216, 0.14) 76%);
  background-repeat: no-repeat;
  padding-bottom: 2px;
}

.lede {
  position: relative;
  max-width: 740px;
  margin: 18px 0 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--muted);
}

/* target form */

.target-form {
  position: relative;
  margin-top: 30px;
}

.target-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 920px;
  padding: 7px 7px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.target-shell:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12), var(--shadow-float);
}

.target-shell.is-busy {
  border-color: #9fb6e4;
}

.prompt {
  flex: none;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

#repo-url {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 4px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink);
}

#repo-url::placeholder {
  color: var(--faint);
}

#repo-url:disabled {
  color: var(--muted);
}

.btn-primary {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 10px 20px -14px rgba(29, 78, 216, 0.9);
  transition: background 0.16s, transform 0.12s, box-shadow 0.16s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-deep);
  box-shadow: 0 12px 24px -14px rgba(23, 64, 180, 0.95);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary:disabled {
  background: #8ba6d9;
  cursor: progress;
}

.btn-primary.is-busy .btn-arrow {
  animation: nudge 0.9s var(--ease) infinite alternate;
}

@keyframes nudge {
  from {
    transform: translateX(-2px);
  }
  to {
    transform: translateX(2px);
  }
}

.btn-arrow {
  font-size: 15px;
  line-height: 1;
}

.target-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  max-width: 920px;
  margin-top: 12px;
}

.hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
}

.hint-sep {
  margin: 0 3px;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--body);
}

.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chips-label {
  margin-right: 2px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--body);
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}

.chip:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

/* pipeline */

.quickstart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.qs-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 14px 18px 15px 0;
}

.qs-step + .qs-step {
  padding-left: 18px;
  border-left: 1px solid var(--line-soft);
}

.qs-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border: 1px solid var(--blue-line);
  border-radius: 50%;
  background: var(--blue-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
}

.qs-step b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.qs-step span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  counter-reset: step;
}

.pipeline[hidden] {
  display: none;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: 11px;
  color: var(--faint);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--faint);
}

.step.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.step.is-active::before {
  color: var(--blue);
}

.step.is-done {
  border-color: #c8e6d1;
  background: var(--green-soft);
  color: #1f7a33;
}

.step.is-done::before {
  content: "✓";
  color: var(--green);
}

/* ==========================================================================
   workspace header
   ========================================================================== */

.workspace {
  margin-top: 30px;
}

.workspace-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line);
}

.deliverables {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--blue-line);
  border-radius: 10px;
  background: linear-gradient(100deg, var(--blue-soft), #fbfdff 72%);
  animation: fadeUp 0.35s var(--ease) both;
}

.deliverables[hidden] {
  display: none;
}

.dl-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dl-copy b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.dl-copy span {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.dl-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.btn-package {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 20px -12px rgba(29, 78, 216, 0.7);
  transition: background 0.15s, transform 0.15s;
}

.btn-package:hover {
  background: var(--blue-deep);
  color: #fff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-outline:hover {
  border-color: var(--blue);
  background: var(--surface);
  color: var(--blue);
}

/* simple mode · plain-language project card */

.simple-empty {
  margin-top: 14px;
  padding: 40px 28px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.simple-empty-index {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--blue);
}

.simple-empty h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.simple-empty p {
  max-width: 52ch;
  margin: 10px auto 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
}

.plain-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 30px;
  margin: 0 0 14px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  animation: fadeUp 0.35s var(--ease) both;
}

.plain-summary[hidden] {
  display: none;
}

.plain-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}

.plain-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.plain-desc {
  max-width: 52ch;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--body);
}

.plain-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.plain-tag {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
}

.plain-tag.is-key {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 600;
}

.plain-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding-left: 26px;
  border-left: 1px solid var(--line-soft);
}

.plain-points {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.plain-point {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plain-point b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.plain-point span {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.plain-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.plain-actions .btn-package,
.plain-actions .btn-outline {
  height: 34px;
}

.plain-actions .btn-package {
  padding: 0 13px;
  font-size: 11.5px;
}

.plain-hint {
  margin: -8px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.plain-bridge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
}

.plain-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.plain-switch:hover {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.plain-switch:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}

.ws-title {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
  white-space: nowrap;
}

.ws-title i {
  width: 4px;
  height: 13px;
  border-radius: 2px;
  background: var(--blue);
}

.ws-right {
  margin-left: auto;
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.source-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--blue);
  white-space: nowrap;
}

.source-badge.is-github {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue);
}

.source-badge.is-profile {
  border-color: var(--line);
  background: var(--surface-3);
  color: var(--muted);
}

.source-badge.is-degraded {
  border-color: #f6cfb2;
  background: var(--orange-soft);
  color: #a9470c;
}

.ws-meta {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-meta.is-live {
  color: var(--body);
}

/* ==========================================================================
   panels
   ========================================================================== */

.panels {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  margin-top: 14px;
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease);
}

.panels.is-scanning {
  opacity: 0.55;
  filter: saturate(0.55);
  pointer-events: none;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: clamp(460px, 60vh, 720px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
  z-index: 2;
}

#terminal-panel::before {
  background: #2f5d8a;
}

.panel-head {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 11px 0 13px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.panel-kind {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--blue-line);
  border-radius: 4px;
  background: var(--surface);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.panel-kind.is-code {
  border-color: #cfe3d8;
  color: #1f7a33;
  background: var(--green-soft);
}

.file {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-icon {
  align-self: center;
  font-size: 11px;
  color: var(--blue);
}

.term-icon {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #2f5d8a;
}

.file-ext {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--faint);
}

.panel-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.icon-btn {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--body);
  font-size: 10.5px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.icon-btn:hover:not(:disabled) {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

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

.icon-btn.is-success {
  color: var(--green);
  border-color: #b9dfc4;
  background: var(--green-soft);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ==========================================================================
   report · the dossier
   ========================================================================== */

.md {
  padding: 28px 32px 42px 34px;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--blue);
  font-size: 14px;
  line-height: 1.85;
  color: var(--body);
  overflow-wrap: anywhere;
}

.md > :first-child {
  margin-top: 0;
}

.md h1,
.md h2,
.md h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.4;
}

.md h1 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 21px;
  letter-spacing: -0.02em;
}

.md h1 code {
  font-size: 0.82em;
  vertical-align: 1px;
}

.md h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 30px 0 12px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.md h2::before {
  content: "";
  flex: none;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--blue);
}

.md h3 {
  margin: 22px 0 9px;
  font-size: 13.5px;
}

.md p {
  margin: 0 0 12px;
}

.md strong {
  color: var(--ink);
  font-weight: 600;
}

.md em {
  color: var(--blue);
  font-style: normal;
}

.md del {
  color: var(--faint);
}

.md a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(29, 78, 216, 0.28);
  text-underline-offset: 3px;
}

.md a:hover {
  text-decoration-color: var(--blue);
}

.md code {
  padding: 1px 5px;
  border: 1px solid #dbe6f3;
  border-radius: 4px;
  background: #f0f5fb;
  color: #1740b4;
  font-family: var(--font-mono);
  font-size: 0.85em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.md blockquote {
  margin: 14px 0;
  padding: 11px 15px;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: #f2f6fc;
  color: #3d5e85;
  font-size: 12.5px;
  line-height: 1.85;
}

.md blockquote p {
  margin: 0;
}

.md ul,
.md ol {
  margin: 10px 0 15px;
  padding-left: 20px;
}

.md li {
  margin: 5px 0;
  padding-left: 2px;
}

.md ul li::marker {
  color: var(--blue);
}

.md ol li::marker {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.md hr {
  height: 1px;
  margin: 26px 0;
  border: 0;
  background: var(--line);
}

.md table {
  width: 100%;
  margin: 12px 0 20px;
  border-collapse: collapse;
  font-size: 12.7px;
  line-height: 1.65;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.md thead th {
  padding: 8px 11px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #486581;
  white-space: nowrap;
}

.md tbody td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--body);
  vertical-align: top;
}

.md tbody td:first-child {
  color: var(--ink);
  font-weight: 500;
}

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

.md tbody tr:hover td {
  background: #f7faff;
}

.md td code,
.md th code {
  font-size: 10.5px;
  white-space: normal;
}

.md td[data-sev] {
  width: 54px;
  white-space: nowrap;
}

.md td[data-sev] code {
  white-space: nowrap;
}

.md td[data-sev="HIGH"] code {
  border-color: #f3c2c2;
  background: var(--red-soft);
  color: #b52d2d;
}

.md td[data-sev="MED"] code {
  border-color: #f6cfb2;
  background: var(--orange-soft);
  color: #a9470c;
}

.md td[data-sev="LOW"] code {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue);
}

/* code blocks inside the light report */

.code-wrap {
  position: relative;
  margin: 14px 0 20px;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.code-lang {
  position: absolute;
  top: 0;
  right: 0;
  padding: 3px 9px;
  border-left: 1px solid var(--navy-line);
  border-bottom: 1px solid var(--navy-line);
  border-radius: 0 9px 0 7px;
  background: rgba(255, 255, 255, 0.05);
  color: #8fa6bb;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-wrap pre {
  margin: 0;
  padding: 16px 16px 17px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 11.8px;
  line-height: 1.75;
  color: var(--code-text);
}

.code-wrap code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.md > * {
  animation: fadeUp 0.36s var(--ease) both;
}

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

/* empty state */

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 460px;
  padding: 26px 2px;
}

.empty-index {
  font-family: var(--font-display);
  font-size: 50px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #cdd9e5;
}

.empty-title {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.md .empty-title {
  display: block;
  margin: 12px 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.md .empty-title::before {
  content: none;
}

.empty-copy {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ghost-btn:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

/* ==========================================================================
   terminal · the build script
   ========================================================================== */

.tw-progress {
  position: relative;
  z-index: 3;
  flex: none;
  height: 2px;
  background: rgba(29, 78, 216, 0.1);
  overflow: hidden;
}

.tw-progress i {
  display: block;
  width: 0%;
  height: 100%;
  background: #5b8dff;
  transition: width 0.12s linear;
}

.terminal {
  padding: 16px 18px 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 140px),
    var(--navy);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  font-variant-ligatures: none;
  scrollbar-color: #34506b transparent;
}

.terminal::-webkit-scrollbar-thumb {
  background: #34506b;
  border: 2px solid transparent;
  background-clip: content-box;
}

.t-run {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 5px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: #8ba3b8;
  word-break: break-word;
}

.t-user {
  color: #8fd3ff;
}

.t-sep {
  color: #5b7590;
}

.t-path {
  color: #7dffc4;
}

.t-cmd {
  color: #7dffc4;
}

.t-muted {
  color: #8ba3b8;
}

.t-caret {
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-left: 4px;
  background: #7dffc4;
  opacity: 0.85;
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.t-idle {
  margin: 18px 0 0;
  color: #7f97ab;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.9;
}

.tw-body {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--code-text);
  tab-size: 2;
}

.tw-cursor {
  display: inline-block;
  width: 6.5px;
  height: 13px;
  margin-left: 1px;
  vertical-align: -2px;
  background: #7dffc4;
  animation: blink 1s steps(2, start) infinite;
}

.tw-cursor.is-idle {
  animation: none;
  opacity: 0.45;
}

.t-comment {
  color: #71899e;
  font-style: italic;
}

.t-string {
  color: #ffd479;
}

.t-var {
  color: #8fd3ff;
}

.t-flag {
  color: #c8a8ff;
}

.t-kw {
  color: #ff9ec4;
}

.t-num {
  color: #ffb86b;
}

.t-done {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 10.5px;
  line-height: 1.8;
  color: #8ba3b8;
  word-break: break-word;
}

.t-ok {
  color: #7dffc4;
  font-weight: 600;
}

.t-hash {
  color: #ffd479;
}

/* ==========================================================================
   browser lab · preview and in-browser build
   ========================================================================== */

.browser-lab {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  animation: fadeUp 0.35s var(--ease) both;
}

.lab-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fcfdff, var(--surface-2));
}

.lab-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lab-mark {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--ink);
  color: #9dc0ff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.lab-title-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.lab-title-text b {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.lab-title-text span {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-tabs {
  display: inline-flex;
  flex: none;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lab-tab {
  height: 26px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.lab-tab:hover {
  color: var(--ink);
}

.lab-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.lab-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.lab-stack {
  padding: 3px 8px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 600;
  color: #1f7a33;
  white-space: nowrap;
}

.lab-link {
  font-size: 10.5px;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

.lab-link:hover {
  text-decoration: underline;
}

.lab-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
  font-size: 10.5px;
  color: var(--muted);
}

.lab-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.lab-status.is-busy .lab-dot {
  background: var(--orange);
  animation: labPulse 1.4s ease-in-out infinite;
}

.lab-status.is-ready .lab-dot {
  background: var(--green);
}

.lab-status.is-warn .lab-dot {
  background: var(--orange);
}

.lab-status.is-error .lab-dot {
  background: var(--red);
}

.lab-status.is-error .lab-status-text {
  color: var(--red);
}

.lab-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-retry {
  flex: none;
  margin-left: auto;
  height: 21px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 10px;
  color: var(--body);
}

.lab-retry:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* layout ---------------------------------------------------------------- */

.lab-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: clamp(430px, 56vh, 640px);
}

.lab-body.is-code {
  grid-template-columns: 234px minmax(0, 1fr);
}

.lab-tree {
  display: none;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.lab-body.is-code .lab-tree {
  display: flex;
}

.tree-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.tree-head span:last-child {
  font-family: var(--font-mono);
  letter-spacing: 0;
  font-weight: 400;
}

.tree-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px 5px 18px;
}

.tree-dir,
.tree-file {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--body);
  text-align: left;
  white-space: nowrap;
}

.tree-dir:hover,
.tree-file:hover {
  background: var(--surface-3);
}

.tree-file.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.tree-caret {
  flex: none;
  width: 9px;
  font-size: 8px;
  color: var(--faint);
  transition: transform 0.15s var(--ease);
}

.tree-dir.is-open .tree-caret {
  transform: rotate(90deg);
}

.tree-ext {
  flex: none;
  width: 25px;
  overflow: hidden;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--faint);
  text-align: center;
  text-transform: uppercase;
}

.tree-file .tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-children {
  margin-left: 9px;
  padding-left: 3px;
  border-left: 1px solid var(--line-soft);
}

.lab-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.lab-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* preview pane ---------------------------------------------------------- */

.preview-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.lab-docs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 30px clamp(22px, 5vw, 66px) 54px;
  box-shadow: none;
}

.lab-docs .doc-note {
  margin: 0 0 22px;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
}

.lab-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 40%, rgba(29, 78, 216, 0.035), transparent 62%),
    var(--surface);
  text-align: center;
}

.lab-empty-index {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  color: var(--line);
  letter-spacing: -0.04em;
}

.lab-empty b {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.lab-empty p {
  max-width: 46ch;
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.lab-empty .btn-run {
  margin-top: 10px;
}

/* code pane ------------------------------------------------------------- */

.code-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 34px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.code-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.code-meta {
  flex: none;
  color: var(--faint);
}

.code-view {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 0 26px;
  background: #fbfcfe;
  font-family: var(--font-mono);
  font-size: 11.7px;
  line-height: 1.75;
  color: #243b53;
  tab-size: 2;
}

.code-view .code-hint {
  display: block;
  padding: 26px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

.code-view .cl {
  display: block;
  min-height: 1.75em;
  padding-right: 18px;
  white-space: pre;
}

.code-view .cl > i {
  display: inline-block;
  width: 46px;
  padding-right: 13px;
  color: #aebccb;
  font-style: normal;
  text-align: right;
  user-select: none;
}

.code-view .c-com {
  color: #7c8fa3;
  font-style: italic;
}

.code-view .c-str {
  color: #1c7c4a;
}

.code-view .c-kw {
  color: var(--blue);
  font-weight: 600;
}

.code-view .c-num {
  color: #c2520c;
}

.code-view .c-tag {
  color: #8a4fbf;
}

/* build pane ------------------------------------------------------------ */

.build-copy {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.build-copy-text {
  min-width: 0;
}

.build-copy-text b {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.build-copy-text p {
  max-width: 68ch;
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}

.build-actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-run {
  height: 33px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-run:hover {
  background: #1c3d5c;
}

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

.build-actions .btn-outline {
  height: 33px;
  font-size: 11px;
}

.build-fallback {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--blue-line);
  background: var(--blue-soft);
}

.build-fallback[hidden] {
  display: none;
}

.build-fallback-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.build-fallback-copy b {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.build-fallback-copy span {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.build-fallback-actions {
  flex: none;
  display: flex;
  gap: 6px;
}

.build-fallback-actions .btn-outline {
  height: 30px;
  font-size: 11px;
}

.build-frame-wrap {
  flex: 1;
  min-height: 0;
  background: #0b1b2b;
}

.build-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.build-idle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 32px;
  background: var(--surface-2);
  text-align: center;
}

.build-idle-tag {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
}

.build-idle p {
  max-width: 50ch;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.build-idle-lead {
  color: var(--ink);
}

.build-idle-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 48ch;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.build-idle-list li {
  position: relative;
  padding-left: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.build-idle-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--faint);
}

@keyframes labPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==========================================================================
   footer
   ========================================================================== */

.page-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 30px 0 6px;
  font-size: 11px;
  color: var(--faint);
}

.foot-sep {
  color: var(--line);
}

.foot-right {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
}

/* ==========================================================================
   toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 20px 40px -20px rgba(16, 42, 67, 0.65);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: #a92c2c;
}

/* ==========================================================================
   responsive
   ========================================================================== */

@media (max-width: 1240px) {
  :root {
    --sidebar-w: 280px;
  }

  .main {
    padding-inline: 28px;
  }

  .md {
    padding: 24px 24px 36px 28px;
    font-size: 13.6px;
  }
}

@media (max-width: 1120px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    width: min(320px, 86vw);
    transform: translateX(-102%);
    box-shadow: 0 0 60px rgba(16, 42, 67, 0.24);
    transition: transform 0.28s var(--ease);
  }

  .sidebar.is-open {
    transform: none;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(16, 42, 67, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s var(--ease);
  }

  .sidebar-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn {
    display: flex;
  }

  .main {
    padding-inline: clamp(18px, 4vw, 36px);
  }

  .hero {
    padding-top: 42px;
  }
}

@media (max-width: 900px) {
  .panels {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel {
    height: clamp(400px, 56vh, 600px);
  }

  .panel:first-child {
    height: clamp(460px, 64vh, 680px);
  }

  .lab-body {
    height: clamp(420px, 60vh, 600px);
  }

  .lab-body.is-code {
    grid-template-columns: 208px minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .main {
    padding: 0 16px 26px;
  }

  .topbar {
    height: 52px;
  }

  .crumbs {
    display: none;
  }

  .top-right {
    gap: 8px;
  }

  .clock {
    display: none;
  }

  .plain-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
  }

  .plain-side {
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .simple-empty {
    padding: 30px 20px;
  }

  .pill {
    height: 23px;
    font-size: 10px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero h1 {
    font-size: clamp(27px, 8vw, 34px);
    letter-spacing: -0.03em;
  }

  .lede {
    font-size: 14px;
    margin-top: 14px;
  }

  .target-form {
    margin-top: 22px;
  }

  .target-shell {
    flex-wrap: wrap;
    padding: 8px;
  }

  .prompt {
    margin-left: 2px;
  }

  #repo-url {
    height: 38px;
    flex: 1 1 calc(100% - 52px);
  }

  .btn-primary {
    width: 100%;
    height: 42px;
  }

  .target-meta {
    margin-top: 10px;
  }

  .chips {
    width: 100%;
  }

  .quickstart {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 18px;
  }

  .qs-step {
    padding: 11px 0;
  }

  .qs-step + .qs-step {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .deliverables {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dl-actions {
    flex-wrap: wrap;
  }

  .btn-package {
    flex: 1 1 auto;
  }

  .workspace {
    margin-top: 24px;
  }

  .workspace-head {
    align-items: flex-start;
    gap: 8px;
  }

  .ws-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .ws-meta {
    max-width: 48vw;
  }

  .panel {
    height: clamp(380px, 58vh, 560px);
  }

  .lab-head {
    flex-wrap: wrap;
    gap: 9px;
  }

  .lab-title-text b {
    font-size: 12.5px;
    white-space: normal;
  }

  .lab-tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .lab-tab {
    flex: 1;
    padding: 0 7px;
  }

  .lab-actions {
    margin-left: auto;
  }

  .lab-stack {
    max-width: 36vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lab-body {
    height: 490px;
  }

  .lab-body.is-code {
    grid-template-columns: 1fr;
    grid-template-rows: 168px minmax(0, 1fr);
  }

  .lab-tree {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lab-docs {
    padding: 20px 18px 36px;
  }

  .lab-empty {
    padding: 20px;
  }

  .lab-status {
    align-items: flex-start;
  }

  .lab-status-text {
    white-space: normal;
  }

  .build-copy {
    flex-direction: column;
    gap: 9px;
  }

  .build-actions {
    justify-content: flex-start;
  }

  .build-fallback {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .build-fallback-actions {
    flex-wrap: wrap;
  }

  .build-idle {
    padding: 22px;
  }

  .panel-actions {
    gap: 4px;
  }

  .icon-btn {
    padding: 0 7px;
  }

  .md {
    padding: 20px 18px 30px 22px;
    font-size: 13.4px;
    line-height: 1.8;
  }

  .md h1 {
    font-size: 18px;
  }

  .md h2 {
    font-size: 14px;
    margin-top: 24px;
  }

  .md table {
    font-size: 12px;
  }

  .terminal {
    font-size: 11.5px;
    padding: 14px 14px 24px;
  }

  .page-foot {
    padding-top: 24px;
  }

  .toast {
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .brand {
    padding-bottom: 14px;
  }

  .stat {
    padding: 9px 8px;
  }

  .stat b {
    font-size: 15px;
  }

  .file-ext {
    display: none;
  }

  .panel-kind {
    display: none;
  }

  .ws-title {
    letter-spacing: 0.08em;
  }

  .empty-index {
    font-size: 40px;
  }
}

/* ==========================================================================
   account system · header menu, favorites, auth pages
   ========================================================================== */

.user-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.user-chip:hover {
  border-color: var(--blue-line);
  box-shadow: 0 6px 16px -12px rgba(16, 42, 67, 0.5);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-logout-btn {
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.user-logout-btn:hover {
  color: var(--red);
  background: var(--red-soft);
}

.fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.fav-btn:hover {
  color: var(--blue);
  border-color: var(--blue-line);
}

.fav-btn.is-on {
  color: #9a6b00;
  border-color: #e9d18b;
  background: #fff9e8;
}

.side-filter {
  display: flex;
  gap: 6px;
}

.side-filter select {
  flex: 1;
  min-width: 0;
}

.fav-filter {
  flex: none;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.fav-filter:hover {
  color: var(--blue);
  border-color: var(--blue-line);
}

.fav-filter.is-on {
  color: #9a6b00;
  border-color: #e9d18b;
  background: #fff9e8;
}

.hist-fav {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--faint);
  font-size: 14px;
  line-height: 1;
  opacity: 0.55;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.hist-fav:hover,
.hist-fav:focus-visible {
  opacity: 1;
  color: #9a6b00;
  background: #fff9e8;
}

.hist-fav.is-on {
  opacity: 1;
  color: #b58500;
}

.hist-item:hover .hist-fav {
  opacity: 1;
}

.hist-name.is-custom {
  font-weight: 600;
  color: var(--ink);
}

.auth-field textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.auth-field textarea:hover {
  border-color: #c3d0de;
}

.auth-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* --------------------------------------------------------------------------
   collection library
   -------------------------------------------------------------------------- */

.collection-count {
  display: grid;
  place-items: center;
  flex: none;
  width: 92px;
  height: 92px;
  border: 1px solid var(--blue-line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.collection-count b {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
}

.collection-count span {
  font-size: 11px;
  color: var(--muted);
}

.collection-list {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.collection-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.collection-card::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue-line);
}

.collection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.collection-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.collection-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.collection-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.collection-repo {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.collection-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.account-link.is-quiet {
  color: var(--muted);
  font-weight: 500;
}

.collection-note {
  margin: 14px 0 4px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
  color: var(--body);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.collection-note.is-muted {
  color: var(--muted);
  font-style: italic;
}

.collection-form {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 12px 16px;
  margin-top: 16px;
}

.collection-buttons {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-submit.is-inline {
  justify-content: center;
  width: auto;
  min-width: 96px;
  height: 36px;
  margin: 0;
  padding: 0 18px;
  font-size: 13px;
}

.collection-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}

.collection-remove {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.collection-remove button {
  padding: 4px 0;
  color: var(--faint);
  font-size: 11.5px;
  transition: color 0.16s var(--ease);
}

.collection-remove button:hover {
  color: var(--red);
}

.collection-empty {
  margin-top: 26px;
  padding: clamp(30px, 5vw, 56px);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
}

.collection-empty h2 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
}

.collection-empty p {
  max-width: 44ch;
  margin: 0 auto 20px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   auth / sign-in
   -------------------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  background: var(--paper);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(380px, 1.14fr);
  min-height: 100vh;
}

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: clamp(28px, 4.2vw, 64px);
  background:
    linear-gradient(rgba(216, 228, 238, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 228, 238, 0.055) 1px, transparent 1px),
    var(--navy);
  background-size: 38px 38px, 38px 38px, auto;
  color: #d8e4ee;
  overflow: hidden;
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: auto -140px -180px auto;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(120, 160, 220, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  width: fit-content;
}

.auth-brand .logo-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(216, 228, 238, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.auth-brand .logo-cursor {
  color: #7aa2f7;
}

.auth-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.auth-brand-text b {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.06em;
  color: #fff;
}

.auth-brand-text span {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #8aa2b8;
  text-transform: uppercase;
}

.auth-thesis {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.auth-eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #7aa2f7;
}

.auth-thesis h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: #f4f8fc;
}

.auth-thesis h1 .grad {
  color: #8fb4ff;
}

.auth-lede {
  max-width: 36ch;
  margin: 20px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: #a9bdd0;
}

.auth-points {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
  border-top: 1px solid rgba(216, 228, 238, 0.14);
}

.auth-points li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: #b9cada;
}

.auth-points li span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #7aa2f7;
}

.auth-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  color: #8aa2b8;
}

.auth-foot a {
  color: #9fc0ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(159, 192, 255, 0.35);
}

.auth-foot a:hover {
  border-bottom-color: #9fc0ff;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px) clamp(22px, 5vw, 80px);
  background:
    radial-gradient(circle at 88% 8%, rgba(29, 78, 216, 0.06), transparent 42%),
    var(--paper);
}

.auth-card {
  position: relative;
  width: min(440px, 100%);
  padding: clamp(26px, 3.6vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
}

.auth-card-head {
  margin-bottom: 24px;
}

.auth-card-index {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 9px;
  border: 1px solid var(--blue-line);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.auth-card-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.auth-card-head p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.auth-flash {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 13px;
}

.auth-flash.is-error {
  border-color: #f3c9c9;
  background: var(--red-soft);
  color: #a92f2f;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form.is-compact {
  gap: 13px;
}

.auth-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.auth-field > span:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.auth-field em {
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  color: var(--faint);
}

.auth-field small {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.auth-field input:hover {
  border-color: #c3d0de;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.auth-input-wrap {
  position: relative;
  display: block;
}

.auth-input-wrap input {
  padding-right: 62px;
}

.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.auth-eye:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auth-code-btn {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.auth-code-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.auth-code-btn:disabled {
  color: var(--faint);
  cursor: default;
}

.auth-code-status {
  min-height: 18px;
  font-size: 11.5px;
  color: var(--muted);
}

.auth-code-status.is-error {
  color: #a92f2f;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 44px;
  margin-top: 4px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}

.auth-submit:hover {
  background: #14324e;
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -3px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.auth-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}

.auth-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue-deep);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-flash.is-ok {
  border-color: #bfe3cd;
  background: #eef8f1;
  color: #1e6b3a;
}

.auth-note {
  margin: -8px 0 18px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.auth-submit.is-link {
  width: 100%;
  justify-content: center;
  text-decoration: none;
}

.auth-legal {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   account center
   -------------------------------------------------------------------------- */

.account-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(29, 78, 216, 0.07), transparent 38%),
    var(--paper);
}

.account-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.account-top .auth-brand-text b {
  color: var(--ink);
}

.account-top .auth-brand-text span {
  color: var(--muted);
}

.account-top .auth-brand .logo-mark {
  border-color: var(--line);
  background: var(--navy);
  color: #fff;
}

.account-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-nav .btn-outline {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
}

.account-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4.4vw, 56px) clamp(20px, 4vw, 48px) 56px;
}

.account-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.account-hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.account-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.account-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  box-shadow: var(--shadow-float);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.account-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.account-card.is-usage {
  background: linear-gradient(160deg, #ffffff 0%, #f7faff 100%);
  border-color: var(--blue-line);
}

.account-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-number {
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.account-number small {
  font-size: 18px;
  font-weight: 500;
  color: var(--faint);
}

.account-card p {
  margin: 8px 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.account-link {
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue-deep);
  text-decoration: none;
}

.account-link:hover {
  text-decoration: underline;
}

.usage-bar {
  height: 7px;
  margin: 6px 0 4px;
  border-radius: 999px;
  background: var(--blue-soft);
  overflow: hidden;
}

.usage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4d7cf0);
}

.account-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.account-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.account-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.account-note {
  font-size: 11px;
  color: var(--faint);
}

.favorite-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.favorite-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--body);
  text-decoration: none;
  transition: background 0.16s var(--ease);
}

.favorite-list a:hover {
  background: var(--surface-2);
}

.favorite-name {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.favorite-name b {
  color: var(--ink);
}

.favorite-meta {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}

.account-empty {
  margin: 0;
  padding: 16px 8px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.account-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--faint);
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    gap: 26px;
    padding: 26px 22px 30px;
  }

  .auth-aside::after {
    display: none;
  }

  .auth-thesis {
    margin-top: 8px;
  }

  .auth-thesis h1 {
    font-size: clamp(30px, 8vw, 42px);
  }

  .auth-points {
    display: none;
  }

  .auth-panel {
    padding: 26px 18px 44px;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-card {
    min-height: 0;
  }

  .account-columns {
    grid-template-columns: 1fr;
  }

  .collection-form {
    grid-template-columns: 1fr;
  }

  .collection-head {
    flex-direction: column;
    gap: 10px;
  }

  .collection-actions {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .user-name {
    display: none;
  }

  .user-menu {
    padding-left: 8px;
  }

  .user-logout-btn {
    padding: 5px 4px;
  }

  .clock {
    display: none;
  }

  .account-top {
    flex-wrap: wrap;
  }

  .account-hero {
    align-items: center;
  }

  .account-badge {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 22px;
  }

  .account-foot {
    flex-direction: column;
  }
}

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