/* ==========================================================================
   Constellation — 站点样式
   视觉语言参照 findreal.me：靛紫主色、胶囊导航、渐变卡片、宽松留白。
   移动端优先，无构建步骤；颜色/间距统一走 CSS 变量，含深浅两套主题。
   ========================================================================== */

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(2rem, 5vw, 3.25rem);

  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-deep: #3730a3;
  --primary-soft: #eef2ff;
  --accent: #8b5cf6;
  --deep: #1e1b4b;

  --bg: #f7f7fc;
  --surface: #ffffff;
  --surface-2: #f1f2f9;
  --ink: #161733;
  --muted: #626888;
  --border: #e5e7f2;
  --link: #4f46e5;
  --link-hover: #3730a3;
  --button-bg: #4f46e5;
  --button-fg: #ffffff;
  --button-hover: #4338ca;
  --danger-bg: #fff1f2;
  --danger-fg: #be123c;
  --danger-border: #fecdd3;
  --shadow: 0 1px 2px rgba(24, 24, 60, 0.04), 0 8px 24px rgba(24, 24, 60, 0.06);
  --shadow-lg: 0 18px 50px rgba(49, 46, 129, 0.22);
}

/* 站点采用浅色主题，沿用上方 :root 定义，不再强制深色覆盖 */

/* Reset + base */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--button-bg);
  color: var(--button-fg);
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus { top: var(--space-4); }

/* 作者样式里的 display 会盖掉浏览器默认的 [hidden]，这里显式兜底 */
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

img, svg { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); margin-top: var(--space-6); }
h3 { font-size: var(--text-lg); margin-top: var(--space-5); }
h4 { font-size: var(--text-base); margin-top: var(--space-4); }

p { margin-top: var(--space-2); overflow-wrap: anywhere; }
.lede { font-size: var(--text-lg); color: var(--muted); margin-top: var(--space-4); max-width: 72ch; }
.small { font-size: var(--text-sm); color: var(--muted); }
.muted { color: var(--muted); }
.big { font-size: var(--text-xl); }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 var(--space-4); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.brand-icon svg { width: 38px; height: 38px; }
.brand-stack { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: var(--text-lg); letter-spacing: -0.03em; }
.brand-tag { font-size: 0.7rem; color: #7c3aed; font-weight: 700; letter-spacing: 0.02em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-soft); text-decoration: none; }

/* 语言切换：按钮 + 下拉，样式参照 findreal.me 的 tl-lang */
.lang-selector { position: relative; flex-shrink: 0; }
.lang-abbr { display: none; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: border-color 0.12s, color 0.12s;
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary-hover); }
.lang-toggle .lang-flag { font-size: 1.1rem; line-height: 1; }
.lang-toggle .lang-current { font-size: var(--text-xs); }
.lang-chevron { width: 12px; height: 12px; transition: transform 0.15s ease; }
.lang-toggle[aria-expanded='true'] .lang-chevron { transform: rotate(180deg); }
.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  width: max-content;
  min-width: 200px;
  max-width: calc(100vw - var(--space-4));
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 120;
}
.lang-toggle[aria-expanded='true'] + .lang-menu { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 36px;
  white-space: nowrap;
  transition: background 0.1s;
}
.lang-option:hover, .lang-option.is-active { background: var(--primary-soft); color: var(--primary-hover); text-decoration: none; }
.lang-option.is-active { font-weight: 700; }
.lang-option .lang-flag { font-size: 1.15rem; line-height: 1; }
.lang-option .lang-name { flex: 1; }
.lang-option .lang-code { font-size: var(--text-xs); color: var(--muted); font-weight: 500; }

/* 窄屏折叠语种全名只留缩写，超窄屏仅留国旗，省横向空间 */
@media (max-width: 659px) {
  .lang-selector { flex: 0 0 auto; }
  .lang-current { display: none; }
  .lang-abbr { display: inline; font-size: var(--text-xs); }
  .lang-toggle { padding: var(--space-1) var(--space-2); }
}
@media (max-width: 359px) {
  .lang-abbr { display: none; }
}

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs { padding: var(--space-4) 0 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; font-size: var(--text-sm); }
.breadcrumbs li::after { content: '/'; margin-left: var(--space-2); color: var(--muted); }
.breadcrumbs li:last-child::after { content: ''; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--link); }
.breadcrumbs span[aria-current='page'] { color: var(--ink); font-weight: 600; }

/* ---------------- Main ---------------- */
/* main 与 .wrap 共用同一元素：用 main.wrap 提高权重，且只补纵向内边距，横向仍交给 .wrap */
main.wrap { flex: 1; padding-top: var(--space-5); padding-bottom: var(--space-6); }
.reading-body, .entry-body, .tool-form { max-width: 72ch; }

