:root {
  --bg: #f4f3ef;
  --fg: #1d1d1b;
  --muted: #6b6a66;
  --card: #ffffff;
  --line: #e6e4de;
  --line-strong: #d6d3cb;
  --shade: #f6f5f1;
  --accent: #2f5d50;
  --accent-hover: #264d42;
  --accent-fg: #ffffff;
  --accent-soft: #e3eee9;
  --danger: #a33a2c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --fg: #ecebe7;
    --muted: #a3a29c;
    --card: #1c1c1a;
    --line: #2e2d2a;
    --line-strong: #3b3a36;
    --shade: #171715;
    --accent: #7fb7a4;
    --accent-hover: #93c6b4;
    --accent-fg: #0f1f1a;
    --accent-soft: #22332d;
    --danger: #e88a7c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { letter-spacing: -0.01em; }
h2:focus { outline: none; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.error { color: var(--danger); font-weight: 500; }
.ok { color: var(--accent); font-weight: 500; }

/* ---------- shell ---------- */
.shell { max-width: 1120px; margin: 0 auto; padding: 32px 16px 48px; }
.panel {
  display: grid; grid-template-columns: 300px 1fr;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.05);
}
.side { padding: 28px 24px; border-right: 1px solid var(--line); }
.side h1 { font-size: 1.45rem; margin: 0 0 18px; }
.facts { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--fg); }
.facts svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.facts a { overflow-wrap: anywhere; }
.chosen { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 20px; }
.main { padding: 24px 28px; min-width: 0; }

