@charset "UTF-8";

/* ╔════════ 0 · SHARED CANVAS — centered 1240px, panels breathe ════════╗ */
html body #tabCalendar.tab-panel,
html body #tabQueue.tab-panel,
html body #tabBesttime.tab-panel { max-width: 1240px; margin-inline: auto; }
html body #tabQueue > div,
html body #tabBesttime > div { padding: 4px 0 24px !important; }

/* Entrance — quiet rise, staggered (DS reduced-motion block kills it) */
@keyframes k1xmaRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html body #tabCalendar.active > *,
html body #tabQueue.active > div > *,
html body #tabBesttime.active > div > * { animation: k1xmaRise .45s var(--k1xv2-ease) both; }
html body #tabCalendar.active > :nth-child(2), html body #tabQueue.active > div > :nth-child(2), html body #tabBesttime.active > div > :nth-child(2) { animation-delay: 60ms; }
html body #tabCalendar.active > :nth-child(3), html body #tabQueue.active > div > :nth-child(3), html body #tabBesttime.active > div > :nth-child(3) { animation-delay: 110ms; }
html body #tabCalendar.active > :nth-child(4), html body #tabQueue.active > div > :nth-child(4), html body #tabBesttime.active > div > :nth-child(4) { animation-delay: 150ms; }
html body #tabCalendar.active > :nth-child(n+5), html body #tabQueue.active > div > :nth-child(n+5), html body #tabBesttime.active > div > :nth-child(n+5) { animation-delay: 190ms; }

/* ╔════════ 1 · HERO HEADERS — eyebrow · display title · quiet sub ════════╗ */
html body #tabCalendar > div:first-child,
html body #tabQueue > div > div:first-child,
html body #tabBesttime > div > div:first-child { margin-bottom: 24px !important; align-items: flex-end !important; }

/* Title blocks — annotated by the enhancer JS below (.k1xma-title/.k1xma-sub)
   because the old k1x layer injects a .k1xm-kicker + gradient span into these
   headers; positional selectors would hit the wrong node. */
html body #tabCalendar > div:first-child .k1xm-kicker,
html body #tabQueue > div > div:first-child .k1xm-kicker,
html body #tabBesttime > div > div:first-child .k1xm-kicker { display: none !important; }
html body #tabCalendar .k1xma-title,
html body #tabQueue .k1xma-title,
html body #tabBesttime .k1xma-title {
  font-family: var(--k1xv2-font-display) !important;
  font-size: clamp(24px, 2.6vw, 30px) !important;
  font-weight: 700 !important; letter-spacing: -0.02em !important;
  line-height: 1.15 !important; color: var(--k1xv2-text) !important;
  text-shadow: 0 0 34px rgba(226,184,87,0.14);
}
/* Neutralize the old gold-gradient title span → solid confident display type */
html body .k1xma-title .k1xm-title-text {
  background: none !important; -webkit-background-clip: initial !important; background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important; color: inherit !important;
  filter: none !important; font: inherit !important;
}
html body #tabCalendar .k1xma-title::before,
html body #tabQueue .k1xma-title::before,
html body #tabBesttime .k1xma-title::before {
  display: block; font-family: var(--k1xv2-font-main);
  font-size: var(--k1xv2-fs-over); font-weight: 800; letter-spacing: 3px;
  text-transform: uppercase; color: var(--k1xv2-gold-2); opacity: .8;
  margin-bottom: 8px; text-shadow: none;
}
html body #tabCalendar .k1xma-title::before { content: 'AUTOCLIPPER · PUBLISH · CALENDAR'; }
html body #tabQueue .k1xma-title::before { content: 'AUTOCLIPPER · PUBLISH · QUEUE'; }
html body #tabBesttime .k1xma-title::before { content: 'AUTOCLIPPER · PUBLISH · BEST TIME'; }
html body #tabCalendar .k1xma-sub,
html body #tabQueue .k1xma-sub,
html body #tabBesttime .k1xma-sub {
  font-size: 13px !important; color: var(--k1xv2-text-2) !important; margin-top: 7px !important; line-height: 1.5;
}

