* { box-sizing: border-box; }
:root {
    color-scheme: light;
    --bg: #fff;
    --panel: #f6f8f7;
    --ink: #172821;
    --muted: #4e625a;
    --border: #8a9c93;
    --accent: #155a43;
    --accent-ink: #fff;
    --danger: #97252b;
    font-size: 100%;
}
:root[data-scale="90"] { font-size: 90%; }
:root[data-scale="120"] { font-size: 120%; }
:root[data-theme="amoled"] {
    color-scheme: dark;
    --bg: #000;
    --panel: #101411;
    --ink: #f2f6f3;
    --muted: #b2c3b8;
    --border: #7b9685;
    --accent: #a9e1c1;
    --accent-ink: #082115;
    --danger: #ffadb0;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 1.125rem/1.5 "Times New Roman", Times, serif;
    overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.page { max-width: 68rem; margin: auto; padding-inline: clamp(.8rem, 4vw, 2.75rem); }
.top { border-bottom: 1px solid var(--border); background: var(--panel); }
.header-row { padding-block: .85rem; }
.header-row, .controls, .heading, nav, .row, .actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: .28rem;
}
.header-row { justify-content: space-between; column-gap: 1rem; }
.heading { align-items: baseline; column-gap: .65rem; }
h1, h2, h3, p { margin-block: 0 .65rem; }
h1 { font-size: clamp(1.5rem, 5vw, 2.15rem); margin: 0; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
.secondary { color: var(--muted); font-size: .9rem; }
nav, main { margin-block: 1rem; }
main:focus { outline: none; }
button {
    border: 1px solid var(--border); border-radius: 999px;
    background: transparent; padding: .1rem .34rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .2rem;
    font-size: .78rem; font-weight: 400; line-height: 1.1; cursor: pointer;
}
.controls { justify-content: center; }
@media (pointer: coarse) {
    button { min-height: 44px; min-width: 44px; }
}

button:hover, button[aria-pressed="true"], button[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button.primary { color: var(--accent); border-color: var(--accent); }
button.danger, .error { color: var(--danger); }
.icon svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button.handle { touch-action: none; cursor: grab; }
button.handle:active { cursor: grabbing; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; top: -100px; color: var(--accent); background: var(--bg); }
.skip:focus { top: .5rem; left: .5rem; z-index: 3; }
.surface, article { border: 1px solid var(--border); border-radius: .45rem; background: var(--panel); }
.surface { max-width: 40rem; padding: 1rem; margin-block: .7rem; }
article { margin-block: .45rem; padding: .45rem; }
article .details { padding: .5rem .2rem 0; }
article.dragging { outline: 2px solid var(--accent); }
.toggle { flex: 1; min-width: 9rem; justify-content: flex-start; text-align: left; }
.users-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem .65rem; margin-block-end: .65rem; }
.users-toolbar h2 { margin: 0; }
.users-table-scroll { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td {
    border-bottom: 1px solid var(--border);
    padding: .38rem .45rem;
    text-align: left;
}
.users-table th { background: var(--panel); font-weight: 600; }
.users-table td .controls { justify-content: flex-start; }
.users-table button { white-space: nowrap; }
.field { display: grid; gap: .2rem; margin-block: .6rem; min-width: 0; }
.field > input, .field > textarea, .field > select {
    width: 100%; padding: .35rem .55rem; min-height: 44px;
    border: 1px solid var(--border); border-radius: .25rem; background: var(--bg);
}
textarea { resize: vertical; min-height: 7rem !important; }
.check { display: flex; align-items: center; min-height: 44px; gap: .38rem; }
.check input { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.actions { margin-block: .4rem; }
.status { margin-block: .65rem; }
.prose { white-space: pre-wrap; }
pre { white-space: pre-wrap; font: inherit; }
dialog { max-width: min(90vw, 44rem); border: 1px solid var(--border); border-radius: .5rem; color: var(--ink); background: var(--bg); }
dialog::backdrop { background: #0008; }
@media (max-width: 36rem) { .actions { flex-basis: 100%; } }
