:root {
  color-scheme: light;
  --ink: #202734;
  --muted: #596579;
  --line: #dfe4ec;
  --blue: #1760c2;
  --blue-light: #edf4ff;
  --green: #216646;
  --green-light: #eaf5ee;
  --amber: #895513;
  --amber-light: #fff5e3;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink);
  background: #f6f8fb;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #1760c2; outline-offset: 3px; }
.skip-link { position: absolute; top: -80px; left: 20px; background: white; padding: 12px; z-index: 5; }
.skip-link:focus { top: 8px; }
.app-header { background: white; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px max(24px, calc((100vw - 1320px) / 2)); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); font-size: 21px; white-space: nowrap; }
.brand strong { font-weight: 650; }
.brand-icon { background: var(--blue); color: white; border-radius: 9px; width: 36px; height: 39px; display: grid; place-items: center; font-weight: 700; box-shadow: inset 0 8px #124c9a; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.owner-badge { color: var(--blue); font-size: 13px; font-weight: 650; background: var(--blue-light); padding: 6px 10px; border-radius: 6px; }
main { max-width: 1320px; margin: auto; padding: 38px 24px 0; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { font-size: clamp(27px, 3vw, 38px); letter-spacing: -.035em; font-weight: 650; margin: 0 0 10px; line-height: 1.15; }
.page-title p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.page-title strong { font-weight: 500; }
.separator { margin: 0 9px; }
.intro { text-align: right; }
.button { display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 40px; border-radius: 7px; border: 1px solid transparent; padding: 9px 14px; font-size: 14px; line-height: 1.3; font-weight: 600; text-decoration: none; transition: background-color .15s ease; }
.primary { background: var(--blue); color: white; }
.primary:hover:not(:disabled) { background: #124c9a; }
.secondary { background: white; color: var(--blue); border-color: #cbd5e3; }
.secondary:hover:not(:disabled), .subtle:hover:not(:disabled), .text:hover:not(:disabled) { background: var(--blue-light); }
.subtle { background: transparent; color: var(--muted); }
.text { background: transparent; color: var(--blue); padding: 6px 8px; min-height: 36px; font-size: 13px; }
.notice { padding: 13px 16px; margin-bottom: 16px; background: var(--blue-light); color: #164b8f; border: 1px solid #bfcef0; border-radius: 7px; line-height: 1.5; overflow-wrap: anywhere; }
.notice.error { background: #fff0ee; border-color: #edc0ba; color: #9a3023; }
.connection { font-size: 12px; color: var(--muted); min-height: 20px; margin-bottom: 12px; }
.identity { display: flex; justify-content: space-between; gap: 32px; align-items: center; background: white; border: 1px solid var(--line); padding: 22px 24px; border-radius: 9px; margin-bottom: 24px; }
.identity strong { font-size: 18px; font-weight: 650; }
.identity p { color: var(--muted); font-size: 14px; margin: 7px 0 0; max-width: 45ch; line-height: 1.5; }
.name-form { width: 370px; flex-shrink: 0; }
label { display: block; font-size: 13px; font-weight: 600; }
.name-form > div { display: flex; gap: 8px; margin: 6px 0; }
input, textarea { border: 1px solid #bbc5d4; background: white; border-radius: 6px; padding: 10px 11px; color: var(--ink); min-width: 0; width: 100%; font-size: 14px; }
input::placeholder, textarea::placeholder { color: #667387; }
input:disabled, textarea:disabled { background: #f3f5f8; }
textarea { resize: vertical; }
small, .small { font-size: 12px; line-height: 1.5; }
.name-form small { color: var(--muted); }
.name-form .button { flex-shrink: 0; }
.joined { display: flex; align-items: center; gap: 12px; font-size: 14px; margin: 0 0 16px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; gap: 24px; }
.calendar-section { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.calendar-toolbar { padding: 22px 22px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
h2 { font-size: 24px; font-weight: 650; letter-spacing: -.025em; margin: 0; }
.calendar-toolbar h2 span { color: var(--muted); font-weight: 400; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); }
.legend span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.available-dot::before { background: #3d9163; }
.proposed-dot::before { background: #b8781e; }
.accepted-dot::before { background: #1760c2; }
.calendar-help { padding: 0 22px; margin: 10px 0 22px; color: var(--muted); font-size: 13px; }
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 12px 0; text-align: center; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.day { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 145px; padding: 10px 7px; background: white; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; min-width: 0; position: relative; }
.day:nth-child(7n) { border-right: 0; }
.day.outside { background: #fafbfd; color: #69758a; cursor: default; }
.day:not(.outside):hover { background: #f6f9fe; }
.day.selected { background: var(--blue-light); box-shadow: inset 0 0 0 2px var(--blue); }
.day-number { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 12px; font-size: 15px; border-radius: 50%; }
.selected .day-number { background: var(--blue); color: white; font-weight: 650; }
.day-summary { display: block; font-size: 10px; line-height: 1.5; color: var(--muted); margin: 5px 0; padding: 3px 4px; overflow-wrap: anywhere; }
.day-summary.available { background: var(--green-light); color: var(--green); border-radius: 4px; }
.day-summary.proposed { background: var(--amber-light); color: var(--amber); border-radius: 4px; }
.day-summary.accepted { background: #e8f0fd; color: #14529f; border-radius: 4px; }
.day-empty { display: block; text-align: center; color: #626f82; font-size: 10px; margin-top: 20px; }
.calendar-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; font-size: 11px; color: var(--muted); }
.how-it-works { padding: 24px 22px; background: #fafbfd; border-top: 1px solid var(--line); }
h3 { font-size: 15px; margin: 0; font-weight: 650; }
.how-it-works p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 9px 0 0; max-width: 70ch; }
.day-panel { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.day-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px; border-bottom: 1px solid var(--line); gap: 8px; }
.day-weekday { font-size: 13px; color: var(--muted); margin: 0 0 5px; }
.day-header h2 { font-size: 25px; }
.day-navigation { display: flex; gap: 4px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); font-size: 18px; }
.icon-button:hover:not(:disabled) { background: var(--blue-light); }
.day-section { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 15px 0 4px; }
.time-slot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; padding: 10px 0; border-top: 1px solid #e7ede9; }
.time-slot > div { flex: 1; }
.slot-time { color: var(--green); font-size: 14px; font-weight: 650; }
.slot-reserved { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.remove-slot { color: #a03a2c; font-size: 12px; }
.count { font-size: 12px; color: var(--muted); }
.event { padding: 15px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border: 0; padding-bottom: 6px; }
.event-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.event-time { font-size: 13px; font-weight: 600; }
.status { border-radius: 4px; font-size: 10px; padding: 4px 6px; font-weight: 650; }
.status.proposed { color: var(--amber); background: var(--amber-light); }
.status.accepted { color: #14529f; background: #e8f0fd; }
.status.declined { color: #61616b; background: #f0f0f3; }
.event h4 { font-size: 15px; margin: 10px 0 5px; line-height: 1.4; overflow-wrap: anywhere; }
.event p { font-size: 12px; line-height: 1.6; margin: 4px 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.event-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.event .google-link { font-size: 12px; padding: 7px 9px; min-height: 34px; }
.archived-toggle { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 15px; font-weight: 400; }
input[type="checkbox"] { width: 15px; height: 15px; }
.proposal-form { padding: 20px; background: #fafbfd; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.proposal-form label { margin: 14px 0 0; }
.proposal-form input, .proposal-form textarea, .inline-form input { margin-top: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.time-fields { display: flex; gap: 12px; }
.time-fields label { flex: 1; min-width: 0; }
.full-width { width: 100%; }
.inline-form { background: var(--blue-light); border-radius: 6px; padding: 14px; margin-top: 12px; }
.inline-form h4 { margin: 0 0 8px; font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
footer { padding: 30px 0; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }
footer span { margin: 0 8px; }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .day { min-height: 150px; }
}
@media (max-width: 800px) {
  .app-header { padding: 14px 16px; flex-wrap: wrap; }
  .brand { font-size: 18px; }
  main { padding: 25px 16px 0; }
  .intro { display: none; }
  .identity { flex-direction: column; align-items: stretch; gap: 18px; padding: 20px; }
  .name-form { width: 100%; }
  .workspace { grid-template-columns: 1fr; gap: 20px; }
  .calendar-toolbar { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 18px 16px 0; }
  .calendar-help { padding: 0 16px; margin-bottom: 16px; }
  .day { min-height: 114px; padding: 8px 3px; }
  .day-summary { font-size: 9px; padding: 3px 2px; }
  .day-number { margin-bottom: 6px; }
  .calendar-footer { padding: 8px 12px; }
  .how-it-works { display: none; }
  .day-panel { scroll-margin-top: 16px; }
  .day-header { padding: 20px; }
}
@media (max-width: 420px) {
  .header-actions { gap: 4px; }
  .header-actions .button { font-size: 12px; padding: 8px 10px; }
  .calendar-toolbar h2 { font-size: 21px; }
  .legend { font-size: 10px; gap: 9px; }
  .day { min-height: 112px; }
  .day-summary { font-size: 9px; }
  .calendar-footer { align-items: flex-start; }
  .calendar-footer > span { max-width: 24ch; line-height: 1.6; }
  .calendar-footer .button { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
