/* ============================================================
   Blend — Direction A's "Published / Drafts / Archived" treatment,
   layered onto Direction B's shell (sharp.css). Only the owned-
   section classes live here; shared shell components (h-section,
   count, ai-chip, segmented, link, btn) come from sharp.css.
   ============================================================ */

.owned {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  width: 100%;
}
.group__head--btn {
  text-align: left;
}
.group__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.group__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.group__chev {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  transition: transform var(--dur-mid) var(--ease-out);
}

/* type list & cards */
.types {
  display: flex;
  flex-direction: column;
}
.group > .types > .type:first-child {
  border-top: 1px solid var(--border);
}
.type {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--border);
}
.types > .type:first-child {
  border-top: none;
}
.type:hover {
  background: var(--surface-2);
}
.type__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.type__lead {
  display: flex;
  align-items: stretch;
  gap: var(--sp-3);
}
.type__bar {
  width: 4px;
  border-radius: var(--r-pill);
  background: var(--cat);
  flex-shrink: 0;
}
.type__leadtext {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.type__name {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.type__desc {
  color: var(--ink-2);
  font-size: var(--text-base);
  max-width: 70ch;
}
/* archived types: dim the whole lead so live types read first */
.type--archived .type__bar {
  opacity: 0.7;
}
.type--archived .type__name {
  color: var(--ink-2);
}

/* status badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-left: auto;
}
.status__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
}
.status--live {
  background: var(--ok-tint);
  color: var(--ok-ink);
}
.status--live .status__dot {
  background: var(--ok-line);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok-line) 22%, transparent);
}
.status--draft {
  background: var(--warn-tint);
  color: var(--warn-ink);
}
.status--draft .status__dot {
  background: var(--warn-line);
}
.status--archived {
  background: var(--surface-3);
  color: var(--ink-3);
}
.status--archived .status__dot {
  background: var(--border-strong);
}

/* chips (warm treatment — overrides sharp.css .chip base for this page) */
.type__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
}
.chip .ic {
  width: 13px;
  height: 13px;
  color: var(--ink-3);
}
.chip time {
  color: var(--ink);
  font-weight: 600;
}
.chip--quiet {
  background: var(--surface-3);
  border-color: transparent;
}
.chip--warm {
  background: var(--warm-tint);
  border-color: color-mix(in oklab, var(--warm) 24%, transparent);
  color: var(--warm-ink);
}
.chip--warm .ic {
  color: var(--warm);
}
.chip--warm time {
  color: var(--warm-ink);
}
/* past schedules: collapsed, quiet count pill */
.chip--past {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--ink-3);
}
.chip--past .ic {
  color: var(--ink-3);
}
/* the schedule currently in effect: highlighted in brand blue (not red) */
.chip--active {
  background: var(--primary-tint);
  border-color: color-mix(in oklab, var(--primary) 32%, transparent);
  color: var(--primary-press);
  font-weight: 600;
}
.chip--active time {
  color: var(--primary-press);
  font-weight: 700;
}
/* upcoming schedules: dashed = planned, not yet in effect */
.chip--future {
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--ink-2);
}
.chip--future .ic {
  color: var(--ink-3);
}
.chip__live {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--ok-line);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok-line) 24%, transparent);
  flex-shrink: 0;
}

/* schedule timeline */
.timeline {
  display: flex;
  gap: 3px;
  height: 8px;
  border-radius: var(--r-pill);
  overflow: hidden;
  max-width: 420px;
}
.timeline__seg {
  width: var(--w);
  background: var(--primary-tint-strong);
  border-radius: 3px;
}
.timeline__seg--warm {
  background: var(--warm);
}

/* AI note (inline maître d') */
.ai-note {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--ai-wash);
  border: 1px solid color-mix(in oklab, var(--ai) 22%, transparent);
}
.ai-note p {
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: var(--lh-snug);
}
.ai-note p strong {
  color: var(--ink);
  font-weight: 600;
}
.ai-note__spark {
  width: 18px;
  height: 18px;
  color: var(--ai);
  align-self: center;
}
.ai-note__act {
  height: 30px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--ai-strong);
  color: var(--ai-on);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
.ai-note__act:hover {
  background: var(--ai-hover);
}
.ai-note__dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.ai-note__dismiss:hover {
  background: oklch(1 0 0 / 0.6);
  color: var(--ink);
}
.ai-note--compact {
  padding: var(--sp-2) var(--sp-3);
}

/* more button */
.type__more {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  align-self: flex-start;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.type__more:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.type__more .ic {
  width: 18px;
  height: 18px;
}

/* collapsible groups */
.group--collapsible .group__head--btn {
  cursor: pointer;
  border-radius: var(--r-lg);
  transition: background var(--dur-fast) var(--ease-out);
}
.group--collapsible .group__head--btn:hover {
  background: var(--surface-2);
}
.group__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease-out);
}
.group__panel-inner {
  overflow: hidden;
}
.group--collapsible[data-open] .group__panel {
  grid-template-rows: 1fr;
}
.group--collapsible[data-open] .group__chev {
  transform: rotate(180deg);
}

