:root {
  color-scheme: light;
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #65717f;
  --line: #e6ded3;
  --accent: #7a4f2a;
  --accent-strong: #4f2d16;
  --secondary: #1f6f78;
  --shadow: 0 16px 40px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  align-items: center;
  background: rgba(250, 247, 242, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 6vw;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a,
.back-link,
.section-heading a {
  color: var(--secondary);
  font-weight: 700;
}

.hero {
  background:
    linear-gradient(90deg, rgba(79, 45, 22, 0.82), rgba(31, 111, 120, 0.68)),
    url("https://images.unsplash.com/photo-1532968961962-8a0cb3a2d4f5?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
  min-height: 520px;
  padding: 96px 6vw 120px;
}

.hero-content,
.page-title,
.section {
  margin: 0 auto;
  max-width: 1180px;
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.7rem;
  opacity: 0.78;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.95;
  margin-bottom: 1.2rem;
  max-width: 900px;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.lead {
  color: inherit;
  font-size: 1.15rem;
  max-width: 680px;
  opacity: 0.82;
}

.actions,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button,
.tabs a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  min-height: 44px;
  padding: 0.75rem 1rem;
}

.button.primary {
  background: #fff;
  color: var(--accent-strong);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.page-title {
  padding: 72px 6vw 24px;
}

.page-title h1 {
  color: var(--accent-strong);
  font-size: clamp(2.25rem, 5vw, 4.6rem);
}

.page-title .lead {
  color: var(--muted);
}

.section {
  padding: 32px 6vw 72px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sign-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.sign-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.sign-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1.1rem;
}

.sign-card.large {
  min-height: 160px;
}

.sign-card strong {
  color: var(--accent-strong);
  font-size: 1.35rem;
}

.sign-card span:last-child {
  color: var(--muted);
}

.sign-card em {
  color: var(--secondary);
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 800;
}

.sign-order {
  color: var(--secondary);
  font-weight: 900;
}

.sign-title {
  padding-bottom: 0;
}

.tabs a {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}

.tabs a.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

.horoscope-layout {
  display: grid;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2rem);
}

.panel.highlight {
  border-top: 6px solid var(--accent);
}

.panel-heading {
  margin-bottom: 1.5rem;
}

.panel-heading span {
  color: var(--muted);
  font-weight: 700;
}

.forecast-list {
  display: grid;
  gap: 1.5rem;
}

.forecast-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  padding-top: 1.35rem;
}

.forecast-heading {
  align-items: center;
  display: flex;
  gap: 0.8rem;
}

.forecast-heading h3 {
  color: var(--accent-strong);
  font-size: 1.28rem;
  margin-bottom: 0;
}

.topic-icon {
  flex: 0 0 auto;
  height: 48px;
  width: 48px;
}

.topic-icon rect {
  fill: #f5efe7;
  stroke: var(--accent);
  stroke-width: 2;
}

.topic-icon circle {
  fill: #fff;
  stroke: var(--secondary);
  stroke-width: 2;
}

.topic-icon text {
  fill: var(--accent-strong);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 900;
}

.forecast-section p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 0;
}

.daily-insights {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.quote-card,
.lucky-number-card,
.advice-card,
.article-signature {
  border-radius: 8px;
  margin: 0;
  padding: 1.25rem;
}

.quote-card {
  background: #f5efe7;
  border-left: 6px solid var(--accent);
}

.quote-card span,
.lucky-number-card span,
.advice-card span,
.article-signature span {
  color: var(--accent-strong);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.quote-card p {
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.lucky-number-card {
  align-items: center;
  background: #eef7f8;
  border: 1px solid rgba(31, 111, 120, 0.25);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(100px, 140px) 1fr;
}

.lucky-number-card strong {
  color: var(--secondary);
  display: block;
  font-size: clamp(3rem, 9vw, 5rem);
  line-height: 0.9;
}

.lucky-number-card p,
.advice-card p,
.article-signature p {
  color: var(--muted);
  margin-bottom: 0;
}

.advice-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.advice-card p {
  color: var(--text);
  font-size: 1.08rem;
}

.article-signature {
  background: #21180f;
  color: #fff;
  display: grid;
  gap: 0.45rem;
  margin-top: 2rem;
}

.article-signature a {
  color: #f4d7b5;
}

.article-signature strong {
  display: block;
  font-size: 1.15rem;
}

.article-signature p {
  color: rgba(255, 255, 255, 0.78);
}

.period-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.period-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.55rem;
  min-height: 190px;
  padding: 1.25rem;
}

.period-card span {
  color: var(--secondary);
  font-weight: 900;
}

.period-card strong {
  color: var(--accent-strong);
  font-size: 1.4rem;
}

.period-card p,
.seo-band p,
.seo-content p,
.prose-section p,
.signature-box p,
.site-footer p {
  color: var(--muted);
}

.seo-band {
  display: grid;
  gap: 1rem;
}

.seo-content {
  border-left: 6px solid var(--secondary);
}

.seo-content p {
  font-size: 1.03rem;
  line-height: 1.7;
}

.signature-box {
  background: #f5efe7;
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  margin-top: 1.5rem;
  padding: 1rem;
}

.signature-box strong {
  color: var(--accent-strong);
}

.prose-section {
  max-width: 900px;
}

.prose-section h2:not(:first-child) {
  margin-top: 2rem;
}

.site-footer {
  background: #21180f;
  color: #fff;
  padding: 48px 6vw 24px;
}

.footer-inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(170px, 1fr));
  margin: 0 auto;
  max-width: 1180px;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1.05rem;
}

.site-footer ul {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: #f4d7b5;
  font-weight: 700;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 2rem auto 0;
  max-width: 1180px;
  padding-top: 1rem;
}

.admin-header {
  background: #fff;
}

.dark {
  background: var(--accent-strong);
  color: #fff;
}

.light {
  background: var(--surface);
  border-color: var(--line);
  color: var(--secondary);
}

.admin-narrow {
  max-width: 680px;
}

.admin-layout {
  display: grid;
  gap: 1.25rem;
}

.stats-grid,
.import-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.1rem;
  padding: 1rem;
}

.stat strong {
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-weight: 700;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-stack label {
  display: grid;
  gap: 0.35rem;
}

.form-stack label span {
  color: var(--accent-strong);
  font-weight: 800;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--secondary);
  border-radius: 8px;
  color: var(--secondary);
  display: inline-flex;
  font-weight: 900;
  min-height: 46px;
  padding: 0.75rem 1rem;
}

.admin-button:hover,
.admin-button:focus {
  background: var(--secondary);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  max-width: 360px;
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent-strong);
  font-size: 0.82rem;
  text-transform: uppercase;
}

td,
td pre {
  color: var(--muted);
  font-size: 0.92rem;
}

td pre {
  margin: 0;
  white-space: pre-wrap;
}

.row-actions {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--secondary);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.link-button.danger {
  color: #a13d34;
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
}

.flash {
  border-radius: 8px;
  font-weight: 700;
  margin: 0;
  padding: 0.75rem 1rem;
}

.flash.success {
  background: #e5f4ed;
  color: #176143;
}

.flash.error,
.flash.failed {
  background: #f8e7e4;
  color: #8c2d26;
}

.flash.partial {
  background: #fff2d6;
  color: #73510d;
}

@media (max-width: 720px) {
  .site-header {
    padding: 0 1rem;
  }

  .hero {
    min-height: 500px;
    padding: 72px 1rem 96px;
  }

  .page-title,
  .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .lucky-number-card {
    grid-template-columns: 1fr;
  }
}
