/* MARKOV MOTION Studio — dark glass theme */
:root {
  --bg: #07080f;
  --bg2: #0c0e1a;
  --panel: rgba(18, 21, 38, 0.72);
  --panel-border: rgba(120, 140, 255, 0.14);
  --text: #e9ecf8;
  --muted: #8b93b0;
  --muted2: #5c6380;
  --accent: #6c7bff;
  --accent2: #9d4bff;
  --accent3: #ff4d9d;
  --ok: #37e6a0;
  --warn: #ffb547;
  --err: #ff5d7a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --font: "Inter", "SF Pro Display", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* animated background */
.bg-orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.5; animation: drift 26s ease-in-out infinite alternate; }
.orb-a { width: 620px; height: 620px; background: radial-gradient(circle, #3b2a8f, transparent 70%); top: -180px; left: -120px; }
.orb-b { width: 540px; height: 540px; background: radial-gradient(circle, #14336e, transparent 70%); bottom: -160px; right: -100px; animation-delay: -8s; }
.orb-c { width: 420px; height: 420px; background: radial-gradient(circle, #5a1d55, transparent 70%); top: 40%; left: 55%; animation-delay: -15s; opacity: 0.35; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, -40px) scale(1.1); }
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; opacity: 0.05; pointer-events: none;
  background-image: linear-gradient(rgba(120,140,255,.4) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(120,140,255,.4) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at top, black 20%, transparent 75%);
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

/* glass */
.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow);
}

/* login */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; padding: 40px 34px; text-align: center; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.logo-badge {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 22px; font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2) 55%, var(--accent3));
  box-shadow: 0 10px 40px rgba(109, 90, 255, 0.45);
}
.logo-badge.small { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; margin: 0; }
.login-card h1 { font-size: 26px; letter-spacing: .5px; margin-bottom: 8px; }
.login-card h1 span { background: linear-gradient(90deg, var(--accent), var(--accent3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: var(--muted); margin-bottom: 22px; font-size: 14px; line-height: 1.5; }
.login-err { color: var(--err); margin-top: 12px; font-size: 13px; min-height: 18px; }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0; margin: 14px 0 14px 14px; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 14px; height: calc(100vh - 28px);
}
.side-logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px; }
.side-logo-text { font-size: 15px; line-height: 1.1; letter-spacing: .3px; font-weight: 700; }
.side-logo-text strong { font-weight: 800; }
.side-logo-sub { display: block; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 3px; margin-top: 3px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: none; border-radius: 11px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .18s ease; text-align: left; font-family: var(--font);
}
.nav-item:hover { background: rgba(120,140,255,.09); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(108,123,255,.22), rgba(157,75,255,.14));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(120,140,255,.25);
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.nav-item.subtle { font-size: 12.5px; padding: 8px 13px; color: var(--muted2); }
.side-status { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); font-size: 12.5px; color: var(--muted); }
.side-status-row { display: flex; align-items: center; gap: 8px; }
.side-status-row span:last-child { margin-left: auto; font-weight: 600; color: var(--text); font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); flex-shrink: 0; transition: background .3s; }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px rgba(55,230,160,.7); }
.dot-warn { background: var(--warn); box-shadow: 0 0 8px rgba(255,181,71,.7); }
.dot-err { background: var(--err); box-shadow: 0 0 8px rgba(255,93,122,.7); }
.side-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.model-chain { font-size: 10.5px; color: var(--muted2); line-height: 1.5; padding: 8px 12px; font-family: var(--mono); word-break: break-all; opacity: .8; }

