:root {
  --mist: #edf0f5;
  --paper: #ffffff;
  --ink: #14203a;
  --slate: #6b7692;
  --line: #d6dbe6;
  --poppy: #e03a1e;
  --poppy-deep: #b52c14;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 32, 58, .06), 0 18px 40px -20px rgba(20, 32, 58, .25);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { left: 8px; z-index: 10; }

/* ---------- header ---------- */
.top {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 16px 0;
}
.langs { position: absolute; right: 16px; top: 16px; z-index: 20; }
.flag {
  display: inline-block;
  width: 24px;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(20, 32, 58, .15);
  flex: none;
}
.flag svg { display: block; width: 100%; height: 100%; }
.lang-current {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 6px 0 8px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
}
.lang-caret { width: 14px; height: 14px; fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.lang-current[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  right: 0;
  top: 40px;
  min-width: 160px;
  padding: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.lang-menu[hidden] { display: none; }
.lang {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.lang:hover { background: var(--mist); }
.lang[aria-checked="true"] { background: var(--mist); }
.lang[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--poppy); font-weight: 800; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 22%, var(--mist) 2px, transparent 2.5px),
    radial-gradient(circle at 70% 22%, var(--mist) 2px, transparent 2.5px),
    linear-gradient(var(--ink) 0 42%, var(--paper) 42%);
  border: 2px solid var(--ink);
}

/* ---------- layout ---------- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.mode[hidden] { display: none; }

.intro { max-width: 560px; margin-bottom: 28px; }
h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 8vw, 64px);
  line-height: .95;
  letter-spacing: .005em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.intro p { margin: 0; color: var(--slate); font-size: 17px; }

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
@media (min-width: 760px) {
  .columns { grid-template-columns: 5fr 4fr; gap: 48px; }
  .preview { position: sticky; top: 24px; }
}
@media (max-width: 759px) {
  .top { padding-top: 14px; }
  .wrap { padding-top: 24px; }
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ---------- form ---------- */
.form { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row[hidden] { display: none; }

.field { display: grid; gap: 6px; min-width: 0; }
label { font-weight: 600; font-size: 14px; }
label small { font-weight: 500; color: var(--slate); margin-left: 4px; }

input[type="text"], input[type="date"], input[type="time"], input[type="url"], textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(224, 58, 30, .35);
  outline-offset: 2px;
  border-color: var(--poppy);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; accent-color: var(--poppy); margin: 0; }

.error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdeae6;
  color: var(--poppy-deep);
  font-size: 14px;
  font-weight: 600;
}
.error[hidden] { display: none; }

/* ---------- composer: one card, rows separated by hairlines ---------- */
.composer { display: grid; gap: 14px; min-width: 0; }
.composer-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.composer-group { border-top: 1.5px solid var(--line); padding: 4px 0; }
.composer .composer-title input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  padding: 14px 18px;
  min-height: 58px;
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  min-height: 46px;
  min-width: 0;
}
.composer-row-top { align-items: flex-start; }
.composer-row-top svg { margin-top: 9px; }
.composer-row > svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--slate);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.composer .composer-row input:not([type="checkbox"]), .composer .composer-row textarea {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 0;
  font-weight: 600;
}
.composer .composer-row textarea { font-weight: 500; resize: none; line-height: 1.4; overflow: hidden; }
.places {
  list-style: none;
  margin: 0 18px 8px 50px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.places[hidden] { display: none; }
.places { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.places li {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  border-top: 1px solid var(--line);
}
.places li:first-child { border-top: 0; }
.places li:hover, .places li[aria-selected="true"] { background: var(--mist); }
.places li strong { display: block; font-weight: 700; }
.places li.is-empty { color: var(--slate); cursor: default; }
.places li.is-skeleton { cursor: default; }
.places li.is-skeleton span, .places li.is-skeleton strong {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--mist) 25%, #e3e7ef 50%, var(--mist) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
.places li.is-skeleton strong { width: 55%; margin-bottom: 6px; }
.places li.is-skeleton span { width: 80%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 -4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.icon-btn:hover { background: var(--mist); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--slate); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover svg { stroke: var(--ink); }

/* ---------- map picker ---------- */
.map-inner { padding-top: 0; }
.map-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); }
.map { width: 100%; height: min(58dvh, 460px); background: var(--mist); }
.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -30px 0 0 -11px;
  background: var(--poppy);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(20, 32, 58, .35);
  pointer-events: none;
  z-index: 500;
}
.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
}
.map-locate {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 500;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.map-locate svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.map-address { min-height: 22px; margin: 12px 4px 10px; text-align: center; font-weight: 600; font-size: 15px; }
.map-address.is-muted { color: var(--slate); font-weight: 500; }
.map-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
.spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--slate);
  animation: spin .8s linear infinite;
  opacity: 0;
  transition: opacity .2s;
}
.spinner.is-on { opacity: 1; }
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.places li span { color: var(--slate); font-size: 13px; }
.composer .composer-row input[type="time"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 96px;
  font-variant-numeric: tabular-nums;
}
.composer .composer-row input:focus-visible, .composer .composer-row textarea:focus-visible, .composer .composer-title input:focus-visible {
  outline: none;
  box-shadow: 0 2px 0 var(--poppy);
}
.arrow { color: var(--slate); flex: none; }

