:root {
  --bg: #f7fbff;
  --bg-soft: #e8f4ff;
  --panel: #ffffff;
  --line: #cde1f5;
  --line-strong: #9ec8f0;
  --text: #12314e;
  --muted: #5d7c9a;
  --accent: #2f80ed;
  --accent-strong: #1f6dd8;
  --accent-warm: #ff9f1c;
  --accent-warm-strong: #f38a00;
  --danger: #e25858;
  --field-bg: #f8fcff;
  --field-border: #c9e0f5;
  --field-focus: #78b6ee;
  --scroll-progress: 0;
}

/* History usability refinement: compact scan, explicit controls and touch-safe pagination. */
.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;
}

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

.history-item {
  min-width: 0;
  padding-right: 16px;
  cursor: default;
}

.history-item:hover {
  transform: none;
}

.history-toolbar {
  display: block;
  margin: 14px 0 8px;
}

.history-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 15px;
}

.history-display-settings-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-display-settings-menu button,
.history-display-settings summary,
.history-item-expand-btn {
  min-height: 44px;
}

.history-display-settings {
  position: relative;
}

.history-display-settings summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

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

.history-display-settings[open] summary {
  border-color: rgba(108, 182, 255, 0.54);
}

.history-display-settings-menu {
  position: absolute;
  z-index: 8;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 44px));
  padding: 10px;
  border: 1px solid rgba(108, 182, 255, 0.28);
  border-radius: 16px;
  background: rgba(16, 18, 32, 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.history-settings-menu {
  display: grid;
  gap: 12px;
}

.history-settings-group {
  min-width: 0;
}

.history-settings-label {
  margin: 0 0 7px;
  color: rgba(226, 233, 246, 0.68);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.history-date-range-form {
  display: grid;
  gap: 9px;
}

.history-date-fields,
.history-date-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-date-field {
  display: grid;
  flex: 1 1 132px;
  gap: 5px;
  color: rgba(226, 233, 246, 0.72);
  font-size: 0.84rem;
  font-weight: 650;
}

.history-date-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  color: var(--text);
  color-scheme: dark;
}

.history-date-range-status {
  min-height: 1.1em;
  margin: 0;
  color: rgba(226, 233, 246, 0.7);
  font-size: 0.82rem;
}

.history-pagination-bottom {
  justify-content: center;
  margin-top: 16px;
}

.history-item-top-actions {
  position: static;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.history-item-top-actions .history-delete-btn,
.history-item-top-actions .history-copy-top-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.history-item-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-right: auto;
  padding: 0 14px;
}

.history-section-toggle {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 6px;
  padding: 4px 0;
  color: #f4f7ff;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}

.history-section-toggle:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  color: #fff;
}

.history-section-chevron {
  display: inline-block;
  font-size: 1.1rem;
  transition: transform 0.18s ease;
}

.history-section-toggle[aria-expanded='false'] .history-section-chevron,
.history-item-expand-btn[aria-expanded='false'] .history-section-chevron {
  transform: rotate(-90deg);
}

.history-collapsed-summary {
  margin-top: 12px;
}

.history-collapsed-meta {
  margin: 0;
  color: rgba(226, 233, 246, 0.76);
  font-size: 0.9rem;
}

.history-empty-state {
  padding: 20px 0;
}

.history-item button:focus-visible,
.history-toolbar button:focus-visible,
.history-pagination button:focus-visible,
.history-display-settings summary:focus-visible {
  outline: 3px solid rgba(118, 196, 255, 0.95);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .history-toolbar {
    grid-template-columns: 1fr;
  }

  .history-global-controls {
    display: flex;
    align-items: stretch;
  }

  .history-global-controls .history-toggle-all-btn,
  .history-display-settings {
    flex: 1 1 calc(50% - 4px);
  }

  .history-display-settings summary {
    width: 100%;
  }

  .history-display-settings-menu {
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 44px));
  }

  .history-page-size-btn,
  .history-page-btn,
  .history-page-arrow {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 440px) {
  .history-item-top-actions {
    align-items: stretch;
  }

  .history-item-expand-btn {
    flex: 1 1 100%;
  }

  .history-page-buttons {
    gap: 4px;
  }

  .history-page-btn,
  .history-page-arrow {
    min-width: 44px;
    padding-inline: 8px;
  }
}

@media (max-width: 820px) {
  #authSection {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    animation: auth-panel-enter 0.48s cubic-bezier(0.2, 0.76, 0.24, 1) both;
  }

  #authSection::before,
  #authSection::after {
    content: '';
    position: absolute;
    inset: -22%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.46;
  }

  #authSection::before {
    background:
      conic-gradient(
        from 140deg at 50% 50%,
        rgba(255, 165, 87, 0.26),
        rgba(123, 178, 255, 0.08),
        rgba(255, 208, 123, 0.2),
        rgba(255, 165, 87, 0.26)
      );
    filter: blur(32px);
    animation: auth-hero-orbit 11s linear infinite;
  }

  #authSection::after {
    background:
      radial-gradient(circle at 22% 18%, rgba(255, 186, 122, 0.26), transparent 36%),
      radial-gradient(circle at 78% 84%, rgba(114, 168, 255, 0.18), transparent 34%),
      radial-gradient(circle at 68% 24%, rgba(255, 222, 158, 0.14), transparent 30%);
    filter: blur(24px);
    animation: auth-hero-drift 9.6s ease-in-out infinite alternate;
  }

  #authSection > * {
    position: relative;
    z-index: 1;
  }

  #authSection .auth-card,
  #authSection .auth-oauth-row {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    animation: auth-block-enter 0.52s cubic-bezier(0.2, 0.76, 0.24, 1) both;
  }

  #authSection .auth-card:nth-of-type(1) {
    animation-delay: 0.06s;
  }

  #authSection .auth-card:nth-of-type(2) {
    animation-delay: 0.14s;
  }

  #authSection .auth-oauth-row {
    animation-delay: 0.2s;
  }
}

.bg-glow {
  animation: auth-bg-float 16s ease-in-out infinite alternate;
}

.seo-panel {
  display: grid;
  gap: 18px;
}

.seo-hero {
  display: grid;
  gap: 10px;
}

.seo-lead {
  max-width: 76ch;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.seo-card,
.seo-faq-item {
  padding: 18px 20px;
  border: 1px solid rgba(158, 200, 240, 0.6);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 246, 255, 0.88)),
    radial-gradient(circle at top right, rgba(255, 176, 64, 0.12), transparent 40%);
  box-shadow: 0 18px 48px rgba(47, 128, 237, 0.08);
}

.seo-card h3,
.seo-faq-item h3 {
  margin-bottom: 10px;
}

.seo-card p,
.seo-faq-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seo-faq {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.seo-guides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.seo-guide-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(158, 200, 240, 0.7);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(47, 128, 237, 0.08);
}

.seo-guide-card h3 {
  margin: 0;
}

.seo-guide-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.seo-guide-card h3 a:hover,
.seo-guide-link:hover {
  color: var(--accent-strong);
}

.seo-guide-card p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.seo-guide-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 800;
}

@media (max-width: 980px) {
  .seo-grid,
  .seo-faq,
  .seo-guides {
    grid-template-columns: 1fr;
  }
}

@keyframes auth-panel-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auth-block-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auth-hero-orbit {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.04);
  }
}

@keyframes auth-hero-drift {
  0% {
    transform: translate(-4%, -2%) scale(1);
  }
  100% {
    transform: translate(3%, 4%) scale(1.03);
  }
}

@keyframes auth-bg-float {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, -10px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #authSection,
  #authSection::before,
  #authSection::after,
  #authSection .auth-card,
  #authSection .auth-oauth-row,
  .bg-glow {
    animation: none !important;
    transform: none !important;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 7% 8%, rgba(47, 128, 237, 0.22), transparent 34%),
    radial-gradient(circle at 90% 12%, rgba(255, 159, 28, 0.2), transparent 30%),
    linear-gradient(180deg, var(--bg), #f2f9ff 42%, #ffffff 100%);
  transition: none;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  font-family: 'Comfortaa', sans-serif;
  letter-spacing: 0.01em;
  color: #0f3659;
}

h1 {
  font-size: clamp(1.75rem, 2.4vw, 2.35rem);
}

p {
  margin: 0;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 82%, rgba(97, 183, 255, 0.12), transparent 34%),
    radial-gradient(circle at 84% 78%, rgba(255, 189, 95, 0.11), transparent 30%);
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.45s ease;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.panel {
  border: 2px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 14px 0 rgba(27, 106, 184, 0.07), 0 18px 26px rgba(46, 126, 205, 0.12);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

#authSection {
  max-width: 560px;
  margin: 0 auto 16px;
  border-color: var(--line-strong);
  box-shadow: 0 16px 0 rgba(27, 106, 184, 0.08), 0 22px 34px rgba(46, 126, 205, 0.16);
}

.auth-subtitle {
  margin-top: 2px;
}

.auth-shell {
  margin-top: 14px;
}

.auth-oauth-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.yandex-login-btn {
  min-width: 240px;
}

.card-block {
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.auth-card {
  padding: 14px;
  gap: 10px;
  border-color: var(--line-strong);
}

.auth-card h2 {
  margin-bottom: 2px;
}

.auth-switch {
  margin-top: 4px;
  font-size: 0.92rem;
}

.auth-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(229, 199, 131, 0.42);
  border-radius: 12px;
  color: #fff1dc;
  font-size: 0.9rem;
  line-height: 1.4;
  background: rgba(229, 199, 131, 0.1);
}

.auth-status.is-error {
  border-color: rgba(245, 130, 130, 0.64);
  color: #ffe2e2;
  background: rgba(163, 45, 45, 0.2);
}

.auth-legal-note {
  margin: 0 0 2px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-link-btn {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-strong);
  padding: 0;
  margin-left: 4px;
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link-btn:hover {
  transform: none;
  filter: none;
  color: var(--accent);
}

.auth-link-btn:active {
  transform: none;
  box-shadow: none;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-color: var(--line-strong);
}

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

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: var(--field-bg);
  border: 2px solid var(--field-border);
  border-radius: 14px;
  padding: 11px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: #7b9ab6;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--field-focus);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.16);
  background: #fff;
}

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

input[type='checkbox'] {
  width: auto;
  accent-color: var(--accent);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 56px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
}

.password-visibility-toggle:hover {
  color: var(--accent);
  background: rgba(47, 128, 237, 0.1);
}

.password-visibility-toggle:focus-visible {
  outline: 3px solid var(--field-focus);
  outline-offset: -2px;
}

.password-visibility-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-consent input {
  margin-top: 3px;
}

.auth-consent a {
  color: #ffd27c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 8px;
}

.account-legal-help {
  margin-top: 0;
}

.cookie-consent-open {
  overflow: hidden;
}

.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 8, 18, 0.82);
  backdrop-filter: blur(18px);
}

.cookie-consent.hidden {
  display: none;
}

