:root {
  --ink: #16251f;
  --muted: #6f7f78;
  --line: #dfe7e2;
  --paper: #f7f8f5;
  --white: #ffffff;
  --green: #1f6a4a;
  --green-dark: #124a34;
  --green-pale: #e4f0e8;
  --mint: #9ecdb2;
  --amber: #c4822a;
  --red: #b44e4e;
  --shadow: 0 24px 70px rgba(31, 58, 47, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(174, 215, 190, 0.28), transparent 32rem),
    linear-gradient(180deg, #fafbf8 0%, #f3f6f2 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
}

.ambient-one {
  width: 22rem;
  height: 22rem;
  left: -12rem;
  top: 28rem;
  background: rgba(211, 229, 217, 0.35);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  right: -8rem;
  top: 55rem;
  background: rgba(222, 218, 194, 0.25);
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--green);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(31, 106, 74, 0.22);
}

.brand-mark svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: -0.15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.trust-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #d6e4da;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  background: #3b9a69;
  border-radius: 50%;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(59, 154, 105, 0.35);
  border-radius: inherit;
  animation: pulse 2s infinite;
}

main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  max-width: 850px;
  margin: 74px auto 52px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -3.2px;
}

.hero h1 span {
  color: var(--green);
  font-style: italic;
}

.hero > p {
  max-width: 670px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.rules-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 720px;
  margin: 38px auto 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rules-strip div {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 0 24px;
  text-align: left;
}

.rules-strip div + div {
  border-left: 1px solid var(--line);
}

.rules-strip span {
  grid-row: 1 / 3;
  color: var(--mint);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
}

.rules-strip strong {
  font-size: 12px;
}

.rules-strip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.workspace-card {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(210, 221, 214, 0.9);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card-heading,
.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

h2 {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.8px;
}

.limit-label {
  color: var(--muted);
  font-size: 11px;
}

form {
  margin-top: 32px;
}

label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 750;
}

.textarea-wrap {
  overflow: hidden;
  border: 1px solid #cedbd3;
  background: #fbfcfa;
  border-radius: 12px;
  transition: border-color 160ms, box-shadow 160ms;
}

.textarea-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 106, 74, 0.09);
}

textarea {
  display: block;
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 18px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.75;
}

textarea::placeholder {
  color: #a4b0aa;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid #e5ebe7;
  color: var(--muted);
  font-size: 10px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--green);
  background: none;
  font-size: 10px;
  font-weight: 800;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
}

.method-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.method-note svg,
.integrity-note svg {
  width: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.method-note strong,
.method-note span {
  display: block;
}

.method-note strong {
  color: var(--ink);
  font-size: 11px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 240px;
  padding: 15px 19px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--green);
  box-shadow: 0 10px 25px rgba(31, 106, 74, 0.22);
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms, background 160ms;
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  padding: 24px 30px;
  border: 1px solid #dbe5df;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
}

.progress-content {
  min-width: 0;
  flex: 1;
}

.progress-heading,
.progress-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.progress-heading > div {
  min-width: 0;
}

.loading-panel strong,
.loading-panel span {
  display: block;
}

.progress-details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
}

.progress-details span {
  margin: 0;
  font-size: 9px;
}

.progress-current {
  max-width: 70%;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-panel.complete .scanner-line {
  display: none;
}

.loading-panel.complete .scanner {
  color: white;
  background: var(--green);
}

.loading-panel.complete .scanner svg {
  stroke: white;
}

.loading-panel strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
}

.loading-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.scanner {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 52px;
  height: 52px;
  border: 1px solid #d3e0d8;
  border-radius: 12px;
}

.scanner svg {
  width: 30px;
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
}

.scanner-line {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 1px;
  background: #54a878;
  box-shadow: 0 0 8px #54a878;
  animation: scan 1.8s ease-in-out infinite;
}

.results-section {
  margin: 86px 0 40px;
}

.export-actions {
  display: flex;
  gap: 8px;
}

.secondary-button {
  padding: 10px 13px;
  border: 1px solid #d5dfd8;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.secondary-button:hover {
  border-color: var(--green);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0 16px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
}

.summary-card strong,
.summary-card small {
  display: block;
}

.summary-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

.summary-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
}

.summary-icon.success {
  color: var(--green);
  background: var(--green-pale);
}

.summary-icon.thematic {
  color: #57718a;
  background: #e8eff5;
}

.summary-icon.fallback {
  color: var(--amber);
  background: #f8eddd;
}

.summary-icon.unresolved {
  color: var(--red);
  background: #f7e7e7;
}

.table-shell {
  overflow: hidden;
  border: 1px solid #d9e3dc;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 15px;
  box-shadow: 0 15px 45px rgba(31, 58, 47, 0.06);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  padding: 13px 18px;
  color: #718078;
  background: #f1f5f2;
  font-size: 9px;
  letter-spacing: 1.2px;
  text-align: left;
  text-transform: uppercase;
}

th:nth-child(1),
th:nth-child(2) {
  width: 34%;
}

th:nth-child(3) {
  width: 32%;
}

td {
  padding: 18px;
  border-top: 1px solid #e4eae6;
  vertical-align: top;
  font-size: 11px;
  line-height: 1.5;
}

td a {
  color: var(--green-dark);
  overflow-wrap: anywhere;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.source-url {
  color: #69776f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.target-cell {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.verified-dot {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-size: 9px;
}

.empty-target {
  color: var(--red);
  font-style: italic;
}

.logic-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.logic-badge.thematic {
  color: #3c667e;
  background: #e8f0f5;
}

.logic-badge.reachable {
  color: var(--green-dark);
  background: var(--green-pale);
}

.logic-badge.localized {
  color: #5c4c82;
  background: #eee9f7;
}

.logic-badge.fallback {
  color: #8b5d22;
  background: #f8eddd;
}

.logic-badge.unresolved {
  color: #994545;
  background: #f7e7e7;
}

.logic-text {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.integrity-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #d8e5dc;
  background: rgba(231, 241, 234, 0.55);
  border-radius: 12px;
}

.integrity-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.integrity-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--green-dark);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 16px;
  color: white;
  background: var(--ink);
  border-radius: 9px;
  box-shadow: 0 12px 35px rgba(22, 37, 31, 0.24);
  font-size: 11px;
}

.toast.error {
  background: #8f3f3f;
}

footer {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 45px 0 35px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #8a9790;
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(0.6); }
  70%, 100% { opacity: 0; transform: scale(1.4); }
}

@keyframes scan {
  0%, 100% { transform: translateY(-23px); opacity: 0.3; }
  50% { transform: translateY(23px); opacity: 1; }
}

@media (max-width: 760px) {
  .hero {
    margin-top: 44px;
  }

  .hero h1 {
    letter-spacing: -2px;
  }

  .rules-strip {
    grid-template-columns: 1fr;
    max-width: 380px;
  }

  .rules-strip div {
    padding: 13px 24px;
  }

  .rules-strip div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .action-row,
  .card-heading,
  .results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .export-actions {
    align-self: stretch;
  }

  .export-actions button {
    flex: 1;
  }

  table {
    min-width: 820px;
  }

  .loading-panel {
    align-items: flex-start;
  }

  .progress-details {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .progress-current {
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 470px) {
  .topbar,
  main,
  footer {
    width: min(100% - 24px, 1040px);
  }

  .trust-pill {
    display: none;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero > p {
    font-size: 15px;
  }

  .workspace-card {
    padding: 22px 17px;
    border-radius: 18px;
  }

  .method-note {
    align-items: flex-start;
  }

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

  footer {
    gap: 12px;
    flex-direction: column;
  }
}
