:root {
  --sky-top: #1a2444;
  --sky-mid: #26345a;
  --sky-low: #252c44;
  --floor: #171c25;

  --card: rgba(32, 40, 54, 0.88);
  --card-solid: #212938;
  --card-hover: rgba(44, 54, 72, 0.95);
  --field: rgba(17, 22, 31, 0.55);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);

  --text: #eef2f9;
  --muted: #a3aec0;
  --dim: #6f7b90;

  --accent: #1d6bff;
  --accent-2: #3d84ff;
  --accent-soft: #a8c5ff;
  --danger: #ff7b7b;


  --radius: 14px;
  --radius-sm: 10px;
  --hour: 52px;
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 42%, var(--sky-low) 72%, var(--floor) 100%) fixed;
  background-color: var(--floor);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }

/* ---------- Sky ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.clouds { position: absolute; inset: 0; width: 100%; height: 100%; }
.stars, .pixels { position: absolute; inset: 0; }
.star {
  position: absolute; border-radius: 50%;
  background: #dfe6ff;
  animation: twinkle var(--tw, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.px { position: absolute; background: #6fa3b3; }
.sparkle { position: absolute; filter: drop-shadow(0 0 6px rgba(220, 230, 255, .8)); animation: twinkle 5s ease-in-out infinite; }
.sparkle.s1 { width: 34px; left: 18.5%; top: 19%; }
.sparkle.s2 { width: 16px; left: 71%; top: 7%; animation-delay: 2s; }
@keyframes twinkle { 0%, 100% { opacity: var(--o, .9); } 50% { opacity: calc(var(--o, .9) * .35); } }
@media (prefers-reduced-motion: reduce) { .star, .sparkle { animation: none; } }

/* ---------- App frame ---------- */
.app {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 14px 20px 20px;
  gap: 14px;
  width: 100%;
}

/* top bar */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.nav h1 { font-size: 26px; font-weight: 700; margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 10px; }

