:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #14213d;
  --muted: #5f6b7a;
  --line: #d8dee8;
  --teal: #0e4d5a;
  --teal-soft: #e7f1f3;
  --red: #8b2332;
  --red-dark: #741a27;
  --focus: rgba(14, 77, 90, 0.18);
  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(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  border-bottom: 1px solid rgba(216, 222, 232, 0.8);
  background: rgba(255, 255, 255, 0.86);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.poc-bar {
  border-bottom: 1px solid rgba(14, 77, 90, 0.18);
  background: var(--teal-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.poc-bar .wrap {
  padding-top: 11px;
  padding-bottom: 11px;
}

main {
  padding: 48px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 42px;
  align-items: start;
}

.hero h2 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
}

.lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.mini-card,
.panel,
.info {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(18, 33, 61, 0.06);
}

.mini-card {
  min-height: 132px;
  border-radius: 8px;
  padding: 20px;
}

.mini-card h3 {
  margin-bottom: 9px;
  font-size: 16px;
}

.mini-card p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.panel {
  border-radius: 8px;
  padding: 28px;
}

.panel-head {
  margin-bottom: 24px;
}

.panel-head h3 {
  margin-bottom: 7px;
  font-size: 24px;
}

.sample-button {
  width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(14, 77, 90, 0.2);
  background: #fff;
  color: var(--teal);
}

.sample-button:hover {
  background: var(--teal-soft);
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 6px;
}

.mode-tab {
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.mode-tab[aria-selected="true"] {
  border-color: rgba(14, 77, 90, 0.2);
  background: #fff;
  color: var(--teal);
}

.mode-panel[hidden] {
  display: none;
}

.dropzone {
  position: relative;
  display: grid;
  height: 260px;
  place-items: center;
  border: 2px dashed rgba(14, 77, 90, 0.28);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 30px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone.is-dragging {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.dropzone-content {
  display: grid;
  width: min(100%, 340px);
  grid-template-rows: auto auto auto auto 48px;
  justify-items: center;
  align-items: start;
}

.file-input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 18px;
  background: var(--teal);
  color: #fff;
}

.upload-title {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.file-name {
  display: -webkit-box;
  width: 100%;
  min-height: 42px;
  max-height: 48px;
  margin-top: 16px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 22px;
}

select,
button,
.report-link {
  min-height: 48px;
  border-radius: 8px;
  font: inherit;
}

select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

textarea {
  width: 100%;
  min-height: 246px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  padding: 16px;
}

textarea:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.char-count {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

button,
.report-link {
  border: 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 20px;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

button:hover,
.report-link:hover {
  background: var(--red-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: refgen-spin 0.8s linear infinite;
}

@keyframes refgen-spin {
  to { transform: rotate(360deg); }
}

.panel.is-busy .dropzone,
.panel.is-busy textarea,
.panel.is-busy select,
.panel.is-busy .mode-tabs,
.panel.is-busy .char-count {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.2);
}

.panel.is-busy .file-input {
  pointer-events: none;
}

button.is-ready {
  background: var(--teal);
  opacity: 1;
  cursor: pointer;
}

button.is-ready:hover {
  background: #0b3f4a;
}

button.is-ready:disabled {
  opacity: 1;
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
.report-link:focus-visible,
.cookie-notice [type="button"]:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.status[data-kind="error"] {
  color: #9b1c2d;
  font-weight: 700;
}

.result {
  display: none;
  align-items: stretch;
  justify-content: flex-start;
  margin-top: 18px;
}

.result.is-visible {
  display: flex;
}

.result p {
  margin: 0;
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
}

.report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
  min-width: 186px;
  min-height: 48px;
  background: var(--teal);
}

.report-link:hover {
  background: #0b3f4a;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .result-actions {
    width: 100%;
  }

  .result-actions .report-link {
    width: 100%;
    justify-content: center;
  }
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 44px;
}

.info {
  border-radius: 8px;
  padding: 28px;
}

.info h3 {
  margin-bottom: 12px;
  font-size: 24px;
}

.page-disclosures {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.page-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(18, 33, 61, 0.04);
}

.page-disclosure summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--ink);
  font-weight: 800;
  list-style-position: inside;
}

.page-disclosure summary:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

.page-disclosure-body {
  border-top: 1px solid var(--line);
  padding: 18px 20px 20px;
}

.page-disclosure-body p {
  max-width: 820px;
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.page-disclosure-body p:last-child {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  color: #7a8491;
  font-size: 13px;
}

.github-info-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.github-info-link:hover {
  color: #4e5966;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.github-info-link:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

.github-icon {
  flex: 0 0 auto;
}

.footer-version {
  display: inline-flex;
  align-items: center;
  color: #9099a5;
}

.footer-version::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin-right: 10px;
  background: #c5ccd5;
}

.cookie-notice {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px;
  left: 16px;
}

.cookie-notice[hidden] {
  display: none;
}

.cookie-notice-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  width: min(1040px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(14, 77, 90, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(18, 33, 61, 0.18);
  padding: 20px;
}

.cookie-copy h2 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.cookie-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: flex-end;
  gap: 10px;
}

.cookie-actions button {
  width: auto;
  white-space: nowrap;
}

.cookie-actions .cookie-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
}

.cookie-actions .cookie-secondary:hover {
  background: var(--teal-soft);
}

.cookie-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.cookie-details[hidden] {
  display: none;
}

.cookie-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.cookie-details dl div {
  min-width: 0;
}

.cookie-details dt {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.cookie-details dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cookie-details code {
  overflow-wrap: anywhere;
}

.cookie-storage-note {
  margin-top: 14px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .hero,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cookie-notice-inner {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  main {
    padding-top: 32px;
  }

  .topbar-inner,
  .controls,
  .result {
    flex-direction: column;
    align-items: stretch;
  }

  .panel {
    padding: 20px;
  }

  .dropzone {
    height: 240px;
    padding: 22px;
  }

  .dropzone-content {
    width: 100%;
    grid-template-rows: auto auto auto auto 44px;
  }

  button,
  .report-link {
    justify-content: center;
    width: 100%;
  }

  .cookie-notice {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .cookie-notice-inner {
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 16px;
  }

  .cookie-details dl {
    grid-template-columns: 1fr;
  }

  .cookie-actions button {
    width: 100%;
  }
}