/* ╔════════ 2 · CALENDAR — toolbar, month nav, jewel day grid ════════╗ */
/* View-mode toggle rail (glass rail + gold active pill) */
html body #tabCalendar > div:first-child > div:last-child { gap: 8px !important; }
html body #tabCalendar > div:first-child > div:last-child > div:first-child {
  border: 1px solid var(--k1xv2-line) !important; border-radius: 12px !important;
  background: var(--k1xv2-glass); padding: 3px; display: flex; gap: 2px;
  box-shadow: var(--k1xv2-edge); overflow: hidden;
}
html body #tabCalendar .p12-view-btn {
  padding: 7px 15px; border-radius: 9px; font-size: 11px; font-weight: 700;
  letter-spacing: .4px; color: var(--k1xv2-text-3); background: transparent;
  transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar .p12-view-btn:hover:not(.active) { color: var(--k1xv2-text); background: var(--k1xv2-glass-hi); }
html body #tabCalendar .p12-view-btn.active {
  background: linear-gradient(180deg, var(--k1xv2-s3), var(--k1xv2-s2));
  color: var(--k1xv2-gold-2);
  box-shadow: inset 0 0 0 1px var(--k1xv2-gold-line), var(--k1xv2-edge-hi), 0 2px 8px rgba(0,0,0,0.4);
}
/* Heat toggle + campaign filter → premium glass controls */
html body #tabCalendar #p12HeatBtn {
  padding: 9px 14px !important; border-radius: 12px !important;
  background: var(--k1xv2-glass) !important; border: 1px solid var(--k1xv2-line) !important;
  color: var(--k1xv2-text-2) !important; font-size: 11px !important; font-weight: 700 !important;
  box-shadow: var(--k1xv2-edge); transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar #p12HeatBtn:hover { border-color: var(--k1xv2-line-strong) !important; color: var(--k1xv2-text) !important; transform: translateY(-1px); }
html body #tabCalendar #p12CampaignFilter {
  padding: 9px 14px !important; border-radius: 12px !important;
  background: linear-gradient(180deg, var(--k1xv2-s1), var(--k1xv2-s0)) !important;
  border: 1px solid var(--k1xv2-line-strong) !important;
  color: var(--k1xv2-text-2) !important; font-size: 11px !important; font-weight: 700 !important;
  box-shadow: var(--k1xv2-edge); outline: none;
}
html body #tabCalendar #p12CampaignFilter:focus { border-color: var(--k1xv2-gold-line-hi) !important; box-shadow: var(--k1xv2-ring), var(--k1xv2-edge); }
/* Auto Plan = THE one gold primary on this view */
html body #tabCalendar .apw-btn {
  border: none; border-radius: 12px; padding: 10px 18px;
  background: var(--k1xv2-gold-grad); color: var(--k1xv2-gold-ink);
  font-size: 12px; font-weight: 800;
  box-shadow: var(--k1xv2-glow-md), 0 2px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -2px 6px rgba(90,60,10,0.35);
  transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar .apw-btn:hover {
  background: var(--k1xv2-gold-grad); transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: var(--k1xv2-glow-lg), 0 2px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.55);
}
/* + Campaign → royal ghost twin */
html body #tabCalendar > div:first-child button[onclick*="p12OpenCampaignModal"] {
  background: var(--k1xv2-gold-tint) !important; border: 1px solid var(--k1xv2-gold-line) !important;
  color: var(--k1xv2-gold-2) !important; border-radius: 12px !important;
  padding: 10px 16px !important; font-size: 11.5px !important; font-weight: 800 !important;
  box-shadow: var(--k1xv2-edge); transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar > div:first-child button[onclick*="p12OpenCampaignModal"]:hover {
  border-color: var(--k1xv2-gold-line-hi) !important; box-shadow: var(--k1xv2-glow-sm), var(--k1xv2-edge); transform: translateY(-1px);
}
/* Month navigator — a quiet instrument row */
html body #tabCalendar > div:nth-child(2) { gap: 12px !important; margin: 2px 0 20px !important; }
html body #tabCalendar > div:nth-child(2) > button {
  border-radius: 10px !important;
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1)) !important;
  border: 1px solid var(--k1xv2-line) !important; color: var(--k1xv2-text-2) !important;
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
  transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar > div:nth-child(2) > button:hover { border-color: var(--k1xv2-gold-line) !important; color: var(--k1xv2-gold-2) !important; transform: translateY(-1px); }