/* ---------- Primitives ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 40px rgba(5, 8, 20, .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.icon-tile {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--accent-soft);
}
.icon-tile svg { width: 18px; height: 18px; }
.icon-tile.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-tile.sm svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-weight: 700; font-size: 15px;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.ghost:hover { background: var(--card-hover); }
.btn.primary { background: var(--accent); border-color: #4b8cff; color: #fff; box-shadow: 0 6px 20px rgba(29, 107, 255, .35); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); background: transparent; border-color: rgba(255, 123, 123, .3); }
.btn.danger:hover { background: rgba(255, 123, 123, .08); }
.btn.wide { flex: 1; }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.xs svg { width: 15px; height: 15px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.link-btn:hover { color: var(--text); }

.seg {
  display: flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(16, 21, 31, .6);
}
.seg button {
  border: 0; background: transparent;
  height: 34px; padding: 0 16px; border-radius: 9px;
  font-weight: 600; font-size: 14px; color: var(--muted);
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--card-solid); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Layout ---------- */
.layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}
.sidebar {
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; min-height: 0;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .card { padding: 16px; }
.main { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }


/* mini calendar */
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mini-head h2 { font-size: 16px; font-weight: 700; }
.mini-nav { display: flex; gap: 6px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-dow { font-size: 11px; font-weight: 600; color: var(--dim); padding: 4px 0; }
.mini-d {
  position: relative;
  aspect-ratio: 1; border: 0; background: none;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  display: grid; place-items: center;
}
.mini-d:hover { background: rgba(255, 255, 255, .06); }
.mini-d.is-other { color: var(--dim); }
.mini-d.is-today { color: var(--accent-soft); font-weight: 800; }
.mini-d.is-selected { background: var(--accent); color: #fff; font-weight: 700; }
.mini-dots { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.mini-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--c); }
.mini-d.is-selected .mini-dots i { box-shadow: 0 0 0 1px #fff; }

input, textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--accent-2); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type="date"], input[type="time"] { min-height: 42px; }
::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
textarea { resize: vertical; }

.select-wrap { position: relative; flex: 1; min-width: 0; }
.select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}
select {
  width: 100%; min-height: 42px; appearance: none;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 34px 10px 12px; font-size: 14px; outline: none; transition: border-color .15s;
}
select:focus { border-color: var(--accent-2); }
select option { background: #1d2533; }

/* checklist (task steps, editor) */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 0 4px; }
.checklist li:hover { background: rgba(255, 255, 255, .04); }
.check { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 7px 0; cursor: pointer; font-size: 14px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.box {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1.5px solid #8b95a7;
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.box::after {
  content: ''; width: 5px; height: 9px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .15s;
}
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.check .txt { overflow-wrap: anywhere; }
.check input:checked ~ .txt { color: var(--dim); text-decoration: line-through; }
.del {
  width: 26px; height: 26px; flex: none; border: 0; border-radius: 7px; background: none;
  color: var(--dim); display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.del svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.checklist li:hover .del, .del:focus-visible { opacity: 1; }
.del:hover { color: var(--danger); background: rgba(255, 123, 123, .08); }
@media (hover: none) { .del { opacity: .7; } }

.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row input { height: 38px; padding: 8px 12px; }
.add-row .icon-btn { width: 38px; height: 38px; }

/* live dot (editor timezone note) */
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-soft); display: inline-block; flex: none; box-shadow: 0 0 0 0 rgba(168, 197, 255, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(168, 197, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 197, 255, 0); } }

/* ---------- Time grid (day & week) ---------- */
.tg-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.tg-inner { min-width: 100%; }
.tg-week .tg-inner { min-width: 720px; }
.tg-head, .tg-body { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(0, 1fr)); }
.tg-head {
  position: sticky; top: 0; z-index: 4;
  background: var(--card-solid);
  border-bottom: 1px solid var(--line);
}
.tz-label { font-size: 10.5px; font-weight: 600; color: var(--dim); display: grid; place-items: end center; padding-bottom: 10px; }
.tg-day {
  border: 0; background: none;
  padding: 10px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border-left: 1px solid var(--line);
  transition: background .15s;
}
.tg-day:hover { background: rgba(255, 255, 255, .03); }
.tg-day .dow { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tg-day .num { font-size: 22px; font-weight: 700; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.tg-day.is-today .num { background: var(--accent); color: #fff; }
.tg-day.is-today .dow { color: var(--accent-soft); }
.tg-day.is-selected:not(.is-today) .num { box-shadow: inset 0 0 0 1.5px var(--line-strong); }

.tg-body { position: relative; }
.tg-gutter { position: relative; }
.hour-label { height: var(--hour); position: relative; }
.hour-label span { position: absolute; top: -8px; right: 10px; font-size: 11px; font-weight: 500; color: var(--dim); font-variant-numeric: tabular-nums; }
.tg-col {
  position: relative;
  height: calc(var(--hour) * 24);
  border-left: 1px solid var(--line);
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(to bottom, transparent calc(var(--hour) / 2), rgba(255,255,255,.035) calc(var(--hour) / 2), rgba(255,255,255,.035) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px));
  background-size: 100% var(--hour);
  cursor: cell;
}
.tg-col.is-today { background-color: rgba(29, 107, 255, .045); }
.now-line { position: absolute; left: -1px; right: 0; height: 2px; background: #ff6b81; z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ff6b81; }

.ev {
  --c: var(--accent-2);
  position: absolute; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 5px 8px; overflow: hidden; text-align: left;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-left: 4px solid var(--c);
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 30%, #17191f);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  transition: filter .15s, transform .1s;
  cursor: pointer;
}
.ev:hover { filter: brightness(1.15); z-index: 3; }
.ev-title { font-size: 13px; font-weight: 700; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-time { font-size: 11.5px; color: color-mix(in srgb, var(--c) 85%, #fff); font-weight: 500; white-space: nowrap; }
.ev-subs { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, #fff); margin-top: 2px; }
.ev-subs svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; }
.ev > span { flex: none; }
.ev-short { flex-direction: row; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.ev-short .ev-title { flex: 0 1 auto; min-width: 0; }
.ev-short .ev-time { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ev-short .ev-subs, .ev-compact .ev-subs { display: none; }
.ev-done .ev-title { text-decoration: line-through; opacity: .7; }


/* ---------- Day view ---------- */
.sidebar .agenda { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.agenda-h { font-size: 22px; font-weight: 700; line-height: 1.25; }
.agenda-sub { color: var(--muted); font-size: 14px; margin-top: -6px; }

.opt-card {
  --c: var(--accent-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(36, 45, 60, .7);
  transition: background .15s, border-color .15s;
}
.opt-card {
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  border-left: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 9%, rgba(36, 45, 60, .7));
}
.opt-card:hover { background: color-mix(in srgb, var(--c) 15%, var(--card-hover)); }
.opt-card .opt-meta { color: color-mix(in srgb, var(--c) 60%, var(--muted)); }
.opt-card .icon-tile { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
/* ticks and progress take the task's colour; dark check mark stays readable on light colours */
.opt-card .check input:checked + .box { background: var(--c); border-color: var(--c); }
.opt-card .check input:checked + .box::after { border-color: #141a24; }
.opt-row {
  width: 100%; border: 0; background: none; text-align: left;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.opt-card .icon-tile { color: var(--c); }
.opt-text { flex: 1; min-width: 0; }
.opt-title { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ring {
  --c: var(--accent-2);
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), transparent 0);
  box-shadow: inset 0 0 0 1.5px #8b95a7;
  display: grid; place-items: center;
}
.ring::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #262f3f; }
.ring.full { background: var(--c); box-shadow: none; }
.ring.full::after { width: 5px; height: 9px; border-radius: 0; background: none; margin-top: -2px; border: solid #141a24; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.opt-body { padding: 0 16px 12px 64px; }
.opt-body .add-row { margin-top: 4px; }
.opt-body .add-row input { height: 34px; font-size: 13px; background: transparent; border-style: dashed; }

.empty-day {
  text-align: center; color: var(--muted); font-size: 14px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 22px 16px;
}

/* ---------- Month view ---------- */
.month { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.month-head div { padding: 12px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.month-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(96px, 1fr)); overflow-y: auto; }
.mc {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 6px; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: background .15s;
}
.mc:nth-child(7n) { border-right: 0; }
.mc:hover { background: rgba(255, 255, 255, .025); }
.mc.is-other { background: rgba(10, 14, 22, .25); }
.mc.is-other .mc-num { color: var(--dim); }
.mc.is-selected { background: rgba(29, 107, 255, .08); box-shadow: inset 0 0 0 1px rgba(61, 132, 255, .45); }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mc-num {
  flex: none;
  border: 0; background: none; padding: 0;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 13.5px; font-weight: 600;
  display: grid; place-items: center;
}
.mc-num:hover { background: rgba(255, 255, 255, .1); }
.mc.is-today .mc-num { background: var(--accent); color: #fff; }
.chip {
  --c: var(--accent-2);
  border: 0; text-align: left;
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 24%, transparent);
  box-shadow: inset 2px 0 0 var(--c);
  font-size: 12px; min-width: 0;
}
.chip:hover { background: color-mix(in srgb, var(--c) 36%, transparent); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.chip-time { color: color-mix(in srgb, var(--c) 80%, #fff); font-variant-numeric: tabular-nums; flex: none; }
.chip-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { border: 0; background: none; color: var(--accent-soft); font-size: 12px; font-weight: 700; text-align: left; padding: 2px 6px; }
.more:hover { text-decoration: underline; }

/* ---------- Editor dialog ---------- */
.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #1f2736;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.sheet::backdrop { background: rgba(8, 11, 22, .55); backdrop-filter: blur(4px); }
.sheet[open] { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.sheet form { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 24px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  --c: var(--accent-2);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: rgba(36, 45, 60, .7);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.opt:hover { background: var(--card-hover); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .icon-tile { width: 32px; height: 32px; color: var(--c); }
.opt .label { flex: 1; font-size: 14px; font-weight: 500; }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #8b95a7; flex: none; display: grid; place-items: center; }
.opt:has(input:checked) { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 12%, #222b3a); }
.opt:has(input:checked) .radio { border-color: var(--c); }
.opt:has(input:checked) .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.rep-panel {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; margin-top: 2px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(17, 22, 31, .3);
}
.rep-line { display: flex; align-items: center; gap: 10px; }
#fEndsRow { margin-top: 2px; }
.rep-line > span { flex: none; min-width: 44px; font-size: 14px; color: var(--muted); }
.rep-line input[type="number"] { width: 72px; flex: none; min-height: 42px; }
.rep-line input[type="date"] { flex: 1; min-width: 0; }
.day-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pill {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: transparent;
  font-size: 13px; font-weight: 700; color: var(--muted);
  transition: background .15s, color .15s;
}
.day-pill:hover { color: var(--text); }
.day-pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub-note { font-style: normal; font-weight: 500; color: var(--dim); margin-left: 6px; }
.ev-time svg, .opt-meta svg {
  display: inline-block; width: 11px; height: 11px; margin-left: 5px; vertical-align: -1px;
}
.tz-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); justify-content: center; }
.tz-note strong { color: var(--text); font-weight: 600; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-foot .btn { height: 48px; }


/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 960px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; padding: 12px 16px 24px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .main { height: 78vh; height: 78dvh; }
  .sidebar { overflow: visible; }
  .nav h1 { font-size: 21px; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; }
  .nav { order: 2; flex-basis: 100%; }
  .top-right { flex: 1; justify-content: space-between; }
  .btn.primary span { display: none; }
  .btn.primary { width: 42px; padding: 0; }
  .seg button { padding: 0 12px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .field:first-child { grid-column: 1 / -1; }
  .mc { padding: 4px 3px; }
  .chip { padding: 2px 4px; }
  .chip-time, .chip .dot { display: none; }
  .month-head div { padding: 10px 4px; text-align: center; font-size: 11px; }
  .sheet form { padding: 18px; }
}
