:root {
  color-scheme: dark;
  --ink: #15120f;
  --charcoal: #222222;
  --panel: #211d19;
  --panel-2: #29231e;
  --sand: #f5e7c6;
  --cream: #faf3e1;
  --orange: #ff6d1f;
  --muted: rgba(245, 231, 198, .6);
  --line: rgba(245, 231, 198, .11);
  --line-strong: rgba(245, 231, 198, .2);
  --green: #f5e7c6;
  --red: #ff6d1f;
  --pink: #ff6d1f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(70rem 35rem at 72% -15%, rgba(255, 109, 31, .11), transparent 62%),
    linear-gradient(120deg, #17130f, #110f0d 68%);
  color: var(--cream);
  font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.app-layout { min-height: 100dvh; display: grid; grid-template-columns: 76px minmax(0, 1fr); }
.side-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 76px;
  padding: 18px 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(15, 13, 11, .86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.rail-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--orange);
  color: var(--ink);
  font-size: 21px;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(255, 109, 31, .22);
}
.tabs { width: 100%; margin-top: 34px; display: flex; align-items: center; flex-direction: column; gap: 10px; }
.tab {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(245, 231, 198, .46);
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.tab:hover { color: var(--cream); background: rgba(245, 231, 198, .06); }
.tab.active { color: var(--ink); background: var(--orange); }
.tab svg { width: 21px; height: 21px; fill: currentColor; }
.tab > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.badge { position: absolute; right: -3px; top: -3px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 20px; background: var(--cream); color: var(--ink); font-size: 9px; font-style: normal; font-weight: 900; }
.rail-status { margin-top: auto; width: 34px; height: 34px; display: grid; place-items: center; }
.rail-status span { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(255, 109, 31, .1); }

.app-shell { grid-column: 2; width: min(100%, 1540px); margin: 0 auto; padding: 0 24px 54px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 15, 12, .8);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.page-context { min-width: 0; display: flex; flex-direction: column; line-height: 1.18; }
.page-context span { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.page-context strong { margin-top: 4px; font-size: 16px; letter-spacing: -.01em; }
.top-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.updated { max-width: 190px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(255, 109, 31, .08); }
.icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(245, 231, 198, .05);
  color: var(--cream);
  font-size: 20px;
  cursor: pointer;
}

main { padding-top: 20px; }
.dashboard-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr); gap: 14px; }
.hero {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent 0 64%, rgba(255, 109, 31, .04) 64% 65%, transparent 65%),
    linear-gradient(180deg, rgba(245, 231, 198, .035), transparent),
    var(--panel);
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  right: 28px;
  left: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 231, 198, .1));
}
.hero::before { top: 36%; }
.hero::after { top: 68%; }
.eyebrow, .control-label { color: var(--orange); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.hero h1 { margin: 13px 0 4px; font-size: clamp(56px, 7vw, 88px); line-height: .9; letter-spacing: -.075em; }
.hero p { width: min(520px, 75%); margin: 18px 0 0; color: var(--muted); }
.hero-meta { position: absolute; right: 28px; bottom: 24px; left: 32px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.hero-meta span { display: flex; align-items: center; gap: 7px; }
.hero-meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.control-card {
  min-height: 238px;
  padding: 25px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(250, 243, 225, .45), transparent 40%),
    linear-gradient(145deg, #ff985f, var(--orange) 46%, #7a3616 120%);
  color: #21140d;
  box-shadow: 0 24px 60px rgba(255, 109, 31, .16);
}
.control-card .control-label { color: rgba(33, 20, 13, .62); }
.control-card h2 { max-width: 250px; margin: 18px 0 8px; font-size: 25px; line-height: 1.03; letter-spacing: -.035em; }
.control-card p { max-width: 290px; margin: 0 0 22px; color: rgba(33, 20, 13, .72); font-size: 12px; }
.primary, .secondary { min-height: 44px; padding: 11px 16px; border-radius: 11px; font-weight: 800; cursor: pointer; }
.primary { margin-top: auto; border: 0; background: var(--cream); color: var(--ink); box-shadow: 0 10px 30px rgba(52, 25, 10, .17); }
.secondary { border: 1px solid var(--line-strong); background: rgba(245, 231, 198, .05); color: var(--cream); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 26px; }
.metrics article { min-width: 0; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(33, 29, 25, .82); }
.metrics span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.metrics strong { color: var(--cream); font-size: 24px; line-height: 1; }
.metrics strong.green, .metrics strong.pink { color: var(--orange); }

.tab-page { display: none; }
.tab-page.active { display: block; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 14px; }
.section-head h2 { margin: 0 0 3px; font-size: 21px; letter-spacing: -.025em; }
.section-head p, .setup-card p { margin: 0; color: var(--muted); font-size: 12px; }
.section-head input { min-width: 240px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; background: rgba(245, 231, 198, .04); color: var(--cream); }
.section-head input::placeholder { color: var(--muted); }
.section-head input:focus { border-color: rgba(255, 109, 31, .75); }

.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.client-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(33, 29, 25, .86); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.client-card:hover { border-color: rgba(255, 109, 31, .55); background: var(--panel-2); }
.client-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.client-name { min-width: 0; overflow: hidden; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.state { flex: 0 0 auto; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 9px; font-weight: 750; }
.state.online { border-color: rgba(255, 109, 31, .4); background: rgba(255, 109, 31, .1); color: var(--orange); }
.card-traffic { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 23px 0 16px; }
.card-traffic strong { display: block; font-size: 23px; font-weight: 650; letter-spacing: -.035em; }
.card-traffic small { display: block; color: var(--muted); font-size: 10px; }
.mini-top { min-height: 78px; padding-top: 10px; border-top: 1px solid var(--line); }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--sand); font-size: 11px; }
.mini-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-tag { display: inline-flex; max-width: 100%; overflow: hidden; padding: 2px 6px; border-radius: 4px; background: rgba(255, 109, 31, .12); color: var(--orange); font-size: 9px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.alert-chip { color: var(--orange); font-size: 10px; font-weight: 800; white-space: nowrap; }
.skeleton { height: 205px; border-radius: 14px; background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 200%; animation: pulse 1.2s infinite; }
@keyframes pulse { to { background-position: -200%; } }

.alerts-list { display: grid; gap: 8px; }
.alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.alert-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 109, 31, .11); color: var(--orange); font-size: 11px; font-weight: 900; }
.alert-row h3 { margin: 0; font-size: 13px; }
.alert-row p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.alert-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.empty { padding: 38px 18px; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--muted); text-align: center; }

