:root {
  --bg: #f8f5ee;
  --card: #fffaf0;
  --text: #28221b;
  --muted: #766b5d;
  --accent: #d35400;
  --accent-dark: #a64000;
  --border: #eadfcb;
  --yes: #18794e;
  --maybe: #9a6700;
  --no: #b42318;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fff0d0, var(--bg));
  color: var(--text);
}
.container { width: min(1150px, calc(100% - 28px)); margin: 28px auto; }
.narrow { max-width: 760px; }
.card {
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(66, 42, 16, .08);
  padding: 24px;
  margin-bottom: 18px;
}
.hero { text-align: center; padding: 38px 24px; }
.emoji { font-size: 56px; }
h1 { margin: 4px 0 10px; font-size: 2.75rem; line-height: 1.05; }
h2 { margin-top: 0; }
p { color: var(--muted); }
label { display: block; font-weight: 700; margin: 14px 0 8px; }
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  color: var(--text);
  font: inherit;
  margin-top: 7px;
}
button {
  border: 0;
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 14px;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: #efe3d0; color: var(--text); }
button.secondary:hover { background: #e5d4bb; }
button:disabled,
button:disabled:hover,
button.secondary:disabled,
button.secondary:disabled:hover {
  background: #efe3d0;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .62;
}
.date-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.date-row input { margin-top: 0; }
.date-row button { margin-top: 0; flex: 0 0 auto; }
.message { min-height: 22px; font-weight: 700; }
.poll-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.back { color: var(--accent-dark); text-decoration: none; font-weight: 700; }
.shareBox { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.availabilityCalendar { margin-top: 12px; }
.bestItem {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  margin-bottom: 10px;
}
.bestItem.best {
  background: #eefaf2;
  border-color: rgba(24, 121, 78, .38);
}
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { border-radius: 999px; padding: 5px 9px; font-weight: 800; color: white; font-size: .85rem; }
.badge.yes { background: var(--yes); }
.badge.maybe { background: var(--maybe); }
.badge.no { background: var(--no); }
.tableWrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { border-bottom: 1px solid var(--border); padding: 12px; text-align: center; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.cell-yes { color: var(--yes); font-weight: 900; }
.cell-maybe { color: var(--maybe); font-weight: 900; }
.cell-no { color: var(--no); font-weight: 900; }
.hidden { display: none !important; }
@media (max-width: 720px) {
  .poll-head, .grid2 { display: block; }
  .shareBox { justify-content: flex-start; }
}


.inlineForm {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.inlineForm label {
  flex: 1;
  min-width: 240px;
}


.muted { color: var(--muted); }
.calendarMonth {
  background: #fffdf8;
  border: 1px solid rgba(234, 223, 203, .95);
  border-radius: 16px;
  padding: 14px;
}
.calendarToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.calendarToolbar h3 {
  margin: 0;
  text-transform: capitalize;
  font-size: 1.3rem;
}
.calendarPager {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendarNav {
  width: 40px;
  height: 40px;
  padding: 0;
  margin-top: 0;
  border-radius: 999px;
  font-size: 1.7rem;
  line-height: 1;
}
.calendarGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.calendarGrid.weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  font-size: .82rem;
}
.calendarGrid.weekdays div {
  padding: 7px 4px;
  border-radius: 999px;
  background: rgba(239, 227, 208, .55);
}
.calendarCell {
  min-height: 128px;
  border: 1px solid rgba(234, 223, 203, .95);
  border-radius: 14px;
  background: #fffefa;
  padding: 9px;
  box-shadow: 0 1px 0 rgba(66, 42, 16, .04);
}
.calendarCell.empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.calendarCell.hasOptions {
  background: #fff8ec;
  border-color: rgba(211, 84, 0, .28);
}
.calendarCell.bestDay {
  background: #effaf3;
  border-color: rgba(24, 121, 78, .52);
  box-shadow: inset 0 0 0 2px rgba(24, 121, 78, .09), 0 5px 18px rgba(24, 121, 78, .08);
}
.calendarDayTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.calendarDayNumber {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 900;
  margin-bottom: 4px;
}
.calendarDayNumber small {
  display: none;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}
.calendarAddToggle {
  width: 30px;
  height: 30px;
  padding: 0;
  margin-top: 0;
  border-radius: 999px;
  background: #f2e5cf;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}
.calendarAddToggle:hover { background: #e7d5b9; }
.calendarOption {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(211, 84, 0, .18);
  border-radius: 12px;
  background: white;
  font-size: .82rem;
  color: var(--text);
  box-shadow: 0 5px 14px rgba(66, 42, 16, .05);
}
.calendarOption.bestOption {
  border-color: rgba(24, 121, 78, .44);
  background: #f8fffa;
}
.calendarOptionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.calendarOption strong {
  color: var(--text);
  font-size: .9rem;
}
.bestTag {
  display: inline-block;
  background: var(--yes);
  color: white;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .68rem;
  font-weight: 800;
}
.calendarStats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.calendarStats span {
  min-width: 0;
  padding: 4px 3px;
  border-radius: 999px;
  background: #f2e7d6;
  color: var(--text);
  font-size: .76rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}
.availabilityChoices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.availabilityChoice {
  display: block;
  position: relative;
  margin: 0;
  min-width: 0;
  font-size: 1.1rem;
  font-weight: 900;
}
.availabilityChoice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.availabilityChoice span {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 6px 4px;
  border: 1px solid rgba(234, 223, 203, .95);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.availabilityChoice input:focus-visible + span {
  outline: 3px solid rgba(211, 84, 0, .22);
  outline-offset: 2px;
}
.availabilityChoice.yes input:checked + span {
  background: var(--yes);
  border-color: var(--yes);
  color: white;
}
.availabilityChoice.maybe input:checked + span {
  background: var(--maybe);
  border-color: var(--maybe);
  color: white;
}
.availabilityChoice.no input:checked + span {
  background: var(--no);
  border-color: var(--no);
  color: white;
}
.calendarAddPanel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 9px;
  border: 1px dashed rgba(211, 84, 0, .38);
  border-radius: 12px;
  background: #fffaf1;
}
.calendarAddPanel label {
  margin: 0;
  font-size: .78rem;
}
.calendarAddPanel input {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
}
.calendarAddActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.calendarAddActions button {
  margin-top: 0;
  padding: 9px 10px;
  border-radius: 10px;
}
@media (max-width: 900px) and (min-width: 701px) {
  .calendarGrid { grid-template-columns: repeat(7, minmax(104px, 1fr)); }
  .calendarMonth { overflow-x: auto; }
  .calendarToolbar,
  .calendarGrid { min-width: 790px; }
}
@media (max-width: 700px) {
  .container {
    width: min(1150px, calc(100% - 16px));
    margin: 10px auto;
  }
  .card {
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 12px;
  }
  h1 { font-size: 2rem; }
  .shareBox button { width: 100%; }
  .calendarMonth {
    padding: 10px;
    border-radius: 14px;
  }
  .calendarToolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 4px 0 10px;
    background: #fffdf8;
  }
  .calendarToolbar h3 { font-size: 1.12rem; }
  .calendarNav {
    width: 42px;
    height: 42px;
  }
  .calendarGrid.weekdays { display: none; }
  .calendarGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .calendarCell.empty { display: none; }
  .calendarCell {
    min-height: 0;
    padding: 12px;
    border-radius: 14px;
  }
  .calendarCell:not(.hasOptions):not(.bestDay) {
    background: rgba(255, 253, 248, .7);
  }
  .calendarDayNumber {
    font-size: 1rem;
    margin-bottom: 0;
  }
  .calendarDayNumber small { display: inline; }
  .calendarAddToggle {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }
  .calendarOption {
    margin-top: 10px;
    padding: 11px;
  }
  .calendarStats span {
    padding: 6px 4px;
    font-size: .86rem;
  }
  .availabilityChoice {
    font-size: 1.25rem;
  }
  .availabilityChoice span {
    min-height: 44px;
    padding: 8px 4px;
  }
  .calendarAddPanel {
    padding: 11px;
  }
  .calendarAddActions button {
    min-height: 42px;
  }
}
