/*
 * Grafatsuki — xAI theme (getdesign.md/x.ai). Loaded after garden.css when GRAFATSUKI_THEME=xai.
 * Near-black canvas, white type at weight 400, translucent-white pills, 8px hairline cards, no shadows.
 * Signal colours stay readable inside the brand's own palette:
 *   calm = mid grey, warning = sunset soft, error = sunset, good = breeze, deploys/jobs = twilight.
 */
:root {
  --paper: #0a0a0a; --paper-2: #0f1012; --card: #141517;
  --ink: #ffffff; --ink-soft: #dadbdf; --muted: #7d8187; --faint: #5d6167;
  --line: #212327; --line-2: #2c2f34; --pill-line: rgba(255,255,255,.25);

  /* the green scale, inverted for a dark canvas: low = surfaces, high = ink */
  --g50: #1a1c20; --g100: #212327; --g200: #363a3f; --g300: #4a4f55; --g400: #a0c3ec; --g500: #a0c3ec;
  --g600: #dadbdf; --g700: #ffffff; --g800: #ffffff; --g900: #050505;
  /* marigold → sunset soft (warnings) */
  --gold50: #1f160d; --gold100: #2a1c0f; --gold300: #ffc285; --gold400: #ffc285; --gold500: #ffc285; --gold700: #ffc285;
  /* terracotta → sunset (errors) */
  --t50: #1f130a; --t100: #2b190c; --t300: #8a4a1c; --t400: #ff7a17; --t500: #ff7a17; --t600: #ff9a4d; --t700: #ffc285;
  --fire: #ff7a17;

  --shadow: none; --shadow-lift: none;
  --radius: 8px;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
html, body { background: var(--paper); color: var(--ink-soft); font-weight: 400; }
body::before { display: none; }
::selection { background: rgba(255,255,255,.22); }
a { color: var(--ink); }
a:hover { color: var(--ink-soft); }

/* Type: weight 400 everywhere, tight negative tracking on display sizes, mono caps for labels */
h1, h2, h3, .display { font-weight: 400; color: var(--ink); }
h1 { font-size: 2.4rem; letter-spacing: -.04em; line-height: 1.05; }
h2 { letter-spacing: -.02em; }
h3 { letter-spacing: -.01em; }
b, strong { font-weight: 500; }
.nav-label, .stat .label, table.t th, .plot .nums span, .issue .hits small, .eyebrow, .kind, label.caps {
  font-family: var(--mono); font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { color: var(--muted); font-size: .72rem; }

/* Shell */
.shell { background: none; }
.side { background: var(--paper); border-right: 1px solid var(--line); }
.brand { color: var(--ink); }
.brand-name { font-family: var(--display); font-weight: 400; letter-spacing: -.04em; }
.brand-name em { color: var(--ink); font-style: normal; font-weight: 400; opacity: .55; }
.nav-label { color: var(--faint); font-size: .64rem; }
.nav-item { font-weight: 400; color: var(--muted); border-radius: 999px; }
.nav-item .ico { color: var(--muted); }
.nav-item:hover { background: var(--g50); color: var(--ink); }
.nav-item.active { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--pill-line); }
.nav-item.active .ico, .nav-item:hover .ico { color: var(--ink); }
.nav-item .count { background: transparent; color: var(--t500); border: 1px solid rgba(255,122,23,.45); font-family: var(--mono); font-weight: 400; }
.side-foot { border-top: 1px solid var(--line); }
.topbar .crumbs, .topbar .crumbs a { font-weight: 400; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mobile-bar { background: var(--paper); }

/* Cards: tight 8px rectangles, hairline, no shadow */
.card, .bed, .logs, .wf, .faq-item, .ct-direct, .type-pick a, .msg-body { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.bed { background: var(--paper-2); }
.card-head h2, .card-head h3 { font-weight: 400; }

/* Stats */
.stat .label { color: var(--muted); font-size: .66rem; }
.stat .value { font-weight: 400; letter-spacing: -.04em; color: var(--ink); }
.stat .stat-ico, .stat.terra .stat-ico, .stat.gold .stat-ico { background: transparent; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.stat.terra .stat-ico { color: var(--t500); border-color: rgba(255,122,23,.35); }
.stat.gold .stat-ico { color: var(--gold500); border-color: rgba(255,194,133,.35); }
.stat .delta { font-weight: 400; font-family: var(--mono); font-size: .72rem; }

/* Buttons: every interactive thing is a pill; white fill only for the primary action */
.btn { font-weight: 400; letter-spacing: 0; font-size: .86rem; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { transform: none; }
.btn-primary, .btn-primary:hover { background: #fff; color: #0a0a0a; border-color: #fff; box-shadow: none; }
.btn-primary:hover { background: #fafaf7; }
.btn-ghost, .btn-gold, .google-btn { background: transparent; color: var(--ink); border-color: var(--pill-line); }
.btn-ghost:hover, .btn-gold:hover { background: var(--g50); color: var(--ink); border-color: rgba(255,255,255,.45); }
.btn-danger { background: transparent; color: var(--t500); border-color: rgba(255,122,23,.5); }

/* Forms */
label { font-weight: 400; color: var(--ink-soft); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=tel], input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=week], select, textarea, .query-box {
  background: var(--g50); border-color: var(--line); border-radius: 8px; color: var(--ink); font-weight: 400; color-scheme: dark; }
input:focus, select:focus, textarea:focus, .query-box:focus { border-color: rgba(255,255,255,.5); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.check { font-weight: 400; } .check input { accent-color: #fff; }
.flash { background: transparent; border-color: var(--pill-line); color: var(--ink); border-radius: 8px; font-weight: 400; }
.flash.bad { border-color: rgba(255,122,23,.45); color: var(--t500); }
.seg { background: transparent; border-color: var(--line-2); }
.seg a { font-weight: 400; font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; }
.seg a.on { background: #fff; color: #0a0a0a; box-shadow: none; }
.chips a { background: transparent; border-color: var(--pill-line); color: var(--muted); font-weight: 400; }
.chips a.on { background: #fff; color: #0a0a0a; border-color: #fff; }
.pager a, .pager span { background: transparent; border-color: var(--pill-line); color: var(--ink); font-weight: 400; }
.pager span.on { background: #fff; color: #0a0a0a; border-color: #fff; }

/* Pills & state */
.pill { font-weight: 400; font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; background: transparent !important; }
.tone-slate { color: var(--muted); border-color: var(--line-2); }
.tone-leaf { color: var(--g400); border-color: rgba(160,195,236,.35); }
.tone-gold { color: var(--gold500); border-color: rgba(255,194,133,.4); }
.tone-terra { color: var(--t500); border-color: rgba(255,122,23,.45); }
.tone-fire { color: #0a0a0a; background: var(--fire) !important; border-color: var(--fire); }
.state { font-weight: 400; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.state.awake { color: var(--ink-soft); }
.state.awake i, .live.on .dot { background: #fff; animation: none; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }

/* Garden plots: one hairline card, monochrome trees, errors still glow sunset */
.plot { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; transition: border-color .2s; }
.plot:hover { transform: none; box-shadow: none; border-color: rgba(255,255,255,.3); }
.plot .scene { background: radial-gradient(60% 80% at 50% 100%, rgba(255,255,255,.06), transparent 70%); }
.plot .scene svg.tree, .app-tree svg { filter: grayscale(1) brightness(1.15) contrast(1.05); }
.plot:hover .scene svg.tree { animation: none; }
.plot .body { background: var(--card); border-top: 1px solid var(--line); }
.plot .name { font-weight: 400; letter-spacing: -.02em; color: var(--ink); }
.plot .nums b { font-weight: 400; color: var(--ink); letter-spacing: -.02em; }
.plot .nums span { font-size: .6rem; }
.plot.new { border: 1px dashed var(--line-2); background: transparent; }
.plot.new .seed, .empty .art, .feature .ico { background: transparent; border: 1px solid var(--pill-line); border-radius: 999px; color: var(--ink); }
.leaf-fall { display: none; }

/* Charts: the server writes the garden's hex values; map them onto the xAI palette */
.chart .grid-line { stroke: var(--line); stroke-dasharray: none; }
.chart .axis { fill: var(--faint); font: 400 10px var(--mono); }
.chart g.col:hover .hover-band { fill: rgba(255,255,255,.04); }
.legend { font-weight: 400; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
[fill="#7d9c6f"] { fill: #4a4f55; }
[fill="#e0a43c"], [fill="#d9932a"] { fill: #ffc285; }
[fill="#c47552"], [fill="#b65e3f"] { fill: #ff7a17; }
[fill="#2c5240"], [fill="#5a7355"] { fill: #ffffff; }
[fill="#5f8f80"] { fill: #a0c3ec; } [fill="#7d6ca8"] { fill: #c4b5fd; }
[stroke="#2c5240"], [stroke="#5a7355"] { stroke: #ffffff; }
[stroke="#d9932a"], [stroke="#e0a43c"] { stroke: #c4b5fd; }
[stroke="#b65e3f"], [stroke="#c47552"] { stroke: #ff7a17; }
[stroke="#7d6ca8"] { stroke: #c4b5fd; }
.legend i[style*="#7d9c6f"] { background: #4a4f55 !important; }
.legend i[style*="#e0a43c"], .legend i[style*="#d9932a"] { background: #ffc285 !important; }
.legend i[style*="#c47552"], .legend i[style*="#b65e3f"] { background: #ff7a17 !important; }
.legend i[style*="#2c5240"], .legend i[style*="#5a7355"] { background: #fff !important; }
.legend i[style*="#5f8f80"] { background: #a0c3ec !important; }
.legend i[style*="#7d6ca8"] { background: #c4b5fd !important; }
.legend .deploy-key i { border-color: #c4b5fd; }
.deploy-note { color: #c4b5fd; font-weight: 400; }

/* Log stream */
.log:hover, table.t tr:hover td, .issue:hover, .wf-row:hover, .mitem:hover, .person:hover { background: rgba(255,255,255,.03); }
.log.lv-error, .log.lv-critical, .log.lv-alert, .log.lv-emergency { background: linear-gradient(90deg, rgba(255,122,23,.08), transparent 45%); box-shadow: inset 2px 0 0 var(--t500); }
.log.lv-warning { box-shadow: inset 2px 0 0 var(--gold500); }
.log .when { color: var(--faint); }
.log .msg { color: var(--ink-soft); }
.log .meta a { color: var(--ink); font-weight: 400; }
pre.json, pre.code, .answer pre, .prose pre { background: #050505; color: #dadbdf; border: 1px solid var(--line); border-radius: 8px; }
.token { background: var(--g50); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.live { font-weight: 400; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

/* Tables */
table.t th { color: var(--muted); font-size: .64rem; border-bottom-color: var(--line); }
table.t td { border-bottom-color: var(--line); }
.bar-mini { background: var(--g100); height: 4px; }
.bar-mini span { background: #fff; }
.bar-mini.bad span { background: var(--t500); }

/* Issues */
.issue { border-bottom: 1px solid var(--line); }
.issue .ico, .issue .ico.tone-ico-terra, .issue .ico.tone-ico-fire, .issue .ico.tone-ico-gold, .issue .ico.tone-ico-leaf { background: transparent; border: 1px solid var(--line-2); border-radius: 999px; }
.issue .ico.tone-ico-terra, .issue .ico.tone-ico-fire { color: var(--t500); border-color: rgba(255,122,23,.4); }
.issue .ico.tone-ico-gold { color: var(--gold500); border-color: rgba(255,194,133,.35); }
.issue .title { color: var(--ink-soft); }
.issue .hits { font-weight: 400; letter-spacing: -.03em; }

/* Waterfall */
.wf-bar { background: #fff; border-radius: 3px; height: 10px; top: 12px; }
.wf-bar.k-query { background: #a0c3ec; }
.wf-bar.k-http { background: #ffc285; }
.wf-bar.k-job { background: #c4b5fd; }
.wf-bar.k-cache { background: #7d8187; }
.wf-bar.err { background: #ff7a17; }
.kind { background: transparent; border: 1px solid var(--line-2); font-weight: 400; font-family: var(--mono); }

/* Tabs */
.tabs { border-bottom-color: var(--line); }
.tabs a { font-weight: 400; color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: #fff; }
.tabs[data-settings-tabs] { background: var(--paper); }

/* Metric list */
.mitem.on { background: transparent; border-color: var(--pill-line); box-shadow: none; }
.mitem .v { font-weight: 400; color: var(--ink); }

/* Steps */
.step::before, .mk-step-n { background: transparent; border: 1px solid var(--pill-line); color: var(--ink); font-family: var(--mono); font-weight: 400; }

/* Public site */
.public-nav a.link { font-weight: 400; color: var(--ink-soft); }
.hero h1 { font-size: 4.5rem; letter-spacing: -.045em; line-height: 1; font-weight: 400; }
.hero h1 em { color: var(--ink); font-style: normal; opacity: .55; }
.hero .lede { color: var(--ink-soft); }
.hero-art, .mk-screen { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.mk-screen { background: var(--card); }
.mk-cta { background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.mk-cta h2 { color: var(--ink); }
.mk-cta .muted { color: var(--muted); }
.mk-cta .btn-ghost { color: var(--ink); border-color: var(--pill-line); }
.mk-stacks .chip { background: transparent; border-color: var(--pill-line); color: var(--ink-soft); font-weight: 400; }
.mk-input, .mk-slack { background: var(--g50); color: var(--ink-soft); }
.skip-link { background: var(--card); }

/* Auth */
.auth-art { background: radial-gradient(120% 80% at 80% 110%, rgba(255,122,23,.28), transparent 55%), radial-gradient(90% 70% at 10% 120%, rgba(124,58,237,.28), transparent 60%), #050505; border-left: 1px solid var(--line); color: var(--ink); }
.auth-art h2 { color: var(--ink); font-weight: 400; letter-spacing: -.03em; font-size: 2.6rem; line-height: 1.05; }
.auth-art p { color: var(--ink-soft); }
.auth-art::after { background: linear-gradient(180deg, rgba(5,5,5,0) 30%, rgba(5,5,5,.9) 100%); }

/* Status, alerts, admin */
.firing { background: linear-gradient(180deg, rgba(255,122,23,.08), var(--card)); border-color: rgba(255,122,23,.4); border-radius: 8px; }
.big-status.up { background: transparent; border: 1px solid var(--pill-line); color: var(--ink); }
.big-status.down { background: var(--t500); color: #0a0a0a; }
.status-body { background: var(--paper); }
.status.ok { color: var(--g400); } .status.ok i { background: var(--g400); }
.health-card { border-top: 2px solid var(--g300); }
.health-card.warn { border-top-color: var(--gold500); } .health-card.bad { border-top-color: var(--t500); }
.avatar { background: transparent; border: 1px solid var(--pill-line); color: var(--ink); font-weight: 400; }
.att-ico, .att-ico.terra, .att-ico.gold { background: transparent; border: 1px solid var(--line-2); border-radius: 999px; }
.att-ico.terra { color: var(--t500); } .att-ico.gold { color: var(--gold500); }
.admin-side { background: #050505; border-right: 1px solid var(--line); color: var(--ink-soft); }
.admin-side .brand-name { color: var(--ink); }
.admin-side .nav-label { color: var(--faint); }
.admin-side .nav-item, .admin-side .nav-item .ico { color: var(--muted); }
.admin-side .nav-item:hover { background: var(--g50); color: var(--ink); }
.admin-side .nav-item.active { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--pill-line); }
.recovery-codes code { background: var(--g50); border-color: var(--line); }
.pw-toggle:hover { color: var(--ink); background: var(--g50); }

@media (max-width: 860px) {
  .hero h1 { font-size: 2.8rem; }
  table.t { background: none; }
  .tabs { background: none; }
}

/* xAI shows no colour imagery: the garden's own illustrations go monochrome and sit back.
   Art made for this theme (public/images/xai/, picked by App\Support\Theme::image()) is shown as it is. */
img[src*="/images/"]:not([src*="/images/xai/"]) { filter: grayscale(1) contrast(1.05) brightness(.85); }
.auth-art img:not([src*="/images/xai/"]) { filter: grayscale(1) brightness(.5); }
.mk-step-art, .mk-wide-art { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }

/* Admin side: no marigold left over */
.admin-side .brand-name em { color: var(--ink); opacity: .55; }
.admin-side .side-badge { background: transparent; color: var(--ink); border: 1px solid var(--pill-line); font-family: var(--mono); font-weight: 400; letter-spacing: .1em; }
.admin-side .side-foot { border-top-color: var(--line); }
.card > span[style*="uppercase"] { font-family: var(--mono); font-weight: 400 !important; }
