:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #fff;
  --ink: #203229;
  --soft: #57675e;
  --edge: #dce5db;
  --green: #245641;
  --green-light: #e6efe7;
  --amber: #fff2d9;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
.shell { width: min(100% - 32px, 720px); margin-inline: auto; }
.top { background: var(--surface); border-bottom: 1px solid var(--edge); }
.top .shell { display: flex; justify-content: space-between; align-items: center; padding-block: 12px; }
.brand { display: inline-flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 720; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--green-light); color: var(--green); border-radius: 9px; }
main { padding: 21px 0 100px; }
.section-head { margin: 8px 0 22px; }
h1, h2, p { margin: 0 0 8px; }
h1 { font-size: clamp(29px, 7vw, 43px); letter-spacing: -.045em; line-height: 1.1; }
h2 { font-size: 19px; line-height: 1.25; }
.section-head p, .hint, small { color: var(--soft); }
.fields { display: grid; gap: 14px; }
.card { min-width: 0; padding: 17px; background: var(--surface); border: 1px solid var(--edge); border-radius: 16px; }
.card + .card, form + .fields, form + .card, #weekly + .fields, form + .photo-grid, .notice + .fields { margin-top: 12px; }
fieldset { margin: 0; }
legend { font-size: 14px; color: var(--soft); padding: 0 6px; }
label { min-width: 0; display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input, textarea, select, button { font: inherit; }
input:not([type=checkbox]), textarea, select {
  width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #ccd9ce;
  color: var(--ink); border-radius: 9px; background: #fbfcfa;
}
textarea { resize: vertical; }
input[type=checkbox] { margin: 0; width: 17px; height: 17px; accent-color: var(--green); }
input[type=file] { font-size: 14px; }
:focus-visible { outline: 2px solid #4e9677; outline-offset: 3px; }
.check { display: flex; align-items: flex-start; gap: 9px; }
.check input { flex: 0 0 17px; margin-top: 2px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
button, .button {
  background: var(--surface); border: 1px solid #cfdcd0; border-radius: 9px; padding: 8px 13px;
  min-height: 42px; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
}
button:disabled { opacity: .56; cursor: wait; }
.quiet { min-height: 35px; border-color: transparent; background: var(--green-light); font-size: 13px; }
.primary { background: var(--green); border-color: var(--green); color: white; font-weight: 650; }
.danger { color: #962e2e; }
.tabs {
  position: fixed; z-index: 1; bottom: 0; left: 0; right: 0; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--edge); padding: 7px 5px max(7px, env(safe-area-inset-bottom));
}
.tabs a { flex: 0 1 124px; min-width: 0; text-align: center; font-size: 13px; color: var(--soft); text-decoration: none; padding: 11px 1px; border-radius: 9px; }
.tabs a[aria-current] { color: var(--green); background: var(--green-light); font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fields .actions { margin-top: 0; }
.notice, #flash { background: var(--amber); padding: 11px 12px; border-radius: 10px; }
#flash[data-kind=success] { background: var(--green-light); }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
summary { cursor: pointer; }
details > :not(summary) { margin-top: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.photo-grid figure { margin: 0; padding: 8px; }
.photo-grid img { width: 100%; display: block; aspect-ratio: 1; object-fit: contain; border-radius: 9px; background: var(--bg); }
.photo-grid figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px; padding-top: 5px; }
.photo-grid button { min-height: 32px; font-size: 12px; padding: 4px 7px; }
#thread:not(:empty) { margin-bottom: 13px; }
@media (max-width: 350px) { .pair { grid-template-columns: 1fr; } }
