/* NHQN Agency Command Center — applies NHQN ecosystem design system (locked 2026-04-29).
   Source of truth: Setup_Business/skills/design-templates/design-system.css
   Rules:
     - paper + ink + accent (cam #E8825A CHỈ trên CTA — không glow)
     - Lora display, Be Vietnam Pro body, JetBrains Mono eyebrow/numbers
     - Sentence case xuyên suốt, không Title Case, không ALL CAPS body
     - Font-weight chỉ 400 và 600
*/

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600&family=Be+Vietnam+Pro:wght@400;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand tokens — locked */
  --paper:  #F5F0E8;
  --paper-soft: #FAF6EE;
  --ink:    #1A1A1A;
  --ink-80: rgba(26, 26, 26, .80);
  --ink-60: rgba(26, 26, 26, .60);
  --ink-40: rgba(26, 26, 26, .40);
  --ink-15: rgba(26, 26, 26, .15);
  --ink-08: rgba(26, 26, 26, .08);
  --accent: #E8825A;
  --accent-dark: #D5704A;
  --white:  #FFFFFF;

  /* Semantic status — used in tags + KPI warn/bad ONLY (not as brand color) */
  --ok:     #2F7A4D;
  --ok-bg:  #E9F2EC;
  --warn:   #B07300;
  --warn-bg:#FFF6DD;
  --bad:    #B23B2C;
  --bad-bg: #FBE8E4;
  --info:   #2E5F87;
  --info-bg:#E5EEF6;

  --font-display: 'Lora', Georgia, serif;
  --font-body:    'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ─────────── Login screen ─────────── */

#login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--paper);
}
#login .card {
  background: var(--white);
  padding: 48px 40px;
  border-radius: 0;
  width: 400px;
  text-align: center;
  border: 1px solid var(--ink-15);
  box-shadow: none;
}
#login h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
#login .sub {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
}
#login .card .sub:last-child {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-60);
  margin: 24px 0 0;
}

.gbtn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  border: 0;
  color: var(--white);
  padding: 14px 28px;
  border-radius: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.gbtn:hover { background: var(--ink-80); }
.gbtn svg { width: 18px; height: 18px; }

/* ─────────── App shell ─────────── */

#app { display: none; min-height: 100vh; }

.topbar {
  background: var(--white);
  color: var(--ink);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--ink-15);
}
.topbar .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.topbar .badge {
  font-family: var(--font-mono);
  font-weight: 500;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.topbar .user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-60);
}
.topbar .user button {
  background: transparent;
  border: 1px solid var(--ink-15);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
}
.topbar .user button:hover { border-color: var(--ink); }

/* ─────────── Tabs (grouped) ─────────── */

.tabs {
  background: var(--white);
  border-bottom: 1px solid var(--ink-15);
  padding: 14px 32px 0;
  display: flex;
  gap: 32px;
  overflow-x: auto;
  position: sticky;
  top: 51px;
  z-index: 9;
  align-items: flex-end;
}
.tab-group {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.tab-group + .tab-group {
  border-left: 1px solid var(--ink-15);
  padding-left: 32px;
  margin-left: 0;
}
.tab-group-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 4px 6px;
  white-space: nowrap;
}
.tab-group > div,
.tab-group {
  display: flex;
  flex-direction: column;
}
.tab-group {
  min-height: 0;
}
.tab-group > button + button { margin-left: 0; }
.tab-group {
  display: grid;
  grid-template-columns: auto;
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  align-items: end;
  column-gap: 0;
}
.tab-group > .tab-group-label {
  grid-column: 1 / -1;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-60);
  white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.tabs button:hover { color: var(--ink); background: var(--paper-soft); }
.tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
  background: var(--paper-soft);
}

@media (max-width: 1100px) {
  .tabs { gap: 20px; padding: 12px 20px 0; }
  .tab-group + .tab-group { padding-left: 20px; }
  .tabs button { padding: 8px 10px; font-size: 12px; }
}

/* ─────────── Layout ─────────── */

.main { padding: 32px; max-width: 1400px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─────────── KPI cards ─────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--ink-15);
  padding: 18px 20px;
  border-radius: 0;
}
.kpi-card .label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.kpi-card .value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.kpi-card .sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-60);
  margin-top: 6px;
}
.kpi-card.warn .value { color: var(--warn); }
.kpi-card.bad  .value { color: var(--bad); }

/* ─────────── Cards ─────────── */