.cookie-consent__card {
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 183, 77, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(25, 30, 48, 0.98), rgba(12, 15, 28, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.cookie-consent__card h2 {
  margin: 0 0 10px;
}

.cookie-consent__card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cookie-consent__card a {
  color: #ffd27c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-consent__check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0;
  color: #f5edf8;
  line-height: 1.45;
}

.cookie-consent__check input {
  margin-top: 4px;
}

button {
  border: 2px solid #2f80ed;
  border-radius: 16px;
  padding: 10px 15px;
  background: linear-gradient(180deg, #4d9fff, #2f80ed);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 8px 0 rgba(25, 95, 163, 0.18), 0 10px 18px rgba(39, 120, 200, 0.25);
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 5px 0 rgba(25, 95, 163, 0.2), 0 8px 12px rgba(39, 120, 200, 0.22);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.secondary {
  background: linear-gradient(180deg, #ffb347, #ff9f1c);
  color: #ffffff;
  border-color: #ff9f1c;
  box-shadow: 0 8px 0 rgba(201, 122, 18, 0.18), 0 10px 16px rgba(236, 156, 48, 0.28);
}

button.secondary:active {
  box-shadow: 0 5px 0 rgba(201, 122, 18, 0.2), 0 8px 12px rgba(236, 156, 48, 0.24);
}

button.danger {
  background: linear-gradient(180deg, #f57c7c, #e25858);
  border-color: #eb7474;
  color: #fff;
  box-shadow: 0 8px 0 rgba(157, 57, 57, 0.2), 0 10px 16px rgba(226, 88, 88, 0.24);
}

.row-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.question-builder {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.question-controls {
  display: flex;
  gap: 8px;
  align-items: end;
}

.detailed-controls {
  flex-wrap: wrap;
}

.question-controls label {
  flex: 1;
  font-size: 0.95rem;
}

.card-count-stepper {
  display: grid;
  grid-template-columns: 52px minmax(84px, 120px) 52px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.card-count-stepper-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%),
    rgba(15, 14, 22, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 24px rgba(0, 0, 0, 0.2);
  color: #f6f8ff;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.card-count-stepper-btn {
  min-height: 64px;
  border-radius: 20px;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
}

.card-count-stepper-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mode-switch {
  display: inline-flex;
  width: 100%;
  padding: 8px;
  gap: 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(15, 14, 22, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.mode-switch-btn {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(231, 236, 244, 0.72);
  font-weight: 800;
  font-size: 0.98rem;
  box-shadow: none;
}

.mode-switch-btn:hover:not(:disabled) {
  color: #f5f7fc;
  background: rgba(255, 255, 255, 0.04);
}

.mode-switch-btn.active {
  border-color: rgba(255, 145, 41, 0.55);
  background: linear-gradient(90deg, #ea7706 0%, #d46905 50%, #bd5c04 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 220, 169, 0.28) inset,
    0 10px 24px rgba(234, 119, 6, 0.26),
    0 0 0 1px rgba(234, 119, 6, 0.18);
}

.spread-type-picker {
  position: relative;
}

.spread-type-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(15, 14, 22, 0.92);
  color: #f5f7fc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.spread-type-trigger-arrow {
  font-size: 1rem;
  color: rgba(231, 236, 244, 0.7);
  transition: transform 0.18s ease;
}

.spread-type-picker.open .spread-type-trigger-arrow {
  transform: rotate(180deg);
}

.spread-type-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 105, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(17, 16, 24, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 44px rgba(0, 0, 0, 0.32);
}

.spread-type-option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(231, 236, 244, 0.84);
  font-weight: 700;
  box-shadow: none;
}

.spread-type-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7fc;
}

.spread-type-option.active {
  border-color: rgba(255, 145, 41, 0.4);
  background: linear-gradient(90deg, rgba(234, 119, 6, 0.16) 0%, rgba(212, 105, 5, 0.1) 100%);
  color: #fff6e8;
}

.info-icon-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 800;
  align-self: end;
}

.question-controls label.context-toggle {
  flex: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 2px solid var(--field-border);
  border-radius: 14px;
  background: #f6fbff;
}

.questions,
.history {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.detailed-plan-actions {
  margin-top: 18px;
  margin-bottom: 28px;
}

.detailed-history-title {
  margin-top: 34px;
  margin-bottom: 18px;
}

.detailed-history-list {
  margin-top: 0;
}

.question-item,
.history-item {
  border: 2px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fcff);
  border-radius: 16px;
  padding: 11px;
}

.history-item {
  position: relative;
  padding-right: 96px;
}

.history-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #f4b1b1;
  background: #fff;
  color: #d34f4f;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.history-delete-btn:hover {
  background: #fff4f4;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.question-meta select {
  width: auto;
  min-width: 102px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.card-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid #bfdcf4;
  font-size: 0.86rem;
  background: #eef8ff;
}

.card-chip.reversed {
  border-color: #ffc66f;
  background: #fff5e4;
}

.selected-card-tile {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 16%),
    rgba(18, 18, 18, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.selected-card-tile img {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: contain;
  padding: 12px;
  background:
    radial-gradient(circle at top, rgba(255, 211, 105, 0.08), transparent 34%),
    linear-gradient(180deg, #181520, #0f0d16);
  transition: transform 0.25s ease;
}

.selected-card-tile.reversed img {
  transform: rotate(180deg);
}

.selected-card-tile-caption {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.selected-card-tile-caption strong {
  color: #f5f7fc;
  font-size: 0.9rem;
  line-height: 1.2;
}

.selected-card-tile-caption span {
  color: rgba(231, 236, 244, 0.72);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-rotate-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.detailed-position-card {
  width: min(100%, 240px);
}

.detailed-position-item {
  padding: 18px;
}

.detailed-position-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
  align-items: start;
}

.detailed-position-copy {
  min-width: 0;
}

.detailed-position-copy p:first-child {
  margin-top: 0;
}

.detailed-position-side {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.detailed-position-side .actions {
  margin-top: 0;
}

.detailed-position-empty {
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(18, 18, 18, 0.82);
  text-align: center;
}

.detailed-layout-board {
  display: grid;
  gap: 14px;
}

.detailed-layout-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detailed-layout-board-head p {
  margin: 0;
}

.detailed-board-batch-pick-btn {
  flex: 0 0 auto;
  align-self: center;
}

.detailed-layout-board-canvas {
  --board-width: 920;
  --board-height: 460;
  position: relative;
  width: 100%;
  min-height: 360px;
  aspect-ratio: calc(var(--board-width) / var(--board-height));
  border-radius: 22px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 211, 105, 0.12), transparent 28%),
    radial-gradient(circle at 78% 92%, rgba(89, 174, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 14%),
    rgba(16, 15, 24, 0.9);
}

.detailed-board-slot {
  position: absolute;
  left: var(--slot-x);
  top: var(--slot-y);
  width: var(--slot-width, 15%);
  z-index: var(--slot-z, 1);
  transform: translate(0, 0) rotate(var(--slot-rotate)) scale(var(--slot-scale));
  transform-origin: top left;
  display: grid;
  gap: 6px;
}

.detailed-board-slot[data-pick-detailed-position] {
  cursor: pointer;
}

.detailed-board-slot-compact {
  gap: 0;
}

.detailed-board-card-frame {
  position: relative;
  aspect-ratio: 156 / 214;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 18%),
    rgba(14, 13, 20, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 22px rgba(0, 0, 0, 0.26);
}

.detailed-board-card-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  background:
    radial-gradient(circle at top, rgba(255, 211, 105, 0.08), transparent 34%),
    linear-gradient(180deg, #181520, #0f0d16);
}

.detailed-board-slot.reversed .detailed-board-card-frame img {
  transform: rotate(180deg);
}

.detailed-board-slot.empty .detailed-board-card-frame {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.22);
}

.detailed-board-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(231, 236, 244, 0.72);
  font-size: 2rem;
  font-weight: 800;
}

.detailed-board-slot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #f5f7fc;
  background: rgba(8, 8, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.detailed-board-slot-meta {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  padding: 8px 9px;
  background: rgba(10, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detailed-board-slot-meta strong {
  font-size: 0.8rem;
  color: #f5f7fc;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detailed-board-slot-meta span {
  font-size: 0.72rem;
  color: rgba(231, 236, 244, 0.74);
  line-height: 1.2;
}

.detailed-board-slot-actions {
  display: flex;
  gap: 6px;
}

.detailed-board-slot-actions button {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 0.73rem;
}

.detailed-board-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detailed-board-legend-item {
  display: grid;
  gap: 6px;
  align-content: start;
}

.detailed-layout-board .card-rotate-btn {
  right: 8px;
  bottom: 8px;
}

.detailed-history-board {
  margin-top: 8px;
}

.detailed-history-board .detailed-layout-board-canvas {
  min-height: 320px;
}

.detailed-layout-board[data-layout-type="celtic_cross"] .detailed-layout-board-canvas {
  min-height: 0;
}

.detailed-layout-board[data-layout-type="relations_360"] .detailed-layout-board-canvas {
  min-height: 0;
}

.detailed-layout-board[data-layout-type="celtic_cross"] .detailed-board-card-frame {
  border-radius: 14px;
}

.detailed-layout-board[data-layout-type="relations_360"] .detailed-board-card-frame {
  border-radius: 14px;
}

.detailed-layout-board[data-layout-type="celtic_cross"] .detailed-board-card-frame img {
  padding: 6px;
}

.detailed-layout-board[data-layout-type="relations_360"] .detailed-board-card-frame img {
  padding: 6px;
}

.detailed-board-slot-readonly .detailed-board-slot-meta {
  pointer-events: none;
}

.detailed-layout-board-mobile-grid .detailed-auto-grid-canvas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

.detailed-layout-board-mobile-grid .detailed-auto-grid-item {
  display: grid;
  gap: 8px;
  align-content: start;
}

.detailed-layout-board-mobile-grid .detailed-auto-grid-item[data-pick-detailed-position] {
  cursor: pointer;
}

.detailed-layout-board-mobile-grid .detailed-board-card-frame {
  border-radius: 18px;
}

.detailed-layout-board-mobile-grid .detailed-board-card-frame img {
  padding: 8px;
}

.detailed-history-cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.detailed-history-thumbs {
  margin-top: 10px;
}

.detailed-selected-thumbs {
  margin-top: 2px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.detailed-selected-thumb .history-card-caption {
  gap: 6px;
}

.detailed-selected-focus {
  color: rgba(231, 236, 244, 0.62);
}

.detailed-selected-thumb-actions {
  display: flex;
  gap: 8px;
  padding: 0 10px 10px;
}

.detailed-selected-thumb-actions .card-rotate-btn {
  position: static;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  flex: 0 0 auto;
}

.detailed-selected-thumb-actions button:not(.card-rotate-btn) {
  min-height: 34px;
  padding: 0 10px;
  flex: 1 1 auto;
}

.history-card-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(14, 13, 20, 0.84);
}

.history-card-item strong {
  color: #f5f7fc;
  font-size: 0.92rem;
}

.history-card-item span {
  color: rgba(231, 236, 244, 0.76);
  font-size: 0.84rem;
  line-height: 1.4;
}

@media (max-width: 820px) {
  .confirm-modal-card {
    padding: 18px 16px 16px;
  }

  .confirm-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .spread-info-modal-card {
    padding: 18px 16px 16px;
  }

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

  .detailed-layout-board-head {
    align-items: stretch;
  }

  .detailed-history-board .detailed-layout-board-canvas {
    min-height: 640px;
  }

  .detailed-history-board[data-layout-type='path_solution'] .detailed-layout-board-canvas {
    min-height: 460px;
  }

  .detailed-history-board[data-layout-type='relations_360'] .detailed-layout-board-canvas {
    min-height: 500px;
  }

  .detailed-board-batch-pick-btn {
    width: 100%;
  }

  .detailed-position-layout {
    grid-template-columns: 1fr;
  }

  .detailed-position-card {
    width: min(100%, 280px);
  }

  .detailed-position-side {
    justify-items: start;
  }

  .detailed-layout-board-canvas {
    min-height: 520px;
    aspect-ratio: auto;
  }

  .detailed-board-legend {
    grid-template-columns: 1fr;
  }

  .detailed-board-slot-badge {
    min-width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .detailed-board-slot-meta strong {
    font-size: 0.74rem;
  }

  .detailed-board-slot-meta span {
    font-size: 0.68rem;
  }

  .detailed-history-board .detailed-board-slot-meta {
    display: none;
  }

  .detailed-history-board[data-layout-type='auto_grid'] .detailed-board-slot-meta {
    display: grid;
  }

  .detailed-layout-board-mobile-grid .detailed-auto-grid-canvas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .detailed-layout-board-mobile-grid .detailed-board-slot-meta {
    display: grid;
    padding: 8px 8px;
    min-height: 64px;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tab-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #f1f8ff;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: 2px solid transparent;
  box-shadow: none;
  border-radius: 999px;
}

.tab-btn.active {
  background: linear-gradient(180deg, #4d9fff, #2f80ed);
  color: #fff;
  border-color: #5fa8f5;
}

.interpretation {
  margin-top: 12px;
  background: #fbfeff;
  border: 2px solid var(--line);
  border-radius: 16px;
  min-height: 80px;
  padding: 14px 16px;
  font-size: 1rem;
  line-height: 1.66;
  color: #1e3f5d;
}

.interpretation h2,
.interpretation h3,
.interpretation h4 {
  margin: 0.3em 0 0.45em;
  font-family: 'Comfortaa', sans-serif;
  color: #0f4b79;
}

.interpretation strong {
  color: #143f63;
  font-weight: 800;
  box-shadow: none;
  text-decoration-line: underline;
  text-decoration-color: rgba(255, 190, 93, 0.72);
  text-decoration-thickness: 0.18em;
  text-underline-offset: 0.16em;
  text-decoration-skip-ink: none;
}

.interpretation p {
  margin: 0.45em 0;
}

.interpretation ul,
.interpretation ol {
  margin: 0.35em 0 0.65em 1.2em;
}

.interpretation-plain {
  white-space: pre-wrap;
}

.suggested-questions {
  margin-top: 12px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #f2f9ff;
}

.suggested-questions h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.suggested-questions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggested-question-btn {
  text-align: left;
}

#detailedMainQuestion {
  min-height: 90px;
}

#detailedPlanMeta {
  margin-top: 10px;
}

.spread-symbol-preview {
  width: min(100%, 720px);
  margin: 16px auto 20px;
  padding: 18px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 105, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(108, 182, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(17, 16, 24, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.spread-symbol-title {
  margin-bottom: 14px;
  color: rgba(231, 236, 244, 0.8);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spread-symbol-art {
  position: relative;
  width: min(100%, 520px);
  height: 250px;
  margin: 0 auto;
}

.layout-celtic-cross .spread-symbol-art {
  width: min(100%, 780px);
  height: 390px;
}

.spread-symbol-art::before {
  content: '';
  position: absolute;
  inset: 8% 12%;
  border-radius: 28px;
  background:
    radial-gradient(circle at center, rgba(201, 157, 255, 0.08), transparent 42%),
    radial-gradient(circle at center, rgba(255, 211, 105, 0.08), transparent 58%);
  pointer-events: none;
}

.spread-symbol-art.connector-cross::after,
.spread-symbol-art.connector-path::after,
.spread-symbol-art.connector-orbit::after,
.spread-symbol-art.connector-knot::after,
.spread-symbol-art.connector-fan::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
}

.spread-symbol-art.connector-cross::after {
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(255, 211, 105, 0.28) 49.7%, rgba(255, 211, 105, 0.28) 50.3%, transparent 50.3%),
    linear-gradient(180deg, transparent 49.7%, rgba(108, 182, 255, 0.24) 49.7%, rgba(108, 182, 255, 0.24) 50.3%, transparent 50.3%);
}

.layout-celtic-cross .spread-symbol-art.connector-cross::after {
  background:
    linear-gradient(
      90deg,
      transparent 43.8%,
      rgba(255, 211, 105, 0.24) 43.8%,
      rgba(255, 211, 105, 0.24) 44.2%,
      transparent 44.2%
    ),
    linear-gradient(
      180deg,
      transparent 48.8%,
      rgba(108, 182, 255, 0.2) 48.8%,
      rgba(108, 182, 255, 0.2) 49.2%,
      transparent 49.2%
    );
}

.spread-symbol-art.connector-path::after {
  background: linear-gradient(180deg, transparent 50%, rgba(255, 211, 105, 0.26) 50%, rgba(255, 211, 105, 0.26) calc(50% + 2px), transparent calc(50% + 2px));
}

.spread-symbol-art.connector-orbit::after {
  inset: 30px 110px;
  border: 1px solid rgba(201, 157, 255, 0.24);
  border-radius: 999px;
}

.spread-symbol-art.connector-knot::after {
  background:
    radial-gradient(circle at 40% 50%, transparent 44px, rgba(201, 157, 255, 0.24) 45px, rgba(201, 157, 255, 0.24) 46px, transparent 47px),
    radial-gradient(circle at 60% 50%, transparent 44px, rgba(255, 211, 105, 0.2) 45px, rgba(255, 211, 105, 0.2) 46px, transparent 47px);
}

.spread-symbol-art.connector-fan::after {
  background:
    linear-gradient(120deg, transparent 43%, rgba(201, 157, 255, 0.18) 43.2%, transparent 43.4%),
    linear-gradient(100deg, transparent 48%, rgba(255, 211, 105, 0.18) 48.2%, transparent 48.4%),
    linear-gradient(80deg, transparent 52%, rgba(108, 182, 255, 0.18) 52.2%, transparent 52.4%);
}

.preview-card-slot {
  position: absolute;
  width: 74px;
  height: 118px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(18, 18, 18, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 26px rgba(0, 0, 0, 0.22);
}

.preview-card-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  background:
    radial-gradient(circle at top, rgba(255, 211, 105, 0.08), transparent 32%),
    linear-gradient(180deg, #181520, #100e18);
}

.preview-card-slot.reversed img {
  transform: rotate(180deg);
}

.preview-card-slot.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
}

.preview-card-placeholder {
  color: rgba(231, 236, 244, 0.76);
  font-size: 1.2rem;
  font-weight: 800;
}

.preview-slot-index {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(12, 12, 18, 0.8);
  color: #fff6e8;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
}

.layout-celtic-cross .slot-1 { left: calc(44% - 37px); top: 136px; z-index: 2; }
.layout-celtic-cross .slot-2 { left: calc(44% - 37px); top: 136px; transform: rotate(90deg); z-index: 3; }
.layout-celtic-cross .slot-3 { left: calc(44% - 37px); top: 244px; z-index: 1; }
.layout-celtic-cross .slot-4 { left: calc(44% - 154px); top: 136px; z-index: 1; }
.layout-celtic-cross .slot-5 { left: calc(44% - 37px); top: 28px; z-index: 1; }
.layout-celtic-cross .slot-6 { left: calc(44% + 80px); top: 136px; z-index: 1; }
.layout-celtic-cross .slot-7 { left: calc(44% + 288px); top: 254px; z-index: 1; }
.layout-celtic-cross .slot-8 { left: calc(44% + 288px); top: 178px; z-index: 1; }
.layout-celtic-cross .slot-9 { left: calc(44% + 288px); top: 102px; z-index: 1; }
.layout-celtic-cross .slot-10 { left: calc(44% + 288px); top: 26px; z-index: 1; }

.layout-path-solution .slot-1 { left: 18px; top: 72px; }
.layout-path-solution .slot-2 { left: 110px; top: 120px; }
.layout-path-solution .slot-3 { left: 202px; top: 56px; }
.layout-path-solution .slot-4 { left: 294px; top: 118px; }
.layout-path-solution .slot-5 { left: 386px; top: 70px; }

.layout-relations-360 .slot-1 { left: calc(50% - 37px); top: 6px; }
.layout-relations-360 .slot-2 { left: calc(50% + 96px); top: 44px; }
.layout-relations-360 .slot-3 { left: calc(50% + 96px); top: 146px; }
.layout-relations-360 .slot-4 { left: calc(50% - 37px); top: 126px; }
.layout-relations-360 .slot-5 { left: calc(50% - 170px); top: 146px; }
.layout-relations-360 .slot-6 { left: calc(50% - 170px); top: 44px; }
.layout-relations-360 .slot-7 { left: calc(50% - 37px); top: 66px; width: 86px; height: 130px; }

.layout-year-cycle .slot-1 { left: calc(50% - 37px); top: 0; }
.layout-year-cycle .slot-2 { left: calc(50% + 72px); top: 24px; }
.layout-year-cycle .slot-3 { left: calc(50% + 126px); top: 86px; }
.layout-year-cycle .slot-4 { left: calc(50% + 72px); top: 142px; }
.layout-year-cycle .slot-5 { left: calc(50% - 37px); top: 132px; }
.layout-year-cycle .slot-6 { left: calc(50% - 146px); top: 142px; }
.layout-year-cycle .slot-7 { left: calc(50% - 200px); top: 86px; }
.layout-year-cycle .slot-8 { left: calc(50% - 146px); top: 24px; }

.layout-karmic-knot .slot-1 { left: calc(50% - 126px); top: 70px; }
.layout-karmic-knot .slot-2 { left: calc(50% + 52px); top: 70px; }
.layout-karmic-knot .slot-3 { left: calc(50% - 37px); top: 18px; }
.layout-karmic-knot .slot-4 { left: calc(50% - 37px); top: 132px; }

.layout-shadow-dynamics .slot-1 { left: calc(50% - 150px); top: 66px; transform: rotate(-16deg); }
.layout-shadow-dynamics .slot-2 { left: calc(50% - 54px); top: 44px; transform: rotate(-6deg); }
.layout-shadow-dynamics .slot-3 { left: calc(50% + 42px); top: 52px; transform: rotate(8deg); }
.layout-shadow-dynamics .slot-4 { left: calc(50% + 138px); top: 76px; transform: rotate(16deg); }

.layout-generic {
  width: min(100%, 860px);
}

.layout-generic .spread-symbol-art {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 14px;
  width: 100%;
  height: auto;
  min-height: 118px;
}

.layout-generic .preview-card-slot {
  position: relative;
  left: auto;
  top: auto;
}

@media (max-width: 720px) {
  .spread-symbol-preview {
    width: 100%;
    padding: 16px;
  }

  .spread-symbol-art {
    width: min(100%, 320px);
    height: 220px;
    transform: scale(0.74);
    transform-origin: center top;
  }

  .layout-generic .spread-symbol-art {
    transform: none;
    width: 100%;
    height: auto;
  }
}

#detailedFollowupsList textarea {
  margin-top: 8px;
  min-height: 76px;
}

#detailedInterpretationBox {
  margin-top: 10px;
}

.detailed-interpret-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(14, 13, 20, 0.84);
}

.detailed-interpret-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #ff9a2f;
  border-right-color: rgba(255, 191, 92, 0.92);
  flex: 0 0 auto;
  animation: detailed-interpret-spin 0.9s linear infinite;
}

.detailed-interpret-loading-copy {
  display: grid;
  gap: 2px;
}

.detailed-interpret-loading-copy strong {
  color: #f5f7fc;
  font-size: 0.96rem;
  line-height: 1.25;
}

.detailed-interpret-loading-copy span {
  color: rgba(231, 236, 244, 0.74);
  font-size: 0.84rem;
  line-height: 1.35;
}

@keyframes detailed-interpret-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.detailed-interpret-duplicate-actions {
  margin-top: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 59, 97, 0.34);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 10;
}

.modal-content {
  width: min(1100px, 100%);
  max-height: 88vh;
  overflow: auto;
}

.confirm-modal-card {
  width: min(560px, 100%);
  padding: 22px 22px 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 105, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(108, 182, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(17, 16, 24, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 28px 64px rgba(0, 0, 0, 0.44);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.confirm-modal-head {
  align-items: flex-start;
}

.confirm-modal-kicker {
  margin: 0 0 6px;
  color: rgba(231, 236, 244, 0.62);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.confirm-modal-body {
  padding: 10px 0 6px;
}

.confirm-modal-body p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #f5f7fc;
}

.confirm-modal-actions {
  justify-content: flex-end;
  gap: 10px;
}

.spread-info-modal-card {
  width: min(900px, 100%);
  padding: 24px 24px 18px;
  border-radius: 28px;
}

.spread-info-modal-body {
  display: grid;
  gap: 18px;
}

.spread-info-intro {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%),
    rgba(14, 13, 20, 0.72);
}

.spread-info-intro p {
  margin: 0;
  color: #e7ecf4;
  line-height: 1.55;
}

.spread-info-current strong {
  color: #ffd369;
}

.spread-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.spread-info-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 105, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(16, 15, 24, 0.88);
}

.spread-info-item-active {
  border-color: rgba(255, 211, 105, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 211, 105, 0.12), 0 18px 30px rgba(0, 0, 0, 0.22);
}

.spread-info-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spread-info-item-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.spread-info-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff1d6;
  background: rgba(255, 211, 105, 0.14);
  border: 1px solid rgba(255, 211, 105, 0.2);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.spread-info-item p {
  margin: 0;
  line-height: 1.55;
  color: #dfe8f7;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  border: 2px solid #b5d5f1;
  background: linear-gradient(180deg, #ffffff, #f2f9ff);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(42, 114, 183, 0.2);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  transform: translateY(8px);
  opacity: 0;
  animation: toast-in 0.2s ease forwards;
}

.toast-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.toast-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid #c1def3;
  background: #fff;
  color: #2f80ed;
  box-shadow: none;
  font-size: 16px;
}

.toast-close:hover {
  transform: none;
}

@keyframes toast-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.deck-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}

.deck-card-wrap {
  position: relative;
}

.deck-card {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: #f3faff;
  aspect-ratio: 0.68 / 1;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-card.back {
  overflow: hidden;
}

.deck-card.front {
  overflow: hidden;
  align-items: stretch;
}

.card-back-art {
  width: 100%;
  height: 100%;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 222, 173, 0.18);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 211, 105, 0.22), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(108, 182, 255, 0.2), transparent 32%),
    radial-gradient(circle at center, rgba(201, 157, 255, 0.08), transparent 40%),
    repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0 10px, rgba(255, 255, 255, 0) 10px 20px),
    linear-gradient(180deg, #17141f 0%, #101018 48%, #141c29 100%);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 14px 24px rgba(0, 0, 0, 0.22);
}

.card-back-art::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 224, 184, 0.14);
  background:
    radial-gradient(circle at center, rgba(255, 211, 105, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 22%);
}

.card-back-art::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -64%);
  color: rgba(255, 226, 183, 0.24);
  font-size: 0.95rem;
  text-shadow: 0 0 22px rgba(255, 211, 105, 0.12);
}

.card-face-art {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 16%),
    rgba(16, 16, 16, 0.94);
}

.card-face-art img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: contain;
  object-position: center;
  padding: 4px;
  background: #120f18;
}