html body #tabCalendar > div:nth-child(2) > button[onclick*="p12GoToday"] {
  width: auto !important; height: auto !important; padding: 8px 16px !important;
  border-radius: 999px !important; font-size: 10.5px !important; font-weight: 800 !important;
  letter-spacing: .8px; text-transform: uppercase; color: var(--k1xv2-gold-2) !important;
  background: var(--k1xv2-gold-tint) !important; border: 1px solid var(--k1xv2-gold-line) !important;
}
html body #tabCalendar #calMonthLabel {
  font-family: var(--k1xv2-font-display) !important; font-size: 17px !important;
  font-weight: 700 !important; letter-spacing: -0.2px; color: var(--k1xv2-text);
}
/* KPI stat row (rendered by wrapped renderCalStats → k1xv2-kpi tiles) */
html body #tabCalendar #calStats {
  display: grid !important; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px !important; margin-bottom: 20px !important;
}
html body #tabCalendar #calStats .k1xv2-kpi { min-width: 0; }
html body #calStats .k1xma-kpi--blue::before { background: linear-gradient(90deg, transparent, rgba(107,163,255,0.5), transparent); }
html body #calStats .k1xma-kpi--green::before { background: linear-gradient(90deg, transparent, rgba(62,232,165,0.5), transparent); }
html body #calStats .k1xma-kpi--red::before { background: linear-gradient(90deg, transparent, rgba(255,107,107,0.5), transparent); }
/* Heat legend → glass card */
html body #tabCalendar #p12HeatLegend {
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1)) !important;
  border: 1px solid var(--k1xv2-line) !important; border-radius: 12px !important;
  padding: 10px 16px !important; box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
}
/* The month grid — one elevated surface, jewel day cells */
html body #tabCalendar #calGrid {
  gap: 6px !important; padding: 12px;
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1)) !important;
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-lg) !important;
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge); overflow: visible !important;
}
html body #tabCalendar #calGrid > div:nth-child(-n+7) {
  background: transparent !important; color: var(--k1xv2-text-4) !important;
  font-size: 9.5px !important; font-weight: 800 !important; letter-spacing: 2px !important;
  padding: 8px 4px 6px !important; min-height: 0;
}
html body #tabCalendar #calGrid > div:not(.p12-day-cell):nth-child(n+8) {
  background: transparent !important; opacity: 1 !important;
  border: 1px dashed rgba(255,255,255,0.04); border-radius: 10px;
}
html body #tabCalendar .p12-day-cell {
  min-height: 104px; padding: 8px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0.004));
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform var(--k1xv2-fast) var(--k1xv2-ease), border-color var(--k1xv2-fast), background var(--k1xv2-fast), box-shadow var(--k1xv2-mid);
}
html body #tabCalendar .p12-day-cell:hover {
  transform: translateY(-1px); border-color: var(--k1xv2-line-strong);
  background: linear-gradient(180deg, var(--k1xv2-s3), var(--k1xv2-s2));
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
}
html body #tabCalendar .p12-day-cell.is-today {
  border-color: var(--k1xv2-gold-line-hi);
  background: linear-gradient(180deg, var(--k1xv2-gold-tint), rgba(226,184,87,0.015));
  box-shadow: var(--k1xv2-glow-sm), var(--k1xv2-edge);
}
html body #tabCalendar .p12-day-cell.is-today > div:first-child > span:first-child { color: var(--k1xv2-gold-2) !important; }
/* Best-time heat overlay — semantic colors preserved at v2 specificity */
html body #tabCalendar .p12-day-cell.p12-heat-cold { background: rgba(100,116,139,0.05); }
html body #tabCalendar .p12-day-cell.p12-heat-warm { background: rgba(245,158,11,0.07); }
html body #tabCalendar .p12-day-cell.p12-heat-hot  { background: rgba(52,211,153,0.09); }
html body #tabCalendar .p12-day-cell.p12-heat-fire { background: rgba(107,163,255,0.13); }
/* Drag target = royal invitation */
html body #tabCalendar .p12-day-cell.drag-over {
  border-color: var(--k1xv2-gold-line-hi); background: var(--k1xv2-gold-tint-hi);
  box-shadow: var(--k1xv2-glow-md), var(--k1xv2-edge);
}
html body #tabCalendar .p12-add-btn {
  width: 20px; height: 20px; line-height: 18px; border-radius: 50%;
  background: var(--k1xv2-gold-tint-hi); border: 1px solid var(--k1xv2-gold-line);
  color: var(--k1xv2-gold-2); font-weight: 800;
}
html body #tabCalendar .p12-post-pill {
  padding: 4px 7px; margin-bottom: 3px; border-radius: 7px;
  font-size: 9.5px; font-weight: 700; box-shadow: var(--k1xv2-edge);
  transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar .p12-post-pill:hover { filter: brightness(1.18); transform: translateY(-1px); box-shadow: var(--k1xv2-e1); }
