/* ─────────────────────────────────────────────────────────────────
   Meetzen — Plan your day

   Three zones, each visually distinct so the eye always knows where
   it is: a tinted hero (which day / how it's going), a segmented tab
   control, and one white card per view. Borders are used sparingly —
   grouping comes from background and spacing instead, which keeps a
   page this dense from reading as a grid of boxes.
   ───────────────────────────────────────────────────────────────── */
.plan-root { display: block; }
/* `.btn` and several blocks set an explicit display, which beats the UA
   `[hidden] { display:none }` rule. */
.plan-root [hidden] { display: none !important; }

.plan-wrap { display: flex; flex-direction: column; gap: var(--s-5); }

/* ═══ Hero ═══════════════════════════════════════════════════════ */
.plan-hero {
  display: flex; flex-direction: column; gap: var(--s-5);
  padding: var(--s-6);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--c-brand-50) 0%, transparent 55%),
    linear-gradient(135deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
  border: 1px solid var(--c-line-soft);
  box-shadow: var(--sh-1);
}
.plan-hero-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5); flex-wrap: wrap;
}

/* ── Date navigation ── */
.plan-datenav { display: flex; align-items: center; gap: var(--s-2); }
.plan-nav-btn {
  width: 36px; height: 36px; flex: 0 0 auto; padding: 0;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text-soft);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}
.plan-nav-btn svg { width: 17px; height: 17px; }
.plan-nav-btn:hover { background: var(--c-brand-50); color: var(--c-brand-600); border-color: var(--c-brand-200); }

.plan-dateblock {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 132px; padding: 0 var(--s-2);
}
.plan-date-label {
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em;
  line-height: var(--lh-tight); color: var(--c-text);
}
.plan-date-sub { display: flex; }
.plan-date-input {
  border: 0; background: transparent; padding: 0; margin: 0;
  color: var(--c-text-mute); font-size: var(--fs-xs); font-family: inherit;
  cursor: pointer; width: 100%;
}
.plan-date-input:focus-visible { outline: 2px solid var(--c-brand-500); outline-offset: 2px; border-radius: var(--r-xs); }

.plan-today-btn {
  border: 1px solid var(--c-line); background: var(--c-surface);
  border-radius: var(--r-pill); padding: 6px 13px;
  font: inherit; font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-text-soft); cursor: pointer; white-space: nowrap;
}
.plan-today-btn:hover { border-color: var(--c-brand-300); color: var(--c-brand-600); }

/* ── Progress ── */
.plan-progress { display: flex; align-items: center; gap: var(--s-4); }
.plan-progress-text {
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-end; text-align: right;
}
.plan-progress-main {
  font-size: var(--fs-base); font-weight: 700; color: var(--c-text);
  line-height: var(--lh-tight);
}
.plan-progress-sub { font-size: var(--fs-xs); color: var(--c-text-mute); }

.plan-ring {
  --pct: 0;
  flex: 0 0 auto;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--c-brand-500) calc(var(--pct) * 1%), var(--c-line-soft) 0);
  transition: background var(--t-slow) var(--ease-out);
}
.plan-ring.is-complete { background: conic-gradient(var(--c-ok) 100%, var(--c-ok) 0); }
.plan-ring > span {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--c-surface);
  display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-soft);
  font-variant-numeric: tabular-nums;
}
.plan-ring.is-complete > span { color: var(--c-ok); }

/* ── One-line intention ── */
.plan-intention { display: flex; flex-direction: column; gap: 6px; }
.plan-intention-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--c-text-mute);
}
.plan-intention-input {
  width: 100%;
  border: 0; border-bottom: 2px solid var(--c-line);
  background: transparent; border-radius: 0;
  padding: 6px 2px;
  font-family: inherit; font-size: var(--fs-md); font-weight: 600;
  color: var(--c-text);
  transition: border-color var(--t-fast) var(--ease-out);
}
.plan-intention-input::placeholder { font-weight: 400; color: var(--c-text-faint); }
.plan-intention-input:focus { outline: none; border-bottom-color: var(--c-brand-500); }

/* ── Carry-over notice ── */
.plan-carry {
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%; text-align: left;
  padding: 10px var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-warm-400);
  background: rgba(255, 178, 124, .12);
  color: var(--c-text); font: inherit; font-size: var(--fs-sm);
  cursor: pointer;
}
.plan-carry:hover { background: rgba(255, 178, 124, .2); }
.plan-carry-ico { font-size: var(--fs-md); line-height: 1; }

