:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5d6470;
  --line: #d9d5cc;
  --accent: #8a5a2b;
  --accent-text: #ffffff;
  --error: #b42318;
  --error-bg: #fdecea;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --card: #1f2226;
    --text: #e8e6e1;
    --muted: #a3a8b0;
    --line: #353a40;
    --accent: #d39a5c;
    --accent-text: #15171a;
    --error: #ff8a80;
    --error-bg: #3a1d1b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
main { max-width: 52rem; margin: 0 auto; padding: 1rem; }
header.site, footer.site {
  max-width: 52rem; margin: 0 auto; padding: .75rem 1rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between;
}
footer.site { color: var(--muted); font-size: .85rem; }
.brand { font-weight: 700; letter-spacing: .02em; }
.langs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .9rem; }
.langmenu { position: relative; font-size: .9rem; }
.langmenu summary { cursor: pointer; color: var(--accent); }
.langmenu .langs {
  position: absolute; inset-inline-end: 0; z-index: 2; margin-top: .4rem; padding: .6rem .8rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  display: grid; grid-template-columns: repeat(2, minmax(7rem, 1fr)); gap: .3rem 1rem; width: max-content;
}
.langs a[aria-current] { font-weight: 700; text-decoration: none; color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .25rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.25rem; margin: 0 0 1rem;
}
fieldset.card { min-width: 0; }
legend { font-weight: 700; padding: 0 .25rem; }
.stay { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: .75rem 0 0; }
.stay dt { color: var(--muted); font-size: .85rem; }
.stay dd { margin: 0; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem 1rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .95rem; }
label.check { flex-direction: row; align-items: flex-start; gap: .5rem; margin: .5rem 0; }
label.check input { margin-top: .3rem; flex: none; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
input[aria-invalid=true] { border-color: var(--error); }
small.err { color: var(--error); min-height: 0; }
small.err:empty { display: none; }
small.hint { color: var(--muted); }
.alert { background: var(--error-bg); color: var(--error); border-radius: 8px; padding: .75rem 1rem; }
button {
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px;
  padding: .75rem 1.5rem; font-weight: 700; cursor: pointer;
}
.prose p { max-width: 40rem; }
/* Admin */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.copy:empty { display: none; }
.copy { font-family: ui-monospace, Menlo, monospace; user-select: all; background: var(--bg); padding: .1rem .35rem; border-radius: 4px; word-break: break-all; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.danger { background: var(--error); color: #fff; }
.badge { font-size: .8rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { border-color: var(--accent); color: var(--accent); }
@media (max-width: 40rem) {
  .table-scroll { overflow-x: auto; }
}
