.mp-datebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mp-arrow {
  font: inherit; font-size: 24px; line-height: 1; width: 42px; height: 42px; flex: none; cursor: pointer;
  color: var(--text); background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
}
.mp-arrow:hover { border-color: var(--accent); }
.mp-date-wrap { position: relative; }
.mp-date-big {
  font: inherit; font-size: 21px; font-weight: 800; color: var(--text); cursor: pointer;
  background: none; border: 0; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); padding: 2px 2px 3px;
}
.mp-date-big:hover, .mp-date-big[aria-expanded="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.mp-date-caret { font-size: 13px; margin-inline-start: 8px; color: var(--accent); }

/* Calendar popover: dark panel with the app's dot texture, days as dots */
.mp-cal {
  position: absolute; z-index: 20; top: calc(100% + 10px); inset-inline-start: 0; width: 300px; padding: 14px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1.5px) 0 0 / 10px 10px,
    var(--bg);
  border: 1px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 18%, transparent), 0 18px 40px rgba(0,0,0,0.7);
}
.mp-cal[hidden] { display: none; }
.mp-cal button { font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; }
.mp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-cal-head b { font-size: 15px; letter-spacing: .04em; }
.mp-cal-head button {
  width: 32px; height: 32px; border-radius: 50%; font-size: 18px; border: 1px solid var(--border) !important;
}
.mp-cal-head button:hover { border-color: var(--accent) !important; color: var(--accent); }
.mp-cal-week, .mp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mp-cal-week span { font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.mp-cal-grid button {
  position: relative; aspect-ratio: 1; border-radius: 50%; font-size: 13.5px; font-weight: 700;
  background: rgba(255,255,255,0.035) !important;
}
.mp-cal-grid button:hover, .mp-cal-grid button:focus-visible { outline: none; background: color-mix(in srgb, var(--accent) 14%, transparent) !important; color: var(--accent); }
.mp-cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--accent-2); color: var(--accent-2); }
.mp-cal-grid button.sel {
  background: var(--accent) !important; color: var(--bg) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 16px color-mix(in srgb, var(--accent) 65%, transparent);
}
.mp-cal-today {
  display: block; width: 100%; margin-top: 10px; padding: 8px; border-radius: calc(var(--radius) - 2px); font-size: 13px; font-weight: 700;
  color: var(--accent-2) !important; border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent) !important;
}
.mp-cal-today:hover { background: color-mix(in srgb, var(--accent-2) 8%, transparent) !important; }

