/* ============================================================
   Avenis CMS v2 — Global Stylesheet
   Design system per SRS Section 12
   Fonts: DM Sans + DM Mono (Google Fonts)
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Background & Surface */
  --bg:       #ffffff;
  --surface:  #f8f8fa;
  --surface2: #f0f0f5;
  --surface3: #e8e8f0;
  --surface4: #dcdce8;

  /* Borders */
  --border:   #e2e2ec;
  --border2:  #d0d0de;
  --border3:  #b8b8cc;

  /* Text */
  --text:     #111118;
  --text2:    #44445a;
  --text3:    #9898b0;

  /* Accent — slate-indigo */
  --accent:   #4F5D95;
  --accent2:  #3A4578;
  --accent3:  #E8EAFA;

  /* Semantic colours */
  --rose:     #C2335A;
  --teal:     #2A9D8F;
  --green:    #3A7D5A;
  --gold:     #8B7355;
  --orange:   #8B4A3A;

  /* Brand pill */
  --brand-pill-bg: #2C3E6B;

  /* Typography */
  --font:    'DM Sans', sans-serif;
  --display: 'DM Sans', sans-serif;
  --mono:    'DM Mono', monospace;

  /* Layout */
  --sidebar-w:         240px;
  --sidebar-collapsed: 52px;
  --topbar-h:          48px;

  /* Radii */
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Motion */
  --T: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; display: block; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--T);
  overflow: hidden;
  z-index: 20;
  position: relative;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* ── Sidebar top: logo + collapse button ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 12px 11px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.sidebar-logo-text {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--T);
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

/* ── Sidebar scroll area ── */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 2px; }

/* ── Section label ── */
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--T);
}
.sidebar.collapsed .sidebar-label { opacity: 0; }

/* ── Nav item ── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text2);
  transition: all var(--T);
  white-space: nowrap;
  overflow: hidden;
  min-height: 32px;
  position: relative;
}
.sidebar-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-item.active { background: var(--surface3); color: var(--accent2); }
.sidebar-item-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-item-text {
  font-size: 12.5px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--T);
  flex: 1;
}
.sidebar.collapsed .sidebar-item-text { opacity: 0; pointer-events: none; }
.sidebar-item-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  background: var(--rose);
  color: #fff;
  border-radius: 10px;
  padding: 1px 5px;
  flex-shrink: 0;
  transition: opacity var(--T);
}
.sidebar.collapsed .sidebar-item-badge { opacity: 0; }

/* ── Brand tree ── */
.brand-node { margin-bottom: 2px; }

.brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text2);
  transition: all var(--T);
  white-space: nowrap;
  overflow: hidden;
  min-height: 32px;
  user-select: none;
}
.brand-header:hover { background: var(--surface2); color: var(--text); }

.brand-pill {
  width: 24px; height: 24px;
  background: var(--brand-pill-bg);
  color: #fff;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}
.brand-name-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--T);
}
.sidebar.collapsed .brand-name-text { opacity: 0; pointer-events: none; }

.brand-chevron {
  font-size: 10px;
  color: var(--text3);
  flex-shrink: 0;
  transition: transform var(--T), opacity var(--T);
}
.sidebar.collapsed .brand-chevron { opacity: 0; }
.brand-node.open .brand-chevron { transform: rotate(90deg); }

.brand-channels {
  display: none;
  padding: 2px 0 4px 28px;
}
.brand-node.open .brand-channels { display: block; }
.sidebar.collapsed .brand-channels { display: none !important; }

.channel-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text3);
  font-size: 12px;
  transition: all var(--T);
  white-space: nowrap;
  overflow: hidden;
  min-height: 28px;
}
.channel-item:hover { background: var(--surface2); color: var(--text2); }
.channel-item.active { color: var(--accent2); background: var(--accent3); }
.channel-item-icon { font-size: 12px; flex-shrink: 0; width: 14px; text-align: center; }
.channel-item-name { overflow: hidden; text-overflow: ellipsis; transition: opacity var(--T); }
.sidebar.collapsed .channel-item-name { opacity: 0; }

/* ── Collapse button ── */
.collapse-btn {
  margin: 4px 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text3);
  font-size: 12px;
  transition: all var(--T);
  border: none;
  background: none;
  width: calc(100% - 12px);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.collapse-btn:hover { background: var(--surface2); color: var(--text2); }
.collapse-icon { font-size: 14px; flex-shrink: 0; }
.collapse-label { transition: opacity var(--T); }
.sidebar.collapsed .collapse-label { opacity: 0; }

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 299;
  backdrop-filter: blur(1px);
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--text2);
  font-size: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.hamburger-btn:hover { background: var(--surface2); }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text3);
  font-size: 12.5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.breadcrumb a { color: var(--text3); transition: color var(--T); }
