:root {
  color-scheme: light;
  --ink: #172b25;
  --muted: #52635a;
  --green: #123e35;
  --turf: #225545;
  --acid: #d4eea0;
  --ground: #f5f6f1;
  --paper: #fff;
  --line: #ced6cc;
  --danger: #8b2629;
  font-family: "Inter", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: var(--ground);
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.22; letter-spacing: -.055em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); font-weight: 780; }
h2 { font-size: 1.47rem; } h3 { font-size: 1.14rem; }
p { line-height: 1.65; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, .button, .file-choice { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled, input:disabled, textarea:disabled { cursor: progress; opacity: .72; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, .file-choice:focus-within {
  outline: 3px solid #388555;
  outline-offset: 3px;
}
button, input, textarea { border-radius: 5px; }
[hidden] { display: none !important; }
.sr-only, .file-choice input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
.skip { position: fixed; top: 0; left: .5rem; transform: translateY(-150%); z-index: 3; padding: .6rem 1rem; background: var(--paper); color: var(--ink); }
.skip:focus { transform: none; }
.network { position: relative; padding: .65rem 1rem; text-align: center; background: #fff1c7; color: #5d4520; }
svg { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
.header { background: var(--paper); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.header-in { max-width: 78rem; margin: 0 auto; padding: .8rem clamp(1.1rem, 4.6vw, 4rem); display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 4rem); min-height: 76px; }
.brand { display: flex; text-decoration: none; align-items: center; gap: .55rem; flex-shrink: 0; }
.brand img { object-fit: cover; width: 45px; height: 45px; }
.brand span { display: flex; flex-direction: column; font-weight: 820; font-size: 1.26rem; line-height: 1.15; letter-spacing: -.065em; }
.brand small { font-size: .75rem; font-weight: 590; color: var(--muted); margin-top: .19rem; letter-spacing: -.03em; }
.topnav { display: flex; align-items: center; gap: .3rem; }
.topnav a, .access, .account, .icon-btn { display: inline-flex; align-items: center; }
.topnav a { gap: .5rem; color: var(--muted); text-decoration: none; min-height: 44px; padding: .65rem 1rem; font-size: .95rem; border-radius: 5px; font-weight: 650; }
.topnav a[aria-current], .topnav a:hover { color: var(--green); background: #edf3e9; }
.account, .access { margin-left: auto; gap: .65rem; font-size: .875rem; font-weight: 600; }
.account { min-width: 0; }
.account > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account button { flex: none; }
.access { color: var(--muted); }
.icon-btn { width: 44px; height: 44px; justify-content: center; border: 1px solid var(--line); background: var(--paper); color: var(--green); }
.icon-btn:hover { background: var(--ground); }
.main, .auth-main { max-width: 78rem; margin: 0 auto; padding: clamp(1.4rem, 3vw, 2.75rem) clamp(1.1rem, 4.6vw, 4rem) max(3.5rem, env(safe-area-inset-bottom)); }
.main, .auth-main, .header-in {
  padding-left: max(clamp(1.1rem, 4.6vw, 4rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.1rem, 4.6vw, 4rem), env(safe-area-inset-right));
}
main:focus { outline: none; }
.loading { margin: 4rem auto; color: var(--muted); text-align: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem 1.3rem; border: 1px solid transparent; border-radius: 5px; min-height: 47px; font-weight: 700; text-decoration: none; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: #235746; }
.button.lime { color: #172c21; background: var(--acid); }
.button.lime:hover { background: #e3f6c0; }
.full { width: 100%; }
.auth-main { padding-top: clamp(1.8rem, 7vh, 5.5rem); max-width: 72rem; }
.auth-card { background: var(--paper); display: grid; grid-template-columns: 1fr 1.04fr; border: 1px solid var(--line); box-shadow: 0 9px 26px #223d3110; border-radius: 11px; overflow: hidden; }
.club-print { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; min-height: 520px; color: #d7e7c8; overflow: hidden; background: var(--green); }
.club-print::before { content: ''; position: absolute; inset: 20px; border: 1px solid #98baa34d; }
.club-print::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(0deg, transparent, transparent 29px, #c6dfbc0d 30px), repeating-linear-gradient(90deg, transparent, transparent 29px, #c6dfbc0d 30px); z-index: -1; }
.print-logo { display: block; width: 60%; max-width: 285px; height: auto; filter: invert(1); mix-blend-mode: screen; }
.print-corner { width: 18px; height: 18px; border: 2px solid #c6dd97; position: absolute; }
.print-corner.tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.print-corner.br { bottom: 20px; right: 20px; border-top: 0; border-left: 0; }
.print-caption { position: absolute; left: 36px; right: 36px; bottom: 39px; display: flex; align-items: center; justify-content: space-between; font-size: .875rem; font-weight: 600; }
.balls { display: inline-flex; gap: 5px; }
.balls i { width: 9px; height: 9px; border-radius: 50%; background: #f4f1d9; }
.balls i:nth-child(2) { background: #e9c84b; }
.balls i:nth-child(3) { background: #db6b56; }
.auth-fields { padding: clamp(2rem, 5vw, 4.5rem); align-self: center; }
.auth-fields h1 { font-size: clamp(2rem, 3.4vw, 3.1rem); }
.intro, .page-heading > p { color: var(--muted); margin-top: .7rem; }
.auth-fields form { margin-top: 1.85rem; }
label:not(.search, .file-choice) { display: block; font-size: .92rem; font-weight: 660; }
input:not([type=file]), textarea { border: 1px solid #acbbae; padding: .75rem .85rem; min-height: 46px; width: 100%; background: var(--paper); color: var(--ink); font-size: 1rem; font-weight: 450; line-height: 1.45; }
label > input:not([type=file]), label > textarea { display: block; margin-top: .38rem; }
textarea { resize: vertical; min-height: 8rem; }
input::placeholder, textarea::placeholder { color: #68776f; }
form label + label, form .field-help + label { margin-top: 1.05rem; }
form .button { margin-top: 1.3rem; }
.field-help, .hint, .filename { color: var(--muted); font-size: .875rem; }
.field-help { margin-top: .3rem; }
.form-message { background: #eff5e7; border-left: 3px solid var(--turf); margin-top: 1rem; padding: .7rem .85rem; font-size: .95rem; }
.form-message.error { background: #fff0ee; color: var(--danger); border-color: #bd5454; }
.auth-foot { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); font-size: .9rem; }
.auth-foot a, .back, .video-link { color: var(--green); font-weight: 700; text-underline-offset: .2em; }
.auth-foot a { margin-left: .25rem; }
.hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 10px; background: var(--green); color: var(--paper); min-height: 252px; display: flex; align-items: center; }
.hero-copy { z-index: 1; padding: clamp(1.6rem, 4vw, 3.2rem); max-width: 65%; }
.hero-copy h1 { font-size: clamp(2.35rem, 4vw, 3.55rem); }
.hero-copy p { margin: .65rem 0 1.4rem; color: #d8e6d8; }
.table-art { position: absolute; right: -2%; top: -10%; height: 133%; width: 39%; transform: rotate(-16deg); background: #225949; border: 9px solid #173f33; box-shadow: 0 0 0 2px #7d9f79; }
.table-rail { position: absolute; inset: 12px; border: 2px solid #81a480; background-image: linear-gradient(#bfd6b024 1px, transparent 1px), linear-gradient(90deg, #bfd6b024 1px, transparent 1px); background-size: 25% 25%; overflow: hidden; }
.table-rail b { position: absolute; left: 28%; top: 20%; width: 45%; height: 48%; transform: skew(-24deg) rotate(9deg); border: 1px dashed #d0dfb5; border-width: 0 0 1px 1px; opacity: .7; }
.ball { position: absolute; width: clamp(16px, 2vw, 27px); aspect-ratio: 1; border-radius: 50%; box-shadow: 3px 4px 0 #10291f77; z-index: 1; }
.ball.white { background: radial-gradient(circle at 30% 25%, #fffef6, #c3c8b4); top: 20%; left: 34%; }
.ball.yellow { background: radial-gradient(circle at 30% 25%, #ffe8a0, #d5ac26); top: 65%; left: 17%; }
.ball.red { background: radial-gradient(circle at 30% 25%, #f58f74, #ba5246); top: 66%; left: 61%; }
.collection { margin-top: clamp(1.8rem, 4vw, 3.7rem); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-head h2 { display: flex; gap: .6rem; align-items: baseline; }
.count { color: var(--muted); font-size: 1rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: .4rem; width: min(100%, 20rem); padding: 0 .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.search:focus-within { outline: 2px solid var(--turf); }
.search input { margin: 0 !important; padding-left: .25rem; background: transparent; border: 0; }
.search input:focus { outline: none; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.card, .panel, .member, .empty { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.card { overflow: hidden; }
.card:focus-within { outline: 3px solid #388555; }
.card a { height: 100%; display: block; text-decoration: none; }
.card a:hover h3 { text-decoration: underline; text-underline-offset: .2em; }
.card-image { background: #e0e7dc; aspect-ratio: 1.9; }
.card-image img { display: block; height: 100%; width: 100%; object-fit: cover; }
.card-copy { padding: 1.1rem; }
.card-copy p { margin: .5rem 0 1.1rem; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.metadata { display: flex; gap: .42rem .75rem; flex-wrap: wrap; color: var(--muted); font-size: .875rem; }
.empty { padding: clamp(2rem, 6vw, 4.6rem) 1rem; text-align: center; }
.empty-icon { color: var(--turf); background: #edf3e7; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 1rem; }
.empty-icon svg { width: 25px; height: 25px; }
.empty p { color: var(--muted); margin-top: .5rem; }
.back { display: inline-block; padding: .45rem 0; font-size: .9rem; }
.page-heading { margin: .9rem 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-heading h1 { font-size: clamp(2.05rem, 3.6vw, 3rem); }
.page-heading .metadata { margin-top: .85rem; }
.panel { padding: clamp(1.2rem, 2.5vw, 2rem); min-width: 0; }
.panel h2 { margin-bottom: 1.35rem; font-size: 1.28rem; }
.upload-form, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.detail-grid { grid-template-columns: 1.3fr 1fr; }
.detail-photo img, #photo-preview img { display: block; width: 100%; height: auto; object-fit: contain; max-height: 65vh; background: #eaf0e8; border-radius: 4px; }
.question p { white-space: pre-wrap; }
.video-link { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.3rem; min-height: 44px; }
.file-area { border: 1px dashed #9aad9c; background: #f7f9f3; border-radius: 6px; padding: 1.4rem; text-align: center; }
.file-choice { position: relative; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .6rem 1rem; border: 1px solid #a5b7a6; border-radius: 5px; background: var(--paper); color: var(--green); font-weight: 650; }
.file-choice:hover { background: #eef4ea; }
#photo-error { color: var(--danger); }
[data-camera-choice] { display: none; }
@media (pointer: coarse) {
  [data-camera-choice] { display: inline-flex; vertical-align: middle; }
  .file-area .file-choice { margin: .2rem; vertical-align: middle; }
}
.hint { margin-top: .7rem; }
.filename { margin: .5rem 0 1rem; }
.fields label small { color: var(--muted); font-weight: 450; font-size: .875rem; }
.member-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.member { padding: 1.3rem; }
.member-name { display: flex; align-items: center; gap: .8rem; }
.avatar { background: #e8f0df; color: var(--green); width: 45px; height: 45px; border-radius: 50%; display: grid; place-items: center; font-size: .875rem; font-weight: 700; flex-shrink: 0; }
.member-name h2 { font-size: 1.12rem; }
.member-name small { display: inline-block; margin-top: .32rem; color: var(--muted); }
.member dl { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); display: flex; gap: 1.4rem; flex-wrap: wrap; }
.member dt, .member dd { font-size: .875rem; }
.member dt { color: var(--muted); margin-bottom: .25rem; }
.error-page h1 { font-size: 1.7rem; }
.error-page p { margin: 1rem 0; }
@media (max-width: 850px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-fields { padding: 2rem; }
  .club-print { min-height: 450px; }
  .header-in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem; min-height: 65px; padding-block: .55rem; }
  .topnav { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: .3rem; border-top: 1px solid var(--line); }
  .topnav a { justify-content: center; text-align: center; padding: .4rem; }
  .account { max-width: 100%; }
}
@media (max-width: 640px) {
  .topnav { gap: .15rem; }
  .topnav a { padding-inline: .12rem; font-size: .9rem; }
  .topnav svg { display: none; }
  .brand img { width: 39px; height: 39px; }
  .account > span { font-size: .85rem; }
  .auth-main { padding-top: 1.2rem; }
  .auth-card, .upload-form, .detail-grid, .member-list { grid-template-columns: 1fr; }
  .club-print { min-height: 120px; justify-content: flex-start; }
  .club-print::before { inset: 10px; }
  .print-corner.tl { top: 10px; left: 10px; }
  .print-corner.br { bottom: 10px; right: 10px; }
  .print-logo { width: 90px; margin-left: 26px; }
  .print-caption { left: auto; right: 25px; bottom: 50%; transform: translateY(50%); flex-direction: column; align-items: end; gap: .45rem; }
  .auth-fields { padding: 1.6rem 1.25rem; }
  .hero { min-height: 205px; }
  .hero-copy { max-width: 76%; padding: 1.2rem; }
  .hero-copy p { font-size: .95rem; }
  .table-art { width: 37%; right: -8%; height: 115%; top: 4%; opacity: .85; }
  .section-head { align-items: start; flex-direction: column; }
  .search { width: 100%; }
  .cards { grid-template-columns: 1fr; }
}
.admin-management { margin-top: 1.6rem; }
.admin-management select {
  appearance: none;
  display: block;
  margin-top: .4rem;
  min-height: 46px;
  max-width: 100%;
  width: 28rem;
  padding: .7rem 2.7rem .7rem .85rem;
  border: 1px solid #acbbae;
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  background-color: white;
  background-image: linear-gradient(45deg, transparent 50%, #41634c 50%), linear-gradient(135deg, #41634c 50%, transparent 50%);
  background-position: calc(100% - 19px) center, calc(100% - 13px) center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.admin-management select:focus-visible { outline: 3px solid #388555; outline-offset: 3px; }
.admin-management .button:not(.primary) { background: var(--paper); color: var(--green); border-color: #a5b7a6; }
.admin-management .button:not(.primary):hover { background: #f2f6eb; }
.admin-management form, .admin-management [data-invite-panel] { margin-block: 1rem; padding-block: 1rem; border-block-start: 1px solid var(--line); }
.admin-management form { display: grid; gap: .9rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-management form label, .admin-management form button { margin: 0; }
.admin-management form button { width: max-content; }
.admin-management [data-invite-panel] .hint { margin-block: .6rem 1rem; }
.admin-management [data-issued] { margin-block: 1rem; }
.admin-management [data-issued] button { margin-top: .7rem; }
.admin-management [data-deactivate] { color: var(--danger) !important; }
@media (max-width: 700px) {
  .admin-management form { grid-template-columns: 1fr; }
}
.topnav { min-width: 0; }
select {font:inherit;max-width:100%;color:var(--ink);border:1px solid #a8b6ab;background-color:var(--paper);border-radius:5px;padding:.55rem .7rem;min-height:44px}
.home-feed,.collection-filters,.study-nav{display:flex;gap:1.25rem;flex-wrap:wrap}
.home-feed{padding:1.1rem 0;border-bottom:1px solid var(--line)}
.home-feed h2{font-size:1rem;margin-bottom:.3rem}
.home-feed a{font-size:.95rem;color:var(--green)}
.collection-filters{margin:.35rem 0 1.1rem;gap:.8rem}
.collection-filters label{font-size:.88rem}.collection-filters select{margin-left:.45rem}
.study-nav{margin-top:1.6rem;border-block-end:1px solid var(--line);gap:.5rem}
.study-nav button{font-weight:650;min-height:44px;padding:.65rem .85rem;border:0;background:transparent;color:var(--muted)}
.study-nav button[aria-pressed=true]{background:var(--green);color:white}
.study-pane,.result-records{margin-top:1.4rem}
.results-layout{display:grid;grid-template-columns:minmax(16rem,.8fr) minmax(0,1.5fr);gap:1.2rem}
.results-layout form,.roster-forms{display:grid;gap:.75rem;margin-top:1rem}
.results-layout label{display:grid;gap:.35rem}.results-layout h3{margin-block:1.2rem .4rem}
.trend { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem .5rem; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-scale, .trend-dates { display: flex; justify-content: space-between; }
.trend-scale { flex-direction: column; align-items: end; padding-block: .8rem 0; }
.trend-plot { display: block; width: 100%; height: 6.5rem; overflow: visible; border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--green); }
.trend-dates { grid-column: 2; gap: .4rem; }
.table-scroll{overflow-x:auto}.result-records table{width:100%;border-collapse:collapse;margin-top:1rem}
.result-records th,.result-records td{text-align:left;padding:.6rem;border-bottom:1px solid var(--line)}
.record-field { display: none; }
.roster-forms{grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:1.3rem}
summary{cursor:pointer}
@media (max-width: 800px) {
  .results-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .collection-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .collection-filters label { min-width: 0; }
  .collection-filters select, .results-layout select { display: block; width: 100%; margin: .35rem 0 0; }
  .study-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2rem; }
  .study-nav button { padding-inline: .25rem; }
  .back, .auth-foot a { display: inline-flex; min-height: 44px; align-items: center; }
  .admin-management summary { min-height: 44px; padding-block: .65rem; }
  .results-layout form label + label { margin-top: 0; }
  .result-records table, .result-records tbody { display: block; }
  .result-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .result-records tr { display: grid; gap: .45rem; border-top: 1px solid var(--line); padding: 1rem 0; }
  .result-records td { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .4rem; padding: 0; border: 0; }
  .result-records .record-field { display: inline; color: var(--muted); font-size: .9rem; }
  .result-records .record-action { display: block; margin-top: .25rem; }
}
@media (max-width: 640px), (pointer: coarse) {
  .collection-filters select, .results-layout select, .admin-management select { font-size: 1rem; }
}