@media (max-width: 680px) {
  .type,
  .group__head {
    padding: var(--sp-4);
  }
  .ai-note {
    grid-template-columns: auto 1fr;
  }
  .ai-note__act {
    grid-column: 2;
    justify-self: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .group__panel {
    transition: none;
  }
}

/* ---------- "⋮" card menu (Edit Name / Edit Settings) ---------- */
.cardmenu {
  position: fixed;
  z-index: var(--z-dropdown);
  min-width: 184px;
  padding: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  animation: cardmenu-in var(--dur-fast) var(--ease-out);
}
.cardmenu[hidden] {
  display: none;
}
@keyframes cardmenu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cardmenu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out);
}
.cardmenu__item:hover {
  background: var(--surface-2);
}

/* ---------- Edit Name modal ---------- */
.minimodal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 48px));
  height: fit-content;
  max-height: 90vh;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.minimodal::backdrop {
  background: oklch(0.18 0.03 264 / 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
}
.minimodal[open]::backdrop {
  animation: am-fade var(--dur-mid) var(--ease-out) forwards;
}
.minimodal__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.minimodal[open] .minimodal__inner {
  animation: am-pop var(--dur-mid) var(--ease-out-quint) both;
}
.minimodal[data-closing] .minimodal__inner {
  animation: am-pop var(--dur-fast) var(--ease-out) reverse both;
}
.minimodal__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.minimodal__close:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.minimodal__body {
  padding: var(--sp-6);
}
.minimodal__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.minimodal__sub {
  font-size: var(--text-base);
  color: var(--ink-2);
  line-height: var(--lh-normal);
  margin: 8px 0 var(--sp-6);
  max-width: 60ch;
}
.minifield {
  margin-bottom: var(--sp-5);
}
.minifield:last-child {
  margin-bottom: 0;
}
.minilabel {
  display: block;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.miniinput {
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: inherit;
  font-size: var(--text-md);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.miniinput:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.miniinput--area {
  height: auto;
  min-height: 88px;
  padding: var(--sp-3);
  line-height: var(--lh-normal);
  resize: vertical;
}
.minimodal__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
}

/* ---------- Toast (success) ---------- */
.toast-area {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-width: 280px;
  max-width: calc(100vw - 32px);
  padding: 12px var(--sp-3) 12px var(--sp-4);
  border-radius: var(--r-md);
  background: oklch(0.52 0.1 162);
  color: #fff;
  box-shadow: var(--sh-3);
  pointer-events: auto;
  animation: toast-in var(--dur-mid) var(--ease-out-quint) both;
}
.toast[data-leaving] {
  animation: toast-out var(--dur-mid) var(--ease-out) forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}
.toast__msg {
  flex: 1;
  font-size: var(--text-base);
  font-weight: 500;
}
.toast__close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  font-size: 18px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  transition: background var(--dur-fast);
}
.toast__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .cardmenu,
  .minimodal[open] .minimodal__inner,
  .minimodal[open]::backdrop,
  .toast,
  .toast[data-leaving] {
    animation: none;
  }
  .minimodal::backdrop {
    opacity: 1;
  }
}

/* ============================================================
   v2 — light page header, Create/Manage zones, status tabs
   ============================================================ */
.pagehd {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pagehd__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
}
.pagehd__title {
  font-size: clamp(1.55rem, 1.3rem + 1vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}
.pagehd__sub {
  margin-top: 7px;
  font-size: var(--text-md);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  max-width: 62ch;
}
.pagehd__actions { display: flex; gap: var(--sp-3); flex-shrink: 0; }

/* outlined secondary button for light surfaces */
.btn--line {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn--line:hover { background: var(--surface-3); border-color: var(--ink-3); }

/* subtle divider between the Create and Manage zones */
.zone-rule { border: none; border-top: 1px solid var(--border); margin: 0; }

/* status tabs */
.tabbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tabs { display: flex; gap: 2px; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  margin-bottom: -1px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tab:hover { color: var(--ink); }
.tab__c {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-2);
}
.tab__live {
  width: 6px; height: 6px; border-radius: var(--r-pill);
  background: oklch(0.7 0.15 150);
  box-shadow: 0 0 0 3px oklch(0.7 0.15 150 / 0.2);
}
.tab.is-active { color: var(--ink); border-bottom-color: var(--primary); }
.tab.is-active .tab__c { background: var(--primary-tint); color: var(--primary-press); }
.tabbar__tools { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: 8px; }

.tabpanel { margin-top: var(--sp-5); }
.tabpanel[hidden] { display: none; }

/* per-panel header: suggestion chip (always) + view toggle (Published only),
   so both read as belonging to the active tab, not the whole page */
.tabpanel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  min-height: 34px;
}

/* each availability type is its own card (not one connected list) */
.manage .types { gap: var(--sp-4); }
.manage .type {
  border-top: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

/* clickable header stats → jump to the matching tab */
.pagehd__stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-4); margin-left: -10px; }
.hstat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.hstat:hover { background: var(--surface-3); color: var(--ink); }
.hstat__n { font-weight: 700; color: var(--ink); }
.hstat__live {
  width: 6px; height: 6px; border-radius: var(--r-pill);
  background: oklch(0.7 0.15 150);
  box-shadow: 0 0 0 3px oklch(0.7 0.15 150 / 0.2);
}
