: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(28px, 4vw, 48px) 0 16px; 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: center; gap: 32px; margin-bottom: 18px; text-align: center; }
.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-chart-toolbar { padding: 0 18px 10px; text-align: center; }
.era-time-navigation { display: flex; justify-content: center; gap: 8px; }
.era-time-navigation button { min-width: 72px; border: 1px solid #a97731; border-radius: 999px; padding: 7px 12px; background: rgba(255, 250, 240, 0.72); color: #5b2a17; cursor: pointer; font-weight: 800; }
.era-time-navigation button:hover { border-color: #70451f; background: #fffaf0; }
.era-time-navigation button:focus-visible { outline: 3px solid rgba(149, 99, 36, 0.35); outline-offset: 2px; }
.era-time-navigation button:disabled { cursor: wait; opacity: 0.5; }
.era-time-navigation button span { display: inline; margin: 0; color: inherit; font-size: 0.68rem; letter-spacing: 0.03em; }
.era-time-status { min-height: 1em; margin: 6px 0 0; color: #79502d; font-size: 0.65rem; }
.era-time-status:empty { display: none; }
.era-wheel[aria-busy="true"] { opacity: 0.55; }

.era-wheel-card { position: relative; width: min(100%, 860px); margin: 0 auto; 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); width: min(100%, 800px, calc(100svh - 90px)); min-height: 0; margin: -8px auto; padding: 0; }
.era-wheel svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.era-chart-caption { padding: 10px 18px 0; text-align: center; }
.era-chart-caption strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 500; line-height: 1; }
.era-chart-caption span { display: block; margin-top: 4px; color: #79502d; font-size: 0.72rem; letter-spacing: 0.08em; }
.era-chart-caption small { display: block; margin-top: 2px; color: #997344; font-size: 0.64rem; }
.era-navigation-time { display: block; margin-top: 3px; color: #79502d; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; }
.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 { width: min(800px, calc(100% - 40px)); display: grid; gap: 28px; padding: 28px 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-zodiac-symbol { color: #7b351d; font-family: Georgia, serif; font-size: 1.15em; }
.era-element-earth { color: #7b4b24; }
.era-element-air { color: #7cac58; }
.era-element-fire { color: #bf443a; }
.era-element-water { color: #2e7794; }
.era-motion-marker { margin-left: 0.36em; color: #79502d; font-size: 0.7em; font-weight: 800; letter-spacing: 0.03em; }
.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-compact-chart-data { display: grid; grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.4fr); align-items: start; }
.era-compact-planet-list { padding: 18px 12px 18px 20px; }
.era-compact-planets { width: 100%; border-collapse: collapse; }
.era-compact-planets td { padding: 5px 0; color: #453126; font-size: 0.83rem; white-space: nowrap; }
.era-compact-planets .era-table-symbol { width: 1.45em; font-size: 1.1rem; }
.era-compact-aspect-scroll { border-left: 1px solid #e5d1a6; }
.era-compact-aspect-grid { min-width: 460px; border-collapse: collapse; text-align: center; }
.era-compact-aspect-grid th,
.era-compact-aspect-grid td { width: 27px; height: 27px; padding: 0; border: 1px solid #ded2b8; }
.era-compact-aspect-grid th { color: #6c3c21; background: #f0dfb9; font-family: Georgia, serif; font-size: 0.69rem; }
.era-compact-aspect-grid td { background: #fffaf0; }
.era-compact-aspect-grid .era-compact-aspect-blank { border-color: transparent; background: transparent; }
.era-compact-aspect-grid .era-aspect-symbol { font-size: 0.91rem; }

.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-article-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(52px, 8vw, 96px) 0 clamp(42px, 7vw, 76px);
  background: #efe0bc;
}
.era-article-heading { position: relative; max-width: 900px; }
.era-article-heading h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.era-article-subtitle { max-width: 700px; margin: 22px 0 0; color: #76502d; font-family: Georgia, serif; font-size: clamp(1.15rem, 2.5vw, 1.5rem); line-height: 1.5; }
.era-article-byline { margin: 25px 0 0; color: #8a5a24; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.era-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 34px; padding-top: 56px; padding-bottom: 80px; }
.era-article-card { min-width: 0; padding: clamp(28px, 5vw, 62px); border: 1px solid var(--era-line); background: #fffaf0; box-shadow: 0 18px 52px rgba(83, 48, 19, 0.09); }
.era-article-main-image { margin: 0 0 32px; }
.era-article-main-image img,
.era-article-body img { display: block; max-width: 100%; height: auto; margin: 1.5em auto; border: 1px solid #e5d1a6; }
.era-article-introduction { margin-bottom: 38px; padding-bottom: 30px; border-bottom: 1px solid #e5d1a6; color: #6c3c21; font-family: Georgia, serif; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.7; }
.era-article-body { color: #3f2a20; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.05rem, 1.7vw, 1.18rem); line-height: 1.85; }
.era-article-body p { margin: 0 0 1.3em; }
.era-article-body p:last-child { margin-bottom: 0; }
.era-article-body a { color: #7b351d; text-decoration: underline; text-underline-offset: 0.16em; }
.era-article-body h2,
.era-article-body h3,
.era-article-body h4,
.era-article-body h5,
.era-article-body h6 { margin: 1.7em 0 0.65em; color: #542112; font-family: Georgia, serif; font-weight: 500; line-height: 1.2; }
.era-article-body ul,
.era-article-body ol { padding-left: 1.35em; }
.era-article-body blockquote { margin: 1.5em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 3px solid var(--era-gold); color: #76502d; font-style: italic; }
.era-article-body table { width: 100%; margin: 1.5em 0; border-collapse: collapse; font-family: "DM Sans", sans-serif; font-size: 0.9rem; }
.era-article-body th,
.era-article-body td { padding: 9px 10px; border: 1px solid #dfc99d; text-align: left; }
.era-article-body th { background: #f0dfb9; color: #6c3c21; }
.era-article-aside-inner { position: sticky; top: 24px; padding: 26px 24px; border: 1px solid var(--era-line); background: #fbf3df; box-shadow: 0 12px 34px rgba(83, 48, 19, 0.06); }
.era-article-aside h2 { margin: 0 0 22px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.era-article-aside dl { margin: 0; }
.era-article-aside dl div { padding: 13px 0; border-top: 1px solid #e5d1a6; }
.era-article-aside dt { color: #8a5a24; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.era-article-aside dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.era-article-back { display: inline-block; margin-top: 22px; color: #7b351d; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; }
.era-article-back:hover { color: #542112; }
.era-article-audit-title { margin: 26px 0 8px; font-family: Georgia, serif; font-size: 1.1rem; }
.era-article-audit { padding-left: 1.1rem; color: #6c3c21; font-size: 0.78rem; overflow-wrap: anywhere; }

.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: center; flex-direction: column; }
  .era-chart-toolbar { padding-bottom: 8px; }
  .era-wheel { width: 100%; width: min(100%, calc(100svh - 110px)); }
  .era-rendering-status { min-height: 260px; }
  .era-data-sections { width: min(800px, calc(100% - 28px)); gap: 18px; padding: 24px 0 48px; }
  .era-section-heading { padding: 22px 18px 18px; }
  .era-table { table-layout: fixed; }
  .era-table th,
  .era-table td { padding: 10px 7px; font-size: 0.76rem; overflow-wrap: anywhere; }
  .era-table th { font-size: 0.56rem; letter-spacing: 0.07em; }
  .era-table-symbol { width: 1.25em; font-size: 1.05rem; }
  .era-compact-chart-data { grid-template-columns: 1fr; }
  .era-compact-planet-list { padding: 16px 18px 10px; }
  .era-compact-aspect-scroll { border-top: 1px solid #e5d1a6; border-left: 0; }
  .era-aspect-matrix { min-width: 0; table-layout: fixed; }
  .era-aspect-matrix th,
  .era-aspect-matrix td { min-width: 0; padding: 6px 1px; }
  .era-aspect-symbol { font-size: 0.92rem; }
  .era-aspect-matrix td small { font-size: 0.48rem; overflow-wrap: anywhere; }
  .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-article-layout { grid-template-columns: 1fr; padding-top: 30px; }
  .era-article-aside-inner { position: static; }
  .era-footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .era-table th,
  .era-table td { padding: 9px 4px; font-size: 0.69rem; }
  .era-table th { font-size: 0.5rem; }
  .era-aspect-matrix td small { display: none; }
}
