/* ==========================================================================
   Бацзы — тёмная «тушь и киноварь» тема
   ========================================================================== */

:root {
  --bg: #0d0b09;
  --bg-soft: #14110d;
  --panel: rgba(255, 246, 230, 0.035);
  --panel-strong: rgba(255, 246, 230, 0.06);
  --line: rgba(214, 178, 106, 0.18);
  --line-strong: rgba(214, 178, 106, 0.4);
  --gold: #d9b46a;
  --gold-soft: #a8874a;
  --text: #f1e9dc;
  --muted: #a99e8d;
  --dim: #786e60;
  --seal: #c2543c;
  --seal-soft: #8e3a2a;
  --jade: #78b391;
  --radius: 20px;
  --radius-sm: 12px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-cjk: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC",
    "SimSun", "MingLiU", serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(217, 180, 106, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 180, 106, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  z-index: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 36px) 72px;
  padding:
    env(safe-area-inset-top)
    max(clamp(16px, 4vw, 36px), env(safe-area-inset-right))
    calc(72px + env(safe-area-inset-bottom))
    max(clamp(16px, 4vw, 36px), env(safe-area-inset-left));
}

/* --------------------------------------------------------------------------
   Фон
   -------------------------------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.ambient__glow--gold {
  width: 52vw;
  height: 52vw;
  top: -26vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(154, 112, 44, 0.42), transparent 68%);
}

.ambient__glow--red {
  width: 46vw;
  height: 46vw;
  bottom: -24vw;
  left: -16vw;
  background: radial-gradient(circle, rgba(124, 45, 32, 0.36), transparent 70%);
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 240, 210, 0.45) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  mix-blend-mode: overlay;
}

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(145deg, #b94a33, #7e2d20);
  color: #f7e8cf;
  font-family: var(--font-cjk);
  font-size: 27px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 24px rgba(120, 40, 28, 0.45);
  transform: rotate(-3deg);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__text strong {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.brand__text span {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Общие элементы
   -------------------------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow__line {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.card {
  position: relative;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(217, 180, 106, 0.055), transparent 55%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.038), rgba(255, 250, 240, 0.012));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(22px, 3vw, 30px);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 246, 230, 0.02);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ghost-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 246, 230, 0.05);
}

.ghost-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost-button--link {
  border-color: transparent;
  background: transparent;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 246, 230, 0.02);
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--gold);
  background: rgba(255, 246, 230, 0.05);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid rgba(255, 226, 168, 0.4);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 244, 220, 0.14), transparent 45%),
    linear-gradient(135deg, #b98f46, #8d652c);
  color: #17110a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow:
    0 12px 30px rgba(160, 112, 42, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.primary-button:hover {
  filter: brightness(1.06);
  box-shadow:
    0 16px 38px rgba(160, 112, 42, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Форма
   -------------------------------------------------------------------------- */

.view {
  animation: rise 0.5s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  max-width: 760px;
  margin: clamp(30px, 6vw, 64px) auto clamp(26px, 4vw, 40px);
  text-align: center;
}

.hero .eyebrow {
  justify-content: center;
}

.hero h1 {
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero h1 em {
  color: var(--gold);
  font-style: italic;
  text-shadow: 0 0 32px rgba(217, 180, 106, 0.2);
}

.hero__lede {
  max-width: 590px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 16px);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.hero__chips span {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__chips span:first-child {
  color: var(--gold);
  font-family: var(--font-cjk);
  font-size: 13px;
  letter-spacing: 0.2em;
}

.calc {
  max-width: 820px;
  margin: 0 auto;
}

.calc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.calc__head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
}

.calc__hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(120, 179, 145, 0.22);
  border-radius: 999px;
  color: var(--jade);
  font-size: 10.5px;
  white-space: nowrap;
}

.calc__hint i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 10px var(--jade);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.field > label,
.field__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field > label span {
  margin-left: 5px;
  color: var(--dim);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 7, 6, 0.5);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder {
  color: #6f6558;
}

