/* ============================================================
   BookXchange Book Intelligence — design system
   Premium black + gold brand
   ------------------------------------------------------------ */

:root {
  /* ----- Brand tokens (gold foil) ----- */
  --gold:        #C9A961;
  --gold-deep:   #8B6F2E;
  --gold-light:  #E5C77A;
  --gold-pale:   #F4DBA0;
  --gold-soft:   #fdf7e8;          /* tinted cream surface */
  --gold-line:   linear-gradient(90deg, transparent 0%, #C9A961 25%, #E5C77A 50%, #C9A961 75%, transparent 100%);
  --gold-grad:   linear-gradient(180deg, #F0D88B 0%, #C9A961 50%, #7A5F26 100%);
  --gold-grad-h: linear-gradient(135deg, #E5C77A 0%, #C9A961 45%, #A78848 100%);

  /* ----- Brand tokens (silver foil) — the second metal of the two-tone identity ----- */
  --silver:        #C0C5CC;
  --silver-deep:   #8B9099;
  --silver-light:  #E8EBEE;
  --silver-pale:   #F2F4F6;
  --silver-soft:   #f1f3f5;
  --silver-line:   linear-gradient(90deg, transparent 0%, #C0C5CC 25%, #E8EBEE 50%, #C0C5CC 75%, transparent 100%);
  --silver-grad:   linear-gradient(180deg, #F2F4F6 0%, #C0C5CC 50%, #8B9099 100%);

  /* ----- Dark surface tokens (black) ----- */
  --black:       #0a0a0a;
  --black-2:     #111111;
  --black-3:     #1a1a1a;
  --black-hair:  #2a2418;           /* subtle warm hairline on dark */
  --dark-text:   #f5f0e6;           /* warm off-white text on black */
  --dark-text-2: #c8bfa9;           /* secondary warm grey on black */
  --dark-muted:  #8c8470;

  /* ----- Light surface tokens ----- */
  --bg:          #faf8f3;            /* off-cream page background */
  --surface:     #ffffff;
  --surface-2:   #f5f1e8;            /* warm light surface */
  --border:      #e8e1d2;            /* warm border */
  --border-2:    #ddd3bd;
  --text:        #1a1814;
  --text-2:      #4a443a;
  --muted:       #847b68;

  /* Semantic */
  --brand:       var(--gold);
  --brand-hover: var(--gold-deep);
  --brand-soft:  var(--gold-soft);
  --accent:      #1f7a5a;            /* deep emerald — works with gold */
  --accent-soft: #e6f4ee;
  --warn:        #b8731a;
  --warn-soft:   #fdf2d8;
  --danger:      #b91c1c;
  --danger-soft: #fde8e8;
  --purple:      #6b46c1;

  --shadow-sm: 0 1px 2px rgba(20,16,8,.06), 0 1px 3px rgba(20,16,8,.04);
  --shadow:    0 4px 6px -1px rgba(20,16,8,.08), 0 2px 4px -2px rgba(20,16,8,.05);
  --shadow-lg: 0 20px 25px -5px rgba(20,16,8,.10), 0 8px 10px -6px rgba(20,16,8,.06);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.45);
  --shadow-gold: 0 4px 12px rgba(201,169,97,.25);

  --radius-sm: .375rem;
  --radius:    .5rem;
  --radius-lg: .75rem;
  --radius-xl: 1rem;

  --font:       'Inter', 'Heebo', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  --font-serif: 'Cormorant Garamond', 'Playfair Display', 'Bodoni Moda', Georgia, 'Times New Roman', serif;
  --font-mono:  "SF Mono", "Monaco", "JetBrains Mono", "Roboto Mono", "Fira Code", monospace;

  --sidebar-width: 240px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -.015em;
}

/* ----- Layout shell -------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 60%, #0a0a0a 100%);
  color: var(--dark-text-2);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 1.25rem 0;
  border-right: 1px solid var(--black-hair);
  position: relative;
}
/* Vertical gold hairline accent on inner edge */
.sidebar::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(201,169,97,.4) 12%, rgba(201,169,97,.5) 50%, rgba(201,169,97,.4) 88%, transparent 100%);
}

.brand {
  display: flex; align-items: center; justify-content: center;
  padding: .5rem 1rem 1.5rem;
  font-weight: 700; font-size: 1.05rem;
  color: var(--dark-text);
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand img {
  width: auto;
  max-width: 100%;
  display: block;
}
/* In the sidebar specifically the logo should be sized to dominate */
.sidebar .brand img {
  height: 56px;
  max-width: 200px;
}
.brand-sub {
  display: block; font-weight: 400; font-size: .72rem;
  color: var(--gold);
  letter-spacing: .14em; text-transform: uppercase; margin-top: 1px;
}

.nav { padding: 0 .75rem; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem;
  margin: .15rem 0;
  color: var(--dark-text-2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
  border-left: 2px solid transparent;
}
.nav a:hover {
  background: rgba(201,169,97,.07);
  color: var(--dark-text);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(201,169,97,.15) 0%, rgba(201,169,97,.03) 100%);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.nav-icon { width: 18px; height: 18px; opacity: .85; }
.nav a.active .nav-icon { opacity: 1; color: var(--gold); }
.nav-section {
  font-size: .68rem; text-transform: uppercase;
  color: var(--gold);
  padding: 1.25rem .75rem .35rem;
  letter-spacing: .12em; font-weight: 700;
  opacity: .8;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(201,169,97,.18);
  font-size: .82rem;
  color: var(--dark-text-2);
}
.sidebar-footer .who { color: var(--dark-text); font-weight: 500; }
.sidebar-footer form { margin-top: .5rem; }
.sidebar-footer button {
  width: 100%;
  background: transparent;
  color: var(--dark-text);
  border: 1px solid rgba(201,169,97,.4);
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  letter-spacing: .02em;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.sidebar-footer button:hover {
  background: rgba(201,169,97,.12);
  border-color: var(--gold);
  color: var(--gold-light);
}
.sidebar-footer a { color: var(--gold) !important; }

/* ----- Content area -------------------------------------- */

.main { padding: 1.75rem 2.25rem 4rem; max-width: 1400px; }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-header::after {
  content: "";
  position: absolute; left: 0; bottom: -1px;
  width: 80px; height: 2px;
  background: var(--gold-grad);
}
.page-header h1 {
  font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; margin: 0;
  color: var(--text);
}
.page-header .subtitle { color: var(--muted); margin-top: .35rem; font-size: .92rem; }

/* ----- Buttons ------------------------------------------- */

.btn, button.primary, button[type=submit] {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(180deg, #D4B36B 0%, #C9A961 50%, #A78848 100%);
  color: #1a1408;
  border: 1px solid #A78848;
  padding: .55rem 1.1rem;
  font-family: inherit; font-size: .9rem; font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: filter .15s, transform .05s, box-shadow .15s;
}
.btn:hover, button.primary:hover, button[type=submit]:hover {
  filter: brightness(1.07);
  box-shadow: var(--shadow-gold);
}
.btn:active, button:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-2);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--gold); }
.btn.danger { background: var(--danger); color: #fff; border-color: #991b1b; }
.btn.danger:hover { background: #dc2626; filter: none; }

/* ----- Cards --------------------------------------------- */

.card, .form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  font-size: 1.05rem; margin: 0 0 1rem;
  color: var(--text); font-weight: 700; letter-spacing: -.005em;
  display: flex; align-items: center;
}
.card h2::before {
  content: "";
  display: inline-block;
  width: 3px; height: 1em;
  background: var(--gold-grad);
  margin-right: .65em;
  border-radius: 2px;
}

/* ----- Forms --------------------------------------------- */

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 0 0 1rem;
  background: var(--surface);
}
legend {
  font-weight: 700; padding: 0 .5rem; color: var(--text);
  font-size: .82rem; text-transform: uppercase; letter-spacing: .06em;
}
label { display: block; margin: .55rem 0; color: var(--text-2); font-size: .88rem; font-weight: 500; }
label.check, label.radio { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.checkrow { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  display: block; width: 100%;
  padding: .55rem .7rem;
  font-family: inherit; font-size: .9rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
  margin-top: .25rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.22);
}
input[type=file] { padding: .35rem; background: var(--surface-2); }
small.muted { color: var(--muted); font-size: .8rem; display: block; margin-top: .35rem; }

.estimate-card {
  background: linear-gradient(135deg, #fdf7e8 0%, #f4dba0 100%);
  border-color: var(--gold);
}

/* ----- Tables -------------------------------------------- */

table.runs, table.kv {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
table.runs thead th {
  background: var(--surface-2);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); font-weight: 700;
  padding: .7rem .95rem; text-align: left;
  border-bottom: 1px solid var(--border-2);
}
table.runs td {
  padding: .8rem .95rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.runs tbody tr:last-child td { border-bottom: 0; }
table.runs tbody tr:hover { background: var(--surface-2); }
table.runs td a { color: var(--gold-deep); text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent; transition: border-color .15s; }
table.runs td a:hover { border-bottom-color: var(--gold); }
table.runs code { font-family: var(--font-mono); font-size: .82rem; color: var(--text); background: var(--surface-2); padding: .15rem .4rem; border-radius: .25rem; }

/* ----- Badges & status ----------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .65rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.badge.pending  { background: var(--warn-soft); color: #92400e; }
.badge.running  { background: rgba(201,169,97,.18); color: #6b5418; position: relative; }
.badge.running::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-deep); display: inline-block;
  animation: pulse 1.4s ease-in-out infinite;
}
.badge.done     { background: var(--accent-soft); color: #14532d; }
.badge.failed   { background: var(--danger-soft); color: #991b1b; }
.badge.cancelled{ background: #f3f0e7; color: #5a523f; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

/* ----- Progress bar -------------------------------------- */

.bar { background: var(--surface-2); height: 8px; border-radius: 999px; overflow: hidden; min-width: 140px; }
.fill {
  height: 100%;
  background: linear-gradient(90deg, #8B6F2E 0%, #C9A961 50%, #E5C77A 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s linear infinite;
  transition: width .3s;
}
@keyframes shimmer { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

/* ----- Credit counters (run detail) ---------------------- */

.credits .cred-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.cred-cell {
  background: linear-gradient(135deg, rgba(201,169,97,.10) 0%, rgba(229,199,122,.05) 100%);
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform .15s, box-shadow .15s;
}
.cred-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.cred-label {
  color: var(--muted); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}
.cred-value {
  font-size: 2.4rem; font-weight: 700; color: var(--text);
  line-height: 1.1; margin-top: .4rem;
  font-feature-settings: "tnum";
}
.cred-sub { font-size: .78rem; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* =========================================================
   MOBILE TOPBAR + HAMBURGER
   ========================================================= */

.topbar {
  display: none;
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
  color: var(--dark-text);
  padding: 0 .75rem;
  align-items: center; gap: .75rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.5);
  border-bottom: 1px solid rgba(201,169,97,.35);
}
.topbar-brand {
  display: flex; align-items: center; gap: .5rem;
  color: var(--dark-text); text-decoration: none;
  font-weight: 600; font-size: 1rem;
  flex: 1; min-width: 0;
}
.topbar-brand img { display: block; }
.topbar-brand span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: .9rem;
}
.topbar-spacer { flex-shrink: 0; }
.hamburger {
  background: transparent; border: 0; color: var(--gold);
  padding: .5rem; cursor: pointer; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
}
.hamburger:active { background: rgba(201,169,97,.18); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 90;
  opacity: 0; transition: opacity .2s;
}
body.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }

/* =========================================================
   TABLET / MOBILE  (≤ 1024px)
   ========================================================= */

@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .main { padding: 1.25rem 1.25rem 3rem; }
  .credits .cred-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .sidebar .brand img { height: 44px; }
}

/* =========================================================
   PHONE-SIZE  (≤ 768px)
   ========================================================= */

@media (max-width: 768px) {
  body { font-size: 15px; }
  .topbar { display: flex; }
  .app-shell { display: block; min-height: calc(100vh - var(--topbar-h)); }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: min(82vw, 320px);
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,.55);
    flex-direction: column;
    padding: 1rem 0;
    overflow-y: auto;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  .sidebar .brand { display: none; }
  .nav { padding: .25rem .75rem; flex: 1; }
  .nav a { padding: .8rem .85rem; font-size: 1rem; min-height: 44px; }
  .nav-section { display: block; padding: 1rem .85rem .35rem; }
  .sidebar-footer { padding: 1rem 1.25rem; }
  .sidebar-footer button { min-height: 44px; font-size: .95rem; }

  .main { padding: 1rem .85rem 3rem; max-width: 100%; }
  .page-header {
    flex-direction: column; align-items: flex-start;
    gap: .5rem; margin-bottom: 1rem;
  }
  .page-header h1 { font-size: 1.4rem; }

  .form-card, .card { padding: 1rem 1rem; border-radius: var(--radius); }
  fieldset { padding: .85rem 1rem; }
  input[type=text], input[type=email], input[type=password], input[type=number],
  input[type=date], select, textarea {
    font-size: 16px;
    padding: .75rem .8rem;
    min-height: 44px;
  }
  textarea { min-height: 100px; }
  label { font-size: .95rem; margin: .65rem 0 .25rem; }
  label.check, label.radio { padding: .3rem 0; }
  .checkrow { gap: .5rem; }
  .checkrow label.check { flex: 1 1 calc(50% - .5rem); }

  .btn, button.primary, button[type=submit] {
    padding: .8rem 1.15rem;
    font-size: 1rem;
    min-height: 44px;
  }
  .form-card button[type=submit] {
    width: 100%; justify-content: center;
  }

  .card table.data, .card table.runs, .card table.kv,
  .card .table-scroll {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  table.runs, table.data, table.kv {
    font-size: .85rem;
    min-width: 600px;
  }
  table.runs td, table.data td, table.kv td,
  table.runs th, table.data th, table.kv th {
    white-space: nowrap;
    padding: .55rem .65rem;
  }
  table.runs td:first-child, table.runs th:first-child,
  table.data td:first-child, table.data th:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  table.runs thead th:first-child, table.data thead th:first-child {
    background: var(--surface-2);
  }

  .credits .cred-grid { grid-template-columns: 1fr; gap: .65rem; }
  .cred-cell { padding: .9rem 1rem; }
  .cred-value { font-size: 1.85rem; }

  canvas { max-width: 100% !important; height: auto !important; }
  .bar { min-width: 0; width: 100%; }

  .login-card {
    width: calc(100% - 2rem);
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  html, body { overflow-x: hidden; }
}

@media (max-width: 414px) {
  .page-header h1 { font-size: 1.25rem; }
  .cred-value { font-size: 1.6rem; }
  .card h2 { font-size: .98rem; }
  .topbar-brand span { font-size: .85rem; }
  table.runs, table.data, table.kv { min-width: 500px; font-size: .8rem; }
}

@media (max-width: 360px) {
  .main { padding: .85rem .65rem 2.5rem; }
  .card, .form-card { padding: .85rem .85rem; }
  .cred-value { font-size: 1.45rem; }
}

@media (hover: none) {
  .cred-cell:hover { transform: none; box-shadow: none; }
  table.runs tbody tr:hover, table.data tbody tr:hover { background: transparent; }
}

/* ----- Misc ---------------------------------------------- */

.empty {
  color: var(--muted); padding: 2.5rem; text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-2);
}
.error   { background: var(--danger-soft); color: #991b1b; padding: .85rem 1.1rem; border-radius: var(--radius); border-left: 4px solid var(--danger); margin-bottom: 1rem; }
.success { background: var(--accent-soft); color: #14532d; padding: .85rem 1.1rem; border-radius: var(--radius); border-left: 4px solid var(--accent); margin-bottom: 1rem; }
.warn    { background: var(--warn-soft); color: #6b5418; padding: .85rem 1.1rem; border-radius: var(--radius); border-left: 4px solid var(--gold); margin-bottom: 1rem; }
pre {
  background: var(--black); color: #e8e1d2;
  padding: .95rem 1.15rem; border-radius: var(--radius);
  overflow-x: auto; max-height: 400px;
  font-family: var(--font-mono); font-size: .82rem; line-height: 1.55;
  border-left: 3px solid var(--gold);
}
code {
  font-family: var(--font-mono); font-size: .85em;
  background: var(--surface-2); padding: .14rem .4rem;
  border-radius: .25rem; color: var(--text);
}

a { color: var(--gold-deep); }
a:hover { color: var(--gold); }

/* ----- Login (full-bleed) -------------------------------- */

.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(ellipse at 30% 20%, #1a1408 0%, #0a0a0a 50%, #000000 100%) fixed;
  position: relative; overflow: hidden;
  color: var(--dark-text);
}
/* Subtle gold glow accents (very low opacity) */
.login-body::before, .login-body::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(110px); pointer-events: none;
}
.login-body::before { width: 520px; height: 520px; background: rgba(201,169,97,.22); top: -160px; left: -110px; }
.login-body::after  { width: 420px; height: 420px; background: rgba(139,111,46,.28); bottom: -100px; right: -60px; }

/* Decorative gold frame corners on the login page */
.login-body .frame-corner {
  position: absolute; width: 28px; height: 28px;
  border: 1.5px solid var(--gold); opacity: .55; pointer-events: none;
}
.login-body .frame-corner.tl { top: 18px; left: 18px;  border-right: 0; border-bottom: 0; }
.login-body .frame-corner.tr { top: 18px; right: 18px; border-left: 0;  border-bottom: 0; }
.login-body .frame-corner.bl { bottom: 18px; left: 18px;  border-right: 0; border-top: 0; }
.login-body .frame-corner.br { bottom: 18px; right: 18px; border-left: 0;  border-top: 0; }

.login-card {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, #111111 0%, #0a0a0a 100%);
  padding: 2.75rem 2.25rem 2.25rem;
  border-radius: var(--radius-xl);
  width: 420px; max-width: calc(100% - 2rem);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(201,169,97,.35);
  color: var(--dark-text);
}
.login-card::before {
  /* gold hairline trim along the top */
  content: ""; position: absolute; top: -1px; left: 8%; right: 8%;
  height: 1px; background: var(--gold-line);
}
.login-card .brand {
  padding: 0 0 1.25rem;
  border-bottom: 1px solid rgba(201,169,97,.18);
  margin-bottom: 1.5rem;
  justify-content: center;
}
.login-card .brand img {
  height: 88px;       /* desktop: large */
  width: auto;
  display: block;
  margin: 0 auto;
}
.login-card h1 { display: none; }
.login-card label { font-weight: 500; color: var(--dark-text-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.login-card input {
  background: rgba(255,255,255,.04);
  color: var(--dark-text);
  border: 1px solid rgba(201,169,97,.3);
}
.login-card input::placeholder { color: var(--dark-muted); }
.login-card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.18);
  background: rgba(255,255,255,.06);
}
.login-card button[type=submit] {
  width: 100%; justify-content: center;
  padding: .8rem; font-size: .95rem;
  margin-top: .85rem;
  letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
}
.login-card .muted {
  text-align: center; margin-top: 1.5rem;
  color: var(--dark-muted); font-size: .82rem;
}
.login-card .error {
  background: rgba(185,28,28,.18); color: #fecaca;
  border-left-color: #ef4444;
}

@media (min-width: 769px) {
  .login-card .brand img { height: 112px; }   /* ≥ 280px wide due to wide aspect */
}

/* ----- Run-detail download CTA --------------------------- */
.card.success-card {
  background: linear-gradient(135deg, var(--accent-soft), #ecfdf5);
  border-color: #86efac;
}

/* ----- Help / Manual styles applied via .docs-* — see help.html -- */