/* Week view surface */
html body #tabCalendar #p12WeekView > div {
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1)) !important;
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-lg) !important;
  padding: 10px; gap: 3px !important; box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
  overflow: visible !important;
}
html body #tabCalendar .p12-week-slot { background: var(--k1xv2-glass); border-radius: 6px; }
html body #tabCalendar .p12-week-slot:hover { border-color: var(--k1xv2-gold-line); }
html body #tabCalendar .p12-week-hour { background: transparent !important; color: var(--k1xv2-text-4); border-right: 1px solid var(--k1xv2-line); }
/* Empty state — one clean premium stage (hides the old duplicated bits) */
html body #tabCalendar #calEmpty { padding: 0 !important; }
html body #tabCalendar #calEmpty > div:nth-child(1),
html body #tabCalendar #calEmpty > div:nth-child(3) { display: none; }
html body #tabCalendar #calEmpty > div:nth-child(2) {
  position: relative; overflow: hidden;
  background: radial-gradient(60% 60% at 50% 0%, var(--k1xv2-gold-tint), transparent 70%),
              linear-gradient(180deg, var(--k1xv2-s1), var(--k1xv2-s0));
  border: 1px dashed var(--k1xv2-gold-line); border-radius: var(--k1xv2-r-xl);
  padding: 64px 40px !important; box-shadow: var(--k1xv2-edge);
}
html body #tabCalendar #calEmpty > div:nth-child(2) > div:nth-child(1) { font-size: 44px !important; opacity: .9 !important; filter: drop-shadow(0 6px 18px rgba(226,184,87,0.25)); margin-bottom: 16px !important; }
html body #tabCalendar #calEmpty > div:nth-child(2) > div:nth-child(2) { font-family: var(--k1xv2-font-display); font-size: 20px !important; font-weight: 700 !important; letter-spacing: -0.3px; color: var(--k1xv2-text) !important; }
html body #tabCalendar #calEmpty > div:nth-child(2) > div:nth-child(3) { font-size: 13px !important; color: var(--k1xv2-text-2) !important; max-width: 420px; margin: 8px auto 22px !important; line-height: 1.6; }
html body #tabCalendar #calEmpty > div:nth-child(2) > button {
  padding: 10px 22px !important; border-radius: 999px !important;
  background: var(--k1xv2-gold-tint) !important; border: 1px solid var(--k1xv2-gold-line) !important;
  color: var(--k1xv2-gold-2) !important; font-size: 12.5px !important; font-weight: 700 !important;
  box-shadow: var(--k1xv2-edge); transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabCalendar #calEmpty > div:nth-child(2) > button:hover { border-color: var(--k1xv2-gold-line-hi) !important; box-shadow: var(--k1xv2-glow-sm), var(--k1xv2-edge); transform: translateY(-1px); }

/* ╔════════ 3 · QUEUE — KPI strip, premium row-cards, honest states ════════╗ */
html body #tabQueue .pubq-stats { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
html body #tabQueue .pubq-stat {
  position: relative; overflow: hidden; text-align: left; padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1));
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-lg);
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
  transition: transform var(--k1xv2-fast) var(--k1xv2-ease), border-color var(--k1xv2-fast), box-shadow var(--k1xv2-mid);
}
html body #tabQueue .pubq-stat:hover { transform: translateY(-2px); border-color: var(--k1xv2-line-strong); box-shadow: var(--k1xv2-e2), var(--k1xv2-edge-hi); }
html body #tabQueue .pubq-stat::before {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
}
html body #tabQueue .pubq-stat-val {
  font-family: var(--k1xv2-font-display); font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums;
}
html body #tabQueue .pubq-stat-lbl {
  font-size: var(--k1xv2-fs-over); font-weight: 800; letter-spacing: var(--k1xv2-ls-over);
  text-transform: uppercase; color: var(--k1xv2-text-4); margin-top: 7px;
}
/* Filter bar */
html body #tabQueue .pubq-toolbar { gap: 10px; margin-bottom: 18px; align-items: center; }
html body #tabQueue .clib-filter {
  padding: 10px 14px; border-radius: 12px; font-size: 12px; font-weight: 600;
  background: linear-gradient(180deg, var(--k1xv2-s1), var(--k1xv2-s0));
  border: 1px solid var(--k1xv2-line-strong); color: var(--k1xv2-text-2);
  box-shadow: var(--k1xv2-edge); transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabQueue .clib-filter:focus { border-color: var(--k1xv2-gold-line-hi); box-shadow: var(--k1xv2-ring), var(--k1xv2-edge); }
