/* Planner & results UI components (loaded after styles.css). */
.topbar { justify-content: space-between; }
.step-nav { display: flex; gap: 6px; overflow-x: auto; }
.step-pill {
  display: flex; align-items: center; gap: 6px; border: 1px solid rgba(231, 223, 243, .14); background: rgba(231, 223, 243, .04); color: var(--pale60);
  border-radius: 999px; padding: 5px 12px 5px 5px; font: 500 .82rem var(--body); cursor: pointer; white-space: nowrap;
}
.step-pill span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(231, 223, 243, .1); font-size: .75rem; }
.step-pill:hover:not(:disabled) { color: var(--pale); border-color: rgba(231, 223, 243, .3); }
.step-pill.done { color: var(--pale); }
.step-pill.done span { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.step-pill:disabled { opacity: .45; cursor: default; }

.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 400; font-size: .9rem; }
.field .label { font-weight: 600; font-size: .9rem; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper output { font: 700 1.6rem var(--disp); min-width: 2ch; text-align: center; }
.btn.icon { width: 40px; height: 40px; padding: 0; font-size: 1.2rem; border-radius: 50%; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px;
  font: 500 .88rem var(--body); cursor: pointer;
}
.segmented button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.search-box { position: relative; margin-top: 6px; }
.search-box input { width: 100%; }
.suggest { display: flex; flex-direction: column; margin-top: 4px; border-radius: 10px; overflow: hidden; }
.suggest:empty { display: none; }
.suggest button, .suggest > span {
  text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  padding: 8px 12px; font: inherit; cursor: pointer;
}
.suggest button:hover { background: var(--accent-soft); }
.suggest small { color: var(--muted); }
.warn-text { color: var(--warn); }

.pace-card { display: flex; flex-direction: column; gap: 3px; }
.pace-icon { font-size: 1.6rem; }
.pace-card .pace-hours { color: var(--accent); font-weight: 600; font-size: .9rem; }

.exp { grid-template-columns: auto auto 1fr; }
.exp-time { font: 600 .9rem var(--body); font-variant-numeric: tabular-nums; color: var(--accent-text); padding-top: 1px; }
.advanced { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 12px; }
.advanced summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.advanced .field { margin-bottom: 12px; }

.skeleton {
  height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));
  background-size: 200% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.action-bar {
  position: sticky; bottom: 0; z-index: 900; display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(40, 30, 20, .08);
  padding: 12px max(24px, calc((100vw - 1320px) / 2 + 24px));
}
.action-bar .btn.big { margin: 0; white-space: nowrap; }
.action-summary { font-size: .9rem; color: var(--muted); }
.action-summary b { color: var(--ink); }

.loading { position: fixed; inset: 0; background: rgba(21, 14, 34, .55); display: grid; place-items: center; z-index: 2000; }
.loading-card {
  background: var(--surface); border-radius: var(--radius); padding: 24px 28px; display: grid; justify-items: center; gap: 8px;
  min-width: 260px; box-shadow: var(--shadow); text-align: center;
}
.loading-card span { color: var(--muted); font-size: .88rem; min-height: 1.3em; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; transition: .25s;
  z-index: 2100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.notice { border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.notice.error { border-color: #e03131; background: color-mix(in srgb, #e03131 8%, var(--surface)); }

/* results */
.overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.ov-card {
  text-align: left; font: inherit; color: var(--ink); cursor: pointer; background: var(--surface); border: 1px solid var(--line);
  border-top: 4px solid var(--day-color); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.ov-card:hover { box-shadow: var(--shadow); }
.ov-day { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--day-color); font-weight: 600; }
.ov-card b { font-family: var(--disp); font-size: 1.02rem; line-height: 1.25; }
.ov-areas { font-size: .8rem; color: var(--muted); }
.ov-meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.ov-meter i { display: block; height: 100%; background: var(--day-color); }
.ov-meta { font-size: .78rem; color: var(--muted); }
.day-tab[aria-pressed="true"] { background: var(--day-color, var(--ink)); border-color: var(--day-color, var(--ink)); color: #fff; }

.badge { font-size: .74rem; border-radius: 999px; padding: 2px 9px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.est { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); cursor: help; }
.badge.bad { background: #e03131; color: #fff; }
.tl li.area-row .body { padding: 14px 0 4px 16px; font-size: .88rem; color: var(--day-color, var(--accent)); }
.tl li.area-row .body::before { display: none; }
.tl li.area-row b { color: var(--ink); }
.stop-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.mini {
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 2px 8px;
  font: 500 .74rem var(--body); cursor: pointer; white-space: nowrap;
}
.mini:hover { color: #e03131; border-color: #e03131; }
.chip.small { padding: 4px 10px; font-size: .82rem; }
.chip.static { cursor: default; }
.skip-box .chips { margin-top: 8px; }
details.day-note summary { cursor: pointer; color: var(--ink); font-weight: 500; }
details.day-note ul { margin: 6px 0 0; padding-left: 1.2rem; }
details.day-note li { margin: 3px 0; }

/* day editing: add / move places, closed-on-arrival highlight */
.day-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.btn-edit { font-size: .8rem; }
.btn-edit[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.edited-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .68rem; letter-spacing: .04em; }
.edit-panel {
  margin: 0 18px 12px; padding: 12px 14px; border: 1.5px dashed var(--accent); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.edit-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.edit-panel-head small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.edit-panel .edit-search { width: 100%; margin-top: 10px; }
.suggest .suggest-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; cursor: default; padding: 6px 12px; }
.hrs { font-size: .76rem; color: var(--ok); white-space: nowrap; text-align: right; }
.hrs.shut { color: #e03131; font-weight: 600; }
.edit-panel-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.order-btns { display: inline-flex; gap: 4px; }
.order-btns .mini { font-size: .9rem; padding: 1px 9px; color: var(--ink); border-color: var(--accent); }
.order-btns .mini:hover:not(:disabled) { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.order-btns .mini:disabled { opacity: .3; cursor: default; }
.stop-tools {display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.move-to { display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.move-to select { font: 500 .78rem var(--body); padding: 3px 6px; border-radius: 8px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--ink); }
.tl li.closed .body, .tl li.closed:hover .body {
  background: color-mix(in srgb, #e03131 10%, transparent); border-left-color: #e03131; border-radius: 0 10px 10px 0;
}
.tl li.closed .body::before { background: #e03131 !important; }
.tl li.closed .time { color: #e03131; font-weight: 700; }
.tl li.closed .stop-name { color: #e03131; }
.closed-msg {
  display: flex; flex-direction: column; gap: 2px; margin: 8px 12px 4px 0; padding: 8px 12px; border-radius: 8px;
  border-left: 4px solid #e03131; background: color-mix(in srgb, #e03131 14%, var(--surface)); font-size: .85rem;
}
.closed-msg b { color: #e03131; }
.ov-closed { font-size: .78rem; font-weight: 700; color: #e03131; }
.num-marker.closed { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #e03131; }
.tl li.flash .body { animation: flashRow 2s ease-out; }
@keyframes flashRow { 0%, 30% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 2px transparent; } }

@media (max-width: 600px) {
  .step-nav { display: none; }
  .stop-head { flex-wrap: wrap; }
  .action-bar { flex-direction: column; align-items: stretch; padding: 10px 16px; }
  .action-bar .btn.big { width: 100%; }
}
@media print {
  .mini, .action-bar, #skipped, .overview, #notices, .day-actions, .edit-panel, .move-to { display: none !important; }
}
