/* ===========================================================================
   Geornix admin — design system
   Dark navy + teal. Single stylesheet, no build step.
   =========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #070c16;
  --bg-glow:
    radial-gradient(1100px 620px at 12% -12%, rgba(79, 209, 197, 0.10), transparent 62%),
    radial-gradient(900px 520px at 100% -6%, rgba(56, 189, 248, 0.07), transparent 58%);
  --surface: #0c1424;
  --surface-2: #101a2e;
  --surface-3: #15223a;
  --surface-hover: #17253f;
  --inset: #0a1120;

  /* Lines */
  --border: #1b2a44;
  --border-soft: rgba(148, 163, 184, 0.12);
  --border-strong: #27395c;

  /* Text */
  --text: #e9eef7;
  --text-2: #a6b3c9;
  --text-3: #6d7d99;
  --text-4: #4c5a74;

  /* Brand + semantics */
  --accent: #4fd1c5;
  --accent-2: #6ee7db;
  --accent-3: #2fb8ab;
  --accent-ink: #04242a;
  --accent-soft: rgba(79, 209, 197, 0.12);
  --accent-line: rgba(79, 209, 197, 0.45);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);

  /* Effects */
  --ring: 0 0 0 3px rgba(79, 209, 197, 0.30);
  --ring-danger: 0 0 0 3px rgba(248, 113, 113, 0.30);
  --r-xs: 5px;
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --sh-2: 0 14px 34px -16px rgba(0, 0, 0, 0.65);
  --sh-pop: 0 26px 60px -22px rgba(0, 0, 0, 0.8);

  /* Type */
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --sidebar-w: 260px;
  --topbar-h: 60px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

::selection { background: rgba(79, 209, 197, 0.28); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #24344f transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: #24344f;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: #31456a; background-clip: content-box; }

/* --- Typography helpers --------------------------------------------------- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }

.h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 1.95rem); line-height: 1.15; }
.h2 { font-size: 1.15rem; line-height: 1.25; }
.h3 { font-size: 0.98rem; }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 0.75rem; }
.small { font-size: 0.8125rem; }
.mono { font-family: var(--mono); font-size: 0.78rem; }
.eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ===========================================================================
   App shell
   =========================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* --- Sidebar -------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 26, 46, 0.72), rgba(7, 12, 22, 0.6));
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: linear-gradient(145deg, var(--accent-2), var(--accent-3));
  box-shadow: 0 8px 22px -8px rgba(79, 209, 197, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.brand-mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.63rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--text-3); }

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

.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group-label {
  padding: 0 10px 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-4);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.855rem;
  font-weight: 550;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: 0.75; }
.nav-link:hover svg { opacity: 1; }

.nav-link.is-active {
  background: linear-gradient(90deg, rgba(79, 209, 197, 0.16), rgba(79, 209, 197, 0.04));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(79, 209, 197, 0.22);
}
.nav-link.is-active svg { color: var(--accent); opacity: 1; }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(79, 209, 197, 0.8);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.who {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 10px;
  color: var(--text-3);
  font-size: 0.76rem;
  overflow: hidden;
}
.who .dot {
  width: 7px; height: 7px; border-radius: 99px; flex: none;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Main column ---------------------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 12, 22, 0.72);
  backdrop-filter: blur(10px);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-3);
  min-width: 0;
}
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--text-4); }
.crumbs .current { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  padding: 28px 26px 120px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head .lead { margin-top: 7px; max-width: 62ch; color: var(--text-2); }
.page-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ===========================================================================
   Buttons
   =========================================================================== */
.btn {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 0.845rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease),
    color 0.14s var(--ease), transform 0.06s var(--ease), box-shadow 0.14s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary {
  --btn-bg: linear-gradient(180deg, var(--accent-2), var(--accent-3));
  --btn-fg: #05231f;
  --btn-bd: transparent;
  box-shadow: 0 10px 26px -12px rgba(79, 209, 197, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 750;
}
.btn-primary:hover { --btn-bg: linear-gradient(180deg, #86f4e8, var(--accent)); }
.btn-primary:focus-visible { box-shadow: var(--ring), 0 10px 26px -12px rgba(79, 209, 197, 0.8); }

.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--surface-hover); --btn-fg: var(--text); border-color: transparent; }

.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: #fecaca; --btn-bd: rgba(248, 113, 113, 0.35); }
.btn-danger:hover { --btn-bg: rgba(248, 113, 113, 0.22); border-color: rgba(248, 113, 113, 0.55); }

.btn-sm { height: 32px; padding: 0 10px; font-size: 0.79rem; border-radius: var(--r-xs); }
.btn-sm svg { width: 14px; height: 14px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-xs);
  --btn-bg: transparent;
  --btn-bd: transparent;
  --btn-fg: var(--text-3);
}
.btn-icon:hover { --btn-bg: var(--surface-hover); --btn-fg: var(--text); border-color: transparent; }
.btn-icon:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-icon:disabled:hover { --btn-bg: transparent; --btn-fg: var(--text-3); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-block { width: 100%; }

/* ===========================================================================
   Cards & panels
   =========================================================================== */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0));
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.card-pad { padding: 20px 22px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h2 { font-size: 1rem; }
.card-head .spacer { margin-left: auto; }

.card-body { padding: 20px; }

.panel-grid { display: grid; gap: 18px; }

/* --- Pills / badges ------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.pill svg { width: 13px; height: 13px; }
.pill .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill--ok { color: var(--success); background: var(--success-soft); border-color: rgba(52, 211, 153, 0.3); }
.pill--warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.3); }
.pill--danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.3); }
.pill--accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

.count {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  display: inline-grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
}

/* --- Alerts --------------------------------------------------------------- */
.alert {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.855rem;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert strong { color: var(--text); }
.alert--ok { border-color: rgba(52, 211, 153, 0.34); background: var(--success-soft); color: #c8f7e4; }
.alert--warn { border-color: rgba(251, 191, 36, 0.34); background: var(--warn-soft); color: #fde9bd; }
.alert--danger { border-color: rgba(248, 113, 113, 0.36); background: var(--danger-soft); color: #fbd5d5; }

/* ===========================================================================
   Dashboard
   =========================================================================== */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  margin-bottom: 22px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.83rem;
  color: var(--text-2);
}
.status-bar .spacer { margin-left: auto; }

.section-group { margin-bottom: 30px; }
.section-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-group-head h2 { font-size: 0.9rem; letter-spacing: 0.02em; }
.section-group-head .rule { flex: 1; height: 1px; background: var(--border-soft); }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 12px;
}

.section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), background 0.16s var(--ease);
}
.section-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.section-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}
.section-card:hover::after { opacity: 1; }