input:focus,
select:focus {
  border-color: var(--line-strong);
  background: rgba(8, 7, 6, 0.78);
  box-shadow: 0 0 0 3px rgba(217, 180, 106, 0.09);
}

input[type="date"],
input[type="time"] {
  color-scheme: dark;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a99e8d' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.time-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-row input {
  flex: 1;
  min-width: 0;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.check em {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 11px;
  font-style: normal;
}

.check--compact {
  white-space: nowrap;
  align-items: center;
  font-size: 12px;
}

.check--compact input {
  margin-top: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8, 7, 6, 0.42);
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented input:checked + span {
  background: linear-gradient(180deg, rgba(217, 180, 106, 0.2), rgba(217, 180, 106, 0.08));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(217, 180, 106, 0.26);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

/* Выбор города */

.city-picker {
  position: relative;
}

.city-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.city-input-wrap > svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.7;
  stroke-linecap: round;
  pointer-events: none;
}

.city-input-wrap input {
  padding-left: 42px;
  padding-right: 42px;
}

.city-clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 19px;
  line-height: 1;
}

.city-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.city-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #17130f;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.city-dropdown__head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(214, 178, 106, 0.1);
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.city-list {
  max-height: 300px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.city-list::-webkit-scrollbar {
  width: 8px;
}

.city-list::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(214, 178, 106, 0.25);
}

.city-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}

.city-item:hover,
.city-item.is-active {
  background: rgba(217, 180, 106, 0.1);
}

.city-item__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.city-item__name strong {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.city-item__name span {
  flex: none;
  color: var(--dim);
  font-size: 11px;
}

.city-item__tz {
  flex: none;
  color: #6e6559;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.city-empty {
  padding: 18px 16px;
  color: var(--dim);
  font-size: 13px;
}

.selected-city {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 180, 106, 0.2);
  border-radius: 12px;
  background: rgba(217, 180, 106, 0.06);
}

.selected-city__pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: rgba(217, 180, 106, 0.12);
  color: var(--gold);
}

.selected-city__pin svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.selected-city__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.selected-city__text strong {
  font-size: 14px;
  font-weight: 600;
}

.selected-city__text span {
  margin-top: 2px;
  color: var(--dim);
  font-size: 11px;
}

.selected-city button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--gold-soft);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field__note {
  color: var(--dim);
  font-size: 11.5px;
}

.advanced {
  margin: 4px 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 7, 6, 0.24);
}

.advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 0.2s;
}

.advanced[open] summary svg {
  transform: rotate(180deg);
}

.advanced__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 16px 18px;
}

.advanced__body .field {
  margin-bottom: 0;
}

.advanced__body .check + .check {
  margin-top: 2px;
}

.calc__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.calc__actions .primary-button {
  flex: 1;
}

.form-error {
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(194, 84, 60, 0.4);
  border-radius: 10px;
  background: rgba(194, 84, 60, 0.1);
  color: #e7a797;
  font-size: 13px;
}

/* Инфо-карточки */

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 1000px;
  margin: clamp(28px, 5vw, 48px) auto 0;
}

.info-card {
  padding: 20px;
  border: 1px solid rgba(214, 178, 106, 0.12);
  border-radius: 16px;
  background: rgba(255, 246, 230, 0.022);
}

.info-card__num {
  display: block;
  margin-bottom: 18px;
  color: var(--gold-soft);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.info-card h3 {
  margin-bottom: 7px;
  font-size: 19px;
}

.info-card p {
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.55;
}

/* FAQ */

.faq {
  max-width: 820px;
  margin: clamp(36px, 6vw, 64px) auto 0;
}

.faq__list {
  border-top: 1px solid var(--line);
}

.faq__list details {
  border-bottom: 1px solid var(--line);
}

.faq__list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  cursor: pointer;
  list-style: none;
}

.faq__list summary::-webkit-details-marker {
  display: none;
}

