:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #65727c;
  --line: #dce3e7;
  --primary: #1d6f8f;
  --primary-dark: #14566f;
  --danger: #b3261e;
  --success: #1f7a4f;
  --warning: #9b6400;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px clamp(18px, 4vw, 48px);
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1,
h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px clamp(18px, 4vw, 48px) 48px;
}

.tool-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr) minmax(260px, 0.75fr);
}

.keyword-panel,
.result-panel,
.auth-panel,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading span,
.empty-state {
  color: var(--muted);
}

textarea,
input {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: block;
  font: inherit;
  margin-top: 8px;
  padding: 12px;
  width: 100%;
}

textarea {
  min-height: 220px;
  resize: vertical;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.button {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: #eef4f6;
  color: var(--primary-dark);
}

.button-secondary:hover {
  background: #dfecef;
}

.result-panel {
  align-content: start;
  display: grid;
  gap: 18px;
}

.result-stats {
  display: grid;
  gap: 4px;
}

.result-stats strong {
  font-size: 40px;
  line-height: 1;
}

.result-stats span {
  color: var(--muted);
}

.muted-line {
  color: var(--muted);
  margin: -8px 0 0;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  border-radius: 6px;
  padding: 12px 14px;
}

.message-error {
  background: #fdebea;
  color: var(--danger);
}

.message-success {
  background: #e9f6ef;
  color: var(--success);
}

.message-warning {
  background: #fff3db;
  color: var(--warning);
  margin-bottom: 18px;
}

.auth-panel {
  margin: 42px auto;
  max-width: 420px;
}

.auth-panel h2 {
  margin-bottom: 18px;
}

.table-panel {
  margin-top: 18px;
}

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

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

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

th {
  background: #edf5f7;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  color: #28343b;
  font-size: 14px;
}

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

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

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

  .actions {
    justify-content: stretch;
  }

  .button {
    width: 100%;
  }
}
