/* Палитра и шрифты — как в «AI мастерской фито роликов» (Travnik. Radar)
   и на nektarica.ru: кремовый фон, шалфейные акценты, заголовки Bebas Neue. */

:root {
  --bg: #FBFAF3;
  --card: #FFFFFF;
  --ink: #2E362B;
  --muted: #54604A;
  --line: rgba(32, 38, 27, .13);
  --accent: #758D64;
  --accent-deep: #4F6540;
  --accent-soft: #E5EBDD;
  --olive: #8C842F;
  --clay: #A9784B;
  --cream: #F5F3E9;
  --mist: #EAEADC;
  --danger: #9B3B2C;
  --danger-soft: #F6E3E0;
  --radius: 12px;
  --shadow: 0 12px 36px -22px rgba(37, 48, 26, .4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.15;
  margin: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-deep); }
a:hover { color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 20px 80px; }

/* ── Шапка и вкладки ─────────────────────────────────────────── */
header.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 0; }
header.top .wrap { padding-top: 0; padding-bottom: 0; display: flex; align-items: center; gap: 16px; }
.home { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.logo { width: 48px; height: 48px; border-radius: 50%; }
header.top h1 { font-size: 26px; }
header.top .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.nav { margin-left: auto; display: flex; gap: 8px; }
.nav a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none;
         color: var(--muted); font-size: 14px; }
.nav a:hover { border-color: var(--accent); color: var(--accent-deep); }


