:root {
  color-scheme: light;
  --ink: #152018;
  --muted: #5c665f;
  --line: #d9ded8;
  --panel: #ffffff;
  --page: #f6f7f4;
  --accent: #0f6b5d;
  --accent-strong: #09493f;
  --accent-soft: #e4f2ef;
  --warn: #8a3b12;
  --warn-bg: #fff2e8;
  --success: #17613c;
  --success-bg: #e8f5ed;
  --shadow: 0 22px 60px rgba(28, 38, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.intro {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.lede {
  max-width: 700px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 1.06rem;
}

.disclosure {
  max-width: 700px;
  margin-bottom: 16px;
  color: #b00020;
  font-size: 1rem;
  font-weight: 700;
}

.workflow-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
}

.workflow-copy p {
  margin-bottom: 10px;
}

.workflow-copy ol {
  margin: 0;
  padding-left: 1.25rem;
}

.workflow-copy li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.workflow-copy li::marker {
  color: var(--accent);
  font-weight: 800;
}

.tool,
.results {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool {
  padding: 22px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
}

.sort-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.sort-control legend {
  width: 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.sort-control label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.sort-control input {
  width: auto;
  min-width: 0;
  margin: 0;
  accent-color: var(--accent);
}

.sort-control label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

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

#copy-button {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

#copy-button:hover:not(:disabled) {
  color: #fff;
  background: var(--accent-strong);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.status {
  min-height: 48px;
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
}

.status:empty {
  display: none;
}

.status[data-type="loading"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status[data-type="success"] {
  background: var(--success-bg);
  color: var(--success);
}

.status[data-type="error"] {
  background: var(--warn-bg);
  color: var(--warn);
}

.results {
  padding: 22px;
}

.results-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#result-count {
  margin-bottom: 0;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--ink);
  background: #fbfcfa;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

td:first-child {
  width: 38%;
  font-weight: 650;
}

td:last-child {
  overflow-wrap: anywhere;
}

tr:last-child td {
  border-bottom: 0;
}

a {
  color: var(--accent);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 34px 0;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .results-header {
    align-items: stretch;
    flex-direction: column;
  }
}