.breadcrumb a:hover { color: var(--text2); }
.breadcrumb-sep { color: var(--border3); font-size: 11px; flex-shrink: 0; }
.breadcrumb-current { color: var(--text2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Topbar actions ── */
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Landscape phones / narrow desktops: the post page's topbar has many action
   buttons (Save, Save & Close, Close, Delete, …). With flex-shrink:0 the row
   overflowed the topbar and .main's overflow:hidden clipped the rightmost
   buttons. Let the row scroll instead. Scoped to ≥769px so the portrait layout
   (which hides non-primary buttons) is left exactly as it is. Wide desktops fit
   everything, so nothing scrolls there. */
@media (min-width: 769px) {
  .topbar-actions { flex-shrink: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions > * { flex-shrink: 0; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text2);
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--T);
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { border-color: var(--border3); color: var(--text); background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.danger:hover { background: #a82b4e; border-color: #a82b4e; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface2); border-color: var(--border); }
.btn.sm { padding: 3px 9px; font-size: 11.5px; }
.btn.icon { padding: 5px 7px; }

.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--T);
}
.btn-icon:hover { background: var(--surface2); color: var(--text2); border-color: var(--border); }
.btn-icon.active { background: var(--surface3); color: var(--accent2); border-color: var(--border2); }

/* Avatar */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.avatar.sm { width: 20px; height: 20px; font-size: 8px; }

/* ============================================================
   PAGE BODY
   ============================================================ */
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}
.page-body::-webkit-scrollbar { width: 5px; }
.page-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.page-subtitle { font-size: 13px; color: var(--text3); }

/* ── Section ── */
.section { margin-bottom: 32px; }
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.section-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ============================================================
   BRAND SECTION HEADER (dashboard)
   ============================================================ */
.brand-section { margin-bottom: 28px; }
.brand-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.brand-section-pill {
  background: var(--brand-pill-bg);
  color: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.brand-section-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.brand-section-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ============================================================
   FILTER TABS
   ============================================================ */
.filter-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid var(--border);
}
.filter-tab {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text3);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--T);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text2); }
.filter-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ── View toggle ── */
.view-toggle { display: flex; gap: 2px; }

/* ============================================================
   CHANNEL CARDS — Gallery view
   ============================================================ */
.channels-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--T);
}
.channel-card:hover {
  border-color: var(--border3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
}
.channel-card.inactive { opacity: 0.6; }

.card-icon-area {
  height: 80px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-body { padding: 11px 13px 13px; }
.card-channel-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}
.card-stats { display: flex; gap: 12px; }
.card-stat { display: flex; flex-direction: column; gap: 1px; }
.card-stat-label { font-size: 10px; color: var(--text3); }
.card-stat-value { font-size: 12px; font-weight: 500; color: var(--text2); font-family: var(--mono); }

/* ── Channel Table view ── */
.channels-table { overflow-x: auto; }

/* ── Channel Board view ── */
.channels-board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.channels-board-col { flex-shrink: 0; width: 200px; }
.channels-board-col-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  padding: 6px 8px;
  background: var(--surface2);
  border-radius: var(--radius);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}

/* ============================================================
   DATA TABLE (generic)
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}
.data-table tr { transition: background var(--T); }
.data-table tbody tr:hover td { background: var(--surface2); }
.data-table.clickable tbody tr { cursor: pointer; }

/* ============================================================
   BOARD / KANBAN
   ============================================================ */
.board-wrap { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col {
  flex-shrink: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}
.board-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.board-col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.board-col-name { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; }
.board-col-count { font-family: var(--mono); font-size: 10px; color: var(--text3); }

.board-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-col-body::-webkit-scrollbar { width: 3px; }
.board-col-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.board-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 11px;
  cursor: pointer;
  transition: all var(--T);
}
.board-card:hover { border-color: var(--border2); box-shadow: 0 2px 8px rgba(0,0,0,0.07); transform: translateY(-1px); }
.board-card-title { font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 8px; line-height: 1.45; }
.board-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drag-ghost { opacity: 0.4 !important; background: var(--accent3) !important; border: 2px dashed var(--accent) !important; }
.drag-chosen { box-shadow: 0 8px 24px rgba(79,93,149,0.25); transform: rotate(1deg); opacity: 0.95; }

/* Board add post */
.board-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--T);
  margin: 4px 8px 8px;
  border: 1px dashed transparent;
  flex-shrink: 0;
}
.board-add-btn:hover { color: var(--text2); background: var(--surface2); border-color: var(--border2); }

