:root {
  --ink: #203c43;
  --muted: #6d7e83;
  --line: #dde5e8;
  --paper: #fff;
  --bg: #f3f6f7;
  --accent: #147a80;
  --soft: #e7f3f2;
  --red: #a73535;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.shell {
  max-width: 740px;
  margin: 0 auto;
  padding: 20px 20px 110px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #74c8c4;
  outline-offset: 3px;
}
button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  background: white;
  color: var(--ink);
  font-weight: 600;
  transition: background 0.15s;
}
button:hover {
  background: var(--bg);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: #10656b;
}
button.quiet {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 6px 8px;
}
button.danger {
  color: var(--red);
}
button.small {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
}
.header,
.brand,
.row,
.section-head,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header {
  justify-content: space-between;
  margin-bottom: 22px;
}
.brand {
  gap: 12px;
}
.brand strong {
  font-size: 18px;
  letter-spacing: -0.4px;
}
.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.badge {
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  gap: 4px;
  background: #e7edef;
  border-radius: 12px;
  margin-bottom: 20px;
}
.tabs button {
  border: 0;
  background: none;
  min-height: 39px;
  padding: 8px;
}
.tabs button[aria-current="page"] {
  background: white;
  box-shadow: 0 1px 4px #203c4310;
}
.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h1 {
  font-size: 21px;
  letter-spacing: -0.6px;
  margin: 0;
}
.meta {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0 0;
}
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}
.subtabs button {
  font-weight: 500;
  font-size: 12px;
  min-height: 35px;
  padding: 7px 11px;
}
.subtabs button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent);
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 10px 0;
  overflow: hidden;
}
.panel-body {
  padding: 16px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
}
.panel summary {
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel summary::-webkit-details-marker {
  display: none;
}
.panel summary:after {
  content: "+";
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
}
.panel[open] summary:after {
  content: "−";
}
.panel[open] summary {
  border-bottom: 1px solid var(--line);
}
.range-note {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field {
  display: block;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fcfdfd;
  color: var(--ink);
  padding: 10px 11px;
  min-height: 41px;
}
.field input {
  font-variant-numeric: tabular-nums;
}
.field textarea {
  resize: vertical;
  min-height: 80px;
}
.field.full {
  grid-column: 1/-1;
}
.fields-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin: 14px 0 8px;
}
.fields-heading:first-child {
  margin-top: 0;
}
.stack {
  display: grid;
  gap: 10px;
}
.answer {
  display: flex;
  align-items: center;
  gap: 9px;
}
.answer input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.answer input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
}
.answer.correct input[type="text"] {
  border-color: #93c8bc;
  background: #f2f9f6;
}
.answer label {
  flex: 1;
}
.answer button {
  flex-shrink: 0;
  padding: 5px 9px;
  min-height: 35px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 12px 0;
}
.check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.toolbar {
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
}
.actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(740px, 100%);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f3f6f7f2;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
[hidden] {
  display: none !important;
}
.notice {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  width: min(690px, calc(100% - 32px));
  background: #203c43;
  color: white;
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 13px;
  z-index: 5;
  box-shadow: 0 6px 24px #203c4322;
}
.notice.error {
  background: #8e3030;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 42px 18px;
}
.result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--soft);
}
.result strong {
  display: block;
  font-size: 17px;
}
.result span {
  font-size: 12px;
  color: var(--muted);
}
.order {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  padding: 13px 16px;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.order:last-child {
  border-bottom: 0;
}
.order strong {
  font-size: 14px;
}
.order span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.order .sum {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.pager {
  display: flex;
  justify-content: space-between;
  margin: 14px 0;
}
.question-title {
  display: block;
  max-width: 90%;
  font-size: 13px;
  font-weight: 500;
}
.question-title small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}
.search {
  margin: 12px 0;
}
.counter {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0;
}
dialog {
  width: min(600px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  max-height: 85dvh;
  overflow: auto;
  color: var(--ink);
  background: white;
}
dialog::backdrop {
  background: #16363d65;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin: 0 0 10px;
  font-size: 19px;
}
dialog .toolbar {
  position: sticky;
  bottom: -22px;
  background: white;
  padding: 15px 0 2px;
  margin-bottom: 0;
}
.diff {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}
.diff li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.diff span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.diff b {
  font-weight: 500;
}
.history-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.history-row small {
  display: block;
  color: var(--muted);
}
.question-tools {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.question-tools .field {
  flex: 1;
}
.loading {
  opacity: 0.55;
  pointer-events: none;
}
a {
  color: var(--accent);
}
@media (max-width: 480px) {
  .shell {
    padding: 16px 14px 108px;
  }
  .header {
    margin-bottom: 16px;
  }
  .header .brand strong {
    font-size: 17px;
  }
  .tabs {
    margin-bottom: 16px;
  }
  .tabs button {
    font-size: 13px;
  }
  .section-head h1 {
    font-size: 20px;
  }
  .panel summary {
    padding: 13px 14px;
  }
  .panel-body {
    padding: 14px;
  }
  .actions {
    padding-left: 14px;
    padding-right: 14px;
  }
  .range-note {
    font-size: 11px;
  }
  .subtabs button {
    padding: 7px 9px;
  }
  .notice {
    bottom: 86px;
  }
  .fields {
    gap: 10px;
  }
  dialog {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