/* ---------- inline date picker: one tap picks and closes ---------- */
.date-btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 4px 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.date-btn[aria-expanded="true"] { color: var(--poppy-deep); }
.time-btn {
  flex: 0 1 auto;
  min-height: 34px;
  padding: 4px 2px;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.time-btn[aria-expanded="true"] { color: var(--poppy-deep); }
.timepicker {
  margin: 0 18px 10px 50px;
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  user-select: none;
}
.timepicker[hidden] { display: none; }
.timepicker { padding: 4px; }
.tp-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  max-height: 212px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 4px;
}
.tp-cell {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
}
.tp-cell:hover { background: var(--mist); }
.tp-cell.is-selected { background: var(--ink); color: #fff; }

/* ---------- past invitations ---------- */
.history { max-width: 560px; margin-top: 36px; }
.history[hidden] { display: none; }
.history-list { display: grid; gap: 8px; }
.history-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.history-item:hover { border-color: var(--ink); }
.history-item[hidden] { display: none; }
.history-day {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 8px;
  background: var(--mist);
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  color: var(--poppy);
}
.history-day small { display: block; font-family: var(--body); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); margin-top: -4px; }
.history-text { min-width: 0; }
.history-title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-sub { display: block; font-size: 13px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-chevron { color: var(--slate); font-size: 20px; }
.history-more { margin-top: 10px; color: var(--slate); }
.history-more[hidden] { display: none; }
.datepicker {
  margin: 0 18px 10px 50px;
  padding: 10px 8px 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  user-select: none;
}
.datepicker[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-size: 14px; font-weight: 700; }
.dp-nav {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
}
.dp-nav:hover { background: var(--mist); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--slate); padding: 4px 0; }
.dp-day {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: var(--mist); }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--line); }
.dp-day.is-selected { background: var(--ink); color: #fff; }
.dp-day:disabled { color: var(--line); cursor: default; background: none; }
.duration { margin-left: auto; flex: none; font-size: 13px; color: var(--slate); font-variant-numeric: tabular-nums; }
.composer-row.check { gap: 12px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:focus-visible) { outline: 3px solid rgba(224, 58, 30, .35); outline-offset: 2px; }
.time-controls { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.time-controls[hidden] { display: none; }
#timeRow .chip-allday {
  margin-left: auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.end-slot { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.end-add {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  white-space: nowrap;
}
.end-add:hover { color: var(--ink); }
.end-add[hidden] { display: none; }
.end-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.end-group[hidden] { display: none; }
.end-group .duration { margin-left: 0; }
.end-clear {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--mist);
  font-size: 16px;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
}
.end-clear:hover { color: var(--ink); }
.date-btn { flex: 0 1 auto; }

.composer-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-top: 1.5px solid var(--line);
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate);
  cursor: pointer;
}
.composer-toggle:hover { color: var(--ink); }
.composer-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.composer-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.repeat-block { flex: 1 1 auto; min-width: 0; padding: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { margin-left: 0; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.repeat-summary { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.repeat-summary[hidden] { display: none; }
.leaf-repeat { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--slate); }
.leaf-repeat:empty { display: none; }

/* range in the pickers */
.dp-day.is-in-range { background: #e3e7f0; border-radius: 0; }
.dp-day.is-range-start, .dp-day.is-range-end { background: var(--ink); color: #fff; }
.dp-day.is-range-start { border-radius: 8px 0 0 8px; }
.dp-day.is-range-end { border-radius: 0 8px 8px 0; }
.dp-day.is-range-start.is-range-end { border-radius: 8px; }

/* custom repeat dialog */
.repeat-dialog { text-align: left; }
.rd-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.rd-label { font-size: 14px; font-weight: 600; color: var(--slate); min-width: 52px; }
.rd-ends { margin: 14px 0 6px; }
.rd-num, .rd-select {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 10px;
}
.rd-num { width: 70px; text-align: center; }
.rd-select { padding-right: 8px; }
.rd-days { display: flex; gap: 4px; flex-wrap: wrap; }
.rd-day {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.rd-day.is-on { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.rd-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; }
.rd-opt input[type="radio"] { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; }
.rd-opt .date-btn { flex: 0 1 auto; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 10px; min-height: 40px; }
.rd-opt .rd-num { width: 64px; }
.repeat-dialog .datepicker { margin: 0 0 10px 30px; }
.rd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.arrow-icon { width: 20px; text-align: center; }
.row-label { font-size: 14px; color: var(--slate); flex: none; }
.status-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px !important; }
.status-pills .send-btn { min-height: 36px; padding: 0 12px; font-size: 13px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s, background .15s;
}
.btn:hover { background: #f7f8fb; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #1f2d4d; }
.btn[hidden] { display: none; }

/* ---------- send by ---------- */
.send { margin-bottom: 28px; }
.send .eyebrow { margin-bottom: 8px; }
.send-row { display: flex; gap: 8px; }
.send-tile {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.send-tile:hover { border-color: var(--ink); }
.send-tile:active { transform: translateY(1px); }
.send-tile[hidden] { display: none; }
.send-tile > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.send-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dot);
  display: grid;
  place-items: center;
}
.send-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.send-icon svg .fill { fill: #fff; stroke: none; }
.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.send-btn:hover { border-color: var(--ink); }
.send-btn[hidden] { display: none; }
.send-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.contacts { display: grid; gap: 8px; margin-top: 12px; }
.contacts[hidden] { display: none; }
.contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
}
.contact-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-tel { display: block; font-size: 12px; font-weight: 500; color: var(--slate); }
.contact .send-btn { min-height: 34px; padding: 0 12px; font-size: 13px; }

/* ---------- share ---------- */
.share-box {
  display: grid;
  gap: 12px;
  margin-bottom: 40px;
}
.share-url {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--slate);
}
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-actions .btn { flex: 1 1 140px; }

.foot-link { margin: 40px 0 0; text-align: center; }
.foot-link a:not(.btn) { color: var(--slate); font-weight: 600; }

/* ---------- the leaf ---------- */
.leaf-stage {
  max-width: 420px;
  margin: 0 auto;
}
.leaf {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: leaf-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes leaf-in {
  from { opacity: 0; transform: translateY(14px) rotate(-.6deg); }
  to   { opacity: 1; transform: none; }
}

.leaf-rings {
  display: flex;
  justify-content: space-between;
  padding: 12px 56px 0;
}
.leaf-rings span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--mist);
  box-shadow: inset 0 2px 3px rgba(20, 32, 58, .25);
}

.leaf-head {
  text-align: center;
  padding: 10px 24px 18px;
  border-bottom: 2px dashed var(--line);
  position: relative;
}
/* the two half-circle notches of a tear-off perforation */
.leaf-head::before, .leaf-head::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mist);
}
.leaf-head::before { left: -8px; }
.leaf-head::after { right: -8px; }

