/* Craft Nodes panel — design system.
 * Copyright © 2026 DemonZDevelopment
 * Maintained by DemonZDevelopment
 *
 * Strictly monochrome black & white. Pure greyscale ramps.
 * Dark is the :root default, light applies when OS prefers light
 * or when data-theme="light" is set.
 *
 * Designed with human craftsmanship: high-contrast typography,
 * optical hierarchy, precision spacing, and clean responsive layouts.
 */

/* ══════════════════════════ tokens ══════════════════════════ */

:root {
  --bg:        #09090b;
  --bg-soft:   #121215;
  --surface:   #121215;
  --raised:    #18181c;
  --surface-2: #202025;
  --line:      #27272c;
  --line-soft: #1d1d22;
  --line-hard: #3f3f46;

  --text:      #fafafa;
  --text-dim:  #a1a1aa;
  --text-mute: #71717a;

  --accent:    #ffffff;
  --accent-2:  #e4e4e7;
  --grad:      linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);

  --ok:   #fafafa;
  --warn: #a1a1aa;
  --bad:  #71717a;
  --off:  #52525b;

  --side-w: 244px;
  --topbar-h: 54px;

  --r-sm: 5px;
  --r:    8px;
  --r-lg: 12px;

  --shadow: 0 4px 20px rgba(0, 0, 0, .45);
  --ring: 0 0 0 2px rgba(255, 255, 255, .25);

  --maxw: 1140px;
  --measure: 68ch;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-soft:   #fafafa;
  --surface:   #ffffff;
  --raised:    #f4f4f6;
  --surface-2: #e9e9ed;
  --line:      #e4e4e9;
  --line-soft: #f0f0f3;
  --line-hard: #d0d0d6;

  --text:      #09090b;
  --text-dim:  #52525b;
  --text-mute: #71717a;

  --accent:    #09090b;
  --accent-2:  #27272a;
  --grad:      linear-gradient(135deg, #09090b 0%, #52525b 100%);

  --ok:   #18181b;
  --warn: #52525b;
  --bad:  #71717a;
  --off:  #a1a1aa;

  --shadow: 0 4px 20px rgba(0, 0, 0, .06);
  --ring: 0 0 0 2px rgba(0, 0, 0, .2);
  color-scheme: light;
}

:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #ffffff;
    --bg-soft:   #fafafa;
    --surface:   #ffffff;
    --raised:    #f4f4f6;
    --surface-2: #e9e9ed;
    --line:      #e4e4e9;
    --line-soft: #f0f0f3;
    --line-hard: #d0d0d6;
    --text:      #09090b;
    --text-dim:  #52525b;
    --text-mute: #71717a;
    --accent:    #09090b;
    --accent-2:  #27272a;
    --grad:      linear-gradient(135deg, #09090b 0%, #52525b 100%);
    --ok:   #18181b;
    --warn: #52525b;
    --bad:  #71717a;
    --off:  #a1a1aa;
    --shadow: 0 4px 20px rgba(0, 0, 0, .06);
    --ring: 0 0 0 2px rgba(0, 0, 0, .2);
    color-scheme: light;
  }
}

/* ══════════════════════════ base ══════════════════════════ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  line-height: 1.25;
  letter-spacing: -.022em;
  font-weight: 650;
  color: var(--text);
}

h1 { font-size: 1.65rem; letter-spacing: -.032em; }
h2 { font-size: 1.24rem; letter-spacing: -.02em; }
h3 { font-size: 1.02rem; letter-spacing: -.015em; }
p  { margin: 0 0 .85em; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, kbd, samp, pre {
  font-family: var(--mono);
  font-size: .88em;
}
code {
  background: var(--surface-2);
  padding: .15em .4em;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
}
pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  overflow-x: auto;
  line-height: 1.45;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.8em 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* ══════════════════════════ brand mark ══════════════════════════ */

.mark, svg.mark {
  width: 24px;
  height: 27px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  color: var(--text);
}

body > .mark {
  display: none !important;
}

.wordmark {
  font-size: 1.45rem;
  letter-spacing: -.035em;
  line-height: 1;
}
.wordmark b { font-weight: 700; }

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.brand-lockup .mark { width: 38px; height: 43px; }

/* ══════════════════════════ shell ══════════════════════════ */

/* Signed-in layout: clean two-column grid (sidebar + topbar + main content + footer) */
body.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "side top"
    "side main"
    "side foot";
  min-height: 100vh;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 0 0 var(--r) 0;
  font-weight: 600;
}
.skip:focus { left: 0; }

/* ---- sidebar ---- */