/* ═══ Segmented tabs ══════════════════════════════════════════════ */
.plan-tabs {
  display: flex; gap: 4px;
  padding: 5px;
  background: var(--c-bg-soft);
  border-radius: var(--r-lg);
}
.plan-tab {
  flex: 1 1 0;
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 10px var(--s-3);
  border: 0; background: transparent; border-radius: var(--r-md);
  font: inherit; font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text-mute); cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.plan-tab:hover { color: var(--c-text); }
.plan-tab.active {
  background: var(--c-surface);
  color: var(--c-brand-600);
  box-shadow: var(--sh-1);
}
.plan-tab:focus-visible { outline: 2px solid var(--c-brand-500); outline-offset: -2px; }
.plan-tab-ico { font-size: var(--fs-base); line-height: 1; }
/* Three equal tabs with long labels must truncate rather than overflow. */
.plan-tab { min-width: 0; }
.plan-tab-label { overflow: hidden; text-overflow: ellipsis; }
.plan-tab-count {
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--c-line-soft); color: var(--c-text-mute);
}
.plan-tab.active .plan-tab-count { background: var(--c-brand-50); color: var(--c-brand-700); }

/* ═══ Panels ══════════════════════════════════════════════════════ */
.plan-panel {
  display: flex; flex-direction: column; gap: var(--s-5);
  padding: var(--s-6);
  background: var(--c-surface);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
}
.plan-panel:focus { outline: none; }

.plan-sec-head { display: flex; flex-direction: column; gap: 3px; }
.plan-sec-head h2 {
  font-size: var(--fs-md); font-weight: 700; letter-spacing: -.01em;
  color: var(--c-text); margin: 0;
}
.plan-sec-head p { margin: 0; font-size: var(--fs-sm); color: var(--c-text-mute); }

.plan-hint { margin: 0; font-size: var(--fs-sm); color: var(--c-text-mute); }
.plan-empty {
  margin: 0; padding: var(--s-6) var(--s-4);
  text-align: center; font-size: var(--fs-sm); color: var(--c-text-mute);
  background: var(--c-bg-soft); border-radius: var(--r-lg);
}
.plan-empty-ico { display: block; font-size: 26px; margin-bottom: var(--s-2); }

/* ── Add bar ── */
.plan-add { display: flex; gap: var(--s-2); }
.plan-add-input {
  flex: 1 1 auto; min-width: 0;
  padding: 11px var(--s-4);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
  font-family: inherit; font-size: var(--fs-base); color: var(--c-text);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.plan-add-input::placeholder { color: var(--c-text-faint); }
.plan-add-input:focus {
  outline: none; border-color: var(--c-brand-400);
  box-shadow: 0 0 0 3px var(--c-brand-50);
}
.plan-add-btn { flex: 0 0 auto; padding-inline: var(--s-5); }
.plan-add-sm .plan-add-input { padding: 8px var(--s-3); font-size: var(--fs-sm); }
.plan-add-sm .plan-add-btn { padding: 8px var(--s-4); font-size: var(--fs-sm); }

/* ── Checklist rows ── */
.plan-list, .plan-prio-list, .plan-tl, .plan-taglist {
  list-style: none; margin: 0; padding: 0;
}
.plan-list { display: flex; flex-direction: column; gap: 2px; }

.plan-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease-out);
}
.plan-item:hover { background: var(--c-surface-2); }
.plan-item-title {
  flex: 1 1 auto; font-size: var(--fs-base); color: var(--c-text);
  word-break: break-word; line-height: var(--lh-snug);
}
.plan-item.is-done .plan-item-title { text-decoration: line-through; color: var(--c-text-faint); }

/* Checkbox — one control, reused everywhere. */
.plan-check {
  flex: 0 0 auto;
  width: 22px; height: 22px; padding: 0;
  border-radius: var(--r-xs);
  border: 2px solid var(--c-line);
  background: var(--c-surface);
  color: transparent; cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}
.plan-check svg { width: 12px; height: 12px; }
.plan-check:hover { border-color: var(--c-brand-400); }
.plan-check[aria-checked="true"] {
  background: var(--c-brand-500); border-color: var(--c-brand-500); color: #fff;
}
.plan-check:focus-visible { outline: 2px solid var(--c-brand-500); outline-offset: 2px; }

/* Destructive actions stay out of sight until you reach for the row —
   twelve always-visible ✕ buttons is most of what made this page noisy. */
.plan-x {
  flex: 0 0 auto;
  width: 28px; height: 28px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  color: var(--c-text-faint);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.plan-x svg { width: 15px; height: 15px; }
.plan-item:hover .plan-x, .plan-prio:hover .plan-x,
.plan-x:focus-visible { opacity: 1; }
.plan-x:hover { color: var(--c-err); background: var(--c-bg-soft); }
@media (hover: none) { .plan-x { opacity: .55; } }

.plan-pill {
  flex: 0 0 auto;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--c-bg-soft); color: var(--c-text-mute);
  font-variant-numeric: tabular-nums;
}

