:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --ink: #16202a;
  --muted: #5d6b78;
  --line: #d7dee5;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d7f1ed;
  --warn: #b45309;
  --error: #b42318;
  --success: #167548;
  --shadow: 0 18px 50px rgba(20, 31, 43, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
textarea {
  font: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}

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

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

h1 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.summary {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.55;
}

.status-pill {
  min-width: 104px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

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

.input-panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.panel-header.compact {
  padding: 18px 20px 0;
}

textarea {
  display: block;
  width: 100%;
  min-height: 178px;
  resize: vertical;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fbfcfd;
  line-height: 1.45;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

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

.primary-button,
.export-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover,
.export-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.ghost-button {
  background: var(--surface);
}

.button-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  fill: currentColor;
  vertical-align: -3px;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.results-section {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 18px 20px 20px;
}

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

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

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

td {
  color: var(--ink);
}

a {
  color: var(--accent-strong);
  font-weight: 700;
}

.empty-state td {
  padding: 32px 10px;
  color: var(--muted);
  text-align: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.tag.ok {
  background: #ddf6e8;
  color: var(--success);
}

.tag.warn {
  background: #fff3d6;
  color: var(--warn);
}

.tag.error {
  background: #ffe3df;
  color: var(--error);
}

.cards-list {
  display: none;
  padding: 0 16px 18px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.result-card + .result-card {
  margin-top: 10px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-title strong {
  display: block;
}

.card-grid {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-grid span {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .panel-header {
    display: block;
  }

  .status-pill,
  .ghost-button {
    margin-top: 12px;
  }

  h1 {
    font-size: 2.1rem;
  }

  .actions button {
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .cards-list {
    display: block;
  }
}