.faq__list summary::after {
  content: "+";
  flex: none;
  color: var(--gold-soft);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 300;
  transition: transform 0.2s;
}

.faq__list details[open] summary::after {
  transform: rotate(45deg);
}

.faq__list p {
  max-width: 680px;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.faq__note {
  margin-top: 18px;
  color: #675e51;
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Результат
   -------------------------------------------------------------------------- */

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 8px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 246, 230, 0.02);
  cursor: pointer;
  user-select: none;
}

.pro-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pro-switch__track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
}

.pro-switch__track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.pro-switch input:checked + .pro-switch__track {
  background: linear-gradient(90deg, #a97c35, #d9b46a);
  box-shadow: 0 0 16px rgba(217, 180, 106, 0.28);
}

.pro-switch input:checked + .pro-switch__track i {
  transform: translateX(16px);
  background: #17110a;
}

.pro-switch input:focus-visible + .pro-switch__track {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

.pro-switch__label {
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.pro-switch input:checked ~ .pro-switch__label {
  color: var(--gold);
}

.result-hero {
  padding: clamp(24px, 4vw, 40px) 0 clamp(20px, 3vw, 30px);
}

.result-hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.result-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(13px, 1.5vw, 15px);
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: #110e0b;
}

.meta-item span {
  color: var(--dim);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meta-item strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.meta-item em {
  color: var(--dim);
  font-size: 10.5px;
  font-style: normal;
}

.meta-item--accent strong {
  color: var(--gold);
}

/* Сила карты */

.strength-card {
  --strength-color: var(--gold);
  margin-top: 14px;
}

.strength-card--strong {
  --strength-color: #9fd0b4;
  border-color: rgba(120, 179, 145, 0.26);
}

.strength-card--weak {
  --strength-color: #e0a08f;
  border-color: rgba(207, 122, 102, 0.26);
}

.strength-card--balanced {
  --strength-color: var(--gold);
  border-color: rgba(217, 180, 106, 0.24);
}

.strength-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.strength-head h2 {
  font-size: clamp(25px, 3.4vw, 34px);
}

.strength-sub {
  margin-top: 4px;
  color: var(--dim);
  font-size: 11.5px;
}

.strength-sub::first-letter {
  text-transform: uppercase;
}

.strength-score {
  flex: none;
  color: var(--strength-color);
  font-family: var(--font-serif);
  font-size: clamp(38px, 5vw, 54px);
  line-height: 0.9;
  text-align: right;
  text-shadow: 0 0 28px rgba(217, 180, 106, 0.12);
}

.strength-score small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.strength-lead {
  max-width: 820px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.strength-lead b {
  color: var(--text);
  font-weight: 600;
}

.strength-meter {
  max-width: 760px;
}

.strength-meter__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(207, 122, 102, 0.62),
    rgba(217, 180, 106, 0.52) 50%,
    rgba(120, 179, 145, 0.68)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.strength-meter__marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 19px;
  height: 19px;
  border: 4px solid #17110a;
  border-radius: 50%;
  background: #f4ecdf;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px var(--strength-color),
    0 0 18px rgba(217, 180, 106, 0.35);
  transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.strength-meter__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.strength-meter__values {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--dim);
  font-size: 11px;
}

.strength-meter__values strong {
  color: var(--text);
  font-weight: 600;
}

.strength-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.strength-factor {
  padding: 13px 14px;
  border: 1px solid rgba(214, 178, 106, 0.13);
  border-radius: 12px;
  background: rgba(255, 246, 230, 0.02);
}

.strength-factor__tag {
  display: block;
  color: var(--dim);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.strength-factor strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
}

.strength-factor strong .hanzi {
  color: var(--strength-color);
  font-family: var(--font-cjk);
  font-size: 22px;
}

.strength-factor__coef {
  margin-left: 5px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.strength-factor p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.strength-factor p em {
  color: var(--dim);
  font-style: normal;
}

.strength-useful {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(214, 178, 106, 0.12);
}

.strength-useful--balanced {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.strength-useful__label {
  color: var(--dim);
  font-size: 10.5px;
}

.strength-breakdown {
  margin-top: 14px;
  border-top: 1px solid rgba(214, 178, 106, 0.12);
}

.strength-breakdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0 4px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.strength-breakdown summary::-webkit-details-marker {
  display: none;
}

.strength-breakdown summary svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 0.2s;
}

.strength-breakdown[open] summary svg {
  transform: rotate(180deg);
}

.strength-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}

.strength-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.strength-table th {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(214, 178, 106, 0.14);
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.strength-table th:first-child {
  text-align: left;
}

.strength-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(214, 178, 106, 0.08);
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.strength-table td:first-child {
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.strength-table__cat {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.25;
}

.strength-table__cat i {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--el);
}

.strength-table__cat small {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.strength-table tr.support td:first-child {
  color: var(--jade);
}

.strength-table tr.drain td:first-child {
  color: #dda08f;
}

.strength-table tfoot td {
  border-top: 1px solid rgba(214, 178, 106, 0.2);
  border-bottom: 0;
  color: var(--text);
  font-weight: 600;
}

.strength-table tfoot tr.support td:first-child {
  color: var(--jade);
}

.strength-table tfoot tr.drain td:first-child {
  color: #dda08f;
}

.strength-table-note {
  margin-top: 7px;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.45;
}

.strength-note {
  margin-top: 10px;
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.5;
}

/* Легенда */

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-end;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--dim);
  font-size: 10px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--el, var(--dim));
}

/* Сама карта */

.chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 10px 14px;
  border: 1px solid rgba(214, 178, 106, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 248, 235, 0.035), rgba(255, 248, 235, 0.008));
  overflow: hidden;
}