/* ═══ Top 3 priorities ════════════════════════════════════════════ */
.plan-prio-list { display: flex; flex-direction: column; gap: var(--s-3); }
.plan-prio {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid transparent;
  transition: border-color var(--t-fast) var(--ease-out);
}
.plan-prio:hover { border-color: var(--c-line); }
.plan-prio.is-empty {
  background: transparent;
  border: 1.5px dashed var(--c-line);
}
.plan-prio-rank {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 800;
  background: var(--c-brand-500); color: #fff;
}
.plan-prio.is-empty .plan-prio-rank { background: var(--c-line); color: var(--c-text-mute); }
.plan-prio.is-done .plan-prio-rank { background: var(--c-ok); }
.plan-prio-title {
  flex: 1 1 auto; font-size: var(--fs-md); font-weight: 600;
  color: var(--c-text); word-break: break-word; line-height: var(--lh-snug);
}
.plan-prio.is-done .plan-prio-title {
  text-decoration: line-through; color: var(--c-text-mute); font-weight: 500;
}
.plan-prio-form { display: flex; gap: var(--s-2); flex: 1 1 auto; min-width: 0; }
.plan-prio-input {
  flex: 1 1 auto; min-width: 0;
  border: 0; background: transparent; padding: 6px 0;
  font-family: inherit; font-size: var(--fs-base); color: var(--c-text);
}
.plan-prio-input::placeholder { color: var(--c-text-faint); }
.plan-prio-input:focus { outline: none; }
.plan-prio-add { flex: 0 0 auto; }

.plan-mins-wrap {
  flex: 0 0 auto;
  display: flex; align-items: baseline; gap: 3px;
  font-size: var(--fs-xs); color: var(--c-text-mute);
}
.plan-mins {
  width: 46px; padding: 4px 6px; text-align: right;
  border: 1px solid transparent; border-radius: var(--r-xs);
  background: transparent; font-family: inherit; font-size: var(--fs-sm);
  color: var(--c-text); font-variant-numeric: tabular-nums;
}
.plan-mins:hover { border-color: var(--c-line); }
.plan-mins:focus { outline: none; border-color: var(--c-brand-400); background: var(--c-surface); }

/* ═══ 12-hour timeline ════════════════════════════════════════════ */
.plan-toolbar { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.plan-start {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-sm); color: var(--c-text-soft);
}
.plan-select {
  padding: 7px var(--s-3);
  border: 1px solid var(--c-line); border-radius: var(--r-sm);
  background: var(--c-surface); font-family: inherit;
  font-size: var(--fs-sm); color: var(--c-text); cursor: pointer;
}
.plan-select:focus { outline: none; border-color: var(--c-brand-400); }

/* The rail: one continuous line with a dot per hour, so twelve rows read
   as a day rather than as a spreadsheet. */
.plan-tl { position: relative; display: flex; flex-direction: column; }
.plan-slot {
  display: grid;
  grid-template-columns: 62px 18px 1fr;
  align-items: center; gap: var(--s-3);
  min-height: 46px;
}
.plan-slot-time {
  text-align: right;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-text-mute); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plan-slot-marker {
  position: relative; align-self: stretch;
  display: grid; place-items: center;
}
/* Connector line, clipped at the first and last dot. */
.plan-slot-marker::before {
  content: ''; position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--c-line-soft);
}
.plan-slot:first-child .plan-slot-marker::before { top: 50%; }
.plan-slot:last-child  .plan-slot-marker::before { bottom: 50%; }
.plan-slot-dot {
  position: relative; z-index: 1;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c-surface);
  box-shadow: 0 0 0 2px var(--c-line);
  transition: background var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.plan-slot.is-filled .plan-slot-dot { background: var(--c-brand-500); box-shadow: 0 0 0 2px var(--c-brand-200); }
.plan-slot.is-done   .plan-slot-dot { background: var(--c-ok); box-shadow: 0 0 0 2px var(--c-ok); }

.plan-slot-body {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 4px var(--s-3) 4px var(--s-2);
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease-out);
}
.plan-slot-input {
  flex: 1 1 auto; min-width: 0;
  border: 0; background: transparent; padding: 6px 4px;
  font-family: inherit; font-size: var(--fs-base); color: var(--c-text);
  border-radius: var(--r-xs);
}
.plan-slot-input::placeholder { color: var(--c-text-faint); font-style: italic; }
.plan-slot-input:focus { outline: none; }
.plan-slot-body:hover, .plan-slot-body:focus-within { background: var(--c-surface-2); }
.plan-slot.is-filled .plan-slot-body { background: var(--c-brand-50); }
.plan-slot.is-filled .plan-slot-input { font-weight: 600; }
.plan-slot.is-done .plan-slot-body { background: var(--c-bg-soft); }
.plan-slot.is-done .plan-slot-input { text-decoration: line-through; color: var(--c-text-mute); font-weight: 500; }