.side {
  grid-area: side;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  padding: 18px 14px 16px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
}
.side-brand:hover { text-decoration: none; }
.side-brand-text {
  font-weight: 680;
  letter-spacing: -.025em;
  font-size: 1.05rem;
  color: var(--text);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.side-group {
  margin: 18px 0 6px;
  padding: 0 8px;
  font-size: .68rem;
  font-weight: 680;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.side-group:first-child { margin-top: 0; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r);
  color: var(--text-dim);
  font-size: .88rem;
  font-weight: 520;
  border: 1px solid transparent;
  transition: all .14s ease;
}
.side-nav a:hover {
  background: var(--raised);
  color: var(--text);
  text-decoration: none;
  border-color: var(--line-soft);
}
.side-nav a.on {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line-hard);
  font-weight: 620;
}

.ni {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
}
.side-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px 10px;
  min-width: 0;
}
.side-mail {
  font-size: .82rem;
  color: var(--text-dim);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-role {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}
.side-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

/* ---- top bar (signed in) ---- */

.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  font-size: .92rem;
  font-weight: 640;
  letter-spacing: -.015em;
  color: var(--text);
}
.topbar-link {
  font-size: .85rem;
  color: var(--text-dim);
  font-weight: 500;
}
.topbar-link:hover { color: var(--text); text-decoration: none; }
.side-toggle { display: none; }
.topbar .sp { flex: 1; }

/* ---- masthead (signed out) ---- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.masthead-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.masthead-nav > a:not(.btn) {
  font-size: .9rem;
  font-weight: 520;
  color: var(--text-dim);
}
.masthead-nav > a:not(.btn):hover, .masthead-nav > a.on {
  color: var(--text);
  text-decoration: none;
}

/* ══════════════════════════ page frame ══════════════════════════ */

.wrap {
  grid-area: main;
  min-width: 0;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.section { padding-top: 36px; }
.center { text-align: center; }

.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: .25em; }
.page-head p { color: var(--text-dim); max-width: var(--measure); margin: 0; font-size: .95rem; }
.page-head.center p { margin-left: auto; margin-right: auto; }

.section-title {
  font-size: .74rem;
  font-weight: 680;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 14px;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 24px;
  padding-bottom: 0;
}
.subnav a {
  padding: 8px 12px;
  font-size: .86rem;
  font-weight: 520;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all .12s ease;
}
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.on {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 620;
}

/* ══════════════════════════ surfaces & cards ══════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card + .card { margin-top: 16px; }
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-title h2, .card-title h3 { margin: 0; font-size: 1.08rem; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.stat { padding: 18px 20px; }
.stat .k { font-size: .78rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 1.85rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; margin: 6px 0 2px; }
.stat .sub { font-size: .78rem; color: var(--text-mute); }

.empty { text-align: center; padding: 48px 24px; }
.empty .big { margin-bottom: 14px; justify-content: center; }
.empty p { color: var(--text-dim); max-width: 44ch; margin: 0 auto 16px; font-size: .92rem; }

.dim { color: var(--text-dim); }
.muted { color: var(--text-mute); }
.lead { font-size: 1.06rem; color: var(--text-dim); line-height: 1.6; }
.mono { font-family: var(--mono); font-size: .88em; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

/* ══════════════════════════ marketing & hero ══════════════════════════ */