.card {
  background: var(--white);
  border: 1px solid var(--ink-15);
  border-radius: 0;
  padding: 24px;
  margin-bottom: 16px;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  letter-spacing: -0.005em;
}
.card h3 .meta {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.card h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 16px 0 8px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ─────────── Tables ─────────── */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ink-08);
  vertical-align: top;
}
table th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
  background: var(--paper-soft);
  border-bottom: 1px solid var(--ink-15);
}
table tr:hover { background: var(--paper-soft); }
.right { text-align: right; }
.right.right { font-family: var(--font-mono); font-weight: 400; }

/* ─────────── Tags (status semantic) ─────────── */

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 0;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.tag.green  { color: var(--ok);   background: var(--ok-bg);   }
.tag.red    { color: var(--bad);  background: var(--bad-bg);  }
.tag.yellow { color: var(--warn); background: var(--warn-bg); }
.tag.blue   { color: var(--info); background: var(--info-bg); }
.tag.gray   { color: var(--ink-60); background: var(--paper-soft); }

/* ─────────── Buttons ─────────── */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  background: var(--accent);
  color: var(--white);
  border: 0;
  padding: 10px 18px;
  border-radius: 0;
  cursor: pointer;
  transition: background .12s;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--accent-dark); }
.btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.outline:hover {
  background: var(--ink);
  color: var(--white);
}
.btn.small { padding: 5px 12px; font-size: 11px; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #962d20; }
.btn.gold { background: var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─────────── Inputs ─────────── */

input, select, textarea {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--ink-15);
  border-radius: 0;
  width: 100%;
  background: var(--white);
  color: var(--ink);
  transition: border-color .12s;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--ink);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 6px;
}

/* ─────────── Alerts ─────────── */

.alert {
  padding: 14px 16px;
  border-radius: 0;
  margin-bottom: 16px;
  font-size: 13px;
  border-left: 3px solid currentColor;
}
.alert.warn  { background: var(--warn-bg); color: #6f4900; border-left-color: var(--warn); }
.alert.error { background: var(--bad-bg);  color: #6c1f15; border-left-color: var(--bad); }
.alert.info  { background: var(--info-bg); color: #1d4565; border-left-color: var(--info); }
.alert.ok    { background: var(--ok-bg);   color: #1f5733; border-left-color: var(--ok); }

/* ─────────── Health rows ─────────── */

.health-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-08);
  font-size: 13px;
}
.health-row:last-child { border-bottom: 0; }
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.dot.green  { background: var(--ok); }
.dot.red    { background: var(--bad); }
.dot.yellow { background: var(--warn); }

/* ─────────── Chat (AI co-pilot) ─────────── */

.chat-box {
  background: var(--paper-soft);
  border: 1px solid var(--ink-15);
  border-radius: 0;
  padding: 14px;
  height: 380px;
  overflow-y: auto;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
}
.chat-msg {
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 0;
  max-width: 85%;
  font-family: var(--font-body);
}
.chat-msg.user {
  background: var(--ink);
  color: var(--white);
  align-self: flex-end;
}
.chat-msg.ai {
  background: var(--white);
  border: 1px solid var(--ink-15);
  white-space: pre-wrap;
  color: var(--ink);
}
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row select { width: auto; flex: 0 0 200px; }
.chat-input-row input { flex: 1; }

/* ─────────── Misc ─────────── */

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-40);
  font-style: italic;
}
.loading { text-align: center; padding: 24px; color: var(--ink-60); }
.muted { color: var(--ink-60); }
canvas { max-height: 280px !important; }

code, pre {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--paper-soft);
  padding: 1px 4px;
}

/* ─────────── Modal ─────────── */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--white);
  border-radius: 0;
  border: 1px solid var(--ink-15);
  padding: 28px;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 18px;
  font-size: 18px;
  letter-spacing: -0.005em;
}
.modal h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ─────────── Calendar — Month grid view (multi-week stacked) ─────────── */

.cal-week-block + .cal-week-block { margin-top: 16px; }

