/* ============================================================
   COZY ART · Social Autopost — дизайн-система
   Шрифт: Manrope (self-host, variable)
   Радиусы: карточки 14, контролы 10, пилюли 999
   Отступы: 4 / 8 / 12 / 16 / 24 / 32 / 48
   ============================================================ */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/static/fonts/unbounded-cyr-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/static/fonts/unbounded-lat-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-cyr-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-lat-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3efe4;
  --surface: #fffdf7;
  --surface-2: #ece7d8;
  --surface-3: #e2dccb;

  --ink: #191611;
  --ink-2: #4a463c;
  --ink-3: #6f6a62;

  --line: rgba(25, 22, 17, 0.16);
  --line-2: rgba(25, 22, 17, 0.34);

  --pencil: #c03a22;
  --pasta: #2b4fd8;

  --accent: #c03a22;
  --accent-ink: #ffffff;
  --accent-2: #b33721;

  --ok: #2c6e49;
  --ok-bg: #dfeade;
  --warn: #8a5c14;
  --warn-bg: #f4e6c8;
  --err: #a03830;
  --err-bg: #f6dcd6;
  --info: #2b4fd8;
  --info-bg: #dfe4f7;

  --r-card: 0px;
  --r-control: 0px;
  --r-pill: 999px;

  --shadow-1: 2px 2px 0 rgba(25, 22, 17, 0.10);
  --shadow-2: 5px 5px 0 rgba(25, 22, 17, 0.12);
  --ring: 0 0 0 3px rgba(43, 79, 216, 0.20);

  --serif: "Unbounded", -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01" on;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 600; }

.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* ---------- шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.brand-text { font-weight: 700; font-size: 14px; letter-spacing: 0.2px; }
.brand-text em {
  display: block;
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.nav { display: flex; gap: 2px; }
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-control);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
}
.nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--surface-3); color: var(--ink); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { color: var(--ink-3); font-size: 13px; }

/* ---------- разметка страницы ---------- */

.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { color: var(--ink-3); font-size: 13.5px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: var(--surface-3);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.08s ease;
}
.btn:hover { background: #e9e3d9; text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #33302b; color: #fff; }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-2); color: #fff; }

.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }

