:root {
  --bg: #f6f6f4; --card: #fff; --ink: #24262a; --muted: #62666d; --line: #dfe0e2; --accent: #1f6f8b; --accent-ink: #fff; --accent-soft: #e4f1f5;
  --good: #1d7a46; --good-soft: #e3f4ea; --warn: #8a5a00; --warn-soft: #fbf0da; --bad: #b3322a; --bad-soft: #fbe6e4; color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0; }
p { margin: 0 0 10px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden-field { position: absolute; left: -9999px; height: 1px; width: 1px; overflow: hidden; }
#top { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#top:empty { display: none; }
#top img { width: 44px; height: 44px; }
#top .who { margin-left: auto; font-size: 14px; color: var(--muted); }
#view { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: none; background: none; border-radius: 0; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.narrow { max-width: 460px; margin: 0 auto; }
.brand { text-align: center; margin: 12px 0 18px; }
.brand img { width: 120px; height: 122px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.top-gap { margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); column-gap: 12px; }
button, .btn { font: inherit; font-weight: 600; min-height: 44px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); }
button.link { border: none; background: none; color: var(--accent); padding: 4px 6px; min-height: 32px; }
button:disabled { opacity: .6; cursor: default; }
button.full { width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label.f { display: block; margin-bottom: 14px; font-weight: 600; font-size: 15px; }
label.f small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; }
input, select, textarea { font: inherit; font-weight: 400; color: inherit; width: 100%; min-height: 44px; padding: 9px 11px; margin-top: 4px; background: #fff; border: 1px solid #b9bbc0; border-radius: 8px; }
textarea { min-height: 76px; resize: vertical; }
input[type=file] { padding: 8px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line); white-space: nowrap; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.notice { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-soft); }
.error { color: var(--bad); font-size: 14px; margin: 0 0 10px; }
.check { padding: 6px 0; }
.check .done { color: var(--good); font-weight: 700; }
.check .todo { color: var(--muted); }
.person { border-top: 1px solid var(--line); padding: 10px 0; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.score { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.scores div { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.scores b { display: block; font-size: 18px; color: var(--ink); }
.problems { font-size: 14px; color: var(--warn); padding-left: 20px; margin: 8px 0 0; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; background: var(--bg); padding: 8px 10px; border-radius: 8px; display: block; margin: 6px 0; overflow-wrap: anywhere; }
dialog { border: none; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 16px 48px rgba(0, 0, 0, .35); color: var(--ink); }
dialog::backdrop { background: rgba(20, 20, 24, .55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.d-head { padding: 16px 18px 8px; }
.d-body { padding: 8px 18px; overflow-y: auto; flex: 1; }
.d-foot { padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; }

fieldset.checks { border: 0; padding: 0; margin: 0 0 14px; font-weight: 600; font-size: 15px; }
fieldset.checks legend { padding: 0; margin-bottom: 4px; }
.checkrow { display: flex; align-items: center; gap: 8px; font-weight: 400; padding: 5px 0; }
.checkrow input { width: 18px; height: 18px; flex: none; }
fieldset.checks small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; }
