/* Plan screen styles (js/screens/plan.js). Owned by that screen only.
   Phone: controls on top, the plan below; only the timeline scrolls.
   Laptop: controls and Tim's plans on the left, the plan + a map sketch on the right. */

.pl-pane { display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding-bottom: 10px; }
.pl-side { flex: none; display: flex; flex-direction: column; gap: 8px; }

/* day chips */
.pl-days button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 38px; line-height: 1.1; font-size: var(--fs-md); padding: 0; }
.pl-days small { font-size: var(--fs-xs); font-weight: 600; opacity: .8; }

/* start / budget / vibe / from */
.pl-opts { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1.1fr; gap: 6px; }
.pl-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  height: 44px;
  padding: 3px 9px 4px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  transition: background var(--t), transform 100ms;
}
.pl-opt:active { transform: scale(.97); }
.pl-opt small { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-faint); line-height: 1.1; }
.pl-opt input, .pl-opt select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}
.pl-opt input::-webkit-date-and-time-value { text-align: left; }
.pl-opt input:focus, .pl-opt select:focus { outline: none; }
.pl-opt:focus-within { border-color: var(--accent); }
.pl-near span { display: flex; align-items: center; gap: 3px; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.pl-near svg { width: 15px; height: 15px; flex: none; }
.pl-near[aria-pressed="true"] { border-color: var(--accent); }
.pl-near[aria-pressed="true"] span { color: var(--accent); }

/* Tim's plans */
.pl-tim { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pl-tim .sec-head { flex: none; padding: 0; }
.pl-tim-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.pl-tim-list::-webkit-scrollbar { display: none; }
.pl-chip {
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  line-height: 1.15;
  transition: background var(--t), transform 100ms;
}
.pl-chip:active { transform: scale(.96); }
.pl-chip-name { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; }
.pl-chip-sub { display: none; font-size: var(--fs-sm); color: var(--ink-faint); white-space: nowrap; }
.pl-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pl-chip[aria-pressed="true"] .pl-chip-sub { color: var(--accent-ink); }

/* the plan */
.pl-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-none { padding-top: 12px; }
.pl-sum { flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; padding: 2px 0 4px; border-bottom: 1px solid var(--rule); font-size: var(--fs-md); color: var(--ink-soft); white-space: nowrap; }
.pl-sum strong { font-size: 19px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-sum span:first-child strong { color: var(--accent); }
.pl-dot { color: var(--ink-faint); }
.pl-over { font-size: var(--fs-sm); font-weight: 700; color: var(--danger); }
.pl-preset-tag { margin-left: auto; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }
.pl-wx { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pl-preset-tag + .pl-wx { margin-left: 4px; }
.pl-wx svg { width: 17px; height: 17px; }

.pl-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pl-tl { list-style: none; margin: 0; padding: 0; }
.pl-stop { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 0; }
.pl-time { flex: none; width: 46px; display: flex; flex-direction: column; font-size: var(--fs-lg); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pl-time small { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-faint); }
.pl-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.pl-name { font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.pl-name:active { color: var(--accent); }
.pl-sub { font-size: var(--fs-md); color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub.has-deal { color: var(--accent); }
.pl-cost { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-swap { margin-right: -6px; color: var(--ink-faint); }
.pl-drive {
  position: relative;
  padding: 1px 0 1px 56px;
  font-size: var(--fs-sm);
  color: var(--ink-faint);
}
.pl-drive::before { content: ""; position: absolute; left: 20px; top: 2px; bottom: 2px; border-left: 2px dotted var(--rule); }
.pl-map { display: none; }

.pl-bw { flex: none; display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-md); color: var(--ink-soft); }
.pl-bw p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-bw p.pl-talk { display: flex; white-space: normal; }
.pl-talk .pl-k { flex: none; padding-top: 2px; }
.pl-k { display: inline-block; width: 46px; margin-right: 10px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.pl-actions { flex: none; gap: 8px; }
.pl-actions .btn { flex: 1 1 auto; gap: 6px; padding: 0 10px; text-decoration: none; font-size: var(--fs-md); white-space: nowrap; }
.pl-actions .btn[disabled] { opacity: .75; }

/* save (bookmark in the summary row): filled gold when this plan is saved */
.pl-save { flex: none; margin: -4px -6px -4px auto; color: var(--ink-faint); }
.pl-wx + .pl-save, .pl-preset-tag + .pl-save { margin-left: 0; }
.pl-save[aria-pressed="true"] { color: var(--accent); }
.pl-save[aria-pressed="true"] svg { fill: var(--accent); }

/* ... menu: Calendar and Send float above the button, so nothing moves */
.pl-more { position: relative; flex: none; display: flex; }
.pl-actions .pl-more-btn { flex: none; width: 44px; padding: 0; }
.pl-more-btn[aria-expanded="true"] { background: var(--raised-hi); }
.pl-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 4px;
  border-radius: var(--r);
  background: var(--raised-hi);
  box-shadow: 0 8px 24px -6px rgb(0 0 0 / .6);
  animation: fade-in var(--t) var(--ease-out);
}
.pl-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 6px; font-size: var(--fs-lg); color: var(--ink); text-align: left; white-space: nowrap; }
.pl-menu button:active { background: var(--raised); }
.pl-menu svg { width: 18px; height: 18px; flex: none; color: var(--ink-soft); }

/* Card link in the top bar */
.pl-card-link { display: flex; align-items: center; padding: 0 8px; font-size: var(--fs-md); font-weight: 600; text-decoration: none; }
.pl-card-link:active { color: var(--accent); }

/* Laptop: controls left, plan + map sketch right. */
@media (min-width: 860px) {
  .pl-pane { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 40px; align-content: start; max-width: 1320px; height: 100%; }
  .pl-side { gap: 14px; }
  .pl-days button { min-height: 46px; }
  .pl-opts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pl-opt { height: 52px; }
  .pl-tim { flex-direction: column; align-items: stretch; gap: 4px; margin-top: 6px; }
  .pl-tim-list { flex-direction: column; overflow: visible; gap: 2px; }
  .pl-chip { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r); border-color: transparent; background: none; }
  .pl-chip:hover { background: var(--surface); }
  .pl-chip[aria-pressed="true"]:hover { background: var(--accent); }
  .pl-chip-sub { display: block; }
  .pl-main { height: 100%; gap: 12px; }
  .pl-sum { gap: 8px; padding-bottom: 10px; font-size: var(--fs-lg); }
  .pl-sum strong { font-size: 28px; }
  .pl-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 28px; align-content: start; }
  .pl-stop { min-height: 58px; }
  .pl-time { width: 58px; font-size: 17px; }
  .pl-name { font-size: 17px; }
  .pl-drive { padding-left: 68px; }
  .pl-drive::before { left: 24px; }
  .pl-map { display: block; width: 100%; height: auto; background: var(--surface); border-radius: 14px; }
  .pl-map-t { font-size: 11px; fill: var(--ink-soft); font-family: var(--sans); }
  .pl-map-n { font-size: 11px; font-weight: 700; fill: var(--accent-ink); font-family: var(--sans); }
  .pl-bw { font-size: var(--fs-lg); gap: 4px; }
  .pl-k { width: 56px; }
  .pl-actions { max-width: 560px; }
  .pl-actions .btn { font-size: var(--fs-lg); }
}