.card-face-label {
  display: block;
  padding: 6px 6px 8px;
  color: #f5f7fc;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%),
    rgba(19, 17, 25, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sigil {
  font-family: 'Comfortaa', sans-serif;
  letter-spacing: 0.22em;
  font-size: 0.56rem;
  color: rgba(255, 242, 214, 0.9);
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  position: relative;
  z-index: 1;
}

.deck-card.selected {
  border-color: #ffad33;
  box-shadow: 0 0 0 3px rgba(255, 173, 51, 0.32);
}

.deck-card.locked {
  opacity: 0.42;
}

.deck-card.reversed {
  transform: rotate(180deg);
}

.deck-card.reversed:hover:not(:disabled) {
  transform: rotate(180deg) translateY(-1px);
}

.deck-card-rotate-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Dark Learn-Language Theme */
:root {
  --bg: #0d0d0d;
  --bg-soft: #131313;
  --panel: #111111;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: #cfcfcf;
  --accent: #6cb6ff;
  --accent-strong: #4ca3f6;
  --accent-warm: #ffd369;
  --accent-warm-strong: #ffc94a;
  --field-bg: #161616;
  --field-border: rgba(255, 255, 255, 0.14);
  --field-focus: #6cb6ff;
}

body {
  color: var(--text);
  background-color: #14121a;
  background:
    radial-gradient(
      1200px circle at calc(18% + (var(--scroll-progress) * 8%)) calc(-10% + (var(--scroll-progress) * 12%)),
      rgba(255, 150, 82, 0.24),
      transparent 60%
    ),
    radial-gradient(
      900px circle at calc(84% - (var(--scroll-progress) * 8%)) calc(8% + (var(--scroll-progress) * 16%)),
      rgba(255, 205, 132, 0.2),
      transparent 62%
    ),
    radial-gradient(
      780px circle at calc(20% + (var(--scroll-progress) * 18%)) calc(82% - (var(--scroll-progress) * 12%)),
      rgba(130, 175, 255, 0.16),
      transparent 60%
    ),
    radial-gradient(
      680px circle at calc(76% - (var(--scroll-progress) * 10%)) calc(78% + (var(--scroll-progress) * 6%)),
      rgba(191, 130, 255, 0.12),
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.045),
      transparent 20%,
      rgba(9, 10, 18, 0.22)
    ),
    linear-gradient(180deg, #14121a 0%, #1b1825 34%, #23192b 67%, #161b26 100%);
  transition: none;
}

.bg-glow {
  background:
    radial-gradient(
      620px circle at calc(10% + (var(--scroll-progress) * 10%)) calc(18% + (var(--scroll-progress) * 10%)),
      rgba(255, 194, 138, 0.16),
      transparent 54%
    ),
    radial-gradient(
      540px circle at calc(88% - (var(--scroll-progress) * 8%)) calc(14% + (var(--scroll-progress) * 14%)),
      rgba(138, 190, 255, 0.14),
      transparent 52%
    ),
    radial-gradient(
      500px circle at calc(76% - (var(--scroll-progress) * 8%)) calc(78% - (var(--scroll-progress) * 8%)),
      rgba(220, 156, 255, 0.1),
      transparent 50%
    );
  filter: saturate(1.12);
  transition: none;
  transform: translateZ(0);
  will-change: transform, opacity;
}

html {
  background-color: #14121a;
}

html,
body {
  overscroll-behavior-y: none;
}

h1,
h2,
h3 {
  color: #f2f7ff;
}

.muted {
  color: #d5cde8;
}

.panel,
.card-block,
.question-item,
.history-item {
  background: rgba(17, 17, 17, 0.88);
  border-color: var(--line);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

input,
textarea,
select {
  color: var(--text);
  background: var(--field-bg);
  border-color: var(--field-border);
}

input::placeholder,
textarea::placeholder {
  color: #7f9bbf;
}

input:focus,
textarea:focus,
select:focus {
  background: #13233d;
  border-color: var(--field-focus);
  box-shadow: 0 0 0 4px rgba(109, 179, 255, 0.2);
}

.question-controls label.context-toggle,
.tab-switch,
.suggested-questions,
.interpretation,
.deck-card,
.toast {
  background: #17161c;
  border-color: var(--line);
}

.tab-btn {
  color: #b3c7e2;
}

.tab-btn.active {
  color: #fff;
}

.card-chip {
  background: #1d1d26;
  border-color: rgba(108, 182, 255, 0.4);
  color: #f3f7ff;
}

.card-chip.reversed {
  background: rgba(255, 211, 105, 0.12);
  border-color: rgba(255, 211, 105, 0.65);
}

.interpretation {
  color: #dce9fb;
}

.interpretation h2,
.interpretation h3,
.interpretation h4 {
  color: #f3f8ff;
}

.interpretation strong {
  color: #ffffff;
  box-shadow: none;
  text-decoration-line: underline;
  text-decoration-color: rgba(255, 211, 105, 0.72);
  text-decoration-thickness: 0.16em;
  text-underline-offset: 0.16em;
  text-decoration-skip-ink: none;
  text-shadow: 0 0 10px rgba(255, 211, 105, 0.08);
}

.history-delete-btn {
  background: #1b1b1b;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffb2b2;
}

.history-delete-btn:hover {
  background: #2a2033;
}

.modal {
  background: rgba(3, 8, 18, 0.74);
}

.toast {
  color: #e8f2ff;
}

.toast-close {
  background: #1d1d1d;
  border-color: rgba(255, 255, 255, 0.18);
  color: #cbe4ff;
}

.deck-card {
  background: #191822;
}

button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 145, 41, 0.55);
  background: linear-gradient(90deg, #ea7706 0%, #d46905 50%, #bd5c04 100%);
  background-size: 140% 100%;
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 220, 169, 0.28) inset,
    0 10px 24px rgba(234, 119, 6, 0.32),
    0 0 0 1px rgba(234, 119, 6, 0.18);
}

button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: #f3f7ff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 10px 24px rgba(0, 0, 0, 0.28);
}

button.is-busy {
  cursor: wait;
}

.btn-busy-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-busy-clock {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 246, 232, 0.78);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  flex: 0 0 auto;
}

.btn-busy-clock::before,
.btn-busy-clock::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: bottom center;
  background: #fff6e8;
  border-radius: 999px;
}

.btn-busy-clock::before {
  width: 2px;
  height: 5px;
  margin-left: -1px;
  margin-top: -5px;
  animation: busy-clock-hand-long 1.2s linear infinite;
}

.btn-busy-clock::after {
  width: 2px;
  height: 7px;
  margin-left: -1px;
  margin-top: -7px;
  animation: busy-clock-hand-short 6s linear infinite;
}

@keyframes busy-clock-hand-long {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes busy-clock-hand-short {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

button.danger {
  border: 1px solid rgba(255, 135, 135, 0.4);
  background: linear-gradient(90deg, #d35a5a 0%, #b94949 100%);
  color: #fff4f4;
  box-shadow:
    0 1px 0 rgba(255, 196, 196, 0.2) inset,
    0 10px 22px rgba(179, 50, 50, 0.28);
}

button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.35) 45%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 0.55s ease;
}

button::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 3px;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}

button:hover:not(:disabled) {
  animation: neon-button-glow 1.6s ease-in-out infinite;
  background-position: 100% 0;
}

button:hover:not(:disabled)::before {
  transform: translateX(130%);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

.tab-btn,
.history-delete-btn,
.toast-close {
  animation: none !important;
}

.tab-btn::before,
.tab-btn::after,
.history-delete-btn::before,
.history-delete-btn::after,
.toast-close::before,
.toast-close::after {
  display: none;
}

@keyframes neon-button-glow {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255, 220, 169, 0.28) inset,
      0 10px 24px rgba(234, 119, 6, 0.32),
      0 0 0 1px rgba(234, 119, 6, 0.18);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255, 230, 186, 0.36) inset,
      0 14px 30px rgba(234, 119, 6, 0.42),
      0 0 22px rgba(234, 119, 6, 0.35);
  }
}

@media (max-width: 700px) {
  .row-form,
  .actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-bar {
    align-items: start;
    gap: 8px;
    flex-direction: column;
  }

  .question-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .card-count-stepper {
    grid-template-columns: 48px 1fr 48px;
  }
}

/* Premium override */
.container {
  max-width: 1280px;
  padding: 24px;
}

.panel,
.card-block,
.question-item,
.history-item {
  position: relative;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 191, 106, 0.08), transparent 24%),
    radial-gradient(circle at bottom left, rgba(118, 160, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.034), transparent 20%),
    linear-gradient(180deg, rgba(34, 28, 46, 0.98), rgba(22, 18, 32, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.015),
    0 24px 60px rgba(0, 0, 0, 0.46);
}

.panel::before,
.card-block::before,
.question-item::before,
.history-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), transparent 26%, transparent 74%, rgba(255, 211, 105, 0.08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.top-bar {
  padding: 22px 24px;
}

h1,
h2,
h3 {
  letter-spacing: 0.015em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.14);
}

.muted {
  color: rgba(231, 236, 244, 0.72);
}

input,
textarea,
select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(18, 18, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input:focus,
textarea:focus,
select:focus {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(19, 27, 40, 0.98);
  box-shadow:
    0 0 0 4px rgba(108, 182, 255, 0.12),
    0 14px 32px rgba(15, 45, 80, 0.18);
}

.tab-switch {
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tab-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: rgba(232, 239, 248, 0.72);
}

.tab-btn.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    linear-gradient(90deg, #ea7706 0%, #d46905 52%, #bf5b05 100%);
  box-shadow:
    0 8px 18px rgba(234, 119, 6, 0.24),
    inset 0 1px 0 rgba(255, 244, 215, 0.22);
}

button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  font-weight: 700;
}

button.secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(116, 171, 255, 0.09), rgba(255, 198, 122, 0.08)),
    rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

button.secondary:hover:not(:disabled) {
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 12px 26px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(124, 168, 255, 0.16);
}

.question-controls label.context-toggle,
.suggested-questions,
.interpretation,
.toast,
.deck-card {
  border-radius: 18px;
}