/* ============================================================
   STATUS / BADGE SYSTEM
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* Status badges — per SRS Section 12.3 */
.b-idea        { background: #F0EFF4; color: #5C5B72; } .b-idea::before        { background: #9E9CB8; }
.b-topublish   { background: #E5EBF8; color: #2D4A8A; } .b-topublish::before   { background: #4F70C4; }
.b-creating    { background: #E8EAF6; color: #3A3F7A; } .b-creating::before    { background: #5C63A8; }
.b-prepare     { background: #F0E8F2; color: #6B3578; } .b-prepare::before     { background: #A05AB0; }
.b-tocheck     { background: #F2EDE0; color: #6B5020; } .b-tocheck::before     { background: #B08040; }
.b-published   { background: #E2EFE8; color: #2A5C3F; } .b-published::before   { background: #3D8A5A; }
.b-cancelled   { background: #F0E8E8; color: #7A2E2E; } .b-cancelled::before   { background: #A84848; }
.b-active      { background: #E2EFE8; color: #2A5C3F; border: 1px solid #c5dece; } .b-active::before { background: #3D8A5A; }
.b-inactive    { background: #F0EFF4; color: #5C5B72; border: 1px solid #dddbe8; } .b-inactive::before { background: #9E9CB8; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface3);
  color: var(--text2);
  border: 1px solid var(--border);
}

/* ============================================================
   PLATFORM CHANNEL ICONS (inline SVG wrappers)
   ============================================================ */
.platform-icon { display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.platform-icon svg { display: block; }

/* ============================================================
   POST EDITOR
   ============================================================ */
.post-layout { display: flex; gap: 0; height: 100%; overflow: hidden; }

/* Left panel: fields */
.post-fields-panel {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.post-fields-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.post-fields-scroll::-webkit-scrollbar { width: 3px; }
.post-fields-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* Right panel: content */
.post-content-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.post-title-wrap { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.post-title-input {
  width: 100%;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  border: none;
  outline: none;
  background: none;
  line-height: 1.2;
  resize: none;
  min-height: 36px;
}
.post-title-input:empty::before {
  content: 'Untitled';
  color: var(--text3);
  pointer-events: none;
}

/* ── Field row ── */
.field-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}
.field-row:last-child { border-bottom: none; }
.field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  min-width: 110px;
  padding-top: 3px;
  flex-shrink: 0;
}
.field-value { flex: 1; min-width: 0; }
.field-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background var(--T);
}
.field-input:hover { background: var(--surface2); }
.field-input:focus { background: var(--surface2); outline: 2px solid var(--accent3); }

/* ── Rich text editor ── */
.editor-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--surface);
}
/* Formatting toolbar — enlarged ×1.25 (28→35px buttons, 12→15px glyphs) */
.toolbar-btn {
  width: 35px; height: 35px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 15px;
  font-family: var(--font);
  transition: all var(--T);
}
.toolbar-btn .ti { font-size: 17px; }
.toolbar-btn:hover { background: var(--surface2); color: var(--text); }
.toolbar-btn.active { background: var(--accent3); color: var(--accent2); }
.toolbar-sep { width: 1px; height: 23px; background: var(--border2); margin: 0 4px; flex-shrink: 0; }
.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}
.editor-body:empty::before {
  content: 'Write your content here…';
  color: var(--text3);
  pointer-events: none;
  display: block;
}
.editor-body h1, .editor-body h2, .editor-body h3 { font-family: var(--display); font-weight: 700; margin-bottom: 8px; margin-top: 16px; color: var(--text); }
.editor-body h1 { font-size: 22px; }
.editor-body h2 { font-size: 18px; }
.editor-body h3 { font-size: 15px; }
.editor-body p { margin-bottom: 10px; }
.editor-body ul, .editor-body ol { padding-left: 20px; margin-bottom: 10px; }
.editor-body blockquote { border-left: 3px solid var(--border3); padding-left: 12px; color: var(--text3); margin: 10px 0; }
.editor-body code { font-family: var(--mono); font-size: 12px; background: var(--surface2); padding: 1px 5px; border-radius: 3px; }
.editor-body pre { font-family: var(--mono); font-size: 12px; background: var(--surface2); padding: 12px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 10px; }
.editor-body a { color: var(--accent2); text-decoration: underline; }

/* ── Comments ── */
.comments-section { border-top: 1px solid var(--border); flex-shrink: 0; max-height: 280px; display: flex; flex-direction: column; }
.comments-header { padding: 10px 20px; font-size: 12px; font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.comments-list { flex: 1; overflow-y: auto; padding: 8px 20px; }
.comment-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.comment-author { font-size: 11px; font-weight: 600; color: var(--text2); }
.comment-time { font-size: 10px; color: var(--text3); font-family: var(--mono); }
.comment-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.comment-input-row { display: flex; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }
.comment-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  resize: none;
  min-height: 34px;
  max-height: 80px;
}
.comment-input:focus { outline: none; border-color: var(--accent); }

/* ── Post topbar actions ── */
.post-topbar-actions { display: flex; align-items: center; gap: 6px; }
.save-indicator {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: var(--radius);
  transition: all var(--T);
}
.save-indicator.unsaved { color: var(--gold); background: rgba(139,115,85,0.1); }
.save-indicator.saving { color: var(--accent2); }
.save-indicator.saved { color: var(--green); }

/* ── Read-only / locked banner ── */
.lock-banner {
  background: #FFF8E6;
  border-bottom: 1px solid #E8D5A0;
  padding: 8px 20px;
  font-size: 12.5px;
  color: #6B5020;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Forward trail ── */
.forward-trail { padding: 12px 20px; border-top: 1px solid var(--border); }
.forward-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}
.forward-step:last-child { border-bottom: none; }

/* ── Media attachments ── */
.media-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.media-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  object-fit: cover;
  cursor: pointer;
  transition: all var(--T);
}
.media-thumb:hover { border-color: var(--border3); transform: scale(1.04); }

/* ── Duplicate warning ── */
.dup-warning {
  font-size: 11.5px;
  color: var(--gold);
  background: rgba(139,115,85,0.08);
  border: 1px solid rgba(139,115,85,0.2);
  border-radius: var(--radius);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.dup-warning a { color: var(--accent2); text-decoration: underline; }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cal-quick-btns { display: flex; gap: 4px; }
.cal-quick-btn {
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text2);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--T);
}
.cal-quick-btn:hover { border-color: var(--border3); background: var(--surface2); }
.cal-quick-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.cal-date-input {
  padding: 5px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
}
.cal-date-input:focus { outline: none; border-color: var(--accent); }

.cal-table-wrap { overflow-x: auto; }
.cal-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.cal-table th {
  text-align: left;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}
.cal-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: middle; }
.cal-table tr { transition: background var(--T); cursor: pointer; }
.cal-table tbody tr:hover td { background: var(--surface2); }

.cal-date-group {
  background: var(--surface);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}
.cal-time { font-family: var(--mono); font-size: 11px; color: var(--text2); }
.cal-uk-time { font-family: var(--mono); font-size: 10px; color: var(--text3); }
.cal-overnight { color: var(--orange); font-size: 9px; }

/* 3-day view */
.cal-3day { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.cal-day-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
.cal-day-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cal-day-header.today { color: var(--accent2); background: var(--accent3); }
.cal-day-body { padding: 8px; overflow-y: auto; max-height: 500px; }
.cal-post-pill {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--T);
  font-size: 12px;
}
.cal-post-pill:hover { border-color: var(--border3); background: var(--surface2); }
.cal-post-title { font-weight: 500; color: var(--text); margin-bottom: 4px; }
.cal-post-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   INBOX
   ============================================================ */
.inbox-tabs { display: flex; gap: 3px; margin-bottom: 16px; }
.inbox-tab {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  color: var(--text3);
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--T);
}
.inbox-tab:hover { color: var(--text2); background: var(--surface2); }
.inbox-tab.active { background: var(--surface); border-color: var(--border2); color: var(--text); }

.inbox-list { display: flex; flex-direction: column; gap: 4px; }
.inbox-item {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--T);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
}
.inbox-item:hover { border-color: var(--border3); background: var(--surface2); }
.inbox-item.unread { background: var(--surface); border-color: var(--border2); }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); flex-shrink: 0; margin-top: 5px; }
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-msg { font-size: 12.5px; color: var(--text2); line-height: 1.5; margin-bottom: 4px; }
.inbox-item-time { font-size: 10px; color: var(--text3); font-family: var(--mono); }
.inbox-resolve-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--T);
  flex-shrink: 0;
}
.inbox-resolve-btn:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.admin-tab {
  padding: 8px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text3);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--T);
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text2); }
.admin-tab.active { color: var(--accent2); border-bottom-color: var(--accent2); font-weight: 600; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.admin-card-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }

