/* Kontent Zavod — web panel (n8n uslubidagi qorong'i dizayn) */
:root {
  color-scheme: dark;
  --bg: #0d0e10;
  --dot: rgba(255, 255, 255, .055);
  --side: #111215;
  --card: #15171b;
  --card-2: #1b1e23;
  --node: #181b20;
  --text: #e8eaed;
  --muted: #8b929d;
  --faint: #5d636d;
  --accent: #c6f432;
  --accent-text: #12160a;
  --accent-soft: rgba(198, 244, 50, .09);
  --soft: #1f2328;
  --border: #272a31;
  --border-2: #343841;
  --edge: #4a4f59;
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, .10);
  --warn: #f5b942;
  --warn-bg: rgba(245, 185, 66, .10);
  --err: #ff5d61;
  --err-bg: rgba(255, 93, 97, .11);
  --info-bg: rgba(198, 244, 50, .06);
  --link: #d6f86a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .25);
  --radius: 12px;
  --nav-h: 62px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
/* Telegram Mini App ham shu qorong'i ranglarda */
html.tg { --shadow: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 15px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
ul, ol { margin: 0; padding-left: 20px; }
input, textarea, select, button { font: inherit; color: inherit; }
::selection { background: rgba(198, 244, 50, .3); }

.boot, .loading-page {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  min-height: 40vh; color: var(--muted); font-family: var(--mono); font-size: 13px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.empty { color: var(--muted); margin: 4px 0; }

/* ---------- qobiq ---------- */
.layout { min-height: 100vh; }
.content { max-width: 1160px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.main[data-view="page"] { max-width: 860px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand b { font-size: 15px; letter-spacing: -.01em; }
.brand .bot-name { font-family: var(--mono); font-size: 12px; }
.logo-sm {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-text);
  font: 800 13px/1 var(--mono); letter-spacing: -.02em;
  box-shadow: 0 0 0 1px rgba(198, 244, 50, .35), 0 0 18px rgba(198, 244, 50, .18);
}
.crumb { display: none; font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 0; }
.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { color: var(--faint); margin: 0 6px; }
.side-brand { display: none; }
html.tg .top { display: none; }
html.tg .content { padding-top: 12px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: rgba(17, 18, 21, .96); border-top: 1px solid var(--border);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 9px; color: var(--muted); font-size: 11px; text-decoration: none;
  min-width: 0; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; line-height: 1; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (min-width: 900px) {
  .layout { display: flex; }
  .side {
    width: 224px; flex: none; position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    background: var(--side); border-right: 1px solid var(--border);
  }
  .side-brand {
    display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px;
    border-bottom: 1px solid var(--border); margin-bottom: 10px;
  }
  .side-brand b { font-size: 15px; display: block; }
  .side-brand .bot-name { font-family: var(--mono); font-size: 12px; }
  .nav {
    position: static; flex-direction: column; justify-content: flex-start; gap: 2px;
    background: transparent; border-top: 0; padding: 0 10px 12px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav a { flex: none; flex-direction: row; gap: 10px; font-size: 14px; padding: 9px 12px; border-radius: 8px; }
  .nav a.active { color: var(--text); background: var(--card-2); box-shadow: inset 2px 0 0 var(--accent); }
  .nav a.active .nav-icon { color: var(--accent); }
  .nav-icon svg { width: 18px; height: 18px; }
  .side-foot {
    margin-top: auto; padding: 12px 16px 16px; border-top: 1px solid var(--border);
    font: 11px/1.5 var(--mono); color: var(--faint);
  }
  .content { flex: 1; min-width: 0; padding: 0 28px 40px; }
  .top { padding: 16px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
  .top .brand { display: none; }
  .crumb { display: block; }
}
.side-foot { display: none; }
@media (min-width: 900px) { .side-foot { display: block; } }

/* ---------- kartochkalar ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; }
.card-head .more { font: 12px var(--mono); white-space: nowrap; color: var(--muted); }
.card-head .more:hover { color: var(--accent); text-decoration: none; }
.mono-head {
  font: 600 11.5px/1.4 var(--mono) !important; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.page-head { margin: 4px 0 16px; }
.page-head h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.page-head .back { display: inline-block; margin-bottom: 8px; font: 13px var(--mono); color: var(--muted); }
.page-head .back:hover { color: var(--accent); text-decoration: none; }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(198, 244, 50, .13), transparent 55%),
    var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; margin-bottom: 14px;
}
.hero h1 { font-size: 24px; margin-bottom: 2px; }
.hero p { color: var(--muted); font-family: var(--mono); font-size: 13px; margin-bottom: 4px; }
.hero a.chip:hover { border-color: var(--accent); text-decoration: none; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 9px; border-radius: 6px; font: 12px/1.5 var(--mono);
  background: var(--soft); color: var(--text); border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.chip.soft { background: transparent; color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(74, 222, 128, .25); }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(245, 185, 66, .28); }
.chip.strong { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }

.alert {
  padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; overflow-wrap: anywhere;
  border: 1px solid var(--border); border-left-width: 3px;
}
.alert.err { background: var(--err-bg); color: #ffb3b5; border-color: rgba(255, 93, 97, .35); border-left-color: var(--err); }
.alert.warn { background: var(--warn-bg); color: #ffd98f; border-color: rgba(245, 185, 66, .3); border-left-color: var(--warn); }
.alert.info { background: var(--info-bg); border-left-color: var(--accent); }
.brief {
  background: var(--card-2); border: 1px dashed var(--border-2);
  padding: 10px 12px; border-radius: 8px; margin: 10px 0; overflow-wrap: anywhere;
}
.brief ul { margin-top: 4px; }

.busy {
  display: flex; align-items: center; gap: 10px;
  background: var(--info-bg); border: 1px solid rgba(198, 244, 50, .22); color: var(--text);
  border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px;
}
.card .busy, .topic .busy { margin: 10px 0 0; }

/* ---------- tugmalar ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions:first-child { margin-top: 0; }
.actions.sticky {
  position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
  background: var(--card); padding: 10px 0 2px; margin-top: 8px;
}
@media (min-width: 900px) { .actions.sticky { bottom: 0; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 14px; cursor: pointer;
  text-align: center; text-decoration: none; line-height: 1.25;
  transition: filter .15s, opacity .15s, border-color .15s, background .15s;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { filter: brightness(.93); }
.btn:focus-visible, .nav a:focus-visible, .flow-node:focus-visible, .feed-row:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.ghost { background: var(--card-2); color: var(--text); border-color: var(--border-2); }
.btn.ghost:hover { border-color: #4a4f59; filter: none; background: #20242a; }
.btn.ok { background: var(--ok); color: #06210f; }
.btn.danger { background: transparent; color: var(--err); border-color: rgba(255, 93, 97, .4); }
.btn.danger:hover { background: var(--err-bg); filter: none; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.btn.icon { min-width: 30px; padding: 4px 8px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: default; filter: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent;
  animation: spin .8s linear infinite;
}
@media (max-width: 480px) {
  .card > .actions > .btn, .topic .actions > .btn { flex: 1 1 auto; }
}

.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner.small { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dashboard: ko'rsatkichlar ---------- */
.stats-wrap { margin: 0 0 14px; }
.stats-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 2px 8px; font: 600 11.5px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.stats-head a { color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 400; }
.stats-head a:hover { color: var(--accent); text-decoration: none; }
.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stat { padding: 14px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-last-child(-n + 2) { border-bottom: 0; }
.stat-label { font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-num { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat.ok .stat-num { color: var(--accent); }
.stat.warn .stat-num { color: var(--warn); }
.stat.err .stat-num { color: var(--err); }
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { border-bottom: 0; }
  .stat:nth-child(2n) { border-right: 1px solid var(--border); }
  .stat:last-child { border-right: 0; }
}

.dash-grid { display: grid; gap: 0 14px; }
.dash-col { min-width: 0; }
@media (min-width: 1200px) {
  .dash-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
}

/* ---------- jarayon sxemasi (n8n uslubi) ---------- */
.flow { padding: 0; overflow: hidden; }
.flow-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card);
}
.flow-title { font: 14px var(--mono); min-width: 0; overflow-wrap: anywhere; }
.flow-title b { color: var(--text); font-weight: 700; }
.flow-title .muted { color: var(--muted); }
.flow-updated { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 5px; border: 1px solid;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(74, 222, 128, .3); }
.badge.busy { color: var(--accent); background: var(--accent-soft); border-color: rgba(198, 244, 50, .35); }
.badge.busy::before { animation: pulse 1.2s ease-in-out infinite; }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(245, 185, 66, .35); }
.badge.err { color: #fff; background: #d63a3f; border-color: #ff6b6f; box-shadow: 0 0 16px rgba(255, 93, 97, .35); }
.badge.err::before { animation: pulse 1s ease-in-out infinite; }

.flow-canvas {
  position: relative; min-height: 160px;
  background-color: #0f1013;
  background-image: radial-gradient(rgba(255, 255, 255, .085) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.edge path { fill: none; stroke: var(--edge); stroke-width: 1.5; stroke-dasharray: 5 5; }
.edge circle { fill: var(--edge); }
.edge.st-busy path { stroke: var(--accent); animation: flowdash .7s linear infinite; }
.edge.st-busy circle { fill: var(--accent); }
.edge.st-warn path { stroke: #8a7240; }
.edge.st-warn circle { fill: #8a7240; }
.edge.st-err path { stroke: var(--err); }
.edge.st-err circle { fill: var(--err); }
.edge.st-off path { stroke: #33363d; }
.edge.st-off circle { fill: #33363d; }
.mk-ok path, .mk-warn path { fill: var(--edge); }
.mk-warn path { fill: #8a7240; }
.mk-busy path { fill: var(--accent); }
.mk-err path { fill: var(--err); }
.mk-off path { fill: #33363d; }
@keyframes flowdash { to { stroke-dashoffset: -10; } }

.edge-label {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  font: 10.5px/1 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #0f1013; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border);
  pointer-events: none;
}
.edge-label.st-busy { color: var(--accent); border-color: rgba(198, 244, 50, .35); }
.edge-label.st-err { color: var(--err); border-color: rgba(255, 93, 97, .45); }
.edge-label.st-warn { color: var(--warn); }
.edge-label.st-off { color: var(--faint); }

.flow-node {
  position: absolute; z-index: 3; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none;
  background: var(--node); border: 1px solid var(--border-2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.flow-node:hover { text-decoration: none; border-color: #5b616b; transform: translateY(-1px); }
.node-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.node-badge {
  flex: none; font: 700 9.5px/1 var(--mono); letter-spacing: .07em;
  padding: 4px 5px; border-radius: 4px; border: 1px solid currentColor;
  color: #b9c0ca; background: rgba(255, 255, 255, .04);
}
.node-badge.t-biz { color: var(--accent); background: rgba(198, 244, 50, .07); }
.node-badge.t-ai { color: #b59bff; background: rgba(181, 155, 255, .08); }
.node-badge.t-cron { color: #f5b942; background: rgba(245, 185, 66, .08); }
.node-badge.t-tg { color: #5cb4ff; background: rgba(92, 180, 255, .08); }
.node-badge.t-med { color: #4fd6c8; background: rgba(79, 214, 200, .08); }
.node-badge.t-ig { color: #ff7ab8; background: rgba(255, 122, 184, .08); }
.node-badge.t-db { color: #d7dbe0; background: rgba(215, 219, 224, .06); }
.node-sub { flex: 1; min-width: 0; font: 11px/1.3 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-idx { flex: none; font: 10px var(--mono); color: var(--faint); }
.node-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-status {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font: 11px/1.3 var(--mono); color: var(--muted);
}
.node-status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px rgba(74, 222, 128, .6); }
.flow-node.st-ok .node-status { color: #a7d9b6; }
.flow-node.st-busy { border-color: rgba(198, 244, 50, .55); box-shadow: 0 0 0 1px rgba(198, 244, 50, .18), 0 0 22px rgba(198, 244, 50, .14); }
.flow-node.st-busy .node-status { color: var(--accent); }
.flow-node.st-busy .node-status::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.flow-node.st-warn { border-color: rgba(245, 185, 66, .45); }
.flow-node.st-warn .node-status { color: var(--warn); }
.flow-node.st-warn .node-status::before { background: var(--warn); box-shadow: 0 0 6px rgba(245, 185, 66, .6); }
.flow-node.st-err {
  border-color: var(--err); background: #1d1416;
  box-shadow: 0 0 0 1px rgba(255, 93, 97, .55), 0 0 28px rgba(255, 93, 97, .35);
}
.flow-node.st-err .node-status { color: var(--err); }
.flow-node.st-err .node-status::before { background: var(--err); box-shadow: 0 0 8px var(--err); animation: pulse 1s ease-in-out infinite; }
.flow-node.st-off { border-style: dashed; background: #131518; box-shadow: none; }
.flow-node.st-off .node-title, .flow-node.st-off .node-badge { opacity: .55; }
.flow-node.st-off .node-status { color: var(--faint); }
.flow-node.st-off .node-status::before { background: #4a4f59; box-shadow: none; }
@keyframes pulse { 50% { opacity: .35; } }
.flow-canvas.narrow .flow-node { padding: 8px 10px; gap: 2px; }
.flow-canvas.narrow .node-idx { display: none; }
.flow-canvas.narrow .node-title {
  font-size: 13.5px; line-height: 1.25; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.flow-canvas.narrow .edge-label { font-size: 10px; padding: 2px 4px; }

/* ---------- so'nggi amallar ---------- */
.feed { padding: 0; overflow: hidden; }
.feed .card-head { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--border); }
.feed .empty { padding: 14px 16px; margin: 0; }
.feed-rows { display: grid; }
.feed-row {
  display: grid; grid-template-columns: 44px 10px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none;
  font-size: 13.5px;
}
.feed-row:first-child { border-top: 0; }
.feed-row:hover { text-decoration: none; background: var(--card-2); }
.feed-time { font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--edge); justify-self: center; }
.feed-row.lv-ok .feed-dot { background: var(--ok); }
.feed-row.lv-info .feed-dot { background: #5cb4ff; }
.feed-row.lv-warn .feed-dot { background: var(--warn); }
.feed-row.lv-err .feed-dot { background: var(--err); box-shadow: 0 0 8px var(--err); }
.feed-row.lv-err .feed-text { color: #ffb3b5; }
.feed-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-day { font: 11px var(--mono); color: var(--faint); }

/* ---------- mavzular ---------- */
.days { display: grid; gap: 16px; }
.day-head {
  margin: 0 2px 8px; color: var(--muted);
  font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.day.is-today .day-head { color: var(--accent); }
.day-items { display: grid; gap: 10px; }
.topic {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  border-left: 3px solid var(--border-2);
}
.card .topic { margin-top: 10px; background: var(--card-2); }
.card .card-head + .topic { margin-top: 0; }
.topic h3 { margin: 6px 0 4px; overflow-wrap: anywhere; }
.topic .muted { font-size: 14px; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.topic .status { font: 600 12px var(--mono); margin-top: 4px; color: var(--muted); }
.topic.st-proposed { border-left-color: var(--warn); }
.topic.st-proposed .status { color: var(--warn); }
.topic.st-approved { border-left-color: var(--ok); }
.topic.st-approved .status { color: var(--ok); }
.topic.st-rejected { border-left-color: var(--err); opacity: .8; }
.topic.st-rejected .status { color: var(--err); }
.topic.is-today { box-shadow: 0 0 0 1px rgba(198, 244, 50, .35) inset; }
.topic .actions { margin-top: 10px; }

.filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; }
.filter label { display: grid; gap: 4px; font: 12px var(--mono); color: var(--muted); }

/* ---------- ro'yxatlar ---------- */
.rows { display: grid; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 8px; margin: 0 -8px; border-top: 1px solid var(--border); border-radius: 6px;
  color: var(--text); text-decoration: none;
}
.row:first-child { border-top: 0; padding-top: 4px; }
.row:hover { text-decoration: none; background: var(--card-2); }
.row-main { min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-main .muted { font-family: var(--mono); font-size: 12px; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; text-align: right; }
.row-side .status { color: var(--muted); max-width: 150px; font: 12px var(--mono); }

.tabs {
  display: flex; gap: 2px; margin: 0 0 16px; overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; text-align: center; padding: 9px 14px; white-space: nowrap;
  color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.card .tiles { margin-bottom: 0; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.card .tile { background: var(--card-2); }
.tile-num { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font: 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.tile.ok .tile-num { color: var(--accent); }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.month-nav b { font: 600 15px var(--mono); }

.list li { margin: 4px 0; overflow-wrap: anywhere; }
.list li::marker { color: var(--faint); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 10px; }
.kv dt { color: var(--muted); font: 13px var(--mono); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- formalar ---------- */
.field { display: grid; gap: 4px; margin: 0 0 14px; }
.field > span { font-weight: 600; }
.field .hint { color: var(--muted); font-style: italic; }
input[type="text"], input[type="url"], input[type="date"], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-2);
  background: #0f1013; color: var(--text); min-height: 42px;
  transition: border-color .15s;
}
input[type="text"]:focus, input[type="url"]:focus, input[type="date"]:focus, textarea:focus, select:focus { border-color: rgba(198, 244, 50, .6); outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="date"] { width: auto; color-scheme: dark; }
textarea { resize: vertical; line-height: 1.5; }
.post-text { min-height: 220px; }
input[type="file"] { max-width: 100%; font-size: 14px; color: var(--muted); }
input[type="file"]::file-selector-button {
  font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 7px; padding: 6px 10px; margin-right: 10px; cursor: pointer;
}
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline > input[type="text"] { flex: 1 1 220px; }
.inline > input[type="file"] { flex: 1 1 220px; }
.card > textarea { margin-top: 6px; }

.post-preview {
  white-space: pre-wrap; overflow-wrap: anywhere; background: #0f1013;
  border-radius: 8px; padding: 12px 14px; border: 1px solid var(--border);
}
.tags { color: var(--link); margin-top: 8px; overflow-wrap: anywhere; font: 13px var(--mono); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.thumb {
  background: #0f1013; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  min-height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0;
}
.thumb .muted { padding: 10px; }
.thumb img, .thumb video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.card > .thumb { max-width: 360px; margin-bottom: 8px; }

.example {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  border-top: 1px solid var(--border); padding: 10px 0;
}
.example:first-of-type { border-top: 0; padding-top: 0; }
.example-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; font-size: 14px; flex: 1; }

/* ---------- kirish ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow);
}
.login-card .logo {
  display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px;
  border-radius: 14px; background: var(--accent); color: var(--accent-text);
  font: 800 20px/1 var(--mono); box-shadow: 0 0 28px rgba(198, 244, 50, .25);
}
.login-card h1 { margin-bottom: 14px; }
.login-card .alert { margin-top: 14px; text-align: left; }

/* ---------- xabar ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 520px); width: max-content;
  background: #1f2329; color: var(--text); padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: opacity .2s, transform .2s;
  overflow-wrap: anywhere;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #2a1518; border-color: rgba(255, 93, 97, .45); border-left-color: var(--err); color: #ffc4c6; }
@media (min-width: 900px) { #toast { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
  .spinner, .btn.loading::after { animation-duration: 2.5s; }
  .edge.st-busy path, .badge::before, .node-status::before { animation: none !important; }
  .flow-node { transition: none; }
}

/* ---------- menyu: qisqa / to'liq nom ---------- */
.nav-full { display: none; }
.nav-short { display: inline; }
@media (min-width: 900px) {
  .nav-full { display: inline; }
  .nav-short { display: none; }
}

/* ---------- viral g'oyalar ---------- */
.topic.st-liked { border-left-color: var(--accent); }
.topic.st-liked .status { color: var(--accent); }
.topic.st-posted, .topic.st-hit { border-left-color: var(--ok); }
.topic.st-posted .status, .topic.st-hit .status { color: var(--ok); }
.topic.st-closed { opacity: .6; }
.topic h3 a { color: inherit; }
.topic h3 a:hover { color: var(--link); text-decoration: none; }
.idea-grid { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 900px) { .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.idea-hook { margin: 4px 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.card > .idea-hook { font-size: 16px; }

.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; padding-bottom: 2px; }
.seg::-webkit-scrollbar { display: none; }
.seg a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border-2); color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap;
}
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.active { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.seg-n { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.seg a.active .seg-n { background: rgba(18, 22, 10, .18); color: var(--accent-text); }

/* ssenariy */
.scenes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.scene {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.scene-sec { font: 600 12px/1.6 var(--mono); color: var(--accent); }
.scene-body { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.scene-voice { line-height: 1.5; }
@media (max-width: 380px) { .scene { grid-template-columns: 1fr; gap: 4px; } }

/* tekshiruv natijasi */
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.score {
  display: inline-block; font: 700 13px var(--mono); padding: 3px 9px; border-radius: 999px; border: 1px solid transparent;
}
.score.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(74, 222, 128, .25); }
.score.mid { background: var(--warn-bg); color: var(--warn); border-color: rgba(245, 185, 66, .28); }
.score.low { background: var(--err-bg); color: var(--err); border-color: rgba(255, 93, 97, .3); }
.goal { font: 600 12px var(--mono); }
.goal.ok { color: var(--ok); }
.goal.warn { color: var(--warn); }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.checklist li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start;
  padding: 8px 10px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--border);
}
.checklist li.bad { border-color: rgba(255, 93, 97, .3); }
.ck { line-height: 1.4; }
.bullets { margin-top: 12px; }
.bullets h3 { font-size: 14px; margin: 0 0 4px; }

/* sozlama */
.toggle { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

/* loyihalar */
.projects { display: grid; gap: 10px; margin-top: 6px; }
@media (min-width: 900px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.project {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  overflow-wrap: anywhere;
}
.project p { margin: 6px 0; }
.project .actions { margin-top: 8px; }
.project-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.project-head h3 { margin: 0; }
.project.editing { background: var(--card); border-color: rgba(198, 244, 50, .45); }

/* trendlar */
.pattern { padding: 10px 0; border-top: 1px solid var(--border); display: grid; gap: 4px; overflow-wrap: anywhere; }
.pattern:first-of-type { border-top: 0; }
.seeds { display: grid; gap: 8px; margin-top: 6px; }
.seed {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.seed span { min-width: 0; overflow-wrap: anywhere; }
.seed .btn { flex: none; }

/* o'xshash profillar */
.comp .tiles { margin: 8px 0; }
.comp .tile { padding: 8px 10px; }
.comp .tile-num { font-size: 18px; }
.comp .project-head h3 { font-size: 16px; }
.comp-posts { margin-top: 10px; }
.comp-posts summary { cursor: pointer; font-weight: 600; }
.comp-posts .list { padding-left: 18px; margin: 6px 0 0; }
.comp-posts li { margin: 6px 0; }
