:root {
  --graphite: #171713;
  --graphite-2: #24221d;
  --graphite-3: #343126;
  --ivory: #f8f1e4;
  --ivory-2: #f2eadb;
  --sand: #ddcfb8;
  --gold: #a9823b;
  --gold-2: #c8a66a;
  --bronze: #7a5630;
  --sage: #435448;
  --sage-2: #62715f;
  --sage-deep: #25362d;
  --mist: #ebe4d6;
  --danger: #9d352d;
  --line: rgba(36, 34, 29, .12);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #17251d; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% -8%, rgba(67,84,72,.52), transparent 34rem),
    radial-gradient(circle at 92% 4%, rgba(169,130,59,.20), transparent 28rem),
    linear-gradient(135deg, #17251d 0%, #18231b 54%, #302718 100%);
  color: var(--ivory);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(248,241,228,.030) 1px, transparent 1px), linear-gradient(90deg, rgba(200,166,106,.026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.15));
}
.shell { width: calc(100vw - 32px); margin: 22px auto 48px; position: relative; }
body.auth-view .shell { min-height: calc(100vh - 28px); margin: 14px auto; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(14px, 3vh, 32px); }
.card {
  background: linear-gradient(180deg, rgba(247,239,224,.98), rgba(229,218,198,.97));
  color: var(--graphite);
  border: 1px solid rgba(169,130,59,.24);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 18px 70px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.5);
}
.hero-card {
  margin-bottom: 14px;
  padding: 12px 18px;
  background:
    radial-gradient(circle at 88% 18%, rgba(200,166,106,.24), transparent 24rem),
    linear-gradient(135deg, var(--sage-deep) 0%, var(--sage) 62%, #334436 100%);
  color: var(--ivory);
  border-color: rgba(200,166,106,.34);
  box-shadow: 0 20px 76px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.10);
}
.brand-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 34px);
  margin-bottom: 0;
  width: 100%;
}
.hero-title-block { min-width: 0; height: 100%; display: flex; align-items: center; text-align: left; }
.hero-title-block h1 { margin: 0; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 16px auto 0; color: rgba(248,241,228,.60); font-size: .78rem; font-weight: 680; letter-spacing: .035em; text-align: center; line-height: 1.25; }
.app-footer span:first-child { color: rgba(248,241,228,.72); }
.app-footer #app-version { color: rgba(200,166,106,.82); }
.app-footer span:not(:last-child)::after { content: "·"; margin-left: 10px; color: rgba(200,166,106,.58); }
.simplia-logo { width: 146px; height: auto; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.14)); }
.rfa-logo { width: 156px; height: auto; object-fit: contain; opacity: 1; filter: drop-shadow(0 8px 18px rgba(0,0,0,.14)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: end; }
.hero-card::after { content: ""; display: block; width: 96px; height: 2px; border-radius: 999px; margin-top: 9px; background: linear-gradient(90deg, var(--gold-2), rgba(248,241,228,.42), transparent); }
h1, h2, h3 { font-family: "Manrope", "Inter", sans-serif; margin: 0 0 8px; letter-spacing: -.035em; }
h1 { font-size: clamp(1.68rem, 2.65vw, 2.55rem); line-height: 1; max-width: none; color: #191812; }
.hero-card h1 { white-space: nowrap; font-weight: 300; letter-spacing: -.062em; text-wrap: balance; }
h2 { font-size: 1.38rem; }
h3 { font-size: 1.08rem; }
.eyebrow { color: var(--bronze); text-transform: uppercase; letter-spacing: .16em; font-size: .83rem; font-weight: 900; margin: 0 0 10px; }
.hero-copy { color: rgba(23,23,19,.70); max-width: 980px; margin: 0; font-size: .98rem; line-height: 1.48; }
.hero-card h1 { color: var(--ivory); text-shadow: 0 2px 18px rgba(0,0,0,.16); }
.hero-card .eyebrow { color: var(--gold-2); }
.hero-card .hero-copy { color: rgba(248,241,228,.80); }
.hero-card .hero-meta span {
  background: rgba(248,241,228,.12);
  color: rgba(248,241,228,.92);
  border-color: rgba(200,166,106,.32);
}
.muted { color: rgba(23,23,19,.64); margin: 0; line-height: 1.45; }
.hero-meta { display: grid; gap: 8px; }
.hero-meta span, .empty-steps span, .badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(169,130,59,.13);
  color: var(--bronze);
  border: 1px solid rgba(169,130,59,.18);
  font-size: .78rem;
  font-weight: 850;
}
.hidden { display: none !important; }
.stack { display: grid; gap: 10px; max-width: 520px; margin-top: 13px; }
.login-submit-row, .login-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 10px; align-items: stretch; }
.login-submit-row button, .login-code-row button { white-space: nowrap; }
.login-code-row { grid-template-columns: minmax(0, 1fr) 190px; }
.login-card {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  border-left: 6px solid var(--gold-2);
  background:
    radial-gradient(circle at 88% 0%, rgba(200,166,106,.22), transparent 18rem),
    linear-gradient(135deg, #6f4a27 0%, var(--bronze) 56%, #4f361f 100%);
  color: var(--ivory);
}
body.auth-view .login-card { align-self: center; justify-self: center; width: min(760px, calc(100vw - 32px)); margin: 0 auto clamp(24px, 7vh, 84px); }
.login-card #login-form, .login-card #login-code-form { max-width: none; }
.login-card #login-copy { max-width: 560px; }
.login-card #login-code-instructions { margin-top: 4px; }
.login-card .subtle-action { width: 100%; background: rgba(17,31,24,.88); color: var(--ivory); box-shadow: none; }
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--sage), var(--gold-2), var(--bronze));
}
.login-card .eyebrow { color: var(--gold-2); }
.login-card h2 { color: var(--ivory); }
.login-card .muted, .login-card .check { color: rgba(248,241,228,.82); }
.login-card input { background: rgba(255,250,240,.96); border-color: rgba(248,241,228,.24); }
.login-card .notice { color: rgba(248,241,228,.86); }
input, button, select { font: inherit; }
input, select { width: 100%; border: 1px solid rgba(36,34,29,.18); border-radius: 13px; padding: 12px 14px; background: #fffaf0; color: var(--graphite); outline: none; }
input:focus, select:focus { border-color: rgba(67,84,72,.72); box-shadow: 0 0 0 4px rgba(67,84,72,.14); }
button { border: 0; border-radius: 13px; padding: 12px 16px; background: linear-gradient(135deg, var(--gold), var(--bronze)); color: white; font-weight: 850; cursor: pointer; box-shadow: 0 10px 24px rgba(122,86,48,.22); }
button.secondary { background: var(--graphite-2); box-shadow: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
.check { display: flex; gap: 8px; align-items: center; color: rgba(23,23,19,.72); }
.check input { width: auto; }
.check input { accent-color: var(--sage); }
.login-card button { background: linear-gradient(135deg, #ead7b6, var(--gold-2)); color: #2d2015; box-shadow: 0 10px 24px rgba(36,24,14,.24); }
.login-card button:hover { filter: brightness(1.04); }
.login-card button.secondary { background: var(--sage-deep); color: var(--ivory); }
.notice { min-height: 1.5em; color: var(--sage); font-weight: 800; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 10px; align-items: start; margin-top: 0; margin-bottom: 0; padding: 15px 16px; border-left: 4px solid rgba(169,130,59,.52); }
.toolbar .eyebrow { margin-bottom: 10px; }
#freshness { grid-column: 1 / -1; display: grid; gap: 7px; margin-top: 9px; width: 100%; }
.freshness-row { display: flex; gap: 7px; width: 100%; align-items: center; }
.freshness-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 0; border-radius: 999px; padding: 5px 7px; background: rgba(23,23,19,.06); color: rgba(23,23,19,.62); font-size: .65rem; font-weight: 760; text-align: center; line-height: 1; white-space: nowrap; overflow: visible; text-overflow: clip; letter-spacing: .01em; }
.freshness-pill-source { flex: 0.78 1 auto; }
.freshness-pill-snapshot { flex: 1.42 1 auto; }
.freshness-pill-activities { flex: 1.08 1 auto; }
.freshness-pill-cases { flex: .92 1 auto; }