/* Queue items — layered row cards with a one-pass sheen */
html body #tabQueue .pubq-item {
  position: relative; overflow: hidden; gap: 14px; padding: 14px 16px; margin-bottom: 10px;
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1));
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-lg);
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
  transition: transform var(--k1xv2-fast) var(--k1xv2-ease), border-color var(--k1xv2-fast), box-shadow var(--k1xv2-mid), background var(--k1xv2-fast);
}
html body #tabQueue .pubq-item:hover {
  transform: translateY(-2px); border-color: var(--k1xv2-line-strong);
  background: linear-gradient(180deg, var(--k1xv2-s3), var(--k1xv2-s2));
  box-shadow: var(--k1xv2-e2), var(--k1xv2-edge-hi);
}
html body #tabQueue .pubq-item::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,0.05) 50%, transparent 58%);
  transform: translateX(-130%); transition: transform var(--k1xv2-slow) var(--k1xv2-ease);
}
html body #tabQueue .pubq-item:hover::after { transform: translateX(130%); }
html body #tabQueue .pubq-item-plat {
  min-width: 42px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; border-radius: 12px;
  background: linear-gradient(180deg, var(--k1xv2-s3), var(--k1xv2-s1));
  border: 1px solid var(--k1xv2-line); box-shadow: var(--k1xv2-edge-hi);
}
html body #tabQueue .pubq-item-title { font-size: 13.5px; font-weight: 700; color: var(--k1xv2-text); letter-spacing: -0.1px; }
html body #tabQueue .pubq-item-meta { font-size: 10.5px; color: var(--k1xv2-text-3); gap: 10px; margin-top: 4px; }
html body #tabQueue .pubq-item-status {
  padding: 5px 11px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .8px;
}
html body #tabQueue .pubq-btn, html body #tabBesttime .pubq-btn {
  padding: 8px 12px; border-radius: 10px; font-size: 11px; font-weight: 700;
  background: var(--k1xv2-glass); border: 1px solid var(--k1xv2-line); color: var(--k1xv2-text-2);
  box-shadow: var(--k1xv2-edge); transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabQueue .pubq-btn:hover, html body #tabBesttime .pubq-btn:hover {
  border-color: var(--k1xv2-gold-line); color: var(--k1xv2-gold-2); transform: translateY(-1px);
  background: var(--k1xv2-glass-hi);
}
/* Empty + honest-error stages */
html body #tabQueue .clib-empty {
  padding: 64px 32px; font-size: 14px; font-weight: 600; color: var(--k1xv2-text-2);
  background: radial-gradient(60% 60% at 50% 0%, var(--k1xv2-gold-tint), transparent 70%),
              linear-gradient(180deg, var(--k1xv2-s1), var(--k1xv2-s0));
  border: 1px dashed var(--k1xv2-gold-line); border-radius: var(--k1xv2-r-xl);
  box-shadow: var(--k1xv2-edge);
}
html body #tabQueue .clib-empty-icon { font-size: 42px; margin-bottom: 14px; filter: drop-shadow(0 6px 18px rgba(226,184,87,0.25)); }
html body .k1xma-error {
  text-align: center; padding: 56px 32px;
  background: linear-gradient(180deg, var(--k1xv2-s1), var(--k1xv2-s0));
  border: 1px dashed var(--k1xv2-line-strong); border-radius: var(--k1xv2-r-xl);
  box-shadow: var(--k1xv2-edge);
}
html body .k1xma-error-icon { font-size: 34px; margin-bottom: 12px; opacity: .8; }
html body .k1xma-error-title { font-family: var(--k1xv2-font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--k1xv2-text); margin-bottom: 8px; }
html body .k1xma-error-sub { font-size: 12.5px; color: var(--k1xv2-text-3); line-height: 1.6; max-width: 46ch; margin: 0 auto 18px; }

