/* Base: reset, layout, rhythm, type, forms, tables. Values come from tokens.css; width adaptations live in responsive.css.
   Rhythm: blocks of a page are 24px apart (the view is a flex column with a gap), never by ad-hoc margins. */
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 14px/1.5 Satoshi, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img { display: block; }
p { margin: 0; }

/* Frame: menu on the left, the view on the right. */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
main { width: 100%; max-width: var(--content-w); padding: var(--s6) var(--s7) var(--s8); }
#view { display: flex; flex-direction: column; gap: var(--s5); animation: enter .2s ease-out; }
#view > * { margin: 0; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }

/* Type */
h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; }
h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; }
small { font-size: 12px; }
.lead { max-width: 760px; margin-top: var(--s2); color: var(--muted); }
.muted { color: var(--muted); }
.flag { font-size: 18px; line-height: 1; }
code { font-size: 12px; }

/* Forms */
select, input[type=text], input[type=date], textarea { min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); }
textarea { width: 100%; min-height: 72px; padding: var(--s2) var(--s3); }
button { min-height: 36px; padding: 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); font-weight: 500; cursor: pointer; transition: background .15s; }
button:hover { background: var(--soft); }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Tables */
.table { overflow-x: auto; border-radius: var(--r-card); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tr:last-child > * { border-bottom: 0; }
thead th { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--soft); }
table.mini th, table.mini td { padding: var(--s2) 0; }
table.mini th + th, table.mini td + td { padding-left: var(--s4); }
