:root {
  --bg: #F6F4F0;
  --card: #FFFFFF;
  --ink: #15233E;
  --muted: #4D5C71;
  --line: #DAE0E7;
  --blue: #345BBE;
  --violet: #7439A0;
  --earth: #08746F;
  --soft: #EAF0FF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.4; }

.site-header { padding: 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.site-header h1 { margin: 0 0 12px; font-size: 1.35rem; color: var(--blue); letter-spacing: 0.02em; }

.date-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.date-form label { font-weight: 600; flex: 0 0 auto; }
.date-form input[type="text"] { flex: 1 1 160px; min-width: 140px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: var(--bg); color: var(--ink); }
.date-form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.date-form button { flex: 0 0 auto; padding: 10px 18px; background: var(--blue); color: #fff;
  border: 0; border-radius: 10px; font-size: 1rem; cursor: pointer; }
.date-form button:active { transform: translateY(1px); }
.hint { flex: 1 0 100%; margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.hint.error { color: #B5341E; }

.sections-nav { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.section-tab { white-space: nowrap; padding: 8px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  color: var(--ink); font-size: 0.95rem; }
.section-tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.dev-token-form[hidden] { display: none !important; }
.dev-token-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line);
  border-radius: 12px; background: var(--bg); }
.dev-token-form label { font-weight: 600; font-size: 0.95rem; }
.dev-token-form input[type="password"] { flex: 1 1 180px; min-width: 140px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.95rem; background: var(--card); color: var(--ink); }
.dev-token-form button { padding: 9px 14px; border: 0; background: var(--muted);
  color: #fff; border-radius: 10px; font-size: 0.95rem; cursor: pointer; }

.action-status { align-self: center; color: var(--muted); font-size: 0.9rem; }

.free-cta { display: inline-block; margin: 0 0 12px; padding: 6px 12px;
  background: var(--soft); color: var(--blue); border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; }

.reveal { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }

.content { padding: 16px; display: grid; gap: 16px; max-width: 760px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.card > p { margin: 0 0 12px; color: var(--muted); }
.card img { display: block; width: 100%; height: auto; border-radius: 12px;
  margin-bottom: 12px; background: var(--bg); min-height: 60px; }
.card img.loading { outline: 2px dashed var(--line); outline-offset: -2px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.actions a, .actions button { padding: 10px 14px; background: var(--violet); color: #fff;
  text-decoration: none; border: 0; border-radius: 10px; font-size: 1rem;
  cursor: pointer; display: inline-block; }
.actions a:active { transform: translateY(1px); }
.actions a.disabled { background: var(--muted); pointer-events: none; opacity: 0.85; }
.actions .dev-badge { align-self: center; padding: 4px 8px; font-size: 0.85rem;
  background: var(--soft); color: var(--blue); border-radius: 999px; }

.input-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.input-row input, .input-row select { flex: 1 1 160px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 1rem;
  background: var(--bg); color: var(--ink); }
.input-row .pair-label { flex: 0 0 100%; font-weight: 600; margin-top: 4px;
  color: var(--muted); font-size: 0.9rem; }

.pair-calc { margin-top: 16px; }
.pair-table { width: 100%; border-collapse: collapse; margin: 12px 0;
  font-size: 0.95rem; }
.pair-table th, .pair-table td { border: 1px solid var(--line);
  padding: 6px 8px; text-align: center; }
.pair-table th { background: var(--bg); color: var(--muted); font-weight: 600; }
.pair-table tr:first-child th { background: var(--card); color: var(--ink); }
.pair-table tr:first-child th:first-child { background: var(--card); }
.pair-table td:first-child { text-align: left; }
.pair-cross { margin: 6px 0; color: var(--muted); }
.pair-energy { font-weight: 700; color: var(--violet); margin: 4px 0 0; }

.pair-rhombus-wrap { margin: 16px 0 20px; }
.pair-rhombus-title { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.pair-rhombus { display: block; width: 100%; max-width: 420px;
  height: auto; margin: 0 auto; }
.pair-rhombus-caption { margin: 8px 0 2px; color: var(--muted);
  text-align: center; font-size: 0.95rem; }
.pair-rhombus-energy { margin: 2px 0 0; text-align: center;
  color: var(--violet); font-weight: 700; font-size: 1.05rem; }

.soul-numbers-slot { margin: 16px 0 12px; }
.soul-numbers-wrap { margin: 0; }
.soul-numbers-title { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.soul-numbers { display: block; width: 100%; max-width: 420px;
  height: auto; margin: 0 auto; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; }

.job-numbers-slot { margin: 16px 0 12px; }
.job-numbers-wrap { margin: 0; }
.job-numbers-title { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.job-numbers-image { display: block; width: 100%; max-width: 100%;
  height: auto; margin: 0; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); }

.pair-reading-slot { margin-top: 20px; }
.pair-reading { margin: 0; padding: 16px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; }
.pair-reading-title { margin: 0; font-size: 1.1rem; color: var(--ink); }
.pair-reading-subtitle { margin: 2px 0 14px; color: var(--muted);
  font-weight: 600; }
.pair-reading-section { margin: 18px 0 6px; font-size: 1.02rem;
  color: var(--blue); }
.pair-reading-subsection { margin: 12px 0 4px; font-size: 0.98rem;
  color: var(--violet); font-weight: 600; }
.pair-reading-body { margin: 6px 0; color: var(--ink);
  line-height: 1.5; }
.input-row input:focus, .input-row select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.placeholder { color: var(--muted); font-style: italic; }
.error-row { color: #B5341E; margin: 0 0 12px; }

.site-footer { padding: 16px; text-align: center; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 480px) {
  .site-header h1 { font-size: 1.15rem; }
  .date-form label { flex: 1 0 100%; }
  .date-form button { flex: 1 1 auto; }
  .card h2 { font-size: 1.05rem; }
}

/* На мобильном раскладываем разделы столбиком — чтобы не приходилось
   листать пальцем горизонтально. На широких экранах остаётся прежний
   горизонтальный ряд со скроллом. */
@media (max-width: 640px) {
  .sections-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: visible;
    gap: 6px;
    padding: 10px 12px;
  }
  .section-tab {
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    white-space: normal;
  }
}
