:root {
  color-scheme: light dark;
  --background: #f0f5f3;
  --surface: #ffffff;
  --ink: #162923;
  --muted: #49635b;
  --line: #c7d8d0;
  --accent: #006c56;
  --accent-text: #ffffff;
  --wash: #e5f4ed;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111c18;
    --surface: #1b2924;
    --ink: #f1faf5;
    --muted: #b4cbc0;
    --line: #4d685e;
    --accent: #75dab5;
    --accent-text: #0b241a;
    --wash: #243d33;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); }
main { max-width: 630px; padding: 22px 16px max(32px, env(safe-area-inset-bottom)); margin: 0 auto; }
.header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin: 0 0 20px; }
.brand { display: block; color: var(--accent); font-size: .9rem; font-weight: 750; margin-bottom: 4px; }
h1 { margin: 0; font-size: clamp(1.55rem, 5vw, 2.2rem); line-height: 1.35; }
h2 { margin: 0; font-size: 1.1rem; }
p { line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.language, .photo-picker, .chip, .photo-list button {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.language { min-height: 42px; padding: 0 13px; font-size: .875rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fields { display: grid; gap: 12px; }
.card { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.pair { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 6px; min-width: 0; font-weight: 600; font-size: .91rem; }
select, input:not([type="file"], [type="checkbox"]), textarea {
  width: 100%; min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--background); color: var(--ink); font-size: 1rem; font-weight: 400;
}
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.categories legend { font-size: .91rem; font-weight: 650; margin-bottom: 7px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { position: relative; min-height: 41px; padding: 7px 11px; display: flex; align-items: center; cursor: pointer; }
.chip:has(:checked) { border-color: var(--accent); background: var(--wash); }
.chip:focus-within, label:focus-within .photo-picker { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.photo-picker { padding: 10px 12px; text-align: center; color: var(--accent); cursor: pointer; }
.help { color: var(--muted); font-size: .83rem; margin: -7px 0 0; }
.photo-list { margin: 0; padding: 0; list-style: none; }
.photo-list:empty { display: none; }
.photo-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 4px; }
.photo-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-list button { min-height: 38px; padding: 0 8px; flex-shrink: 0; }
.primary { display: block; width: 100%; min-height: 48px; margin-top: 14px; border: 0; border-radius: 12px;
  padding: 12px; color: var(--accent-text); background: var(--accent); text-align: center; text-decoration: none; font-weight: 700;
}
.primary:disabled { opacity: .62; cursor: wait; }
.notice { display: block; padding: 10px 12px; margin: 12px 0; border-radius: 10px; border: 1px solid var(--line);
  background: var(--wash); color: var(--ink); font-size: .9rem; line-height: 1.6;
}
.success p, .success .primary { margin: 0; }
.success strong { display: inline-block; margin-inline-start: 4px; }
@media (max-width: 320px) { .pair { grid-template-columns: 1fr; } }