.leaf-month {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.leaf-day {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 128px;
  line-height: .86;
  color: var(--poppy);
  font-variant-numeric: tabular-nums;
}
.leaf-day.is-range { font-size: 84px; line-height: 1; }
.leaf-weekday {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--slate);
}

.leaf-body { padding: 22px 28px 28px; }
.leaf-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.leaf-time {
  margin: 0;
  font-weight: 700;
  font-size: 17px;
}
.leaf-time small { display: block; font-size: 12px; font-weight: 500; color: var(--slate); }
.leaf-location { margin: 8px 0 0; font-weight: 500; }
.leaf-location:empty, .leaf-desc:empty { display: none; }
.leaf-desc {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--slate);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.leaf.is-empty .leaf-title { color: var(--line); }

/* ---------- status box (auto-open, added to own calendar) ---------- */
.status-box {
  max-width: 420px;
  margin: 28px auto 0;
  padding: 18px 20px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  text-align: center;
}
.status-box[hidden] { display: none; }
.status-box p { margin: 0; }
.status-box .status-tip {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--slate);
}
.status-box .status-tip strong { color: var(--poppy-deep); }
.status-links { margin-top: 8px !important; font-size: 14px; color: var(--slate); }
.status-links a, .status-links button {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 0 5px;
  text-decoration: underline;
  cursor: pointer;
}
.status-box.is-error { border-color: var(--poppy); }
#selfStatus { margin: 0 auto 28px; }