.interpretation {
  background:
    radial-gradient(circle at top right, rgba(255, 211, 105, 0.1), transparent 30%),
    radial-gradient(circle at bottom left, rgba(124, 160, 255, 0.08), transparent 24%),
    radial-gradient(circle at center top, rgba(214, 154, 255, 0.06), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(30, 24, 40, 0.94);
  padding: 20px 22px;
  line-height: 1.72;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 38px rgba(0, 0, 0, 0.28);
}

.interpretation strong {
  font-weight: 700;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

.interpretation p + p {
  margin-top: 0.75em;
}

.history-item {
  padding-top: 16px;
  padding-right: 52px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.history-item:hover {
  transform: translateY(-1px);
}

.history-item button,
.history-item textarea,
.history-item input,
.history-item select,
.history-item a,
.history-item .interpretation-markdown,
.history-item .history-note-editor {
  cursor: auto;
}

.history-collapse-section {
  transition: opacity 0.18s ease, max-height 0.22s ease, margin 0.18s ease, padding 0.18s ease;
}

.history-item.history-item-collapsed .history-collapse-section {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.history-item.history-item-collapsed {
  padding-bottom: 16px;
}

.history-collapsed-summary {
  display: none;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(12, 12, 24, 0.52);
}

.history-collapsed-date {
  margin: 0 0 8px;
}

.history-collapsed-title {
  margin: 0 0 6px;
  color: #f5f8ff;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.history-collapsed-list {
  display: grid;
  gap: 7px;
}

.history-collapsed-row {
  display: grid;
  gap: 4px;
}

.history-collapsed-q {
  color: #f4f7ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.history-collapsed-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-collapsed-card-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(245, 248, 255, 0.9);
  border: 1px solid rgba(108, 182, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(108, 182, 255, 0.2), rgba(108, 182, 255, 0.06)),
    rgba(12, 18, 30, 0.82);
}

.history-collapsed-card-chip.reversed {
  color: #fff4da;
  border-color: rgba(255, 211, 105, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 211, 105, 0.24), rgba(255, 211, 105, 0.06)),
    rgba(24, 18, 8, 0.84);
}

.history-item.history-item-collapsed > h3 {
  display: none;
}

.history-item.history-item-collapsed .history-collapsed-summary {
  display: block;
}

.history-item-detailed.history-item-detailed-collapsed .detailed-expand-section {
  display: none;
}

.history-item-detailed .history-detailed-open-hint {
  margin-top: 8px;
  color: rgba(226, 233, 246, 0.72);
  font-size: 0.86rem;
}

.history-item-detailed:not(.history-item-detailed-collapsed) .history-detailed-open-hint {
  display: none;
}

.history-questions-block {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(18, 16, 28, 0.5);
}

.history-block-head,
.history-note-top,
.history-interpretation-block {
  cursor: pointer;
}

.history-interpretation-block {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(18, 16, 28, 0.5);
}

.history-block-head {
  color: #f4f7ff;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.history-interpretation-block .history-text-controls {
  margin-top: 0;
  margin-bottom: 8px;
}

.history-interpretation-block .interpretation-markdown {
  margin-top: 0;
  min-height: 0;
  padding: 14px 16px;
  line-height: 1.62;
}

.history-interpretation-block .interpretation-markdown.hidden {
  display: none;
}

.history-inline-interpret-order {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.history-inline-interpret-order .muted {
  margin: 0;
}

.history-questions-block.block-collapsed .history-questions {
  display: none;
}

.history-note-box.block-collapsed .history-note-editor-wrap,
.history-note-box.block-collapsed .history-note-status {
  display: none;
}

.suggested-questions {
  cursor: pointer;
}

.suggested-questions.block-collapsed .suggested-questions-list {
  display: none;
}

.history-delete-btn {
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.03);
}

.history-item-top-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

.history-item-top-actions .history-delete-btn,
.history-item-top-actions .history-copy-top-btn {
  position: static;
}

.history-item-top-actions .history-copy-top-btn {
  min-width: 30px;
  width: 30px;
  min-height: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
}

.history-item-top-actions .history-copy-top-btn svg {
  width: 16px;
  height: 16px;
}

.card-chip {
  padding: 7px 12px;
  background: linear-gradient(180deg, rgba(108, 182, 255, 0.08), rgba(108, 182, 255, 0.03));
}

.card-chip.reversed {
  background: linear-gradient(180deg, rgba(255, 211, 105, 0.12), rgba(255, 211, 105, 0.04));
}

.modal {
  backdrop-filter: blur(8px);
}

.modal-content {
  border-radius: 28px;
}

.deck-card {
  min-height: 92px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(18, 18, 18, 0.96);
}

.card-back-art {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 211, 105, 0.18), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(108, 182, 255, 0.18), transparent 30%),
    radial-gradient(circle at center, rgba(201, 157, 255, 0.08), transparent 40%),
    repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0 10px, rgba(255, 255, 255, 0) 10px 20px),
    linear-gradient(180deg, #17141f, #0f1016 56%, #151d2a);
}

.sigil {
  color: rgba(255, 243, 214, 0.82);
  letter-spacing: 0.22em;
  font-size: 0.56rem;
}

.toast {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(18, 18, 18, 0.98);
}

button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-position 0.25s ease, border-color 0.18s ease, filter 0.18s ease;
}

button::before {
  display: none;
}

button::after {
  left: 14px;
  right: 14px;
  top: 4px;
  height: 34%;
  opacity: 0.55;
}

button:hover:not(:disabled) {
  animation: none;
  transform: translateY(-1px);
  background-position: 72% 0;
  box-shadow:
    0 1px 0 rgba(255, 220, 169, 0.24) inset,
    0 12px 24px rgba(234, 119, 6, 0.22),
    0 0 0 1px rgba(234, 119, 6, 0.16);
}

button.secondary:hover:not(:disabled) {
  animation: none;
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(108, 182, 255, 0.1);
}

button.open-history-btn {
  background:
    linear-gradient(180deg, rgba(255, 232, 184, 0.28), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, #ff9a1f 0%, #ff7f11 48%, #ff5b2e 100%);
  color: #fffaf2;
  border-color: rgba(255, 182, 86, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 210, 0.34),
    0 14px 26px rgba(255, 117, 24, 0.3),
    0 0 0 1px rgba(255, 161, 53, 0.18);
}

button.open-history-btn:hover:not(:disabled) {
  color: #fffdf9;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.4),
    0 18px 30px rgba(255, 117, 24, 0.36),
    0 0 0 1px rgba(255, 189, 98, 0.24);
}

/* Deck cards use border highlight for selection; remove generic button gloss circles */
.deck-card::before,
.deck-card::after {
  display: none !important;
}

.suggested-questions {
  background:
    radial-gradient(circle at top left, rgba(234, 119, 6, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(108, 182, 255, 0.15), transparent 26%),
    radial-gradient(circle at center top, rgba(223, 142, 255, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    rgba(29, 22, 35, 0.96);
  padding: 16px 18px;
}

.suggested-questions h3 {
  margin-bottom: 12px;
  color: #f4f7fc;
}

.suggested-questions-list {
  gap: 10px;
}

.suggested-question-btn {
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 18px;
  justify-content: flex-start;
  text-align: left;
  line-height: 1.3;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

.suggested-question-btn::after {
  display: none;
}

.suggested-question-btn:nth-child(4n + 1) {
  background:
    linear-gradient(180deg, rgba(255, 189, 122, 0.18), rgba(255, 189, 122, 0.04)),
    rgba(37, 26, 12, 0.96);
  border-color: rgba(234, 119, 6, 0.24);
}

.suggested-question-btn:nth-child(4n + 2) {
  background:
    linear-gradient(180deg, rgba(123, 183, 255, 0.18), rgba(123, 183, 255, 0.04)),
    rgba(14, 23, 37, 0.96);
  border-color: rgba(108, 182, 255, 0.24);
}

.suggested-question-btn:nth-child(4n + 3) {
  background:
    linear-gradient(180deg, rgba(201, 157, 255, 0.2), rgba(201, 157, 255, 0.05)),
    rgba(30, 20, 43, 0.96);
  border-color: rgba(201, 157, 255, 0.2);
}

.suggested-question-btn:nth-child(4n + 4) {
  background:
    linear-gradient(180deg, rgba(111, 222, 182, 0.18), rgba(111, 222, 182, 0.04)),
    rgba(14, 34, 29, 0.96);
  border-color: rgba(111, 222, 182, 0.18);
}

.suggested-question-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background-position: 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.dialog-context-btn {
  border: 1px solid rgba(255, 160, 74, 0.55) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)),
    linear-gradient(90deg, rgba(234, 119, 6, 0.96) 0%, rgba(212, 105, 5, 0.96) 100%) !important;
  color: #fff7ef !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 196, 0.22),
    0 10px 24px rgba(234, 119, 6, 0.24),
    0 0 0 1px rgba(234, 119, 6, 0.12) !important;
}

.dialog-context-btn:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 214, 0.28),
    0 14px 28px rgba(234, 119, 6, 0.28),
    0 0 0 1px rgba(255, 180, 102, 0.18) !important;
}

.history-questions {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.history-question-block {
  display: grid;
  gap: 10px;
}

.history-question-title {
  margin: 0;
  font-weight: 700;
  color: #f5f7fc;
}

.history-export-btn {
  position: absolute;
  top: 8px;
  right: 40px;
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border-width: 1px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: none;
}

.history-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.history-card-thumb {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 16%),
    rgba(18, 18, 18, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(0, 0, 0, 0.22);
}

.history-card-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 156 / 214;
  height: auto;
  object-fit: contain;
  background: #110f18;
}

.history-card-thumb.reversed img {
  transform: rotate(180deg);
}

.history-card-caption {
  display: grid;
  gap: 4px;
  padding: 10px;
  line-height: 1.2;
}

.history-card-caption span {
  color: #f5f8fd;
  font-size: 0.82rem;
  font-weight: 700;
}

.history-card-caption small {
  color: rgba(231, 236, 244, 0.72);
  font-size: 0.75rem;
}

.history-text-controls {
  margin-top: 14px;
  margin-bottom: 10px;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.history-global-controls {
  margin-bottom: 16px;
  justify-content: flex-end;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 8px;
  padding: 12px 14px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.38);
}

.history-page-size,
.history-page-nav,
.history-page-buttons,
.history-page-size-options {
  display: flex;
  align-items: center;
  gap: 7px;
}

.history-page-size {
  flex-wrap: wrap;
}

.history-page-size-label {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.history-page-size-btn,
.history-page-btn,
.history-page-arrow {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
}

.history-page-size-btn.active,
.history-page-btn.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 5px 16px rgba(79, 70, 229, 0.26);
}

.history-page-btn[aria-current='page'] {
  pointer-events: none;
}

.history-page-ellipsis {
  min-width: 24px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 800;
}

.history-pagination-status {
  margin-left: 4px;
  white-space: nowrap;
}

.history-questions-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-questions-head-row span {
  min-width: 0;
}

.history-toggle-btn {
  min-height: 40px;
  padding: 0 14px;
}

.history-copy-btn {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.history-copy-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.history-copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.history-copy-label {
  font-size: 0.84rem;
  color: rgba(231, 236, 244, 0.78);
  letter-spacing: 0.01em;
  user-select: none;
}

.history-copy-btn.is-copied {
  border-color: rgba(140, 255, 191, 0.6);
  box-shadow: 0 0 0 2px rgba(140, 255, 191, 0.18) inset;
}

.detailed-history-copy-top {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
  margin-bottom: 10px;
}

.history-toggle-all-btn {
  min-height: 42px;
  padding: 0 16px;
}

.history-note-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 16px 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 194, 94, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(120, 166, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(24, 20, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 32px rgba(0, 0, 0, 0.18);
}

.history-note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-note-label {
  color: #fff6e9;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.history-note-editor {
  min-height: 120px;
  resize: vertical;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 16%),
    rgba(16, 14, 22, 0.96);
}

.history-note-editing .history-note-editor {
  border-color: rgba(255, 191, 104, 0.34);
  box-shadow: 0 0 0 4px rgba(255, 172, 70, 0.08);
}

.history-note-actions {
  justify-content: flex-end;
  margin-top: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.history-note-status {
  min-height: 22px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(231, 238, 255, 0.72);
}

.history-note-status[data-tone='draft'] {
  color: #b7cffc;
}

.history-note-status[data-tone='saving'] {
  color: #ffd480;
}

.history-note-status[data-tone='saved'] {
  color: #9fe0aa;
}

.history-note-status[data-tone='error'] {
  color: #ff9c9c;
}

.admin-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-usage-subtabs {
  margin: 10px 0 12px;
}

.admin-main-subtabs {
  margin: 0;
}

.admin-usage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-usage-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(11, 12, 27, 0.48);
}

.admin-usage-card strong {
  display: block;
  font-size: 1.03rem;
  color: #fff7e7;
}

.admin-usage-card span {
  font-size: 0.83rem;
  color: rgba(223, 231, 250, 0.82);
}

.seo-admin-note {
  max-width: 920px;
  margin: -4px 0 16px;
  line-height: 1.55;
}

.seo-admin-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.seo-admin-controls input {
  flex: 1 1 260px;
  min-height: 44px;
}

.seo-admin-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-admin-filter-btn {
  min-height: 40px;
  white-space: nowrap;
}

.seo-admin-filter-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
}

.seo-admin-url {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.seo-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.seo-status-covered {
  color: #c8f6d8;
  border-color: rgba(113, 225, 155, 0.48);
  background: rgba(47, 149, 87, 0.18);
}

.seo-status-partial {
  color: #ffe1a6;
  border-color: rgba(247, 181, 73, 0.52);
  background: rgba(190, 121, 25, 0.17);
}

.seo-status-missing {
  color: #ffc7cf;
  border-color: rgba(234, 102, 121, 0.5);
  background: rgba(180, 55, 74, 0.17);
}

.seo-status-planned,
.seo-status-notChecked {
  color: #cbd8ff;
  border-color: rgba(126, 154, 236, 0.45);
  background: rgba(68, 93, 177, 0.17);
}

.admin-usage-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  margin-bottom: 16px;
}

.admin-usage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: rgba(11, 12, 25, 0.7);
}

.admin-usage-table th,
.admin-usage-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.88rem;
  vertical-align: top;
}

.admin-usage-table th {
  color: #f6ddbb;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-user-email-link {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: #dfeaff;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(255, 211, 105, 0.4);
  text-underline-offset: 3px;
}

.admin-user-email-link:hover {
  transform: none;
  filter: none;
  color: #fff3d6;
  text-decoration-color: rgba(255, 211, 105, 0.86);
}

.admin-user-email-link.active {
  color: #ffdca1;
  text-decoration-color: rgba(255, 211, 105, 0.95);
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.top-bar-profile {
  min-width: 0;
}

.top-bar-profile h2 {
  margin-bottom: 12px;
}

.top-bar-email {
  display: none;
  font-size: 1.04rem;
  color: rgba(236, 241, 255, 0.82);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-account-menu-wrap {
  position: relative;
  display: none;
  margin-left: auto;
  width: fit-content;
}

.mobile-account-menu-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

.mobile-account-menu-btn-icon {
  width: 19px;
  height: 19px;
  fill: rgba(245, 248, 252, 0.95);
}

.mobile-account-menu {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 10px);
  width: min(280px, calc(100vw - 24px));
  z-index: 40;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 191, 106, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(118, 160, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 20%),
    rgba(18, 16, 28, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 18px 42px rgba(0, 0, 0, 0.4);
}

.mobile-account-menu-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.mobile-account-menu-email {
  color: rgba(235, 241, 255, 0.8);
  font-size: 0.84rem;
  word-break: break-word;
}

.mobile-account-menu-balance {
  color: #fff3dc;
  font-size: 1.2rem;
}

.mobile-account-menu-actions {
  display: grid;
  gap: 8px;
}

.top-balance-card {
  min-width: 190px;
  border-radius: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 203, 128, 0.18), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(18, 15, 28, 0.75));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.top-balance-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241, 224, 197, 0.88);
  margin-bottom: 2px;
}