.hero {
  padding: 72px 24px 56px;
  max-width: 100%;
  text-align: center;
}
.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 620;
  color: var(--text-dim);
  background: var(--raised);
  border: 1px solid var(--line-hard);
  border-radius: 999px;
  padding: 5px 15px;
  margin-bottom: 24px;
}
.hero .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.hero h1 {
  font-size: clamp(2.2rem, 6.5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.04em;
  margin-bottom: .42em;
  font-weight: 750;
}
.hero .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero p {
  max-width: 58ch;
  margin: 0 auto 28px;
  color: var(--text-dim);
  font-size: 1.08rem;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-points {
  list-style: none;
  margin: 38px auto 0;
  padding: 0;
  max-width: 78ch;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: center;
  font-size: .86rem;
  color: var(--text-mute);
}
.hero-points li { display: inline-flex; align-items: center; }


.feature {
  padding: 22px 22px 24px;
  transition: transform .15s ease, border-color .15s ease;
}
.feature:hover {
  transform: translateY(-2px);
  border-color: var(--line-hard);
}
.feature .ico {
  margin-bottom: 14px;
  color: var(--text);
  display: inline-flex;
  padding: 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.feature h3 { margin-bottom: .4em; font-size: 1.05rem; }
.feature p { color: var(--text-dim); font-size: .92rem; margin: 0; line-height: 1.55; }

.ticks { list-style: none; margin: 14px 0 0; padding: 0; }
.ticks li {
  position: relative;
  padding: 6px 0 6px 24px;
  font-size: .91rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 13px;
  width: 10px;
  height: 5px;
  border-left: 1.8px solid var(--accent);
  border-bottom: 1.8px solid var(--accent);
  transform: rotate(-45deg);
}

.plan {
  display: flex;
  flex-direction: column;
  position: relative;
}
.plan:hover { border-color: var(--line-hard); }
.plan-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.plan-desc { color: var(--text-mute); font-size: .88rem; margin: 4px 0 14px; }
.plan-specs { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.plan-specs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .9rem;
}
.plan-specs li:last-child { border-bottom: 0; }
.plan-specs span { color: var(--text-mute); }
.plan-specs b { font-weight: 600; color: var(--text); }

/* ══════════════════════════ controls & buttons ══════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r);
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line-hard);
  font: inherit;
  font-size: .88rem;
  font-weight: 580;
  letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all .12s ease;
  user-select: none;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 640;
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--bg);
  opacity: .95;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover {
  background: var(--raised);
  color: var(--text);
  border-color: var(--line);
}
.btn-danger {
  background: transparent;
  color: var(--text);
  border-color: var(--line-hard);
}
.btn-danger:hover {
  background: var(--surface-2);
  border-color: var(--text);
}
.btn-sm {
  padding: 5px 11px;
  font-size: .82rem;
  border-radius: var(--r-sm);
}
.btn-block { width: 100%; }
.btn-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.btn-row.mt-1 { margin-top: 12px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  font: inherit;
  transition: all .12s ease;
}
.icon-btn:hover {
  background: var(--raised);
  color: var(--text);
  border-color: var(--line);
}

.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 25px;
  padding: 0 8px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: .72rem;
  font-weight: 640;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s ease;
}
.copy:hover {
  color: var(--text);
  border-color: var(--line-hard);
  background: var(--surface-2);
}

/* ══════════════════════════ forms ══════════════════════════ */

.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label {
  display: block;
  margin-bottom: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.005em;
}
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field input[type=search],
.field input[type=url], .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line-hard);
  border-radius: var(--r);
  font: inherit;
  font-size: .9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); }
.field select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field .hint { margin-top: 6px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .89rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}
.check span { color: var(--text); }

.hint { font-size: .82rem; color: var(--text-mute); line-height: 1.5; }
.form-grid {
  display: grid;
  gap: 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.form-grid .span2 { grid-column: 1 / -1; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}
.row + .row { border-top: 1px solid var(--line-soft); }
.row > span:first-child { color: var(--text-mute); font-size: .88rem; }
.row > b, .row > strong { font-weight: 600; color: var(--text); }

.kv { list-style: none; margin: 0; padding: 0; }
.kv li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .9rem;
}
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--text-mute); }
.kv b { font-weight: 600; text-align: right; word-break: break-word; color: var(--text); }

details.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 14px;
}
details.panel > summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; color: var(--text-mute); font-size: 1.2rem; line-height: 1; }
details.panel[open] > summary::after { content: "\2212"; }
details.panel > summary:hover { color: var(--text); }
.panel-body { padding: 4px 16px 16px; border-top: 1px solid var(--line-soft); }

/* ══════════════════════════ tables ══════════════════════════ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.table-wrap > table {
  width: 100%;
  border-collapse: collapse;
  font-size: .89rem;
  text-align: left;
}
.table-wrap th {
  font-weight: 650;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--bg-soft);
}
.table-wrap td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--text);
}
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: var(--raised); }
.t-right { text-align: right; }
.t-center { text-align: center; }
.t-actions { white-space: nowrap; text-align: right; }
.t-actions .btn { margin-left: 6px; }
.batch-ck, [data-batch-all] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}

.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 8px;
}
.meter i, .meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}
.meter span.warn { background: var(--text-mute); }
.meter span.bad { background: var(--text-dim); }

/* ══════════════════════════ badges & icons ══════════════════════════ */

.tag, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge.ok   { color: var(--text); border-color: var(--line-hard); background: var(--raised); }
.badge.wait { color: var(--text-dim); border-color: var(--line); }
.badge.bad  { color: var(--bg); background: var(--text); border-color: var(--text); }
.badge.off  { color: var(--text-mute); border-color: var(--line-soft); }

.big { color: var(--text-mute); display: flex; }
.big .ico-svg { width: 32px; height: 32px; }