.pillar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--el, var(--line-strong)), transparent);
  opacity: 0.65;
}

.pillar--day {
  border-color: rgba(217, 180, 106, 0.4);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(217, 180, 106, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(255, 248, 235, 0.05), rgba(255, 248, 235, 0.01));
  box-shadow: 0 0 40px rgba(217, 180, 106, 0.08);
}

.pillar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 10px;
}

.pillar__label {
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pillar__label b {
  margin-left: 3px;
  color: #7f705a;
  font-family: var(--font-cjk);
  font-weight: 400;
  letter-spacing: 0;
}

.pillar__god {
  color: var(--god-color, var(--muted));
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pillar__char {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 94px;
  margin-bottom: 6px;
  border-radius: 12px;
  background:
    radial-gradient(90% 90% at 50% 10%, var(--el-soft, rgba(255, 255, 255, 0.05)), transparent 78%);
}

.pillar__char .hanzi {
  color: var(--el, var(--text));
  font-family: var(--font-cjk);
  font-size: clamp(40px, 7.2vw, 58px);
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 0 24px var(--el-glow, transparent);
}

.pillar__char .caption {
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pillar__char .caption em {
  font-style: normal;
}

.pillar__char .caption-meta::before {
  content: " · ";
}

.chart-scroll-hint,
.luck-scroll-hint {
  display: none;
  margin-top: 8px;
  color: var(--dim);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.pillar__char--branch {
  margin-bottom: 10px;
}

.pillar__hidden {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 9px;
  border-top: 1px dashed rgba(214, 178, 106, 0.14);
}

.hidden-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.hidden-row .stem {
  color: var(--el, var(--text));
  font-family: var(--font-cjk);
  font-size: 13px;
}

.hidden-row .god {
  margin-left: auto;
  overflow: hidden;
  color: var(--dim);
  font-size: 8.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pillar__foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(214, 178, 106, 0.1);
  color: var(--dim);
  font-size: 9px;
  line-height: 1.35;
}

.pillar__foot strong {
  color: var(--muted);
  font-weight: 500;
}

.pillar__void {
  position: absolute;
  top: 34px;
  right: 6px;
  padding: 1px 4px;
  border: 1px solid rgba(194, 84, 60, 0.4);
  border-radius: 4px;
  color: #cf7a66;
  font-family: var(--font-cjk);
  font-size: 8px;
  line-height: 1.4;
}

.chart-note {
  margin-top: 14px;
  color: var(--dim);
  font-size: 11px;
}

.chart-note b {
  color: var(--muted);
  font-weight: 500;
}

/* Сетка результата */

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  margin-top: 14px;
}

.result-grid--current {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.daymaster-card {
  display: flex;
  flex-direction: column;
}

.daymaster__hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.daymaster__seal {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 246, 230, 0.09), transparent 60%),
    rgba(217, 180, 106, 0.06);
  color: var(--el, var(--gold));
  font-family: var(--font-cjk);
  font-size: 42px;
  line-height: 1;
  box-shadow: inset 0 0 24px rgba(217, 180, 106, 0.06);
}

.daymaster__title h3 {
  font-size: 25px;
  line-height: 1.1;
}

.daymaster__title p {
  margin-top: 4px;
  color: var(--dim);
  font-size: 11.5px;
}

.daymaster__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--el, var(--gold));
}