.notice {
  max-width: 420px;
  margin: 24px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fdeae6;
  color: var(--poppy-deep);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.notice[hidden] { display: none; }
.connect-hint {
  max-width: 420px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 14px;
  color: var(--slate);
}
.connect-hint[hidden] { display: none; }
.connect-hint a { font-weight: 700; color: var(--ink); }

/* ---------- install on the home screen ---------- */
.install {
  position: relative;
  padding: 12px 40px 12px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  color: var(--slate);
}
.install[hidden], .install p[hidden] { display: none; }
.install p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.install strong { color: var(--ink); }
.install .ios-share {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  fill: none;
  stroke: #1a73e8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
}

/* ---------- account ---------- */
.account {
  max-width: 560px;
  margin: -12px 0 32px;
  font-size: 14px;
  color: var(--slate);
}
.account[hidden], .account p[hidden] { display: none; }
.account p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.account strong { color: var(--ink); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- providers ---------- */
.providers {
  max-width: 420px;
  margin: 28px auto 0;
  display: grid;
  gap: 10px;
}
.providers[hidden] { display: none; }
.providers .eyebrow { margin-bottom: 2px; text-align: center; }
.remember-note {
  margin: 6px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--slate);
}
.remember-note[hidden] { display: none; }
.link-btn {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
.provider {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 0 18px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  transition: transform .1s, border-color .15s;
}
.provider:hover { border-color: var(--ink); }
.provider-direct {
  width: 100%;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-color: var(--ink);
}
.provider-direct .provider-hint { color: #1a73e8; font-weight: 600; }
.provider-direct[disabled] { opacity: .6; cursor: default; }
.provider[hidden] { display: none; }
.provider:active { transform: translateY(1px); }
.provider-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dot); }
.provider-name { font-weight: 700; }
.provider-hint { font-size: 13px; color: var(--slate); }
.provider-tip, .auto-tip {
  margin: -2px 0 2px;
  padding: 0 18px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--slate);
}
.provider-tip strong, .auto-tip strong { color: var(--poppy-deep); }
.provider-tip[hidden], .auto-tip[hidden] { display: none; }
.auto-tip { margin: 8px 0 0 !important; padding: 0; }

.more { display: grid; gap: 10px; }
.more summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  padding: 8px;
}
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { color: var(--ink); }

/* ---------- bottom sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--mist);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -20px 60px -20px rgba(20, 32, 58, .4);
}
.sheet::backdrop { background: rgba(20, 32, 58, .45); }
.sheet[open] { animation: sheet-up .38s cubic-bezier(.2, .8, .2, 1); }
.sheet.is-dragging { animation: none; }
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
.sheet-grip {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 0 8px;
  background: var(--mist);
  touch-action: none;
  cursor: grab;
}
.sheet-handle {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--line);
}
.sheet-inner { padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-inner .eyebrow { text-align: center; }
.sheet-event {
  max-width: 420px;
  margin: 0 auto 14px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  text-align: center;
  line-height: 1.35;
}
.sheet-event strong { display: block; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .01em; }
.sheet-event span { font-size: 14px; color: var(--slate); }
.sheet-inner .providers { margin-top: 0; }
.leaf-compact { margin-bottom: 18px; }
.leaf-compact[hidden], .sheet-event[hidden] { display: none; }
.leaf-compact .leaf-rings { padding-top: 10px; }
.leaf-compact .leaf-head { padding: 6px 20px 12px; }
.leaf-compact .leaf-day { font-size: 96px; }
.leaf-compact .leaf-day.is-range { font-size: 64px; }
.leaf-compact .leaf-body { padding: 16px 22px 20px; }
.leaf-compact .leaf-title { font-size: 28px; }
.leaf-compact .leaf-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.intro-share { margin: 26px 0 18px; }
.intro-share h1 { font-size: clamp(30px, 6vw, 40px); }
.intro-share p { font-size: 15px; }
#selfStatus { margin: 0 auto 8px; }
/* The page behind must not move while the sheet is open or dragged. */
body.sheet-open { position: fixed; width: 100%; overflow: hidden; }
.sheet-close {
  display: flex;
  width: 100%;
  max-width: 420px;
  margin: 16px auto 0;
}
@media (min-width: 760px) {
  .sheet {
    width: 480px;
    margin: auto;
    border-radius: 22px;
    max-height: 90vh;
  }
  .sheet-grip { display: none; }
  .sheet[open] { animation: leaf-in .35s cubic-bezier(.2, .8, .2, 1); }
}

