/* Section layouts. Image ratios by record type: event 16:9 / 4:3, person 3:4, team mark 1:1 (R-1). */

/* photos, albums */
.yeargroup { margin-block: 26px; }
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.album { display: flex; flex-direction: column; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.album-cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.album-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; font-size: 14px; }
.album-text strong { font-family: var(--font-display); font-weight: 400; font-size: 18px; text-transform: var(--display-case); letter-spacing: var(--display-track); }
.grid-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.gp { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.whobox { padding: 14px 16px; margin-bottom: 20px; background: var(--surface); border-left: 3px solid var(--accent); }
.strip { display: flex; gap: 6px; overflow-x: auto; }
.strip img, .strip a { width: 120px; height: 84px; flex-shrink: 0; display: block; }

/* photo viewer */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) { .viewer { grid-template-columns: minmax(0, 1fr) 320px; } }
.viewer-img { position: relative; background: #000; }
.viewer-img .ph { height: auto; max-height: 72vh; object-fit: contain; }
.frame-mark { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); display: none; }
.frame-mark b { position: absolute; left: -2px; top: -24px; background: #fff; color: #111; font: 600 12px/1 var(--font-body); padding: 5px 7px; }
.show-marks .frame-mark { display: block; }
.editing .frame-mark { border-style: dashed; }
.viewer-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wholist { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); margin-block: 12px; }
.wholist ol { margin: 0; padding-left: 22px; }

/* event */
.teamcols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.teamcol h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.teamcol ul, .evlist, .storylist, .roster { list-style: none; padding: 0; margin: 0; }
.teamcol li, .evlist li, .roster li { padding: 3px 0; }
.storylist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.evlist li.hit a { font-weight: 600; }

/* people */
.grid-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; margin-top: 18px; }
.pcard { display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.portrait { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface-2); margin-bottom: 8px; }
.portrait-crest { display: flex; align-items: center; justify-content: center; }
.portrait-crest .crest { width: 52%; height: auto; }
.portrait-crest .crest-ktf { width: 34% !important; height: auto !important; aspect-ratio: 400 / 880; }
.pnick { font-family: var(--font-display); font-size: 21px; line-height: 1.1; text-transform: var(--display-case); letter-spacing: var(--display-track); }
.pcard .pname { font-size: 14px; }
.personhead { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 560px) { .personhead { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; } }
.personhead .pn .pnick { font-size: clamp(34px, 6vw, 54px); }
.personhead .pn .pname { font-family: var(--font-body); font-size: 20px; text-transform: none; letter-spacing: 0; }
.periods { list-style: none; padding: 0; margin: 0 0 14px; }
.periods li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }

/* memory: calm, no hover, no motion */
.memory .pagehead p { font-size: 18px; }
.memlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 26px; }
.memitem { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.portrait-mem .ph { filter: var(--photo-filter) grayscale(1) brightness(.85); }
.memitem h2 a { color: var(--text); text-decoration: none; }
.memyears { color: var(--muted); letter-spacing: .04em; }
.memteams { font-size: 14px; color: var(--muted); }
.memory * { transition: none !important; }
.memory img { transform: none !important; }

/* timeline */
.tl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tl-year { margin-left: auto; font-size: 14px; color: var(--muted); }
.tl svg { display: block; font-family: var(--font-body); }
.tl-team { font-family: var(--font-label); text-transform: var(--label-case); letter-spacing: var(--label-track); font-size: 11px; fill: var(--muted); }
.tl-name { font-size: 12px; fill: var(--text); }
.tl-name.dim, .tl-bar.dim { opacity: .18; }
.tl-sep { stroke: var(--line); }
.tl-bar { opacity: .85; }
.tl-bar.gone { opacity: .55; }
.tl-guide { stroke: var(--line); stroke-dasharray: 2 4; }
.tl-guide.key { stroke: var(--muted); }
.tl-ev circle { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.tl-ev.key circle { fill: var(--accent); stroke: var(--accent); }
.tl-ev text { font-size: 12px; fill: var(--muted); }
.tl-ev.key text { fill: var(--text); font-weight: 600; }
.tl-axis text { fill: var(--muted); font-size: 12px; }
.tl-axis path, .tl-axis line { stroke: var(--line); }
.tl-cursor { stroke: var(--accent); stroke-width: 1.5; }
.tl-y { margin-block: 18px; }
.tl-y ul { padding-left: 18px; margin: 0 0 6px; }

/* calendar */
.calbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.mgrid { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 12px; }
.mgrid th, .mgrid td { border: 1px solid var(--line); padding: 3px 4px; vertical-align: top; }
.mgrid thead th { font-family: var(--font-label); text-transform: var(--label-case); letter-spacing: .06em; color: var(--muted); font-weight: 400; }
.mgrid tbody th { text-align: left; color: var(--muted); font-variant-numeric: tabular-nums; width: 48px; }
.mgrid tr.hit th { color: var(--accent-ink); background: var(--accent); }
.mgrid td { height: 30px; width: 7.5%; }
.calev { display: block; font-size: 11px; line-height: 1.25; padding: 2px 4px; margin-bottom: 2px; background: var(--surface-2); color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calev.hit { background: var(--accent); color: var(--accent-ink); }
.calev.off { opacity: .35; }
.ystrip { display: flex; gap: 4px; padding-bottom: 6px; }
.ycell { flex: 0 0 58px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; font: inherit; font-size: 13px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; }
.ycell .dots { display: flex; gap: 3px; min-height: 7px; }
.ycell i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: block; }
.ycell.hit { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ycell.hit i { background: var(--accent-ink); }
.ycell.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.yearpanel { margin-top: 16px; }
.calfound { margin-top: 14px; }

/* teams */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 8px 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.teamhead { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 560px) { .teamhead { grid-template-columns: 90px minmax(0, 1fr); gap: 14px; } }
.teamcrest { display: flex; justify-content: center; aspect-ratio: 1; align-items: center; background: var(--surface); border: 1px solid var(--line); }
.teamcrest .crest { width: 72%; height: auto; }
.teamcrest .crest-ktf { width: 36% !important; height: auto !important; aspect-ratio: 400 / 880; }
.eras { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.era h3 { font-size: 16px; color: var(--muted); }

/* songs */
.songlist { list-style: none; padding: 0; columns: 2 260px; }
.songlist li { padding: 4px 0; break-inside: avoid; }
.songlist .letter { font-family: var(--font-display); font-size: 22px; color: var(--muted); padding-top: 10px; }
.song { max-width: 42rem; }
.sline { margin-bottom: 14px; }
.chords { display: flex; gap: 2.2em; font: 600 14px/1.2 ui-monospace, "Consolas", monospace; color: var(--accent); }
.lyric { font-size: 18px; }

/* admin */
.inbox { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.inbox-item { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.inbox-meta { font-size: 14px; margin-bottom: 6px; }
.upload-grid, .keys-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .upload-grid { grid-template-columns: 360px minmax(0, 1fr); } .keys-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 34px 16px; margin-bottom: 16px; text-align: center;
  border: 2px dashed var(--line); background: var(--surface); cursor: pointer; color: var(--muted); }
.dropzone strong { color: var(--text); }
.albumedit { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.albumedit li { position: relative; display: flex; flex-direction: column; gap: 6px; }
.albumedit img { aspect-ratio: 4 / 3; height: auto; }
.albumedit .handle { position: absolute; right: 6px; top: 6px; background: var(--surface); padding: 0 5px; color: var(--muted); cursor: grab; }
.form { max-width: 760px; display: grid; gap: 4px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend, .labeltext { font-size: 14px; color: var(--muted); margin: 0; }
.fieldrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.prompts { margin: 0; padding: 12px 14px 12px 34px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.prompts li { margin-bottom: 4px; }
.table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table th { font-weight: 400; color: var(--muted); font-size: 13px; }
.status { font-size: 13px; padding: 2px 8px; border: 1px solid var(--line); }
.status.s0 { border-color: var(--accent); color: var(--accent); }
.status.s2 { color: var(--muted); border-style: dashed; }
.qrcard { align-self: start; padding: 20px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.qr { width: 180px; height: 180px; display: block; margin: 12px auto; }
.code { font: 600 22px/1 ui-monospace, "Consolas", monospace; letter-spacing: .12em; }
