:root {
  color-scheme: dark;
  --bg: #090a0c;
  --panel: #101216;
  --panel-2: #15181d;
  --line: #272b32;
  --text: #f2f4f7;
  --muted: #969da8;
  --accent: #f5a623;
  --green: #4ade80;
  --red: #fb7185;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 15px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.logo-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #111; }
h1 { font-size: clamp(28px, 4vw, 44px); margin: 24px 0 8px; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 22px; }
h3 { margin: 0; font-size: 16px; }
p { color: var(--muted); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
input, textarea, select { width: 100%; color: var(--text); background: #0c0e11; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,166,35,.12); }
textarea { min-height: 120px; resize: vertical; }
.form { display: grid; gap: 14px; }
.btn { border: 1px solid var(--line); color: var(--text); background: var(--panel-2); border-radius: 10px; padding: 11px 16px; font-weight: 700; }
.btn:hover { border-color: #454b56; }
.btn:disabled { cursor: not-allowed; opacity: .48; }
.btn-primary { background: var(--accent); color: #161009; border-color: transparent; }
.btn-quiet { background: transparent; }
.btn-small { padding: 7px 10px; font-size: 13px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; background: #0c0e11; }
.nav { display: grid; gap: 6px; }
.nav button { text-align: left; padding: 11px 12px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; }
.nav button.active { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 var(--accent); }
.nav button.locked { opacity: .62; }
.project { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.project select { margin-top: 8px; }
.project-actions { display: flex; gap: 8px; margin-top: 10px; }
.content { padding: 30px clamp(20px, 4vw, 58px) 70px; max-width: 1500px; width: 100%; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
.grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.connections { display: grid; gap: 10px; }
.provider-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #0d0f12; }
.provider-card-head { display: flex; align-items: center; gap: 11px; }
.provider-summary { margin: 10px 0 12px; font-size: 13px; }
.provider-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.connection { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.connection:last-child { border-bottom: 0; }
.provider { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; background: #20252c; }
.provider.telegram { color: #38bdf8; }
.provider.vk { color: #60a5fa; }
.provider.max { color: #fbbf24; }
.status { font-size: 12px; font-weight: 800; color: var(--green); }
.status.error { color: var(--red); }
.composer { display: grid; gap: 16px; }
.target { padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.target-head { display: flex; justify-content: space-between; align-items: center; }
.check { display: flex; gap: 10px; align-items: center; color: var(--text); }
.check input { width: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.history { margin-top: 18px; }
.post-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 0 10px; }
.post-item { border-bottom: 1px solid var(--line); }
.post-item:last-child { border-bottom: 0; }
.target-statuses { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 14px; }
.target-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.target-status a { color: var(--green); text-decoration: none; }
.target-error { width: 100%; color: var(--red); font-size: 13px; padding-top: 3px; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 12px; }
.badge.published { color: var(--green); }
.badge.failed, .badge.partial { color: var(--red); }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); }
.notice { border-radius: 10px; padding: 11px 12px; background: rgba(74,222,128,.09); color: var(--green); }
.notice.error { background: rgba(251,113,133,.09); color: var(--red); }
.notice.warning { background: rgba(245,166,35,.1); color: #ffd28a; line-height: 1.5; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); z-index: 20; }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.docs-card { display: grid; gap: 16px; }
.setup-steps { display: grid; gap: 11px; margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.5; }
.setup-steps li::marker { color: var(--accent); font-weight: 800; }
.setup-steps a, .docs-card a:not(.btn) { color: #7dd3fc; }
code { padding: 2px 5px; border-radius: 5px; background: #20242a; color: #f7c66d; overflow-wrap: anywhere; }
.field-help { color: #6f7783; font-size: 12px; }
.discover-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 11px; border: 1px dashed var(--line); border-radius: 11px; }
#discovered-channels:empty { display: none; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.docs-link { display: inline-block; justify-self: start; text-decoration: none; }
.doc-note { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.doc-note p { margin: 7px 0 0; line-height: 1.5; }
.hidden { display: none !important; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .project { margin-top: 0; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .content { padding: 22px 14px 50px; }
  .sidebar { padding: 15px; }
  .nav { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}