.top-balance-value {
  display: block;
  font-size: 1.38rem;
  line-height: 1.15;
  color: #fff6e6;
  text-shadow: 0 1px 10px rgba(255, 175, 78, 0.2);
}

.account-panel-head {
  margin-bottom: 12px;
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.account-stat-card {
  border-radius: 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(10, 11, 23, 0.58);
}

.account-stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.36rem;
  line-height: 1.1;
  color: #f8fbff;
}

.account-stat-label {
  color: rgba(213, 223, 247, 0.78);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-stat-balance {
  border-color: rgba(255, 195, 110, 0.3);
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 189, 95, 0.18), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 18%),
    rgba(14, 13, 24, 0.72);
}

.account-topup-row {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}

.account-topup-field {
  min-width: 220px;
}

.account-topup-field input {
  width: 100%;
}

.account-topup-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.account-policy-note {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.account-policy-note a {
  color: #ffd38f;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.billing-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 4px;
}

.billing-history-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.billing-history-head p {
  margin: 5px 0 0;
}

.billing-month-picker {
  flex: 0 0 auto;
}

.billing-month-picker summary {
  min-height: 44px;
  white-space: nowrap;
}

.billing-month-options {
  display: grid;
  width: min(260px, calc(100vw - 44px));
  max-height: min(360px, 60vh);
  overflow-y: auto;
}

.billing-month-options button {
  justify-content: flex-start;
  min-height: 44px;
  text-align: left;
}

.billing-month-options button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}

.billing-pagination {
  margin-top: 12px;
}

.billing-pagination .history-page-size-btn,
.billing-pagination .history-page-btn,
.billing-pagination .history-page-arrow {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 640px) {
  .billing-history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-month-picker,
  .billing-month-picker summary {
    width: 100%;
  }

  .billing-month-picker summary {
    justify-content: space-between;
  }

  .billing-month-options {
    right: auto;
    left: 0;
  }
}

@media (max-width: 980px) {
  .top-bar {
    grid-template-columns: 1fr;
  }

  .top-bar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .top-balance-card {
    min-width: 170px;
  }

  .account-stats-grid {
    grid-template-columns: 1fr;
  }

  .account-topup-row {
    flex-direction: column;
    align-items: stretch;
  }

  .account-topup-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.admin-usage-table td {
  color: rgba(236, 242, 255, 0.9);
}

.admin-usage-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.82rem;
}

.admin-billing-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-billing-form button {
  align-self: end;
}

#adminTbankCredentialsStatus {
  overflow-wrap: anywhere;
}

.admin-balance-input {
  min-width: 140px;
}

.tab-btn-admin {
  margin-left: auto;
}

.tab-badge {
  margin-left: 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #ff8a2d, #f06f00);
  box-shadow: 0 4px 10px rgba(240, 111, 0, 0.35);
}

.support-chat-shell {
  display: grid;
  gap: 10px;
}

.support-chat-thread {
  border: 2px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fcff);
  border-radius: 16px;
  padding: 12px;
  min-height: 220px;
  max-height: 460px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.support-chat-item {
  width: min(88%, 640px);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.support-chat-item.mine {
  justify-self: end;
  background: linear-gradient(180deg, rgba(255, 176, 83, 0.95), rgba(234, 119, 6, 0.94));
  color: #fff;
}

.support-chat-item.their {
  justify-self: start;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: #f1f5ff;
}

.support-chat-item.sender-system {
  background: linear-gradient(180deg, rgba(198, 218, 255, 0.4), rgba(180, 203, 242, 0.28));
  color: #0f3659;
}

.support-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.support-chat-head strong {
  font-size: 0.84rem;
}

.support-chat-head span {
  font-size: 0.75rem;
  opacity: 0.86;
}

.support-chat-text {
  white-space: pre-wrap;
  line-height: 1.4;
}

.support-chat-form {
  display: grid;
  gap: 10px;
}

.support-chat-form textarea {
  min-height: 96px;
}

.support-chat-form button {
  justify-self: start;
}

.deck-card {
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease, border-color 0.18s ease !important;
  transform-origin: center center;
}

.deck-card-rotate-btn::before,
.deck-card-rotate-btn::after,
.card-rotate-btn::before,
.card-rotate-btn::after {
  display: none !important;
}

.deck-card-rotate-btn:hover:not(:disabled),
.card-rotate-btn:hover:not(:disabled) {
  animation: none !important;
  transform: none !important;
}

.support-admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  min-height: 520px;
}

.support-admin-conversations-wrap,
.support-admin-thread-wrap {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(10, 14, 24, 0.6);
  padding: 10px;
}

.support-admin-conversations {
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.support-conv-item {
  text-align: left;
  width: 100%;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 4px;
}

.support-conv-item::before,
.support-conv-item::after {
  display: none;
}

.support-conv-item:hover:not(:disabled) {
  animation: none;
  transform: none;
}

.support-conv-item.active {
  border-color: rgba(255, 182, 97, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 182, 97, 0.45);
}

.support-conv-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.support-conv-top strong {
  color: #f6f8ff;
}

.support-conv-top span {
  font-size: 0.78rem;
  color: rgba(236, 242, 255, 0.75);
}

.support-conv-meta {
  font-size: 0.75rem;
  color: rgba(236, 242, 255, 0.72);
}

.support-conv-preview {
  font-size: 0.84rem;
  color: rgba(236, 242, 255, 0.92);
}

.support-conv-unread {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8b2e, #ee6c00);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

.support-admin-thread-head {
  padding: 6px 8px 10px;
}

.support-chat-thread-admin {
  min-height: 340px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%),
    rgba(12, 16, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 980px) {
  .support-admin-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .support-admin-conversations {
    max-height: 280px;
  }
}

/* User support chat as phone messenger */
.support-chat-phone {
  max-width: 430px;
  margin: 0 auto;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(14, 18, 30, 0.96);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 0;
  overflow: hidden;
}

.support-chat-phone-top {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(94, 175, 255, 0.18), rgba(130, 226, 173, 0.14));
}

.support-chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(180deg, #5ec1ff, #2f80ed);
  box-shadow: 0 4px 10px rgba(47, 128, 237, 0.35);
}

.support-chat-contact-copy {
  display: grid;
  gap: 2px;
}

.support-chat-contact-copy strong {
  color: #f5f9ff;
  font-size: 0.95rem;
}

.support-chat-contact-copy .muted {
  color: rgba(233, 242, 255, 0.78);
  font-size: 0.77rem;
}

.support-chat-thread-user {
  border: none;
  border-radius: 0;
  margin: 0;
  min-height: 340px;
  max-height: 340px;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 18%, rgba(110, 206, 255, 0.12), transparent 42%),
    radial-gradient(circle at 80% 82%, rgba(127, 226, 168, 0.1), transparent 36%),
    linear-gradient(180deg, #0f1423, #0c1120);
}

.support-chat-thread-user .support-chat-item {
  width: fit-content;
  max-width: 85%;
  border-radius: 16px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.22);
}

.support-chat-thread-user .support-chat-item.their {
  justify-self: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(40, 49, 75, 0.96);
  color: #edf3ff;
}

.support-chat-thread-user .support-chat-item.mine {
  justify-self: end;
  background:
    linear-gradient(180deg, rgba(166, 240, 182, 0.98), rgba(126, 216, 152, 0.95)),
    rgba(123, 211, 148, 0.96);
  color: #0c2f18;
  border-color: rgba(178, 248, 193, 0.66);
}

.support-chat-thread-user .support-chat-item.sender-system {
  justify-self: center;
  background: rgba(162, 190, 255, 0.2);
  color: #eaf2ff;
  border-color: rgba(170, 198, 255, 0.36);
}

.support-chat-thread-user .support-chat-head {
  margin-bottom: 4px;
}

.support-chat-thread-user .support-chat-head strong {
  font-size: 0.75rem;
  font-weight: 700;
}

.support-chat-thread-user .support-chat-head span {
  font-size: 0.68rem;
  opacity: 0.85;
}

.support-chat-thread-user .support-chat-text {
  font-size: 0.9rem;
  line-height: 1.35;
}

.support-chat-form-user {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(13, 17, 28, 0.98);
}

.support-chat-form-user textarea {
  min-height: 56px;
  max-height: 140px;
  border-radius: 20px;
  padding: 14px 16px;
  resize: none;
  font-size: 0.98rem;
}

.support-chat-form-user button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 50%;
  padding: 0;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 520px) {
  .support-chat-phone {
    max-width: 100%;
    border-radius: 22px;
  }

  .support-chat-thread-user {
    min-height: 300px;
    max-height: 48vh;
  }
}

.footer {
  margin-top: 48px;
  padding: 56px 0 26px;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: #0a1220;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 4% 18%, rgba(86, 96, 177, 0.16) 0%, transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(20, 107, 111, 0.13) 0%, transparent 38%);
  pointer-events: none;
}

.footer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1280px, calc(100% - 48px));
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.4), transparent);
  pointer-events: none;
}

.footer-container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer__content {
  display: grid;
  grid-template-columns: minmax(300px, 1.3fr) minmax(170px, 0.7fr) minmax(220px, 0.8fr);
  gap: clamp(32px, 7vw, 116px);
  margin-bottom: 40px;
}

.footer__section {
  min-width: 0;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.12rem;
  text-decoration: none;
}

.footer__description {
  max-width: 34ch;
  margin: 0 0 18px;
  color: #b9c2d2;
  line-height: 1.6;
}

.footer__actions {
  display: flex;
  width: fit-content;
}

.footer__email-link {
  min-height: 40px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e8edf7;
  text-decoration: none;
  gap: 9px;
  min-width: 0;
  padding: 4px 0;
  border-bottom: 1px solid rgba(201, 210, 229, 0.45);
  font-size: 0.95rem;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer__email-link:hover,
.footer__email-link:focus-visible {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.footer__email-arrow {
  color: #b9c2d2;
  font-size: 1.1em;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}

.footer__email-link:hover .footer__email-arrow,
.footer__email-link:focus-visible .footer__email-arrow {
  color: #ffffff;
  transform: translateX(3px);
}

.footer__title {
  margin-bottom: 14px;
  color: #f3f5fa;
  font-family: 'Nunito', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__links li {
  margin-bottom: 2px;
}

.footer__link,
.footer__legal-link,
.footer__contact-item a {
  color: #b9c2d2;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.footer__link:hover,
.footer__legal-link:hover,
.footer__contact-item a:hover {
  color: #ffffff;
}

.footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 3px 0;
}

.footer__contact {
  display: grid;
  gap: 5px;
  margin-top: 4px;
}

.footer__contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  min-height: 44px;
  padding: 0;
  color: #b9c2d2;
  font-size: 0.95rem;
  min-width: 0;
}

.footer__contact-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.footer__contact-item a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer__availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0;
  color: #96a3b8;
  font-size: 0.9rem;
}

.footer__availability::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #82c8b3;
  box-shadow: 0 0 0 4px rgba(130, 200, 179, 0.1);
}

.footer__bottom {
  padding-top: 22px;
  border-top: 1px solid rgba(150, 163, 184, 0.16);
}

.footer__bottom-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__bottom-copy {
  display: grid;
  gap: 6px;
}

.footer__copyright {
  color: #b9c2d2;
  font-size: 0.92rem;
}

.footer__built-by {
  color: #8f9bb0;
  font-size: 0.92rem;
}

.footer__legal {
  display: flex;
  justify-content: end;
  gap: 10px 22px;
  flex-wrap: wrap;
}

.footer__legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.92rem;
  text-decoration: none;
}

.footer__legal-link:hover,
.footer__legal-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer a:focus-visible {
  outline: 3px solid rgba(118, 196, 255, 0.95);
  outline-offset: 4px;
  border-radius: 6px;
}

.legal-page {
  max-width: 960px;
}

.legal-doc {
  display: grid;
  gap: 14px;
}

.legal-doc h1 {
  margin-bottom: 0;
}

.legal-doc h2 {
  margin-top: 12px;
}

.legal-doc p {
  line-height: 1.65;
}

.legal-doc a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-doc-actions {
  margin-top: 12px;
}

.legal-doc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 8px;
  color: #ffffff !important;
  background: linear-gradient(90deg, #ea7706 0%, #d46905 50%, #bd5c04 100%);
  text-decoration: none !important;
  box-shadow:
    0 1px 0 rgba(255, 220, 169, 0.28) inset,
    0 10px 24px rgba(234, 119, 6, 0.32);
}

@media (max-width: 768px) {
  .footer {
    margin-top: 28px;
    padding: 40px 0 24px;
  }

  .footer-container {
    width: min(100% - 28px, 1280px);
  }

  .footer__content {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 28px;
  }

  .footer__description {
    max-width: 40ch;
  }

  .footer__bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal {
    justify-content: center;
  }

  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .history-page-size,
  .history-page-nav {
    justify-content: space-between;
  }

  .history-page-buttons {
    justify-content: center;
    flex: 1 1 auto;
  }
}

@media (max-width: 440px) {
  .footer__legal {
    justify-content: center;
  }

  .history-page-size {
    justify-content: flex-start;
  }

  .history-pagination-status {
    width: 100%;
    margin-left: 0;
  }

  .history-page-btn,
  .history-page-arrow {
    min-width: 36px;
    padding-inline: 8px;
  }
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  z-index: 80;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  border: 1px solid rgba(255, 193, 119, 0.38);
  color: #fff6e8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(255, 179, 71, 0.95), rgba(234, 119, 6, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 241, 214, 0.26),
    0 14px 34px rgba(234, 119, 6, 0.28),
    0 0 0 1px rgba(255, 173, 84, 0.14);
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.18s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 227, 0.3),
    0 16px 36px rgba(234, 119, 6, 0.32),
    0 0 0 1px rgba(255, 196, 122, 0.18);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(118, 196, 255, 0.95);
  outline-offset: 4px;
}

@media (max-width: 720px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    font-size: 1.35rem;
  }
}