/* ---------- mini calendar ---------- */
.minical { margin-top: 8px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-title { font-weight: 650; }
.mc-nav { display: flex; gap: 2px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-dow { font-size: 0.75rem; color: var(--muted); padding: 4px 0; }
.mc-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; font: inherit; font-size: 0.875rem; color: var(--muted); border: 0; background: none; padding: 0;
}
.mc-day.out { visibility: hidden; }
.mc-day.inweek { background: var(--shade); }
.mc-day.has { color: var(--accent); background: var(--accent-soft); font-weight: 650; cursor: pointer; }
.mc-day.has:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mc-day.sel, .mc-day.has.sel { background: var(--accent); color: var(--accent-fg); }
.mc-day.today { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); background: var(--card); border-radius: 8px; cursor: pointer; color: var(--fg); padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.mc-nav .icon-btn { border-color: transparent; }
.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  border-radius: 8px; padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--card); color: var(--fg); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--shade); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding-left: 0; padding-right: 0; }
.btn.small { font-size: 0.875rem; padding: 5px 12px; }
.btn.ghost.small { padding-left: 0; padding-right: 0; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- week grid ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-title { font-size: 1.3rem; margin: 0; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.weekgrid { position: relative; border-bottom: 1px solid var(--line); }
.wg-heads { display: grid; grid-template-columns: 52px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.wg-dayhead { text-align: center; padding: 6px 0 10px; display: flex; flex-direction: column; }
.wg-dow { font-size: 0.8rem; color: var(--muted); }
.wg-date { font-size: 1.25rem; font-weight: 650; }
.wg-dayhead.none .wg-date { color: var(--muted); font-weight: 500; }
.wg-dayhead.today .wg-date { color: var(--accent); }
.wg-scroll { max-height: 540px; overflow-y: auto; }
.wg-cols { display: grid; grid-template-columns: 52px repeat(7, 1fr); }
.wg-gutter { position: relative; }
.wg-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.wg-col {
  position: relative; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
}
.wg-col.none { background-color: var(--shade); }
.wg-slot {
  position: absolute; left: 4px; right: 4px; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-fg); font: inherit; font-size: 0.8rem; font-weight: 650;
  text-align: left; padding: 2px 8px; overflow: hidden; white-space: nowrap; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.wg-slot:hover { background: var(--accent-hover); transform: translateY(-1px); }
.wg-slot.selected { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.wg-slot.current { background: repeating-linear-gradient(45deg, var(--shade), var(--shade) 6px, var(--card) 6px, var(--card) 12px); color: var(--muted); border: 1.5px dashed var(--line-strong); cursor: default; box-shadow: none; }
.wg-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--card) 70%, transparent); text-align: center;
}
.wg-empty p { margin: 0; font-weight: 600; }

.tz { margin: 14px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
select, input, textarea {
  font: inherit; color: inherit; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; width: 100%;
}
.tz select { width: auto; max-width: 100%; padding: 6px 10px; }

/* day list (phone) */
.daylist { display: none; }
.daylist h3 { font-size: 1rem; margin: 4px 0 10px; }
.daylist-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  font: inherit; cursor: pointer; padding: 10px 6px; border-radius: 8px; font-weight: 650;
  border: 1px solid var(--accent); background: var(--card); color: var(--accent);
}
.slot.selected, .slot:hover { background: var(--accent); color: var(--accent-fg); }

.sticky-confirm { position: sticky; bottom: 12px; margin-top: 14px; }
.sticky-confirm .btn { width: 100%; box-shadow: 0 6px 20px rgba(0,0,0,.15); }

/* ---------- form / screens ---------- */
.form, .done { max-width: 520px; }
.form h2, .done h2 { font-size: 1.3rem; margin: 4px 0 8px; }
.back { margin-bottom: 4px; }
.when { font-size: 1.05rem; font-weight: 600; margin: 4px 0 14px; }
.field { margin: 14px 0; display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.row form { margin: 0; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.callout p { margin: 0 0 10px; }

/* server-rendered message pages */
.wrap { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.head h1 { font-size: 1.5rem; margin: 0 0 8px; }
.card a { overflow-wrap: anywhere; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 16px 0; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 8px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.agent-note { margin-top: 32px; color: var(--muted); font-size: 0.85rem; max-width: 760px; }
.agent-note h2 { font-size: 0.9rem; margin-bottom: 4px; }
code { font-size: 0.85em; overflow-wrap: anywhere; }

/* ---------- suggestions + month ---------- */
.suggest h2, .mv-title { font-size: 1.15rem; margin: 0 0 12px; }
.suggest-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.suggest-card {
  font: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.suggest-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.suggest-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sc-day { color: var(--muted); font-size: 0.85rem; }
.sc-date { font-weight: 650; font-size: 1.05rem; }
.sc-time { margin-top: 6px; font-weight: 700; font-size: 1.25rem; color: var(--accent); }

.mv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mv-head .mv-title { margin: 0; }
.mv-nav { display: flex; gap: 6px; }
.mv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mv-dow { font-size: 0.75rem; color: var(--muted); text-align: center; padding: 6px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--shade); }
.mv-day {
  position: relative; min-height: 86px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; background: var(--card);
}
.mv-day.out { background: var(--shade); }
.mv-day.out .mv-num { opacity: .35; }
.mv-day.past .mv-num { color: var(--muted); opacity: .6; }
.mv-day.open { cursor: pointer; }
.mv-day.open:hover { background: var(--accent-soft); }
.mv-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.mv-day.today .mv-num { background: var(--fg); color: var(--card); border-radius: 999px; padding: 0 6px; }
.mv-num { font-size: 0.85rem; font-weight: 600; line-height: 1.6; }
.mv-day.away { background-image: repeating-linear-gradient(135deg, rgba(240,200,120,.22) 0 7px, transparent 7px 14px); background-color: #fffaf0; }
.mv-away { font-size: 0.72rem; font-weight: 700; color: #8a6418; white-space: nowrap; overflow: visible; position: relative; z-index: 1; }
.mv-first {
  font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; padding: 3px 8px; border-radius: 6px;
  border: 0; background: var(--accent); color: var(--accent-fg);
}
.mv-first:hover { background: var(--accent-hover); }
.mv-first.selected { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.mv-more { font: inherit; font-size: 0.75rem; color: var(--accent); background: none; border: 0; padding: 0 2px; cursor: pointer; font-weight: 600; }
.mv-more:hover { text-decoration: underline; }
.mv-dot { display: none; }
.day-panel { margin: 14px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.day-panel h3 { font-size: 1rem; margin: 0 0 10px; }
.day-panel .daylist-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.mv-legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.mv-legend li { display: block; }
.mv-legend .sw { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.mv-legend .btn.ghost { padding: 0; font-size: inherit; }
.mv-legend .sw { width: 14px; height: 14px; border-radius: 3px; background-image: repeating-linear-gradient(135deg, rgba(240,200,120,.6) 0 3px, #fffaf0 3px 6px); border: 1px solid #e3b864; flex: none; }
@media (prefers-color-scheme: dark) {
  .mv-day.away { background-color: #241f13; }
  .mv-away { color: #e3b864; }
  .mv-legend .sw { background-image: repeating-linear-gradient(135deg, rgba(227,184,100,.5) 0 3px, #241f13 3px 6px); }
}

/* ---------- travel ---------- */
.away-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: #fff6e5; border: 1px solid #f0d9a8; color: #5c4210; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.away-banner p { margin: 2px 0; }
.wg-col.away { background-color: transparent; background-image: repeating-linear-gradient(135deg, rgba(240,200,120,.18) 0 8px, transparent 8px 16px), linear-gradient(to bottom, var(--line) 1px, transparent 1px); }
.wg-away { position: absolute; top: 6px; left: 4px; right: 4px; font-size: 0.7rem; font-weight: 650; color: #8a6418; text-align: center; line-height: 1.2; }
.wg-dayhead.away .wg-date { color: #b5862b; }
.mc-day.away { box-shadow: inset 0 0 0 1.5px #e3b864; }
@media (prefers-color-scheme: dark) {
  .away-banner { background: #2e2615; border-color: #5a4720; color: #f1d9a4; }
  .wg-away { color: #e3b864; }
}

/* ---------- ask ---------- */
.ask-cta { margin: 14px 0 0; color: var(--muted); }
.ask-cta .btn.ghost { padding: 0; }
.offer-list { display: grid; gap: 8px; margin: 12px 0; }
.offer-list .slot { text-align: left; padding: 12px 14px; }
.reply h2 { font-size: 1.05rem; margin: 18px 0 8px; }
.reply .times { display: grid; gap: 8px; margin-bottom: 12px; }
.reply label { font-weight: 600; display: block; margin-bottom: 4px; }
.draft { white-space: pre-wrap; background: var(--shade); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: inherit; font-size: 0.9rem; }

.proposals-in { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 2px; margin: 14px 0; }
.proposals-in legend { font-weight: 600; padding: 0 4px; }
.proposals { display: grid; gap: 8px; margin: 8px 0 4px; }
.proposal { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .suggest-row { grid-template-columns: 1fr; gap: 8px; }
  .suggest-card { flex-direction: row; align-items: baseline; gap: 8px; padding: 12px 14px; }
  .sc-time { margin: 0 0 0 auto; font-size: 1.1rem; }
  .mv-day { min-height: 48px; padding: 4px; align-items: center; }
  .mv-first, .mv-more { display: none; }
  .mv-dot { display: block; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
  .mv-away { font-size: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mv-dow { font-size: 0.7rem; }
  .shell { padding: 16px 12px 40px; }
  .panel { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 16px; }
  .main { padding: 18px 16px; }
  .facts { margin-bottom: 16px; }
}