.daymaster__text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.daymaster__quote {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 178, 106, 0.12);
  color: var(--dim);
  font-size: 11.5px;
}

/* Баланс стихий */

.balance-card .section-head {
  margin-bottom: 14px;
}

.balance-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.balance-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
}

.balance-row__name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.balance-row__name i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--el);
}

.balance-row__bar {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.balance-row__bar span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--el-soft), var(--el));
  box-shadow: 0 0 12px var(--el-soft);
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.balance-row__value {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.balance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(214, 178, 106, 0.12);
}

.balance-note {
  margin-top: 10px;
  color: var(--dim);
  font-size: 10.5px;
}

/* Такты */

.luck-card {
  margin-top: 14px;
}

.luck-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.luck-meta .tag {
  font-size: 10px;
  padding: 4px 9px;
}

.luck-timeline {
  display: flex;
  gap: 8px;
  margin: 0 -4px;
  padding: 12px 4px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.luck-timeline::-webkit-scrollbar {
  height: 5px;
}

.luck-timeline::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: rgba(214, 178, 106, 0.25);
}

.luck-pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 96px;
  padding: 12px 8px 10px;
  border: 1px solid rgba(214, 178, 106, 0.13);
  border-radius: 13px;
  background: rgba(255, 246, 230, 0.02);
  scroll-snap-align: start;
}

.luck-pillar.is-current {
  border-color: var(--line-strong);
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(217, 180, 106, 0.16), transparent 75%),
    rgba(217, 180, 106, 0.04);
  box-shadow: 0 0 24px rgba(217, 180, 106, 0.1);
}

.luck-pillar__char {
  color: var(--gold);
  font-family: var(--font-cjk);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.luck-pillar__age {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.luck-pillar__years {
  margin-top: 1px;
  color: var(--dim);
  font-size: 8.5px;
  white-space: nowrap;
}

.luck-pillar__god {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(214, 178, 106, 0.1);
  width: 100%;
  color: var(--god-color, var(--dim));
  font-size: 8.5px;
  text-align: center;
  white-space: nowrap;
}

.luck-pillar__now {
  position: absolute;
  top: -7px;
  right: -3px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #17110a;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.luck-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px;
}

/* PRO */

.pro-panel {
  margin-top: 22px;
  scroll-margin-top: 12px;
  animation: rise 0.45s ease both;
}

.pro-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 180, 106, 0.32);
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(217, 180, 106, 0.14), transparent 60%),
    rgba(217, 180, 106, 0.04);
}

.pro-banner__tag {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #d9b46a, #9a7130);
  color: #17110a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.pro-banner h2 {
  font-size: 22px;
}

.pro-banner p {
  margin-top: 3px;
  color: var(--dim);
  font-size: 11.5px;
}