@media (max-width: 820px) {
  .container {
    padding: 14px;
  }

  .panel,
  .card-block,
  .question-item,
  .history-item {
    border-radius: 20px;
    padding: 14px;
  }

  .top-bar {
    padding: 14px 16px;
    gap: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .top-bar-profile {
    display: none;
  }

  .top-bar-email {
    display: none;
  }

  .top-bar-actions {
    display: flex;
    width: auto !important;
    align-items: flex-start;
    justify-content: flex-end !important;
    margin-left: auto;
  }

  .top-bar-actions > .top-balance-card,
  .top-bar-actions > #logoutBtn {
    display: none;
  }

  .mobile-account-menu-wrap {
    display: block;
    margin-left: auto;
    align-self: flex-start;
  }

  .top-balance-card {
    min-width: 0;
    padding: 10px 12px;
  }

  .top-balance-value {
    font-size: 1.2rem;
  }

  .tab-switch {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tab-switch::-webkit-scrollbar {
    display: none;
  }

  .tab-btn,
  .tab-btn-admin {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 0.88rem;
  }

  .tab-btn-admin {
    margin-left: 0;
  }

  #tabAdminBtn {
    display: none;
  }

  .actions {
    gap: 10px;
  }

  .actions > button,
  .actions > a,
  .actions > .button-like {
    flex: 1 1 100%;
  }

  .history-global-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 14px;
    justify-content: stretch;
  }

  .history-global-controls .history-toggle-all-btn,
  #exportPdfBtn {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 8px 18px rgba(0, 0, 0, 0.2);
  }

  #exportPdfBtn {
    width: 100%;
    margin-bottom: 10px;
  }

  .question-builder textarea,
  #detailedMainQuestion,
  .history-note-editor,
  .support-chat-form-user textarea,
  .support-chat-form textarea {
    font-size: 0.96rem;
  }

  .question-controls {
    gap: 10px;
  }

  .question-controls label {
    width: 100%;
  }

  .mode-switch {
    padding: 6px;
    gap: 6px;
  }

  .mode-switch-btn {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  .spread-type-trigger {
    min-height: 48px;
    padding: 0 14px;
    font-size: 0.95rem;
  }

  .spread-type-menu {
    max-height: min(52vh, 340px);
  }

  .spread-type-option {
    padding: 12px 14px;
    font-size: 0.94rem;
    line-height: 1.3;
  }

  .info-icon-btn {
    align-self: stretch;
    min-width: 48px;
    width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .interpretation {
    padding: 16px 16px 18px;
    border-radius: 18px;
    font-size: 0.97rem;
    line-height: 1.62;
  }

  .interpretation h2,
  .interpretation h3,
  .interpretation h4 {
    line-height: 1.24;
  }

  .history-item h3,
  .question-item h3,
  .panel h2 {
    line-height: 1.18;
  }

  .history-item {
    gap: 8px;
  }

  .history-card-thumb {
    border-radius: 16px;
  }

  .history-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .history-card-caption {
    padding: 8px 8px 10px;
  }

  .history-card-caption span {
    font-size: 0.76rem;
  }

  .history-card-caption small {
    font-size: 0.68rem;
  }

  .admin-usage-table-wrap {
    margin: 0 -6px;
    padding: 0 6px 4px;
  }

  .admin-usage-table {
    min-width: 720px;
  }

  .admin-usage-table th,
  .admin-usage-table td {
    padding: 10px 10px;
    font-size: 0.86rem;
    vertical-align: top;
  }

  .support-chat-phone {
    max-width: 100%;
    border-radius: 24px;
  }

  .support-chat-phone-top {
    padding: 12px 12px 10px;
  }

  .support-chat-thread-user {
    min-height: 280px;
    max-height: 50vh;
    padding: 12px;
    gap: 8px;
  }

  .support-chat-thread-user .support-chat-item {
    max-width: 90%;
    border-radius: 14px;
  }

  .support-chat-form-user {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
    gap: 8px;
  }

  .support-chat-form-user textarea {
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 18px;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 10px;
  }

  .panel,
  .card-block,
  .question-item,
  .history-item {
    padding: 12px;
    border-radius: 18px;
  }

  .top-bar {
    padding: 12px;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: auto;
  }

  .top-bar-profile {
    display: none;
  }

  .top-bar-profile h2 {
    display: none;
  }

  .top-bar-email {
    display: none;
  }

  .top-bar-actions {
    display: flex;
    width: auto !important;
    justify-content: flex-end !important;
    align-self: flex-start;
    margin-left: auto;
  }

  .mobile-account-menu {
    width: min(260px, calc(100vw - 20px));
    top: calc(100% + 8px);
    right: 0;
    left: auto;
  }

  .tab-btn,
  .tab-btn-admin {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
    border-radius: 13px;
  }

  #standardTabContent .panel:first-child {
    padding: 14px 12px 16px;
  }

  #standardTabContent .panel:first-child h2 {
    margin-bottom: 10px;
    font-size: 1.18rem;
  }

  #spreadTitle,
  #questionText {
    border-radius: 18px;
    padding: 14px 16px;
    font-size: 0.98rem;
  }

  #spreadTitle {
    min-height: 54px;
  }

  #questionText {
    min-height: 120px;
    line-height: 1.45;
  }

  .question-builder {
    gap: 12px;
    margin-top: 12px;
  }

  .question-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .question-controls > label:first-child {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 20%),
      rgba(15, 14, 22, 0.62);
  }

  .question-controls > label:first-child {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(231, 236, 244, 0.94);
  }

  .history-global-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .history-global-controls .history-toggle-all-btn,
  #exportPdfBtn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    letter-spacing: 0;
  }

  .card-count-stepper {
    grid-template-columns: 46px 1fr 46px;
    gap: 8px;
    margin-top: 2px;
  }

  .card-count-stepper-value,
  .card-count-stepper-btn {
    min-height: 46px;
  }

  .card-count-stepper-value {
    border-radius: 14px;
    font-size: 1.08rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 8px 18px rgba(0, 0, 0, 0.18);
  }

  .card-count-stepper-btn {
    border-radius: 14px;
    font-size: 1.42rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 8px 18px rgba(0, 0, 0, 0.18);
  }

  .question-controls label.context-toggle {
    flex: none;
    width: 100%;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18%),
      rgba(15, 14, 22, 0.78);
    font-size: 0.92rem;
    font-weight: 700;
    color: #eef3fb;
  }

  .question-controls label.context-toggle input[type='checkbox'] {
    transform: scale(1.15);
  }

  #addQuestionBtn {
    min-height: 44px;
    border-radius: 14px;
    font-size: 0.94rem;
  }

  #standardActions {
    margin-top: 14px;
    display: grid;
    gap: 10px;
  }

  #saveAndInterpretBtn {
    order: 1;
    min-height: 46px;
    border-radius: 15px;
    font-size: 0.94rem;
    line-height: 1.2;
  }

  #saveOnlyBtn {
    order: 2;
  }

  #openDeckBtn {
    order: 3;
  }

  #saveOnlyBtn,
  #openDeckBtn {
    min-height: 42px;
    border-radius: 14px;
    font-size: 0.88rem;
  }

  #interpretationBox {
    margin-top: 14px;
    min-height: 120px;
  }

  .detailed-layout-board-canvas {
    min-height: 440px;
    padding: 12px;
  }

  .detailed-history-board .detailed-layout-board-canvas {
    min-height: 700px;
  }

  .detailed-history-board[data-layout-type='path_solution'] .detailed-layout-board-canvas {
    min-height: 420px;
  }

  .detailed-history-board[data-layout-type='relations_360'] .detailed-layout-board-canvas {
    min-height: 460px;
  }

  .detailed-board-slot {
    gap: 4px;
  }

  .detailed-board-slot-meta {
    padding: 7px 8px;
  }

  .detailed-board-slot-meta strong {
    font-size: 0.74rem;
  }

  .detailed-board-slot-meta span {
    font-size: 0.68rem;
  }

  .detailed-board-slot-actions {
    gap: 4px;
  }

  .detailed-board-slot-actions button {
    min-height: 34px;
    padding: 6px 7px;
    font-size: 0.68rem;
  }

  .detailed-layout-board[data-layout-type="celtic_cross"] .detailed-layout-board-canvas {
    min-height: 400px;
  }

  .spread-type-trigger,
  .mode-switch-btn {
    font-size: 0.9rem;
  }

  .interpretation {
    padding: 14px;
    font-size: 0.94rem;
    line-height: 1.56;
  }

  .spread-info-modal-card {
    width: min(100%, calc(100vw - 20px));
    padding: 14px 12px 12px;
    border-radius: 20px;
  }

  .spread-info-modal-body {
    gap: 12px;
  }

  .confirm-modal-head {
    align-items: flex-start;
    gap: 10px;
  }

  .confirm-modal-head h2 {
    font-size: 1.28rem;
    line-height: 1.15;
  }

  .spread-info-intro {
    padding: 12px;
    border-radius: 16px;
  }

  .spread-info-intro p {
    font-size: 0.92rem;
    line-height: 1.48;
  }

  .spread-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .spread-info-item {
    padding: 14px 12px;
    gap: 8px;
    border-radius: 18px;
  }

  .spread-info-item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .spread-info-item-head h3 {
    font-size: 0.94rem;
    line-height: 1.18;
  }

  .spread-info-chip {
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  .spread-info-item p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .history-card-thumb {
    border-radius: 14px;
  }

  .history-export-btn {
    top: 7px;
    right: 38px;
    min-height: 24px;
    height: 24px;
    padding: 0 7px;
    font-size: 0.64rem;
  }

  .support-chat-avatar {
    width: 34px;
    height: 34px;
  }

  .support-chat-contact-copy strong {
    font-size: 0.9rem;
  }

  .support-chat-contact-copy .muted {
    font-size: 0.72rem;
  }

  .support-chat-form-user button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

/* Final history overrides: this file contains earlier responsive rules. */
.history {
  grid-template-columns: minmax(0, 1fr);
}

.history-item {
  min-width: 0;
  padding-right: 16px;
  cursor: default;
}

.history-item:hover {
  transform: none;
}

.history-item-top-actions {
  position: static;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.history-item-top-actions .history-delete-btn,
.history-item-top-actions .history-copy-top-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.history-pagination-bottom {
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 820px) {
  .history-global-controls .history-toggle-all-btn,
  .history-page-size-btn,
  .history-page-btn,
  .history-page-arrow,
  .history-display-settings summary {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .history-global-controls .history-toggle-all-btn,
  .history-page-size-btn,
  .history-page-btn,
  .history-page-arrow,
  .history-display-settings summary {
    min-height: 44px;
  }
}

@media (max-width: 440px) {
  .history-page-btn,
  .history-page-arrow {
    min-width: 44px;
    min-height: 44px;
  }

  .history-item-expand-btn {
    flex: 1 1 100%;
  }
}

/* Keep long card names and the view menu inside narrow mobile screens. */
.history .interpretation,
.history .interpretation :where(p, h1, h2, h3, h4, strong, em, li) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 560px) {
  .history-page-size-btn {
    min-width: 44px;
  }

  .history-display-settings-menu {
    left: auto;
    right: 0;
    width: min(280px, calc(100vw - 28px));
  }
}

/* Keep cabinet navigation and each history record compact on a phone. */
@media (max-width: 440px) {
  .app-navigation-panel {
    padding: 8px;
  }

  .app-navigation-panel .tab-switch {
    scroll-snap-type: x proximity;
    scroll-padding-inline: 10px;
  }

  .app-navigation-panel .tab-btn {
    scroll-snap-align: center;
  }

  .history-pagination {
    gap: 12px;
    padding: 14px;
    border-color: rgba(119, 140, 255, 0.3);
    border-radius: 20px;
    background:
      linear-gradient(145deg, rgba(31, 35, 72, 0.78), rgba(14, 19, 38, 0.88)),
      rgba(15, 23, 42, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 24px rgba(4, 8, 24, 0.16);
  }

  .history-page-nav {
    gap: 6px;
  }

  .history-page-size {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
  }

  .history-page-size-label {
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 750;
  }

  .history-page-size-options {
    justify-content: stretch;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(154, 172, 255, 0.2);
    border-radius: 15px;
    background: rgba(7, 11, 27, 0.42);
  }

  .history-page-size-options .history-page-size-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 8px 7px;
    border-color: transparent;
    border-radius: 11px;
    color: rgba(234, 239, 255, 0.82);
    background: transparent;
    box-shadow: none;
  }

  .history-page-size-options .history-page-size-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #5365ed, #0bb6cf);
    box-shadow: 0 5px 13px rgba(38, 114, 221, 0.32);
  }

  .history-pagination-status {
    grid-column: 1 / -1;
    width: auto;
    margin: -2px 0 0;
    color: rgba(220, 226, 246, 0.72);
    font-size: 0.92rem;
  }

  .history-page-nav {
    justify-content: center;
    padding-top: 2px;
  }

  .history-page-buttons {
    gap: 5px;
  }

  .history-page-btn,
  .history-page-arrow {
    min-width: 42px;
    min-height: 42px;
    padding-inline: 7px;
    border-color: rgba(173, 186, 232, 0.28);
    border-radius: 12px;
    background: rgba(50, 55, 82, 0.64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
  }

  .history-page-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, #5365ed, #0bb6cf);
    box-shadow: 0 5px 13px rgba(38, 114, 221, 0.28);
  }

  .history-page-arrow:disabled {
    opacity: 0.46;
    box-shadow: none;
  }

  .history-item-top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    align-items: center;
    justify-content: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 10px 0 12px;
  }

  .history-item-expand-btn {
    min-width: 0;
    margin-right: 0;
    padding: 0 10px;
    white-space: nowrap;
    font-size: 0.88rem;
  }

  .history-item.history-item-collapsed {
    padding-bottom: 12px;
  }

  .history-collapsed-summary {
    margin-top: 4px;
  }
}

/* Public conversion landing: premium editorial rather than a generic app screen. */
.landing-nav {
  max-width: 1180px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 16px;
  padding: 10px 4px;
}

.landing-nav-brand,
.landing-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f7f3eb;
  font-family: Comfortaa, sans-serif;
  font-weight: 800;
  text-decoration: none;
}

.landing-nav-brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229, 199, 131, .55);
  border-radius: 12px;
  color: #e5c783;
  background: rgba(229, 199, 131, .1);
}