.section-card .sc-top { display: flex; align-items: center; gap: 10px; }
.section-card .sc-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.section-card .sc-icon svg { width: 17px; height: 17px; }
.section-card h3 { font-size: 0.94rem; }
.section-card .sc-blurb {
  color: var(--text-3);
  font-size: 0.79rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.section-card .sc-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-3);
}
.section-card .sc-go { margin-left: auto; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.section-card .sc-go svg { width: 14px; height: 14px; transition: transform 0.16s var(--ease); }
.section-card:hover .sc-go svg { transform: translateX(2px); }

/* ===========================================================================
   Forms
   =========================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.005em;
}
.field-hint { font-size: 0.76rem; color: var(--text-3); line-height: 1.5; }

.input,
.textarea,
.select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--text);
  font: inherit;
  font-size: 0.87rem;
  line-height: 1.5;
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease), background 0.14s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent-3);
  background: var(--surface);
  box-shadow: var(--ring);
}
.textarea { min-height: 108px; resize: vertical; font-size: 0.86rem; }

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d7d99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.input[type="number"] { font-variant-numeric: tabular-nums; }

/* --- Switch --------------------------------------------------------------- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  padding: 3px 0;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative;
  width: 40px;
  height: 23px;
  flex: none;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 99px;
  background: var(--text-3);
  transform: translateY(-50%);
  transition: transform 0.18s var(--ease), background 0.16s var(--ease);
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent-line); }
.switch input:checked + .track::after { background: var(--accent); transform: translate(17px, -50%); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch .switch-label { font-size: 0.84rem; font-weight: 600; color: var(--text); }

/* --- Field grids ---------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ===========================================================================
   Editor
   =========================================================================== */
.editor { display: grid; gap: 18px; }

.group {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.group-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}
.group-head .g-icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  color: var(--accent);
  background: var(--accent-soft);
}
.group-head .g-icon svg { width: 16px; height: 16px; }
.group-head h2 { font-size: 0.95rem; }
.group-head .g-sub { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }
.group-body { padding: 18px; display: grid; gap: 16px; }

/* --- Repeater (list) ------------------------------------------------------ */
.repeater { display: flex; flex-direction: column; gap: 12px; }
.rep-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rep-head .rep-label { font-size: 0.8rem; font-weight: 650; }
.rep-head .rep-hint { font-size: 0.76rem; color: var(--text-3); }
.rep-head .spacer { margin-left: auto; }

.rep-list { display: flex; flex-direction: column; gap: 9px; }

.rep-item {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.14s var(--ease), opacity 0.14s var(--ease);
}
.rep-item:hover { border-color: var(--border-strong); }
.rep-item.dragging { opacity: 0.45; border-style: dashed; }
.rep-item.drop-target { border-color: var(--accent); box-shadow: var(--ring); }

.rep-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}
.rep-grip {
  width: 24px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  color: var(--text-4);
  cursor: grab;
  flex: none;
  border: none;
  background: transparent;
}
.rep-grip:hover { color: var(--text-2); background: var(--surface-hover); }
.rep-grip svg { width: 15px; height: 15px; }

