/* Mobile first. One column, readable on a phone, widens on a desktop. */
:root { --fg: #1a1a1a; --bg: #fff; --muted: #666; --line: #ddd; --accent: #2a6cb0; --warn: #8a4b00; }
@media (prefers-color-scheme: dark) {
  :root { --fg: #eee; --bg: #121212; --muted: #aaa; --line: #333; --accent: #7fb3ff; --warn: #ffb760; }
}
* { box-sizing: border-box; }
html { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
body { margin: 0; }
a { color: var(--accent); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 1.2rem; }
.site-header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem .9rem; align-items: center; }
.site-header nav a, .site-header nav button { white-space: nowrap; }
.who { color: var(--muted); }
main { max-width: 40rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); }
.error { color: #b00020; }
.badge { color: var(--warn); }
button, input[type=text], input[type=password], input[type=date] { font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: var(--fg); width: 100%; }
button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; }
button.link { background: none; border: none; color: var(--accent); width: auto; padding: 0; text-decoration: underline; }
form.stack { display: grid; gap: .5rem; }
form.stack label { margin-top: .5rem; }
ul.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
ul.cards a { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .5rem; text-decoration: none; color: var(--fg); }
ul.cards .meta { display: block; color: var(--muted); font-size: .9rem; }
dl.attrs { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
dl.attrs dt { color: var(--muted); }
dl.attrs dd { margin: 0; }
table.sizes { width: 100%; border-collapse: collapse; }
table.sizes th, table.sizes td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }
ul.messages { list-style: none; padding: 0; }
.who { text-decoration: none; }
small.help { color: var(--muted); display: block; margin-top: -.25rem; }
small.error { color: #b00020; display: block; }
.qr { max-width: 16rem; margin: 1rem 0; }
.qr svg { width: 100%; height: auto; background: #fff; }
code.secret { word-break: break-all; }
/* Photos (F-009) */
.site-header nav a { text-decoration: none; }
select, textarea, input[type=search], input[type=number] { font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: var(--fg); width: 100%; }
fieldset.group { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem 1rem 1rem; margin: .5rem 0 0; display: grid; gap: .4rem; }
fieldset.group legend { font-weight: 600; padding: 0 .3rem; }
details.new-row { margin-top: .25rem; display: grid; gap: .4rem; }
details.new-row summary { cursor: pointer; color: var(--accent); }
.dropzone { border: 2px dashed var(--line); border-radius: .5rem; padding: 1rem; text-align: center; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.dropzone p { margin: 0 0 .5rem; color: var(--muted); }
.pickers { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.button-like { display: inline-block; text-align: center; padding: .6rem 1rem; border: 1px solid var(--accent); color: var(--accent); border-radius: .4rem; cursor: pointer; }
.button-like.camera { display: none; }
@media (pointer: coarse) { .button-like.camera { display: inline-block; } .dropzone p { display: none; } }
/* Visually hidden but still clickable through its label; Firefox ignores label clicks on display:none file inputs. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
ul.previews { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: .5rem; }
ul.previews .frame { width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: .4rem; }
ul.previews img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
ul.previews button { font-size: .85rem; margin-right: .5rem; }
ul.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; }
ul.grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: .5rem; display: block; }
ul.grid a, ul.grid label { display: block; text-decoration: none; color: var(--fg); }
ul.grid .meta { display: block; color: var(--muted); font-size: .85rem; line-height: 1.3; margin-top: .25rem; }
ul.grid.selectable label { position: relative; cursor: pointer; }
ul.grid.selectable input { position: absolute; top: .5rem; left: .5rem; width: 1.5rem; height: 1.5rem; }
ul.grid.selectable input:checked + img { outline: 3px solid var(--accent); }
ul.suggestions { list-style: none; padding: 0; margin: .25rem 0; display: grid; gap: .25rem; }
ul.suggestions li { display: flex; align-items: center; gap: .5rem; }
figure.photo { margin: 0 0 1rem; }
figure.photo img { width: 100%; height: auto; border-radius: .5rem; display: block; }
.errorbox { border: 1px solid #b00020; color: #b00020; border-radius: .5rem; padding: .75rem 1rem; }
.errorbox ul { margin: .25rem 0 0; padding-left: 1.2rem; }
progress { width: 100%; height: .75rem; }
/* Profiles (F-011) */
.profile .banner, .frame-box { display: block; width: 100%; aspect-ratio: 3 / 1; max-height: 20vh; overflow: hidden; border-radius: .5rem; margin-bottom: 1rem; background: var(--line); }
.profile .banner img, .frame-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-box { cursor: grab; touch-action: none; user-select: none; }
.frame-box.round { width: 12rem; aspect-ratio: 1; max-height: none; border-radius: 50%; }
.frame-box:active { cursor: grabbing; }
input[type=range] { width: 100%; }
.identity { display: flex; gap: 1rem; align-items: center; }
.identity h1, .identity p { margin: 0; }
.identity .edit { margin-left: auto; }
.avatar { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.small { width: 2rem; height: 2rem; vertical-align: middle; margin-right: .4rem; }
.avatar.placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--line); color: var(--muted); font-weight: 700; font-size: 1.5rem; }
.avatar.placeholder.small { font-size: .9rem; }
.avatar.placeholder.big { width: 100%; height: auto; aspect-ratio: 1; border-radius: .5rem; font-size: 2.5rem; }
.byline { display: flex; align-items: center; }
.bio { white-space: pre-wrap; }
.actions { display: flex; gap: 1rem; align-items: center; margin-top: .5rem; }
.actions button { width: auto; }
button.secondary { background: none; color: var(--accent); }
ul.grid.selectable input[type=radio] { position: absolute; top: .5rem; left: .5rem; width: 1.5rem; height: 1.5rem; }
ul.grid.selectable input[type=radio]:checked + img, ul.grid.selectable input[type=radio]:checked + .avatar { outline: 3px solid var(--accent); }
select.narrow { width: auto; }
label.check { display: flex; align-items: center; gap: .5rem; }
label.check input { width: auto; }
.feed-section { padding: .75rem 0; border-top: 1px solid var(--line); }
.feed-section:first-of-type { border-top: none; padding-top: 0; }
.feed-section .byline { margin: 0 0 .5rem; }
.avatar.square { border-radius: .75rem; }
.avatar.small.square { border-radius: .4rem; margin-right: 0; }
.frame-box.square { width: 12rem; aspect-ratio: 1; max-height: none; border-radius: .75rem; }
table.sizes.editing input, table.sizes.editing select { padding: .3rem .4rem; min-width: 4rem; }
table.sizes.editing td { vertical-align: top; }
.glove-card { display: flex; gap: .75rem; align-items: flex-start; }
.glove-card p { margin: 0 0 .25rem; }
dl.attrs.compact { margin: 0; font-size: .9rem; }
.table-scroll { overflow-x: auto; max-width: 100%; }
table.sizes.editing td:nth-of-type(1) { min-width: 8rem; }
table.sizes.editing td:nth-of-type(1) input { margin-top: .25rem; }
