:root {
  --bg: #f5f9ff;
  --panel: #ffffff;
  --panel-soft: #eef7ff;
  --text: #172033;
  --muted: #64748b;
  --line: #cfe3f8;
  --blue: #1769e0;
  --blue-dark: #0f4fb0;
  --cyan: #22b8f0;
  --shadow: 0 18px 45px rgba(23, 105, 224, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button,
.button-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  padding: 0 18px;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  background: var(--blue-dark);
}

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

.secondary,
.ghost {
  background: white;
  color: var(--blue-dark);
  border: 1px solid var(--line);
}

.ghost {
  min-height: 36px;
}

a {
  color: var(--blue-dark);
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 10px 12px;
}

.page {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

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

.hero {
  padding: 22px;
  margin-bottom: 18px;
}

.mode-label {
  width: fit-content;
  border: 1px solid #b8ddff;
  border-radius: 999px;
  background: #e9f6ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  margin-bottom: 12px;
}

.hero-top,
.section-head,
.actions,
.ask-row,
.filter-actions,
.list-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero-top,
.section-head,
.list-head {
  justify-content: space-between;
}

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

.ask {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ask label {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}

.mode-help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.ask-row {
  align-items: stretch;
}

.ask-row input {
  font-size: 16px;
}

.answer {
  min-height: 160px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
  padding: 16px;
  line-height: 1.35;
}

.answer.empty {
  color: var(--muted);
}

.answer p {
  margin: 0 0 2px;
}

.lists {
  padding: 20px;
}

.section-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-head h1,
.list-head h2 {
  margin: 0;
  font-size: 24px;
}

.section-head p,
.actions span {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.filter-grid {
  display: grid;
  gap: 18px;
  margin: 18px 0 16px;
}

.filter-group {
  display: grid;
  gap: 10px;
}

.filter-group-title {
  color: #0f4f8f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

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

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

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

.filter-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(23, 105, 224, 0.05);
}

.filter-card {
  margin-bottom: 0;
}

.filter-row-top .filter-card:first-child {
  grid-column: auto;
}

.filter-card-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.filter-card h3 {
  margin: 0;
  color: #143a68;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.filter-count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.filter-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.checks {
  display: grid;
  gap: 8px;
}

.filter-card.compact .checks {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.checks.scroll {
  max-height: 210px;
  overflow: auto;
  padding-right: 4px;
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  border-radius: 6px;
  padding: 2px;
}

.check:hover {
  background: #eef7ff;
}

.check:has(input:checked) {
  background: #e4f3ff;
  color: #0f4fb0;
}

.check input {
  width: 16px;
  min-height: 16px;
  margin: 1px 0 0;
  padding: 0;
}

.filter-actions {
  justify-content: flex-start;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
}

.applied {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  margin-bottom: 18px;
}

.applied > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e4f3ff;
  color: #123b68;
  padding: 6px 10px;
  font-size: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.list-head {
  margin-bottom: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 14px;
}

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

th {
  position: sticky;
  top: 0;
  background: #eaf5ff;
  color: #143a68;
  z-index: 1;
}

td:nth-child(2) {
  min-width: 300px;
}

@media (max-width: 980px) {
  .ask-row,
  .section-head,
  .actions,
  .filter-actions,
  .list-head {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-grid {
    gap: 12px;
  }

  .filter-row,
  .filter-row-top,
  .filter-row-short,
  .filter-row-medium,
  .filter-row-long {
    display: grid;
    grid-template-columns: 1fr;
    columns: auto;
    gap: 12px;
  }

  .filter-card {
    margin-bottom: 0;
  }

}
