/* Vazirmatn — self-hosted (SIL OFL). Latin + Arabic/Persian subset per weight. */
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/vazirmatn-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/vazirmatn-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/vazirmatn-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/vazirmatn-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/vazirmatn-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/vazirmatn-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/vazirmatn-latin-900-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/vazirmatn-arabic-900-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --paper: #f7f4ed;
  --ink: #17221d;
  --muted: #69726d;
  --line: #dedbd2;
  --green: #1f6248;
  --green-dark: #174b38;
  --green-pale: #dce9df;
  --accent: #c45c52;            /* terracotta — brand accent only */
  --accent-soft: rgba(196, 92, 82, .75);
  --error: #b3261e;             /* distinct red — error states only */
  --white: #fffefa;
  --surface: rgba(255, 254, 250, .96);
  --soft: #eef3ed;
  --shadow: 0 24px 70px rgba(30, 53, 43, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s, transform .2s; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(31, 98, 72, .2); outline-offset: 2px; }
.hidden { display: none !important; }

/* Gentle entrance motion to orient the user when a view/section appears */
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view { animation: viewIn .32s ease both; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
}
.ambient-one { width: 420px; height: 420px; top: 75px; right: -260px; background: rgba(169, 199, 178, .21); }
.ambient-two { width: 320px; height: 320px; left: -170px; bottom: -90px; background: rgba(211, 183, 153, .15); }

.site-header {
  width: min(1180px, calc(100% - 48px));
  height: 86px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(31, 98, 72, .12);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; cursor: pointer; text-align: right; }