/* ============================================================
   NEWS FEEDER (RSS)
   ============================================================ */
.rss-layout { display: flex; gap: 0; height: 100%; overflow: hidden; }
.rss-sidebar { width: 260px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.rss-sidebar-header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text2); flex-shrink: 0; }
.rss-feed-list { flex: 1; overflow-y: auto; padding: 6px; }
.rss-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--T);
  margin-bottom: 2px;
}
.rss-feed-item:hover { background: var(--surface2); }
.rss-feed-item.active { background: var(--accent3); color: var(--accent2); }
.rss-feed-initials {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.rss-feed-name { font-size: 12.5px; font-weight: 500; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rss-feed-meta { font-size: 10px; color: var(--text3); font-family: var(--mono); }
.rss-count-badge { font-family: var(--mono); font-size: 10px; color: var(--text3); background: var(--surface3); padding: 1px 6px; border-radius: 10px; flex-shrink: 0; }

.rss-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.rss-main-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.rss-articles { flex: 1; overflow-y: auto; }
.rss-articles::-webkit-scrollbar { width: 5px; }
.rss-articles::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.rss-article-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--T);
}
.rss-article-row:hover { background: var(--surface2); }
.rss-row-num { font-family: var(--mono); font-size: 11px; color: var(--text3); width: 24px; flex-shrink: 0; padding-top: 2px; text-align: right; }
.rss-article-body { flex: 1; min-width: 0; }
.rss-article-title { font-size: 13px; font-weight: 600; color: var(--accent2); margin-bottom: 4px; }
.rss-article-title:hover { text-decoration: underline; }
.rss-article-desc { font-size: 12px; color: var(--text3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rss-article-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rss-article-source { font-size: 11px; color: var(--accent2); font-weight: 500; }
.rss-article-date { font-size: 10px; color: var(--text3); font-family: var(--mono); }
.rss-create-btn { flex-shrink: 0; }
.rss-feed-tag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text3);
}

/* ============================================================
   BIN
   ============================================================ */
.bin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 6px;
  background: var(--bg);
  transition: all var(--T);
}
.bin-item:hover { border-color: var(--border3); background: var(--surface2); }
.bin-item-info { flex: 1; min-width: 0; }
.bin-item-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bin-item-meta { font-size: 11px; color: var(--text3); display: flex; gap: 10px; flex-wrap: wrap; }
.bin-expiry { font-family: var(--mono); font-size: 10px; color: var(--orange); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(80, 80, 120, 0.25);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  animation: modalIn 0.18s ease;
}
.modal.lg { max-width: 600px; }
.modal.xl { max-width: 720px; }
@keyframes modalIn { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-title { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Form ── */
.form-field { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 11px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color var(--T);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 11.5px; color: var(--rose); margin-top: 4px; }
.form-hint { font-size: 11.5px; color: var(--text3); margin-top: 4px; }

/* ── Color swatches ── */
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; transition: transform var(--T); border: 2px solid transparent; }
.swatch:hover { transform: scale(1.2); }
.swatch.selected { border-color: var(--text); transform: scale(1.15); }

/* ============================================================
   TOAST
   ============================================================ */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 6px; z-index: 500; pointer-events: none; }
.toast {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  min-width: 200px;
  max-width: 340px;
  animation: toastIn 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.info    { border-left: 3px solid var(--accent2); }
.toast.danger  { border-left: 3px solid var(--rose); }
.toast.warning { border-left: 3px solid var(--gold); }
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   LOADING / EMPTY STATES
   ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text3);
  font-size: 13px;
  padding: 20px;
  justify-content: center;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 10px;
  color: var(--text3);
}
.empty-icon { font-size: 32px; opacity: 0.4; }
.empty h3 { font-size: 14px; font-weight: 600; color: var(--text2); }
.empty p { font-size: 13px; text-align: center; }