.rep-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 4px 4px;
  border-radius: var(--r-xs);
}
.rep-toggle:hover { background: var(--surface-hover); }
.rep-toggle .chev { width: 15px; height: 15px; color: var(--text-3); flex: none; transition: transform 0.16s var(--ease); }
.rep-item.is-open .rep-toggle .chev { transform: rotate(90deg); }
.rep-title {
  font-size: 0.85rem;
  font-weight: 620;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rep-sub { font-size: 0.74rem; color: var(--text-3); }
.rep-idx {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-4);
  min-width: 18px;
}
.rep-actions { display: flex; gap: 2px; margin-left: auto; }

.rep-item-body {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 14px;
}
.rep-item:not(.is-open) .rep-item-body { display: none; }

.rep-empty {
  padding: 22px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.82rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--inset);
}

/* --- Strings list --------------------------------------------------------- */
.str-list { display: flex; flex-direction: column; gap: 8px; }
.str-row { display: flex; gap: 8px; align-items: center; }
.str-row .input { flex: 1; }

/* ===========================================================================
   Sticky save bar
   =========================================================================== */
.savebar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 26px;
  border-top: 1px solid var(--border);
  background: rgba(7, 12, 22, 0.86);
  backdrop-filter: blur(12px);
  transform: translateY(110%);
  transition: transform 0.22s var(--ease);
}
.savebar.is-visible { transform: translateY(0); }

.savebar-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.savebar .state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-3);
}
.savebar .state .dot {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--warn);
  box-shadow: 0 0 10px var(--warn);
}
.savebar .spacer { margin-left: auto; }
.savebar-actions { display: flex; align-items: center; gap: 9px; }

/* ===========================================================================
   Toasts
   =========================================================================== */
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  box-shadow: var(--sh-pop);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.26s var(--ease), opacity 0.26s var(--ease);
}
.toast.is-in { transform: translateX(0); opacity: 1; }
.toast .t-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast .t-body { min-width: 0; }
.toast .t-title { font-size: 0.84rem; font-weight: 650; }
.toast .t-msg { font-size: 0.78rem; color: var(--text-2); margin-top: 1px; overflow-wrap: anywhere; }
.toast--ok { border-color: rgba(52, 211, 153, 0.4); }
.toast--ok .t-icon { color: var(--success); }
.toast--err { border-color: rgba(248, 113, 113, 0.4); }
.toast--err .t-icon { color: var(--danger); }
.toast--info .t-icon { color: var(--accent); }

/* ===========================================================================
   Login
   =========================================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(400px, 100%);
  padding: 30px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.005));
  background-color: var(--surface);
  box-shadow: var(--sh-pop);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card .auth-sub { color: var(--text-2); font-size: 0.85rem; margin-top: 6px; }
.auth-form { display: grid; gap: 15px; margin-top: 22px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 0.76rem; color: var(--text-3); }

/* ===========================================================================
   Tools
   =========================================================================== */
.tool-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--inset);
  font-size: 0.82rem;
}
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kv .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); }
.kv .v { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

.spinner {
  width: 15px; height: 15px;
  border-radius: 99px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Revision list -------------------------------------------------------- */
.rev-list { display: flex; flex-direction: column; }
.rev-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.rev-row:last-child { border-bottom: none; }
.rev-when { font-size: 0.84rem; font-weight: 600; }
.rev-meta { font-size: 0.75rem; color: var(--text-3); }
.rev-row .spacer { margin-left: auto; }

/* ===========================================================================
   Utilities
   =========================================================================== */
.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { margin-left: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
code {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
}

/* ===========================================================================
   Nested object block
   =========================================================================== */
.subblock { display: grid; gap: 14px; }
.subhead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 680;
  color: var(--text);
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--border-soft);
}
.subhead .field-hint { font-weight: 500; }

/* ===========================================================================
   Image field
   =========================================================================== */
.media-row {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.media-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r);
  border: 1px dashed var(--border-strong);
  background: var(--inset);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-preview.is-drop { border-color: var(--accent); border-style: solid; box-shadow: var(--ring); }
.media-preview.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 22, 0.62);
}
.media-preview.is-busy::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: 22px; height: 22px;
  border-radius: 99px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
.media-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--text-4);
  font-size: 0.74rem;
}
.media-empty svg { width: 22px; height: 22px; }
.media-controls { display: grid; gap: 9px; align-content: start; }
@media (max-width: 640px) {
  .media-row { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    order: 3;
  }
  .nav-group { flex-direction: row; flex-wrap: wrap; gap: 4px; align-items: center; }
  .nav-group-label { display: none; }
  .brand { padding: 0 4px 0 2px; }
  .sidebar-foot { flex-direction: row; border-top: none; padding-top: 0; margin-left: auto; }
  .who { display: none; }
  .savebar { left: 0; }
  .content { padding: 22px 16px 130px; }
  .topbar { padding: 0 16px; }
}
