:root {
  color-scheme: light dark;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --text: #1b2421;
  --muted: #566460;
  --border: #d5dcd9;
  --accent: #0f766e;
  --accent-soft: #e2f3f1;
  --on-accent: #ffffff;
  --warn: #9a3412;
  --warn-bg: #fff3ea;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111715;
    --surface: #19211e;
    --text: #e5ece9;
    --muted: #a2b0aa;
    --border: #2e3a36;
    --accent: #2dd4bf;
    --accent-soft: #15302c;
    --on-accent: #06302b;
    --warn: #fdba74;
    --warn-bg: #2b1b10;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.brand {
  padding: 20px 0 4px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
}

h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 8px 0 8px;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 40px 0 10px;
}

h3 {
  font-size: 1.05rem;
  margin: 20px 0 4px;
}

p {
  margin: 0 0 12px;
}

.lead,
.muted {
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.tab {
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.tab[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .fields.two {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

input[type="date"],
input[type="number"],
input[type="time"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 4px;
}

.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.check label {
  margin: 0;
  font-weight: 400;
  font-size: 1rem;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.result {
  margin-top: 16px;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.big {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}

.result p {
  margin: 4px 0 0;
}

.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.warn:empty {
  display: none;
}

details {
  border-top: 1px solid var(--border);
  padding: 4px 0;
}

summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

details p {
  margin: 0 0 12px;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

[hidden] {
  display: none !important;
}
