:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f7f4;
  color: #17211c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #51665a;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 18px;
}

.status {
  min-width: 112px;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  background: #fff;
}

.top-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.download-button {
  min-height: 38px;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: #17211c;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.download-button {
  background: #146c43;
  border-color: #146c43;
  color: #fff;
}

.hidden {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.panel {
  background: #ffffff;
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(23, 33, 28, 0.06);
}

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

.section-head span {
  color: #607167;
  font-size: 13px;
}

.compact {
  margin-top: 20px;
}

.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

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

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

label {
  display: grid;
  gap: 6px;
  color: #4d5c53;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d5ce;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfb;
  color: #17211c;
  font: inherit;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 18px;
}

.toggles label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7e0da;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f9fbfa;
}

.toggles input {
  width: auto;
}

.primary {
  min-height: 44px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #146c43;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.primary:disabled {
  cursor: progress;
  opacity: 0.68;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source {
  border: 1px solid #e1e8e4;
  border-radius: 8px;
  padding: 11px;
}

.source strong {
  display: block;
  margin-bottom: 4px;
}

.source span {
  color: #607167;
  font-size: 13px;
}

.results {
  margin-top: 16px;
}

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

.quote-card {
  border: 1px solid #dde7e1;
  border-radius: 8px;
  padding: 14px;
}

.quote-card.best {
  border-color: #146c43;
  background: #f2fbf5;
}

.quote-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.quote-card p {
  margin: 5px 0;
  color: #46564d;
  font-size: 14px;
}

@media (max-width: 880px) {
  .layout,
  .cards,
  .two,
  .four {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 108, 67, 0.12), rgba(32, 90, 136, 0.12)),
    #f6f7f4;
}

.login-shell {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 28px;
}

.login-brand h1 {
  max-width: 560px;
  font-size: clamp(34px, 5vw, 56px);
}

.login-copy {
  max-width: 440px;
  margin: 14px 0 0;
  color: #51665a;
  font-size: 18px;
  line-height: 1.45;
}

.login-panel {
  display: grid;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 42px rgba(23, 33, 28, 0.12);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d7e0da;
  border-radius: 8px;
  background: #f6f8f7;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #526258;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: #146c43;
  color: #ffffff;
}

.register-only {
  display: none;
}

body[data-auth-mode="register"] .register-only {
  display: grid;
}

.login-note {
  margin: 0;
  color: #607167;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 780px) {
  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 20px;
    padding: 32px 0;
  }
}