.btn-danger { background: transparent; border-color: #e3c4bf; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }

.btn-sm { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- карточки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 16px; }
.card h2 {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- формы ---------- */

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.field > span small { font-weight: 500; color: var(--ink-3); }

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.field textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: #9a948a; }
.field input:hover,
.field textarea:hover { border-color: #bfb7a9; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  min-height: 42px;
  cursor: pointer;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.check-row input:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.check-title { flex: 1; font-size: 14px; }
.check-meta { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* ---------- чипы фильтров ---------- */

.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); color: var(--ink); text-decoration: none; }
.chip-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-active:hover { color: #fff; }

/* ---------- список постов ---------- */

.posts { display: grid; gap: 8px; }

.post-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.post-row:hover {
  color: var(--ink);
  text-decoration: none;
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}

.post-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-main { min-width: 0; }
.post-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
  font-weight: 600;
  font-size: 15px;
}
.post-title strong { font-weight: 600; }
.post-preview {
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--ink-3);
}

.post-side { display: flex; align-items: center; gap: 10px; }

.plat {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--surface-3);
  color: var(--ink-3);
}
.plat-sent { background: var(--ok-bg); color: var(--ok); }
.plat-failed { background: var(--err-bg); color: var(--err); }
.plat-skipped { background: var(--surface-3); color: #9a948a; }
.plat-pending { background: var(--info-bg); color: var(--info); }

/* ---------- бейджи статусов ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.badge-draft { background: var(--surface-3); color: var(--ink-3); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-scheduled { background: var(--info-bg); color: var(--info); }
.badge-publishing { background: var(--info-bg); color: var(--info); }
.badge-published { background: var(--ok-bg); color: var(--ok); }
.badge-partial { background: var(--warn-bg); color: var(--warn); }
.badge-failed { background: var(--err-bg); color: var(--err); }
.badge-rejected { background: var(--surface-3); color: var(--ink-3); }
.badge-sent { background: var(--ok-bg); color: var(--ok); }
.badge-skipped { background: var(--surface-3); color: var(--ink-3); }

/* ---------- пустые состояния ---------- */

.empty {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
}
.empty h2 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty p { color: var(--ink-3); margin: 0 0 16px; font-size: 14px; }

/* ---------- уведомления ---------- */

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-control);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-error { background: var(--err-bg); color: var(--err); border-color: #eccac6; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #cfe3d6; }

/* ---------- вход ---------- */

.login-wrap { display: grid; place-items: center; min-height: calc(100vh - 64px); padding: 24px; }
.login-card { width: 100%; max-width: 400px; padding: 32px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .muted { margin: 0 0 24px; font-size: 13.5px; }

/* ---------- редактор ---------- */

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.editor-side { display: grid; gap: 16px; position: sticky; top: 88px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* предпросмотр */
.preview-block {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface-2);
}
.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.preview-head strong { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.preview-head small { font-size: 11.5px; color: var(--ink-3); }
.preview-tabs { display: flex; gap: 4px; padding: 10px 12px 0; background: var(--surface); flex-wrap: wrap; }
.preview-tab {
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--surface-3);
  color: var(--ink-3);
  border-radius: 8px 8px 0 0;
  min-height: 38px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.preview-tab:hover { color: var(--ink); }
.preview-tab.active { background: var(--surface); color: var(--ink); }
.preview-tab:focus-visible { outline: none; box-shadow: var(--ring); }
.preview-body {
  background: var(--surface);
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 10px;
  padding: 16px 18px;
  min-height: 100px;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 14.5px;
}
.preview-body:empty::before { content: "Пусто"; color: var(--ink-3); }
.preview-meta { padding: 0 16px 12px; font-size: 12px; color: var(--ink-3); text-align: right; }
.preview-meta.over { color: var(--err); font-weight: 700; }

/* медиа */
.media-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.media-item {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-3);
}
.media-item img,
.media-item video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.media-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(28, 26, 23, 0.72);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.media-remove:hover { background: rgba(28, 26, 23, 0.9); }

.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-label {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-control);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.upload-label:hover { border-color: var(--accent); background: var(--surface); color: var(--ink); }
.upload-label:focus-within { box-shadow: var(--ring); }
.upload-name { font-size: 12.5px; color: var(--ink-3); }

/* результаты и журнал */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
}
.table tr:last-child td { border-bottom: none; }

.log { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.log li:last-child { border-bottom: none; }
.log-time { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-platform { color: var(--accent); font-weight: 600; min-width: 88px; }
.log-error { color: var(--err); }
.log-warning { color: var(--warn); }

/* ---------- настройки ---------- */

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 2px;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.settings-tab:hover { border-color: var(--line-2); color: var(--ink); }
.settings-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.settings-tab:focus-visible { outline: none; box-shadow: var(--ring); }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: #b3aca3; }
.tab-dot.ok { background: #6cc78f; }
.tab-dot.fail { background: #e08379; }

.settings-panel { display: none; }
.settings-panel.active { display: block; }

.setting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.setting-main { padding: 24px; }
.setting-main h2 { margin-bottom: 18px; }
.setting-aside { display: grid; gap: 14px; }
.status-card { padding: 20px; }

.setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.setting-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}
.setting-sub { margin: 0 0 16px; color: var(--ink-3); font-size: 13px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--ink-3);
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.fail { background: var(--err-bg); color: var(--err); }
.status-pill.idle { background: var(--surface-3); color: var(--ink-3); }

.setting-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setting-actions .btn { width: 100%; }
.setting-actions .btn-wide { grid-column: 1 / -1; }
.setting-result { margin-top: 12px; min-height: 20px; font-size: 13px; }
.setting-result.ok { color: var(--ok); }
.setting-result.fail { color: var(--err); }

.hint {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
}
.hint code {
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.guide-card {
  padding: 18px 20px;
}

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.guide-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.guide-steps code {
  display: inline;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--ink-2);
  word-break: break-all;
}

.guide-steps a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-steps code.long {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.45;
}

.guide-steps code.wrap {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.guide-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ============================================================
   РЕДАКЦИОННЫЙ СТИЛЬ · «редакционный стол»
   бумага / чернила / красный карандаш / синяя паста
   ============================================================ */

body {
  font-family: var(--body);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(25, 22, 17, 0.045) 1px, transparent 1px),
    linear-gradient(var(--surface-2) 1px, transparent 1px);
  background-size: 22px 22px, 100% 8px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: var(--serif); }
h1 { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; }
.page-head h1 { max-width: 22ch; }
.page-head .sub { max-width: 72ch; font-size: 14px; }

/* --- шапка --- */

.topbar {
  height: 70px;
  background: var(--bg);
  backdrop-filter: none;
  border-bottom: 2px solid var(--ink);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: var(--pencil);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}
.brand-text {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-text em {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav a {
  border-radius: 0;
  font-weight: 600;
  padding: 8px 12px;
  position: relative;
}
.nav a:hover { background: transparent; text-decoration: none; color: var(--ink); }
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  background: var(--pencil);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }
.nav a.active { background: transparent; color: var(--ink); font-weight: 700; }

.who { font-family: var(--mono); font-size: 12px; }

/* --- кнопки --- */

.btn {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn-primary { background: var(--ink); color: var(--paper, #fff); box-shadow: 3px 3px 0 var(--pencil); }
.btn-primary:hover { background: #2a2620; color: #fff; }
.btn-accent { background: var(--pencil); color: #fff; }
.btn-accent:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--ink); box-shadow: 3px 3px 0 var(--pasta); }
.btn-ghost:hover { background: var(--surface); box-shadow: 1px 1px 0 var(--pasta); }
.btn-danger { border-color: var(--err); color: var(--err); box-shadow: 3px 3px 0 rgba(160, 56, 48, 0.3); }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }

/* --- карточки и блоки --- */

.card {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 7px 7px 0 rgba(25, 22, 17, 0.14);
}
.card h2 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.empty {
  border: 2px dashed var(--ink);
  background: var(--surface-2);
}
.empty h2 { font-family: var(--serif); }

.hint, .guide-card {
  border-radius: 0;
  border: 1.5px dashed var(--line-2);
  background: var(--surface-2);
}
.hint { border-style: dashed; }
.guide-card { border: 2px solid var(--ink); background: var(--surface); box-shadow: 4px 4px 0 rgba(25, 22, 17, 0.08); }
.guide-card h3 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; }
.guide-steps { font-family: var(--body); }
.guide-steps code { border-radius: 0; border: 1px solid var(--line); }

.alert { border-radius: 0; border-width: 2px; }
.alert-error { border-color: var(--err); }
.alert-ok { border-color: var(--ok); }

/* --- формы --- */

.field > span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input,
.field textarea,
.field select {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  font-family: var(--body);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--pasta);
  box-shadow: 0 0 0 3px rgba(43, 79, 216, 0.18);
}
.check-title { font-weight: 600; }
.check-meta { font-family: var(--mono); font-size: 11.5px; }

.setting-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.setting-aside { min-width: 0; }
.guide-steps code.long { max-width: 100%; }

.setting-aside > *,
.guide-card,
.guide-steps,
.guide-steps li { min-width: 0; }
.guide-steps { grid-template-columns: minmax(0, 1fr); }
.guide-card { overflow: hidden; }

/* --- вкладки настроек --- */

.settings-tab {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 2px 2px 0 rgba(25, 22, 17, 0.14);
}
.settings-tab:hover { border-color: var(--ink); background: var(--surface-2); }
.settings-tab.active {
  background: var(--pencil);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.tab-dot { width: 8px; height: 8px; }
.tab-dot.ok { background: #1f8a4c; }
.tab-dot.fail { background: #b33721; }

.status-pill {
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
}
.status-pill.ok, .status-pill.fail, .status-pill.idle { background: transparent; }
.status-card { border: 2px solid var(--ink); }
.setting-head h2 { font-size: 17px; }

/* --- бейджи, чипы, платформы --- */

.badge {
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  border: 1px solid currentColor;
  padding: 2px 8px;
}
.badge::before { width: 5px; height: 5px; }

.chip { border-radius: 0; border: 1.5px solid var(--ink); font-family: var(--mono); font-size: 11.5px; }
.chip-active { background: var(--ink); color: #fff; }

.plat { border-radius: 0; font-family: var(--mono); font-size: 9.5px; }

/* --- список постов --- */

.post-row {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(25, 22, 17, 0.08);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.post-row:hover {
  border-color: var(--ink);
  box-shadow: 5px 5px 0 rgba(25, 22, 17, 0.16);
  transform: translate(-1px, -1px);
}
.post-thumb { border-radius: 0; border: 1px solid var(--ink); }
.post-title strong { font-weight: 700; }
.post-meta { font-family: var(--mono); font-size: 11.5px; }

/* --- таблицы --- */

.table th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 2px solid var(--ink);
}
.table td { border-bottom: 1px dashed var(--line); }

/* --- журнал --- */

.log-time, .log-platform { font-family: var(--mono); font-size: 12px; }

/* --- редактор --- */

.preview-block { border-radius: 0; border: 1.5px solid var(--ink); }
.preview-tab { border-radius: 0; font-family: var(--mono); font-size: 12px; }
.preview-tab.active { background: var(--surface-2); font-weight: 700; }
.upload-label { border-radius: 0; border: 1.5px dashed var(--ink); }
.media-item { border-radius: 0; border: 1.5px solid var(--ink); }

/* --- вход и модалки --- */

.login-card { border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(25, 22, 17, 0.14); }
.login-card h1 { font-size: 24px; }
.modal-card { border: 2px solid var(--ink); border-radius: 0; box-shadow: 10px 10px 0 rgba(25, 22, 17, 0.18); }
.modal-head h2 { font-family: var(--serif); }

/* --- новости --- */

.news-item { border-radius: 0; border: 1.5px solid var(--ink); }
.news-item:hover { box-shadow: 4px 4px 0 rgba(25, 22, 17, 0.12); }

/* --- аккаунт --- */

.account-grid .card { box-shadow: 4px 4px 0 rgba(25, 22, 17, 0.10); }

/* ---------- адаптив ---------- */

@media (max-width: 960px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .setting-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 0 14px; height: auto; min-height: 58px; flex-wrap: wrap; }
  .brand-text { font-size: 13px; }
  .brand-text em { display: none; }
  .nav { flex-wrap: wrap; gap: 0; }
  .nav a { padding: 6px 9px; font-size: 12.5px; }
  .who { display: none; }
  .page { padding: 20px 14px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .preview-tab { min-height: 42px; }
  .media-remove { width: 36px; height: 36px; }
  .settings-tab { min-height: 44px; }
  .page-head h1 { font-size: 22px; }
  .card { padding: 18px; }
  .post-row { grid-template-columns: auto minmax(0, 1fr); }
  .post-side { grid-column: 1 / -1; justify-content: flex-start; }
  .post-thumb { width: 48px; height: 48px; }
  .setting-actions { grid-template-columns: 1fr; }
  .preview-head { flex-direction: column; align-items: flex-start; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- ИИ-редактор ---------- */

.ai-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -4px 0 18px;
}

.inline-row { display: flex; gap: 8px; align-items: stretch; }
.inline-row select { flex: 1; min-width: 0; }
.inline-row .btn { flex-shrink: 0; }

.prompt-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 26, 23, 0.45);
  backdrop-filter: blur(2px);
}
.modal[hidden] { display: none; }

.modal-card {
  width: min(1020px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 24px 64px rgba(28, 26, 23, 0.28);
}
.modal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}
.ai-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: auto;
  min-height: 0;
}
.ai-col { padding: 18px 22px; min-width: 0; }
.ai-col + .ai-col { border-left: 1px solid var(--line); background: var(--surface-2); }
.ai-col h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ai-col pre {
  margin: 0;
  max-height: 55vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .ai-compare { grid-template-columns: 1fr; }
  .ai-col + .ai-col { border-left: none; border-top: 1px solid var(--line); }
  .modal { padding: 0; }
  .modal-card { max-height: 100vh; border-radius: 0; border: none; }
  .ai-col pre { max-height: 34vh; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .inline-row { flex-wrap: wrap; }
  .inline-row .btn { width: 100%; }
}

/* ---------- тексты по платформам ---------- */

.platform-text {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface-2);
}
.platform-text-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.platform-text-head strong { flex: 1; font-size: 14px; }
.platform-text textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}
.platform-text textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.platform-text-status { min-height: 16px; margin-top: 4px; color: var(--ink-3); }
.platform-text-status.ok { color: var(--ok); }
.platform-text-status.fail { color: var(--err); }

/* ---------- правила площадок ---------- */

.rules-card { margin-top: 16px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rule-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface-2);
}
.rule-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rule-head strong { flex: 1; font-size: 14px; }
.rule-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.rule-toggle input { accent-color: var(--accent); }
.rule-item textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.rule-item textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

@media (max-width: 860px) {
  .rules-grid { grid-template-columns: 1fr; }
}

/* ---------- загрузка медиа ---------- */

.dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-control);
  background: var(--surface-2);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.dropzone.dragover { border-color: var(--accent); background: #fbf5ee; }
.dropzone .upload-label { background: var(--surface); }

.media-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-chip button {
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.file-chip button:hover { color: var(--err); }

.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- личный кабинет и пользователи ---------- */

.login-alt { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
}
.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.account-grid .card { margin-top: 0; }

.platform-list { display: grid; gap: 2px; }
.platform-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
  border-radius: 6px;
}
.platform-row:last-child { border-bottom: none; }
.platform-row:hover { text-decoration: none; background: var(--surface-2); }
.plat-code {
  flex: none;
  width: 40px;
  padding: 3px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--surface-3);
  border-radius: var(--r-pill);
}
.platform-name { flex: none; min-width: 108px; font-size: 14px; font-weight: 600; }
.platform-target {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-3);
}

.card-table { padding: 0; overflow: hidden; }
.card-table .table { min-width: 760px; }
.data-table td { vertical-align: middle; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.role-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.role-tag.role-admin { background: var(--info-bg); color: var(--info); }

@media (max-width: 640px) {
  .platform-name { min-width: 0; }
  .platform-target { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .topbar-right { margin-left: auto; }

  .card-table { background: transparent; border: none; box-shadow: none; overflow: visible; }
  .card-table .table { display: block; min-width: 0; }
  .card-table thead { display: none; }
  .card-table tbody, .card-table tr, .card-table td { display: block; width: auto; }
  .card-table tr {
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-1);
  }
  .card-table tr:last-child { margin-bottom: 0; }
  .card-table td { padding: 4px 0; border: none; }
  .card-table td[data-label]::before {
    content: attr(data-label) " · ";
    color: var(--ink-3);
    font-size: 12.5px;
  }
  .card-table .num { text-align: left; }
  .card-table .actions-col { width: auto; padding-top: 10px; }
  .row-actions { justify-content: flex-start; }
}

/* ---------- новости ---------- */
.news-search-form { display: grid; gap: 16px; }
.news-search-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.news-search-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.news-history { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.news-status-card { padding: 16px 18px; }
.news-status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spinner {
  width: 16px; height: 16px; flex: 0 0 auto;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: news-spin 0.8s linear infinite;
}
@keyframes news-spin { to { transform: rotate(360deg); } }

.news-list-head, .news-list-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 0 0 12px;
}
.news-list-foot { margin: 16px 0 0; }
.news-list { display: grid; gap: 12px; }

.news-item {
  display: grid;
  grid-template-columns: 22px 132px minmax(0, 1fr);
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px;
}
.news-item-used { background: var(--surface-2); }
.news-item-check { display: flex; align-items: flex-start; padding-top: 4px; }
.news-item-thumb {
  width: 132px; height: 92px;
  border-radius: 10px; overflow: hidden;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
}
.news-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-item-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.source-tag {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent-2); background: var(--surface-3);
  padding: 3px 8px; border-radius: 999px;
}
.news-item-title { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.news-item-text { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.news-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.news-sources-table .row-off { opacity: 0.65; }
.feed-yes { color: var(--ok); font-weight: 600; }
.news-source-add { margin-top: 16px; }
.news-source-add summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.news-source-form {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-top: 12px; align-items: end;
}
.news-source-form .check-row { grid-column: 1 / -1; }
.news-source-form button { justify-self: start; }

@media (max-width: 760px) {
  .news-search-fields,
  .news-source-form { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 22px minmax(0, 1fr); }
  .news-item-thumb { grid-column: 2; width: 100%; height: 160px; }
  .news-item-body { grid-column: 2; }
}

.advanced-fields {
  border: 1.5px dashed var(--line-2);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.advanced-fields summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}
.telegram-connect .guide-steps code { word-break: break-all; }
.telegram-connect .setting-result { margin-top: 10px; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- API ---------- */

.api-key {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  white-space: pre-wrap;
}
.api-code {
  margin: 8px 0 0;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: #221e17;
  color: #f3efe4;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}
.inline-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  font: inherit;
}
