/* InterGate panel — single stylesheet, no framework */
:root {
  --bg: #0b0f16;
  --bg-soft: #0f1520;
  --panel: #131a26;
  --panel-2: #172031;
  --line: #223049;
  --line-soft: #1b2434;
  --text: #e8eef8;
  --muted: #8fa1bd;
  --dim: #63758f;
  --accent: #5b8cff;
  --accent-2: #7aa2ff;
  --ok: #3ddc97;
  --warn: #ffc860;
  --err: #ff6b81;
  --info: #6ad4ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .85);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(91, 140, 255, .13), transparent 62%),
    radial-gradient(760px 480px at 8% 0%, rgba(61, 220, 151, .07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #a8c2ff; }

code, .mono, pre { font-family: var(--mono); font-size: .88em; }
.mono-xs { font-family: var(--mono); font-size: .78rem; }
.muted { color: var(--muted); }
.num { text-align: right; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(19, 26, 38, .92), rgba(15, 21, 32, .92));
  border-right: 1px solid var(--line-soft);
  position: sticky; top: 0; height: 100vh;
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 0; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), #7d5bff);
  color: #fff; box-shadow: 0 8px 20px -10px rgba(91, 140, 255, .9);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-mark-lg { width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 14px; }
.brand-mark-lg svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .98rem; letter-spacing: .2px; }
.brand-text small { color: var(--dim); font-size: .71rem; letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.is-active { background: rgba(91, 140, 255, .14); color: #cfe0ff; box-shadow: inset 0 0 0 1px rgba(91, 140, 255, .28); }
.nav a.is-active svg { opacity: 1; }

.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; }
.who div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who strong { font-size: .86rem; }
.who small { color: var(--dim); font-size: .72rem; }
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(91, 140, 255, .18); color: #cfe0ff; font-weight: 600; font-size: .85rem;
  box-shadow: inset 0 0 0 1px rgba(91, 140, 255, .3);
}

.main { padding: 26px 30px 60px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 1.42rem; letter-spacing: -.015em; font-weight: 650; }
.sub { margin: 3px 0 0; color: var(--muted); font-size: .875rem; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: .86rem; font-weight: 550; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(140deg, var(--accent), #6f7dff); color: #fff; box-shadow: 0 10px 24px -14px rgba(91, 140, 255, .95); }
.btn-primary:hover { background: linear-gradient(140deg, #6b98ff, #7d8bff); color: #fff; }
.btn-ghost { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #1e293c; border-color: #2c3d5c; color: #fff; }
.btn-danger { background: rgba(255, 107, 129, .12); border-color: rgba(255, 107, 129, .35); color: #ffb3bf; }
.btn-danger:hover { background: rgba(255, 107, 129, .2); color: #ffd0d8; }
.btn-sm { padding: 6px 11px; font-size: .8rem; }
.btn-xs { padding: 4px 9px; font-size: .74rem; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- cards */
.card {
  background: linear-gradient(180deg, rgba(23, 32, 49, .75), rgba(19, 26, 38, .75));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 18px 18px 20px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card, .cols + .card, .stat-grid + .card, .card + .cols, .cols + .cols, .stat-grid + .cols, .card + .stat-grid { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: .95rem; font-weight: 600; letter-spacing: .01em; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.cols-form { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-grid-sm { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 32, 49, .8), rgba(19, 26, 38, .8));
  border: 1px solid var(--line-soft);
}
.stat-link { color: var(--text); transition: border-color .15s, transform .1s; }
.stat-link:hover { border-color: #2c3d5c; color: var(--text); transform: translateY(-1px); }
.stat-label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
.stat-value { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-of { font-size: .95rem; color: var(--dim); font-weight: 500; }
.stat-foot { color: var(--dim); font-size: .78rem; }

/* ---------------------------------------------------------------- lists */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft);
}
.list-row:last-child { border-bottom: 0; }
.list-tight .list-row { padding: 7px 4px; }
.list-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: var(--text); }
.list-main:hover strong { color: #cfe0ff; }
.list-main strong { font-size: .88rem; font-weight: 560; }
.list-main small { color: var(--dim); font-size: .77rem; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
  text-align: left; font-weight: 550; font-size: .73rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: rgba(91, 140, 255, .045); }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 560; }
.table-ips td { font-size: .84rem; }
.cell-actions { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 560;
  letter-spacing: .01em; white-space: nowrap; text-transform: capitalize;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: rgba(61, 220, 151, .12); }
.badge-warn { color: var(--warn); background: rgba(255, 200, 96, .12); }
.badge-err { color: var(--err); background: rgba(255, 107, 129, .12); }
.badge-info { color: var(--info); background: rgba(106, 212, 255, .12); }
.badge-muted { color: var(--muted); background: rgba(143, 161, 189, .1); }

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-inline { flex-direction: row; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span { font-size: .78rem; font-weight: 550; color: var(--muted); letter-spacing: .02em; }
.field small { color: var(--dim); font-size: .74rem; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }

input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  background: #0d131e; border: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: .87rem; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #2d3f60; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, .17);
}
input::placeholder, textarea::placeholder { color: #4f6079; }
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.input-sm { padding: 6px 9px; font-size: .8rem; width: auto; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: .82rem; color: var(--muted); }
.check input { width: 15px; height: 15px; margin-top: 2px; flex: none; accent-color: var(--accent); }

/* ---------------------------------------------------------------- flash */
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: .86rem; border: 1px solid transparent;
}
.flash-ok { background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .3); color: #a8f2cf; }
.flash-warn { background: rgba(255, 200, 96, .1); border-color: rgba(255, 200, 96, .3); color: #ffdf9e; }
.flash-err { background: rgba(255, 107, 129, .1); border-color: rgba(255, 107, 129, .32); color: #ffc2cb; }
.flash-x { background: none; border: 0; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: .6; }
.flash-x:hover { opacity: 1; }

/* ---------------------------------------------------------------- misc blocks */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 16px; color: var(--muted); }
.empty-icon { color: var(--dim); margin-bottom: 4px; }
.empty-icon svg { width: 28px; height: 28px; }
.empty strong { color: var(--text); font-size: .9rem; }
.empty p { margin: 0; font-size: .82rem; max-width: 40ch; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 14px 0 0; }
.kv div { min-width: 0; }
.kv dt { color: var(--dim); font-size: .73rem; text-transform: uppercase; letter-spacing: .07em; }
.kv dd { margin: 2px 0 0; font-size: .86rem; overflow-wrap: anywhere; }

.ip-hero { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: rgba(91, 140, 255, .08); border: 1px solid rgba(91, 140, 255, .22); }
.ip-hero-addr { font-size: 1.24rem; font-weight: 600; letter-spacing: -.01em; }

.hint { color: var(--muted); font-size: .82rem; margin: 12px 0 0; }
.hint code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.hints { margin: 0; padding-left: 18px; color: var(--muted); font-size: .84rem; display: flex; flex-direction: column; gap: 9px; }
.hints strong { color: var(--text); }

.code {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: #0a1017; border: 1px solid var(--line-soft); color: #c7d6ef;
  font-size: .8rem; line-height: 1.6; overflow-x: auto; white-space: pre;
}
.code-scroll { max-height: 420px; overflow: auto; }
.dns-block { margin-top: 16px; padding: 13px; border-radius: var(--radius-sm); background: rgba(106, 212, 255, .05); border: 1px solid rgba(106, 212, 255, .18); display: flex; flex-direction: column; gap: 9px; }
.dns-block-head { display: flex; justify-content: space-between; align-items: center; font-size: .84rem; }
.verify-detail { margin: 0 0 4px; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.recipe { display: flex; flex-direction: column; gap: 7px; }
.recipe-row { display: grid; grid-template-columns: 62px 1fr 1fr; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); font-size: .82rem; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; font-size: .86rem; }
.steps strong { color: var(--text); }
.onboarding { border-color: rgba(91, 140, 255, .25); }

.tabs { display: inline-flex; gap: 3px; background: var(--panel-2); padding: 3px; border-radius: 8px; }
.tabs a { padding: 4px 11px; border-radius: 6px; font-size: .79rem; color: var(--muted); }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: rgba(91, 140, 255, .2); color: #cfe0ff; }
.tabs-inline { align-self: center; }

.link { color: var(--accent-2); font-weight: 550; }
.link:hover { color: #a8c2ff; text-decoration: underline; }
.hint-quiet { color: var(--dim); font-size: .78rem; }

.input { width: auto; }

.error-code { margin: 0; font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; color: var(--accent-2); text-align: center; }

/* ---------------------------------------------------------------- portal */
.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line-soft);
  background: rgba(15, 21, 32, .85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.portal-who { display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.portal-who form { margin: 0; }
.portal-main { width: 100%; max-width: 980px; margin: 0 auto; }
.subrow td { padding-top: 0; }
.subrow-inner { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.auth-foot a { color: var(--accent); }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card {
  width: min(392px, 100%); padding: 30px 28px;
  background: linear-gradient(180deg, rgba(23, 32, 49, .92), rgba(17, 23, 34, .92));
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 34px 70px -40px rgba(0, 0, 0, .95);
}
.auth-card-slim { text-align: center; display: flex; flex-direction: column; gap: 12px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand h1 { margin: 0; font-size: 1.24rem; letter-spacing: -.015em; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.auth-foot { margin: 16px 0 0; text-align: center; color: var(--dim); font-size: .76rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols, .cols-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 12px 14px; overflow-x: auto;
  }
  .brand { flex: none; padding: 0; }
  .brand-text { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav a { padding: 8px 10px; }
  .nav a span, .nav a svg { }
  .sidebar-foot { flex-direction: row; align-items: center; border-top: 0; border-left: 1px solid var(--line-soft); padding: 0 0 0 14px; }
  .who small { display: none; }
  .main { padding: 20px 16px 50px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .stat-grid, .stat-grid-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; }
}


/* ---------------------------------------------------------------- live sessions */
.stat-live .stat-value { color: var(--ok); }
.stat-live { border-color: rgba(61, 220, 151, .28); }

.filter-bar { margin: 16px 0 14px; gap: 8px; }

.live-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; align-items: start;
}

.live-card {
  display: flex; flex-direction: column; gap: 11px;
  padding: 14px; border-radius: var(--radius); min-width: 0;
  background: linear-gradient(180deg, rgba(23, 32, 49, .85), rgba(19, 26, 38, .85));
  border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  transition: border-color .2s, opacity .35s, transform .2s;
}
.live-card:hover { border-color: #2c3d5c; }
.live-card.is-new { animation: live-in .35s ease-out; }
.live-card.is-gone { opacity: 0; transform: scale(.97); }
.live-card.is-ended { opacity: .72; }
@keyframes live-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.live-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.live-head div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.live-host { font-weight: 600; font-size: .9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-host:hover { color: #cfe0ff; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--dim); }
.live-dot.is-on {
  background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, .55);
  animation: pulse 2s infinite;
}
.live-dot.is-off { background: #46566e; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .5); }
  70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.live-desc {
  font-size: .82rem; color: #cddcf5; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(91, 140, 255, .08); border: 1px solid rgba(91, 140, 255, .16);
  min-height: 54px; overflow-wrap: anywhere;
}

.live-screen {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); background: #0a1017;
}
.live-frame-wrap { position: relative; height: 230px; overflow: hidden; background: #fff; }
.live-frame {
  width: 200%; height: 200%; border: 0; display: block;
  transform: scale(.5); transform-origin: 0 0;
}
.live-frame-empty {
  display: grid; place-items: center; height: 100%; color: var(--dim); font-size: .8rem;
  background: var(--panel-2);
}
.live-screen-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 9px; border-top: 1px solid var(--line-soft); background: var(--panel-2);
}
.live-screen-lg .live-frame-wrap { height: 420px; }
.live-screen-lg .live-frame { width: 100%; height: 100%; transform: none; }
.live-screen-lg { margin-bottom: 10px; }

.live-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.live-meta div { display: flex; flex-direction: column; min-width: 0; }
.live-meta dt { color: var(--dim); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.live-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live-fields { display: flex; flex-wrap: wrap; gap: 5px; }
.field-chip {
  display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%;
  padding: 3px 8px; border-radius: 7px; font-size: .74rem;
  background: rgba(61, 220, 151, .09); border: 1px solid rgba(61, 220, 151, .2); color: #d6f7e8;
  overflow-wrap: anywhere;
}
.field-chip em { font-style: normal; color: #8fe8bd; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.field-chip b { font-weight: 500; color: #eafaf3; }
.live-foot { display: flex; gap: 7px; flex-wrap: wrap; }
.live-foot .btn { flex: 1; }
.live-card.is-frozen { border-color: rgba(255, 200, 96, .45); }
[hidden] { display: none !important; }
.preview-pages {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px;
  border-top: 1px solid var(--line-soft); background: var(--panel-2);
}
.preview-pages .btn { flex: 0 0 auto; }
.preview-pages .btn.is-active {
  color: var(--text); background: rgba(91, 140, 255, .22);
  border-color: rgba(91, 140, 255, .5);
}

.cols-wide-left { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.subhead { margin: 18px 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent); }
.tl-open { background: var(--ok); }
.tl-navigate { background: var(--info); }
.tl-update { background: var(--warn); }
.tl-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.tl-body strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text); }
.tl-body p { flex-basis: 100%; margin: 2px 0 0; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 1080px) {
  .cols-wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .live-meta { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- cloned pages */
.ig-addr-form { display: none; margin-top: 14px; padding: 16px; border: 1px solid #d5d9e0;
  border-radius: 10px; background: #fbfcfe; font: 13px/1.45 system-ui, -apple-system, sans-serif; }
.ig-addr-form.is-open { display: block; }
.ig-addr-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.ig-addr-fields label { display: flex; flex-direction: column; gap: 4px; color: #4a5568; font-size: 12px; }
.ig-addr-fields input { padding: 8px 10px; border: 1px solid #c3cad6; border-radius: 7px; font: inherit;
  color: #1a202c; background: #fff; }
.ig-addr-fields input:focus { outline: 2px solid #ff5a00; outline-offset: 1px; border-color: #ff5a00; }
.ig-addr-actions { display: flex; gap: 10px; margin-top: 14px; }
.ig-addr-save, .ig-addr-cancel { padding: 8px 16px; border-radius: 7px; font: 600 13px system-ui, sans-serif;
  cursor: pointer; border: 1px solid transparent; }
.ig-addr-save { background: #ff5a00; color: #fff; }
.ig-addr-save:hover { background: #e64f00; }
.ig-addr-cancel { background: #fff; color: #4a5568; border-color: #c3cad6; }
.ig-addr-cancel:hover { background: #f1f4f9; }
/* ---------------------------------------------------------------- bare account pages */
.shell-bare { display: block; min-height: 100vh; }
.shell-bare .main { max-width: 1080px; margin: 0 auto; padding: 28px 22px 60px; }
.shell-bare .topbar { margin-bottom: 18px; }
.shell-bare .tabs { margin-left: auto; }
/* ---------------------------------------------------------------- mailer */
.live-foot .btn:only-child { flex: 1; }
.table td strong + .muted { display: block; }

/* ---------------------------------------------------------------- offers editor */
.offer-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.offer-thumbs img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 7px;
  border: 1px solid var(--line-soft); background: var(--panel-2);
}

/* keep the mobile nav visibly scrollable instead of silently clipped */
@media (max-width: 820px) {
  .sidebar { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .sidebar::-webkit-scrollbar { height: 5px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
}

/* offer editor sections */
.form-sub {
  grid-column: 1 / -1; margin: 8px 0 -4px; padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.form-sub:first-child { border-top: 0; padding-top: 0; }