/* ---------------- Shared panels ---------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-top: var(--space-5);
  box-shadow: var(--shadow);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---------------- Sign grid ---------------- */
.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
  list-style: none;
  margin-top: var(--space-5);
  padding: 0;
}
.sign-grid.compact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.sign-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.sign-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--ink);
}
.sign-name { font-weight: 750; font-size: var(--text-lg); letter-spacing: -0.02em; }
.sign-dates { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }
.sign-meta { font-size: var(--text-xs); color: var(--primary); margin-top: var(--space-2); font-weight: 600; }

/* ---------------- Link lists & facts ---------------- */
.link-list { list-style: none; padding: 0; margin-top: var(--space-4); }
.link-list li {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-3);
}
.link-list li > p { margin-top: var(--space-1); }
.link-list li h2 { margin: 0 0 var(--space-1); font-size: var(--text-lg); }
.facts { list-style: none; padding: 0; margin-top: var(--space-3); }
.facts li { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.facts li:last-child { border-bottom: none; }

/* ---------------- Buttons & forms ---------------- */
.button, button[type='submit'], .btn, .search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--button-bg);
  color: var(--button-fg);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
  transition: background 0.16s ease, transform 0.16s ease;
}
.button:hover, button[type='submit']:hover, .btn:hover, .search-btn:hover {
  background: var(--button-hover);
  color: var(--button-fg);
  text-decoration: none;
  transform: translateY(-1px);
}
.tool-form { margin-top: var(--space-5); }
.field { margin-bottom: var(--space-4); }
.field label { display: block; margin-bottom: var(--space-2); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  max-width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field .small { display: block; margin-top: var(--space-1); }
.field .error {
  color: var(--danger-fg);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-1);
  font-size: var(--text-sm);
}

.result { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.result .big { word-break: keep-all; }

/* ---------------- Reading body ---------------- */
.reading-body { margin-top: var(--space-4); line-height: 1.8; }
.entry-body { margin-top: var(--space-4); line-height: 1.8; }
.entry-body h2, .entry-body h3 { margin-top: var(--space-6); }
.entry-body p { margin-top: var(--space-3); }
.entry-body ul, .entry-body ol { margin-top: var(--space-3); padding-left: var(--space-6); }
.entry-body li { margin-top: var(--space-1); }
.entry-body a { text-decoration: underline; }

/* ---------------- Window links ---------------- */
.window-links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); padding: 0; list-style: none; }
.window-links a {
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.window-links a:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ---------------- Footer ---------------- */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-5) 0 var(--space-5);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr); gap: var(--space-6); }
.footer-about { color: var(--muted); font-size: var(--text-sm); max-width: 48ch; margin-top: var(--space-3); }
.site-footer h2 { font-size: var(--text-sm); margin: 0 0 var(--space-3); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.site-footer ul.plain { list-style: none; padding: 0; }
.site-footer ul.plain li { margin-bottom: var(--space-2); }
.site-footer ul.plain a { color: var(--ink); font-size: var(--text-sm); }
.site-footer ul.plain a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: center; text-align: center; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--muted); }
.footer-bottom p { margin: 0; }

/* ==========================================================================
   首页（参照 findreal.me 的 hero / rails / flagship / card grid）
   ========================================================================== */