.landing-nav-menu,
.landing-nav-actions { display: flex; align-items: center; gap: 10px; }
.landing-nav-articles {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 12px;
  color: #d6d1dd;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}
.landing-nav-articles:hover { color: #fff7e7; background: rgba(255,255,255,.055); }
.landing-nav-actions button,
.landing-account-btn {
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  white-space: nowrap;
}
.landing-account-btn {
  border-color: rgba(229, 199, 131, .45);
  color: #f7f3eb;
  background: rgba(229, 199, 131, .1);
}
.landing-account-btn:hover { border-color: #e5c783; background: rgba(229, 199, 131, .18); }
.landing-account-btn svg { width: 19px; height: 19px; fill: currentColor; }
.landing-nav :where(a, button):focus-visible { outline: 3px solid #e5c783; outline-offset: 4px; }

#authSection.landing-hero,
.landing-entry,
.landing-editorial {
  max-width: none;
  overflow: hidden;
}

#authSection.landing-hero {
  position: relative;
  margin: 0;
  padding: clamp(32px, 5vw, 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(360px, .78fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: center;
  border-color: rgba(213, 172, 99, .22);
  background:
    radial-gradient(circle at 80% 28%, rgba(213, 172, 99, .15), transparent 22rem),
    radial-gradient(circle at 8% 7%, rgba(104, 83, 171, .24), transparent 31rem),
    linear-gradient(145deg, rgba(19, 20, 49, .97), rgba(7, 18, 29, .98));
}

#authSection.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .6;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, #000, transparent 86%);
}

.landing-hero-copy,
.landing-visual,
.landing-auth-panel,
.landing-entry-copy,
.landing-editorial-copy { position: relative; z-index: 1; min-width: 0; }

.landing-eyebrow,
.landing-result-label,
.landing-auth-step {
  margin: 0;
  display: block;
  color: #e5c783;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.landing-hero h1,
.landing-section-heading h2,
.landing-entry-copy h2,
.landing-editorial-copy h2 {
  font-family: Comfortaa, sans-serif;
  color: #f7f3eb;
  letter-spacing: -.045em;
}

.landing-hero h1 { max-width: 760px; margin: 15px 0 20px; font-size: clamp(2.4rem, 4vw, 4.45rem); line-height: 1.04; }
.landing-hero-lead { max-width: 620px; margin: 0; color: #c8c5d5; font-size: clamp(1.05rem, 1.7vw, 1.24rem); line-height: 1.68; }

.landing-benefits { display: grid; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; color: #f1eef5; font-weight: 750; }
.landing-benefits li { display: flex; gap: 11px; align-items: center; }
.landing-benefits li::before { content: '✦'; display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; color: #e5c783; font-size: .7rem; border: 1px solid rgba(229,199,131,.45); border-radius: 50%; }

.landing-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.landing-hero-actions button, .seo-links button, .seo-links a.secondary { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; border-radius: 14px; font-weight: 900; text-decoration: none; }
.landing-hero-actions button:not(.secondary), .seo-links button { color: #19130c; border-color: #e5c783; background: linear-gradient(135deg, #e5c783, #c9914f); box-shadow: 0 14px 36px rgba(213,172,99,.2); }
.landing-hero-actions button:not(.secondary):hover, .seo-links button:hover { filter: brightness(1.06); transform: translateY(-2px); }
.seo-links a.secondary, .landing-hero-actions .secondary { border: 1px solid rgba(229,199,131,.28); color: #ece9f3; background: rgba(255,255,255,.035); }
.seo-links a.secondary:hover, .landing-hero-actions .secondary:hover { border-color: rgba(229,199,131,.7); background: rgba(255,255,255,.08); }

.landing-disclaimer { max-width: 620px; margin: 18px 0 0; color: #9996aa; font-size: .84rem; line-height: 1.55; }
.landing-visual { width: min(100%, 490px); justify-self: end; }
.landing-visual-frame { position: relative; padding: 9px; border: 1px solid rgba(229,199,131,.25); border-radius: 28px; background: rgba(7,10,24,.72); box-shadow: 0 34px 90px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.1); }
.landing-visual-frame::after { content: ''; position: absolute; inset: 12% -8% -10%; z-index: -1; background: rgba(213,172,99,.2); filter: blur(55px); }
.landing-visual-frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 21px; }
.landing-result-preview { width: min(94%, 420px); margin: -86px auto 0; padding: 18px 20px; border: 1px solid rgba(229,199,131,.3); border-radius: 18px; background: rgba(18,19,42,.91); box-shadow: 0 20px 42px rgba(0,0,0,.32); backdrop-filter: blur(14px); }
.landing-result-preview strong { display: block; margin-top: 8px; color: #f8f4eb; font-size: 1.06rem; line-height: 1.5; }
.landing-result-preview strong span { color: #e5c783; }
.landing-result-preview p { margin: 8px 0 0; color: #b9b5c6; font-size: .9rem; line-height: 1.5; }

.landing-trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 1180px; margin: 16px auto 0; padding: 20px 26px; border: 1px solid rgba(255,255,255,.09); border-radius: 18px; color: #c8c5d3; background: rgba(17,18,40,.65); }
.landing-trust-strip p { margin: 0; text-align: center; font-size: .91rem; font-weight: 750; }
.landing-trust-strip span { margin-right: 8px; color: #e5c783; }

.landing-entry { display: grid; grid-template-columns: minmax(0,.9fr) minmax(360px,1.1fr); gap: clamp(28px,6vw,100px); margin-top: clamp(56px,8vw,104px); padding: clamp(30px,5vw,70px); border-color: rgba(229,199,131,.16); background: linear-gradient(135deg, rgba(24,23,52,.94), rgba(10,24,34,.95)); }
.landing-entry-copy h2, .landing-section-heading h2, .landing-editorial-copy h2 { margin: 12px 0 16px; font-size: clamp(1.9rem,3.4vw,3.3rem); line-height: 1.14; }
.landing-entry-copy > p:not(.landing-eyebrow), .landing-editorial-copy > p { max-width: 570px; color: #c1bdcd; font-size: 1.06rem; line-height: 1.68; }
.landing-question-example { margin-top: 28px; max-width: 540px; padding: 18px 20px; border-left: 2px solid #d5ac63; border-radius: 0 14px 14px 0; background: rgba(255,255,255,.045); }
.landing-question-example span { color: #e5c783; font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.landing-question-example p { margin: 8px 0 0; color: #eeeaf3; font-size: 1.03rem; line-height: 1.58; }
.landing-auth-panel { padding: clamp(22px,3vw,34px); border: 1px solid rgba(229,199,131,.2); border-radius: 24px; background: rgba(7,12,27,.6); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.landing-auth-panel button { min-height: 44px; }
.landing-auth-intro h2 { margin: 8px 0 4px; color: #f7f3eb; font-size: clamp(1.38rem,2vw,1.75rem); }
.landing-auth-intro p { margin: 0 0 16px; color: #aaa8ba; line-height: 1.55; }
.landing-auth-panel .auth-shell { width: 100%; min-height: 0; }
.landing-auth-panel .auth-card { padding: 20px; border-color: rgba(229,199,131,.15); background: rgba(255,255,255,.035); box-shadow: none; }
.landing-auth-panel .auth-card h2 { margin-top: 0; }
.guest-account-title { display: none; }

/* The account route is intentionally a task-focused entry point, not a second landing page. */
body.guest-account-view #authSection,
body.guest-account-view .landing-trust-strip,
body.guest-account-view #landing-spread,
body.guest-account-view #seoLandingSection,
body.guest-account-view .landing-steps,
body.guest-account-view .landing-scenarios,
body.guest-account-view .landing-example,
body.guest-account-view .landing-editorial,
body.guest-account-view #seoGuidesSection,
body.guest-account-view #seoFaqSection,
body.guest-account-view .footer,
body.authenticated-view .landing-trust-strip,
body.authenticated-view #authSection,
body.authenticated-view #landingAuthPanel,
body.authenticated-view #landing-spread,
body.authenticated-view #seoLandingSection,
body.authenticated-view #seoGuidesSection,
body.authenticated-view #seoFaqSection,
body.authenticated-view .landing-steps,
body.authenticated-view .landing-scenarios,
body.authenticated-view .landing-example,
body.authenticated-view .landing-editorial {
  display: none;
}

body.guest-account-view .landing-nav-menu {
  display: none;
}

body.guest-account-view .landing-nav {
  margin-bottom: clamp(18px, 4vw, 42px);
}

body.guest-account-view .landing-entry {
  display: block;
  width: min(100%, 540px);
  margin: 0 auto clamp(24px, 6vw, 64px);
  padding: clamp(18px, 4vw, 32px);
}

body.guest-account-view .landing-entry-copy,
body.guest-account-view .landing-auth-intro {
  display: none;
}

body.guest-account-view .landing-auth-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.guest-account-view .guest-account-title {
  display: block;
  margin: 0 0 20px;
  color: #f7f3eb;
  font-family: Comfortaa, sans-serif;
  font-size: clamp(1.65rem, 6vw, 2.25rem);
  letter-spacing: -.04em;
  line-height: 1.15;
}

body.guest-account-view .yandex-login-btn {
  width: 100%;
  min-width: 0;
}

/* Password recovery is an account-only flow even when entered from a public link. */
body.password-reset-view #authSection,
body.password-reset-view .landing-trust-strip,
body.password-reset-view #landing-spread,
body.password-reset-view #seoLandingSection,
body.password-reset-view .landing-steps,
body.password-reset-view .landing-scenarios,
body.password-reset-view .landing-example,
body.password-reset-view .landing-editorial,
body.password-reset-view #seoGuidesSection,
body.password-reset-view #seoFaqSection,
body.password-reset-view .footer {
  display: none;
}
body.password-reset-view .landing-nav-menu,
body.password-reset-view .landing-entry-copy,
body.password-reset-view .landing-auth-intro,
body.password-reset-view .guest-account-title {
  display: none;
}
body.password-reset-view .landing-entry {
  display: block;
  width: min(100%, 540px);
  margin: 0 auto clamp(24px, 6vw, 64px);
  padding: clamp(18px, 4vw, 32px);
}
body.password-reset-view .landing-auth-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.seo-panel { gap: 26px; margin-top: clamp(56px,8vw,104px); padding: clamp(30px,5vw,70px); border-color: rgba(229,199,131,.14); background: linear-gradient(145deg, rgba(19,20,47,.9), rgba(8,24,33,.9)); }
.seo-hero { max-width: 760px; gap: 10px; }
.seo-panel .seo-card, .seo-panel .seo-faq-item, .seo-panel .seo-guide-card { border-color: rgba(229,199,131,.14); color: #ebe8f0; background: linear-gradient(150deg, rgba(36,35,68,.72), rgba(13,29,42,.76)); box-shadow: inset 0 1px rgba(255,255,255,.045); }
.seo-panel :where(.seo-card,.seo-faq-item,.seo-guide-card) p { color: #c0bdcc; }
.seo-panel .seo-guide-card h3 a, .seo-panel .seo-guide-link { color: #f4f1f7; }
.seo-card-number { width: 40px; height: 40px; margin-bottom: 8px; border: 1px solid rgba(229,199,131,.35); border-radius: 12px; color: #e5c783; background: rgba(213,172,99,.08); }
.seo-guides-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.seo-all-articles {
  min-height: 46px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(229,199,131,.32);
  border-radius: 13px;
  color: #f4ecd9;
  font-weight: 900;
  text-decoration: none;
  background: rgba(229,199,131,.055);
}
.seo-all-articles:hover { border-color: rgba(229,199,131,.7); background: rgba(229,199,131,.11); }
.seo-guide-card { min-height: 230px; display: flex; flex-direction: column; transition: transform .22s ease, border-color .22s ease; }
.seo-guide-card:hover { transform: translateY(-4px); border-color: rgba(229,199,131,.42); }
.seo-guide-topic { margin-bottom: 18px; color: #e5c783; font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.seo-guide-card h3 { font-size: 1.24rem; line-height: 1.35; }
.seo-guide-link { gap: 8px; margin-top: auto; text-decoration: none; }

.landing-steps, .landing-scenarios { max-width: 1180px; margin: clamp(72px,10vw,132px) auto 0; }
.landing-section-heading { max-width: 760px; }
.landing-steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
.landing-steps-grid li { padding: 26px; border-top: 1px solid rgba(229,199,131,.35); border-radius: 0 0 20px 20px; background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); }
.landing-steps-grid span { color: #e5c783; font-size: .78rem; font-weight: 900; letter-spacing: .1em; }
.landing-steps-grid h3 { margin: 22px 0 10px; color: #f2eff6; font-size: 1.23rem; }
.landing-steps-grid p { margin: 0; color: #b9b5c6; line-height: 1.62; }
.landing-scenarios-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 32px; }
.landing-scenario-card { min-height: 260px; display: flex; flex-direction: column; padding: 26px; border: 1px solid rgba(229,199,131,.14); border-radius: 22px; color: #f4f1f8; text-decoration: none; background: radial-gradient(circle at 85% 10%, rgba(213,172,99,.12), transparent 38%), linear-gradient(145deg, rgba(38,35,73,.74), rgba(10,27,38,.88)); transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.landing-scenario-card:hover { transform: translateY(-5px); border-color: rgba(229,199,131,.5); background: radial-gradient(circle at 85% 10%, rgba(213,172,99,.2), transparent 43%), linear-gradient(145deg, rgba(44,40,82,.9), rgba(10,27,38,.96)); }
.landing-scenario-card span { color: #e5c783; font-size: .76rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.landing-scenario-card h3 { margin: 20px 0 10px; color: inherit; font-size: 1.3rem; line-height: 1.3; }
.landing-scenario-card p { margin: 0; color: #beb9c9; line-height: 1.58; }
.landing-scenario-card b { margin-top: auto; padding-top: 22px; color: #e5c783; font-size: .9rem; }
.landing-scenario-card i { font-style: normal; }
.landing-scenarios-all { margin: 22px 0 0; }
.landing-scenarios-all a { display: inline-flex; gap: 9px; align-items: center; color: #f4ecd9; font-weight: 900; text-decoration: none; }
.landing-scenarios-all a:hover { color: #fff7e7; text-decoration: underline; text-underline-offset: 4px; }

.landing-editorial { max-width: 1180px; margin: clamp(72px,10vw,132px) auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: stretch; border: 1px solid rgba(229,199,131,.16); border-radius: 28px; background: #15162f; }
.landing-editorial-image { min-height: 460px; background: linear-gradient(90deg, transparent 55%, #15162f 100%), url('/images/tarot-cabinet-hero.png') center 58% / cover; }
.landing-editorial-copy { padding: clamp(32px,6vw,78px); display: flex; flex-direction: column; justify-content: center; }
.landing-editorial-copy dl { display: grid; gap: 14px; margin: 26px 0 0; }
.landing-editorial-copy dl div { padding: 14px 0 0; border-top: 1px solid rgba(229,199,131,.2); }
.landing-editorial-copy dt { color: #e5c783; font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.landing-editorial-copy dd { margin: 6px 0 0; color: #e6e2eb; line-height: 1.55; }

.landing-nav :where(button,a):focus-visible, .landing-hero :where(button,a):focus-visible, .seo-panel :where(button,a):focus-visible, .landing-scenarios a:focus-visible { outline: 3px solid #e5c783; outline-offset: 4px; }

@media (max-width: 960px) {
  #authSection.landing-hero, .landing-entry, .landing-editorial { grid-template-columns: 1fr; }
  .landing-visual { width: min(100%, 520px); justify-self: center; }
  .landing-entry-copy { max-width: 680px; }
  .landing-editorial-image { min-height: 340px; background: linear-gradient(180deg, transparent 62%, #15162f), url('/images/tarot-cabinet-hero.png') center 58% / cover; }
  .landing-editorial-copy { padding-top: 14px; }
}

@media (max-width: 720px) {
  .landing-nav { min-height: 60px; margin: 0 16px 12px; padding: 6px 0; }
  .landing-nav-brand { font-size: .84rem; }
  .landing-nav-brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .landing-nav-menu, .landing-nav-actions { gap: 7px; }
  .landing-nav-articles { padding-inline: 8px; font-size: .82rem; }
  .landing-nav-actions button,
  .landing-account-btn { min-height: 44px; padding-inline: 11px; font-size: .82rem; }
  #authSection.landing-hero, .landing-entry, .seo-panel { padding: 28px 18px; }
  #authSection.landing-hero { gap: 34px; }
  .landing-hero h1 { font-size: clamp(2.25rem, 11vw, 3.25rem); }
  .landing-hero-actions, .seo-links { display: grid; grid-template-columns: 1fr; }
  .landing-hero-actions button, .seo-links button, .seo-links a.secondary { width: 100%; }
  .landing-trust-strip { grid-template-columns: 1fr 1fr; margin-inline: 16px; padding: 14px 10px; }
  .landing-trust-strip p { font-size: .76rem; }
  .landing-steps, .landing-scenarios { margin: 76px 16px 0; }
  .landing-steps-grid, .landing-scenarios-grid { grid-template-columns: 1fr; }
  .landing-steps-grid { gap: 10px; }
  .landing-scenario-card { min-height: 220px; }
  .landing-editorial { margin: 76px 16px; border-radius: 22px; }
  .landing-editorial-image { min-height: 300px; }
  .landing-editorial-copy { padding: 30px 22px 36px; }
  .landing-auth-panel { padding: 20px 14px; border-radius: 20px; }
  .landing-auth-panel .auth-card { padding: 17px 14px; }
  .seo-guides-heading { align-items: stretch; flex-direction: column; gap: 18px; }
  .seo-all-articles { align-self: flex-start; }
}

@media (max-width: 480px) {
  .landing-nav { flex-wrap: wrap; gap: 4px 10px; padding-top: 8px; }
  .landing-nav-menu { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-scenario-card, .landing-hero-actions button { transition: none; }
  .landing-scenario-card:hover, .landing-hero-actions button:not(.secondary):hover { transform: none; }
}

/* Public question-to-registration funnel. The draft never leaves the browser before signup. */
.landing-funnel {
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, .72fr);
  grid-template-areas: "form preview";
  column-gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(40px, 6vw, 76px);
  padding: clamp(26px, 4vw, 52px);
  border-color: rgba(229, 199, 131, .2);
  background:
    radial-gradient(circle at 88% 12%, rgba(74, 163, 226, .15), transparent 20rem),
    linear-gradient(145deg, rgba(25, 22, 55, .96), rgba(8, 24, 34, .97));
}

.landing-funnel h2,
.landing-funnel h3 { color: #f7f3eb; }
.landing-funnel-form { grid-area: form; }
.landing-funnel h2 { margin: 12px 0 12px; font-family: Comfortaa, sans-serif; font-size: clamp(1.7rem, 3vw, 2.8rem); line-height: 1.18; letter-spacing: -.04em; }
.landing-funnel-intro { max-width: 660px; margin: 0; color: #c6c2d1; line-height: 1.62; }
.landing-funnel-question { display: grid; gap: 9px; margin-top: 24px; }
.landing-funnel-question > span { color: #f1edf5; font-weight: 800; }
.landing-funnel-question textarea { width: 100%; min-height: 108px; resize: vertical; padding: 14px 16px; border: 1px solid rgba(229, 199, 131, .26); border-radius: 16px; color: #f4f0f5; background: rgba(4, 9, 20, .66); font: inherit; line-height: 1.5; }
.landing-funnel-question textarea::placeholder { color: #89869a; }
.landing-funnel-question textarea:focus-visible { outline: 3px solid #e5c783; outline-offset: 3px; border-color: #e5c783; }
.landing-funnel-picker { margin-top: 24px; }
.landing-funnel-picker-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.landing-funnel-picker h3 { margin: 0; font-size: 1.08rem; }
.landing-funnel-picker p { margin: 6px 0 0; }
.landing-funnel-card-count { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.landing-funnel-card-count button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; font-size: 1.4rem; line-height: 1; }
.landing-funnel-card-count output { min-width: 86px; padding: 12px 8px; border: 1px solid rgba(229, 199, 131, .24); border-radius: 12px; color: #f8f3e8; font-size: .86rem; font-weight: 850; text-align: center; background: rgba(5, 11, 25, .55); }
.landing-funnel-deck-note { color: #aaa7b8; font-size: .84rem; line-height: 1.45; }
.landing-funnel-cards.deck-grid {
  grid-template-columns: repeat(auto-fill, clamp(40px, 3vw, 46px));
  gap: 4px;
  justify-content: start;
  margin-top: 12px;
}
.landing-funnel-cards .deck-card { width: 100%; min-height: 0; border-width: 1px; border-radius: 10px; }
.landing-funnel-cards .card-back-art { min-height: 0; border-radius: 8px; }
.landing-funnel-cards .card-back-art::before { inset: 4px; border-radius: 6px; }
.landing-funnel-cards .card-back-art::after { font-size: .68rem; }
.landing-funnel-cards .sigil { font-size: .43rem; letter-spacing: .12em; }
.landing-funnel-cards .deck-card-rotate-btn { right: -4px; bottom: -4px; width: 22px; min-width: 22px; height: 22px; min-height: 22px; border-width: 1px; font-size: .72rem; }
.landing-funnel-cards .deck-card:focus-visible, .landing-funnel-preview button:focus-visible, .landing-funnel-card-count button:focus-visible { outline: 3px solid #e5c783; outline-offset: 3px; }

.landing-funnel-preview { grid-area: preview; align-self: stretch; display: flex; flex-direction: column; padding: clamp(22px, 3vw, 32px); border: 1px solid rgba(229, 199, 131, .25); border-radius: 22px; background: rgba(7, 11, 27, .74); box-shadow: inset 0 1px rgba(255,255,255,.07), 0 18px 50px rgba(0,0,0,.18); }
.landing-funnel-preview h3 { margin: 11px 0 10px; font-size: clamp(1.3rem, 2vw, 1.68rem); line-height: 1.3; }
.landing-funnel-preview > p:not(.landing-eyebrow):not(.landing-funnel-offer):not(.landing-funnel-footnote) { margin: 0; color: #c8c5d2; line-height: 1.58; }
.landing-funnel-steps { display: flex; gap: 8px; margin: 24px 0; padding: 0; list-style: none; counter-reset: landing-funnel-step; }
.landing-funnel-steps li { min-width: 0; flex: 1; display: grid; gap: 5px; color: #c4bfce; font-size: .76rem; font-weight: 750; text-align: center; }
.landing-funnel-steps li::before { counter-increment: landing-funnel-step; content: counter(landing-funnel-step); width: 28px; height: 28px; display: grid; place-items: center; justify-self: center; border: 1px solid rgba(229,199,131,.45); border-radius: 50%; color: #e5c783; background: rgba(229,199,131,.08); }
.landing-funnel-price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: auto; padding: 16px 0; border-top: 1px solid rgba(229,199,131,.2); color: #c3bfce; }
.landing-funnel-price small { display: block; margin-top: 3px; color: #9692a3; font-size: .72rem; font-weight: 600; }
.landing-funnel-price strong { color: #f8f3e8; font-size: 1.45rem; white-space: nowrap; }
.landing-funnel-offer { margin: 0 0 16px; padding: 11px 13px; border: 1px solid rgba(76, 195, 172, .42); border-radius: 12px; color: #e2fff7; font-weight: 850; background: rgba(45, 160, 139, .14); }
.landing-funnel-charge-hint { margin: 0 0 16px; color: #bbb7c6; font-size: .84rem; line-height: 1.5; }
.landing-funnel-preview > button { width: 100%; min-height: 52px; padding: 12px 16px; border-color: #e5c783; border-radius: 14px; color: #19130c; background: linear-gradient(135deg, #e5c783, #c9914f); font-weight: 900; }
.landing-funnel-preview > button:disabled { cursor: not-allowed; opacity: .56; filter: grayscale(.35); }
.landing-funnel-footnote { margin: 13px 0 0; color: #9d9aab; font-size: .82rem; line-height: 1.5; }
.history-private-note { margin: -4px 0 18px; color: #aaa7b8; font-size: .92rem; }
.account-history-panel { scroll-margin-top: 18px; }
/* History is a reading workspace, not a marketing surface: remove decorative orbs from long cards. */
.account-history-panel .history-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 18%),
    linear-gradient(145deg, rgba(35, 29, 49, .98), rgba(19, 17, 31, .98)) !important;
}

.account-history-panel .history-item::before {
  display: none;
}

/* The cabinet is a workspace: keep its long reading history free of background orbs. */
body.authenticated-view {
  background: linear-gradient(180deg, #14121a 0%, #1b1825 42%, #161b26 100%) !important;
}

body.authenticated-view .bg-glow {
  display: none !important;
}

.account-history-panel {
  background: linear-gradient(145deg, rgba(35, 29, 49, .99), rgba(19, 17, 31, .99)) !important;
}

.account-history-panel .history-questions-block,
.account-history-panel .history-interpretation-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(18, 16, 28, .96) 22%) !important;
}

.account-history-panel .interpretation,
.account-history-panel .history-note-box,
.account-history-panel .suggested-questions,
.account-history-panel .detailed-layout-board-canvas {
  background: linear-gradient(145deg, rgba(31, 27, 43, .98), rgba(20, 17, 31, .98)) !important;
}
.app-navigation-panel { padding: 10px; }

@media (max-width: 960px) {
  .landing-funnel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "form" "preview";
  }
  .landing-funnel-preview { max-width: 680px; }
}

@media (max-width: 720px) {
  .landing-funnel { margin-inline: 16px; padding: 28px 18px; }
  .landing-funnel-picker-heading { align-items: stretch; flex-direction: column; }
  .landing-funnel-card-count { align-self: flex-start; }
  .landing-funnel-preview { padding: 22px 18px; }
}

@media (max-width: 380px) {
  .landing-funnel { margin-inline: 10px; padding-inline: 14px; }
}

/* Compact public-deck picker and content-rich landing modules. */
.landing-funnel-open-deck {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  border-color: rgba(229, 199, 131, .32);
  border-radius: 13px;
  color: #f5f0e8;
  font-weight: 850;
  background: rgba(255, 255, 255, .035);
}
.landing-funnel-open-deck:hover:not(:disabled) { border-color: rgba(229, 199, 131, .7); background: rgba(229, 199, 131, .1); }
.landing-funnel-open-deck:disabled { cursor: wait; opacity: .62; }
.landing-funnel-open-deck:focus-visible { outline: 3px solid #e5c783; outline-offset: 3px; }

.landing-deck-dialog {
  width: min(1160px, calc(100vw - 24px));
  max-width: none;
  max-height: min(860px, calc(100vh - 24px));
  padding: 0;
  border: 1px solid rgba(229, 199, 131, .34);
  border-radius: 24px;
  color: #f5f0f8;
  background: linear-gradient(145deg, #191836, #081925);
  box-shadow: 0 28px 100px rgba(0, 0, 0, .65);
}
.landing-deck-dialog::backdrop { background: rgba(3, 5, 14, .76); backdrop-filter: blur(5px); }
.landing-deck-dialog-inner { max-height: inherit; padding: clamp(20px, 3vw, 34px); overflow: auto; }
.landing-deck-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.landing-deck-dialog h2 { margin: 9px 0 8px; color: #f8f3eb; font-family: Comfortaa, sans-serif; font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.25; }
.landing-deck-dialog-head .muted { max-width: 660px; margin: 0; line-height: 1.55; }
.landing-deck-dialog-close { min-width: 108px; min-height: 44px; flex: none; border-radius: 12px; }
.landing-deck-dialog-close:focus-visible,
.landing-full-deck .deck-card:focus-visible,
.landing-full-deck .deck-card-rotate-btn:focus-visible { outline: 3px solid #e5c783; outline-offset: 3px; }
.landing-full-deck.deck-grid { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 10px 8px; margin-top: 26px; }
.landing-full-deck .deck-card { width: 100%; min-height: 0; border-radius: 11px; }
.landing-full-deck .card-back-art { min-height: 0; border-radius: 9px; }
.landing-full-deck .card-back-art::after { font-size: .76rem; }
.landing-full-deck .sigil { font-size: .48rem; }
.landing-full-deck .deck-card-rotate-btn { width: 25px; min-width: 25px; height: 25px; min-height: 25px; right: -5px; bottom: -5px; padding: 0; font-size: .8rem; }

.landing-scenario-card--image { min-height: 0; padding: 0; overflow: hidden; }
.landing-scenario-card--image > img { width: 100%; height: 160px; display: block; object-fit: cover; border-bottom: 1px solid rgba(229, 199, 131, .16); filter: saturate(.88) contrast(1.04); transition: transform .35s ease, filter .35s ease; }
.landing-scenario-card--image:hover > img { transform: scale(1.035); filter: saturate(1.02) contrast(1.06); }
.landing-scenario-card--image > div:not(.landing-scenario-actions) { padding: 22px 24px 0; }
.landing-scenario-card--image h3 { margin-top: 14px; }
.landing-scenario-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 20px 24px 23px; }
.landing-scenario-actions button { min-height: 44px; padding: 9px 12px; border-radius: 12px; font-size: .86rem; font-weight: 850; }
.landing-scenario-actions a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: #e5c783; font-size: .86rem; font-weight: 850; text-decoration: none; }
.landing-scenario-actions a:hover { color: #fff0ce; text-decoration: underline; text-underline-offset: 4px; }
.landing-scenario-actions i { font-style: normal; }

.landing-example { max-width: 1180px; display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 92px); align-items: center; margin: clamp(72px, 10vw, 132px) auto 0; padding: clamp(28px, 5vw, 64px); border: 1px solid rgba(229, 199, 131, .16); border-radius: 28px; background: radial-gradient(circle at 14% 28%, rgba(213, 172, 99, .12), transparent 17rem), linear-gradient(135deg, rgba(25, 22, 55, .92), rgba(7, 24, 34, .93)); }
.landing-example-cards { min-height: 278px; position: relative; display: grid; place-items: center; }
.landing-example-card { width: min(35vw, 146px); aspect-ratio: .63; position: absolute; display: grid; align-content: end; padding: 14px 9px; overflow: hidden; border: 1px solid rgba(242, 225, 184, .55); border-radius: 14px; color: #f9f1dc; font-family: Comfortaa, sans-serif; font-size: .66rem; font-weight: 800; text-align: center; text-shadow: 0 2px 10px #000; background: radial-gradient(circle at 50% 26%, rgba(255, 234, 135, .74), transparent 25%), linear-gradient(160deg, #306b87, #142041 58%, #090c1a); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.landing-example-card::before { content: ''; position: absolute; inset: 13px; border: 1px solid rgba(244, 219, 155, .46); border-radius: 9px; pointer-events: none; }
.landing-example-card--sun { transform: translateX(-66px) rotate(-12deg); background: radial-gradient(circle at 50% 26%, #ffe16e 0 12%, transparent 13%), linear-gradient(160deg, #e18942, #593b43 58%, #18142e); }
.landing-example-card--emperor { z-index: 2; transform: translateY(-12px); background: radial-gradient(ellipse at 50% 29%, #f6c46b 0 11%, transparent 12%), linear-gradient(160deg, #963f42, #44244e 56%, #17142e); }
.landing-example-card--wands { transform: translateX(66px) rotate(12deg); background: radial-gradient(circle at 50% 24%, #eef2e1 0 8%, transparent 9%), linear-gradient(160deg, #547d57, #2d525a 56%, #121c2c); }
.landing-example-copy h2 { max-width: 620px; margin: 12px 0 16px; color: #f7f3eb; font-family: Comfortaa, sans-serif; font-size: clamp(1.9rem, 3.4vw, 3.1rem); line-height: 1.15; letter-spacing: -.04em; }
.landing-example-copy > p:not(.landing-eyebrow) { max-width: 660px; color: #c6c2d1; line-height: 1.66; }
.landing-example-copy button { min-height: 44px; margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-weight: 850; }
.landing-example-copy button:focus-visible, .landing-scenario-actions button:focus-visible { outline: 3px solid #e5c783; outline-offset: 3px; }

.seo-faq details { min-width: 0; }
.seo-faq-item { overflow: hidden; }
.seo-faq-item summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; cursor: pointer; color: #f4f0f8; font-weight: 850; line-height: 1.42; list-style: none; }
.seo-faq-item summary::-webkit-details-marker { display: none; }
.seo-faq-item summary::after { content: '+'; flex: 0 0 auto; color: #e5c783; font-size: 1.4rem; font-weight: 400; transition: transform .2s ease; }
.seo-faq-item[open] summary { border-bottom: 1px solid rgba(229, 199, 131, .16); }
.seo-faq-item[open] summary::after { transform: rotate(45deg); }
.seo-faq-item summary:focus-visible { outline: 3px solid #e5c783; outline-offset: -3px; }
.seo-faq-item p { margin: 0; padding: 0 18px 18px; line-height: 1.62; }

@media (max-width: 720px) {
  .app-navigation-panel .tab-btn { min-height: 44px; }
  .landing-deck-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 18px; }
  .landing-deck-dialog-inner { padding: 18px 14px; }
  .landing-deck-dialog-head { gap: 14px; }
  .landing-deck-dialog-close { min-width: 44px; width: 44px; padding: 0; font-size: 0; }
  .landing-deck-dialog-close span { font-size: 1.35rem; }
  .landing-full-deck.deck-grid { grid-template-columns: repeat(auto-fill, minmax(47px, 1fr)); gap: 9px 6px; margin-top: 20px; }
  .landing-scenario-card--image > img { height: 168px; }
  .landing-example { grid-template-columns: 1fr; margin-inline: 16px; padding: 30px 22px; border-radius: 22px; }
  .landing-example-cards { min-height: 230px; }
  .landing-example-card { width: 122px; }
  .landing-example-card--sun { transform: translateX(-53px) rotate(-12deg); }
  .landing-example-card--wands { transform: translateX(53px) rotate(12deg); }
}

@media (max-width: 380px) {
  .landing-nav-menu { flex-wrap: wrap; justify-content: flex-start; }
  .landing-nav-actions { width: 100%; }
  .landing-nav-actions button { flex: 1 1 0; }
  .landing-deck-dialog-head .muted { font-size: .84rem; }
  .landing-full-deck.deck-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px 5px; }
  .landing-scenario-actions { align-items: stretch; flex-direction: column; }
  .landing-scenario-actions a { justify-content: center; }
  .landing-example { margin-inline: 10px; padding-inline: 16px; }
}

/* Keep saved readings visually quiet: opaque surfaces prevent any page artwork
   from bleeding through tall, expanded history cards. */
.account-history-panel,
.account-history-panel .history-item {
  background: #211c2d !important;
  background-image: none !important;
  isolation: auto;
}

.account-history-panel::before,
.account-history-panel::after,
.account-history-panel .history-item::before {
  display: none !important;
}

/* Long saved readings get their own opaque paint layer under the content. */
.account-history-panel .history-item {
  overflow: hidden;
}

.account-history-panel .history-item::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  border-radius: inherit;
  background: #211c2d !important;
  pointer-events: none;
}

.account-history-panel .history-item > * {
  position: relative;
  z-index: 1;
}

.account-history-panel .history-questions-block,
.account-history-panel .history-interpretation-block,
.account-history-panel .interpretation,
.account-history-panel .history-note-box,
.account-history-panel .suggested-questions,
.account-history-panel .detailed-layout-board-canvas {
  background: #191622 !important;
  background-image: none !important;
}