.ico-svg {
  width: 1.2em;
  height: 1.2em;
  display: inline-block;
  vertical-align: -.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-xs { width: .8em; height: .8em; vertical-align: -.05em; }
.ico-sm { width: .96em; height: .96em; vertical-align: -.1em; }
.ico-svg + .ico-svg, .ico-xs + .ico-xs, .ico-sm + .ico-sm { margin-left: .3em; }

/* ══════════════════════════ alerts ══════════════════════════ */

.alert {
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 18px;
  font-size: .9rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-left-width: 4px;
}
.alert-bad  { border-left-color: var(--text); }
.alert-ok   { border-left-color: var(--text-mute); }
.alert-info { border-left-color: var(--text-dim); }
.alert-warn { border-left-color: var(--text-mute); }
.alert-ok a { text-decoration: underline; }

.file-list { margin: 8px 0 0; padding-left: 20px; font-size: .84rem; word-break: break-all; }
.file-list li { margin: 3px 0; }

/* ══════════════════════════ auth ══════════════════════════ */

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 0;
  height: 52px;
}
.auth-link {
  font-size: .88rem;
  font-weight: 560;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--r);
  transition: all .12s ease;
}
.auth-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.auth-wrap {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 20px 24px 72px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 30px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.auth-header {
  text-align: center;
  margin-bottom: 22px;
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.auth-logo .mark {
  width: 46px;
  height: 52px;
  color: var(--text);
}
.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.auth-sub {
  font-size: .9rem;
  color: var(--text-mute);
  margin: 0;
}
.auth-card h1 { font-size: 1.45rem; margin-bottom: .25em; }
.auth-card .dim { font-size: .92rem; margin-bottom: 20px; }
.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  font-size: .88rem;
  color: var(--text-mute);
}
.auth-alt a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-card .btn-block { margin-top: 8px; }

/* ══════════════════════════ build / integrity ══════════════════════════ */

.integrity-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  font-size: .96rem;
  margin: 2px 0 6px;
}
.integrity-state.ok { color: var(--text); }
.integrity-state.bad { color: var(--text); }
.integrity-state.wait { color: var(--text-dim); }
.integrity-state .ico-svg { width: 1.15em; height: 1.15em; }
.alert:has(.integrity-state) { border-left-width: 4px; }

/* ══════════════════════════ footer ══════════════════════════ */

.foot {
  grid-area: foot;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
  font-size: .84rem;
  color: var(--text-mute);
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.foot-sep { opacity: .45; }
.foot-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line-hard);
  transition: all .12s ease;
}
.foot-link:hover { color: var(--text); border-bottom-color: var(--text); }

/* ══════════════════════════ console ══════════════════════════ */

.term-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  background: var(--bg);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: .88rem;
  flex: none;
}
.term-bar .mark { width: 18px; height: 20px; }
.term-bar .sp { flex: 1; }
.term-title { font-weight: 620; }
#termStatus { color: var(--text-mute); font-size: .82rem; }
.term-host {
  flex: 1;
  min-height: 0;
  padding: 8px 4px 8px 12px;
  background: var(--bg);
}
.term-host .xterm { height: 100%; }

/* ══════════════════════════ utilities ══════════════════════════ */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 18px; }
.mb-3 { margin-bottom: 28px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

.install-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.install-cmd {
  flex: 1;
  padding: 9px 12px;
  font-size: .8rem;
  border-radius: var(--r);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- instance view ---------- */

.inst-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .inst-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }
}

.inst { display: flex; flex-direction: column; gap: 14px; }
.inst-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.inst-name {
  font-weight: 660;
  font-size: 1.08rem;
  letter-spacing: -.018em;
  word-break: break-word;
}
.inst-sub { font-size: .82rem; color: var(--text-mute); margin-top: 2px; }
.inst-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.inst-net {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: .86rem;
}
.inst-net .row { padding: 4px 0; border: 0; }
.inst-net .row span { color: var(--text-mute); flex: none; }
.inst-net .row b { font-family: var(--mono); font-weight: 500; word-break: break-all; text-align: right; }

.body { min-width: 0; }
.select-compact { padding: 5px 26px 5px 9px !important; font-size: .84rem !important; max-width: 100%; }

.code-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.code-list code {
  padding: 9px 12px;
  border-radius: var(--r);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .84rem;
  text-align: center;
  letter-spacing: .03em;
}

/* ══════════════════════════ responsive ══════════════════════════ */

@media (max-width: 900px) {
  body.app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "main" "foot";
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(280px, 84vw);
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5);
  }
  .side.open { transform: none; }
  .side-toggle { display: inline-grid; }
  .wrap { padding: 20px 16px 52px; }
  .hero { padding: 44px 16px 36px; }
  .masthead-inner { padding: 12px 16px; }
  .masthead-nav { gap: 14px; }
}

@media (max-width: 560px) {
  .card { padding: 16px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .btn-row .btn { flex: 1; }
  .masthead-nav > a:not(.btn):nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

@media print {
  .side, .topbar, .foot, .btn, .copy { display: none !important; }
  body.app { display: block; }
  body { color: #000; background: #fff; }
  .card, .table-wrap { border-color: #999; }
}