/* Meeting time: date, start and end for every city */
.mp-picked { margin-top: 14px; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.mp-picked-title { font-size: 12.5px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.mp-row-city { font-weight: 800; font-size: 16px; }
.mp-row-day { color: var(--muted); font-size: 14px; }
.mp-row-day.diff { color: var(--amber); }
.mp-row-time { font-size: 24px; font-weight: 800; text-align: end; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mp-btn {
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; border-radius: calc(var(--radius) - 2px); padding: 10px 16px;
  color: var(--text); background: rgba(255,255,255,0.05); border: 1px solid var(--border);
}
.mp-btn.primary { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.mp-calmenu-wrap { position: relative; }
.mp-calmenu {
  position: absolute; z-index: 20; inset-inline-start: 0; bottom: calc(100% + 6px); min-width: 100%; padding: 4px; display: grid; gap: 2px;
  background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
}
.mp-calmenu[hidden] { display: none; }
.mp-calmenu button {
  font: inherit; font-size: 14px; font-weight: 700; text-align: start; white-space: nowrap; cursor: pointer;
  color: var(--text); background: none; border: 0; border-radius: 8px; padding: 9px 12px;
}
.mp-calmenu button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mp-btn:hover { filter: brightness(1.08); }

#mp-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--bg); border: 1px solid var(--accent); color: var(--text); padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
#mp-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .mp-picked { padding: 12px; }
  .mp-date-wrap { flex: 1 1 auto; min-width: 0; text-align: center; position: static; }
  .mp-datebar { position: relative; }
  .mp-date-big { font-size: 16px; line-height: 1.25; }
  .mp-cal { inset-inline-start: auto; left: 50%; transform: translateX(-50%); width: min(320px, calc(100vw - 40px)); top: calc(100% + 6px); }
  .mp-datebar { flex-wrap: nowrap; }
  .mp-row-city { grid-area: city; } .mp-row-time { grid-area: time; font-size: 22px; }
  .mp-row-day { grid-area: day; font-size: 13px; }
  .mp-btn { flex: 1 1 auto; padding: 10px 10px; }
}

/* ---------- Themes (shared with the main map: CYBER / MONO / 8-BIT) ---------- */
body { --sat: #5aa9ff; --sun: #ff5c7a; }
body[data-theme="retro"] :is(.mp-picked, .mp-btn, .mp-cal, .mp-cal-grid button, .mp-arrow, .mp-calmenu, .mp-calmenu button, .mp-cal-head button, .mp-cal-today) { border-radius: 0 !important; }
body[data-theme="retro"] :is(.mp-picked) { border: 2px solid #fff; box-shadow: 4px 4px 0 var(--accent); }
body[data-theme="retro"] :is(h1, .brand, .mp-date-big, .mp-btn, .mp-picked-title, .mp-cal-head b, .mp-row-time) {
  font-family: 'Press Start 2P', ui-monospace, monospace; letter-spacing: 0;
}
body[data-theme="retro"] h1 { font-size: 18px; line-height: 1.6; }
body[data-theme="retro"] .mp-btn { font-size: 10px; line-height: 1.6; }
body[data-theme="retro"] .mp-date-big { font-size: 13px; line-height: 1.7; }
body[data-theme="retro"] .mp-row-time { font-size: 15px; }
/* ---------- Weekend: Saturday blue, Sunday red ---------- */
.we-sat { --we: var(--sat); } .we-sun { --we: var(--sun); }
.we, .mp-row-day.we { color: var(--we) !important; }
.mp-cal-week span.we { color: var(--we); }
.mp-cal-grid button.we:not(.sel) { color: var(--we); }

/* ---------- Available hours: one 24-hour bar per city, in that city's clock ---------- */
.mp-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-presets > button, .mp-preset {
  font: inherit; font-size: 12px; font-weight: 700; border-radius: calc(var(--radius) - 2px);
  color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.mp-presets > button { cursor: pointer; padding: 4px 10px; }
.mp-preset { display: inline-flex; align-items: center; }
.mp-preset button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 4px 4px 4px 10px; }
.mp-preset .mp-preset-x { padding: 4px 8px 4px 4px; font-size: 10px; }
.mp-preset .mp-preset-x:hover { color: #ff6b81; }
.mp-presets > button:hover, .mp-preset:hover { color: var(--text); }
.mp-presets > button.on, .mp-preset.on { color: var(--text); border-color: var(--accent); }
.mp-strip { position: relative; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 22px; touch-action: none; user-select: none; cursor: pointer; }
/* one cell per hour, split by a dashed line into two half-hours */
.mp-hr { display: flex; border-radius: 3px; overflow: hidden; }
.mp-half { flex: 1; background: rgba(255, 255, 255, 0.07); }
.mp-half + .mp-half { border-inline-start: 1px dashed rgba(255, 255, 255, 0.22); }
.mp-half.on { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.mp-half:hover { filter: brightness(1.6); }
/* the meeting time picked below, at its exact minute in each city's day */
.mp-at { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-inline-start: -1px; background: var(--text); border-radius: 1px; pointer-events: none; }
body[data-theme="retro"] :is(.mp-hr, .mp-presets > button, .mp-preset) { border-radius: 0; }

/* ---------- one-timeline planner ---------- */
/* top line of the board: the date on the left, the base city search on the right */
.mp-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.mp-toolbar .mp-datebar { display: flex; align-items: center; gap: 8px; margin: 0; }
.mp-toolbar .mp-date-big { justify-content: space-between; }
.mp-toolbar .yz-actions { margin-inline-start: auto; }
.mp-toolbar .locate-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.mp-board { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.mp-tl { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.mp-tl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.mp-tl-head b { color: var(--accent); font-size: 17px; }
.mp-tl-head .mp-avail-hint { margin-inline-start: 12px; font-size: 12.5px; color: var(--muted); }
/* The timeline reads like a table, but only its header row is framed: a line above and below, open at both ends */
.mp-tl-grid { position: relative; display: grid; grid-template-columns: 206px minmax(0, 1fr); /* the longest city name (Marquesas Islands, 150px in CYBER) fits with its ▾ and ✕ */ margin-top: 4px; }
.mp-tl-grid > .tc { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px 14px; }
/* header row */
/* header row: a fixed 40px so the ticks and the time handle share one centre line (20px) */
.mp-tl-grid > .tc.hd { box-sizing: border-box; height: 40px; padding-top: 0; padding-bottom: 0; margin-bottom: 6px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
/* "Now" once, above the column of local times */
.mp-tl-grid > .tc.hd.corner { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mp-tl-grid > .tc.hd.corner em { font-style: normal; font-size: 11px; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.mp-tl-grid > .tc.hd.hint { font-size: 12px; color: var(--muted); }
.mp-ruler { position: relative; height: 100%; cursor: ew-resize; touch-action: none; user-select: none; }
.mp-ruler span { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 11.5px; color: var(--muted); pointer-events: none; }
.mp-ruler span:first-child { transform: translate(0, -50%); } .mp-ruler span:last-child { transform: translate(-100%, -50%); }
/* city rows */
.tc.nm { line-height: 1.2; }
/* long names wrap onto a second line instead of being cut ("Marquesas / Islands") */
.tc.nm b { font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.tc.nm small { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
/* base city: the world clock's found-city highlight (accent pill, page-colour text), readable in every theme */
.tc.nm.base b { align-self: flex-start; max-width: 100%; color: var(--bg); background: var(--accent); border-radius: 4px; padding: 0 6px; margin-inline-start: -6px; }
.tc.sm { font-size: 13px; color: var(--muted); }
.mp-tl-grid > .tc.sm { display: block; align-content: center; }
.mp-tl-grid .mp-strip { height: 32px; }
/* Everyone row: the answer */
.mp-tl-grid > .tc.all { margin-top: 6px; }
.mp-tl-grid > .tc.nm.all b { font-size: 15px; color: var(--accent); }
.mp-tl-grid > .tc.sm.all { color: var(--accent); font-weight: 700; }
.mp-tl-grid .mp-strip.mp-all { height: 36px; } /* same height as the city bars */
.mp-all { cursor: default; }
.mp-all-half { flex: 1; background: rgba(255, 255, 255, 0.04); }
.mp-all-half.on { background: var(--accent); cursor: pointer; }

.mp-all-half + .mp-all-half { border-inline-start: 1px dashed rgba(255, 255, 255, 0.12); }
.mp-tl-overlay { position: absolute; top: 0; bottom: 0; left: 212px; right: 14px; pointer-events: none; z-index: 2; } /* over the bars: 206px names + 6px inset; 14px padding on the right */
.mp-tl-overlay .mp-at { position: absolute; top: 0; bottom: 0; width: 2px; margin-inline-start: -1px; background: var(--text); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.mp-at-handle {
  position: absolute; top: 20px; left: 50%; transform: translate(-50%, -50%); pointer-events: auto; cursor: ew-resize; touch-action: none;
  font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap; color: var(--bg); background: var(--text);
  border: 0; border-radius: 6px; padding: 3px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.mp-at-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mp-picked-title { font-size: 13px; }
.mp-map-toggle { margin-inline-start: auto; }
.mp-map-wrap { margin-top: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.mp-map-wrap[hidden] { display: none; }
body[data-theme="retro"] :is(.mp-board, .mp-at-handle, .mp-map-wrap, .mp-all-half) { border-radius: 0; }
body[data-theme="retro"] .tc.nm b { font-family: var(--font-pixel); font-size: 12px; }
body[data-theme="retro"] .mp-tl-grid { border-radius: 0; }

/* calendar: month / year pickers */
.mp-cal-title { display: flex; gap: 4px; align-items: center; }
.mp-cal-head .mp-cal-pick { width: auto; height: auto; border: 0 !important; font-size: 15px !important; font-weight: 800; padding: 4px 8px !important; border-radius: 8px; }
.mp-cal-head .mp-cal-pick:hover { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
.mp-cal-range { font-size: 15px; font-weight: 800; }
.mp-cal-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-cal-mgrid button { padding: 12px 0; border-radius: 8px; font-weight: 700; }
.mp-cal-mgrid button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent) !important; color: var(--accent); }
.mp-cal-mgrid button.today { box-shadow: inset 0 0 0 1.5px var(--accent-2); color: var(--accent-2); }
.mp-cal-mgrid button.sel { background: var(--accent) !important; color: var(--bg) !important; }
body[data-theme="retro"] :is(.mp-cal-pick, .mp-cal-mgrid button) { border-radius: 0; }
/* any city name in the timeline can become the base: it shows the base highlight's outline on hover */
.tc.nm b[data-base] { align-self: flex-start; max-width: 100%; cursor: pointer; border-radius: 4px; padding: 0 6px; margin-inline-start: -6px; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s, color .15s; }
.tc.nm b[data-base]:hover, .tc.nm b[data-base]:focus-visible { outline: none; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tc.nm.base b[data-base]:hover, .tc.nm.base b[data-base]:focus-visible { color: var(--bg); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
body[data-theme="retro"] .mp-tl-grid > .tc.nm.all b { font-size: 12px; }
/* saved city sets look like the hour presets; naming happens inline */
.mp-saved .mp-preset button { font-size: 13px; }
.mp-name-form { display: inline-flex; align-items: center; gap: 6px; }
.mp-name-form input {
  font: inherit; font-size: 13px; font-weight: 700; width: 160px; color: var(--text); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent); border-radius: calc(var(--radius) - 2px); padding: 4px 10px; outline: none;
}
.mp-name-form button { font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px 10px; border-radius: calc(var(--radius) - 2px); color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.mp-name-form button[type="submit"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
body[data-theme="retro"] :is(.mp-name-form input, .mp-name-form button) { border-radius: 0; }
/* rename (✎) beside each saved set and hour preset */
.mp-preset .mp-preset-ed { padding: 4px 2px; font-size: 11px; }
.mp-preset .mp-preset-ed:hover { color: var(--accent); }
/* remove a city from its timeline row */
.tc.nm { position: relative; padding-inline-end: 22px !important; }
/* the bar column sits closer to the names (ruler cell and bars share the same 6px inset) */
.mp-tl-grid > .tc:nth-child(2n) { padding-inline-start: 6px; } /* the bar column: ruler cell and bars */
.mp-row-x { position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%); font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px 6px; opacity: .45; }
.mp-row-x:hover, .mp-row-x:focus-visible { opacity: 1; color: #ff6b81; }
/* today's "now" on the timeline: a thin dashed line in the second accent, labelled under the Everyone row */
.mp-now { position: absolute; top: 40px; bottom: 0; width: 0; border-inline-start: 1px dashed var(--accent-2); }
.mp-now .mp-now-top { position: absolute; bottom: -17px; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 700; font-style: normal; color: var(--accent-2); }
/* the board's top line is tighter now that the chip row is gone */
.mp-toolbar { margin-bottom: 8px; }
.mp-saved { margin: 0 0 4px; }
.mp-toolbar #mp-save[hidden] { display: none; }
/* tags on the meeting line: each city's local time at that moment, beside its own row */
.mp-at-tag {
  position: absolute; left: 6px; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  font-size: 11.5px; font-weight: 800; font-style: normal; font-variant-numeric: tabular-nums; line-height: 1;
  padding: 3px 6px; border-radius: 5px; color: var(--text); background: var(--bg); border: 1px solid var(--text);
}
.mp-at-tag.night { color: var(--muted); border-color: var(--border); }
.mp-at.flip .mp-at-tag { left: auto; right: 6px; }
body[data-theme="retro"] .mp-at-tag { border-radius: 0; font-size: 10px; }
/* City cell: name + ✕ are one pill on one line (16px; a long name ends in "…" and shows in full on hover), "Now" right under it */
.tc.nm { padding-inline-end: 8px !important; }
.nm-top { display: flex; min-width: 0; }
.nm-pill { display: inline-flex; align-items: center; min-width: 0; max-width: calc(100% + 6px); margin-inline-start: -6px; padding: 1px 2px 1px 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s; }
.nm-name { min-width: 0; font: inherit; font-size: 16px; font-weight: 700; line-height: 1.3; text-align: start; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-pill .mp-row-x { position: static; transform: none; flex: none; font-size: 10px; padding: 2px 4px; margin-inline-start: 2px; color: inherit; opacity: .45; }
.nm-pill .mp-row-x:hover, .nm-pill .mp-row-x:focus-visible { opacity: 1; color: #ff6b81; }
.nm-pill:hover, .nm-pill:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
.nm-pill:hover .nm-name, .nm-name:focus-visible { color: var(--accent); outline: none; }
/* base city: the found-city highlight, ✕ included */
.tc.nm.base .nm-pill { background: var(--accent); }
.tc.nm.base .nm-name, .tc.nm.base .nm-pill:hover .nm-name, .tc.nm.base .mp-row-x { color: var(--bg); }
.tc.nm.base .nm-pill:hover, .tc.nm.base .nm-pill:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.tc.nm small { margin-top: 2px; font-size: 12px; }
.mp-tl-grid .mp-strip:not(.mp-all) { height: 36px; }
.mp-tl-grid > .tc.nm.all b { font-size: 14px; }
body[data-theme="retro"] .nm-name { font-family: var(--font-pixel); font-size: 11px; line-height: 1.5; }
body[data-theme="retro"] .nm-pill { border-radius: 0; }
.tc.nm.all small { color: var(--accent); font-weight: 700; }
.mp-presets .mp-save-pre { color: var(--accent); border-style: dashed; }
/* "Cities" and "Hours" rows share one layout: label, saved items, and their actions on the right */
.mp-setrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.mp-setrow .mp-saved-label { min-width: 52px; margin: 0; }
.mp-setrow .mp-presets { flex: 1; min-width: 0; }
.mp-setrow-acts { display: flex; gap: 6px; margin-inline-start: auto; }
.mp-act {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px 10px; border-radius: calc(var(--radius) - 2px);
  color: var(--text); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.mp-act:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mp-act:disabled { opacity: .35; cursor: default; }
.mp-none { font-size: 12px; color: var(--muted); opacity: .7; }
.mp-tl-head { margin-bottom: 8px; }
body[data-theme="retro"] .mp-act { border-radius: 0; }
/* one section: date + saved cities on the first line, hour presets on the second, then the timeline */
.mp-toolbar { margin-bottom: 12px; }
.mp-toolbar .mp-datebar { gap: 6px; }
.mp-toolbar .mp-date-big { margin-inline-start: 0; }
.mp-toolbar-sets { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-inline-start: auto; }
.mp-toolbar-sets .mp-presets { justify-content: flex-end; }
.mp-tl { margin-top: 0; padding-top: 0; border-top: 0; }
.mp-tl-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
/* reordering: the row being dragged */
.tc.nm .nm-name[data-base]:not([data-base="0"]) { cursor: grab; }
.tc.nm.moving .nm-pill { box-shadow: inset 0 0 0 1px var(--accent), 0 6px 18px rgba(0, 0, 0, .45); }
body.mp-dragging, body.mp-dragging * { cursor: grabbing !important; }
/* no cities yet */
.mp-empty { padding: 28px 0 18px; text-align: center; color: var(--muted); font-size: 14px; }
.mp-empty p { margin: 0 0 12px; }
/* date: arrows either side, smaller than before */
.mp-toolbar .mp-arrow { width: 32px; height: 32px; font-size: 18px; }
.mp-toolbar .mp-date-big { margin-inline-start: 0; text-align: center; justify-content: center; }
/* every city row has the same height in every theme */
.mp-tl-grid > .tc.nm:not(.all) { box-sizing: border-box; height: 84px; }
/* per-city hours menu */
.nm-hours-wrap { position: relative; margin-top: 4px; }
.nm-hours { font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 1px 7px; border-radius: 4px; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-hours:hover, .nm-hours[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.nm-menu { position: absolute; z-index: 30; inset-inline-start: 0; top: calc(100% + 4px); min-width: 150px; padding: 4px; display: grid; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); box-shadow: 0 14px 30px rgba(0, 0, 0, .6); }
.nm-menu button { font: inherit; font-size: 13px; font-weight: 700; text-align: start; white-space: nowrap; cursor: pointer; color: var(--text); background: none; border: 0; border-radius: 6px; padding: 7px 10px; }
.nm-menu button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.mp-at-handle { text-align: center; }
body[data-theme="retro"] :is(.nm-hours, .nm-menu, .nm-menu button) { border-radius: 0; }
/* Saved cities: one menu on the date line */
.mp-dd { position: relative; margin-inline-start: auto; }
.mp-dd-menu { position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); width: 300px; padding: 6px; display: grid; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); box-shadow: 0 14px 30px rgba(0, 0, 0, .6); }
.mp-dd-menu[hidden] { display: none; }
.mp-dd-item { display: flex; align-items: center; border-radius: 6px; }
.mp-dd-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mp-dd-item.on .mp-dd-open { color: var(--accent); }
.mp-dd-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; font: inherit; font-size: 13px; font-weight: 700; text-align: start; cursor: pointer; color: var(--text); background: none; border: 0; padding: 6px 8px; }
.mp-dd-open small { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mp-dd-item .mp-preset-ed, .mp-dd-item .mp-preset-x { font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 6px; }
.mp-dd-item .mp-preset-ed:hover { color: var(--accent); } .mp-dd-item .mp-preset-x:hover { color: #ff6b81; }
.mp-dd-none { font-size: 12px; color: var(--muted); padding: 6px 8px; }
.mp-dd-sep { height: 1px; margin: 4px 2px; background: var(--border); }
.mp-dd-save { font: inherit; font-size: 13px; font-weight: 700; text-align: start; cursor: pointer; color: var(--accent); background: none; border: 0; border-radius: 6px; padding: 7px 8px; }
.mp-dd-save:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mp-dd-save:disabled { color: var(--muted); opacity: .6; cursor: default; }
.mp-dd-menu .mp-name-form, .nm-menu .mp-name-form { padding: 4px; flex-wrap: wrap; }
.mp-dd-menu .mp-name-form input, .nm-menu .mp-name-form input { width: 100%; }
/* hour presets: one line — names shortened, ✎ ✕ appear over the button on hover */
.mp-setrow .mp-presets { flex-wrap: nowrap; overflow: hidden; }
.mp-setrow .mp-preset { position: relative; flex: none; }
/* saved cities and hour presets: the same button width — long names end in "…" (full name on hover) */
.mp-setrow .mp-preset :is([data-preset], [data-open-set]) { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-end: 10px; }
.mp-setrow .mp-preset .mp-preset-ed, .mp-setrow .mp-preset .mp-preset-x { display: none; }
.mp-setrow .mp-preset:hover .mp-preset-ed, .mp-setrow .mp-preset:hover .mp-preset-x, .mp-setrow .mp-preset:focus-within .mp-preset-ed, .mp-setrow .mp-preset:focus-within .mp-preset-x { display: block; position: absolute; top: 50%; transform: translateY(-50%); background: var(--bg); border-radius: 4px; }
.mp-setrow .mp-preset:hover .mp-preset-ed, .mp-setrow .mp-preset:focus-within .mp-preset-ed { right: 22px; }
.mp-setrow .mp-preset:hover .mp-preset-x, .mp-setrow .mp-preset:focus-within .mp-preset-x { right: 2px; }
/* city cell: two lines again — the hours menu opens from ▾ next to the name */
.mp-tl-grid > .tc.nm:not(.all) { height: 62px; }
.nm-pill .nm-caret { flex: none; font: inherit; font-size: 13px; line-height: 1; padding: 2px 4px; margin-inline-start: 4px; color: inherit; background: none; border: 0; cursor: pointer; opacity: .85; }
.nm-pill .nm-caret:hover, .nm-pill .nm-caret[aria-expanded="true"] { opacity: 1; color: var(--accent); }
.tc.nm.base .nm-pill .nm-caret { color: var(--bg); }
.nm-menu { top: 30px; left: 8px; min-width: 190px; }
.nm-menu button { display: flex; align-items: center; gap: 6px; }
.nm-check { display: inline-block; width: 12px; color: var(--accent); }
body[data-theme="retro"] :is(.mp-dd-menu, .mp-dd-item, .mp-dd-open, .mp-dd-save) { border-radius: 0; }
/* third line: the hours this city uses (Daylight, a preset name, Custom, None) */
.tc.nm small.nm-mode { margin-top: 1px; font-size: 11.5px; font-weight: 700; color: var(--accent-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* second line of a city: its local time now and its hours picker */
.nm-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; min-width: 0; }
.nm-sub small { margin: 0 !important; flex: none; }
/* fixed width: a long preset name is cut with "…", the ▾ always stays visible */
.nm-sub .nm-hours { display: inline-flex; align-items: center; gap: 4px; flex: none; width: 104px; max-width: none; min-width: 0; margin: 0; padding: 0 6px; font-size: 11px; line-height: 17px; color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }
.nm-menu { top: 46px; }
/* rows above the timeline: cities, then hours */
.mp-setrow + .mp-tl, .mp-toolbar + .mp-setrow { margin-top: 0; }
.mp-setrow-acts .mp-dd { position: relative; margin: 0; }
.mp-setrow-acts .mp-dd-menu { width: 260px; }
.mp-dd-save small { font-weight: 500; color: var(--muted); }
.nm-hours-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.nm-hours-caret { flex: none; }
/* "Now": the corner label, each city's local time and the dashed Now line share one colour, so they read as one thing */
.mp-tl-grid > .tc.hd.corner { color: var(--accent-2); }
.nm-sub small[data-now] { color: var(--accent-2); }
.nm-sub .nm-hours { color: var(--text); border-color: var(--border); }
.nm-sub .nm-hours:hover, .nm-sub .nm-hours[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
/* 1. what is in use is filled with the accent (like the base city in the timeline) */
.mp-setrow .mp-presets > button.on, .mp-setrow .mp-preset.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.mp-setrow .mp-preset.on button { color: var(--bg); }
.mp-setrow .mp-preset.on:hover .mp-preset-ed, .mp-setrow .mp-preset.on:hover .mp-preset-x { background: var(--accent); }
/* 2. Save cities / Save hours / Reset step back: text buttons, so the saved items lead */
.mp-setrow-acts .mp-act { border-color: transparent; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.mp-setrow-acts .mp-act:hover:not(:disabled) { border-color: transparent; color: var(--accent); }
.mp-setrow-acts .mp-act:disabled { text-decoration: none; }
/* Now: label on top of its dashed line, in the header row (the meeting-time handle sits above it when they meet) */
.mp-now { top: 0 !important; }
.mp-now .mp-now-top { bottom: auto !important; top: 20px; transform: translate(-50%, -50%) !important; padding: 2px 5px; border-radius: 4px; background: var(--bg); border: 1px solid var(--accent-2); font-size: 10px; line-height: 1; }
.mp-tl-overlay .mp-at { z-index: 1; }
/* Now line: "Now" on top, each city's local time now beside its row (same look as the meeting line's tags, in the Now colour) */
.mp-now .mp-now-top { position: absolute; top: 20px; left: 0; transform: translate(-50%, -50%); }
.mp-now-tag {
  position: absolute; right: 6px; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  font-size: 11px; font-weight: 800; font-style: normal; font-variant-numeric: tabular-nums; line-height: 1;
  padding: 3px 6px; border-radius: 5px; color: var(--accent-2); background: var(--bg); border: 1px dashed var(--accent-2);
}
.mp-now.right .mp-now-tag { right: auto; left: 6px; }

body[data-theme="retro"] .mp-now-tag { border-radius: 0; font-size: 10px; }
/* each city's local time now: the same colour as the dashed Now line (no extra label) */
.nm-now-t { display: inline-block; min-width: var(--now-w, 0); }
.nm-sub .nm-hours { flex: 1 1 auto; width: auto; min-width: 0; max-width: 104px; }
/* name boxes: live "n/19" count, red under the 2-character minimum */
.mp-name-count { flex: none; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 34px; text-align: end; }
.mp-name-count.short { color: #ff6b81; }
.mp-dd-menu .mp-name-form .mp-name-count, .nm-menu .mp-name-form .mp-name-count { order: 1; }
/* saved-city and preset buttons: at least 76px wide, name on the left — ✎ ✕ (shown on hover at the right) never cover a short name */
.mp-setrow .mp-preset :is([data-preset], [data-open-set]) { min-width: 76px; text-align: start; }
/* Daylight has the same minimum width as the saved buttons */
.mp-setrow .mp-presets > button[data-preset="sun"] { min-width: 76px; }
/* messages look and sit like the world clock's (centre of the screen) */
#mp-toast {
  left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%) scale(.96); z-index: 200;
  padding: 14px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--accent);
  font-size: 14px; font-weight: 700; box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 18px var(--accent-glow);
  transition: opacity .18s ease, transform .18s ease;
}
#mp-toast.show { transform: translate(-50%, -50%) scale(1); }
/* Save hours: name box first, then the city whose bar is saved */
.mp-savehours { width: 330px; }
.mp-from { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 4px 2px; }
.mp-from span { font-size: 11px; font-weight: 700; color: var(--muted); margin-inline-end: 4px; text-transform: uppercase; letter-spacing: .05em; }
.mp-from-btn { font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 3px 8px; border-radius: 6px; color: var(--text); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.mp-from-btn.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.mp-from-note { font-size: 11.5px; color: var(--muted); padding: 2px 4px 4px; }
.mp-from-note.warn { color: #ff6b81; }
.mp-name-form button[type="submit"]:disabled { opacity: .4; cursor: default; }
/* meeting length */
.mp-picked-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mp-picked-head .mp-picked-title { margin: 0; }
.mp-dur { display: flex; flex-wrap: wrap; gap: 4px; }
.mp-dur-btn { font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 3px 9px; border-radius: 6px; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.mp-dur-btn:hover { color: var(--text); }
.mp-dur-btn.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.mp-row-time small { font-size: 11px; color: var(--amber); margin-inline-start: 4px; }
/* the meeting on the timeline: shaded from its start line to its end */
.mp-dur-band { position: absolute; top: 40px; bottom: 0; background: color-mix(in srgb, var(--text) 10%, transparent); border-inline-end: 1px solid color-mix(in srgb, var(--text) 45%, transparent); pointer-events: none; }
body[data-theme="retro"] :is(.mp-from-btn, .mp-dur-btn) { border-radius: 0; }
/* meeting end: a handle at the bottom of the timeline (the start's handle is at the top) */
.mp-end { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; z-index: 1; }
.mp-end[hidden] { display: none; }
.mp-end-handle {
  position: absolute; bottom: -12px; left: 0; transform: translate(-50%, 50%); pointer-events: auto; cursor: ew-resize; touch-action: none;
  font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap; text-align: center; color: var(--text); background: var(--bg);
  border: 1px solid var(--text); border-radius: 6px; padding: 3px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.mp-end-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mp-tl-hint { margin-top: 22px !important; }
.mp-dur-now { font-size: 12px; font-weight: 800; color: var(--text); margin-inline-end: 6px; align-self: center; }
/* meeting rows: tighter, one colour for dates, a dim row when a city is not free for the whole meeting */
.mp-row { padding: 6px 0; }
.mp-row-time { font-size: 18px; }
/* meeting dates: muted, Saturday blue and Sunday red (the only colours used for dates, as on the calendar) */
.mp-row-day, .mp-row-day.diff { color: var(--muted) !important; }
.mp-row-day.we { color: var(--we) !important; }
.mp-row.night { opacity: .5; }
body[data-theme="retro"] .mp-end-handle { border-radius: 0; }
/* MEETING TIME, compact: title + actions, then the length, then the cities three to a row */
.mp-picked .mp-picked-head { margin-bottom: 10px; }
.mp-picked .mp-actions { margin: 0; }
.mp-picked .mp-dur { margin-bottom: 12px; align-items: center; }
.mp-dur-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-inline-end: 8px; }
.mp-picked-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mp-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: rgba(255, 255, 255, 0.02); }
.mp-cell .mp-row-city { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-cell .mp-row-day { font-size: 12px; }
.mp-cell .mp-row-time { font-size: 17px; font-weight: 800; text-align: start; font-variant-numeric: tabular-nums; } /* long 12-hour forms ("10:00 a. m.") may wrap after the dash */
.mp-cell.night { opacity: .45; }
body[data-theme="retro"] .mp-cell { border-radius: 0; }
body[data-theme="retro"] .mp-cell .mp-row-time { font-size: 13px; }
/* MEETING TIME: a bigger title, smaller action buttons */
.mp-picked .mp-picked-title { font-size: 16px; letter-spacing: .05em; }
.mp-picked .mp-actions .mp-btn { font-size: 12px; padding: 6px 11px; }
body[data-theme="retro"] .mp-picked .mp-picked-title { font-size: 13px; }
body[data-theme="retro"] .mp-picked .mp-actions .mp-btn { font-size: 9px; }
/* the hours picker under each city: narrower */
.nm-sub .nm-hours { max-width: 84px; }
/* the meeting line's city times sit ON the white line, filled white like its top handle (the end handle stays outlined) */
.mp-tl-overlay .mp-at .mp-at-tag, .mp-tl-overlay .mp-at.flip .mp-at-tag { left: 0; right: auto; transform: translate(-50%, -50%); color: var(--bg); background: var(--text); border-color: var(--text); }
.mp-tl-overlay .mp-at .mp-at-tag.night { color: var(--bg); background: var(--muted); border-color: var(--muted); }
/* length: the current length on the left, quick choices on the right */
.mp-picked .mp-dur { justify-content: space-between; }
.mp-dur-cur { display: inline-flex; align-items: baseline; }
.mp-dur-cur .mp-dur-now { font-size: 15px; }
.mp-dur-quick { display: inline-flex; flex-wrap: wrap; gap: 4px; }
/* meeting length: quick choices under the Everyone bar (right), the length itself in the MEETING TIME title */
.mp-tl-dur { display: flex; justify-content: flex-end; gap: 4px; margin-top: 30px; } /* clear of the end handle hanging below the timeline */
.mp-tl-dur + .mp-tl-hint { margin-top: 10px !important; }
.mp-picked-len { color: var(--text); margin-inline-start: 4px; }
/* end past this day: pinned to the right edge, grows to the left */
.mp-end.past .mp-end-handle { transform: translate(-100%, 50%); border-style: dashed; }
/* end line: every city's end time, outlined like the end handle */
.mp-end-tag {
  position: absolute; left: 0; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  font-size: 11.5px; font-weight: 800; font-style: normal; font-variant-numeric: tabular-nums; line-height: 1;
  padding: 3px 6px; border-radius: 5px; color: var(--text); background: var(--bg); border: 1px solid var(--text);
}
.mp-end-tag.night { color: var(--muted); border-color: var(--border); }
.mp-end.out .mp-end-tag { transform: translate(4px, -50%); }
.mp-end.in .mp-end-tag { transform: translate(calc(-100% - 4px), -50%); }
.mp-tl-overlay .mp-at.out .mp-at-tag { transform: translate(calc(-100% - 4px), -50%); }
/* stacked: start tag in the upper half of the row, end tag in the lower half (both still on their lines) */
.mp-tl-overlay .mp-at.stack .mp-at-tag { margin-top: -10px; }
.mp-end.stack .mp-end-tag { margin-top: 10px; }

body[data-theme="retro"] .mp-end-tag { border-radius: 0; font-size: 10px; }
.mp-tl-overlay .mp-at.right .mp-at-tag { transform: translate(4px, -50%); }
/* end tags sit above the white meeting line (it used to run through them when tags were stacked) */
.mp-tl-overlay .mp-end { z-index: 3; }

@media (max-width: 600px) {
  main.wrap { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .mp-board { padding: 14px 12px; }
  .mp-toolbar { flex-wrap: nowrap; }
  .mp-toolbar .mp-datebar { flex: 1 1 auto; min-width: 0; justify-content: space-between; }
  .mp-toolbar .mp-date-wrap { flex: 1 1 auto; min-width: 0; }
  .mp-toolbar .mp-date-big { display: block; width: 100%; min-width: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* stacked when the meeting is too short for both side by side: start above, end below */

  /* the meeting: one column through every city's bar */
  /* the meeting, as on the desktop: white start line, a light band, grey end line; a handle on top (start) and at the bottom (end) */
  /* the time ruler with both handles stays at the top of the screen while the cities scroll under it */
  /* each city's start and end time, on the white and grey lines */
  /* Now, as on the desktop: a dashed line with "Now" on the ruler, and each city's time now in the same colour */
  body[data-theme="retro"] .mp-toolbar .mp-date-big { font-size: 10px; letter-spacing: -0.5px; }
  .mp-toolbar .mp-date-caret { margin-inline-start: 4px; }
  /* sheets */
  /* the desktop's name form and Save hours menu inside the Saved sheet */
  /* the result: a sheet from the bottom */
  .mp-picked { scroll-margin-top: 12px; }
  .mp-picked-head { flex-wrap: wrap; }
  .mp-picked-grid { grid-template-columns: minmax(0, 1fr); }
}

/* undo after removing a city: above the bottom bar on a phone, at the bottom elsewhere */
.mp-undo { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 950; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px 12px 10px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--accent); box-shadow: 0 12px 30px rgba(0, 0, 0, .55); font-size: 13.5px; font-weight: 700; color: var(--text); }
.mp-undo[hidden] { display: none; }
.mp-undo button { flex: none; font: inherit; font-weight: 800; color: var(--bg); background: var(--accent); border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; }
body[data-theme="retro"] :is(.mp-undo, .mp-undo button) { border-radius: 0; }
@media (max-width: 600px) { .mp-undo { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 32px); justify-content: space-between; } }
.mp-undo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* phone planner, in meeting order: the length first (− / + and quick lengths), then a move-only handle over the timeline */

/* ---------- One planner on every screen: the desktop planner, narrowed for a phone (≤600px) ---------- */
@media (max-width: 600px) {
  .mp-tl-grid { grid-template-columns: 96px minmax(0, 1fr); }
  .mp-tl-overlay { left: 100px; right: 6px; } /* over the bars: 96px names + 4px inset, 6px on the right (the desktop numbers are 212px / 14px) */
  .mp-tl-grid > .tc { padding: 6px 6px; }
  .mp-tl-grid > .tc:nth-child(2n) { padding-inline-start: 4px; }
  .mp-tl-grid > .tc.nm:not(.all) { height: 72px; }
  .nm-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
  .nm-pill .mp-row-x { font-size: 11px; padding: 6px 6px; }
  .nm-sub { flex-direction: column; align-items: flex-start; gap: 3px; }
  .nm-sub small { font-size: 11px; }
  .nm-sub .nm-hours { max-width: 100%; font-size: 11px; padding: 3px 6px; }
  .mp-tl-grid > .tc.nm.all b { font-size: 13px; }
  .tc.nm.all small { font-size: 11px; }
  .mp-ruler span { font-size: 10px; white-space: nowrap; }
  body[data-theme="retro"] .mp-ruler span { font-size: 8px; }
  .mp-strip { touch-action: pan-y; } /* a finger can still scroll the page over the bars */
  .mp-at-tag, .mp-end-tag, .mp-now-tag { font-size: 10px; padding: 2px 4px; }
  .mp-at-handle, .mp-end-handle { padding: 6px 10px; font-size: 12px; }
  .mp-at-handle::before, .mp-end-handle::before { content: ""; position: absolute; inset: -8px -6px; } /* a finger-sized grip */
  .nm-menu { min-width: 180px; max-width: calc(100vw - 40px); }
  /* saved cities and presets: each row wraps, the buttons go under the chips; ✎ ✕ always shown (there is no hover on a phone) */
  .mp-setrow { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; } /* chips first (they wrap), the buttons after them on the right */
  .mp-setrow .mp-presets { flex: 1 1 auto; flex-wrap: wrap; overflow: visible; }
  .mp-setrow .mp-preset :is([data-preset], [data-open-set]) { max-width: none; padding-inline-end: 4px; }
  .mp-setrow .mp-preset .mp-preset-ed, .mp-setrow .mp-preset .mp-preset-x { display: block; position: static; transform: none; padding: 6px 7px; background: none; }
  .mp-setrow-acts { margin-inline-start: auto; flex-wrap: wrap; }
  .mp-name-form { display: flex; flex-wrap: wrap; width: 100%; }
  .mp-name-form input { flex: 1 1 140px; min-width: 0; }
  .mp-setrow-acts .mp-dd-menu { right: auto; left: 0; width: min(260px, calc(100vw - 48px)); } /* opens inside the screen */
  .mp-tl-dur { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; } /* the six lengths fill the width, one row */
  .mp-tl-dur .mp-dur-btn { padding: 8px 0; white-space: nowrap; overflow: hidden; text-align: center; }
}

/* touch screens of any size (phones, tablets): no hover, so ✎ ✕ on saved chips are always shown and the chips wrap */
@media (hover: none), (pointer: coarse) {
  .mp-setrow .mp-presets { flex: 1 1 auto; flex-wrap: wrap; overflow: visible; }
  .mp-setrow .mp-preset :is([data-preset], [data-open-set]) { max-width: none; padding-inline-end: 4px; }
  .mp-setrow .mp-preset .mp-preset-ed, .mp-setrow .mp-preset .mp-preset-x { display: block; position: static; transform: none; padding: 6px 7px; background: none; }
}

/* the time above a dragging finger */
.mp-finger-tip { position: fixed; z-index: 960; pointer-events: none; padding: 8px 12px; font-size: 16px; font-weight: 800; white-space: nowrap; color: var(--bg); background: var(--text); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
.mp-finger-tip[hidden] { display: none; }
body[data-theme="retro"] .mp-finger-tip { border-radius: 0; }
.nm-menu .nm-move { border-top: 1px solid var(--border); }
.nm-menu .nm-move + .nm-move { border-top: 0; }
/* the hint matches the pointer: mouse words on a desktop, finger words on a touch screen */
.mp-tl-hint .hint-touch { display: none; }
@media (hover: none), (pointer: coarse) { .mp-tl-hint .hint-mouse { display: none; } .mp-tl-hint .hint-touch { display: inline; } }

/* a city row lifted by a long press (touch reorder) */
.tc.nm.lifted .nm-pill { box-shadow: inset 0 0 0 2px var(--accent), 0 8px 22px rgba(0, 0, 0, .55); transform: scale(1.04); }
@media (hover: none), (pointer: coarse) { .tc.nm .nm-name { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } } /* a long press lifts the row instead of opening the text menu */
.tc.nm.drop-above { box-shadow: 0 -2px 0 var(--accent); } .tc.nm.drop-below { box-shadow: 0 2px 0 var(--accent); } /* the line in the gap the lifted city drops into */

/* narrow 12-hour ruler: hour numbers on top, 오전 / 오후 under the start of each half */
.mp-ruler .mp-ruler-period { position: absolute; top: 72%; transform: translateY(-50%); font-size: 9px; font-style: normal; font-weight: 700; color: var(--accent-2); white-space: nowrap; pointer-events: none; }
.mp-ruler:has(.mp-ruler-period) span { top: 34%; }
.mp-ruler span:last-of-type { transform: translate(-100%, -50%); } /* the last hour stays inside even when 오전 / 오후 follow it */

/* touch screens: a tap also sets :hover, and the desktop hover rule used to move ✎ ✕ away under the finger (the tap then hit the chip) */
@media (hover: none), (pointer: coarse) {
  .mp-setrow .mp-preset:is(:hover, :focus-within) .mp-preset-ed, .mp-setrow .mp-preset:is(:hover, :focus-within) .mp-preset-x { display: block !important; position: static !important; transform: none !important; background: none !important; }
}

/* ---------- Phone (≤600px): the name column in three lines (name ✕ · time now · hours ▾), the desktop layout narrowed; the time now also rides faintly on the Now line ---------- */
@media (max-width: 600px) {
  .mp-tl-grid { grid-template-columns: 96px minmax(0, 1fr); }
  .mp-tl-overlay { left: 100px; right: 6px; } /* over the bars: 96px names + 4px inset */
  .mp-tl-grid > .tc.nm:not(.all) { height: 56px; }
  .mp-now-tag, .mp-now.right .mp-now-tag { display: block; left: 0; right: auto; transform: translate(-50%, -50%); font-size: 10px; padding: 2px 4px; opacity: .7; z-index: 0; } /* faint, centred on the dashed line: it never hides the meeting tags */
  .mp-tl-grid > .tc.nm .nm-sub small[data-now] { display: none; } /* the time now is on the Now line: the name cell keeps two lines */
}
@media (min-width: 601px) { .mp-now-tag { display: none; } }
.nm-pill .nm-caret, .nm-menu .nm-drop { display: none; } /* (the one-line name cell is off: ✕ and the hours button are in the cell again) */
.mp-ruler .mp-ruler-icon { font-size: 12px; color: var(--accent-2); } /* ☾ midnight, ☀ noon on the narrow 12-hour ruler */

/* every screen: an hour label on the ruler never wraps (the last 12-hour label, "오전 12시", used to stand on end) */
.mp-ruler span { white-space: nowrap; }
.mp-ruler { cursor: default; } /* the ruler only shows the hours now; the time handles move the meeting */

/* Everyone: each overlap window on its own line, then +N */
.tc.nm.all .mp-win-line { display: block; white-space: nowrap; }
.tc.nm.all .mp-win-more { opacity: .8; } /* +N at the end of the second line */
@media (max-width: 600px) {
  .tc.nm.all small { font-size: 10.5px; }
  .tc.nm.all .mp-win-line { white-space: normal; } /* the window wraps inside the narrow name column instead of running into the bars */
}

/* phone: the saved cities and hour presets fold away under one toggle */
.mp-save-fold { display: none; }
@media (max-width: 600px) {
  .mp-save-fold { display: flex; align-items: center; gap: 6px; margin: -4px 0 8px auto; padding: 4px 2px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); cursor: pointer; } /* a small text link, like the desktop's Save cities */
  .mp-save-fold-caret { color: var(--accent); transition: transform .15s; }
  .mp-board.saves-open .mp-save-fold-caret { transform: rotate(180deg); }
  .mp-board:not(.saves-open) .mp-setrow { display: none; }
}
@media (max-width: 600px) {
  .mp-tl-grid > .tc.nm:not(.all) { height: 68px; justify-content: center; gap: 2px; } /* each city gets its own room; its name and hours stay together */
  .mp-tl-grid > .tc.nm .nm-sub { margin-top: 0; }
  .nm-menu { top: calc(100% - 6px); left: 4px; min-width: 200px; max-width: calc(100vw - 48px); z-index: 40; box-shadow: 0 14px 34px rgba(0, 0, 0, .65); } /* opens right under the city, above everything below it */
  .nm-menu button { padding: 10px 12px; font-size: 14px; } /* finger-sized rows */
}
@media (max-width: 600px) {
  .mp-end-handle { bottom: -16px; } /* a little lower, clear of the Everyone bar */
  .mp-tl-dur { margin-top: 46px; } /* a little room between the end handle and the lengths */
  .mp-tl-hint .mp-hint-line { display: block; } /* one instruction per line */
  .mp-tl-hint { font-size: 10px; line-height: 1.5; }
}
