:root {
  /* HS Digital brand kit (HSDG48/brand-library, brands/hs-digital): Navy #0B3768, Blue #1E88D2, Blue 700 #1466A6,
     Sky #E8F3FC, Mist #F6F9FC, Ink #0A1A2F, Slate #5A6B82, Line #DCE6F0; Bricolage Grotesque + Manrope */
  --bg: #f6f9fc; --card: #fff; --ink: #0a1a2f; --muted: #5a6b82; --line: #dce6f0; --soft: #e8f3fc;
  --brand: #0b3768; --brand-ink: #fff; --accent: #1466a6;
  --ok: #10b981; --warn: #f59e0b; --bad: #dc2626; --busy: #94a3b8; --info: #1e88d2;
  --shadow: 0 1px 2px rgba(11, 55, 104, .06), 0 8px 24px -12px rgba(11, 55, 104, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1a2f; --card: #10243f; --ink: #eef4fa; --muted: #9db0c8; --line: #1d3a5e; --soft: #132c4c;
    --brand: #1e88d2; --brand-ink: #0a1a2f; --accent: #6db8ec; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope.ttf); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Bricolage; src: url(/fonts/Bricolage.ttf); font-weight: 200 800; font-display: swap; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3, .logo, .big, .kpi b { font-family: Bricolage, Manrope, system-ui, sans-serif; }
h2, h3 { margin: 0; font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--bad); min-height: 1.2em; }
.logo { font-weight: 800; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo picture, .logo .wm { display: block; height: 26px; width: auto; }
.logo .hq { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .02em; padding-left: 10px; border-left: 1px solid var(--line); }
.logo .hq i { font-style: normal; color: var(--muted); font-weight: 600; }
.login-box .logo picture, .login-box .logo .wm { height: 34px; }
/* the logo slides in once, on the group's easing (HS brand motion) */
.logo .wm { animation: logo-in .8s var(--ease) both; } .logo .hq { animation: logo-in .8s .15s var(--ease) both; }
@keyframes logo-in { from { opacity: 0; transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) { .logo .wm, .logo .hq { animation: none; } }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 7px 12px;
  font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--brand); } .btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; }
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 1px; }

.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--card); padding: 28px; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
  width: min(340px, 100%); display: grid; gap: 10px; }
.login-box .logo { font-size: 22px; margin-bottom: 8px; }

#app { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; padding: 0 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top h1 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; min-width: 110px; }
.engine { display: flex; gap: 8px; align-items: center; }
.pill { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--soft); }
.pill.on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.off { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; color: var(--ink); padding: 5px 11px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--brand); color: var(--brand-ink); }
.seg.small button { padding: 3px 8px; font-size: 12px; }
.seg-label { padding: 0 8px 0 10px; color: var(--muted); font-size: 12px; }
.platforms { display: flex; gap: 6px; flex-wrap: wrap; }
.plat { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 99px;
  padding: 3px 10px 3px 8px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink); }