.setup-card { width: min(100%, 760px); margin: 9px auto; display: flex; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.setup-card h3 { margin: 0 0 3px; font-size: 14px; }
.setup-card button { margin-top: 11px; }
.step { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--orange); color: var(--ink); font-weight: 900; }
.test-card { border-color: rgba(255, 109, 31, .35); }
.status-line { color: var(--muted); text-align: center; }

.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.drawer { position: fixed; z-index: 41; right: 0; top: 0; bottom: 0; width: min(600px, 100%); overflow: auto; border-left: 1px solid var(--line); background: #191512; box-shadow: -30px 0 80px rgba(0, 0, 0, .55); transform: translateX(102%); transition: transform .24s ease; overscroll-behavior: contain; }
.drawer.open { transform: none; }
.drawer-head { position: sticky; top: 0; z-index: 2; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(25, 21, 18, .92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.drawer-head > div { min-width: 0; }
.drawer-head h2 { margin: 3px 0 0; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { padding: 16px 20px calc(46px + env(safe-area-inset-bottom)); }
.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.detail-metrics div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.detail-metrics span { display: block; color: var(--muted); font-size: 10px; }
.detail-metrics strong { display: block; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.detail-section { margin-top: 20px; }
.detail-section h3 { margin: 0 0 8px; font-size: 13px; }
.data-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.data-row .host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-row small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.ip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-pill { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--sand); font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50; width: max-content; max-width: calc(100% - 28px); padding: 11px 15px; border: 1px solid rgba(255, 109, 31, .45); border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); transform: translateX(-50%); text-align: center; }

@media (max-width: 1050px) {
  .dashboard-top { grid-template-columns: minmax(0, 1.3fr) minmax(260px, .8fr); }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-layout { display: block; }
  .side-rail { inset: auto 0 0 0; width: 100%; height: calc(66px + env(safe-area-inset-bottom)); padding: 6px 10px env(safe-area-inset-bottom); align-items: stretch; border: 0; border-top: 1px solid var(--line); background: rgba(20, 17, 14, .94); }
  .rail-logo, .rail-status { display: none; }
  .tabs { height: 100%; margin: 0; align-items: stretch; flex-direction: row; justify-content: space-around; gap: 5px; }
  .tab { width: auto; height: 100%; flex: 1 1 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border-radius: 9px; }
  .tab svg { width: 18px; height: 18px; }
  .tab > span { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: inherit; font-size: 9px; font-weight: 750; white-space: nowrap; }
  .badge { right: calc(50% - 25px); top: 1px; }
  .app-shell { width: 100%; padding: 0 12px calc(88px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 62px; }
  .page-context span { font-size: 8px; }
  .page-context strong { font-size: 14px; }
  .updated { display: none; }
  main { padding-top: 12px; }
  .dashboard-top { grid-template-columns: 1fr; gap: 8px; }
  .hero { min-height: 185px; padding: 21px 18px; border-radius: 14px; }
  .hero h1 { margin-top: 10px; font-size: 60px; }
  .hero p { width: 100%; margin-top: 12px; padding-right: 10px; font-size: 12px; }
  .hero-meta { right: 18px; bottom: 15px; left: 18px; padding-top: 9px; font-size: 9px; }
  .hero-meta span:last-child { display: none; }
  .control-card { min-height: 152px; padding: 17px; border-radius: 14px; }
  .control-card h2 { margin: 10px 0 4px; font-size: 20px; }
  .control-card p { margin-bottom: 14px; }
  .control-card .primary { width: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 8px 0 20px; }
  .metrics article { min-height: 70px; padding: 11px 12px; display: block; border-radius: 11px; }
  .metrics span { display: block; font-size: 9px; white-space: normal; }
  .metrics strong { display: block; margin-top: 8px; font-size: 22px; }
  .section-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .section-head h2 { font-size: 19px; }
  .section-head input, .section-head .secondary { width: 100%; min-width: 0; }
  .client-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .client-card { padding: 14px; border-radius: 12px; }
  .alert-row { grid-template-columns: auto minmax(0, 1fr); }
  .alert-time { grid-column: 2; }
  .setup-card { gap: 11px; padding: 14px; }
  .setup-card .primary, .setup-card .secondary { width: 100%; }
  .drawer { left: 0; right: 0; top: auto; width: 100%; max-height: min(88dvh, 820px); border: 1px solid var(--line); border-width: 1px 0 0; border-radius: 18px 18px 0 0; transform: translateY(102%); }
  .drawer.open { transform: none; }
  .drawer-head { padding: 22px 15px 12px; border-radius: 18px 18px 0 0; }
  .drawer-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 3px; border-radius: 9px; background: var(--line-strong); transform: translateX(-50%); }
  .drawer-body { padding: 14px 15px calc(24px + env(safe-area-inset-bottom)); }
  .detail-metrics div { padding: 9px 7px; }
  .detail-metrics strong { font-size: 13px; }
  .data-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .data-row small:last-child { grid-column: 1 / -1; }
}

@media (max-width: 370px) {
  .hero h1 { font-size: 52px; }
  .metrics article { min-height: 66px; }
}

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

/* Admin console v3 ------------------------------------------------------- */
select, textarea, dialog input { font: inherit; }
.tab .nav-glyph { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 20px; font-weight: 900; line-height: 1; }
.attention-number { margin: 8px 0 0; font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -.07em; }
.orange { color: var(--orange) !important; }
.node-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.server-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.node-card, .inbound-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.node-card.is-down { border-color: rgba(255,109,31,.45); }
.node-head, .node-head > div, .node-foot, .node-actions { display: flex; align-items: center; }
.node-head { justify-content: space-between; gap: 12px; }
.node-head > div { min-width: 0; gap: 9px; }
.node-head strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.node-flag { font-size: 20px; }
.node-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 22px 0 16px; }
.node-stats div { position: relative; min-width: 0; padding-bottom: 9px; }
.node-stats span { display: block; color: var(--muted); font-size: 9px; }
.node-stats b { font-size: 16px; }
.node-stats i { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; overflow: hidden; border-radius: 4px; background: var(--line); }
.node-stats i::after { content:""; display:block; width:var(--fill); height:100%; border-radius:inherit; background:var(--orange); }
.node-foot { flex-wrap: wrap; justify-content: space-between; gap: 7px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.node-actions { flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.node-actions > * { flex: 1 1 120px; text-align: center; }
.button-link { display: inline-grid; place-items: center; text-decoration: none; }
.danger-soft { min-height:44px; padding:10px 14px; border:1px solid rgba(255,109,31,.38); border-radius:11px; background:rgba(255,109,31,.08); color:var(--orange); font-weight:800; cursor:pointer; }
.error-text { min-height: 88px; color: var(--orange); word-break: break-word; }
.inbound-panel { grid-column: span 1; padding-top: 12px; }
.inbound-panel h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.inbound-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; align-items:center; gap:12px; padding:11px 0; border-top:1px solid var(--line); }
.inbound-row > div { min-width: 0; }
.inbound-row strong,.inbound-row b,.inbound-row span { display:block; }
.inbound-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.inbound-row div span { color:var(--muted); font-size:9px; }
.inbound-row div:not(:first-child) { text-align:right; }

.toolbar { display:flex; gap:8px; margin-bottom:10px; }
.toolbar input,.toolbar select,.form-dialog input,.form-dialog select,.reply-box textarea { min-height:44px; padding:10px 13px; border:1px solid var(--line-strong); border-radius:11px; outline:none; background:rgba(245,231,198,.04); color:var(--cream); }
.toolbar input { flex:1; }.toolbar select { min-width:160px; }
.admin-client-list { display:grid; gap:7px; }
.admin-client-row { width:100%; display:grid; grid-template-columns:minmax(240px,1.5fr) minmax(90px,.6fr) minmax(70px,.45fr) auto auto; align-items:center; gap:16px; padding:13px 15px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--cream); text-align:left; cursor:pointer; }
.admin-client-row:hover { border-color:rgba(255,109,31,.5); background:var(--panel-2); }
.client-identity { min-width:0; display:flex; align-items:center; gap:11px; }
.client-identity div { min-width:0; }.client-identity strong,.client-identity small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.client-identity small,.client-cell span { color:var(--muted); font-size:9px; }
.package { flex:0 0 32px; width:32px; height:32px; display:grid; place-items:center; border-radius:9px; background:var(--orange); color:var(--ink); font-size:10px; font-weight:950; }.package.work { background:var(--sand); }
.client-cell span,.client-cell b { display:block; }.client-cell b { font-size:12px; }.row-arrow { color:var(--orange); font-size:22px; }
.client-summary { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.link-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--line); }.link-row span { overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }.action-grid .wide { grid-column:1/-1; }

.request-list { display:grid; gap:10px; }.request-card { display:flex; justify-content:space-between; gap:20px; padding:18px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }.request-card h3 { margin:5px 0 3px; }.request-card p { margin:0; color:var(--muted); font-size:11px; }.request-card pre { max-width:700px; overflow:auto; padding:9px; border-radius:8px; background:rgba(0,0,0,.18); color:var(--muted); font-size:9px; }.request-actions { display:flex; align-items:center; gap:7px; }

.support-layout { min-height:620px; display:grid; grid-template-columns:minmax(240px,.7fr) minmax(0,1.5fr); overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--panel); }
.ticket-list { overflow:auto; border-right:1px solid var(--line); }.ticket { width:100%; padding:14px; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--cream); text-align:left; cursor:pointer; }.ticket:hover,.ticket.active { background:rgba(255,109,31,.07); }.ticket.active { box-shadow:inset 3px 0 var(--orange); }.ticket > div { display:flex; justify-content:space-between; gap:8px; }.ticket p { margin:6px 0 2px; overflow:hidden; color:var(--muted); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }.ticket small { color:var(--muted); font-size:9px; }
.state.waiting { border-color:rgba(255,109,31,.4); color:var(--orange); }
.conversation { min-width:0; display:flex; flex-direction:column; }.conversation-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 17px; border-bottom:1px solid var(--line); }.conversation-head h3,.conversation-head p { margin:0; }.conversation-head p { color:var(--muted); font-size:10px; }.messages { flex:1; min-height:300px; max-height:480px; overflow:auto; padding:18px; }.message { width:fit-content; max-width:80%; margin:7px 0; padding:10px 12px; border-radius:12px 12px 12px 3px; background:rgba(245,231,198,.07); }.message.admin { margin-left:auto; border-radius:12px 12px 3px 12px; background:rgba(255,109,31,.15); }.message p { margin:0; white-space:pre-wrap; }.message small { display:block; margin-top:5px; color:var(--muted); font-size:8px; }.reply-box { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:13px; border-top:1px solid var(--line); }.reply-box textarea { resize:vertical; }.reply-box .primary { margin:0; }

