:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-strong: #111827;
  --text: #172033;
  --muted: #667085;
  --line: #d8dde6;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --warning-bg: #fffaeb;
  --warning-text: #93370d;
  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:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 340px),
    var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

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

.workspace {
  display: grid;
  gap: 24px;
}

.masthead {
  max-width: 760px;
}

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

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
}

h3 {
  margin: 24px 0 12px;
  font-size: 1rem;
}

.masthead p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.parser-panel,
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
}

.parser-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

label {
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: #fbfcfe;
  line-height: 1.6;
}

textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.actions,
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

button.secondary:hover {
  background: #f2f4f7;
}

.message {
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: white;
}

.message.error {
  border-color: #fecdca;
  background: var(--danger-bg);
  color: var(--danger);
}

.message.success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.result {
  padding: 20px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}

.meta-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

dd {
  margin: 6px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.warnings {
  margin-top: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--warning-bg);
  color: var(--warning-text);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.url-cell {
  max-width: 320px;
}

.copy-row {
  white-space: nowrap;
}

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

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

  h1 {
    font-size: 2.25rem;
  }
}