/* ╔════════ 4 · BEST TIME — carded sections, hero KPIs, premium heatmap ════════╗ */
/* Header actions: Learn = THE gold primary; Smart Queue = glass ghost */
html body #tabBesttime .inbox-sync-btn[onclick*="btLearn"] {
  background: var(--k1xv2-gold-grad) !important; color: var(--k1xv2-gold-ink) !important;
  border: none !important; border-radius: 12px !important; padding: 10px 18px !important;
  font-size: 12px !important; font-weight: 800 !important;
  box-shadow: var(--k1xv2-glow-md), 0 2px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -2px 6px rgba(90,60,10,0.35);
  transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabBesttime .inbox-sync-btn[onclick*="btLearn"]:hover { transform: translateY(-1px); filter: brightness(1.06); background: var(--k1xv2-gold-grad) !important; }
html body #tabBesttime .inbox-sync-btn[onclick*="btLoadQueue"] {
  background: var(--k1xv2-glass); border: 1px solid var(--k1xv2-line); color: var(--k1xv2-text-2);
  border-radius: 12px; padding: 10px 16px; font-size: 12px; font-weight: 700;
  box-shadow: var(--k1xv2-edge); transition: all var(--k1xv2-fast) var(--k1xv2-ease);
}
html body #tabBesttime .inbox-sync-btn[onclick*="btLoadQueue"]:hover { border-color: var(--k1xv2-line-strong); color: var(--k1xv2-text); background: var(--k1xv2-glass-hi); transform: translateY(-1px); }
/* Consistency KPI tiles — the number is the hero */
html body #tabBesttime .bt-consist { gap: 12px; margin-bottom: 20px; }
html body #tabBesttime .bt-consist-card {
  position: relative; overflow: hidden; text-align: left; padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1));
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-lg);
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
  transition: transform var(--k1xv2-fast) var(--k1xv2-ease), border-color var(--k1xv2-fast), box-shadow var(--k1xv2-mid);
}
html body #tabBesttime .bt-consist-card:hover { transform: translateY(-2px); border-color: var(--k1xv2-line-strong); box-shadow: var(--k1xv2-e2), var(--k1xv2-edge-hi); }
html body #tabBesttime .bt-consist-card::before {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
}
html body #tabBesttime .bt-consist-val {
  font-family: var(--k1xv2-font-display); font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums;
}
html body #tabBesttime .bt-consist-lbl {
  font-size: var(--k1xv2-fs-over); font-weight: 800; letter-spacing: var(--k1xv2-ls-over);
  text-transform: uppercase; color: var(--k1xv2-text-4); margin-top: 7px;
}
/* Section panels (JS wraps heading + content into .k1xma-panel) */
html body #tabBesttime .k1xma-panel {
  position: relative; background: linear-gradient(180deg, var(--k1xv2-s2), var(--k1xv2-s1));
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-lg);
  padding: 20px; margin-bottom: 18px;
  box-shadow: var(--k1xv2-e1), var(--k1xv2-edge);
}
html body #tabBesttime .k1xma-panel::before {
  content: ''; position: absolute; top: -1px; left: 8%; right: 8%; height: 1px; pointer-events: none;
  background: var(--k1xv2-gold-hair); opacity: .5;
}
html body #tabBesttime .k1xma-sech {
  font-family: var(--k1xv2-font-display) !important; font-size: 16px !important;
  font-weight: 700 !important; letter-spacing: -0.2px; color: var(--k1xv2-text) !important;
  margin: 0 0 4px !important;
}
html body #tabBesttime .k1xma-sech-sub { font-size: 11.5px !important; color: var(--k1xv2-text-3) !important; margin-bottom: 14px !important; }
html body #tabBesttime .k1xma-scroll { overflow-x: auto; padding-bottom: 4px; }
html body #tabBesttime #k1xmaBtPlatTabs { margin: 2px 0 14px; }
/* Heatmap — bigger cells, soft radius, real data only.
   min-width 620 ONLY when real cells exist (scoped scroll for the data grid);
   skeleton / honest error / empty stages stay full-flex so nothing is cut
   off inside the panel on a 375px phone. Hours rail hides without cells. */
