:root {
  color-scheme: light;
  --canvas: #fff;
  --paper: #fff;
  --card-shadow: 0 3px 8px rgb(0 0 0 / 6%), 0 10px 28px rgb(0 0 0 / 10%);
  --ink: #111;
  --muted: #222;
  --teal: #1745b5;
  --blue-dark: #0f2d6f;
  --blue-deep: #111;
  --line: #cdddfa;
  --amber: #c56a16;
  --pale: #e4ecff;
  --state-soft: #e9f0ff;
  --state-warm: #fff4ec;
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 13px;
  font-weight: 600;
}
button:hover:enabled {
  background: var(--state-soft);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
a {
  color: var(--ink);
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.22;
  letter-spacing: -1px;
  font-weight: 650;
}
h2 {
  font-size: 18px;
  font-weight: 650;
}
h3 {
  font-size: 14px;
}
p {
  line-height: 1.65;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 9px;
}
input,
textarea {
  border: 1px solid #b9c8ec;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  padding: 12px;
  line-height: 1.5;
}
textarea {
  resize: vertical;
  min-height: 180px;
}
input::placeholder,
textarea::placeholder {
  color: #555;
}
.masthead {
  height: 91px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  background: var(--paper);
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border: 2px solid var(--teal);
  border-radius: 8px 8px 2px 2px;
  color: var(--teal);
  font-size: 32px;
  line-height: 1;
}
.header-note {
  color: var(--muted);
  font-size: 12px;
}
.session-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}
.attempts {
  font-size: 13px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  padding: 13px 18px;
}
.primary:hover:enabled {
  background: #11359f;
}
.badge {
  display: inline-block;
  border: 1px solid #b6cffb;
  color: var(--blue-dark);
  background: var(--pale);
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.page-footer {
  padding: 25px 4%;
  display: flex;
  justify-content: space-between;
  gap: 25px;
  font-size: 11px;
  color: var(--muted);
}
.workspace {
  max-width: 1600px;
  margin: auto;
  padding: 34px 4% 12px;
}
.work-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.work-heading p {
  color: var(--muted);
  margin-top: 9px;
}
.mode-banner {
  padding: 12px 16px;
  border-left: 3px solid var(--teal);
  background: var(--state-soft);
  line-height: 1.5;
  font-size: 12px;
  margin-bottom: 24px;
}
.desk {
  display: grid;
  grid-template-columns: minmax(255px, 0.95fr) minmax(390px, 1.65fr) minmax(
      180px,
      0.65fr
    );
  align-items: start;
  gap: 24px;
}
.source-panel,
.result-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.source-panel {
  padding: 22px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.panel-heading > span {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}
.source-switch {
  display: flex;
  background: var(--canvas);
  padding: 4px;
  border-radius: 7px;
  margin-bottom: 20px;
}
.source-switch button {
  width: 50%;
  background: transparent;
  border-color: transparent;
}
.source-switch button[aria-pressed="true"] {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}
.dropzone {
  border: 1px dashed #aec6f4;
  border-radius: 7px;
  display: flex;
  align-items: center;
  text-align: center;
  flex-direction: column;
  padding: 28px 12px 18px;
  background: #f4f7ff;
  position: relative;
  cursor: pointer;
  gap: 9px;
}
.dropzone.dragging {
  border: 2px solid var(--teal);
  background: var(--pale);
}
.dropzone:focus-within {
  outline: 3px solid var(--blue-dark);
  outline-offset: 3px;
}
.upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--state-soft);
  color: var(--teal);
  font-size: 30px;
  border-radius: 50%;
  margin-bottom: 5px;
}
.dropzone strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.dropzone > span:not(.upload-icon) {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.dropzone small {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
}
.dropzone input {
  width: 100%;
  font-size: 11px;
  padding: 5px;
  margin-top: 8px;
  border: 0;
  background: transparent;
}
.source-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 15px 0;
}
.source-panel .primary {
  width: 100%;
}
.attempt-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}
.samples {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.samples p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 12px;
}
#sample-links {
  display: grid;
  gap: 10px;
}
#sample-links a {
  font-size: 12px;
}
.input-hint {
  display: block;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.result-panel > .panel-heading {
  padding: 22px 22px 0;
}
.route-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: var(--state-soft);
  border-block: 1px solid var(--line);
}
.route-strip > div {
  flex: 1;
  min-width: 0;
}
.route-strip span:not(.route-line) {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 7px;
}
.route-strip strong {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.route-line {
  color: var(--teal);
  font-size: 28px;
}
.empty-note {
  font-size: 12px;
  color: var(--muted);
  padding: 18px 22px 5px;
}
.fields {
  padding: 0 22px;
}
.field-row {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.field-main {
  margin: 0;
  display: flex;
  gap: 7px;
  line-height: 1.65;
  font-size: 13px;
}
.field-main dt {
  font-weight: 500;
  flex: 0 0 45%;
  color: var(--blue-deep);
}
.field-main dd {
  margin: 0;
  font-weight: 600;
  min-width: 0;
  flex: 1;
}
.field-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}
.field-row.ambiguous .field-meta,
.field-row.missing .field-meta {
  color: var(--amber);
}
.field-row.confirmed .field-meta {
  color: var(--teal);
}
.field-source {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 3px;
}
.field-questions {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 5px;
}
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 22px 22px 0;
}
.export-bar button {
  font-size: 11px;
  padding: 9px 10px;
}
.export-status {
  font-size: 11px;
  color: var(--teal);
  padding: 10px 22px;
  min-height: 35px;
}
.guide-panel {
  padding: 5px 0;
}
.guide-panel h2 {
  font-size: 15px;
  line-height: 1.5;
}
.guide-list {
  list-style: none;
  padding: 0;
  margin: 22px 0;
}
.guide-list li {
  padding-left: 17px;
  border-left: 2px solid #bccdf0;
  margin-bottom: 23px;
}
.guide-list strong {
  font-size: 12px;
}
.guide-list p,
.limits p,
.usage p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.65;
}
.limits,
.usage {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.usage dl {
  margin: 13px 0;
}
.usage dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  padding: 7px 0;
}
.usage dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
.usage dt {
  color: var(--muted);
}
.usage .cost {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 12px;
}
.progress-area {
  padding: 18px 22px 0;
}
.progress-area > div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.progress-area p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px;
}
progress {
  width: 100%;
  height: 5px;
  accent-color: var(--teal);
  margin-top: 10px;
  display: block;
  border: 0;
}
progress::-webkit-progress-bar {
  background: var(--canvas);
  border-radius: 3px;
}
progress::-webkit-progress-value {
  background: var(--teal);
  border-radius: 3px;
}
.error {
  color: #a33128;
  font-size: 12px;
  line-height: 1.6;
}
.global-error,
.exhausted {
  padding: 13px 16px;
  background: #fff5f1;
  border: 1px solid #ffd5bf;
  border-radius: 6px;
  margin-bottom: 20px;
}
.exhausted {
  font-size: 12px;
}
.clarify-panel {
  background: var(--state-soft);
  margin: 20px 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.clarify-panel p {
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0 15px;
}
.clarify-panel label {
  font-size: 11px;
  margin-top: 14px;
}
.clarify-panel input {
  font-size: 12px;
}
.clarify-panel button {
  font-size: 12px;
  margin-top: 20px;
}
.closed-note {
  padding: 15px 22px 0;
  font-size: 11px;
  color: var(--muted);
}
.login-layout {
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 157px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 10%;
  padding: 65px 6%;
}
.login-intro h1 {
  font-size: clamp(34px, 3.5vw, 52px);
  line-height: 1.15;
  letter-spacing: -1.8px;
}
.lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 480px;
  margin-top: 26px;
}
.rail-diagram {
  display: flex;
  align-items: start;
  margin: 58px 0 45px;
  max-width: 460px;
}
.rail-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  font-size: 11px;
}
.rail-stop i {
  display: block;
  width: 17px;
  height: 17px;
  border: 4px solid var(--teal);
  border-radius: 50%;
  background: var(--canvas);
}
.rail-track {
  flex: 1;
  border-top: 2px solid #c0d1f4;
  border-bottom: 2px solid #c0d1f4;
  height: 7px;
  margin-top: 5px;
  position: relative;
}
.rail-track span {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
.intro-foot {
  font-size: 12px;
  color: var(--muted);
}
.login-card {
  padding: 34px;
  background: white;
  border: 0;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.login-card h2 {
  font-size: 26px;
  margin: 24px 0 10px;
  letter-spacing: -0.6px;
}
.login-card form {
  margin-top: 0;
}
.login-card form label {
  font-size: 12px;
}
.login-card .primary {
  width: 100%;
  margin-top: 12px;
}
.login-card .error {
  margin-top: 12px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 14px 30px;
}
.login-shell .login-card {
  width: min(460px, 92vw);
}
.mode-note {
  border-top: 1px solid var(--line);
  padding-top: 21px;
  margin-top: 23px;
  font-size: 11px;
  color: var(--muted);
}
.mode-note strong {
  color: var(--ink);
}
.mode-note p {
  margin-top: 7px;
}
.code-button {
  padding: 1px 4px;
  border: 0;
  border-radius: 3px;
  background: var(--pale);
  color: var(--teal);
  font-size: 11px;
}
@media (min-width: 1550px) {
  .workspace {
    padding-inline: 50px;
  }
  .desk {
    gap: 30px;
  }
}
@media (max-width: 1100px) {
  .desk {
    grid-template-columns: minmax(250px, 0.85fr) minmax(370px, 1.4fr);
    gap: 20px;
  }
  .guide-panel {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 24px;
  }
  .guide-panel > h2 {
    grid-column: 1/-1;
  }
  .guide-list,
  .limits,
  .usage {
    margin: 0;
  }
  .guide-list {
    grid-row: 2;
  }
  .workspace {
    padding-inline: 3%;
  }
  .masthead {
    padding-inline: 3%;
  }
  .login-layout {
    gap: 6%;
    padding-inline: 5%;
  }
}
@media (max-width: 720px) {
  .masthead {
    height: auto;
    min-height: 82px;
    padding: 15px 5%;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 15px;
  }
  .session-controls {
    gap: 15px;
    margin-left: auto;
  }
  .attempts {
    font-size: 11px;
  }
  .text-button {
    font-size: 11px;
  }
  .work-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  h1 {
    font-size: 27px;
  }
  .work-heading p {
    font-size: 12px;
  }
  .workspace {
    padding: 25px 5% 0;
  }
  .desk {
    grid-template-columns: minmax(0, 1fr);
  }
  .guide-panel {
    display: block;
  }
  .guide-panel > h2 {
    margin-top: 8px;
  }
  .guide-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
  }
  .guide-list li {
    padding-left: 10px;
  }
  .limits,
  .usage {
    margin-top: 20px;
  }
  .page-footer {
    padding-inline: 5%;
    flex-direction: column;
    gap: 7px;
  }
  .field-main {
    font-size: 12px;
  }
  .route-strip {
    gap: 10px;
  }
  .route-strip strong {
    font-size: 12px;
  }
  .login-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 35px;
    padding: 35px 6%;
  }
  .login-intro h1 {
    font-size: 35px;
  }
  .lead {
    font-size: 14px;
    margin-top: 18px;
  }
  .rail-diagram {
    margin: 30px 0 35px;
  }
  .intro-foot {
    display: none;
  }
  .login-card {
    padding: 25px;
  }
  .header-note {
    display: none;
  }
  .guide-panel .usage {
    max-width: 350px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

#text-panel {
  margin-top: 22px;
}
.inactive-source {
  opacity: 0.58;
}
.inactive-source .dropzone {
  cursor: default;
}
.inactive-source textarea {
  background: #eff3fb;
}
.inactive-source input:disabled {
  cursor: not-allowed;
}

.attempts {
  color: var(--blue-deep);
  font-weight: 600;
}

.sample-strip {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-top: 0;
  border-bottom: 0;
}
.sample-strip > div:first-child {
  flex: 0 0 205px;
}
.sample-strip p {
  margin: 5px 0 0;
}
.sample-strip #sample-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.sample-strip #sample-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--paper);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sample-strip #sample-links a:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}
.sample-icon {
  width: 36px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sample-icon svg {
  width: 100%;
  height: 100%;
}
@media (max-width: 720px) {
  .sample-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .sample-strip > div:first-child {
    flex: auto;
  }
}
