: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: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 14px 0 8px;
}

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

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

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

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

.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: max-content;
  max-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-pagination-bottom {
  justify-content: center;
  margin-top: 16px;
}

.history-item-top-actions {
  position: static;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.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-period-options {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .history-period-options button {
    flex: 0 0 auto;
  }

  .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-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);
}

.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;
}

@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;
}

.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: 40px;
  padding: 56px 0 28px;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(135deg, #111827 0%, #030712 100%);
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  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.35fr) minmax(190px, 0.75fr) minmax(250px, 1fr);
  gap: clamp(28px, 5vw, 88px);
  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 20px;
  color: #d1d5db;
  line-height: 1.6;
}

.footer__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  width: min(100%, 292px);
  gap: 12px;
}

.footer__email-link,
.footer__social-link {
  min-height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.footer__email-link {
  gap: 9px;
  min-width: 0;
  padding: 10px 14px;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  isolation: isolate;
}

.footer__social-link {
  width: 44px;
  flex: 0 0 44px;
  padding: 0;
  isolation: isolate;
}

.footer__email-link:hover,
.footer__social-link:hover {
  color: #4f46e5;
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.footer__title {
  margin-bottom: 16px;
  color: #ffffff;
  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: 4px;
}

.footer__link,
.footer__legal-link,
.footer__contact-item a {
  color: #d1d5db;
  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: 4px;
  margin-top: 4px;
}

.footer__contact-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 0;
  min-height: 44px;
  padding: 8px 0;
  color: #d1d5db;
  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: 44px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer__bottom {
  padding-top: 24px;
  border-top: 1px solid #1f2937;
}

.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: #d1d5db;
  font-size: 0.92rem;
}

.footer__built-by {
  color: #d1d5db;
  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: underline;
  text-underline-offset: 3px;
}

.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__actions {
    width: 100%;
  }

  .footer__email-link {
    padding-inline: 12px;
  }

  .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;
  }

  #tabAccountBtn,
  #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;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.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-period-options button,
  .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-period-options button,
  .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));
  }
}

/* Public conversion landing */
#authSection.landing-hero {
  max-width: none;
  margin: 0 0 16px;
  padding: clamp(26px, 4.5vw, 58px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
  overflow: hidden;
}

.landing-hero-copy,
.landing-auth-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.landing-hero h1 {
  max-width: 820px;
  margin: 10px 0 18px;
  font-size: clamp(2.2rem, 3.8vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.landing-hero-lead {
  max-width: 720px;
  margin: 0;
  color: #dbe4f4;
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.65;
}

.landing-benefits {
  display: grid;
  gap: 11px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
  color: #f5f8ff;
  font-weight: 750;
}

.landing-benefits li {
  display: flex;
  gap: 11px;
  align-items: center;
}

.landing-benefits li::before {
  content: '✓';
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(51, 211, 255, 0.55);
  border-radius: 50%;
  color: #53dcff;
  background: rgba(25, 157, 220, 0.12);
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}

.landing-hero-actions button,
.seo-links button,
.seo-links a.secondary {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
}

.landing-auth-panel button {
  min-height: 44px;
}

.seo-links a.secondary {
  border: 1px solid rgba(164, 180, 214, 0.26);
  color: #e4ebf8;
  background: rgba(35, 44, 68, 0.7);
}

.seo-links a.secondary:hover {
  border-color: rgba(79, 204, 255, 0.55);
  background: rgba(41, 64, 98, 0.86);
}

.landing-result-preview {
  max-width: 720px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(104, 205, 255, 0.27);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(29, 50, 94, 0.64), rgba(11, 30, 47, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.landing-result-label,
.landing-auth-step {
  display: block;
  color: #6ddfff;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.landing-result-preview strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(1.03rem, 1.7vw, 1.22rem);
  line-height: 1.45;
}

.landing-result-preview p,
.landing-disclaimer,
.landing-auth-intro p {
  color: #aebbd1;
  line-height: 1.55;
}

.landing-result-preview p {
  margin: 8px 0 0;
}

.landing-disclaimer {
  max-width: 720px;
  margin: 16px 0 0;
  font-size: 0.86rem;
}

.landing-auth-panel {
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(160, 180, 218, 0.2);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(26, 31, 50, 0.96), rgba(12, 28, 42, 0.95));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.landing-auth-intro h2 {
  margin: 8px 0 4px;
  font-size: clamp(1.38rem, 2vw, 1.75rem);
}

.landing-auth-intro p {
  margin: 0 0 16px;
}

.landing-auth-panel .auth-shell {
  width: 100%;
  min-height: 0;
}

.landing-auth-panel .auth-card {
  padding: 20px;
  border-color: rgba(151, 173, 216, 0.2);
  background: rgba(12, 17, 31, 0.72);
  box-shadow: none;
}

.landing-auth-panel .auth-card h2 {
  margin-top: 0;
}

.seo-panel .seo-card,
.seo-panel .seo-faq-item,
.seo-panel .seo-guide-card {
  border-color: rgba(135, 160, 205, 0.18);
  color: #e9eef8;
  background: linear-gradient(150deg, rgba(27, 33, 55, 0.92), rgba(13, 30, 43, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.seo-panel :where(.seo-card, .seo-faq-item, .seo-guide-card) p {
  color: #bac5d8;
}

.seo-panel .seo-guide-card h3 a,
.seo-panel .seo-guide-link {
  color: #f4f7fd;
}

.seo-card-number {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border: 1px solid rgba(79, 204, 255, 0.35);
  border-radius: 12px;
  color: #66ddff;
  background: rgba(38, 151, 207, 0.1);
  font-size: 0.79rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.landing-hero :where(button, a):focus-visible,
.seo-panel :where(button, a):focus-visible {
  outline: 3px solid #75e4ff;
  outline-offset: 3px;
}

@media (max-width: 960px) {
  #authSection.landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-auth-panel {
    width: 100%;
  }
}

@media (max-width: 640px) {
  #authSection.landing-hero {
    padding: 23px 18px;
    gap: 26px;
  }

  .landing-hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
    letter-spacing: -0.035em;
  }

  .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-result-preview {
    padding: 16px;
  }

  .landing-auth-panel {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .landing-auth-panel .auth-card {
    padding: 17px 14px;
  }
}