.pro-banner__date {
  margin-left: auto;
  color: var(--gold-soft);
  font-size: 10.5px;
  text-align: right;
  white-space: nowrap;
}

.current-luck-card .luck-big {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 0 16px;
}

.current-luck-card .luck-big__char {
  color: var(--gold);
  font-family: var(--font-cjk);
  font-size: clamp(38px, 7vw, 56px);
  line-height: 1;
  letter-spacing: 0.04em;
}

.current-luck-card .luck-big__info h3 {
  font-size: 21px;
}

.current-luck-card .luck-big__info p {
  margin-top: 4px;
  color: var(--dim);
  font-size: 11.5px;
}

.luck-progress {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.luck-progress span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #8f6a2e, #d9b46a);
}

.current-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.current-stat {
  padding: 10px 12px;
  background: #110e0b;
}

.current-stat span {
  display: block;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.current-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
}

/* Мини-карта текущего дня */

.current-day-card .section-head {
  margin-bottom: 12px;
}

.current-day {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.current-day__pillar {
  min-width: 0;
  padding: 8px 5px;
  border: 1px solid rgba(214, 178, 106, 0.13);
  border-radius: 10px;
  background: rgba(255, 246, 230, 0.02);
  text-align: center;
}

.current-day__label {
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.current-day__char {
  display: block;
  margin: 4px 0 3px;
  color: var(--el, var(--text));
  font-family: var(--font-cjk);
  font-size: 26px;
  line-height: 1.1;
}

.current-day__char b {
  display: block;
  font-weight: 500;
}

.current-day__god {
  overflow: hidden;
  color: var(--dim);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.current-day__note {
  margin-top: 10px;
  color: var(--dim);
  font-size: 10.5px;
}

/* Взаимодействия */

.interactions-card {
  margin-top: 14px;
}

.interactions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.interaction {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(214, 178, 106, 0.1);
  border-radius: 9px;
  background: rgba(255, 246, 230, 0.018);
  color: var(--muted);
  font-size: 11.5px;
}

.interaction__chars {
  color: var(--gold);
  font-family: var(--font-cjk);
  font-size: 15px;
  white-space: nowrap;
}

.interaction__type {
  margin-left: auto;
  color: var(--dim);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.result-footer p {
  max-width: 640px;
  color: #675e51;
  font-size: 10.5px;
}

/* Тост */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #1c1711;
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .result-grid,
  .result-grid--current {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .result-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-legend {
    display: none;
  }
}

@media (max-width: 620px) {
  input[type="text"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  select {
    font-size: 16px;
  }

  .app {
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding-top: 16px;
  }

  .brand__seal {
    width: 40px;
    height: 40px;
    font-size: 23px;
    border-radius: 11px;
  }

  .brand__text strong {
    font-size: 16px;
  }

  .brand__text span {
    font-size: 8.5px;
  }

  .ghost-button--link {
    min-height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  .hero {
    margin-top: 28px;
    margin-bottom: 22px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .hero__chips {
    gap: 6px;
  }

  .hero__chips span {
    padding: 4px 9px;
    font-size: 9px;
  }

  .card {
    border-radius: 16px;
  }

  .calc__head {
    flex-direction: column;
    gap: 10px;
  }

  .grid--2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .calc__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .calc__actions .ghost-button {
    min-height: 44px;
  }

  .primary-button {
    min-height: 50px;
  }

  .chart {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(98px, 1fr);
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .chart::-webkit-scrollbar {
    height: 4px;
  }

  .chart::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(214, 178, 106, 0.25);
  }

  .pillar {
    padding: 9px 6px 11px;
    border-radius: 12px;
    scroll-snap-align: start;
  }

  .chart-scroll-hint,
  .luck-scroll-hint {
    display: block;
  }

  .hidden-row > span:nth-child(2) {
    display: none;
  }

  .caption-meta {
    display: none;
  }

  .pillar__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 8px;
  }

  .pillar__god {
    font-size: 8.5px;
  }

  .pillar__char {
    min-height: 78px;
    margin-bottom: 4px;
  }

  .pillar__char .hanzi {
    font-size: clamp(34px, 10vw, 44px);
  }

  .pillar__char .caption {
    font-size: 7.5px;
    letter-spacing: 0;
  }

  .pillar__hidden {
    gap: 2px;
    padding-top: 7px;
  }

  .hidden-row {
    gap: 2px;
    font-size: 8.5px;
  }

  .hidden-row .stem {
    font-size: 11px;
  }

  .hidden-row .god {
    font-size: 7.5px;
  }

  .pillar__foot {
    margin-top: 7px;
    padding-top: 6px;
    font-size: 8px;
  }

  .pillar__void {
    top: 28px;
    right: 3px;
    font-size: 7px;
  }

  .result-top {
    flex-wrap: wrap;
  }

  .result-actions {
    margin-left: auto;
  }

  .result-hero h1 {
    font-size: clamp(32px, 9vw, 44px);
  }

  .result-meta {
    border-radius: 12px;
  }

  .strength-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .strength-head h2 {
    font-size: 24px;
  }

  .strength-score {
    font-size: 42px;
  }

  .strength-lead {
    font-size: 13px;
  }

  .meta-item {
    padding: 9px 11px;
  }

  .result-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .current-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pro-banner {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    column-gap: 14px;
  }

  .pro-banner__tag {
    grid-row: span 2;
  }

  .pro-banner__date {
    grid-column: 2;
    margin: 6px 0 0;
    text-align: left;
  }

  .luck-pillar {
    flex-basis: 86px;
  }
}

@media (max-width: 380px) {
  .pillar__label b {
    display: none;
  }

  .pillar__char .hanzi {
    font-size: 36px;
  }

  .pillar__char .caption {
    max-width: 56px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hidden-row .god {
    display: none;
  }
}

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

/* --------------------------------------------------------------------------
   Печать
   -------------------------------------------------------------------------- */

@media print {
  :root {
    --bg: #fff;
    --text: #1a1712;
    --muted: #4b443a;
    --dim: #6b6256;
    --line: rgba(60, 50, 35, 0.24);
    --line-strong: rgba(60, 50, 35, 0.45);
    --panel: #fff;
    --shadow: none;
  }

  body {
    background: #fff;
    color: #1a1712;
  }

  body::before,
  .ambient,
  .topbar,
  .result-top,
  .result-actions,
  .pro-switch,
  .result-footer .ghost-button,
  .chart-scroll-hint,
  .luck-scroll-hint,
  .toast {
    display: none !important;
  }

  .app {
    width: 100%;
    padding: 0;
  }

  .card,
  .pillar,
  .current-day__pillar,
  .meta-item,
  .current-stat {
    background: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .card {
    break-inside: avoid;
    border-color: rgba(60, 50, 35, 0.3);
  }

  .result-hero {
    padding-top: 0;
  }

  .result-hero h1 {
    font-size: 34px;
  }

  .chart {
    gap: 6px;
  }

  .pillar__char .hanzi,
  .pillar__god,
  .luck-pillar__char,
  .luck-big__char,
  .current-day__char,
  .current-day__char b,
  .daymaster__seal,
  .strength-score,
  .strength-factor strong .hanzi {
    color: #1a1712 !important;
    text-shadow: none !important;
  }

  .pillar__char .hanzi {
    font-size: 40px;
  }

  .chart {
    grid-auto-flow: row !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-columns: auto !important;
    overflow: visible !important;
  }

  .pillar__char .caption,
  .pillar__foot,
  .hidden-row,
  .hidden-row .stem,
  .hidden-row .god,
  .chart-note,
  .balance-note,
  .daymaster__text,
  .daymaster__quote {
    color: #4b443a !important;
  }

  .pro-panel {
    animation: none;
  }

  .luck-timeline {
    overflow: visible;
    flex-wrap: wrap;
  }

  .result-footer {
    display: none;
  }
}
