:root {
  --bg: var(--tg-theme-bg-color, #0d141c);
  --surface: var(--tg-theme-secondary-bg-color, #172431);
  --surface-2: #203140;
  --text: var(--tg-theme-text-color, #f5f7fa);
  --muted: var(--tg-theme-hint-color, #9badbd);
  --accent: var(--tg-theme-button-color, #22c7e6);
  --accent-text: var(--tg-theme-button-text-color, #071217);
  --good: #35d49a;
  --warn: #ffbd59;
  --bad: #ff6678;
  --line: rgba(157, 184, 205, .18);
  --radius: 14px;
  --safe-top: var(--tg-safe-area-inset-top, env(safe-area-inset-top));
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom));
  font-family: "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overscroll-behavior: none; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100dvh; padding: calc(12px + var(--safe-top)) 14px calc(86px + var(--safe-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 14px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); }
.eyeline { color: var(--accent); font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .1em; }
h1 { margin: 5px 0 0; font-size: 27px; line-height: 1; letter-spacing: -.025em; }
h2, h3, p { margin-top: 0; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 27px; }
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 8px calc(7px + var(--safe-bottom)); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-nav button { min-height: 54px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bottom-nav button span { font-size: 22px; line-height: 1; }
.bottom-nav button small { font-size: 10px; font-weight: 700; }
.bottom-nav button.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.stats-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px 0 14px; }
.stat { min-width: 0; padding: 11px 12px; background: var(--surface); border-radius: 12px; }
.stat b { display: block; font-size: 22px; line-height: 1; }
.stat span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 9px; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head span { color: var(--muted); font-size: 12px; }
.stack { display: grid; gap: 10px; }
.item { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.item-body { padding: 14px; }
.item h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.18; letter-spacing: -.015em; text-wrap: balance; }
.item h3 { margin: 0 0 6px; font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.copy { margin: 0; color: color-mix(in srgb, var(--text) 88%, var(--muted)); font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.image { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--surface-2); }
.image.square { aspect-ratio: 1; }
.score-total { display: flex; align-items: baseline; justify-content: space-between; margin: 12px 0 7px; }
.score-total b { color: var(--accent); font-size: 25px; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.score { padding: 8px 9px; border-radius: 9px; background: var(--surface-2); }
.score span { display: block; color: var(--muted); font-size: 10px; }
.score b { font-size: 13px; }
.rationale { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; }
.actions { display: flex; gap: 7px; padding: 0 14px 14px; flex-wrap: wrap; }
.button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 750; font-size: 13px; }
.button.primary { background: var(--accent); color: var(--accent-text); }
.button.good { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--good); }
.button.bad { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); color: var(--bad); }
.button.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }
.button:disabled { opacity: .45; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 800; }
.pill.good { color: var(--good); }.pill.warn { color: var(--warn); }.pill.bad { color: var(--bad); }
.reaction { margin-top: 8px; padding: 9px 10px; background: var(--surface-2); border-radius: 9px; font-size: 13px; }
.post-preview { margin: 10px 0 16px; padding: 14px; border-radius: var(--radius); background: var(--surface); }
.post-preview h2 { margin-bottom: 10px; font-size: 17px; }
.publication-preview { color: color-mix(in srgb, var(--text) 92%, var(--muted)); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }.publication-preview a { color: var(--accent); }
.channel-signature { display: block; margin-top: 13px; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12px; text-align: left; }
.notice { padding: 11px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.4; }
.notice.good { background: color-mix(in srgb, var(--good) 10%, var(--surface)); color: var(--good); }
.timeline { display: grid; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.timeline-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; padding: 13px; background: var(--surface); }
.timeline-time { color: var(--accent); font-weight: 850; font-size: 12px; }
.timeline-row h3 { margin: 0; font-size: 14px; }.timeline-row p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.empty b { display: block; margin-bottom: 6px; color: var(--text); }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.toolbar .button { white-space: nowrap; }
.toolbar.footer-tools { margin-top: 12px; }
.load-more { width: 100%; margin-top: 12px; }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.system-control { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.system-control strong { font-size: 15px; }.system-control small { display: block; margin: 5px 0 0 18px; color: var(--muted); line-height: 1.35; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; }.status-dot.online { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 12%, transparent); }.status-dot.offline { background: var(--muted); }
.job { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; background: var(--surface); border-radius: 11px; }
.job strong { font-size: 13px; }.job small { color: var(--muted); }.job .error { grid-column: 1/-1; color: var(--bad); font-size: 11px; }
.job-actions { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.form { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; min-height: 45px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--bg); color: var(--text); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.text-tool { min-height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 11px; }
.reaction-editor { display: grid; grid-template-columns: 54px 1fr; gap: 7px; }
.setting-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.setting-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }.setting-row:last-child { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.setting-row strong { font-size: 13px; }.setting-row small { grid-column: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.settings-group { margin-top: 10px; }
.settings-group summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: var(--radius); background: var(--surface); font-weight: 800; cursor: pointer; list-style: none; }
.settings-group summary::-webkit-details-marker { display: none; }
.settings-group summary span { color: var(--muted); font-size: 11px; }
.settings-group[open] summary { margin-bottom: 1px; border-radius: var(--radius) var(--radius) 0 0; }
.inline-details { margin-top: 12px; }.inline-details summary { color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 800; }.inline-details .setting-row { margin-top: 1px; padding-left: 0; padding-right: 0; }
.rules { padding: 14px; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }.rules b { font-size: 13px; }.rules p { margin: 4px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.45; }.rules p:last-child { margin-bottom: 0; }
dialog { width: min(100%, 620px); max-height: calc(100dvh - 28px); margin: auto 0 0; padding: 0; border: 0; border-radius: 16px 16px 0 0; background: var(--bg); color: var(--text); box-shadow: 0 -6px 12px rgba(0,0,0,.26); }
dialog::backdrop { background: rgba(0,0,0,.58); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }.modal-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); }
.modal-body { padding: 15px 16px calc(22px + var(--safe-bottom)); overflow-y: auto; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(86px + var(--safe-bottom)); width: max-content; max-width: calc(100% - 30px); padding: 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 750; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; transition: .2s ease-out; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }.toast.error { background: var(--bad); color: #19040a; }
.loading { display: flex; justify-content: center; gap: 6px; padding: 70px 0; }.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite alternate; }.loading span:nth-child(2) { animation-delay: .2s; }.loading span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 720px) { .app-shell { max-width: 760px; margin: 0 auto; }.bottom-nav { left: 50%; max-width: 760px; transform: translateX(-50%); border-radius: 14px 14px 0 0; }.score-grid { grid-template-columns: repeat(5, 1fr); } dialog { margin-left: auto; margin-right: auto; } }
