/*
  Trip Planner — "less but better".

  Warm grey paper, black dots, one orange. Light only, on purpose: the
  reference is a printed-object look and it does not survive inversion.

  How a day reads:
    black dot       everyone free
    hollow ring     someone away (their initials inside)
    orange          today
    orange ring     the dates you are picking
    orange dot      suggested dates
*/

:root {
  color-scheme: light;

  --paper: #e8e6e1;
  --paper-2: #f2f1ed;
  --ink: #121412;
  --grey: #8a8884;
  --ring: #c9c6c0;
  --line: #d3d0ca;
  --orange: #f06a28;
  --ok: #121412;
  --warn: #c2410c;

  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 40px 140px;
}

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

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
}
.session { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--grey); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: rgba(18, 20, 18, .06); }
.btn.primary { background: var(--ink); color: var(--paper-2); }
.btn.primary:hover { background: #2a2c2a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper-2); }

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey);
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); }

.field {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
}
.field::placeholder { color: var(--grey); }
.field:focus { outline: none; border-color: var(--ink); }

/* ---------- notice ---------- */

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  font-size: 14px;
}
.notice::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--orange);
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 360px);
  justify-content: space-between;
  gap: 64px;
  align-items: start;
}

/* ---------- poster ---------- */

.poster { padding-top: 40px; }

.today-num {
  font-size: clamp(120px, 20vw, 230px);
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.05em;
  margin-left: -.04em;
  font-variant-numeric: tabular-nums;
}

.counter { display: grid; gap: 18px; }
.counter-label { color: var(--ink); }

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
}
.month-block { display: grid; margin: 0; font-weight: 400; line-height: 1.1; }
.month { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: .01em; }
.year { font-size: clamp(28px, 3.6vw, 40px); color: var(--grey); }
.weekday { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; }

.cal-nav { display: flex; align-items: center; gap: 22px; margin: 48px 0 48px -6px; }
.arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.arrow svg { width: 22px; height: 22px; }
.arrow:hover { background: rgba(18, 20, 18, .07); }
.cal-nav .text-btn { margin-left: 8px; }

.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 14px; }
.dow { margin-bottom: 18px; }
.dow span { text-align: center; font-size: 14px; color: var(--grey); }
.grid { row-gap: 20px; }

/* ---------- days ---------- */

.day {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.day.blank { cursor: default; }

.dot {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-2);
  transition: transform .15s ease;
}
.day:not(.blank):hover .dot { transform: scale(1.06); }

.n { font-size: clamp(11px, 1.3vw, 15px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.who { font-size: 9px; font-weight: 600; letter-spacing: .1em; line-height: 1; }

.day.away .dot { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ring); }
.day.away .who { color: var(--grey); }

.day.past .dot { opacity: .3; }

.day.today.free .dot { background: var(--orange); color: #fff; }
.day.today.away .dot { color: var(--orange); box-shadow: inset 0 0 0 2px var(--orange); }

.day.picked .dot { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--orange); }
.day.picked.away .dot { box-shadow: inset 0 0 0 2px var(--ring), 0 0 0 3px var(--paper), 0 0 0 5px var(--orange); }

.day.suggested::after {
  content: "";
  position: absolute;
  bottom: -12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 40px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--grey);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.key { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; }
.key.free { background: var(--ink); }
.key.away { box-shadow: inset 0 0 0 2px var(--ring); }
.key.today { background: var(--orange); }
.key.sugg { width: 5px; height: 5px; margin: 0 3.5px; background: var(--orange); }

.help { margin: 14px 0 0; font-size: 14px; color: var(--grey); }

.trips { display: grid; gap: 16px; margin-top: 56px; }
.trip-list { list-style: none; margin: 0; padding: 0; display: grid; }
.trip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.trip:last-child { border-bottom: 1px solid var(--line); }
.trip .initial { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ring); }
.trip-place { display: grid; line-height: 1.3; min-width: 0; }
.trip-place strong { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.trip-place span { font-size: 13px; color: var(--grey); }
.trip-dates { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- side ---------- */

.side { display: grid; gap: 44px; padding-top: 48px; }
.side section { display: grid; gap: 16px; }

.people { list-style: none; margin: 0; padding: 0; display: grid; }
.person { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.person:last-child { border-bottom: 1px solid var(--line); }
.initial {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-2);
  font-size: 13px;
  font-weight: 600;
}
.person-text { display: grid; line-height: 1.3; }
.person-name { font-weight: 500; }
.person-status { font-size: 13px; color: var(--grey); }
.person-status.ok { color: var(--ink); }
.person-status.warn { color: var(--warn); }

.suggestions { list-style: none; margin: 0; padding: 0; display: grid; }
.sugg { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.sugg:last-child { border-bottom: 1px solid var(--line); }
.sugg-head { display: flex; align-items: baseline; gap: 10px; }
.sugg-head::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--orange); transform: translateY(-2px); }
.sugg-dates { flex: 1; padding: 0; border: 0; background: none; text-align: left; font-size: 17px; font-weight: 600; cursor: pointer; }
.sugg-dates:hover { color: var(--orange); }
.sugg-meta { font-size: 13px; color: var(--grey); }
.sugg-note { margin: 0; overflow-wrap: anywhere; }
.remove { padding: 0; border: 0; background: none; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); cursor: pointer; }
.remove:hover { color: var(--warn); }
.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.answers li { display: flex; justify-content: space-between; gap: 10px; }
.answers .yes { color: var(--ink); font-weight: 500; }
.answers .no { color: var(--warn); }
.answers .none { color: var(--grey); }
.vote { display: flex; gap: 8px; }
.vote .btn { flex: 1; }

.free { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--grey); }

.footer {
  margin: 96px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ---------- selection bar ---------- */

.sheet {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  width: min(860px, calc(100% - 24px));
  padding: 14px 14px 14px 24px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(18, 20, 18, .12);
}
.sheet-main { display: grid; line-height: 1.3; }
.sheet-main strong { font-weight: 600; }
.sheet-main span { font-size: 13px; color: var(--grey); }
.sheet .field { flex: 1; min-width: 180px; }
.sheet-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- small screens ---------- */

@media (max-width: 960px) {
  .page { max-width: 600px; padding: 20px 24px 170px; }
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side { padding-top: 64px; }
}

@media (max-width: 480px) {
  .page { padding: 16px 20px 190px; }
  .poster { padding-top: 32px; }
  .today-num { font-size: 136px; }
  .hero-row { margin-top: 28px; }
  .cal-nav { margin: 28px 0 32px -6px; }
  .dow, .grid { column-gap: 8px; }
  .grid { row-gap: 14px; }
  .dow { margin-bottom: 12px; }
  .dow span { font-size: 12px; }
  .n { font-size: 12px; }
  .who { font-size: 7px; letter-spacing: .04em; }
  .day.suggested::after { bottom: -9px; width: 4px; height: 4px; }
  .sheet { border-radius: 24px; padding: 16px; }
  .sheet-actions { width: 100%; }
  .sheet-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dot { transition: none; }
}