.work-banner { margin-bottom:12px; display:flex; align-items:center; justify-content:space-between; gap:15px; padding:18px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }.work-banner h2,.work-banner p { margin:0; }.work-banner h2 { font-size:32px; }.work-banner p { color:var(--muted); }.alerts-head { margin-top:28px; }
.audit-list { display:grid; gap:6px; }.audit-row { display:grid; grid-template-columns:auto minmax(140px,.7fr) minmax(0,1fr) auto; align-items:center; gap:12px; padding:11px 13px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }.audit-id { color:var(--orange); font-size:10px; }.audit-row p { margin:2px 0 0; color:var(--muted); font-size:10px; }.audit-row pre { margin:0; overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }.audit-row time { color:var(--muted); font-size:9px; white-space:nowrap; }

.form-dialog { width:min(480px,calc(100% - 24px)); padding:0; border:1px solid var(--line-strong); border-radius:17px; background:#191512; color:var(--cream); box-shadow:var(--shadow); }.form-dialog::backdrop { background:rgba(0,0,0,.75); backdrop-filter:blur(5px); }.form-dialog form { padding:18px; }.dialog-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }.dialog-head h2 { margin:3px 0 0; }.form-dialog label { display:grid; gap:5px; margin:11px 0; color:var(--muted); font-size:10px; }.form-dialog input,.form-dialog select { width:100%; color:var(--cream); }.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }.dialog-actions .primary { margin:0; }
button:disabled { opacity:.45; cursor:wait; }

@media(max-width:1050px){.node-grid{grid-template-columns:1fr 1fr}.server-grid{grid-template-columns:1fr}.inbound-panel{grid-column:auto}.admin-client-row{grid-template-columns:minmax(180px,1fr) auto auto auto}.admin-client-row .client-cell:first-of-type{display:none}}
@media(max-width:720px){
  .tabs{overflow-x:auto;justify-content:flex-start;scrollbar-width:none}.tabs::-webkit-scrollbar{display:none}.tab{flex:0 0 60px;min-width:60px}.tab .nav-glyph{font-size:17px}.tab>span:not(.nav-glyph){position:static;width:auto;height:auto;overflow:visible;clip:auto;font-size:8px;font-weight:750}.badge{right:2px}
  .admin-hero .hero h1{font-size:42px;letter-spacing:-.05em}.attention-number{font-size:44px}.node-grid{grid-template-columns:1fr}.server-grid{grid-template-columns:1fr}.node-actions>*{flex-basis:100%}.inbound-row{grid-template-columns:minmax(0,1fr) auto}.inbound-row>div:nth-child(3){display:none}.inbound-row>.state{grid-column:2}
  .toolbar{flex-direction:column}.toolbar select{width:100%}.admin-client-row{grid-template-columns:minmax(0,1fr) auto auto;padding:12px}.admin-client-row .client-cell{display:none}.admin-client-row>.state{grid-column:2}.row-arrow{grid-column:3;grid-row:1}.request-card{flex-direction:column}.request-actions>*{flex:1}.support-layout{min-height:0;display:block;border:0;background:transparent}.ticket-list{max-height:290px;margin-bottom:10px;border:1px solid var(--line);border-radius:13px}.conversation{min-height:500px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}.messages{max-height:none}.reply-box{grid-template-columns:1fr}.request-actions{width:100%}.audit-row{grid-template-columns:auto minmax(0,1fr) auto}.audit-row pre{display:none}.work-banner{align-items:flex-start;flex-direction:column}.work-banner .secondary{width:100%}
}

/* Mobile-friendly form authentication */
.login-body { min-height:100dvh; display:grid; place-items:center; padding:20px; }
.login-shell { width:min(920px,100%); display:grid; grid-template-columns:1.15fr .85fr; overflow:hidden; border:1px solid var(--line); border-radius:22px; background:var(--panel); box-shadow:var(--shadow); }
.login-brand { min-height:520px; padding:54px; display:flex; align-items:flex-start; flex-direction:column; justify-content:flex-end; background:radial-gradient(circle at 15% 10%,rgba(255,109,31,.28),transparent 45%),linear-gradient(140deg,#2a211a,#161310); }
.login-mark { width:54px; height:54px; margin-bottom:auto; display:grid; place-items:center; border-radius:15px; background:var(--orange); color:var(--ink); font-size:26px; font-weight:950; }
.login-brand h1 { max-width:420px; margin:12px 0 8px; font-size:48px; line-height:.95; letter-spacing:-.055em; }
.login-brand p,.login-card p,.login-card small { color:var(--muted); }
.login-card { padding:42px; display:flex; flex-direction:column; justify-content:center; }
.login-card h2 { margin:8px 0 3px; font-size:28px; }.login-card p { margin:0 0 22px; }
.login-card label { display:grid; gap:6px; margin:8px 0; color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.login-card input { width:100%; min-height:49px; padding:11px 13px; border:1px solid var(--line-strong); border-radius:11px; outline:none; background:rgba(245,231,198,.05); color:var(--cream); font-size:16px; text-transform:none; letter-spacing:0; }
.login-card input:focus { border-color:var(--orange); }.login-card .primary { width:100%; margin:15px 0 12px; }.login-card small { text-align:center; }.login-error { margin:0 0 8px!important; padding:9px 11px; border:1px solid rgba(255,109,31,.4); border-radius:9px; background:rgba(255,109,31,.08); color:var(--orange)!important; font-size:11px; }
@media(max-width:720px){.login-body{padding:0;background:var(--ink)}.login-shell{min-height:100dvh;display:block;border:0;border-radius:0}.login-brand{min-height:255px;padding:calc(28px + env(safe-area-inset-top)) 24px 28px}.login-mark{width:44px;height:44px;margin-bottom:55px}.login-brand h1{font-size:38px}.login-brand p{margin:0}.login-card{padding:28px 24px calc(32px + env(safe-area-inset-bottom))}.login-card h2{font-size:24px}}
