:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: rgba(255, 255, 255, 0.9);
  --text: #11201c;
  --muted: #62716d;
  --line: rgba(17, 32, 28, 0.12);
  --accent: #087f5b;
  --accent-strong: #075f48;
  --red: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(145deg, rgba(8, 127, 91, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.10), transparent 38%),
    var(--bg);
  color: var(--text);
}

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.login-view {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 34px;
  align-items: center;
}

.login-view h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.6rem, 6.2vw, 6rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.intro {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.eyebrow,
.pill {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 12px;
}

.panel,
.split-card,
.warning {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(18, 35, 31, 0.09);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.login-panel {
  gap: 14px;
}

.topbar,
.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.warning {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--muted);
}

.warning strong {
  color: var(--red);
}

.split-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.split-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.split-card span {
  color: var(--muted);
  font-weight: 850;
}

.split-card strong {
  font-size: 1.7rem;
}

.split-card.high strong {
  color: var(--red);
}

.split-card.normal strong {
  color: var(--blue);
}

.split-card.safe strong {
  color: var(--accent-strong);
}

.split-card p,
.panel-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.wide-panel {
  align-content: start;
}

.form-stack,
.recommendation-list,
.history-list,
.news-list,
.option-grid {
  display: grid;
  gap: 12px;
}

.recommendation-card,
.history-row,
.news-row,
.option-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.66);
}

.recommendation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.recommendation-card p,
.recommendation-card footer {
  grid-column: 1 / -1;
}

.recommendation-card span,
.history-row span,
.news-row span,
.option-grid span,
.empty {
  color: var(--muted);
}

.recommendation-card p {
  margin: 0;
  line-height: 1.45;
}

.recommendation-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.score {
  min-width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 127, 91, 0.1);
  color: var(--accent-strong);
  font-weight: 900;
}

.recommendation-card.high {
  border-color: rgba(220, 38, 38, 0.25);
}

.history-row,
.option-grid article {
  display: grid;
  gap: 4px;
}

.news-row {
  display: grid;
  gap: 6px;
}

.news-row.positive {
  border-color: rgba(22, 163, 74, 0.28);
}

.news-row.negative {
  border-color: rgba(220, 38, 38, 0.28);
}

.option-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

[hidden] {
  display: none !important;
}

@media (max-width: 950px) {
  .login-view,
  .grid,
  .split-cards,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head,
  .warning {
    align-items: start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .login-view h1 {
    font-size: clamp(2.25rem, 12vw, 4rem);
  }

  .recommendation-card {
    grid-template-columns: 1fr;
  }
}
