/* Raippa: calm, readable, light and dark. No external fonts or requests. */
:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1d232b; --muted: #5d6875; --line: #e2e6eb;
  --accent: #2f6f6a; --accent-ink: #ffffff; --accent-soft: #e4f1ef;
  --ok: #2e7d4f; --warn: #a16207; --err: #b4232c; --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b; --card: #1a2027; --ink: #e6eaee; --muted: #9aa5b1; --line: #2a323b;
    --accent: #5fb3aa; --accent-ink: #0d1412; --accent-soft: #1d2e2c;
    --ok: #5cc28a; --warn: #e0b04a; --err: #f07178;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand i { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
           display: inline-grid; place-items: center; font-style: normal; font-size: 15px; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
nav.main a { text-decoration: none; color: var(--muted); padding: 10px 12px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
nav.main a.on, nav.main a:hover { color: var(--ink); background: var(--accent-soft); }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.pill.ok { color: var(--ok); } .pill.err { color: var(--err); } .pill.warn { color: var(--warn); }
.btn, button { font: 600 15px var(--font); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
       border-radius: 10px; padding: 10px 16px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.ghost, button.ghost { background: transparent; color: var(--accent); }
.btn.danger, button.danger { background: transparent; border-color: var(--err); color: var(--err); }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=time], input[type=date], input[type=number], textarea, select {
  font: 16px var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 6px 12px 6px 0; min-height: 44px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.flash { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.err-text { color: var(--err); }
.center { max-width: 440px; margin: 8vh auto; }
.codes { font: 600 16px ui-monospace, Menlo, Consolas, monospace; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
pre.output { white-space: pre-wrap; font: 15px/1.5 var(--font); background: var(--bg); border-radius: 10px; padding: 14px; margin: 0; }
.sched { display: grid; gap: 10px; grid-template-columns: 1fr; }
.sched form.edit { display: grid; gap: 8px 14px; grid-template-columns: 2fr 1fr; align-items: end; }
.days { display: flex; flex-wrap: wrap; }
@media (max-width: 640px) {
  .field2, .sched form.edit { grid-template-columns: 1fr; }
  table.stack thead { display: none; }
  table.stack td { display: block; border: 0; padding: 4px 0; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
}

/* small utilities (no inline styles: the CSP forbids them) */
.mt { margin-top: 12px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 12px; } .m0 { margin: 0; }
.wide { width: 100%; justify-content: center; } .span-all { grid-column: 1 / -1; } .narrow { max-width: 240px; }
.meta { margin: 4px 0 8px; } .between { justify-content: space-between; } .inline-form { display: inline; }
.mono-big { font: 600 22px ui-monospace, Menlo, Consolas, monospace; } .big-number { font-size: 28px; margin: 4px 0; }
.cal-row { justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }
.cal-row select { width: auto; min-width: 150px; }
.cal-name { flex: 1 1 160px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.small { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px; }
