/* Кабинет Публициста. Оформление — система департамента НЭЙРУ из
   neuru-platform.html: те же переменные, тот же градиент, те же радиусы и
   тени. Публицист — сотрудник в общей линейке, и переход между его
   кабинетом и остальным департаментом не должен выглядеть как переход в
   чужой продукт.

   Тёмной темы нет намеренно: её нет у департамента, и своя добавила бы
   расхождение там, где мы добиваемся совпадения. */

:root {
  --bg: #f4f6fb;
  --card: #fff;
  --text: #1a1d2e;
  --muted: #6b7280;
  --light: #9ca3af;
  --blue: #2563eb;
  --violet: #7c3aed;
  --grad: linear-gradient(135deg, #2563eb, #7c3aed);
  --soft: linear-gradient(135deg, rgba(37, 99, 235, .07), rgba(124, 58, 237, .07));
  --border: rgba(37, 99, 235, .12);
  --shadow: 0 4px 24px rgba(37, 99, 235, .07), 0 1px 4px rgba(0, 0, 0, .04);
  --shadow2: 0 8px 40px rgba(37, 99, 235, .13), 0 2px 8px rgba(0, 0, 0, .05);
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --r: 16px;
  --sw: 240px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Courier New", ui-monospace, Menlo, monospace;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

/* Два мягких пятна на фоне — оттуда же, они задают глубину без картинок. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 80% 20%, rgba(37, 99, 235, .05), transparent),
    radial-gradient(ellipse 500px 500px at 10% 80%, rgba(124, 58, 237, .04), transparent);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 28px; font-weight: 900; letter-spacing: -.8px; }
h2 { font-size: 16px; font-weight: 800; letter-spacing: -.4px; }
h3 { font-size: 14px; font-weight: 700; }
a { color: var(--blue); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* ── Каркас ───────────────────────────────────────────────────────────── */

.layout { display: flex; min-height: 100vh; }

.side {
  width: var(--sw);
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 20px rgba(37, 99, 235, .04);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}
.brand strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 500;
  margin-top: 2px;
}

.nav { display: flex; flex-direction: column; padding-bottom: 10px; }
.nav .group {
  padding: 16px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .5px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  cursor: pointer;
  position: relative;
  transition: all .18s;
}
.nav button:hover { background: var(--soft); color: var(--blue); }
.nav button.on { background: var(--soft); color: var(--blue); font-weight: 600; }
.nav button.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--grad);
  border-radius: 0 3px 3px 0;
}
.nav .count {
  margin-left: auto;
  background: var(--grad);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 7px;
  font-weight: 700;
}

.side .who {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--light);
}

.main {
  margin-left: var(--sw);
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  padding: 32px;
  max-width: 1100px;
}
.head { margin-bottom: 28px; }
.head p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 6px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { position: static; width: 100%; min-height: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; padding: 6px 12px 12px; }
  .nav .group { display: none; }
  .nav button { width: auto; padding: 8px 14px; border-radius: 8px; }
  .nav button.on::before { display: none; }
  .main { margin-left: 0; padding: 20px 16px 48px; }
}

/* ── Элементы ─────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow2); }
.card h3 { margin-bottom: 8px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, textarea, select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); }
textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 11px; color: var(--light); margin-top: 4px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

button.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 20px;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  transition: box-shadow .2s, opacity .2s;
}
button.btn:hover { box-shadow: 0 4px 14px rgba(37, 99, 235, .3); }
button.btn.ghost {
  background: var(--card);
  color: var(--muted);
  border-color: var(--border);
}
button.btn.ghost:hover { background: var(--soft); color: var(--blue); box-shadow: none; }
button.btn.danger {
  background: var(--card);
  color: var(--bad);
  border-color: rgba(239, 68, 68, .35);
}
button.btn.danger:hover { box-shadow: none; background: rgba(239, 68, 68, .06); }
button.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }

.tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(37, 99, 235, .1);
  color: var(--blue);
  white-space: nowrap;
}
.tag.ok { background: rgba(16, 185, 129, .1); color: #059669; }
.tag.warn { background: rgba(245, 158, 11, .12); color: #b45309; }
.tag.bad { background: rgba(239, 68, 68, .1); color: var(--bad); }

.note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.note.bad { color: var(--bad); }
.note.warn { color: #b45309; }
.note.ok { color: #059669; }

.empty {
  text-align: center;
  color: var(--light);
  font-size: 13px;
  padding: 44px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  background: var(--card);
}

.post-body { white-space: pre-wrap; margin: 12px 0; font-size: 13px; line-height: 1.65; }
.checks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.log { font-size: 12px; }
.log td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--muted); }
table { width: 100%; border-collapse: collapse; }

.auth { max-width: 380px; margin: 12vh auto; padding: 0 16px; position: relative; z-index: 1; }
.auth .card { padding: 28px; }
.auth .mark {
  width: 36px;
  height: 36px;
  background: var(--grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
  margin-bottom: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow2);
  z-index: 200;
}
.toast.bad { background: var(--bad); }
[hidden] { display: none !important; }

/* ── Новостник ────────────────────────────────────────────────────────────
   Раскладка и календарь повторяют департамент: узкая колонка с месяцем,
   широкая со списком. На узком экране колонки встают друг под друга. */

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .news-layout { grid-template-columns: 1fr; } }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 12px; }
.cal-dn {
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--light);
  text-transform: uppercase;
  padding: 6px 0;
}
.cal-d {
  /* Не aspect-ratio: у элемента сетки он раздувает минимальную ширину, и
     календарь вылезает за карточку поверх списка новостей. */
  height: 34px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-family: inherit;
  transition: all .15s;
}
.cal-d:hover { background: var(--soft); color: var(--blue); }
.cal-d.has::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}
.cal-d.today { border: 2px solid var(--blue); color: var(--blue); font-weight: 700; }
.cal-d.sel {
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .38);
}
.cal-d.sel::after { display: none; }
.cal-d.empty { visibility: hidden; pointer-events: none; }

.cal-legend {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: var(--light);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.cal-legend .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.cal-legend .dot.ring { background: transparent; border: 2px solid var(--blue); }

.np-date { font-size: 16px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 4px; }
.np-sub { font-size: 11px; color: var(--muted); margin-bottom: 14px; }

.hl-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .05);
  margin-bottom: 7px;
  cursor: pointer;
  transition: all .18s;
}
.hl-row:hover { background: var(--soft); border-color: rgba(37, 99, 235, .22); }
.hl-row.open { background: var(--soft); border-color: rgba(37, 99, 235, .3); }
.hl-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); flex: 1; min-width: 0; }
.hl-strength { font-size: 10px; color: var(--light); flex-shrink: 0; margin-top: 2px; }
.hl-detail { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 8px; }
.hl-detail b { color: var(--text); font-weight: 600; }
.tag.evergreen { background: rgba(124, 58, 237, .1); color: var(--violet); }

.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.source-row:last-child { border-bottom: 0; }
.source-row .value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.source-row.off .value { opacity: .45; text-decoration: line-through; }
