* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.65 var(--font);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
a {
  color: var(--action);
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button {
  border: 0;
  background: transparent;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: -.04em;
  line-height: 1.35;
}
h2 {
  font-size: 18px;
  line-height: 1.5;
}
h3 {
  font-size: 16px;
}
small,
.small {
  font-size: 13px;
}
.muted,
.card-sub {
  color: var(--muted);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 20px;
}
.row,
.row-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.btn,
.link-button,
.icon-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 17px;
  border-radius: var(--control-radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  line-height: 1.45;
  font-weight: 550;
}
.btn:hover,
.link-button:hover {
  background: var(--soft);
}
.btn.primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-ink);
}
.btn.secondary {
  background: var(--soft);
  border-color: transparent;
}
.btn.danger {
  color: var(--danger);
}
.link-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--action);
}
.icon-btn {
  min-width: 46px;
  padding: 10px;
}
.card,
.panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 16px;
}
.tag {
  display: inline-block;
  border-radius: 6px;
  background: var(--soft);
  color: var(--action);
  font-size: 12px;
  padding: 2px 8px;
  white-space: normal;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 14px;
}
.field input,
.field select,
.field textarea,
.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
}
textarea {
  resize: vertical;
  max-width: 100%;
}
.field:has([required]) > span:after {
  content: " *";
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.wide {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.actions > .btn {
  flex: 1;
}
.segments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.segments button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.segments button[aria-pressed=true] {
  color: var(--action-ink);
  border-color: var(--action);
  background: var(--action);
}
.empty {
  padding: 32px 16px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.warning,
.error {
  padding: 12px 16px;
  border-left: 3px solid var(--danger);
  background: var(--soft);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.error {
  color: var(--danger);
}
.warning:empty,
.error:empty {
  display: none;
}
dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #25282566;
}
dialog h2 {
  margin-bottom: 12px;
}
dialog .field {
  margin-top: 16px;
}
details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.6 ui-monospace, monospace;
  max-height: 330px;
  overflow: auto;
}
#toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  border-radius: 8px;
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 16px;
  z-index: 80;
  display: none;
}
#toast[data-open=true] {
  display: block;
}
.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.rule {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
