:root {
  --ink: #1b2227; --muted: #5d6a70; --paper: #f3f5f4; --card: #ffffff;
  --line: #d5dad8; --accent: #0f6b4b; --accent-ink: #ffffff; --warn: #a15c00;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e8ecea; --muted: #9aa8ad; --paper: #151a1d; --card: #1e2529;
          --line: #333d42; --accent: #3fb68b; --accent-ink: #08130e; --warn: #e0a64a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header.bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem;
             border-bottom: 1px solid var(--line); background: var(--card); }
header.bar .brand { font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; }
header.bar form { margin: 0; }
main { max-width: 52rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
a { color: var(--accent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; }
.flash { background: var(--card); border-left: 4px solid var(--warn); padding: .6rem .8rem; margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
input, select { width: 100%; padding: .6rem; font: inherit; color: inherit; background: var(--paper);
                border: 1px solid var(--line); border-radius: 4px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; }
button, .btn { display: inline-block; padding: .65rem 1.1rem; font: inherit; font-weight: 600;
               background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px;
               cursor: pointer; text-decoration: none; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.muted { color: var(--muted); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .08em; }
.join-code-input { font-size: 1.6rem; text-transform: uppercase; letter-spacing: .15em; text-align: center; }
textarea { width: 100%; padding: .6rem; font: .95rem/1.4 ui-monospace, Menlo, Consolas, monospace; color: inherit;
           background: var(--paper); border: 1px solid var(--line); border-radius: 4px; min-height: 18rem; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.panel + .panel, .panel + details, details + h2 { margin-top: 1rem; }
details.panel summary { cursor: pointer; font-weight: 600; }
.flash.errors { border-left-color: #b00020; }
.flash ul { margin: .4rem 0 0; padding-left: 1.2rem; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--paper); padding: 0 .25em; border-radius: 3px; }
tr.note td { font-style: italic; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; display: block; }
.photo { display: block; max-width: 100%; max-height: 18rem; border-radius: 4px; margin: .5rem 0; }
.map { height: 22rem; border-radius: 4px; border: 1px solid var(--line); margin: .75rem 0; }
label.inline { display: block; font-weight: 400; margin: .25rem 0 .75rem; }
label.inline input { width: auto; margin-right: .4rem; }
button.secondary { background: var(--card); color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: #b00020; color: #fff; }
.objlist { list-style: none; margin: 0; padding: 0; }
.objlist li { margin-bottom: .6rem; }
.objlist a { display: flex; align-items: center; gap: .8rem; padding: .6rem; background: var(--card);
             border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; min-height: 4.5rem; }
.objlist .thumb { width: 80px; height: 60px; flex: none; background: var(--line); }
.objtext { flex: 1; font-size: 1.1rem; }
.objstate { text-align: right; font-size: .9rem; }
.ok { color: var(--accent); font-weight: 700; }
.warn { color: var(--warn); font-weight: 600; }
.pending { display: block; color: var(--warn); font-size: .9rem; }
.photo.wide { width: 100%; max-height: 24rem; object-fit: contain; background: var(--card); }
.bigbtn { display: block; width: 100%; min-height: 4.5rem; font-size: 1.4rem; }
.bigbtn:disabled { opacity: .5; cursor: not-allowed; }
.scroll-x { overflow-x: auto; }
table.sheet td { font-size: 1.1rem; vertical-align: top; }
table.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sheet .gap { height: .6em; }
.map.tall { height: 28rem; }
tr.mine td { background: color-mix(in srgb, var(--accent) 15%, var(--card)); font-weight: 600; }
.small { font-size: .85rem; }
/* Form rows: if a label wraps to two lines, keep every input in the row on one baseline. */
.row > div { display: flex; flex-direction: column; justify-content: flex-end; }