/* ============================================================
   LOGIN / LANDING PAGE
   Note: illustration classes are prefixed "li-" because plain names
   like .sidebar/.avatar/.row/.status are already real app classes
   elsewhere in this shared stylesheet.
   ============================================================ */
body.login-page {
  min-height: 100vh;
  background: var(--bg);
  overflow: auto;
  height: auto;
}
.login-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
}

/* ── Left: intro / marketing panel ── */
.login-intro {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px) clamp(32px, 5vw, 88px) 28px;
  background:
    radial-gradient(circle at 55% 68%, rgba(79, 93, 149, 0.10), transparent 36%),
    var(--surface);
}
.login-intro-copy { margin-top: clamp(28px, 4vh, 48px); max-width: 640px; }
.login-intro-copy h1 {
  font-family: var(--display);
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  font-weight: 700;
}
.login-intro-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--text3);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.6;
}

.li-art { position: relative; flex: 1; min-height: 340px; width: min(100%, 700px); margin-top: 24px; }
.li-art::before {
  content: "";
  position: absolute;
  left: 7%; right: 3%; bottom: 2%; height: 83%;
  border-radius: 48% 52% 44% 56%;
  background: var(--accent3);
  opacity: 0.6;
}

.li-monitor { position: absolute; left: 25%; bottom: 8%; width: 54%; z-index: 3; }
.li-screen {
  height: 230px;
  overflow: hidden;
  border: 10px solid var(--accent2);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 20px 35px rgba(17,17,24,0.12);
}
.li-screen-top {
  display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  color: #fff; background: var(--accent);
  font-size: 9px;
}
.li-screen-top b:first-child {
  display: grid; place-items: center;
  width: 16px; height: 16px; border-radius: 4px;
  color: var(--accent); background: #fff;
}
.li-screen-top i { margin-left: auto; opacity: 0.55; font-style: normal; letter-spacing: 2px; }
.li-screen-body { display: grid; grid-template-columns: 56px 1fr; height: calc(100% - 32px); }
.li-side { display: grid; place-content: start center; gap: 12px; padding-top: 16px; background: var(--accent2); }
.li-side i { width: 26px; height: 6px; border-radius: 5px; background: rgba(255,255,255,0.3); }
.li-dash { padding: 12px 14px; font-size: 9px; color: var(--text2); }
.li-summary { display: grid; grid-template-columns: 1fr 60px; gap: 8px; margin: 9px 0; }
.li-chart, .li-count { height: 56px; border-radius: 6px; background: var(--surface); }
.li-chart { display: grid; place-items: center; overflow: hidden; color: var(--accent); font-size: 46px; }
.li-count { display: grid; place-content: center; text-align: center; }
.li-count b { font-size: 20px; color: var(--text); }
.li-count small { color: var(--text3); font-size: 7px; }
.li-row { display: flex; justify-content: space-between; align-items: center; height: 24px; border-top: 1px solid var(--border); }
.li-status { padding: 3px 6px; border-radius: 8px; color: var(--green); background: rgba(58,125,90,0.12); font-size: 7px; }
.li-status.blue { color: var(--accent2); background: var(--accent3); }
.li-status.grey { color: var(--text3); background: var(--surface2); }
.li-stand { width: 50px; height: 22px; margin: auto; background: var(--accent2); }
.li-base { width: 140px; height: 10px; margin: auto; border-radius: 8px 8px 3px 3px; background: var(--accent2); }

.li-float-card, .li-approved, .li-calendar, .li-spark, .li-avatar, .li-comment {
  position: absolute;
  z-index: 4;
  background: var(--bg);
  box-shadow: 0 12px 25px rgba(17,17,24,0.10);
}
.li-float-card { width: 150px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; }
.li-float-card strong { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text); }
.li-blog { left: 0; top: 18%; }
.li-social { right: 0; top: 14%; width: 160px; }
.li-media { right: 1%; bottom: 1%; }
.li-mini-content { display: flex; gap: 9px; margin-top: 11px; }
.li-thumb { width: 44px; height: 38px; border-radius: 5px; background: var(--accent3); }
.li-lines { display: grid; flex: 1; align-content: center; gap: 6px; }
.li-lines i { height: 6px; border-radius: 5px; background: var(--surface3); }
.li-lines i:nth-child(2) { width: 78%; }
.li-lines i:nth-child(3) { width: 55%; }
.li-tick {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-left: auto;
  border-radius: 50%; color: #fff; background: var(--teal);
}
.li-spark {
  display: grid; place-items: center;
  left: 49%; top: 7%; width: 64px; height: 64px;
  border: 2px solid var(--accent3); border-radius: 50%;
  color: var(--accent); font-size: 28px;
}
.li-avatar {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border: 4px solid var(--bg); border-radius: 50%;
  color: #fff; font-weight: 800;
}
.li-person-one { left: 5%; bottom: 25%; background: var(--accent2); }
.li-person-two { right: 3%; top: 49%; background: var(--accent); }
.li-comment { left: 1%; bottom: 49%; padding: 8px 12px; border-radius: 10px; color: #fff; background: var(--gold); letter-spacing: 3px; }
.li-approved { display: flex; align-items: center; gap: 8px; right: 0; bottom: 23%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 10.5px; font-weight: 700; color: var(--text); }
.li-approved .li-tick { margin: 0; }
.li-calendar { left: 7%; bottom: 0; width: 132px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; }
.li-calendar-head { height: 21px; background: var(--accent); }
.li-calendar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 9px; }
.li-calendar-grid i { height: 15px; border-radius: 3px; background: var(--surface2); }
.li-calendar-grid i:nth-child(15) { background: var(--accent); }