.main { flex: 1; padding: 22px 26px 60px; max-width: 1500px; margin: 0 auto; width: 100%; }
.view { display: none; animation: rise .35s ease both; }
.view.active { display: block; }
.view-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.view-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.head-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* buttons */
.btn {
  font-family: var(--font); font-size: 14px; font-weight: 600; border: none; border-radius: 11px;
  padding: 10px 18px; cursor: pointer; transition: all .16s ease; color: #fff;
  background: linear-gradient(135deg, #4b5ad9, var(--accent2));
  box-shadow: 0 6px 20px rgba(88, 80, 255, .28);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(88, 80, 255, .4); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, #4b5ad9, var(--accent2)); }
.btn-ghost { background: rgba(120,140,255,.08); color: var(--text); box-shadow: none; border: 1px solid var(--panel-border); }
.btn-ghost:hover { background: rgba(120,140,255,.16); }
.btn-warn { background: linear-gradient(135deg, #c96a1f, #8a3a7e); box-shadow: 0 6px 20px rgba(201,106,31,.25); }
.btn-block { width: 100%; }
.btn-big { padding: 14px 18px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; top: 0; right: 0; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(108,123,255,.25), transparent 70%); transform: translate(30px, -30px); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--muted2); }

/* panels */
.panel { padding: 18px 20px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { font-size: 15px; font-weight: 700; }
.panel-head .btn { margin-left: auto; }
.divider-label { text-align: center; color: var(--muted2); font-size: 11px; letter-spacing: 2px; margin: 14px 0 10px; text-transform: uppercase; }
.form-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 14px 0 8px; text-transform: uppercase; letter-spacing: 1px; }

/* inputs */
.input {
  width: 100%; background: rgba(8,10,22,.75); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: 11px; padding: 11px 14px; font-size: 14px; font-family: var(--font); outline: none;
  transition: border .18s, box-shadow .18s;
}
.input:focus { border-color: rgba(108,123,255,.6); box-shadow: 0 0 0 3px rgba(108,123,255,.14); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.grow { flex: 1; }
.form-err { color: var(--err); font-size: 13px; margin-top: 10px; min-height: 0; }
.form-ok { color: var(--ok); font-size: 13px; margin-top: 10px; word-break: break-word; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* new job */
.new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .new-grid { grid-template-columns: 1fr; } }
.dropzone {
  border: 2px dashed rgba(120,140,255,.3); border-radius: 14px; padding: 34px 18px; text-align: center;
  cursor: pointer; transition: all .2s; background: rgba(8,10,22,.4);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(108,123,255,.09); }
.dz-ico { font-size: 30px; margin-bottom: 8px; }
.dz-title { font-size: 15px; font-weight: 600; }
.dz-sub { color: var(--muted2); font-size: 12.5px; margin-top: 4px; }
.file-chip { display: flex; align-items: center; gap: 10px; margin-top: 12px; background: rgba(108,123,255,.12); border: 1px solid rgba(108,123,255,.3); border-radius: 11px; padding: 9px 13px; font-size: 13px; }
.fc-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-size { color: var(--muted); font-size: 12px; }
.fc-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.spec-samples { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.chip {
  align-self: flex-start; background: rgba(120,140,255,.07); border: 1px solid var(--panel-border); color: var(--muted);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; cursor: pointer; transition: all .15s; font-family: var(--font);
}
.chip:hover { color: var(--text); background: rgba(120,140,255,.16); border-color: rgba(120,140,255,.4); }

.fmt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fmt-card { position: relative; border: 1.5px solid var(--panel-border); border-radius: 11px; padding: 17px 12px 12px; cursor: pointer; text-align: center; transition: all .16s; background: rgba(8,10,22,.5); }
.fmt-card:hover { border-color: rgba(120,140,255,.4); }
.fmt-card.active { border-color: var(--accent); background: rgba(108,123,255,.11); box-shadow: 0 0 0 3px rgba(108,123,255,.12); }
.fmt-thumb { height: 44px; border-radius: 6px; margin-bottom: 9px; position: relative; overflow: hidden; background: linear-gradient(160deg, #1c2139, #2a2545); }
.fmt-thumb::before { content: ""; position: absolute; inset: 0; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.09); }
.fmt-912 { width: 26px; height: 42px; margin: 1px auto; background: linear-gradient(180deg, #6c7bff, #9d4bff); border-radius: 3px; position: relative; }
.fmt-11 { width: 34px; height: 34px; margin: 5px auto; background: linear-gradient(135deg, #6c7bff, #ff4d9d); border-radius: 5px; }
.fmt-169 { width: 42px; height: 24px; margin: 10px auto; background: linear-gradient(90deg, #37e6a0, #6c7bff); border-radius: 3px; }
.fmt-name { font-size: 12.5px; font-weight: 600; }
.fmt-tag { font-size: 10.5px; color: var(--muted2); margin-top: 2px; }

.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 900px) { .style-grid { grid-template-columns: repeat(2, 1fr); } }
.style-card { border: 1.5px solid var(--panel-border); border-radius: 12px; padding: 12px; cursor: pointer; transition: all .16s; background: rgba(8,10,22,.5); }
.style-card:hover { border-color: rgba(120,140,255,.4); }
.style-card.active { border-color: var(--accent); background: rgba(108,123,255,.11); box-shadow: 0 0 0 3px rgba(108,123,255,.12); }
.style-swatch { height: 26px; border-radius: 7px; margin-bottom: 9px; }
.style-name { font-size: 12.5px; font-weight: 600; }
.style-desc { font-size: 10.5px; color: var(--muted2); margin-top: 2px; line-height: 1.35; }

.mode-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-btn, .dur-btn {
  background: rgba(8,10,22,.7); border: 1.5px solid var(--panel-border); color: var(--muted);
  border-radius: 10px; padding: 9px 15px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: var(--font);
}
.mode-btn:hover, .dur-btn:hover { color: var(--text); }
.mode-btn.active, .dur-btn.active { border-color: var(--accent); color: #fff; background: rgba(108,123,255,.16); }
.mode-hint { font-size: 12px; color: var(--muted2); margin-top: 8px; line-height: 1.4; }
.dur-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dur-custom { width: 92px; padding: 8px 10px; }

/* library */
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { background: transparent; border: 1px solid var(--panel-border); color: var(--muted); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; transition: all .15s; font-family: var(--font); }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: rgba(108,123,255,.18); border-color: var(--accent); color: #fff; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.job-card { padding: 16px; cursor: pointer; transition: all .18s; position: relative; overflow: hidden; }
.job-card:hover { transform: translateY(-2px); border-color: rgba(120,140,255,.35); }
.job-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.job-thumb { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, #141a33, #241d42); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; overflow: hidden; }
.job-thumb img { width: 100%; height: 100%; object-fit: cover; }
.job-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.job-card-sub { font-size: 11px; color: var(--muted2); margin-top: 3px; font-family: var(--mono); }
.job-card-meta { display: flex; align-items: center; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.meta-chip { font-size: 10.5px; background: rgba(120,140,255,.09); border: 1px solid var(--panel-border); color: var(--muted); padding: 3px 9px; border-radius: 999px; }
.job-card-err { margin-top: 9px; font-size: 11.5px; color: var(--err); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* state badges */
.state-badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 5px 13px; letter-spacing: .5px; text-transform: uppercase; }
.state-QUEUED { background: rgba(140,150,200,.14); color: #a8b0d8; }
.state-RUNNING, .state-ANALYZING, .state-PLANNING, .state-TRANSCRIBING, .state-EDITING, .state-RENDERING, .state-REVIEWING, .state-DELIVERING { background: rgba(108,123,255,.16); color: #9aa5ff; }
.state-COMPLETED { background: rgba(55,230,160,.14); color: var(--ok); }
.state-FAILED, .state-BLOCKED { background: rgba(255,93,122,.15); color: var(--err); }
.state-CANCELLED { background: rgba(140,150,200,.12); color: var(--muted); }

.job-list { display: flex; flex-direction: column; gap: 9px; }
.job-list .job-card { display: flex; align-items: center; gap: 14px; }
.job-list .job-card-title { -webkit-line-clamp: 1; }

/* job detail */
.job-title-wrap h2 { font-size: 21px; }
.job-progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.job-progress { flex: 1; }
.progress { height: 9px; background: rgba(120,140,255,.1); border-radius: 999px; overflow: hidden; position: relative; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3)); background-size: 200% 100%; animation: flow 2.4s linear infinite; transition: width .6s ease; }
@keyframes flow { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
.job-stage { font-size: 12.5px; color: var(--muted); min-width: 120px; text-align: right; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }

.job-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--panel-border); margin-bottom: 16px; flex-wrap: wrap; }
.job-tab { background: none; border: none; color: var(--muted); padding: 10px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; font-family: var(--font); }
.job-tab:hover { color: var(--text); }
.job-tab.active { color: #fff; border-bottom-color: var(--accent); }
.job-tab-pane { display: none; animation: rise .3s ease both; }
.job-tab-pane.active { display: block; }

.job-video-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--panel-border); background: #000; margin-bottom: 14px; box-shadow: var(--shadow); }
.job-video-wrap video { width: 100%; max-height: 62vh; display: block; background: #000; }

.job-files { display: flex; gap: 9px; flex-wrap: wrap; }
.file-btn {
  background: rgba(120,140,255,.07); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-size: 12.5px; cursor: pointer; transition: all .15s; font-family: var(--font); font-weight: 600;
}
.file-btn:hover { background: rgba(120,140,255,.16); }
.file-btn .fb-size { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 11px; }

/* plan */
.plan-box { display: flex; flex-direction: column; gap: 12px; }
.plan-section { background: rgba(8,10,22,.5); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 16px; }
.plan-section h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.plan-section h4 span { color: var(--accent); }
.concept-block { font-size: 14px; line-height: 1.6; }
.seg-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid rgba(120,140,255,.07); font-size: 13.5px; }
.seg-row:last-child { border-bottom: none; }
.seg-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted2); min-width: 84px; }
.seg-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; background: rgba(108,123,255,.14); color: #9aa5ff; border-radius: 6px; padding: 3px 7px; }
.seg-text { flex: 1; line-height: 1.4; }
.gfx-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid rgba(120,140,255,.07); }
.gfx-row:last-child { border-bottom: none; }
.gfx-type { font-family: var(--mono); font-size: 11px; color: var(--accent3); min-width: 110px; }
.json-block { font-family: var(--mono); font-size: 12px; color: var(--muted); background: rgba(8,10,22,.6); border-radius: 10px; padding: 12px; overflow-x: auto; line-height: 1.5; max-height: 380px; }

/* qa */
.qa-box { display: flex; flex-direction: column; gap: 12px; }
.qa-score-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.qa-score-ring { width: 96px; height: 96px; position: relative; flex-shrink: 0; }
.qa-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.qa-score-ring .ring-bg { fill: none; stroke: rgba(120,140,255,.14); stroke-width: 9; }
.qa-score-ring .ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.qa-score-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.qa-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(120,140,255,.07); font-size: 13.5px; }
.qa-item:last-child { border-bottom: none; }
.qa-verdict { font-size: 10.5px; font-weight: 800; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; letter-spacing: .5px; flex-shrink: 0; margin-top: 1px; }
.v-ok { background: rgba(55,230,160,.14); color: var(--ok); }
.v-warn { background: rgba(255,181,71,.14); color: var(--warn); }
.v-fail { background: rgba(255,93,122,.15); color: var(--err); }
.qa-frames { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.qa-frame { border-radius: 10px; overflow: hidden; border: 1px solid var(--panel-border); width: 150px; }
.qa-frame img { width: 100%; display: block; }
.qa-frame-caption { font-size: 10.5px; color: var(--muted2); padding: 5px 8px; font-family: var(--mono); }

/* events */
.events-box { display: flex; flex-direction: column-reverse; gap: 4px; max-height: 62vh; overflow-y: auto; padding-right: 6px; }
.event-row { display: flex; gap: 10px; align-items: baseline; font-size: 12.8px; padding: 7px 10px; border-radius: 8px; background: rgba(8,10,22,.4); border: 1px solid rgba(120,140,255,.05); }
.event-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted2); white-space: nowrap; }
.event-level { font-size: 9.5px; font-weight: 800; letter-spacing: .5px; padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
.el-INFO { background: rgba(108,123,255,.13); color: #9aa5ff; }
.el-STATE { background: rgba(55,230,160,.13); color: var(--ok); }
.el-WARN { background: rgba(255,181,71,.14); color: var(--warn); }
.el-ERROR { background: rgba(255,93,122,.15); color: var(--err); }
.event-msg { flex: 1; line-height: 1.45; }

/* actions */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.action-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 15px 10px; border-radius: 12px; border: 1.5px solid var(--panel-border); background: rgba(8,10,22,.5); color: var(--text); cursor: pointer; transition: all .16s; font-family: var(--font); font-size: 13px; font-weight: 600; }
.action-btn:hover { border-color: rgba(108,123,255,.5); background: rgba(108,123,255,.1); transform: translateY(-1px); }
.action-btn .ab-ico { font-size: 21px; }
.action-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.rebuild-row { display: flex; gap: 8px; margin-bottom: 8px; }

/* publish platforms */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.plat-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--panel-border); background: rgba(8,10,22,.5); cursor: pointer; transition: all .15s; font-size: 12.5px; font-weight: 600; color: var(--text); }
.plat-item:hover { border-color: rgba(120,140,255,.4); }
.plat-item.active { border-color: var(--ok); background: rgba(55,230,160,.08); box-shadow: 0 0 0 2px rgba(55,230,160,.1); }
.plat-ico { font-size: 16px; }
.plat-name { flex: 1; }
.plat-check { color: var(--ok); font-weight: 800; }

/* chain */
.chain-wrap { display: flex; flex-direction: column; gap: 8px; }
.chain-item { display: flex; align-items: center; gap: 10px; background: rgba(8,10,22,.55); border: 1px solid var(--panel-border); border-radius: 11px; padding: 10px 13px; }
.chain-pos { font-family: var(--mono); font-size: 11px; color: var(--muted2); min-width: 42px; }
.chain-name { font-family: var(--mono); font-size: 12.5px; font-weight: 600; flex: 1; }
.chain-role { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .7px; }
.chain-lat { font-size: 11.5px; font-family: var(--mono); }
.chain-note { font-size: 11.5px; color: var(--muted2); margin-top: 10px; }
.ping-ok { color: var(--ok); }
.ping-fail { color: var(--err); }
.ping-idle { color: var(--muted2); }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 99; }
.toast { background: rgba(16,18,34,.94); border: 1px solid var(--panel-border); border-left: 3px solid var(--accent); border-radius: 11px; padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow); animation: slideIn .3s ease both; max-width: 340px; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(120,140,255,.18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,140,255,.3); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; position: static; height: auto; margin: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-status, .side-footer { display: none; }
  .main { padding: 16px; }
  .stat-value { font-size: 24px; }
}