.brand-mark { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; background: var(--green); box-shadow: 0 6px 16px rgba(31, 98, 72, .2); transform: rotate(-2deg); }
.brand-mark svg { transform: rotate(2deg); }
.brand strong { display: block; font-size: 21px; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.header-actions { display: flex; align-items: center; gap: 24px; }
.text-button, .pill-button { border: 0; cursor: pointer; background: transparent; }
.text-button { color: #58625d; font-size: 14px; }
.text-button:hover { color: var(--green); }
.pill-button { display: flex; gap: 10px; align-items: center; padding: 11px 17px; border: 1px solid rgba(31,98,72,.28); border-radius: 999px; color: var(--green); font-weight: 700; font-size: 13px; transition: .2s; }
.pill-button:hover { background: var(--green); color: white; }
.pill-button span { font-size: 17px; line-height: 1; }

.setup-view { width: min(1140px, calc(100% - 48px)); min-height: calc(100vh - 86px); margin: auto; padding: 58px 0 78px; display: grid; grid-template-columns: .92fr 1.08fr; gap: 70px; align-items: center; }
.hero-copy { padding-right: 10px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--green); font-size: 14px; font-weight: 700; }
.eyebrow span { width: 26px; height: 1px; background: var(--green); }
.hero-copy h1 { margin: 19px 0 24px; font-size: clamp(42px, 5vw, 66px); line-height: 1.25; font-weight: 900; }
.hero-copy h1 em { color: var(--accent); font-style: normal; font-weight: 800; position: relative; }
.hero-copy h1 em::after { content: ""; position: absolute; height: 7px; right: 2px; left: 0; bottom: -7px; border-top: 2px solid rgba(196,92,82,.75); border-radius: 50%; transform: rotate(-2deg); }
.hero-copy > p { max-width: 500px; color: var(--muted); line-height: 2.05; font-size: 17px; }

.setup-card { padding: 34px 38px 36px; border: 1px solid rgba(72,86,77,.14); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.setup-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.step-kicker { color: var(--green); font-size: 13px; font-weight: 700; }
.setup-head h2 { margin: 6px 0 0; font-size: 24px; }
.steps { display: flex; align-items: center; direction: rtl; }
.steps span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #a4aaa6; font-size: 12px; }
.steps span.active { color: white; background: var(--green); border-color: var(--green); }
.steps i { width: 25px; height: 1px; background: var(--line); }

.field { display: block; margin-bottom: 17px; }
.field > span, .date-label-row > span { display: block; margin-bottom: 9px; font-weight: 700; font-size: 14px; }
.field > span small { margin-right: 4px; color: #a0a5a2; font-weight: 400; }
.input-shell { height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: white; transition: .2s; }
.input-shell:focus-within { border-color: rgba(31,98,72,.7); box-shadow: 0 0 0 3px rgba(31,98,72,.08); }
.input-shell > span { color: #9aa29e; font-size: 15px; }
.input-shell input { width: 100%; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.input-shell input::placeholder { color: #a6aaa8; }
.date-label-row { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; }
.date-label-row > span { margin: 0; }
.date-label-row small { color: var(--green); font-size: 12px; }

.creator-window { padding: 16px; margin: 22px 0; border: 1px solid #d8e3da; border-radius: 13px; background: #f3f7f3; }
.creator-window-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.creator-window-head span { font-size: 14px; font-weight: 700; }
.creator-window-head small { max-width: 245px; color: var(--muted); text-align: left; font-size: 11px; line-height: 1.7; }
.creator-time-row .select-field select { background: var(--white); }

.calendar { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.calendar-head { height: 53px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid #ece9e2; }
.calendar-head strong { font-size: 16px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f5f4ef; color: #65706a; cursor: pointer; font-size: 22px; line-height: 1; }
.icon-button:hover { background: var(--green-pale); color: var(--green); }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays { padding: 10px 12px 4px; color: #6d7872; font-size: 12px; font-weight: 700; text-align: center; }
.calendar-grid { padding: 3px 12px 13px; row-gap: 4px; }
.day-button { position: relative; width: 39px; height: 38px; margin: auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 13px; }
.day-button:hover:not(:disabled) { background: #edf3ee; color: var(--green); }
.day-button.selected { color: white; background: var(--green); box-shadow: 0 5px 11px rgba(31,98,72,.18); font-weight: 700; }
.day-button.today:not(.selected)::after { content: ""; position: absolute; width: 3px; height: 3px; bottom: 3px; border-radius: 50%; background: var(--accent); }
.day-button:disabled { color: #c4c6c4; cursor: not-allowed; text-decoration: line-through; }
.day-blank { height: 38px; }
.quick-row { margin: 11px 2px 0; display: flex; justify-content: space-between; align-items: center; color: #76817b; font-size: 12px; }
.quick-row button { padding: 0; border: 0; border-bottom: 1px dashed rgba(31,98,72,.5); color: var(--green); background: none; cursor: pointer; font-size: 12px; }
.selected-dates-preview { display: none; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.selected-dates-preview.has-dates { display: flex; }
.date-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #d8e4da; border-radius: 999px; color: var(--green); background: #f2f7f2; cursor: pointer; font-size: 12px; }
.date-chip:hover { border-color: #b8cdbd; background: #e8f1e9; }
.date-chip b { font-size: 14px; font-weight: 400; line-height: 1; }
.form-error { min-height: 22px; margin-top: 8px; color: var(--error); font-size: 13px; }
.field-msg { display: block; margin-top: 6px; color: var(--error); font-size: 12px; font-weight: 700; }
.field-msg:empty { display: none; }
.field.invalid .input-shell { border-color: var(--error); box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.field.invalid .input-shell > span { color: var(--error); }
.primary-button { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 13px; border: 0; border-radius: 12px; color: white; background: var(--green); box-shadow: 0 9px 20px rgba(31,98,72,.18); font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button span { font-size: 18px; }

/* Event view */
.event-view { width: min(1220px, calc(100% - 48px)); margin: auto; padding: 44px 0 72px; }
.event-topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 30px; }
.event-title-block { display: flex; gap: 15px; align-items: center; }
.back-button { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; color: var(--green); }
.back-button:hover { border-color: #b9c9bd; background: var(--soft); }
.event-meta { margin-bottom: 6px; color: var(--green); font-size: 12px; font-weight: 700; }
.live-dot { width: 6px; height: 6px; display: inline-block; margin-left: 5px; border-radius: 50%; background: #58a878; box-shadow: 0 0 0 4px rgba(88,168,120,.12); }
.event-title-block h1 { margin: 0; font-size: 30px; line-height: 1.35; }
.event-title-block p { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
/* Invite bar — full-width share row beneath the title */
.invite-bar { display: flex; flex-wrap: wrap; gap: 16px 26px; margin-bottom: 24px; padding: 16px 18px; border: 1px solid rgba(72,86,77,.14); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px rgba(30,53,43,.06); }
.invite-link-row, .invite-send { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.invite-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.invite-copy { display: flex; align-items: center; gap: 11px; height: 46px; padding: 0 8px 0 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; direction: ltr; transition: .2s; }
.invite-copy:hover { border-color: #b9c9bd; background: #fbfdfb; }
.invite-copy i { flex: 0 0 auto; color: var(--green); font-style: normal; font-size: 16px; }
.invite-copy b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5f6964; font-size: 13px; font-weight: 400; text-align: left; }
.invite-copy em { flex: 0 0 auto; padding: 5px 12px; border-radius: 8px; background: var(--green-pale); color: var(--green); font-style: normal; font-size: 12px; font-weight: 700; transition: .2s; }
.invite-copy:hover em { background: var(--green); color: #fff; }
.invite-copy.copied em { background: var(--green); color: #fff; }
.event-layout { display: grid; grid-template-columns: 285px minmax(0,1fr); direction: ltr; gap: 22px; align-items: start; }
.event-layout > * { direction: rtl; }
.participant-card, .schedule-card { border: 1px solid rgba(72,86,77,.14); border-radius: 19px; background: var(--surface); box-shadow: 0 14px 40px rgba(30,53,43,.08); }
.participant-card { position: sticky; top: 20px; padding: 27px 24px 24px; }
.respondents { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 19px; }
.respondents > span { color: var(--muted); font-size: 11px; }
.avatar-stack { min-height: 33px; display: flex; justify-content: center; direction: ltr; }
.avatar-stack span { width: 35px; height: 35px; display: grid; place-items: center; margin-left: -7px; border: 2px solid var(--white); border-radius: 50%; color: white; font-size: 12px; font-weight: 700; box-shadow: 0 3px 8px rgba(25,45,36,.09); }
.avatar-stack span:first-child { margin-left: 0; }
.avatar-1 { background: #6f917f; }
.avatar-2 { background: #b87564; }
.avatar-3 { background: #777a9d; }
.avatar-4 { background: #a58855; }
.avatar-more, .avatar-empty { color: var(--green) !important; background: #e7efe8; }
.participant-card h2 { margin: 0; text-align: center; font-size: 20px; }
.participant-card > p { margin: 10px auto 24px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.9; }
.field.compact { margin-bottom: 16px; }
.field.compact .input-shell { height: 44px; }
.paint-hint { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 13px; margin: 18px 0; border-radius: 11px; background: #f0f4ef; }
.mouse-icon { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: var(--green); background: white; font-size: 17px; }
.paint-hint > div { flex: 1; }
.paint-hint b, .paint-hint small { display: block; }
.paint-hint b { margin-bottom: 4px; font-size: 13px; }
.paint-hint small { color: var(--muted); font-size: 11px; }
.paint-hint button { flex: 0 0 auto; align-self: flex-start; padding: 3px 0; border: 0; border-bottom: 1px dashed #9bb3a2; background: none; color: var(--green); cursor: pointer; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 14px 24px 2px; color: #59655f; font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend span { width: 17px; height: 17px; border: 1px solid #dde1de; border-radius: 4px; }
.legend-mine { background: #9bc4a8; border-color: #86b596 !important; }
.legend-best { background: var(--green); border-color: var(--green) !important; }
.participant-card .primary-button { height: 48px; font-size: 13px; }
.secondary-button { width: 100%; padding: 13px 5px 3px; border: 0; color: var(--green); background: none; cursor: pointer; font-size: 12px; font-weight: 700; }

.select-field { display: grid; gap: 7px; min-width: 0; }
.select-field > span { color: #4e5c55; font-size: 12px; font-weight: 700; }
.select-field select { width: 100%; height: 44px; padding: 0 10px; border: 1px solid #d3dcd5; border-radius: 9px; outline: 0; color: var(--ink); background: white; font-family: inherit; font-size: 14px; cursor: pointer; }
.select-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,98,72,.09); }
.time-range-row { display: grid; grid-template-columns: 1fr 20px 1fr; gap: 7px; align-items: end; }
.range-arrow { height: 44px; display: grid; place-items: center; color: var(--green); font-size: 16px; }

.schedule-card { min-width: 0; overflow: hidden; }
.schedule-toolbar { height: 72px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; border-bottom: 1px solid #e4e2db; }
.segmented { display: flex; padding: 3px; border-radius: 9px; background: #efeee8; }
.segmented button { padding: 9px 16px; border: 0; border-radius: 7px; color: #69746e; background: transparent; cursor: pointer; font-size: 12px; }
.segmented button.active { color: var(--green); background: white; box-shadow: 0 2px 7px rgba(25,50,39,.09); font-weight: 700; }
.segmented span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-right: 4px; border-radius: 99px; color: white; background: var(--green); font-size: 11px; font-weight: 700; }
.toolbar-note { color: #6f7b74; font-size: 11px; }
.swipe-note { display: none; }
.schedule-scroll { overflow: auto; direction: ltr; scrollbar-color: #bccbc0 transparent; }
.schedule-grid { min-width: 650px; display: grid; user-select: none; direction: ltr; }
.date-head { position: sticky; top: 0; z-index: 3; height: 70px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-left: 1px solid #e4e3de; border-bottom: 1px solid #dddcd6; background: #faf9f5; direction: rtl; }
.date-head b { margin-bottom: 5px; font-size: 13px; }
.date-head span { color: var(--muted); font-size: 11px; }
.date-head.today { color: var(--green); background: #f0f5ef; }
.time-corner { position: sticky; top: 0; left: 0; z-index: 5; background: #faf9f5; border-left: 1px solid #e4e3de; border-bottom: 1px solid #dddcd6; }
.time-label { position: sticky; left: 0; z-index: 2; height: 32px; display: flex; align-items: flex-start; justify-content: center; padding-top: 5px; border-left: 1px solid #deded9; background: #faf9f5; color: #56635c; font-size: 11px; direction: rtl; }
.slot { position: relative; height: 32px; border: 0; border-left: 1px solid rgba(214,216,211,.8); border-bottom: 1px solid rgba(222,223,218,.7); background: white; cursor: cell; touch-action: manipulation; }
.slot.hour { border-bottom: 2px solid #9aa39b; }
.time-label.hour { border-bottom: 2px solid #9aa39b; }
.slot:hover { box-shadow: inset 0 0 0 1px rgba(31,98,72,.25); }
.slot.mine { background: #9bc4a8; }
.slot.result-1 { background: #eaf1ec; }
.slot.result-2 { background: #bad4c0; }
.slot.result-3 { background: #76a987; }
.slot.result-4 { background: #39775a; }
.slot.result-best { background: #18583f; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.slot.result-view { cursor: pointer; }
.slot-count { display: grid; place-items: center; width: 100%; height: 100%; font-size: 10px; font-weight: 700; color: rgba(20,39,31,.55); pointer-events: none; }
.slot.result-3 .slot-count, .slot.result-4 .slot-count, .slot.result-best .slot-count { color: rgba(255,255,255,.92); }
.schedule-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 22px; border-top: 1px solid #e3e2dc; color: #5f6b65; font-size: 11px; }
.schedule-footer b { margin-right: 3px; color: var(--green); }

.toast { position: fixed; z-index: 20; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; min-width: 260px; padding: 12px 15px; border: 1px solid rgba(31,98,72,.2); border-radius: 12px; background: #fff; box-shadow: 0 16px 40px rgba(25,48,38,.18); opacity: 0; transform: translateY(18px); pointer-events: none; transition: .3s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 10px; }
.toast p { margin: 0; font-size: 13px; }
/* Empty results prompt */
.results-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; margin: 8px 24px; padding: 34px 20px; border: 1px dashed #d3ddd5; border-radius: 14px; background: #fbfdfb; animation: fadeSlide .3s ease both; }
.results-empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 12px; background: var(--green-pale); color: var(--green); font-size: 20px; }
.results-empty b { font-size: 15px; }
.results-empty small { max-width: 320px; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* Sticky save action on phones — save right after painting, no scrolling back up */
.mobile-save { position: fixed; z-index: 18; left: 14px; right: 14px; bottom: 14px; display: none; align-items: center; justify-content: center; gap: 8px; height: 52px; border: 0; border-radius: 13px; color: #fff; background: var(--green); box-shadow: 0 12px 30px rgba(31,98,72,.34); font-size: 14px; font-weight: 700; cursor: pointer; animation: fadeSlide .25s ease both; }
.mobile-save span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.22); font-size: 12px; }

.toast.error { border-color: rgba(179, 38, 30, .35); }
.toast.error > span { background: var(--error); }
.toast.error p { color: var(--error); }

dialog { width: min(470px, calc(100% - 32px)); padding: 34px; border: 0; border-radius: 20px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(18,34,27,.35); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 14px; left: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f0eee8; cursor: pointer; }
.dialog-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--green); }
dialog h2 { margin: 18px 0 24px; font-size: 21px; }
dialog ol { display: grid; gap: 19px; padding: 0; margin: 0; list-style: none; }
dialog li { display: flex; gap: 13px; align-items: flex-start; }
dialog li > b { flex: 0 0 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-pale); font-size: 10px; }
dialog strong, dialog small { display: block; }
dialog strong { margin: 2px 0 4px; font-size: 14px; }
dialog small { color: var(--muted); line-height: 1.8; font-size: 12px; }

/* Best-time callout */
.best-time { display: none; align-items: center; gap: 12px; margin: 16px 24px 0; padding: 13px 16px; border: 1px solid #cfe3d4; border-radius: 13px; background: linear-gradient(180deg, #f2f8f2, #eaf3ec); }
.best-time.show { display: flex; animation: fadeSlide .3s ease both; }
.best-badge { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--green); font-size: 16px; }
.best-body b { display: block; margin-bottom: 2px; font-size: 14px; color: var(--green-dark); }
.best-sub { display: block; margin-bottom: 8px; color: #5c6b62; font-size: 12px; }
.best-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.best-ranges span { padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #d3e3d7; color: var(--ink); font-size: 12px; font-weight: 700; }

/* Slot detail — who is and isn't free at the hovered/tapped time */
.slot-detail { margin: 14px 24px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfb; }
.slot-detail-hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.slot-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.slot-detail-head b { font-size: 14px; }
.slot-detail-head span { color: var(--green); font-size: 12px; font-weight: 700; }
.slot-detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slot-detail-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.slot-detail-yes .slot-detail-label { color: var(--green); }
.slot-detail-no .slot-detail-label { color: #a08d84; }
.slot-detail ul { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.slot-detail li { padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.slot-detail-yes li { background: #e7f1ea; color: var(--green-dark); }
.slot-detail-no li { background: #f1eeea; color: #7c726b; }
.slot-detail-none { color: #b3aaa4; font-size: 13px; }

.site-footer { width: min(1180px, calc(100% - 48px)); display: flex; justify-content: center; gap: 8px; margin: 0 auto; padding: 22px 0 30px; color: #7b8580; font-size: 11px; }
.site-footer > * + *::before { content: "·"; margin-left: 8px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--green); }

/* Legal / content pages (privacy) */
.legal { width: min(760px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 70px; }
.legal h1 { font-size: 30px; margin: 0 0 6px; }
.legal-updated { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.legal h2 { font-size: 18px; margin: 26px 0 8px; }
.legal p, .legal li { color: #3a443e; font-size: 15px; line-height: 1.95; }
.legal ul { margin: 0; padding-right: 20px; }
.legal a { color: var(--green); }
.legal .back { display: inline-block; margin-top: 30px; font-weight: 700; text-decoration: none; }

/* Share channels */
.share-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.share-channel { flex: 1 1 auto; min-width: 108px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 700; transition: .2s; }
.share-channel span { font-size: 14px; }
.share-channel.native { flex-basis: 100%; }
.share-channel.tg:hover { border-color: #aacbe6; background: #eef6fc; color: #1c6aa6; }
.share-channel.wa:hover { border-color: #a7d8b4; background: #eef9f0; color: #1c8a4a; }
.share-channel.em:hover { border-color: #d8c39a; background: #fbf6ea; color: #8a6d1e; }
.share-channel.sm:hover { border-color: #b9c4bd; background: #f1f5f2; color: var(--green); }
.share-channel.native:hover { border-color: #b9c9bd; background: #f6f9f6; color: var(--green); }

@media (max-width: 900px) {
  .setup-view { grid-template-columns: 1fr; gap: 40px; padding-top: 42px; }
  .hero-copy { text-align: center; padding: 0; }
  .eyebrow { justify-content: center; }
  .hero-copy > p { margin-left: auto; margin-right: auto; }
  .event-topbar { align-items: flex-start; gap: 20px; }
  .event-layout { grid-template-columns: 1fr; }
  /* On narrow screens show the time grid first, then the name + save below it */
  .participant-card { position: static; order: 2; }
  .schedule-card { order: 1; }
}

@media (max-width: 620px) {
  .site-header { width: calc(100% - 28px); height: 75px; }
  .brand small, .text-button { display: none; }
  .pill-button { padding: 9px 12px; }
  .setup-view, .event-view { width: calc(100% - 24px); }
  .setup-view { padding: 34px 0 45px; }
  .hero-copy h1 { font-size: 43px; }
  .setup-card { padding: 24px 18px; border-radius: 18px; }
  .creator-window-head { flex-direction: column; gap: 5px; }
  .creator-window-head small { max-width: none; text-align: right; font-size: 12px; }
  .day-button { width: 40px; height: 42px; }
  .quick-row > span { display: none; }
  /* Bigger, thumb-friendly grid cells on phones */
  .slot, .time-label { height: 44px; }
  .time-label { padding-top: 7px; }
  .event-topbar { flex-direction: column; }
  .invite-bar { gap: 14px; padding: 14px; }
  .event-title-block h1 { font-size: 22px; }
  .schedule-toolbar { padding: 0 12px; }
  .toolbar-note { display: none; }
  .swipe-note { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 12px; border-bottom: 1px solid #e4e2db; color: #68756e; background: #f4f7f3; font-size: 11px; }
  .swipe-note span { color: var(--green); font-size: 14px; }
  .legend { margin-left: 14px; margin-right: 14px; }
  /* 16px inputs stop iOS Safari from zooming in on focus */
  .input-shell input, .select-field select { font-size: 16px; }
  .best-time, .slot-detail { margin-left: 14px; margin-right: 14px; }
  .participant-card { padding: 24px 20px; }
  .schedule-footer { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
  .toast { right: 14px; left: 14px; bottom: 14px; }
  .mobile-save.show { display: flex; }
  /* lift the toast above the sticky save bar when it's present */
  .mobile-save.show ~ .toast { bottom: 78px; }
  .site-footer { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