/* ── Right: sign-in panel ── */
.login-side {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px clamp(28px, 5vw, 72px);
  background: var(--bg);
  border-left: 1px solid var(--border);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  justify-content: center;
}
.login-logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.login-logo-text { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--text); }
.login-title { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--text3); margin-bottom: 24px; }
.login-error { background: rgba(194,51,90,0.08); border: 1px solid rgba(194,51,90,0.2); border-radius: var(--radius); padding: 8px 12px; font-size: 12.5px; color: var(--rose); margin-bottom: 16px; }
.login-link { display: block; text-align: center; font-size: 12.5px; color: var(--accent2); margin-top: 16px; }
.login-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .login-page-grid { display: block; }
  .login-intro { min-height: auto; padding: 36px 24px 16px; }
  .li-art { height: 380px; width: min(100%, 640px); }
  .login-side { min-height: auto; padding: 40px 24px 56px; border-top: 1px solid var(--border); border-left: 0; }
}
@media (max-width: 620px) {
  .login-intro { padding: 26px 18px 8px; }
  .login-intro .login-logo-mark { width: 44px; height: 44px; font-size: 20px; }
  .login-intro .login-logo-text { font-size: 22px; }
  .login-intro-copy h1 { font-size: 30px; }
  .li-art { height: 300px; overflow: hidden; }
  .li-monitor { left: 15%; width: 71%; transform: scale(0.82); transform-origin: bottom; }
  .li-float-card { transform: scale(0.72); }
  .li-blog { left: -14px; transform-origin: left; }
  .li-social { transform-origin: right; }
  .li-avatar, .li-approved, .li-calendar { transform: scale(0.72); }
  .li-person-one, .li-comment { display: none; }
}

/* ============================================================
   MOBILE — Bottom nav
   ============================================================ */
.bottom-nav { display: none; }
.hamburger-btn { display: none; }

/* ============================================================
   RESPONSIVE — 768px (tablet/mobile)
   ============================================================ */
@media (max-width: 768px) {
  * { -webkit-tap-highlight-color: transparent; }
  input, select, textarea { font-size: 16px !important; }

  html, body { overflow-x: hidden; overflow-y: auto; height: auto; }
  body { overflow: auto; }

  /* Reset the desktop `.app { height:100vh; overflow:hidden }` (line ~81) on
     mobile. Without this the app is clamped to one screen and clips everything
     below the fold — in portrait the post's Content editor and Comments became
     unreachable (only landscape, which crosses 768px into the desktop layout,
     showed them). height:auto + page scroll makes the whole post reachable. */
  .app { display: block; min-height: 100vh; height: auto; overflow: visible; }

  /* Sidebar — off-screen */
  .sidebar {
    position: fixed !important;
    top: 0 !important; left: 0 !important; bottom: 0 !important;
    width: 280px !important;
    z-index: 1000 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1) !important;
    overflow-y: auto !important;
    box-shadow: none !important;
  }
  .sidebar.mobile-open { transform: translateX(0) !important; box-shadow: 8px 0 32px rgba(0,0,0,0.2) !important; }
  .sidebar.collapsed { transform: translateX(-100%) !important; width: 280px !important; }
  .sidebar.collapsed.mobile-open { transform: translateX(0) !important; }
  .sidebar.collapsed .sidebar-item-text,
  .sidebar.collapsed .brand-name-text,
  .sidebar.collapsed .sidebar-label,
  .sidebar.collapsed .collapse-label,
  .sidebar.collapsed .sidebar-logo-text { opacity: 1 !important; pointer-events: auto !important; }
  .sidebar.collapsed .brand-channels { display: none !important; }
  .brand-node.open .brand-channels { display: block !important; }
  .collapse-btn { display: none !important; }

  .sidebar-overlay { display: none; }
  .sidebar-overlay.active { display: block !important; }

  .hamburger-btn { display: flex !important; }

  /* overflow:visible !important neutralises post.php's inline overflow-y:auto on
     .main so it doesn't become a clamped 100vh scroll container on mobile — the
     page (body) scrolls instead. Horizontal stays contained via html/body
     overflow-x:hidden above. */
  .main { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 60px; overflow: visible !important; }

  .topbar { position: static; flex-wrap: nowrap; padding: 10px 12px; }
  .topbar-actions .btn:not(.primary) { display: none !important; }

  .page-body, .content-area { padding: 14px; overflow-y: visible; height: auto; flex: 1; }

  /* Bottom nav */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 200;
    align-items: stretch;
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text3);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 4px;
    text-decoration: none;
    position: relative;
    transition: color 0.15s;
  }
  .bottom-nav-item:hover, .bottom-nav-item.active { color: var(--accent); }
  .bottom-nav-icon { font-size: 18px; line-height: 1; }
  .bottom-nav-badge {
    position: absolute; top: 5px; left: calc(50% + 6px);
    min-width: 15px; height: 15px;
    border-radius: 8px;
    background: var(--rose); color: #fff;
    font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
  }

  /* Toast */
  .toast-wrap { left: 12px; right: 12px; bottom: 66px; }

  /* Channels gallery */
  .channels-gallery { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* Board: stack */
  .board-wrap { flex-direction: column !important; overflow-x: visible !important; }
  .board-col { width: 100% !important; max-height: none !important; }

  /* Post editor: stack */
  .post-layout { flex-direction: column !important; }
  .post-fields-panel { width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--border) !important; max-height: 40vh; }
  .post-content-panel { min-height: 50vh; }

  /* RSS: stack */
  .rss-layout { flex-direction: column !important; }
  .rss-sidebar { width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--border) !important; max-height: 200px; }

  /* Cal 3day */
  .cal-3day { grid-template-columns: 1fr !important; }

  /* Modal */
  .modal { margin: 16px; max-width: calc(100vw - 32px) !important; }

  /* Admin */
  .admin-mobile-msg { display: flex !important; }
  .admin-content { display: none !important; }

  /* Filter tabs */
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap !important; }
  .filter-tab { flex-shrink: 0; }

  /* Anything explicitly not wanted on phones (e.g. calendar Export CSV) */
  .hide-on-mobile { display: none !important; }

  /* Brand tiles: single scrollable row on phones */
  .cal-brand-tiles { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    max-width: 100%; padding-bottom: 2px; }
  .cal-brand-tile { flex-shrink: 0; }

  /* Calendar — floating New Post button, thumb-reachable above the bottom nav */
  .cal-fab-newpost {
    display: flex !important;
    position: fixed;
    right: 16px; bottom: 72px;
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    cursor: pointer;
    z-index: 195;
  }
  .cal-fab-newpost:active { transform: scale(0.94); }
}