.cal-week-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
}
.cal-week-header .cal-week-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
}
.cal-week-header .cal-week-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--paper);
  opacity: .75;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  background: var(--ink-15);
  gap: 1px;
}
.cal-month-dow {
  background: var(--paper);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
  text-align: center;
  padding: 8px 4px;
}
.cal-month-rowlabel {
  background: var(--paper);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
.cal-month-cell {
  background: var(--white);
  min-height: 110px;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: cell;
  transition: background .12s;
  position: relative;
}
.cal-month-cell:hover { background: var(--paper-soft); }
.cal-month-cell.out-of-range { background: var(--paper); opacity: .55; }
.cal-month-cell.is-today { background: var(--paper-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-month-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.cal-day-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  line-height: 1;
}
.cal-month-cell.is-today .cal-day-num { color: var(--accent); }
.cal-day-mono {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-40);
  letter-spacing: 0.06em;
}
.cal-month-cell-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.cal-slot-pill {
  display: grid;
  grid-template-columns: 28px 18px 1fr;
  gap: 4px;
  align-items: start;
  padding: 3px 5px;
  font-size: 10px;
  line-height: 1.25;
  cursor: pointer;
  transition: transform .12s;
  border-radius: 0;
  border: 0;
}
.cal-slot-pill:hover { transform: translateX(2px); }
.cal-slot-time {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.02em;
  padding-top: 1px;
}
.cal-slot-chan {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: center;
  padding-top: 1px;
}
.cal-slot-hook {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* ─────────── Slot hover popup ─────────── */
.slot-popup {
  position: fixed;
  z-index: 200;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--ink);
  box-shadow: 0 12px 40px rgba(26, 26, 26, .18);
  padding: 12px 14px;
  font-size: 12px;
  pointer-events: auto;
  animation: popupFade .12s ease-out;
}
@keyframes popupFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.slot-popup .pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.slot-popup .pop-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-40);
  letter-spacing: 0.04em;
}
.slot-popup .pop-time-chan {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.slot-popup .pop-hook {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  margin: 6px 0 8px;
  letter-spacing: -0.005em;
}
.slot-popup .pop-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  font-size: 11px;
  color: var(--ink-60);
  margin-bottom: 10px;
}
.slot-popup .pop-meta strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.slot-popup .pop-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--ink-08);
}
.slot-popup .pop-actions button { padding: 4px 10px; font-size: 11px; }
.slot-popup .pop-hint {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-40);
}

/* ─────────── Drag & drop visual ─────────── */
.cal-slot-pill { user-select: none; -webkit-user-drag: element; }
.cal-slot-pill[draggable="true"]:active { cursor: grabbing; }
.cal-slot-pill.dragging { opacity: .35; }
.cal-month-cell.drop-target {
  background: var(--paper-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.cal-matrix-cell.drop-target {
  background: var(--paper-soft);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.cal-slot-pill.is-clone-drag { outline: 2px dashed var(--accent); }
.cal-slot-pill.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-slot-pill.is-selectable { cursor: copy; }

/* Bulk action bar */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(26,26,26,.25);
  z-index: 80;
  font-family: var(--font-body);
  font-size: 13px;
}
.bulk-bar .bulk-count {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--accent);
}
.bulk-bar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--paper);
  padding: 6px 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.bulk-bar button:hover { border-color: var(--paper); background: rgba(255,255,255,.08); }