/* ── Карточки ───────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.card > h3 { background: var(--accent-soft); padding: 10px 18px; font-size: 21px; display: flex;
             align-items: center; gap: 10px; flex-wrap: wrap; }
.card > h3 .btn { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
                  letter-spacing: 0; text-transform: none; }
.card-body { padding: 16px 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hint { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
        font-size: 14px; color: var(--muted); }
.hint.warn { background: #FBF3E4; border-color: #E5D3A8; color: #7A5A12; }
.hint.err { background: var(--danger-soft); border-color: #D8C3BE; color: var(--danger); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; line-height: 1.6;
       background: var(--mist); color: var(--muted); white-space: nowrap; }
.tag.rub { background: var(--accent); color: #fff; }
.tag.rt { background: #E9E2D2; color: #6B5326; }
.tag.zv { background: #E1E8EE; color: #3A5468; }
.tag.ok { background: var(--accent-soft); color: var(--accent-deep); }
.tag.pub { background: var(--accent-deep); color: #fff; }
.tag.chosen { background: var(--olive); color: #fff; }
.tag.personal { background: #F0E2D6; color: #7A4A28; }

/* ── Кнопки и поля ──────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
       border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-size: 15px;
       cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-deep); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn.flat { border-color: var(--line); background: var(--card); color: var(--muted); }
.btn.flat:hover { border-color: var(--accent); color: var(--ink); background: var(--card); }
.btn.danger { background: transparent; border-color: #D8C3BE; color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 4px 12px; font-size: 14px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
                   border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input[type=text], input[type=url], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea.post { min-height: 420px; font-size: 15.5px; line-height: 1.6; resize: vertical; }
label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .btn, .row > .shrink { flex: 0 0 auto; }

/* ── День ───────────────────────────────────────────────────── */
.daybar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.daybar h2 { font-size: 34px; }
.daybar .grow { flex: 1; }
.daygrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.side .card > h3 { font-size: 18px; }
.side ul { margin: 0; padding-left: 18px; font-size: 14px; }
.side li { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.draft-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 18px 0; }
.draft-head .grow { flex: 1; }
.draft .card-body { padding-top: 10px; }
.draft.is-chosen { border-color: var(--olive); box-shadow: 0 0 0 2px rgba(140, 132, 47, .25), var(--shadow); }
.draft.is-published { border-color: var(--accent-deep); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.counter { font-size: 13px; color: var(--muted); margin-left: auto; }
.counter.over { color: var(--danger); font-weight: 600; }
details.more { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.more ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.claims li { color: #7A5A12; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo { position: relative; width: 120px; }
.photo img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.photo .x { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); border: 0; border-radius: 50%;
            width: 24px; height: 24px; cursor: pointer; color: var(--danger); }
.photo a.dl { font-size: 12px; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--muted);
        cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* ── Таблица плана ──────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.filters > * { flex: 0 1 auto; }
.filters input[type=search] { min-width: 240px; }
table.plan { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.plan th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px;
                border-bottom: 2px solid var(--line); background: var(--cream); }
table.plan td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plan tr.month td { background: var(--accent-soft); font-family: "Bebas Neue", Impact, sans-serif;
                         font-size: 19px; letter-spacing: .03em; padding: 6px 10px; }
table.plan td.date { white-space: nowrap; color: var(--muted); }
table.plan td .title { font-weight: 500; }
table.plan td .sum { color: var(--muted); font-size: 13px; }
table.plan select, table.plan input { padding: 4px 8px; font-size: 13.5px; border-radius: 8px; }
table.plan .plants { min-width: 190px; }
table.plan .views { text-align: right; color: var(--muted); white-space: nowrap; }
.saved { outline: 2px solid var(--accent) !important; transition: outline .6s; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; }
.pager span { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Статистика ─────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stat b { display: block; font-family: "Bebas Neue", Impact, sans-serif; font-size: 32px; font-weight: 400; }
.stat span { color: var(--muted); font-size: 13.5px; }
.hbar { display: grid; grid-template-columns: 170px 1fr 56px; gap: 10px; align-items: center; font-size: 14px;
        margin-bottom: 6px; }
.hbar .bar { background: var(--mist); border-radius: 6px; height: 12px; overflow: hidden; }
.hbar .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.hbar .bar i.personal { background: var(--clay); }
.hbar .n { text-align: right; color: var(--muted); }
.diff { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.diff del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.diff ins { background: var(--accent-soft); color: var(--accent-deep); text-decoration: none; }
.pre { white-space: pre-wrap; font-size: 14.5px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.log { font-size: 13px; font-family: ui-monospace, Menlo, monospace; max-height: 340px; overflow: auto; }
.log div { padding: 2px 0; border-bottom: 1px solid var(--line); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.thumbs label { display: block; font-size: 12px; color: var(--muted); }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
         padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }

.login { max-width: 420px; margin: 60px auto; }

@media (max-width: 900px) {
  .daygrid, .cols2 { grid-template-columns: 1fr; }
  .side { order: 2; }
  header.top h1 { font-size: 21px; }
  .hbar { grid-template-columns: 120px 1fr 44px; }
  table.plan .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  header.top .sub, .nav { display: none; }
  textarea.post { min-height: 340px; }
  table.plan { font-size: 13.5px; }
}

/* ── Подсказки ─────────────────────────────────────────────── */
.who { align-self: center; color: var(--muted); font-size: 14px; padding: 0 6px; }
details.guide { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
                margin-bottom: 18px; font-size: 15px; }
details.guide > summary { cursor: pointer; padding: 10px 16px; font-weight: 600; color: var(--accent-deep); list-style: none;
                          display: flex; align-items: center; gap: 10px; }
details.guide > summary:hover { color: var(--ink); }
.chev { margin-left: auto; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
        transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
details.guide[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
details.guide > summary::-webkit-details-marker { display: none; }
details.guide[open] > summary { border-bottom: 1px solid var(--line); }
details.guide .g { padding: 4px 18px 12px; }
details.guide ol, details.guide ul { padding-left: 22px; margin: 8px 0; }
details.guide li { margin-bottom: 6px; }
.tip { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.help h3 { font-size: 24px; margin: 26px 0 8px; }
.help p, .help li { font-size: 16px; }
.help li { margin-bottom: 6px; }

/* ── Иконки: один набор, одна толщина линии ───────────────── */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
     stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.i.ok { color: var(--accent-deep); }
.tag .i { width: 1em; height: 1em; margin-right: 4px; vertical-align: -.15em; }
.hint .i { margin-right: 4px; }
.hint.warn .i { color: #9A6B12; }
.btn .i { width: 1.1em; height: 1.1em; }
.drop { display: inline-flex; align-items: center; gap: 8px; }

/* ── Шапка в стиле nektarica.ru: стеклянная «капсула» меню ─────── */
header.top { background: rgba(255, 254, 245, .86); -webkit-backdrop-filter: blur(14px) saturate(1.2);
             backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid rgba(117, 141, 100, .22);
             position: sticky; top: 0; z-index: 10; padding: 12px 0; }
header.top .bar { gap: 22px; }
header.top h1 { font-size: 26px; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 40px; margin: 0 auto;
            background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
            border: 1px solid rgba(117, 141, 100, .28); box-shadow: 0 10px 28px -20px rgba(37, 48, 26, .5);
            font-size: 13.5px; line-height: 20px; font-weight: 600; letter-spacing: -.1px; }
.main-nav a { white-space: nowrap; text-decoration: none; padding: 8px 14px; border-radius: 30px; color: #1c2418;
              transition: background .2s, color .2s; }
.main-nav a:hover { background: var(--accent); color: #fff; }
.main-nav a.on { background: rgba(117, 141, 100, .18); }
.main-nav a.on:hover { background: var(--accent); }
.user { display: flex; align-items: center; gap: 6px; margin-left: 0; }
.who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; padding-right: 6px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
           border: 1px solid rgba(117, 141, 100, .28); color: var(--accent-deep); background: rgba(255, 255, 255, .62);
           transition: background .2s, color .2s; }
.iconbtn:hover, .iconbtn.on { background: var(--accent); color: #fff; }
.iconbtn .i { width: 19px; height: 19px; }
@media (max-width: 900px) {
  header.top .bar { flex-wrap: wrap; gap: 10px 14px; }
  .user { margin-left: auto; }
  .main-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .who { display: none; }
}

/* ── Контент-план: фильтры ─────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; margin-bottom: 16px; }
.filters .fld { flex: 0 0 auto; min-width: 150px; }
.filters .fld.grow { flex: 1 1 320px; }
.filters select, .filters input[type=search] { height: 42px; }
.searchbox { display: flex; gap: 8px; }
.searchbox input { flex: 1; min-width: 0; }
.searchbox .btn { height: 42px; padding: 0 22px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border: 1px solid var(--line);
          border-radius: 999px; background: var(--card); cursor: pointer; font-size: 14px; color: var(--muted); margin-left: auto; }
.toggle:hover { border-color: var(--accent); }
.toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--mist);
                position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
                       background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); }
.toggle:has(input:checked) { color: var(--ink); border-color: var(--accent); }
@media (max-width: 700px) { .toggle { margin-left: 0; } .filters .fld { flex: 1 1 140px; } }

/* ── Контент-план: ссылки ТГ / MAX ─────────────────────────── */
.links { display: flex; align-items: center; gap: 8px; }
.tglink { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep);
          text-decoration: none; font-size: 13px; font-weight: 600; }
.tglink:hover { background: var(--accent); color: #fff; }
table.plan .links input { height: 32px; min-width: 150px; }
table.plan td.hide-sm { min-width: 260px; }

/* ── Выбор файла ───────────────────────────────────────────── */
.importrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.importrow .or { color: var(--muted); font-size: 14px; }
.filepick { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px dashed var(--accent);
            border-radius: 999px; color: var(--accent-deep); background: var(--cream); cursor: pointer; font-size: 15px;
            max-width: 280px; }
.filepick:hover { background: var(--accent-soft); }
.filepick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.plan td select { min-width: 140px; }
table.plan td.hide-sm { min-width: 0; }
table.plan .links input { min-width: 130px; width: 100%; }

/* ── Справка по клику «?» ──────────────────────────────────── */
.q { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; margin-left: 6px;
     border-radius: 50%; border: 1.5px solid rgba(117, 141, 100, .6); background: transparent; color: var(--accent-deep);
     font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: 0;
     cursor: pointer; vertical-align: middle; flex: none; text-transform: none; }
.q:hover, .q:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; outline: none; }
.qpop { position: absolute; z-index: 60; max-width: 340px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff;
        font: 400 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; text-transform: none;
        box-shadow: 0 14px 34px -14px rgba(37, 48, 26, .6); white-space: pre-line; }
.stat .q { margin-left: 4px; }

/* ── Выбор даты ────────────────────────────────────────────── */
.datebtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
           border: 1px solid rgba(117, 141, 100, .4); background: var(--card); color: var(--ink); font: inherit; font-size: 15px;
           cursor: pointer; }
.datebtn:hover { border-color: var(--accent); background: var(--accent-soft); }
.datebtn .i { color: var(--accent-deep); }
.cal { position: absolute; z-index: 70; width: 300px; padding: 14px; border-radius: 16px; background: var(--card);
       border: 1px solid rgba(117, 141, 100, .28); box-shadow: 0 18px 44px -18px rgba(37, 48, 26, .5); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 21px; letter-spacing: .03em; }
.cal-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--accent-deep);
           cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.cal-nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-w { font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal-d { height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font: inherit; font-size: 14.5px;
         cursor: pointer; padding: 0; }
.cal-d:hover { background: var(--accent-soft); }
.cal-d.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-d.sel { background: var(--accent); color: #fff; box-shadow: none; }
.cal-foot { margin-top: 10px; text-align: center; }
.cal-today { border: 0; background: transparent; color: var(--accent-deep); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.cal-today:hover { text-decoration: underline; }
.draft-head .counter { margin-left: 0; }
.draft-head .q { margin-left: 4px; }

/* ── Плашки статистики: «?» в правом верхнем углу ─────────── */
.stat { position: relative; }
.stat > .q { position: absolute; top: 12px; right: 12px; margin: 0; }
.stat b { padding-right: 28px; }

/* ── Длинные слова не должны раздвигать карточки ───────────── */
.daygrid > *, .cols2 > *, .card, .card-body { min-width: 0; }
.card { overflow: clip; }
textarea, input { max-width: 100%; }
textarea { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow-x: hidden; }
.card-body, .hint, .pre, .diff, details.guide .g { overflow-wrap: anywhere; }
