:root {
  --bg: #f6f0e8;
  --ink: #1e1c1a;
  --muted: #6d655d;
  --card: rgba(255, 251, 247, 0.9);
  --line: rgba(30, 28, 26, 0.12);
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --warn: #c2410c;
  --glow: radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 40%), linear-gradient(135deg, #fff9f2, #efe5d6 68%, #e3d2bf);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--glow);
  min-height: 100vh;
}
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--accent-strong);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 10px;
  max-width: 12ch;
}
.lede, .card-meta, .body-text, .save-status, .hint {
  color: var(--muted);
}
.hero-card, .card, .login-card {
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(68, 52, 36, 0.08);
}
.hero-card, .card {
  padding: 20px;
}
.hero-label, .card-label, .section-title {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hero-value, .metric-value, .big-number {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  margin: 10px 0 4px;
}
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  padding: 10px 16px;
  cursor: pointer;
  color: var(--ink);
}
.tab.active {
  background: var(--accent);
  color: white;
  border-color: transparent;
}
.panel { display: none; }
.panel.active { display: block; animation: fadeIn 180ms ease; }
.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.progress {
  margin-top: 12px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(30, 28, 26, 0.08);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  transition: width 200ms ease;
}
.list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.list-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.45);
}
.list-item strong {
  display: block;
  margin-bottom: 4px;
}
.settings-form,
.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin-top: 18px;
}
.provider-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.provider-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.45);
}
.field {
  display: grid;
  gap: 8px;
}
.field.full {
  grid-column: 1 / -1;
}
.stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
label {
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.settings-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}
.primary, .secondary {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
}
.primary {
  background: var(--accent);
  color: white;
}
.secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.secondary.small {
  padding: 8px 14px;
}
.danger {
  color: var(--warn);
}
.mono {
  font-family: Consolas, monospace;
}
.qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}
.qr-wrap svg {
  width: 220px;
  height: 220px;
}
.qr-wrap.compact svg {
  width: 180px;
  height: 180px;
}
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 460px;
  padding: 36px;
}
.login-header h1 {
  font-size: 2rem;
  max-width: none;
}
.login-hint {
  margin-top: 0;
}
.login-error {
  color: var(--warn);
  background: rgba(194, 65, 12, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}
button.full {
  width: 100%;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
  .hero, .two-up, .three-up, .settings-form, .provider-grid {
    grid-template-columns: 1fr;
  }
  .shell {
    padding: 16px;
  }
  .hero-right {
    align-items: flex-start;
  }
}
