:root { font-family: "Avenir Next", Avenir, system-ui, sans-serif; color: #29233a; background: #f5f3f8; }
* { box-sizing: border-box; }
body { margin: 0; }
.site { --theme: #261b3a; --light: #65417c; --flare: #bf6e95; --ink: #513468; --accent: #e9dcf6; --wash: #f5f3f8; background: var(--wash); min-height: 100vh; padding-bottom: 56px; }
.site[data-theme="foret"] { --theme: #122d2a; --light: #235745; --flare: #7b9c58; --ink: #285943; --accent: #dceee2; --wash: #f0f6f3; }
.site[data-theme="nuit"] { --theme: #102440; --light: #29477e; --flare: #6d7cae; --ink: #304d7c; --accent: #e0e9fc; --wash: #f1f5fb; }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.hero {
  color: white;
  background:
    repeating-radial-gradient(ellipse at 85% 120%, transparent 0 35px, #fff1 36px 37px, transparent 38px 64px),
    radial-gradient(ellipse at 91% 100%, var(--flare), transparent 52%),
    linear-gradient(115deg, var(--theme) 24%, var(--light));
}
.top { min-height: 82px; border-bottom: 1px solid #ffffff33; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: var(--ink); font-size: 24px; }
.top-actions, .week-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.theme-label { display: flex; align-items: center; gap: 7px; font-size: .875rem; }
button, input, textarea, select { font: inherit; }
button { min-height: 42px; cursor: pointer; border: 1px solid #ded8e5; border-radius: 10px; padding: 8px 12px; background: white; color: var(--ink); font-weight: 700; }
button:hover { background: var(--accent); }
button:disabled { opacity: .62; cursor: default; }
.theme-label select { width: auto; min-height: 42px; background-color: white; color: var(--ink); }
.intro { padding-block: 55px 73px; }
h1 { margin: 0; font-size: clamp(3rem, 8vw, 6.1rem); line-height: .97; letter-spacing: -.065em; }
.intro p { max-width: 440px; font-size: 1.1rem; margin: 20px 0 0; }
.workspace { margin-top: -27px; }
.weekbar, .card { background: white; border: 1px solid #e8e2ed; border-radius: 20px; box-shadow: 0 6px 24px #281b3b09; }
.weekbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 20px; margin-bottom: 18px; }
.weekbar span { display: block; font-size: .875rem; color: #625b6c; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.07fr); gap: 18px; align-items: start; }
.card { padding: clamp(16px, 3vw, 28px); }
h2 { margin: 0 0 17px; font-size: 1.55rem; letter-spacing: -.04em; }
h3 { font-size: 1.04rem; margin: 18px 0 10px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
form label { display: block; font-size: .875rem; font-weight: 700; margin-bottom: 12px; min-width: 0; }
input, textarea, select { display: block; max-width: 100%; min-width: 0; width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid #dcd5e3; border-radius: 10px; color: inherit; background: #fbfafd; }
form :is(input, textarea, select) { margin-top: 5px; font-size: 1rem; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23513468' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
:focus-visible { outline: 3px solid #9973c4; outline-offset: 2px; }
.slot { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; background: var(--wash); border-radius: 12px; margin-bottom: 8px; }
.slot label { margin-bottom: 0; }
.remove { grid-column: 1 / -1; justify-self: end; min-height: 30px; padding: 0 10px; font-size: 1.15rem; }
.add { border: 0; padding-inline: 4px; background: transparent; }
.submit { background: var(--ink); color: white; width: 100%; margin-top: 12px; min-height: 48px; }
.submit:hover { background: var(--theme); }
.form-status { margin: 10px 0 0; color: var(--ink); font-size: .9375rem; }
.form-status:empty { display: none; }
.empty { padding: 16px; border-radius: 14px; border: 1px dashed #d7cddd; background: var(--wash); }
.empty h3, .empty p { margin: 0; }
.empty p { margin-top: 5px; }
.muted, .empty p { color: #625b6c; }
.matches, .entries { padding: 0; margin: 0; list-style: none; }
.matches > li, .entries > li { border-radius: 12px; padding: 12px 14px; margin-top: 8px; overflow-wrap: anywhere; }
.matches > li { background: var(--accent); color: var(--ink); }
.matches span { display: block; }
.entries > li { background: var(--wash); }
.entries p { margin: 3px 0 7px; }
.entries ul { margin: 0; padding-left: 20px; }
@media (max-width: 740px) { .columns { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .wrap { width: calc(100% - 28px); }
  .intro { padding-block: 38px 55px; }
  .slot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot .day { grid-column: 1 / -1; }
}

[hidden] { display: none !important; }
#board-status:empty { display: none; }
form fieldset > p { font-size: .875rem; margin: 7px 0 0; }
.intro { position: relative; }
.invite-button { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; padding: 2px 14px 2px 3px; background: #fff; }
.columns { grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr); }
.schedule-scroll { overflow-x: auto; border: 1px solid #e4dce9; border-radius: 12px; }
.schedule { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .875rem; }
.schedule :is(th,td) { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #e8e2ed; }
.schedule thead { background: var(--accent); color: var(--ink); }
.schedule tbody th { min-width: 110px; max-width: 165px; background: var(--wash); }
.schedule tr > th:first-child { position: sticky; left: 0; }
.schedule thead tr > th:first-child { background: var(--accent); }
.schedule tbody tr:last-child > * { border-bottom: 0; }
.row-topic { display: block; font-weight: 400; overflow-wrap: anywhere; }
.table-slot { display: block; white-space: nowrap; margin-bottom: 4px; }
.workshop ul { margin: 6px 0 0; padding-left: 20px; }
.slot-hint { margin-top: 0; font-size: .875rem; }
.day-card { margin-bottom: 7px; padding: 4px 8px 7px; border: 1px solid #e8e2ed; border-radius: 10px; }
.day-card legend { padding-inline: 5px; font-size: .875rem; font-weight: 750; }
.slot-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px; }
.period { background: var(--wash); border-radius: 7px; padding: 4px 6px; min-width: 0; }
form label.period-toggle { display: flex; gap: 5px; align-items: center; min-height: 34px; margin: 0; }
form .period-toggle input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--ink); }
.period-times label { margin: 1px 0 5px; }
.period-times input { padding: 4px; }
.welcome { width: min(410px, calc(100vw - 32px)); border: 0; border-radius: 24px; padding: 28px; color: #29233a; text-align: center; box-shadow: 0 22px 80px #10082059; --ink: #513468; --accent: #e9dcf6; --theme: #261b3a; }
.welcome::backdrop { background: #1c122a88; }
.welcome h2 { margin: 12px 0 8px; font-size: 1.85rem; }
.welcome p { margin: 0; }
.welcome-close { position: absolute; right: 12px; top: 12px; border: 0; font-size: 1.3rem; }
.welcome-figure { border: 0; padding: 0; border-radius: 35px; display: inline-flex; }
@media (max-width: 900px) { .columns { grid-template-columns: minmax(0, 1fr); } }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .mobile-nav { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; padding: 8px 0; margin-bottom: 10px; background: var(--wash); }
  .mobile-nav a { display: grid; flex: 1; place-items: center; min-height: 42px; border-radius: 10px; padding: 6px; background: var(--accent); color: var(--ink); font-size: .875rem; font-weight: 700; text-align: center; }
  #table-card, #form-card { scroll-margin-top: 63px; }
}

.site[data-theme="prune"] { --theme: #174742; --light: #26665d; --flare: #e99d69; --ink: #174742; --accent: #dbefe6; --wash: #f8f5ee; }
.invite-button img { border-radius: 8px; object-fit: cover; }
.welcome { --ink: #174742; --accent: #ffce91; --theme: #113b36; background: #fff8eb; color: #174742; }
.welcome-figure { border-radius: 20px; overflow: hidden; width: min(100%, 290px); }
.welcome-figure img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.welcome-close { color: #174742; }

.site[data-theme="prune"] { --wash: #f6f8f3; --accent: #dceee5; }
#planning .columns { grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); }
#planning .card, .weekbar { border-color: #dfe8df; }
#planning h2 { font-size: 1.45rem; }
.day-overview { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 6px; overflow-x: auto; padding: 4px; margin: -4px; }
.day-tab { color: #184640; display: grid; align-content: start; gap: 4px; text-align: left; padding: 8px 7px; border-color: #dee9e0; background: #f7faf7; font-size: .84rem; }
.day-tab[aria-pressed="true"] { background: #194840; border-color: #194840; color: white; }
.day-date { font-weight: 500; }
.day-stat { display: flex; justify-content: space-between; gap: 3px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.day-stat b { font-variant-numeric: tabular-nums; }
.day-details { margin-top: 19px; }
.day-details h3, #board > h3 { margin: 15px 0 9px; }
.day-details h4 { margin: 15px 0 7px; }
.day-pick { padding: 13px 15px; display: grid; gap: 3px; background: #fff0d8; border: 1px solid #f0d8ad; border-radius: 12px; color: #3d3123; }
.pick-label { font-size: .85rem; font-weight: 700; }
.candidate-list, .week-topics { list-style: none; margin: 0; padding: 0; }
.candidate-list > li { border: 1px solid #dfe8df; border-radius: 12px; padding: 12px; margin-bottom: 8px; overflow-wrap: anywhere; }
.candidate-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.join-button { flex-shrink: 0; font-size: .875rem; border-color: #cee0d4; background: #e9f4ee; }
.candidate-times { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: .875rem; }
.candidate-times dt { font-weight: 650; }
.candidate-times dd { margin: 0; }
.week-topics > li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e3ece4; overflow-wrap: anywhere; }
.week-topics > li span { flex-shrink: 0; }
.full-schedule { margin-top: 15px; }
.full-schedule summary { margin-bottom: 8px; cursor: pointer; color: #174742; font-weight: 650; }
.join-context:empty { display: none; }
.join-context { color: #174742; font-weight: 650; }
:root:has(#planning:not([hidden])) .intro { padding-block: 25px 43px; }
:root:has(#planning:not([hidden])) .intro h1 { font-size: clamp(2rem, 5vw, 3.7rem); }
:root:has(#planning:not([hidden])) .intro h1 br { display: none; }
:root:has(#planning:not([hidden])) .intro h1 br::after { content: " "; }
:root:has(#planning:not([hidden])) .intro .invite-button { position: absolute; right: 0; bottom: 42px; }
@media (max-width: 900px) {
  #planning .columns { grid-template-columns: minmax(0, 1fr); }
  :root:has(#planning:not([hidden])) .intro .invite-button { display: none; }
}
@media (min-width: 901px) and (max-width: 1120px) { .day-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 650px) { .day-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); } .day-tab { padding-inline: 5px; } .day-stat { font-size: .70rem; } }
@media (max-width: 400px) { .day-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.day-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 9px; }
.day-heading h3 { margin: 0; }
.candidate-list h5 { margin: 10px 0 4px; font-size: .875rem; }
.shared-times { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.shared-times li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 5px 8px; background: #edf6ef; border-radius: 8px; font-size: .875rem; }
.shared-times li > span:nth-child(2) { flex: 1 1 auto; }
.pick-button { background: #fff; border-color: #c5d9cc; min-height: 36px; font-size: .8125rem; }
.chosen-tag { font-weight: 700; color: #174742; }

.in-planning { --wash: #f0f5f2; }
.in-planning .hero { color: #173f37; background: #fff; border-bottom: 1px solid #dce6e0; }
.in-planning .intro { display: none; }
.in-planning .top { min-height: 61px; border: 0; }
.in-planning .workspace { margin-top: 24px; }
.in-planning .weekbar { background: transparent; border: 0; box-shadow: none; padding: 0 0 6px; }
.weekbar h1 { font-size: clamp(1.8rem, 5vw, 2.65rem); color: #153d35; margin-bottom: 7px; letter-spacing: -.045em; }
.in-planning #planning .columns { grid-template-columns: minmax(0, 1fr); }
.in-planning #form-card { width: min(100%, 720px); justify-self: center; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.board-head h2 { margin: 0; }
#new-subject { color: #fff; background: #18584a; border-color: #18584a; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { border: 1px solid #d6e4de; border-radius: 11px; background: #f7faf8; overflow: hidden; min-width: 0; }
.week-day[data-active="true"] { border-color: #458271; }
.week-day h3 { margin: 0; }
.week-day .day-tab { width: 100%; border: 0; border-radius: 0; padding: 9px 8px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; background: #e5f0eb; box-shadow: none; }
.week-day .day-tab[aria-pressed="true"] { background: #18584a; color: #fff; }
.day-counts { display: grid; gap: 3px; padding: 7px 8px; background: #f0f6f3; border-bottom: 1px solid #e1ebe6; }
.day-subjects { list-style: none; margin: 0; padding: 0; }
.day-subjects li { display: grid; gap: 4px; padding: 9px 8px; background: #fff; border-bottom: 1px solid #e1ebe6; overflow-wrap: anywhere; }
.day-subjects li:last-child { border-bottom: 0; }
.week-subject { display: flex; align-items: flex-start; gap: 4px; justify-content: space-between; font-size: .88rem; }
.subject-counter { background: #d4efe1; color: #104438; border-radius: 99px; min-width: 1.55em; padding: 1px 4px; text-align: center; font-weight: 800; flex-shrink: 0; }
.week-names, .day-empty { color: #526561; font-size: .81rem; }
.day-empty { margin: 8px; }
.week-join { justify-self: start; min-height: 29px; padding: 3px 6px; font-size: .78rem; color: #135345; background: #f2f8f4; }
#access-form { max-width: 540px; margin-top: 18px; }
#access-form input { margin: 6px 0 10px; }
.resume-link { font-weight: 700; color: #175748; }
@media (max-width: 1020px) { .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.saved-subject:empty { display: none; }
.saved-subject { background: #e0f4e8; border: 1px solid #a8cfb6; border-radius: 10px; padding: 10px 12px; color: #17483a; font-weight: 700; margin: 0 0 12px; scroll-margin-top: 65px; }
.day-subjects li.just-saved { background: #e5f5eb; box-shadow: inset 3px 0 #26815d; }
.saved-tag { font-size: .75rem; color: #175842; font-weight: 700; }
.in-planning #form-card { width: 100%; scroll-margin-top: 68px; }
.registration-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 24px; }
.registration-context { background: #edf5f0; border: 1px solid #d6e6dc; border-radius: 12px; padding: 13px; min-width: 0; }
.registration-context h3 { color: #17483a; margin: 0 0 8px; }
.registration-context p { margin: 0; }
.context-list, .context-names { list-style: none; padding: 0; margin: 0; }
.context-list { display: grid; gap: 8px; max-height: 24rem; overflow: auto; }
.context-list > li { background: #fff; border: 1px solid #dbe9df; border-radius: 8px; padding: 8px; overflow-wrap: anywhere; }
.context-day { border-top: 1px solid #e3eee6; margin-top: 6px; padding-top: 4px; }
.context-day-head, .context-names li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 12px; }
.context-day-head { color: #425e53; font-size: .84rem; }
.context-names li { font-size: .86rem; margin-top: 3px; }
.context-names li span { color: #53655d; }
@media (max-width: 720px) {
  .registration-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .context-list { max-height: 15rem; }
}
.day-counts { margin: 0; color: #425e53; font-size: .8rem; }
.slot-end { display: block; font-size: .85rem; color: #17483a; padding-bottom: 3px; }
.week-time { color: #175548; font-variant-numeric: tabular-nums; }
.week-title { font-size: .9rem; }
.candidate-times dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.day-pick .week-join { justify-self: start; }
.weekly-sheet { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid #dce7e1; border-radius: 12px; overflow: hidden; }
.weekly-sheet :is(th, td) { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid #e3ebe7; overflow-wrap: anywhere; }
.weekly-sheet thead { background: #153f35; color: #fff; }
.weekly-sheet thead th:nth-child(1) { width: 23%; }
.weekly-sheet thead th:nth-child(2) { width: 44%; }
.weekly-sheet tbody th { padding: 0; background: #eaf3ee; }
.weekly-sheet tbody:last-child tr:last-child td { border-bottom: 0; }
.weekly-sheet tbody[data-active="true"] .sheet-day { background: #d6ece0; }
.sheet-day { width: 100%; display: flex; align-items: baseline; gap: 10px; background: transparent; color: #17483a; border: 0; border-radius: 0; min-height: 33px; padding: 6px 10px; text-align: left; }
.sheet-empty { color: #526561; font-size: .85rem; }
.weekly-sheet .week-title, .weekly-sheet .saved-tag { display: block; margin-bottom: 4px; }
.weekly-sheet tr.just-saved td { background: #e6f6ec; }
.sheet-count { display: block; color: #426054; font-size: .8rem; }
.participant-roster { display: grid; gap: 2px; padding: 0; margin: 0; list-style: none; }
.participant-name { border: 0; border-radius: 4px; background: transparent; min-height: 25px; padding: 1px 2px; color: #18584a; text-decoration: underline; text-underline-offset: 2px; font-size: .9rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.participant-dialog { width: min(480px, calc(100% - 36px)); border: 1px solid #d6e6dc; border-radius: 15px; color: #173f37; }
.participant-dialog::backdrop { background: #173f3770; }
.participant-dialog h2 { margin: 0 36px 10px 0; }
.participant-dialog li { margin-bottom: 6px; }
.participant-close { position: absolute; top: 8px; right: 8px; color: #173f37; min-height: 34px; }
@media (max-width: 500px) { .weekly-sheet :is(th, td) { padding-inline: 6px; } .weekly-sheet tbody th { padding-inline: 0; } .weekly-sheet .week-time { font-size: .83rem; } }
#form-card[data-mode="request"] .registration-layout { display: block; }
#form-card[data-mode="request"] { max-width: 760px; }
.cancel-form { width: 100%; margin-top: 7px; }
.withdraw { color: #81272e; border-color: #e5c3c4; background: #fff6f6; }