.home { padding-top: var(--space-4); }
.hero { text-align: center; padding: var(--space-6) 0 var(--space-5); }
.kicker {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: var(--space-4) auto var(--space-3);
  max-width: 16ch;
  font-size: var(--text-3xl);
  line-height: 1.1;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { max-width: 58ch; margin: 0 auto; color: var(--muted); font-size: var(--text-lg); }

.search-bar { display: flex; gap: var(--space-2); max-width: 680px; margin: var(--space-5) auto 0; }
.search-input {
  flex: 1;
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  box-shadow: var(--shadow);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-btn { white-space: nowrap; }
.search-btn svg { width: 18px; height: 18px; }

.rail { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-2) 0 var(--space-3); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.rail-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.rail-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.rail-btn[data-element='fire'] .rail-dot { background: linear-gradient(135deg, #f97316, #ef4444); }
.rail-btn[data-element='earth'] .rail-dot { background: linear-gradient(135deg, #059669, #14b8a6); }
.rail-btn[data-element='air'] .rail-dot { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.rail-btn[data-element='water'] .rail-dot { background: linear-gradient(135deg, #6366f1, #a855f7); }

.section { margin-top: var(--space-7); }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.section-bar h2 { margin: 0; }
.see-all { font-size: var(--text-sm); font-weight: 700; white-space: nowrap; }

.flagship {
  position: relative;
  overflow: hidden;
  margin-top: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--deep), var(--primary-deep) 60%, var(--primary));
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.flagship-copy { position: relative; z-index: 1; max-width: 52ch; }
.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
}
.flagship h2 { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-2xl); color: #fff; }
.flagship-desc { color: rgba(255, 255, 255, 0.82); }
.flagship .facts li { border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.9); }
.flagship .facts a { color: #fff; text-decoration: underline; }
.flagship-btn {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--primary-deep);
  font-weight: 800;
}
.flagship-btn:hover { background: rgba(255, 255, 255, 0.9); color: var(--primary-deep); text-decoration: none; }
.flagship-art {
  position: absolute;
  right: -40px;
  top: 50%;
  width: 320px;
  height: 320px;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-4); }
.tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); text-decoration: none; }
.tile-thumb {
  position: relative;
  height: 104px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: rgba(255, 255, 255, 0.92);
}
.tile-thumb svg { width: 34px; height: 34px; }
.tile--fire .tile-thumb { background: linear-gradient(135deg, #b45309, #ef4444); }
.tile--earth .tile-thumb { background: linear-gradient(135deg, #047857, #10b981); }
.tile--air .tile-thumb { background: linear-gradient(135deg, #0369a1, #6366f1); }
.tile--water .tile-thumb { background: linear-gradient(135deg, #4338ca, #a855f7); }
.tile:nth-child(3n) .tile-thumb { background: linear-gradient(135deg, #312e81, #6366f1); }
.tile-cat {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
}
.tile-body { display: flex; flex-direction: column; flex: 1; padding: var(--space-4); }
.tile-title { font-size: var(--text-lg); font-weight: 750; line-height: 1.3; letter-spacing: -0.02em; }
.tile-meta { margin-top: auto; padding-top: var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.empty { margin-top: var(--space-5); color: var(--muted); text-align: center; }

.adsense { margin: var(--space-6) 0; text-align: center; min-height: 90px; }

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */
/* 导航项较多，容器还没收缩到 860px 时就先换行，避免链接被裁掉 */
@media (max-width: 1040px) {
  .header-inner { flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); padding-bottom: var(--space-2); }
  .main-nav { order: 3; width: 100%; }
  .lang-selector { margin-left: auto; }
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  main.wrap { padding-top: var(--space-2); padding-bottom: var(--space-5); }
  .home { padding-top: var(--space-2); }
  h1 { font-size: var(--text-xl); }
  h2 { font-size: var(--text-lg); }
  h3 { font-size: var(--text-base); }
  .lede, .hero-sub { font-size: var(--text-base); }
  .hero { padding: var(--space-2) 0; }
  .hero h1 { max-width: none; }
  .flagship { padding: var(--space-5); }
  .flagship h2 { font-size: var(--text-xl); }
  .flagship-art { width: 200px; height: 200px; right: -70px; opacity: 0.35; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .tile-thumb { height: 82px; }
  .tile-body { padding: var(--space-3); }
  .tile-title { font-size: var(--text-base); }
  .tile-meta { font-size: var(--text-xs); }
  .sign-grid, .sign-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sign-card { padding: var(--space-3); }
  .sign-name { font-size: var(--text-base); }
  .sign-meta { display: none; }
  .panel { padding: var(--space-4); }
  .button, button[type='submit'], .btn { width: 100%; }
  .search-btn { width: auto; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  .wrap { padding-left: var(--space-3); padding-right: var(--space-3); }
  .brand-name { font-size: var(--text-base); }
  .brand-tag { font-size: 0.65rem; }
  .card-grid { gap: var(--space-2); }
  .tile-title { font-size: var(--text-sm); }
  .tile-cat { font-size: 0.65rem; }
  .main-nav a { font-size: var(--text-xs); padding: var(--space-2); }
}

@media (max-height: 480px) and (orientation: landscape) {
  .header-inner { min-height: 52px; }
  main.wrap { padding-top: var(--space-4); padding-bottom: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------- Birth chart ---------------- */
.birth-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.birth-card {
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.birth-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.birth-sign {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xl);
  font-weight: 750;
  letter-spacing: -0.02em;
}
.birth-card p { font-size: var(--text-sm); }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin-top: var(--space-3);
}
.chip {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.chip.is-dominant { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: var(--space-4); }
.chart-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.chart-table th, .chart-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.chart-table thead th { color: var(--muted); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }
.chart-table tbody th { font-weight: 700; }
.chart-table tr:last-child th, .chart-table tr:last-child td { border-bottom: none; }
.birth-placement { margin-top: var(--space-5); }
.birth-placement h3 { margin-top: 0; }
@media (max-width: 700px) {
  .birth-cards { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .chart-table th, .chart-table td { padding: var(--space-2) 6px; }
}