/* ============================================================
   RESPONSIVE — 480px (phone)
   ============================================================ */
@media (max-width: 480px) {
  .channels-gallery { grid-template-columns: 1fr !important; }
  .breadcrumb { max-width: calc(100vw - 140px); }
  .post-title-input { font-size: 20px !important; }
  .cal-3day { grid-template-columns: 1fr !important; }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden { display: none !important; }
.cal-fab-newpost { display: none; } /* mobile-only — shown in the 768px media query */

/* Content Calendar — brand quick-filter tiles (replaces the brand dropdown) */
.cal-brand-tiles { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-brand-tile {
  padding: 7px 14px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: all var(--T);
}
.cal-brand-tile:hover { border-color: var(--accent); color: var(--text); }
.cal-brand-tile.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cal-brand-tile.more-toggle {
  border-style: dashed;
  color: var(--text3);
  font-weight: 500;
}
.cal-brand-tile.more-toggle:hover { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--mono); }
.text-sm { font-size: 11.5px; }
.text-xs { font-size: 10px; }
.text-muted { color: var(--text3); }
.text-danger { color: var(--rose); }
.text-success { color: var(--green); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 6px; }
.gap-3 { gap: 10px; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================================================
   POST CARD — Single column centred layout (v2 redesign)
   ============================================================ */
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: visible;
}

.post-card-title-wrap {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.post-title-input {
  width: 100%;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  border: none;
  outline: none;
  background: none;
  line-height: 1.2;
  min-height: 40px;
  cursor: text;
}
.post-title-input.empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
  pointer-events: none;
}
.post-title-input:focus { outline: none; }

/* ── Fields list ── */
.post-fields-list { padding: 0 32px; }

.pf-row {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.pf-row:last-child { border-bottom: none; }

.pf-label {
  width: 180px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
}
.pf-label .ti { font-size: 13px; color: var(--text3); }

.pf-value {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  display: flex;
  align-items: center;
}

.pf-readonly {
  font-size: 13px;
  color: var(--text2);
}

.pf-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background var(--T);
}
.pf-input:hover { background: var(--surface2); }
.pf-input:focus { background: var(--surface2); outline: 2px solid var(--accent3); }
.pf-input::placeholder { color: var(--text3); }

/* ── See more toggle ── */
.pf-seemore {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: color var(--T);
}
.pf-seemore:hover { color: var(--text2); }

/* ── Status pill ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--T);
  font-family: var(--font);
}
.status-pill:hover { border-color: var(--border3); background: var(--surface3); }
.status-pill:disabled { opacity: 0.6; cursor: default; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.person-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Field popover ── */
.field-popover {
  position: fixed;
  z-index: 9999;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 220px;
  max-width: 300px;
  padding: 4px;
  /* A long list has to scroll INSIDE the popover. Because this is
     position:fixed, scrolling the page does not move it, so anything that
     overflowed the viewport was simply unreachable — which is what happened
     once Category grew past a dozen entries. toggleFieldPopover() overrides
     max-height per open with the space actually available. */
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: modalIn 0.15s ease;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: background var(--T);
}
.popover-item:hover { background: var(--surface2); }
.popover-item.selected { background: var(--accent3); color: var(--accent2); }

.popover-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.popover-manage {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text3);
  cursor: pointer;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: all var(--T);
}
.popover-manage:hover { color: var(--text2); background: var(--surface2); }

/* ── Post sections ── */
.post-section-divider {
  height: 1px;
  background: var(--border);
  margin: 0 32px;
}

.post-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.post-comments-section { padding: 20px 32px; }
.post-content-section  { padding: 20px 32px 28px; }

/* Editor placeholder */
.editor-body.empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
  pointer-events: none;
  display: block;
}

/* Status manager item */
.status-manager-item:hover { background: var(--surface2) !important; }

/* ── Media thumb in fields ── */
.media-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  object-fit: cover;
  cursor: pointer;
  transition: all var(--T);
}
.media-thumb:hover { border-color: var(--border3); transform: scale(1.05); }

/* ── Auto-schedule admin + Calendar review ─────────────── */
.as-admin-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.as-admin-card { min-width:0; }
.as-channel-card { grid-column:1 / -1; }
.as-full { grid-column:1 / -1; }
/* The two reference lists are the tallest things on the tab. Cap them and let
   them scroll internally, so Brand Controls and Channel Timetable — the parts
   actually operated week to week — stay reachable without a long scroll. */