.bulk-bar button.danger { border-color: var(--bad); color: #ffb8ad; }
.bulk-bar button.danger:hover { background: var(--bad); color: #fff; }

/* ─────────── Remarketable signal (posted + post_url) ─────────── */
.cal-slot-pill.is-remarketable {
  box-shadow: inset 0 0 0 2px var(--accent);
  position: relative;
}
.cal-slot-pill.is-remarketable::after {
  content: '↻';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
}

/* ─────────── Pinned slot indicator ─────────── */
.cal-slot-pill.is-pinned { padding-left: 14px; }
.cal-slot-pill.is-pinned::before {
  content: '📌';
  position: absolute;
  left: 1px;
  top: 1px;
  font-size: 9px;
}

/* ─────────── Best performers section ─────────── */
.best-perf-strip {
  background: var(--white);
  border: 1px solid var(--ink-15);
  margin-bottom: 16px;
  padding: 12px 16px;
}
.best-perf-strip .bp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.best-perf-strip .bp-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.best-perf-strip .bp-meta {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-60);
}
.best-perf-strip .bp-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.best-perf-card {
  flex: 0 0 240px;
  background: var(--paper-soft);
  border: 1px solid var(--ink-15);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  font-size: 12px;
  cursor: grab;
  transition: transform .12s, box-shadow .12s;
  position: relative;
}
.best-perf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 26, 26, .08);
}
.best-perf-card.dragging { opacity: .35; }
.best-perf-card .bp-card-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-40);
  margin-bottom: 6px;
}
.best-perf-card .bp-card-hook {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.best-perf-card .bp-card-metrics {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  padding: 4px 0;
  border-top: 1px dashed var(--ink-08);
  border-bottom: 1px dashed var(--ink-08);
}
.best-perf-card .bp-metric {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.best-perf-card .bp-metric strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
  margin-right: 2px;
}
.best-perf-card .bp-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.best-perf-card .bp-card-unpin {
  position: absolute;
  top: 4px;
  right: 4px;
  background: transparent;
  border: 0;
  color: var(--ink-40);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}
.best-perf-card .bp-card-unpin:hover { color: var(--bad); }
.best-perf-empty {
  text-align: center;
  padding: 20px;
  color: var(--ink-40);
  font-size: 12px;
  font-style: italic;
}

/* ─────────── Collapsed past weeks ─────────── */
.cal-week-block.is-past .cal-week-header {
  background: var(--paper-soft);
  color: var(--ink-60);
  cursor: pointer;
}
.cal-week-block.is-past .cal-week-header:hover { background: var(--paper); color: var(--ink); }
.cal-week-block.is-past .cal-week-header .cal-week-name { font-weight: 400; }
.cal-week-block.is-past.collapsed .cal-month-grid { display: none; }
.cal-week-block.is-past .cal-week-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-60);
  letter-spacing: 0.10em;
}
.cal-week-block.is-past.collapsed .cal-week-toggle::before { content: '▸ '; }
.cal-week-block.is-past:not(.collapsed) .cal-week-toggle::before { content: '▾ '; }
.cal-week-block.is-current .cal-week-header { background: var(--ink); }
.cal-week-block.is-future .cal-week-header { background: var(--ink-80); }
.cal-week-block.is-past .cal-week-header { color: var(--ink-60); }

.cal-chan-pill {
  display: inline-flex;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ─────────── Calendar — Matrix view ─────────── */

.cal-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cal-matrix thead th {
  background: var(--paper-soft);
  border-bottom: 1px solid var(--ink-15);
  padding: 10px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
  text-align: center;
}
.cal-matrix .cal-matrix-row-head {
  background: var(--paper-soft);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  padding: 12px;
  border-right: 1px solid var(--ink-15);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  vertical-align: middle;
}
.cal-matrix-cell {
  border: 1px solid var(--ink-08);
  vertical-align: top;
  padding: 6px;
  min-width: 110px;
  height: 80px;
  cursor: cell;
  transition: background .12s;
}
.cal-matrix-cell:hover { background: var(--paper-soft); }
.cal-matrix-pill {
  display: grid;
  grid-template-columns: 30px 18px 1fr;
  gap: 3px;
  align-items: center;
  padding: 3px 6px;
  font-size: 10px;
  margin-bottom: 3px;
  cursor: pointer;
}
.cal-matrix-pill:hover { transform: translateX(2px); }

/* ─────────── Calendar slot row ─────────── */

.slot-row {
  display: grid;
  grid-template-columns: 70px 90px 1fr 110px 130px;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ink-15);
  border-radius: 0;
  margin-bottom: 8px;
  align-items: center;
  background: var(--white);
  font-size: 13px;
}
.slot-row .slot-time {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.slot-row .slot-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
@media (max-width: 900px) {
  .slot-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ─────────── Library card ─────────── */

.lib-card {
  background: var(--paper-soft);
  border: 1px solid var(--ink-15);
  border-radius: 0;
  padding: 14px;
  margin-bottom: 8px;
  font-size: 13px;
}
.lib-card .lib-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.lib-card .lib-content { white-space: pre-wrap; line-height: 1.55; color: var(--ink); }
.lib-card .lib-actions { margin-top: 10px; display: flex; gap: 6px; }

/* ─────────── Posts table ─────────── */

.post-body-preview {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--ink-60);
  font-size: 12px;
}

/* ─────────── Notification bell ─────────── */

.notif-wrap { position: relative; }
#notifBell {
  background: transparent;
  border: 1px solid var(--ink-15);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  transition: border-color .12s;
}
#notifBell:hover { border-color: var(--ink); }
#notifBadge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 0;
  min-width: 18px;
  text-align: center;
  display: none;
  letter-spacing: 0.04em;
}
#notifList {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-height: 520px;
  overflow-y: auto;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--ink-15);
  border-radius: 0;
  box-shadow: 0 12px 40px rgba(26, 26, 26, .12);
  z-index: 50;
}
#notifList.open { display: block; }
