/* Additions for the server-rendered app (on top of app.css). */
.avatar { background: var(--gold); color: var(--forest); }
details.profile > summary { list-style: none; cursor: pointer; }
details.profile > summary::-webkit-details-marker { display: none; }
details.profile .chev { transition: transform .15s; }
details.profile[open] .chev { transform: rotate(180deg); }
details.profile[open] > summary { background: rgba(255,255,255,.14); }
.profile .popover { width: 320px; }
.profile-dl { margin: 0; padding: 16px 20px; display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; font-size: 14px; line-height: 20px; border-bottom: 1px solid var(--sand); }
.profile-dl dt { color: var(--stone); }
.profile-dl dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* Radio / checkbox cards built on real inputs */
.rc { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; min-height: 44px; border: 2px solid var(--sand); background: var(--white); color: var(--forest); cursor: pointer; transition: border-color .15s, background .15s; }
.rc:hover { border-color: var(--rock); }
.rc input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rc__dot { width: 20px; height: 20px; flex: none; margin-top: 1px; border-radius: 9999px; border: 2px solid var(--rock); background: var(--white); transition: all .15s; }
.rc:has(input:checked) { border-color: var(--forest); background: var(--cream); }
.rc:has(input:checked) .rc__dot { border-color: var(--forest); background: var(--forest); box-shadow: inset 0 0 0 4px var(--white); }
.rc:has(input:focus-visible) { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.rc--check .rc__dot { border-radius: 3px; }
.rc--check:has(input:checked) .rc__dot { box-shadow: none; background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; }
.rc__title { display: block; font-weight: 700; font-size: 15px; line-height: 20px; }
.rc__sub { display: block; font-size: 13px; line-height: 18px; color: var(--stone); margin-top: 2px; }
.rc--compact { padding: 10px 12px; align-items: center; font-size: 14px; font-weight: 600; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 180px)), 1fr)); gap: 8px; }

.panel-forest .rc { background: transparent; color: var(--cream); border-color: rgba(250,249,245,.35); }
.panel-forest .rc:hover { border-color: rgba(250,249,245,.7); }
.panel-forest .rc__dot { background: transparent; border-color: rgba(250,249,245,.6); }
.panel-forest .rc:has(input:checked) { border-color: var(--gold); background: rgba(0,0,0,.18); }
.panel-forest .rc:has(input:checked) .rc__dot { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 4px var(--forest); }
.panel-forest .rc--check:has(input:checked) .rc__dot { box-shadow: none; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23265530' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; }
.panel-forest .rc__sub, .panel-forest .field-hint { color: var(--sand); }
.panel-forest .field-error { color: var(--gold); }
.panel-forest .input, .panel-forest .textarea, .panel-forest .select { border-color: transparent; }
.panel-forest .input[aria-invalid="true"] { border-color: var(--gold); box-shadow: none; }

/* Fields that depend on a choice */
.only-temp, .only-custom, .only-teacher, .only-student, .only-staff { display: none; }
form:has(input[name=list][value=temp]:checked) .only-temp,
form:has(input[name=expiry][value=custom]:checked) .only-custom,
form:has(input[name=role][value=teacher]:checked) .only-teacher,
form:has(input[name=role][value=student]:checked) .only-student,
form:has(input[name=role][value=staff]:checked) .only-staff { display: block; }

/* Native dialogs */
dialog.modal { padding: 0; border: 0; color: var(--forest); max-width: min(540px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(22, 50, 32, .55); }
dialog.modal[open] { animation: pop .2s var(--ease); }

.toast--error .toast__icon { background: var(--danger-tint); color: var(--danger); }
.mode-card { display: block; width: 100%; text-align: left; padding: 18px 20px 20px; min-height: 44px; color: var(--forest); background: var(--white); border: 2px solid var(--sand); }
.mode-card:hover { border-color: var(--rock); }
.mode-card.is-active { background: var(--cream); border-color: var(--forest); cursor: default; }
.kv { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--stone); }
.inline-form { display: inline; margin: 0; }
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 20px; font-size: 14px; line-height: 20px; }
.pill-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--rock); background: var(--white); color: var(--forest); font-size: 14px; font-weight: 600; text-decoration: none; }
.pill-link[aria-current="page"] { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.pill-link[aria-current="page"] .chip__n { color: var(--sand); }