/* ---------- Apple guide ---------- */
.guide {
  width: min(100% - 32px, 400px);
  margin: auto;
  padding: 20px;
  border: 0;
  border-radius: 20px;
  background: var(--mist);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.guide::backdrop { background: rgba(20, 32, 58, .45); }
.guide[open] { animation: leaf-in .3s cubic-bezier(.2, .8, .2, 1); }
.guide .eyebrow { text-align: center; }
.guide-figure { display: block; width: 100%; height: auto; margin-bottom: 14px; }
.guide-steps { margin: 0 0 16px; padding-left: 22px; font-size: 15px; line-height: 1.5; }
.guide-steps strong { color: var(--poppy-deep); }
.guide-actions { display: grid; gap: 12px; justify-items: center; }
.guide-actions .btn { width: 100%; }
.guide-actions .link-btn { color: var(--slate); font-weight: 600; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .leaf, .sheet[open], .guide[open] { animation: none; }
  .spinner { animation-duration: 1.6s; }
  .btn, .provider { transition: none; }
}

/* ---------- message preview format ---------- */
.format-switch { display: flex; gap: 6px; margin-left: auto; }
.format-opt {
  width: 52px;
  height: 40px;
  padding: 4px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
}
.format-opt svg { display: block; width: 100%; height: 100%; }
.format-opt .fo-card { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.format-opt .fo-img { fill: #d6dbe6; }
.format-opt .fo-line { fill: #d6dbe6; }
.format-opt[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.format-opt[aria-checked="true"] .fo-img { fill: var(--poppy); }
.format-opt[aria-checked="true"] .fo-line { fill: var(--ink); }
.format-opt .fo-dark { fill: #2a2a2a; }
.format-opt .fo-amber { fill: #d6dbe6; }
.format-opt[aria-checked="true"] .fo-dark { fill: #111; }
.format-opt[aria-checked="true"] .fo-amber { fill: #ffb400; }

/* ---------- message preview: what the chat app will show ---------- */
.msg-stage { max-width: 420px; margin: 0 auto 18px; }
#previewMessage { margin: 0; }
.msg {
  position: relative;
  padding: 6px 6px 22px;
  background: #dcf8c6;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
.msg-card { background: rgba(0, 0, 0, .05); border-radius: 10px; overflow: hidden; }
.msg-media { display: flex; background: #e9ecf1; }
.msg-img { display: block; width: 100%; height: auto; opacity: 1; transition: opacity .2s; }
.msg.is-loading .msg-img { opacity: .45; }
.msg-text { display: grid; gap: 2px; padding: 8px 10px 10px; font-size: 13px; line-height: 1.35; color: #111; }
.msg-title { font-weight: 700; }
.msg-desc { color: #555; }
.msg-domain { margin-top: 4px; font-size: 12px; color: #777; }
.msg-time { position: absolute; right: 12px; bottom: 6px; font-size: 11px; color: #667; }
/* compact: small thumbnail on the left */
.msg.is-compact .msg-card { display: flex; }
.msg.is-compact .msg-media { flex: none; width: 84px; }
.msg.is-compact .msg-img { width: 84px; height: 84px; object-fit: cover; }
.msg.is-compact .msg-text { padding: 8px 10px; min-width: 0; }
.msg.is-compact .msg-title, .msg.is-compact .msg-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
