:root { color-scheme: light dark; }
* { box-sizing: border-box; }

body {
  font-family: ui-sans-serif, system-ui, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  line-height: 1.4;
}

h1 { margin: 0 0 0.25rem; }

.sub { opacity: 0.7; margin-bottom: 1rem; }

nav {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}
nav a { margin-right: 0.75rem; color: inherit; }
nav a.active { font-weight: 600; text-decoration: none; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

fieldset {
  border: 1px solid #8884;
  border-radius: 6px;
  padding: 0.75rem;
}
legend { padding: 0 0.5rem; font-weight: 600; }

textarea, input[type=text] {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  padding: 0.5rem;
  border: 1px solid #8886;
  border-radius: 4px;
  background: transparent;
  color: inherit;
}

textarea { min-height: 6rem; resize: vertical; }

button {
  font-family: inherit;
  padding: 0.4rem 0.8rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  border: 1px solid #8886;
  border-radius: 4px;
  background: #8881;
  color: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #8883; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
  background: #8881;
  padding: 0.5rem;
  border-radius: 4px;
  margin: 0.25rem 0;
  max-height: 22rem;
  overflow: auto;
}

.tag { font-weight: 600; padding: 0 0.25rem; border-radius: 3px; }
.tag.match { background: #4c6; color: #000; }
.tag.partial { background: #fb4; color: #000; }
.tag.dead { background: #e44; color: #fff; }

.row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

#status {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.consumed {
  font-family: ui-monospace, monospace;
  background: #8882;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.big-input {
  font-size: 1.05rem;
  padding: 0.7rem;
}

.hero {
  text-align: center;
  padding: 1.5rem 0 1rem;
}
.hero h1 { font-size: 1.8rem; }
.hero .sub { font-size: 1rem; }

.dfa-out {
  background: #8881;
  padding: 0.5rem;
  border-radius: 4px;
  margin: 0.25rem 0;
}
.dfa-out svg text { fill: currentColor; }
.dfa-out svg ellipse,
.dfa-out svg polygon,
.dfa-out svg path { stroke: currentColor; }
.dfa-out svg ellipse { fill: transparent; }
.dfa-out .caption { opacity: 0.6; font-size: 0.8rem; margin-top: 0.5rem; text-align: center; }

.zoom-wrap {
  position: relative;
  width: 100%;
  height: 32rem;
  overflow: hidden;
  border: 1px dashed #8884;
  border-radius: 4px;
  user-select: none;
  cursor: grab;
}
.zoom-inner {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.zoom-inner svg { display: block; }
.zoom-reset {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