.plat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--busy); }
.plat.on .dot { background: var(--ok); } .plat.off { opacity: .6; text-decoration: line-through; }
.plat .warn { color: var(--warn); }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 22px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--bad); }
.kpi.alert { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.kpi.click { cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; min-height: 0; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head a, a.small { color: var(--brand); text-decoration: none; font-weight: 600; }

.cal { display: flex; flex-direction: column; gap: 8px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; align-items: center; } .cal-nav h2 { margin-left: 6px; }
.plan-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-chip { font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; display: flex; gap: 8px; align-items: center; }
.calendar { min-height: calc(100vh - 210px); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; overflow: auto; }
.calendar.month { grid-auto-rows: minmax(96px, auto); }
.calendar.month .day { overflow: visible; gap: 3px; }
.month .post .st { display: none; }
.day { background: var(--soft); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 5px; min-height: 0; overflow: auto; border: 2px solid transparent; }
.day.today { border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.day.past { opacity: .72; } .day.other { opacity: .45; }
.day.drop { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--soft)); }
.day-head { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; }
.post { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--busy); border-radius: 8px; padding: 5px;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; cursor: pointer; font-size: 12px; }
.post:hover { border-color: var(--brand); }
.post[draggable="true"] { cursor: grab; }
.post .thumb { width: 40px; height: 64px; border-radius: 5px; background: var(--soft) center / cover no-repeat; display: grid; place-items: center; font-size: 16px; }
.month .post { grid-template-columns: minmax(0, 1fr); padding: 3px 5px; } .month .post .thumb, .month .post .hook { display: none; }
.post .meta { font-weight: 700; display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; }
.post .hook { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post .st { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.s-made { border-left-color: var(--info); } .s-made .st { color: var(--info); }
.s-approved { border-left-color: var(--ok); } .s-approved .st { color: var(--ok); }
.s-published { border-left-color: var(--brand); } .s-published .st { color: var(--brand); }
.s-failed, .s-waiting { border-left-color: var(--warn); } .s-failed .st, .s-waiting .st { color: var(--warn); }
.s-rejected { border-left-color: var(--bad); }
.hint { margin: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px -4px 8px; }
.tabs button { background: none; border: 0; padding: 8px 10px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }
.count { background: var(--warn); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; }
.count:empty { display: none; }
.tab-body { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.item .row { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.item blockquote { margin: 0; padding-left: 8px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.feed { font-size: 12.5px; display: grid; gap: 2px; } .feed .when { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.empty { color: var(--muted); text-align: center; padding: 20px 8px; }

.chart { height: 150px; } .chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .legend { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.chart .sw { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.drawer { position: fixed; inset: 0; z-index: 10; }
.drawer-back { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--card); overflow: auto; padding: 20px; box-shadow: -8px 0 30px rgba(0, 0, 0, .2); }
.close { position: absolute; top: 10px; right: 10px; }
.d-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; margin-top: 10px; }
.d-media video, .d-media img { width: 100%; border-radius: 10px; background: #000; display: block; }
.d-media .slides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.d-media .slides img { aspect-ratio: 4 / 5; object-fit: cover; cursor: pointer; }
.d-sec { display: grid; gap: 6px; margin-bottom: 14px; }
.d-sec h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.d-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-row input[type="datetime-local"] { width: auto; }
.flag { background: color-mix(in srgb, var(--warn) 14%, transparent); border-radius: 8px; padding: 8px; font-size: 12.5px; }
.targets { display: grid; gap: 4px; font-size: 12.5px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; } .stats b { font-size: 16px; display: block; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card);
  padding: 9px 16px; border-radius: 10px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 1100px) {
  .calendar { overflow: visible; min-height: 0; }
  .calendar:not(.month) { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 640px) {
  .d-grid { grid-template-columns: 1fr; } .top-right { margin-left: 0; }
  .calendar.month { grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 10px; }
}

/* --- vector touches: the logo mark, a QR-dot pattern in the hero, line drawings for empty states ---------- */
.mark { width: 26px; height: 26px; vertical-align: -7px; margin-right: 7px; border-radius: 8px;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--brand) 70%, transparent); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.logo:hover .mark { transform: rotate(-8deg) scale(1.08); }
.login-box .mark { width: 34px; height: 34px; vertical-align: -10px; }
.hero::before { content: ""; position: absolute; right: 14px; bottom: -18px; width: 150px; height: 150px; opacity: .13; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21' fill='%230B3768'%3E%3Cpath d='M0 0h7v7H0zM2 2v3h3V2zM14 0h7v7h-7zM16 2v3h3V2zM0 14h7v7H0zM2 16v3h3v-3z' fill-rule='evenodd'/%3E%3Crect x='3' y='3' width='1' height='1'/%3E%3Cpath d='M9 0h2v2H9zM9 3h1v3H9zM11 5h2v2h-2zM8 8h3v1H8zM13 9h2v2h-2zM16 8h2v1h-2zM19 9h2v3h-2zM9 11h2v2H9zM12 12h1v3h-1zM15 13h3v2h-3zM9 15h2v2H9zM14 16h2v3h-2zM17 17h4v1h-4zM9 19h3v2H9zM19 19h2v2h-2zM0 9h2v2H0zM3 10h3v1H3zM5 12h2v1H5z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: float 7s ease-in-out infinite alternate; }
.empty::before { content: ""; display: block; width: 92px; height: 64px; margin: 0 auto 10px; opacity: .85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 64' fill='none' stroke='%230B3768' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='46' cy='58' rx='34' ry='4' fill='%230B3768' fill-opacity='.12' stroke='none'/%3E%3Crect x='28' y='10' width='36' height='44' rx='6' fill='%230B3768' fill-opacity='.08'/%3E%3Cpath d='M36 22h20M36 30h14M36 38h18'/%3E%3Cpath d='M70 12l3-6M76 18l6-2M20 14l-4-5M14 24l-6 1' stroke-opacity='.6'/%3E%3Ccircle cx='71' cy='40' r='9' fill='%23fff'/%3E%3Cpath d='M67 40l3 3 5-6'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: float 5s ease-in-out infinite alternate; }
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 120' preserveAspectRatio='none'%3E%3Cpath d='M0 70C40 50 70 90 110 72S180 40 210 58V120H0z' fill='%230B3768' fill-opacity='.07'/%3E%3Cpath d='M0 90C50 72 80 108 130 90S190 70 210 80V120H0z' fill='%230B3768' fill-opacity='.08'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.nav > * { position: relative; z-index: 1; }
.btn.go { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 750;
  box-shadow: 0 6px 18px -8px rgba(11, 55, 104, .5); }
.btn.go:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.go svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; fill: currentColor; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes float { from { transform: translateY(0) rotate(0); } to { transform: translateY(-6px) rotate(2deg); } }
@media (max-width: 900px) { .nav::after { display: none; } }
.err-item.read { opacity: .55; } .err-item .row .btn { margin-left: auto; padding: 2px 8px; }