/* Current hour */
.plan-slot.is-now .plan-slot-time { color: var(--c-err); font-weight: 700; }
.plan-slot.is-now .plan-slot-dot {
  background: var(--c-err); box-shadow: 0 0 0 3px rgba(239, 71, 97, .22);
  animation: plan-pulse 2.4s infinite ease-in-out;
}
.plan-now-tag {
  flex: 0 0 auto;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--c-err); color: #fff;
}
@keyframes plan-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ═══ Chips ═══════════════════════════════════════════════════════ */
.plan-chiprow {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
}
.plan-chiprow-fill {
  padding: var(--s-3) var(--s-4);
  background: var(--c-bg-soft); border-radius: var(--r-lg);
  max-height: 116px; overflow-y: auto; scrollbar-width: thin;
}
.plan-chiprow-label {
  font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-mute);
  margin-right: 2px;
}
.plan-chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--c-line); background: var(--c-surface);
  border-radius: var(--r-pill); padding: 5px 12px;
  font: inherit; font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-text-soft); cursor: pointer;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}
.plan-chip-btn:hover {
  border-color: var(--c-brand-400); color: var(--c-brand-600); background: var(--c-brand-50);
}
.plan-chip-btn.is-prio {
  border-color: var(--c-brand-200); background: var(--c-brand-50); color: var(--c-brand-700);
}
.plan-chip-btn.is-prio:hover { border-color: var(--c-brand-500); }
.plan-chip-plus { font-size: var(--fs-base); line-height: 1; color: var(--c-text-faint); }
.plan-chip-btn:hover .plan-chip-plus { color: var(--c-brand-500); }

/* ═══ Collapsible sub-sections (Routines / Saved blocks) ══════════ */
.plan-sub {
  border-radius: var(--r-lg);
  background: var(--c-bg-soft);
  overflow: hidden;
}
.plan-sub-head {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  cursor: pointer; list-style: none;
  user-select: none;
}
.plan-sub-head::-webkit-details-marker { display: none; }
.plan-sub-head:hover { background: var(--c-line-soft); }
.plan-sub-title { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); }
.plan-sub-note { flex: 1 1 auto; font-size: var(--fs-xs); color: var(--c-text-mute); }
.plan-sub-chev {
  flex: 0 0 auto; width: 16px; height: 16px; color: var(--c-text-mute);
  transition: transform var(--t-base) var(--ease-out);
}
.plan-sub[open] .plan-sub-chev { transform: rotate(180deg); }
.plan-sub-body {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: 0 var(--s-4) var(--s-4);
}

/* Saved routines / blocks read as tags — they're a library, not a to-do list. */
.plan-taglist { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.plan-tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 5px 6px 5px 12px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-soft);
}
.plan-tag-text { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-tag-x {
  width: 20px; height: 20px; padding: 0; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 50%;
  color: var(--c-text-faint); font-size: 11px; cursor: pointer;
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.plan-tag-x:hover { color: var(--c-err); background: var(--c-bg-soft); }
.plan-tag-empty {
  font-size: var(--fs-xs); color: var(--c-text-mute); font-style: italic;
  padding: var(--s-2) 0;
}

/* ═══ Narrow screens ══════════════════════════════════════════════ */
@media (max-width: 720px) {
  .plan-hero, .plan-panel { padding: var(--s-4); }
  .plan-hero-row { flex-direction: column; align-items: stretch; gap: var(--s-4); }
  .plan-progress { justify-content: space-between; }
  .plan-progress-text { align-items: flex-start; text-align: left; }

  /* Icon-only tabs would be a guessing game; keep labels, drop the counts. */
  .plan-tab { padding: 10px var(--s-2); font-size: var(--fs-xs); gap: 6px; }
  .plan-tab-count { display: none; }

  .plan-slot { grid-template-columns: 50px 14px 1fr; gap: var(--s-2); }
  .plan-slot-time { font-size: 11px; }
  .plan-prio { padding: var(--s-3) var(--s-4); gap: var(--s-3); flex-wrap: wrap; }
  .plan-prio-title { flex-basis: 100%; order: 3; }
  .plan-add { flex-wrap: wrap; }
  .plan-add-input { flex-basis: 100%; }
  .plan-add-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-ring, .plan-slot-dot, .plan-sub-chev { transition: none; }
  .plan-slot.is-now .plan-slot-dot { animation: none; }
}
