/* =====================================================================
   Дизайн v2 (11.11.2026, по прототипу критика): боковое меню, мягкие карточки, фиолетовый акцент.
   Подключается после site.css и переопределяет его; классы страниц прежние (их заменяет live.js).
   ===================================================================== */
body { font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 27px; letter-spacing: -.6px; line-height: 1.2; }
h2 { font-size: 17px; letter-spacing: -.2px; }
svg.icons { display: none; }
.side-nav svg, .bottom-nav svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- каркас --- */
body.shell main { max-width: 1320px; padding: 30px 36px 80px; margin: 0 0 0 max(var(--side), calc(var(--side) + (100vw - var(--side) - 1320px) / 2)); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40; display: flex; flex-direction: column; gap: 18px;
    padding: 22px 14px 14px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -1px; }
.logo img { width: 32px; height: 32px; border-radius: 9px; }
.logo i { font-style: normal; color: #9bc21f; }
.sidebar .logo { padding: 0 10px; }
.side-nav { display: grid; gap: 2px; }
.nav-caption { font-size: 10px; letter-spacing: 1.2px; font-weight: 800; color: var(--muted); opacity: .8; text-transform: uppercase; padding: 0 12px; margin: 16px 0 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.side-nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav a:hover { background: var(--bg); color: var(--text); }
.side-nav a.active { background: var(--soft); color: var(--accent-2); }
.side-nav a.proj img, .side-nav a.proj b { width: 22px; height: 22px; border-radius: 7px; object-fit: cover; flex: none; display: grid; place-items: center;
    font-size: 11px; background: var(--soft); color: var(--accent); }
.side-nav .sub { display: grid; gap: 1px; margin: 2px 0 6px 22px; padding-left: 10px; border-left: 2px solid var(--line); }
.side-nav .sub a { padding: 7px 10px; font-size: 13px; }
.account { margin: auto 0 0; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.account .ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent-2); font-weight: 800; flex: none; }
.account .who { display: grid; min-width: 0; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who small { font-weight: 500; color: var(--muted); font-size: 11px; }
.account button.link { margin-left: auto; font-size: 13px; }
header.topbar { display: none; }
.bottom-nav, .scrim { display: none; }

/* --- кнопки --- */
button, a.btn { min-height: 40px; padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; line-height: 1.3;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 1px solid transparent;
    box-shadow: 0 6px 12px color-mix(in srgb, var(--accent) 18%, transparent); transition: background .15s, border-color .15s, color .15s; }
button:hover, a.btn:hover { filter: none; background: var(--accent-2); }
button.secondary, a.btn.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
button.secondary:hover, a.btn.secondary:hover { background: var(--soft); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
button.link, button.more, .flash .flash-x, .ig-modes button, .ig-prev, .ig-next, .ig-more, .ig-reel-bar button, .mic-wrap .mic, .picked button, .sel-btn, .chip-btn {
    min-height: 0; box-shadow: none; font-weight: inherit; }
button.link, button.more { background: none; color: var(--accent); padding: 0; border: 0; }
button.link:hover, button.more:hover { background: none; text-decoration: underline; }
button.ok-btn { background: var(--ok); box-shadow: none; }
button.warn-btn { background: var(--err); box-shadow: none; }
button.secondary.warn { color: var(--err); }
a.btn.ghost { background: none; box-shadow: none; color: var(--muted); }
a.btn.ghost:hover { background: var(--soft); color: var(--accent-2); }
.sel-btn { background: var(--panel); border-radius: 10px; color: var(--text); display: block; }
.sel-btn:hover { background: var(--panel); }
.ig-modes button { background: var(--panel); color: var(--text); }
.ig-modes button.active { background: var(--accent); color: #fff; }
.ig-prev, .ig-next { background: #fff; color: #262626; display: inline-block; }
.ig-more, .ig-reel-bar button, .mic-wrap .mic, .picked button, .flash .flash-x { background: none; }
.ig-more:hover, .ig-reel-bar button:hover, .mic-wrap .mic:hover, .picked button:hover, .flash .flash-x:hover { background: none; }
.chip-btn { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 999px; }
.chip-btn:hover { background: var(--soft); }

/* --- поля --- */
input, textarea, select, .sel-btn { border-radius: 10px; border-color: var(--line); background: var(--panel); }
input, select { min-height: 40px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
label { font-size: 13px; font-weight: 600; gap: 4px; }

/* --- карточки и панели --- */
.card, .panel, .post, .empty, .user-card, dialog.ask { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.card { padding: 20px; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.panel { padding: 18px 20px; }
.empty { box-shadow: none; background: var(--panel); }
.crumbs { font-size: 13px; font-weight: 600; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.flash { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line)); border-left: 4px solid var(--ok); }
.alert { border-radius: 12px; }
.alert.warn { border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--panel)); padding: 12px 16px; }

/* --- статусы: цвет плюс подпись --- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 750; padding: 4px 8px; border-radius: 8px; border: 0;
    background: color-mix(in srgb, currentColor 12%, transparent); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.draft, .badge.idea { color: var(--muted); }
.badge.review, .badge.images, .badge.build { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip { border-radius: 8px; font-weight: 600; }

/* --- проекты (главная) --- */
.project-card { gap: 16px; }
.project-card:hover { box-shadow: 0 12px 32px rgba(39, 48, 75, .1); }
.brand-ava { box-shadow: none; border-radius: 13px; }
.stat { border-radius: 12px; padding: 12px; background: var(--bg); }
.stat b { font-size: 26px; letter-spacing: -1px; }
.stat.attn { background: var(--soft); }

/* --- проект --- */
.page-head { gap: 16px; margin-bottom: 20px; }
.page-head .brand-ava { width: 52px; height: 52px; }
.page-head h1 { font-size: 27px; }
.head-actions { gap: 8px; align-items: center; }
.need { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0; border: 0; background: none; box-shadow: none; margin-bottom: 20px; }
.need > strong { grid-column: 1 / -1; font-size: 15px; }
.need-item { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
    font-size: 13px; font-weight: 650; color: var(--muted); }
.need-item b { font-size: 28px; letter-spacing: -1px; line-height: 1.1; color: var(--accent); order: -1; }
.need-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.need-item.bad b { color: var(--err); }
.pills { gap: 6px; margin-bottom: 18px; }
.pills a { padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pills a:hover { background: var(--soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent-2); }
.pills a.active { background: var(--soft); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pills a.active small { opacity: 1; }
.pills a.attn small { background: var(--accent); }
.posts { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.post { overflow: hidden; }
.post:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 12px 32px rgba(39, 48, 75, .1); }
.thumb { aspect-ratio: 4 / 5; background: linear-gradient(145deg, var(--soft), var(--bg)); }
.kind { top: 10px; left: 10px; border-radius: 8px; font-weight: 700; font-size: 11px; padding: 4px 8px; background: rgba(20, 22, 40, .62); backdrop-filter: blur(6px); }
.body { padding: 14px 16px 16px; }
.body .row { gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.body .row .badge:first-of-type { margin-left: auto; }
.caption { font-size: 13px; color: var(--muted); }
.card-actions { padding: 0 16px 16px; }
.card-actions button { min-height: 36px; padding: 7px 10px; font-size: 13px; }
.start { padding: 22px 24px; }

/* --- пост --- */
.post-page { gap: 22px; grid-template-columns: minmax(0, 1fr) 400px; }
.panel.decision { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.ig-phone { border-radius: 22px; box-shadow: var(--shadow); }
.history li { border-radius: 10px; }

/* --- календарь --- */
.calendar { gap: 8px; }
.day { border-radius: 12px; padding: 8px; min-height: 120px; }
.day.today { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
.slot { border-radius: 7px; padding: 4px 6px; background: color-mix(in srgb, currentColor 10%, var(--panel)); }

/* --- таблицы --- */
table.plan th { font-size: 12px; color: var(--muted); font-weight: 700; }

/* --- вход --- */
body.bare { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent), var(--bg); }
body.bare main { max-width: 440px; margin: 0 auto; padding: 24px 16px; }
.login { border-radius: 18px; box-shadow: 0 20px 60px rgba(39, 48, 75, .12); padding: 32px 28px; margin-top: 10vh; }
.login-logo { width: 56px; height: 56px; border-radius: 15px; }

/* --- планшет: меню только иконками --- */
@media (max-width: 1100px) {
    :root { --side: 76px; }
    .sidebar { padding: 18px 10px; }
    .sidebar .logo { justify-content: center; padding: 0; }
    .sidebar .logo span, .nav-caption, .side-nav a span, .account .who, .account button.link { display: none; }
    .side-nav a { justify-content: center; padding: 11px; }
    .side-nav .sub { margin: 2px 0 6px; padding: 0; border: 0; }
    .account { justify-content: center; }
    body.shell main { padding: 26px 24px 70px; }
    .need { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- телефон: меню выезжает по кнопке «Ещё», снизу короткая навигация --- */
@media (max-width: 760px) {
    :root { --side: 280px; }
    body.shell main { margin: 0; padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
    header.topbar { display: flex; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 14px; gap: 12px; align-items: center;
        background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
    header.topbar .logo { font-size: 19px; order: 0; }
    header.topbar .top-title { order: 1; }
    header.topbar .logo img { width: 28px; height: 28px; }
    .top-title { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
    .sidebar { transform: translateX(-100%); transition: transform .2s; padding: 22px 14px 14px; }
    body.menu-open .sidebar { box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
    .sidebar .logo { justify-content: flex-start; padding: 0 10px; }
    .sidebar .logo span, .nav-caption, .side-nav a span, .account button.link { display: initial; }
    .account .who { display: grid; }
    .side-nav a { justify-content: flex-start; padding: 10px 12px; }
    .side-nav .sub { margin: 2px 0 6px 22px; padding-left: 10px; border-left: 2px solid var(--line); }
    .account { justify-content: flex-start; }
    body.menu-open .sidebar { transform: none; }
    body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20, 22, 40, .45); }
    .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 32; height: calc(62px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(18, 24, 49, .05); }
    .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 0;
        padding: 6px 0; font-size: 10px; font-weight: 750; color: var(--muted); background: none; border: 0; border-radius: 0; box-shadow: none; }
    .bottom-nav a.active { color: var(--accent); }
    .bottom-nav svg { width: 20px; height: 20px; }
    .bottom-nav button:hover { background: none; color: var(--accent); }
    .flash { top: 64px; }
    h1, .page-head h1 { font-size: 22px; }
    .need { gap: 8px; }
    .need-item { padding: 12px 14px; }
    .need-item b { font-size: 24px; }
    .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .body { padding: 10px 12px 12px; }
    .card-actions { padding: 0 12px 12px; }
    .pills, .tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
    .decision .decision-bar { bottom: calc(62px + env(safe-area-inset-bottom)); }
    main:has(.decision-bar) { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
    .live-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .posts { grid-template-columns: 1fr; } }
.need-item.zero b { color: var(--muted); opacity: .6; }
.need-item.zero { box-shadow: none; }
.posts .caption { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.stat span { overflow-wrap: normal; hyphens: auto; }
.decision-bar button.warn-btn, .card-actions button.warn-btn { background: var(--panel); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 35%, var(--line)); }
.decision-bar button.warn-btn:hover, .card-actions button.warn-btn:hover { background: color-mix(in srgb, var(--err) 8%, var(--panel)); }
@media (max-width: 1000px) { .post-page { grid-template-columns: minmax(0, 1fr); } }
.prelim-item .use input { position: static; width: 18px; height: 18px; }
button.warn-btn { background: var(--panel); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 35%, var(--line)); box-shadow: none; }
button.warn-btn:hover { background: color-mix(in srgb, var(--err) 8%, var(--panel)); }
@media (max-width: 760px) { .prelim-bar { bottom: calc(62px + env(safe-area-inset-bottom)); } }
/* «Моя работа» (агентство) */
.work-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.work-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.work-item:last-child { border-bottom: 0; }
.work-item img, .work-item .ph { width: 44px; height: 55px; border-radius: 8px; object-fit: cover; flex: none; background: var(--soft); }
.work-item .txt { display: grid; min-width: 0; flex: 1; }
.work-item .txt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item .txt small { color: var(--muted); font-size: 12px; }
.work-item .date { width: 52px; flex: none; display: grid; place-items: center; padding: 6px 0; border-radius: 10px; background: var(--soft); color: var(--accent-2); font-weight: 800; font-size: 14px; line-height: 1.2; }
.work-item .date small { font-weight: 600; font-size: 11px; }
.work-item:hover b { color: var(--accent); }
.work-table { width: 100%; border-collapse: collapse; }
.work-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px; }
.work-table td { padding: 10px 8px; border-top: 1px solid var(--line); font-size: 14px; }
@media (max-width: 900px) { .work-cols { grid-template-columns: 1fr; } }
.work-cols { align-items: start; }
.panel { align-content: start; }
.need-item small { font-size: 11px; font-weight: 600; color: var(--muted); }
/* Контент-план (агентство) */
.month-title { font-weight: 800; font-size: 16px; min-width: 130px; text-align: center; }
.plan-layout { display: grid; gap: 16px; }
.plan-layout.with-form { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.plan-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.plan-grid .dow { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 4px; }
.pday { min-height: 110px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pday.other { opacity: .45; }
.pday.today { border-color: var(--accent); }
.pnum { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.padd { opacity: 0; font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 6px; }
.pday:hover .padd { opacity: 1; }
.padd:hover { background: var(--soft); }
.pslot { display: grid; gap: 1px; padding: 5px 7px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--soft); color: var(--text); min-width: 0; }
.pslot b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pslot small { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pslot.sel { outline: 2px solid var(--accent); }
.pslot.planned { border-left-color: var(--muted); background: var(--bg); }
.pslot.late { border-left-color: var(--err); background: color-mix(in srgb, var(--err) 8%, var(--panel)); }
.pslot.published { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--panel)); }
.pslot.queued { border-left-color: var(--ok); }
.pslot.failed { border-left-color: var(--err); }
.pslot.cancelled { opacity: .5; text-decoration: line-through; }
.pslot.fact { border-left-color: var(--line); background: transparent; border: 1px dashed var(--line); }
.plan-form { position: sticky; top: 16px; }
.plan-form form { display: grid; gap: 10px; }
.plan-form div.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-actions p { flex-basis: 100%; margin: 0; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.row-line input { flex: 1; }
.camp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.camp-form button { grid-column: 1 / -1; justify-self: start; }
.badge.late, .badge.failed { color: var(--err); }
.badge.planned, .badge.brief, .badge.cancelled { color: var(--muted); }
.badge.published, .badge.queued { color: var(--ok); }
@media (max-width: 1100px) { .plan-layout.with-form { grid-template-columns: 1fr; } .plan-form { position: static; } }
@media (max-width: 760px) {
    .plan-grid { grid-template-columns: 1fr; }
    .plan-grid .dow, .pday.other { display: none; }
    .pday { min-height: 0; }
    .pday:not(:has(.pslot)) { display: none; }
    .padd { opacity: 1; }
}

.plan-form label, .plan-form .mic-wrap { min-width: 0; width: 100%; }
.plan-form input, .plan-form select, .plan-form textarea, .plan-form .sel { width: 100%; min-width: 0; max-width: 100%; }
.plan-layout > * { min-width: 0; }