html body #tabBesttime .bt-hours { gap: 3px; margin-bottom: 5px; min-width: 0; }
html body #tabBesttime .bt-hours:not(:has(+ .bt-heatmap .bt-heatmap-cell)) { display: none; }
html body #tabBesttime .bt-hours span { font-size: 8px; color: var(--k1xv2-text-4); font-weight: 700; }
html body #tabBesttime .bt-heatmap { gap: 3px; margin-bottom: 6px; min-width: 0; }
html body #tabBesttime .bt-hours:has(+ .bt-heatmap .bt-heatmap-cell),
html body #tabBesttime .bt-heatmap:has(.bt-heatmap-cell) { min-width: 620px; }
html body #tabBesttime .bt-heatmap-label { font-size: 9px; font-weight: 700; color: var(--k1xv2-text-3); padding-right: 8px; }
html body #tabBesttime .bt-heatmap-cell {
  min-height: 17px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.03);
  transition: transform var(--k1xv2-fast) var(--k1xv2-ease), box-shadow var(--k1xv2-fast);
}
html body #tabBesttime .bt-heatmap-cell:hover { transform: scale(1.28); box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 0 1px var(--k1xv2-gold-line); }
html body #tabBesttime .bt-heatmap-cell .bt-tip {
  background: linear-gradient(180deg, rgba(18,20,29,0.97), rgba(10,12,17,0.97));
  border: 1px solid var(--k1xv2-line-strong); border-radius: 8px; padding: 6px 10px;
  font-size: 10px; box-shadow: var(--k1xv2-e2);
}
/* Recommendation cards — rank chip + confident time */
html body #tabBesttime .bt-recs { gap: 10px; margin-bottom: 4px; }
html body #tabBesttime .bt-rec-card {
  position: relative; overflow: hidden; gap: 14px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.006));
  border: 1px solid var(--k1xv2-line); border-radius: var(--k1xv2-r-md);
  box-shadow: var(--k1xv2-edge);
  transition: transform var(--k1xv2-fast) var(--k1xv2-ease), border-color var(--k1xv2-fast), box-shadow var(--k1xv2-mid);
}
html body #tabBesttime .bt-rec-card:hover { transform: translateY(-2px); border-color: rgba(62,232,165,0.3); box-shadow: var(--k1xv2-e1), var(--k1xv2-edge); }
html body #tabBesttime .bt-rec-rank {
  min-width: 38px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; border-radius: 11px; color: var(--k1xv2-gold-2);
  background: var(--k1xv2-gold-tint); border: 1px solid var(--k1xv2-gold-line);
  box-shadow: var(--k1xv2-edge);
}
html body #tabBesttime .bt-rec-time { font-family: var(--k1xv2-font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.2px; color: var(--k1xv2-text); }
html body #tabBesttime .bt-rec-reason { font-size: 11px; color: var(--k1xv2-text-3); margin-top: 3px; }
html body #tabBesttime .bt-rec-score { font-family: var(--k1xv2-font-display); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ╔════════ 5 · MOBILE ≤768px — no horizontal page scroll at 375 ════════╗ */
@media (max-width: 768px) {
  html body #tabQueue .pubq-stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  html body #tabQueue .pubq-stat:nth-child(5) { grid-column: 1 / -1; }
  html body #tabQueue .pubq-stat-val, html body #tabBesttime .bt-consist-val { font-size: 24px; }
  html body #tabCalendar #calStats { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 10px !important; }
  html body #tabBesttime .bt-consist { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  html body #tabCalendar > div:first-child,
  html body #tabQueue > div > div:first-child,
  html body #tabBesttime > div > div:first-child { flex-direction: column; align-items: flex-start !important; gap: 14px; }
  html body #tabCalendar .p12-day-cell { min-height: 64px; padding: 4px; border-radius: 8px; }
  html body #tabCalendar #calGrid { gap: 3px !important; padding: 6px; }
  html body #tabCalendar .p12-post-pill { font-size: 8px; padding: 2px 4px; }
  html body #tabBesttime .k1xma-panel { padding: 14px; }
  html body #tabQueue .pubq-item { flex-wrap: wrap; }
  html body #tabQueue .pubq-item-actions { width: 100%; justify-content: flex-end; }
}
