:root {
  color-scheme: light;
  font: 16px/1.45 Geist, Inter, system-ui, sans-serif;
  color: #24261f;
  background: #f7f6f2;
  --paper: #fffefa;
  --muted: #555950;
  --border: #deded4;
  --primary: #344c37;
  --selected: #edf2e9;
  --focus: #52724a;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 280px; margin: 0; }
h1, h2, p { margin: 0; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .57; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.review { width: min(100%, 820px); margin: 0 auto; padding: clamp(25px, 5vw, 56px) 20px 65px; }
.menu { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; border-bottom: 1px solid var(--border); margin: 0 0 23px; padding: 0 0 9px; }
.menu-links { display: flex; align-items: center; gap: 16px; min-height: 34px; }
.menu a, .video-list a, .status-cards a { color: var(--primary); text-underline-offset: .2em; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 620; text-decoration: none; }
.menu a:hover, .menu a[aria-current] { text-decoration: underline; }
.menu .sign-out { padding-inline: 0; border: 0; color: var(--muted); background: transparent; }
.menu .sign-out:hover:not(:disabled) { text-decoration: underline; }
.new-video { margin: 0; }
.new-video > summary { margin-left: auto; padding: 7px 9px; border-radius: 7px; background: var(--selected); list-style: none; }
.new-video > summary::-webkit-details-marker { display: none; }
.new-video-form { margin-top: 5px; }
.new-video-form input { width: min(100%, 290px); }
.add-media { margin-top: 21px; }
h1 { margin: 0 0 27px; font-size: clamp(27px, 5vw, 42px); line-height: 1.13; font-weight: 680; letter-spacing: -.05em; }
h2, legend { font-size: 21px; line-height: 1.2; font-weight: 660; letter-spacing: -.025em; }
.section + .section { margin-top: 32px; }
.section > h2, legend { margin-bottom: 12px; }
fieldset { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }

.choice {
  min-width: 0;
  min-height: 51px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
  gap: 12px;
  align-items: center;
  padding: 4px 9px 4px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--paper);
}
.choice:has(:checked):not(.is-approved) { border-color: #a18c67; background: #f4efe4; }
.choice.is-approved { border-color: #47744c; box-shadow: inset 0 0 0 1px #47744c; background: var(--selected); }
.choice label { min-width: 0; min-height: 44px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.choice label span { min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }
.choice input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--primary); cursor: pointer; }
.choice audio { width: 100%; height: 38px; }
.choice.new-choice { grid-template-columns: 1fr; margin-top: 2px; }
.choice-name { margin-top: 11px; font-size: 14px; font-weight: 620; }
.active-media { display: block; width: 100%; max-height: 60vh; margin-top: 12px; border-radius: 10px; background: #20221f; }

.field { min-width: 0; display: grid; gap: 5px; margin-top: 8px; }
.field > span { font-size: 14px; font-weight: 620; }
input[type="text"], input[type="password"], textarea, select { width: 100%; padding: 8px 10px; border: 1px solid #84887f; border-radius: 7px; color: inherit; background: var(--paper); }
textarea { min-height: 76px; resize: vertical; }
button { min-height: 44px; padding: 6px 11px; border: 1px solid #cfcfc3; border-radius: 7px; color: inherit; background: var(--paper); font-size: 14px; }
button.primary { padding-inline: 13px; border-color: var(--primary); color: white; background: var(--primary); font-weight: 620; }
button.primary:hover:not(:disabled) { background: #273d2b; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.form-status, .muted { color: var(--muted); font-size: 14px; }
.form-status.error { color: #9d341c; }
.status-row { margin-top: 8px; }
.status-row span { display: block; color: #24261f; white-space: pre-wrap; }

.frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(64vw, 155px), 1fr)); gap: 10px; }
.frames button { min-width: 0; display: grid; align-content: start; gap: 0; overflow: hidden; padding: 0; text-align: left; }
.frames button:hover { border-color: #84987d; }
.frames button.is-approved { border-color: #47744c; box-shadow: 0 0 0 1px #47744c; }
.frames button.is-approved .frame-caption { background: var(--selected); }
.frames img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #ecece3; }
.frame-caption { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; padding: 7px 8px; overflow-wrap: anywhere; }
.approval-badge, .choice label .approval-badge {
  flex: none;
  padding: 2px 6px;
  border-radius: 4px;
  color: #285535;
  background: #e0efde;
  font-size: 12px;
  font-weight: 650;
}
details { margin-top: 11px; }
summary { width: fit-content; padding: 3px 0; color: var(--primary); font-size: 14px; font-weight: 620; cursor: pointer; }
.frame-form { max-width: 515px; }
.access { margin-top: 17px; }
.access-form { max-width: 420px; }
.access-form > p { margin-top: 6px; }
.upload-result { margin-top: 8px; }
.upload-result ul { margin: 3px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.frame-note { margin-top: 8px; }
.frame-note span { display: block; color: #24261f; white-space: pre-wrap; }
.frame-attachment { margin-top: 6px; }
.video-list, .approval-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.video-list a { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); }
.video-list a:hover { border-color: #84987d; }
.status-cards h2 { font-size: 18px; }
.approval { border: 1px solid var(--border); border-radius: 8px; background: var(--paper); }
.approval:has(:checked), .approval.is-approved { border-color: #8ca083; background: var(--selected); }
.approval-label { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 44px; padding: 7px 10px; font-size: 14px; cursor: pointer; }
.approval-label:has(:disabled) { cursor: default; }
.approval-label.read-only { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.approval-label input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.approval-state { color: var(--muted); font-size: 13px; }
.approval .form-status { padding: 0 10px 7px 35px; }

dialog { max-width: min(1050px, calc(100% - 24px)); max-height: calc(100% - 22px); overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; background: var(--paper); }
dialog::backdrop { background: #1b211ad6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.frame-actions { margin: 0 0 10px; }
dialog img { display: block; max-width: 100%; max-height: calc(100vh - 105px); margin-inline: auto; object-fit: contain; }
noscript { display: block; width: min(100%, 820px); margin: auto; padding: 0 20px; }

@media (max-width: 460px) {
  .review { padding-inline: 15px; }
  h1 { margin-bottom: 21px; }
  .choice { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 3px 9px 6px; }
  .choice audio { height: 35px; }
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
