:root {
  --era-ink: #3a211a;
  --era-brown: #2b100d;
  --era-brown-light: #4b1e12;
  --era-gold: #d7a64d;
  --era-gold-light: #f2d18a;
  --era-cream: #f6edda;
  --era-cream-deep: #ead39f;
  --era-line: #d7bd88;
  --era-muted: #765847;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; }
button, input { font: inherit; }

.era-page {
  min-height: 100vh;
  background: var(--era-cream);
  color: var(--era-ink);
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

.era-page a { color: inherit; text-decoration: none; }
.era-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.era-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--era-brown);
  color: #f9e7b7;
}

.era-header::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 72% 16%, rgba(184, 125, 37, 0.32), transparent 30%),
    linear-gradient(115deg, #31110c 0%, #4b1e12 48%, #1e0b0a 100%);
  content: "";
}

.era-header::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(245, 214, 139, 0.62) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  opacity: 0.26;
}

.era-header-inner { padding-block: 22px 0; }
.era-header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.era-brand { display: flex; align-items: center; gap: 14px; }
.era-brand strong {
  display: block;
  color: #f5d28a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.era-brand small { display: block; margin-top: 3px; color: #c39a57; font-size: 0.62rem; letter-spacing: 0.23em; text-transform: uppercase; }
.era-brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #cf9b41;
  border-radius: 50%;
  background: #4b2015;
  box-shadow: 0 0 0 5px rgba(207, 155, 65, 0.12);
}
.era-brand-orbit { position: absolute; width: 28px; height: 14px; border: 1px solid #e1b75a; border-radius: 50%; transform: rotate(-25deg); }
.era-brand-star { color: #f7dfa1; font-size: 0.85rem; }
.era-account-actions { display: flex; align-items: center; gap: 16px; color: #efd18e; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.era-account-actions form { margin: 0; }
.era-account-actions button,
.era-login-link { padding: 10px 17px; border: 1px solid #a97731; border-radius: 999px; background: transparent; color: #efd18e; cursor: pointer; }
.era-account-actions button:hover,
.era-login-link:hover { border-color: #f1d38d; background: #63301b; }

.era-nav { display: flex; justify-content: center; gap: clamp(20px, 5vw, 52px); margin-top: 22px; border-top: 1px solid #714424; padding: 15px 0; color: #d8b97e; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.17em; text-transform: uppercase; }
.era-nav a:hover { color: #fff; }

.era-chart-hero { position: relative; overflow: hidden; padding: clamp(42px, 7vw, 78px) 0 64px; background: #efe0bc; }
.era-grid-pattern { position: absolute; inset: 0; background-image: linear-gradient(rgba(121, 79, 34, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(121, 79, 34, 0.07) 1px, transparent 1px); background-size: 42px 42px; pointer-events: none; }
.era-chart-heading { position: relative; display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.era-kicker { margin: 0 0 9px; color: #956324; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; }
.era-chart-heading h1,
.era-auth-card h1,
.era-section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.era-chart-heading h1 { font-size: clamp(2.7rem, 7vw, 5.4rem); letter-spacing: -0.045em; line-height: 0.98; }
.era-time { min-width: 210px; border-left: 1px solid #c39a57; padding-left: 24px; text-align: right; }
.era-time strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 500; line-height: 1; }
.era-time span { display: block; margin-top: 7px; color: #79502d; font-size: 0.76rem; letter-spacing: 0.08em; }
.era-time small { display: block; margin-top: 5px; color: #997344; font-size: 0.68rem; }

.era-wheel-card { position: relative; border: 1px solid rgba(155, 105, 39, 0.34); background: rgba(255, 251, 239, 0.84); box-shadow: 0 24px 70px rgba(75, 32, 15, 0.12); }
.era-wheel { width: min(100%, 800px); min-height: 320px; margin: 0 auto; padding: clamp(10px, 2vw, 24px); }
.era-wheel svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.era-rendering-status { display: grid; min-height: 360px; margin: 0; place-items: center; color: var(--era-muted); }
.era-axis-label { fill: #4a2417; font-family: "DM Sans", sans-serif; font-size: 13px; font-weight: 800; letter-spacing: 0.05em; paint-order: stroke; stroke: #fffaf0; stroke-width: 3px; }
.era-planet-pointer { fill: #9a6422; stroke: #fffaf0; stroke-width: 0.8px; }

.era-data-sections { display: grid; gap: 28px; padding: 58px 0 72px; }
.era-data-panel { border: 1px solid var(--era-line); background: #fbf3df; box-shadow: 0 12px 34px rgba(83, 48, 19, 0.06); }
.era-section-heading { padding: 27px 30px 22px; border-bottom: 1px solid var(--era-line); }
.era-section-heading h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.era-table-scroll { overflow-x: auto; }
.era-table,
.era-aspect-matrix { width: 100%; border-collapse: collapse; }
.era-table th,
.era-table td { padding: 13px 18px; border-bottom: 1px solid #e5d1a6; text-align: left; }
.era-table th { color: #8a5a24; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.era-table td { font-size: 0.9rem; }
.era-table tbody tr:last-child td { border-bottom: 0; }
.era-table-symbol { display: inline-block; width: 1.7em; color: #7b351d; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 400; text-align: center; }
.era-aspect-matrix { min-width: 850px; text-align: center; }
.era-aspect-matrix th,
.era-aspect-matrix td { min-width: 54px; padding: 9px 5px; border: 1px solid #dfc99d; }
.era-aspect-matrix th { background: #f0dfb9; }
.era-aspect-matrix td small { display: block; margin-top: 2px; color: var(--era-muted); font-size: 0.58rem; line-height: 1.2; }
.era-aspect-symbol { font-size: 1.12rem; font-weight: 800; }
.era-aspect-flow { color: #247454; }
.era-aspect-tense { color: #ad3d31; }
.era-aspect-adjust { color: #7650a8; }
.era-aspect-neutral { color: #6e665b; }
.era-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.era-technical-panel { padding-bottom: 28px; }
.era-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; padding: 6px 30px 20px; }
.era-detail-grid div { padding: 15px 0; border-bottom: 1px solid #e5d1a6; }
.era-detail-grid dt { color: #8a5a24; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.era-detail-grid dd { margin: 6px 0 0; overflow-wrap: anywhere; }
.era-detail-wide { grid-column: 1 / -1; }
.era-technical-panel h3 { margin: 12px 30px; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.era-cusp-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 10px 30px 0; list-style: none; }
.era-cusp-list li { padding: 10px; background: #f0dfb9; }
.era-cusp-list strong { color: #7b351d; }

.era-notice { margin: 20px; padding: 16px 18px; border: 1px solid #c99b57; background: #fff6df; }
.era-notice-error { border-color: #ba6c5d; color: #7f281d; }

.era-auth-section { position: relative; display: grid; min-height: 68vh; place-items: center; padding: 64px 20px; background: #efe0bc; }
.era-auth-card { position: relative; width: min(100%, 480px); padding: clamp(28px, 6vw, 48px); border: 1px solid var(--era-line); background: #fbf3df; box-shadow: 0 24px 70px rgba(75, 32, 15, 0.13); }
.era-auth-card h1 { font-size: 3rem; }
.era-auth-card > p:not(.era-kicker) { color: var(--era-muted); line-height: 1.7; }
.era-auth-form { display: grid; gap: 18px; margin-top: 26px; }
.era-auth-form label span { display: block; margin-bottom: 7px; color: #6c3c21; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.era-auth-form input { width: 100%; padding: 12px 13px; border: 1px solid #c7a66f; background: #fffaf0; color: var(--era-ink); }
.era-auth-form input:focus { outline: 2px solid #9a6422; outline-offset: 2px; }
.era-auth-form button { justify-self: start; padding: 12px 24px; border: 0; border-radius: 999px; background: #6c2d18; color: #fff3d0; cursor: pointer; font-weight: 700; }
.era-auth-form button:hover { background: #542112; }

.era-footer { background: var(--era-brown); color: #d9b77b; }
.era-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 34px 0; }
.era-footer strong { color: #f0cb7d; font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: 0.08em; }
.era-footer p { margin: 6px 0 0; color: #a77c4c; font-size: 0.75rem; }

@media (max-width: 760px) {
  .era-shell { width: min(100% - 28px, 1180px); }
  .era-brand small { display: none; }
  .era-brand-mark { width: 42px; height: 42px; }
  .era-account-actions { gap: 8px; }
  .era-account-actions > a:not(.era-login-link) { display: none; }
  .era-nav { justify-content: flex-start; gap: 22px; overflow-x: auto; }
  .era-chart-heading { align-items: flex-start; flex-direction: column; }
  .era-time { border-left: 0; border-top: 1px solid #c39a57; padding: 16px 0 0; text-align: left; }
  .era-wheel { min-height: 240px; padding: 4px; }
  .era-rendering-status { min-height: 260px; }
  .era-detail-grid { grid-template-columns: 1fr; }
  .era-detail-wide { grid-column: auto; }
  .era-cusp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .era-footer-inner { align-items: flex-start; flex-direction: column; }
}
