:root {
  color-scheme: light;
  --ink: #191d1f;
  --muted: #667174;
  --line: #d9e2df;
  --paper: #ffffff;
  --mist: #eef5f2;
  --teal: #1b6b67;
  --teal-dark: #114845;
  --coral: #b94a42;
  --gold: #b58424;
  --blue: #2d5f88;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mist);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.screen {
  padding: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 1rem;
}

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

.title {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.05;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 12px;
}

.actions {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.button.secondary {
  background: var(--mist);
  color: var(--ink);
}

.button.warning {
  background: var(--coral);
}

.button.small {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.checkgroup legend {
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.scale {
  display: grid;
  gap: 6px;
}

.scale-value {
  float: right;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chip input {
  width: auto;
}

.nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: #fff;
}

.nav button {
  min-height: 58px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav button.active {
  color: var(--teal);
  background: var(--mist);
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.item strong {
  display: block;
  margin-bottom: 4px;
}

.notice {
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: #fff8e8;
  color: #5b410e;
}

.error {
  color: var(--coral);
  font-weight: 700;
}

.export-box {
  min-height: 360px;
  white-space: pre-wrap;
}

svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .screen {
    padding: 16px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .nav,
  .no-print {
    display: none !important;
  }

  .app-shell {
    width: 100%;
  }
}