#as-category-list, #as-keyword-list { max-height:460px; overflow-y:auto; overscroll-behavior:contain; }
/* Keyword KB: grouped chips rather than one full-width row per term. */
.as-kw-groups { display:flex; flex-direction:column; gap:12px; }
.as-kw-cat { display:flex; align-items:center; gap:7px; font-size:11px; font-weight:600;
             text-transform:uppercase; letter-spacing:.04em; color:var(--text3); margin-bottom:6px; }
.as-kw-count { background:var(--surface2); border-radius:9px; padding:1px 6px; font-size:10px; font-weight:600; }
.as-kw-chips { display:flex; flex-wrap:wrap; gap:5px; }
.as-kw-chip { display:inline-flex; align-items:stretch; border:1px solid var(--border2);
              border-radius:6px; overflow:hidden; background:var(--surface); }
.as-kw-chip .as-kw-term { border:0; background:transparent; cursor:pointer; font:inherit;
              font-size:11.5px; color:var(--text); padding:3px 6px; display:inline-flex; align-items:center; gap:5px; }
.as-kw-chip .as-kw-term:hover { background:var(--surface2); }
.as-kw-chip .as-kw-term b { font-size:9.5px; font-weight:700; color:var(--text3);
              background:var(--surface2); border-radius:7px; padding:0 4px; }
.as-kw-chip .as-kw-x { border:0; border-left:1px solid var(--border2); background:transparent;
              cursor:pointer; color:var(--text3); font-size:13px; line-height:1; padding:0 6px; }
.as-kw-chip .as-kw-x:hover { background:var(--danger-bg, #fbe3e3); color:var(--danger, #b33a3a); }
.as-kw-chip.is-inactive { opacity:.5; }
.as-kw-chip.is-inherited { border-style:dashed; }
/* type=time needs room for HH:MM plus the native picker glyph, or it clips. */
.as-time-field { width:150px; min-width:150px; }
.as-help { margin:3px 0 0; color:var(--text3); font-size:11.5px; font-weight:400; }
.as-toolbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; margin:0 0 14px; }
.as-toolbar > label { display:flex; flex-direction:column; gap:5px; font-size:11px; color:var(--text3); }
.as-toolbar .form-select { min-width:210px; }
.as-list { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.as-list-row { display:flex; align-items:center; gap:9px; padding:9px 10px; border-bottom:1px solid var(--border); }
.as-list-row:last-child { border-bottom:0; }
.as-list-row.is-inactive { opacity:.58; }
.as-list-main { min-width:0; flex:1; display:flex; flex-direction:column; gap:2px; }
.as-list-main strong { font-size:12.5px; }
.as-list-main small { color:var(--text3); font-size:10.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.as-color { width:10px; height:10px; display:inline-block; flex:0 0 10px; border-radius:50%; margin-right:5px; }
.as-setting-row { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin:10px 0 14px; }
.as-setting-row label { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text2); }
.as-setting-row .form-input { width:82px; }
.as-channel-settings { padding:12px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); }
.as-channel-settings label:first-child .form-select { min-width:175px; }
.as-gate { display:flex; flex-wrap:wrap; gap:7px; margin:8px 0; }
.as-gate.good,.as-gate.bad,.as-gate.warn { display:inline-flex; padding:6px 9px; border-radius:6px; font-size:11px; font-weight:600; }
.as-gate.good { background:#e7f7ee; color:#1a7f4b; }
.as-gate.bad { background:#fdeaea; color:#b03434; }
.as-gate.warn { background:#fff4df; color:#9a6412; }
.as-slot-grid { display:grid; gap:7px; }
.as-slot-row { display:grid; grid-template-columns:70px minmax(130px,1fr) minmax(180px,2fr) auto auto; align-items:center; gap:10px; padding:9px 10px; border:1px solid var(--border); border-radius:var(--radius); }
.as-slot-row small { color:var(--text3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.as-fallback-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.as-fallback-item { display:grid; grid-template-columns:auto 1fr 72px; align-items:center; gap:6px; font-size:12px; }
.as-fallback-item .form-input { padding:5px 7px; }
.as-review { padding:15px; margin-bottom:16px; background:var(--surface); border:1px solid var(--border2); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.as-summary { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 12px; }
.as-summary span { padding:5px 8px; border-radius:6px; background:var(--surface2); color:var(--text2); font-size:11px; }
.as-proposal-table .form-select { min-width:245px; max-width:360px; }
.as-proposal-table td small { display:block; max-width:340px; margin-top:3px; color:var(--text3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.as-time-input { width:92px; min-width:92px; padding:6px; }
.as-gap-row { opacity:.7; background:var(--surface2); }
.as-reason-preferred { color:#1a7f4b; }
.as-reason-fallback { color:#2c6fa8; }
.as-reason-relaxed { color:#b8570a; }
.as-reason-overflow { color:#7c4db3; }
.as-review-actions { justify-content:flex-end; align-items:center; gap:12px; margin-top:12px; }
@media (max-width:900px) {
  .as-admin-grid { grid-template-columns:1fr; }
  .as-channel-card { grid-column:auto; }
  .as-slot-row { grid-template-columns:62px 1fr auto auto; }
  .as-slot-row small { grid-column:1 / -1; }
  .as-fallback-list { grid-template-columns:1fr; }
}
