/**
 * PsyTarots theme - design system from styles.json
 * Single font: Merienda (sizes and weights only)
 */

@font-face {
  font-family: "MeriendaLocal";
  src: url("../fonts/Merienda-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "MeriendaLocalBold";
  src: url("../fonts/Merienda-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --navbar-height: 64px;
  --footer-height: 56px;

  /* Tokens - radius */
  --radius-xs: 0.375rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 9999px;

  /* Tokens - spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --spacing-3xl: 3rem;

  /* Tokens - shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.14);

  /* Light theme colors */
  --color-bg: #F4F1EA;
  --color-bg-elevated: #FBFAF7;
  --color-paper: #FFFFFF;
  --color-paper-muted: #F8F6F1;
  --color-text: #1E2A38;
  --color-text-muted: #5F6B7A;
  --color-border: rgba(30, 42, 56, 0.12);
  --color-border-strong: rgba(30, 42, 56, 0.18);
  --color-primary: #1E2A38;
  --color-primary-hover: #16202B;
  --color-primary-text: #FFFFFF;
  --color-accent: #C8A95B;
  --color-accent-hover: #B99646;
  --color-accent-text: #1E2A38;
  --color-accent-dim: rgba(200,169,91,0.12);
  --color-accent-glow: rgba(200,169,91,0.06);
  --star-color: rgba(30,42,56,0.55);
  --star-color-accent: rgba(200,169,91,0.65);
  --color-link: #1E2A38;
  --color-link-hover: #0F1720;
  --color-success: #2E7D32;
  --color-warning: #B26A00;
  --color-danger: #B42318;
  --color-info: #2F6F8F;
  --color-overlay: rgba(30, 42, 56, 0.60);

  /* Typography */
  --font: "MeriendaLocal", sans-serif;
  --font-bold: "MeriendaLocalBold", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-size-base: 16px;
  --line-height-body: 1.7;
  --line-height-headings: 1.25;

  /* Body text scale (DM Sans) */
  --text-xs:      0.75rem;   /* badges, chips, tiny uppercase labels */
  --text-sm:      0.875rem;  /* captions, notes, secondary meta */
  --text-base:    1rem;      /* body, standard UI */
  --text-lg:      1.125rem;  /* intro text, lead paragraphs, card titles */
  --text-xl:      1.25rem;   /* prominent text */
  --text-2xl:     1.75rem;   /* display numbers (pricing) */

  /* Extended Merienda display scale */
  --text-3xl:      1.5rem;    /* large decorative section headings */

  /* Icon sizes (Material Icons) */
  --icon-xs:       0.9rem;    /* tiny inline icons within text */
  --icon-sm:       1.125rem;  /* small UI control icons */
  --icon-md:       1.25rem;   /* standard navbar/action icons */
  --icon-hero:     2rem;      /* homepage audience card icons */
  --icon-lg:       1.75rem;   /* section/card feature icons */
  --icon-xl:       2.25rem;   /* hero/feature display icons */
  --icon-arrow:    1.7rem;    /* decorative arrows */
  --icon-arrow-sm: 1.45rem;   /* decorative arrows (responsive) */

  /* Button-specific sizes */
  --text-btn-nav: var(--text-sm);   /* navbar links and buttons */
  --text-btn-cta: var(--text-base); /* homepage CTA buttons */

  /* Focus ring */
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;
  --focus-ring-color: var(--color-accent);
}

/* Dark theme (styles.json themes.dark) */
[data-theme="dark"] {
  --color-bg: #0F1620;
  --color-bg-elevated: #121B26;
  --color-paper: #16202B;
  --color-paper-muted: #141E29;
  --color-text: #E7ECEF;
  --color-text-muted: #A7B2BE;
  --color-border: rgba(231, 236, 239, 0.14);
  --color-border-strong: rgba(231, 236, 239, 0.22);
  --color-primary: #E7ECEF;
  --color-primary-hover: #FFFFFF;
  --color-primary-text: #0F1620;
  --color-accent: #C8A95B;
  --color-accent-hover: #D7B86A;
  --color-accent-text: #0F1620;
  --color-accent-dim: rgba(200,169,91,0.15);
  --color-accent-glow: rgba(200,169,91,0.08);
  --star-color: rgba(231,236,239,0.6);
  --star-color-accent: rgba(200,169,91,0.75);
  --color-link: #E7ECEF;
  --color-link-hover: #FFFFFF;
  --color-success: #5AD07A;
  --color-warning: #F6B74B;
  --color-danger: #FF6B6B;
  --color-info: #78B7D6;
  --color-overlay: rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* Google Fonts - load in base.html */

/* Starfield: floating stars in background */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

[data-theme="dark"] .stars-layer,
[data-theme="light"] .stars-layer {
  opacity: 0.5;
}

.layout-above-starfield {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.stars-layer {
  position: absolute;
  width: 1px;
  height: 1px;
  left: 0;
  top: 0;
  border-radius: 50%;
  box-shadow: var(--star-shadow, none);
  animation: starfield-float 200s linear infinite;
}

.stars-layer::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 1px;
  left: 0;
  top: 2000px;
  border-radius: 50%;
  box-shadow: var(--star-shadow, none);
}

.stars-layer--small { animation-duration: 80s; }
.stars-layer--medium { animation-duration: 160s; }
.stars-layer--big { animation-duration: 240s; }
.stars-layer--xslow { animation-duration: 320s; }

@keyframes starfield-float {
  from { transform: translateY(0); }
  to { transform: translateY(-2000px); }
}

/* Base - Merienda everywhere */
html {
  height: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: var(--line-height-headings);
  color: var(--color-text);
}

code, kbd, samp {
  font-size: var(--text-sm);
}

/* Hero e CTA finale: paragrafi centrati */
.home-hero p,
.home-cta-final p {
  text-align: center;
}

.page-disclaimer {
  text-align: center !important;
}

/* Scroll reveal utility */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

a {
  color: var(--color-link);
}

a:hover {
  color: var(--color-link-hover);
}

.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-text-muted) !important;
}

/* Bootstrap overrides - buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.625rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 160ms ease;
}


/* Accent button */
.btn-accent {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-text);
}

.btn-accent:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

/* Forms */
.form-control, .form-select {
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.875rem;
}

/* Hover e filled: stesso aspetto (sfondo paper-muted) */
.form-control:hover,
.form-control:not(:placeholder-shown),
.form-select:hover,
.form-select:not(:placeholder-shown) {
  background-color: var(--color-paper-muted);
  border-color: var(--color-border-strong);
}

/* Focus: bordo accent, sfondo invariato */
.form-control:focus, .form-select:focus {
  background-color: var(--color-paper-muted);
  border-color: var(--color-accent);
  color: var(--color-text);
  box-shadow: 0 0 0 3px rgba(200, 169, 91, 0.25);
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-text {
  color: var(--color-text-muted) !important;
}

/* Password toggle: keep icon perfectly centered in input-group button */
.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-inline: 0.75rem;
}

.password-toggle .material-icons-outlined {
  display: block;
  line-height: 1;
}

/* Autocomplete: stesso stile della compilazione manuale (no sfondo bianco) */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active,
.form-control:autofill,
.form-control:autofill:hover,
.form-control:autofill:focus,
.form-control:autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--color-paper-muted) inset !important;
  box-shadow: 0 0 0 1000px var(--color-paper-muted) inset !important;
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
  caret-color: var(--color-text) !important;
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
}

/* Tema scuro: valori espliciti per evitare che il browser forzi testo nero sull'autofill */
[data-theme="dark"] .form-control:-webkit-autofill,
[data-theme="dark"] .form-control:-webkit-autofill:hover,
[data-theme="dark"] .form-control:-webkit-autofill:focus,
[data-theme="dark"] .form-control:-webkit-autofill:active,
[data-theme="dark"] .form-control:autofill,
[data-theme="dark"] .form-control:autofill:hover,
[data-theme="dark"] .form-control:autofill:focus,
[data-theme="dark"] .form-control:autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #141E29 inset !important;
  box-shadow: 0 0 0 1000px #141E29 inset !important;
  color: #E7ECEF !important;
  -webkit-text-fill-color: #E7ECEF !important;
  caret-color: #E7ECEF !important;
}

/* Cards - text follows theme */
.card,
.card p,
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
  color: var(--color-text);
}

.card .text-muted {
  color: var(--color-text-muted) !important;
}

.card {
  background-color: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
}

.alert-info {
  background-color: rgba(47, 111, 143, 0.10);
  border-color: rgba(47, 111, 143, 0.22);
  color: var(--color-text);
}

.alert-success {
  background-color: rgba(46, 125, 50, 0.10);
  border-color: rgba(46, 125, 50, 0.22);
  color: var(--color-text);
}

.alert-warning {
  background-color: rgba(178, 106, 0, 0.12);
  border-color: rgba(178, 106, 0, 0.26);
  color: var(--color-text);
}

.alert-danger {
  background-color: rgba(180, 35, 24, 0.12);
  border-color: rgba(180, 35, 24, 0.26);
  color: var(--color-text);
}

/* Navbar */
.navbar {
  background-color: var(--color-bg-elevated) !important;
  border-bottom: 1px solid var(--color-border);
  min-height: 64px;
}

.site-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-main {
  flex: 1;
  padding-top: var(--navbar-height);
}

.site-footer {
  min-height: var(--footer-height);
  background-color: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border) !important;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.5rem;
  min-height: var(--footer-height);
  padding: 0.4rem 0;
}

.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.site-footer-favicon {
  width: 14px;
  height: 14px;
}

.site-footer-title {
  font-family: var(--font-bold);
  font-size: var(--text-sm);
  font-weight: 700;
}

.site-footer-sep {
  opacity: 0.5;
  line-height: 1;
}

.site-footer-address {
  display: contents;
  font-style: normal;
}

.site-footer-nav {
  display: contents;
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  font-family: var(--font);
  font-weight: 700;
  color: var(--color-text);
}

.navbar-brand:hover {
  color: var(--color-text);
}

/* Logo: accent color (styles.json accent) via mask */
.navbar-brand-logo {
  display: inline-block;
  width: 40px;
  height: 40px;
  background-color: var(--color-accent);
  -webkit-mask: var(--logo-url) no-repeat center;
  mask: var(--logo-url) no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

/* Navbar actions: user + settings, aligned right */
.navbar-actions {
  gap: 0.25rem;
  position: relative;
}

.options-dropdown {
  position: relative;
}

.options-hint {
  position: absolute;
  right: calc(100% + 0.2rem);
  top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
  z-index: 4;
  width: 6rem;
}

.options-hint-text {
  display: inline-block;
  transform: rotate(10deg);
  transform-origin: right top;
  font-size: var(--text-sm);
  line-height: 1.05;
  color: var(--color-text-muted);
  white-space: normal;
  text-align: center;
}

.options-hint-arrow-icon {
  position: absolute;
  right: -1.4rem;
  top: 0.2rem;
  font-size: var(--icon-arrow);
  line-height: 1;
  color: var(--color-accent);
  transform: rotate(120deg);
  transform-origin: center;
}

/* Icon-only buttons: same size, no caret */
.navbar-icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: none;
  transition: all 0.18s ease;
}

.navbar-icon-btn .material-icons {
  font-size: var(--icon-md);
}

.navbar-icon-btn:hover,
.navbar-icon-btn:focus-visible {
  border-color: var(--color-border-strong) !important;
  color: var(--color-text) !important;
  background: var(--color-paper-muted) !important;
}

.navbar-icon-btn:focus-visible {
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(200, 169, 91, 0.25);
}

.nav-link {
  font-size: var(--text-btn-nav);
  color: var(--color-text-muted);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text);
}

/* Navbar active link indicator */
.navbar .nav-link.active {
  border-bottom: 2px solid var(--color-accent);
}

/* Landing page navbar links */
.navbar-landing-links {
  gap: 0.15rem;
}

.navbar-landing-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease;
}

.navbar-landing-link:hover {
  color: var(--color-text);
  background: var(--color-accent-dim);
}

.site-navbar .btn {
  font-size: var(--text-btn-nav);
}

/* Options panel (settings dropdown) - adapts to theme */
.dropdown-menu.options-panel {
  background-color: var(--color-paper) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

.options-panel .options-panel-title,
.options-panel .options-label,
.options-panel .dropdown-item {
  color: var(--color-text);
}

.options-panel .dropdown-item:hover {
  background-color: var(--color-paper-muted);
  color: var(--color-text);
}

.options-panel .dropdown-item {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  margin-bottom: 0.25rem;
  transition: all 160ms ease;
}

.options-panel .dropdown-item:last-child {
  margin-bottom: 0;
}

.options-panel .dropdown-item:hover,
.options-panel .dropdown-item:focus,
.options-panel .dropdown-item.active,
.options-panel .dropdown-item:active {
  background-color: var(--bs-secondary) !important;
  border-color: var(--bs-secondary) !important;
  color: #fff !important;
}

.options-panel .dropdown-divider {
  border-color: var(--color-border);
}

.options-panel .dropdown-item .material-icons {
  font-size: var(--icon-sm);
}

.options-panel .dropdown-item .material-icons-outlined {
  font-size: var(--icon-sm);
}

.options-panel .options-label.text-muted {
  color: var(--color-text-muted) !important;
}

.options-panel {
  min-width: 200px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.options-panel-title {
  font-weight: 600;
  color: var(--color-text);
}

/* Generic dropdown menus: rounded items + theme hover (avoid default blue) */
.dropdown-menu {
  --bs-dropdown-border-radius: var(--radius-xl);
  --bs-dropdown-link-active-bg: var(--bs-secondary);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-hover-bg: var(--bs-secondary);
  --bs-dropdown-link-hover-color: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background-color: var(--color-paper);
  color: var(--color-text);
}

.dropdown-menu .dropdown-item {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  margin-bottom: 0.25rem;
  color: var(--color-text);
  transition: all 160ms ease;
}

.dropdown-menu .dropdown-item:last-child {
  margin-bottom: 0;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
  background-color: var(--bs-secondary) !important;
  border-color: var(--bs-secondary) !important;
  color: #fff !important;
}

/* Selects: softer rounded shape + themed option colors */
.form-select {
  border-radius: var(--radius-pill) !important;
  background-color: var(--color-paper);
  border-color: var(--color-border);
}

.form-select:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(200, 169, 91, 0.25) !important;
}

/* Bootstrap input-group normally squares controls; force rounded select too */
.input-group > .form-select,
.input-group .form-select {
  border-radius: var(--radius-pill) !important;
}

.form-select option {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.options-theme-btn,
.options-lang-btn {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: none;
  font-size: var(--text-sm);
  transition: all 0.18s ease;
}

.options-theme-btn .material-icons {
  font-size: var(--icon-sm);
}

.options-theme-btn:hover,
.options-lang-btn:hover {
  border-color: var(--color-border-strong) !important;
  color: var(--color-text) !important;
  background: var(--color-paper-muted) !important;
}

.options-theme-btn:focus-visible,
.options-lang-btn:focus-visible {
  border-color: var(--color-border-strong) !important;
  color: var(--color-text) !important;
  background: var(--color-paper-muted) !important;
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(200, 169, 91, 0.25);
}

.options-theme-btn.active,
.options-lang-btn.active {
  background-color: var(--color-accent-dim);
  border-color: rgba(200, 169, 91, 0.35);
  color: var(--color-text);
}

.options-theme-btn.active:hover,
.options-theme-btn.active:focus-visible,
.options-lang-btn.active:hover,
.options-lang-btn.active:focus-visible {
  background-color: var(--color-accent-dim) !important;
  border-color: rgba(200, 169, 91, 0.35) !important;
  color: var(--color-text) !important;
}

/* Pricing cards (Piattaforma Z style) */
.home-pricing-cards {
  margin-top: 0.5rem;
}

.home-pricing-card {
  padding: 1.25rem;
  height: 100%;
  background: color-mix(in oklch, var(--color-text) 6%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--color-text) 10%, transparent);
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.home-pricing-card:hover {
  border-color: rgba(200,169,91,0.35);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(200,169,91,0.08);
}

.home-pricing-card--highlight {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px color-mix(in oklch, var(--color-accent) 25%, transparent);
}

.home-pricing-card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.home-pricing-card--highlight .home-pricing-card-title {
  color: var(--color-accent);
}

.home-pricing-card-price {
  margin: 0 0 0.15rem;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.home-pricing-card-price-unit {
  margin: 0 0 0.25rem;
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

.home-pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  flex: 1;
}

.home-pricing-features li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.4rem;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  opacity: 0.95;
}

.home-pricing-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
  font-size: var(--text-base);
}

.home-pricing-cta {
  margin-top: auto;
  width: 100%;
  text-align: center;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* Hero logo: accent color, left of title */
.hero-logo {
  display: inline-block;
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--color-accent);
  -webkit-mask: var(--logo-url) no-repeat center;
  mask: var(--logo-url) no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

.hero-logo-cards {
  display: inline-block;
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--color-accent);
  -webkit-mask: var(--psaicards-logo-url) no-repeat center;
  mask: var(--psaicards-logo-url) no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

/* Home: intro block senza box, centrato su sfondo */
.home-intro {
  max-width: 42rem;
  text-align: justify;
  line-height: 1.7;
  font-size: var(--text-base);
}

/* Sezione identita: carta Il Matto in background, destra, ruotata +20deg */
.home-identity-section {
  position: relative;
  overflow: visible;
}

.home-identity-section::before {
  content: "";
  position: absolute;
  left: 78%;
  top: 50%;
  width: min(55%, 320px);
  aspect-ratio: 63/88;
  background: url("../img/cards/00-TheFool.png") no-repeat center;
  background-size: contain;
  transform: translate(-50%, -50%) rotate(20deg);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.home-identity-section > * {
  position: relative;
  z-index: 1;
}

/* Home sections use full-width body text (avoid apparent empty second column) */
.home-page .section-body {
  max-width: none;
}

.home-how-steps {
  position: relative;
}

.home-how-steps::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.6rem;
  bottom: 1.6rem;
  width: 2px;
  background: color-mix(in oklch, var(--color-accent) 35%, transparent);
}

.home-how-step {
  position: relative;
  margin-bottom: 0.85rem;
}

.home-how-step .card {
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.home-how-step .card:hover {
  border-color: rgba(200,169,91,0.35);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(200,169,91,0.10);
}

.home-how-step:last-child {
  margin-bottom: 0;
}

.home-how-step-index {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #1f1f1f;
  font-weight: 700;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.home-story-section {
  position: relative;
}

.home-story-card {
  position: relative;
  padding: clamp(1.1rem, 2.8vw, 2rem);
  border: 1px solid color-mix(in oklch, var(--color-accent) 30%, var(--color-border));
  border-left: 4px solid color-mix(in oklch, var(--color-accent) 78%, var(--color-border));
  border-radius: var(--radius-xl);
  background:
    linear-gradient(
      145deg,
      color-mix(in oklch, var(--color-bg-elevated) 86%, transparent),
      color-mix(in oklch, var(--color-paper) 86%, transparent)
    );
  box-shadow:
    0 16px 32px color-mix(in oklch, var(--color-text) 8%, transparent),
    inset 0 1px 0 color-mix(in oklch, white 12%, transparent);
  overflow: hidden;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.home-story-card:hover {
  border-color: rgba(200,169,91,0.5);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(200,169,91,0.10);
}

.home-story-card::after {
  content: "";
  position: absolute;
  top: -35%;
  right: -8%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(
    closest-side,
    color-mix(in oklch, var(--color-accent) 18%, transparent),
    transparent 72%
  );
  pointer-events: none;
}

.home-story-section--why .home-story-card {
  border-left-color: color-mix(in oklch, var(--color-success) 65%, var(--color-border));
}

.home-collaboration-card {
  justify-content: center;
  min-height: 170px;
}

.home-collaboration-card .home-pricing-card-title {
  margin-bottom: 0.6rem;
}

@media (max-width: 991.98px) {
  .options-hint {
    right: calc(100% + 0.1rem);
    top: 2.3rem;
    width: 5.4rem;
  }

  .options-hint-text {
    font-size: var(--text-xs);
  }

  .options-hint-arrow-icon {
    right: -1.25rem;
    top: 0.15rem;
    font-size: var(--icon-arrow-sm);
  }
}

@media (max-width: 768px) {
  .home-identity-section::before {
    left: 86%;
    top: 34%;
    width: min(38%, 180px);
    opacity: 0.14;
  }

  .home-how-steps::before {
    left: 0.85rem;
  }

  .home-story-card::after {
    width: 160px;
    height: 160px;
    right: -14%;
  }
}

.card p {
  text-align: left;
}

/* Login: carta Il Mago in background a sinistra, ruotata -20deg */
.login-page-section {
  position: relative;
  overflow: visible;
}

.login-page-section::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 50%;
  width: min(55%, 320px);
  aspect-ratio: 63/88;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%) rotate(-20deg);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.login-page-section .row {
  position: relative;
  z-index: 1;
}

.login-intro,
.register-intro {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
  font-size: var(--text-lg);
  text-align: justify;
  position: relative;
  z-index: 1;
}

/* Register: carta La Stella in background a sinistra, ruotata -20deg (stesso stile login) */
.register-page-section {
  position: relative;
  overflow: visible;
}

.register-page-section::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 50%;
  width: min(55%, 320px);
  aspect-ratio: 63/88;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%) rotate(-20deg);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.register-page-section .row {
  position: relative;
  z-index: 1;
}

/* Dashboard: intro with role card on the right, rotated +20deg */
.dashboard-intro-section {
  position: relative;
  overflow: visible;
}

.dashboard-intro-section::before {
  content: "";
  position: absolute;
  left: 78%;
  top: 50%;
  width: min(55%, 320px);
  aspect-ratio: 63/88;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%) rotate(20deg);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.dashboard-intro-section-inner {
  position: relative;
  z-index: 1;
}

.dashboard-intro {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
  font-size: var(--text-lg);
  text-align: justify;
}

.list-group-item {
  background-color: var(--color-paper);
  color: var(--color-text);
  border-color: var(--color-border);
}

.list-group-item:hover {
  background-color: var(--color-paper-muted);
  color: var(--color-text);
}

.reading-list-item {
  padding: 0.9rem 1rem;
  cursor: pointer;
}


.reading-list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.reading-list-item-row-bottom {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.reading-list-title {
  min-width: 0;
  word-break: break-word;
  font-weight: 600;
  color: var(--color-text);
}

.reading-list-datetime {
  white-space: nowrap;
}

.reading-list-owner {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.reading-status-badge {
  white-space: nowrap;
}

/* Modal errori registrazione: in alto, tema progetto, non blocca il resto */
.modal-dialog-top {
  margin-top: calc(var(--navbar-height) + 1.5rem);
  margin-right: auto;
  margin-left: auto;
  align-self: flex-start;
}

.modal .modal-dialog-top {
  max-width: 480px;
  max-height: calc(100vh - var(--navbar-height) - 1rem);
}

/* Modal errori auth (login/register): in alto, tema, non blocca, click fuori chiude */
.auth-errors-modal-theme .modal-content {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-height: inherit;
  overflow-y: auto;
}

.auth-errors-modal-theme .modal-header {
  border-bottom: none;
}

.auth-errors-modal-theme .modal-header .modal-title {
  color: var(--color-text);
  font-weight: 600;
}

[data-theme="dark"] .auth-errors-modal-theme .btn-close {
  filter: invert(1);
}

.auth-errors-list {
  color: var(--color-danger);
  list-style: none;
  padding-left: 0;
}

#global-feedback-modal .auth-errors-list {
  color: var(--color-text);
}

#global-feedback-modal .auth-errors-list.feedback-list-danger {
  color: var(--color-danger);
}

.admin-users-table-wrap {
  background-color: var(--color-paper);
  border: 1px solid var(--color-border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-users-table {
  --bs-table-bg: var(--color-paper);
  --bs-table-color: var(--color-text);
  --bs-table-striped-bg: var(--color-paper-muted);
  --bs-table-striped-color: var(--color-text);
  --bs-table-hover-bg: var(--color-paper-muted);
  --bs-table-hover-color: var(--color-text);
  --bs-table-border-color: var(--color-border);
  min-width: 980px;
}

.admin-users-table thead th {
  background-color: var(--color-bg-elevated);
  color: var(--color-text);
  border-bottom-color: var(--color-border);
  white-space: nowrap;
}

.admin-users-table td,
.admin-users-table th {
  border-color: var(--color-border);
}

.admin-icon-btn {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: all 160ms ease;
}

.admin-icon-btn:hover {
  background: var(--color-paper-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.admin-icon-btn-danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.admin-icon-btn-danger:hover {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

.admin-icon-btn .material-icons-outlined {
  font-size: var(--icon-sm);
  line-height: 1;
}

.admin-verified-true {
  color: var(--color-success);
}

.admin-verified-false {
  color: var(--color-danger);
}

.admin-subscription-active {
  color: var(--color-success);
  font-weight: 600;
}

.admin-subscription-inactive {
  color: var(--color-danger);
  font-weight: 600;
}

.admin-actions-cell {
  white-space: nowrap;
}

/* Modal auth: non blocca la pagina, permette click-through */
.auth-errors-modal-theme.modal {
  pointer-events: none;
}

.auth-errors-modal-theme .modal-dialog {
  pointer-events: auto;
}

/* =============================================
   LANDING PAGE
============================================= */

/* Hero */
.landing-hero {
  min-height: calc((100vh - var(--navbar-height)) / 1.2);
  display: flex;
  align-items: center;
  padding: 2rem 0 2rem;
}

.landing-tagline {
  font-family: var(--font);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.landing-product-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.landing-product-mark {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}

.landing-product-title {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
}

.landing-lead {
  font-family: var(--font);
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.landing-body-copy {
  font-size: 0.95rem;
  line-height: 1.5;
}

.landing-check-list {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.landing-check-icon {
  font-size: 1rem;
  color: var(--color-accent);
  margin-top: 2px;
}

.landing-phone-visual {
  width: 90%;
  max-width: 300px;
  opacity: 0.55;
}

.landing-scroll-link {
  font-size: 0.85rem;
  text-decoration: none;
}

.landing-scroll-link .material-icons-outlined {
  font-size: 1.1rem;
}

.landing-accent-icon {
  font-size: var(--icon-hero);
  color: var(--color-accent);
}

.landing-card-min-height {
  min-height: 180px;
}

.landing-card-thumb {
  width: 80px;
}

.landing-beta-summary-card {
  justify-content: flex-start;
}

.landing-beta-summary-card .landing-check-list {
  margin-bottom: 0;
}

.landing-accent-copy {
  color: var(--color-accent);
}

.landing-form-legend {
  font-size: 1rem;
  font-weight: 400;
}

.page-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.contact-action-group {
  width: 100%;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.contact-action-group .btn-primary,
.contact-action-group .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  min-height: 3.25rem;
  box-sizing: border-box;
  text-align: center;
  line-height: 1;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .contact-action-group {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
  }

  .contact-action-group .btn-primary,
  .contact-action-group .btn-secondary {
    flex: 1 1 0;
    width: 0;
    max-width: none;
  }
}

.hero-title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.6s ease both;
}

.landing-hero .hero-logo {
  width: 10.5rem;
  height: 10.5rem;
}

.home-hero .hero-logo {
  width: clamp(6rem, 15vw, 10.5rem);
  height: clamp(6rem, 15vw, 10.5rem);
}

.dashboard-intro-section .hero-logo {
  width: clamp(6rem, 15vw, 10.5rem);
  height: clamp(6rem, 15vw, 10.5rem);
}

.landing-hero .landing-product-lockup .hero-logo-cards {
  width: clamp(5rem, 9vw, 5.8rem);
  height: clamp(5rem, 9vw, 5.8rem);
}

.home-hero .hero-logo-cards {
  width: clamp(6rem, 15vw, 10.5rem);
  height: clamp(6rem, 15vw, 10.5rem);
}

.dashboard-intro-section .hero-logo-cards {
  width: clamp(6rem, 15vw, 10.5rem);
  height: clamp(6rem, 15vw, 10.5rem);
}

.hero-main-title {
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(2.6rem, 5.8vw, 4.2rem);
  color: var(--color-text);
  margin-bottom: 0;
  letter-spacing: -0.5px;
}

.hero-tagline {
  margin-top: 0.55rem;
  max-width: 720px;
  font-size: clamp(0.95rem, 1.7vw, 1.12rem);
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hero-headline {
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-headline .accent-line {
  color: var(--color-accent);
  display: block;
}

.hero-sub {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 520px;
  margin-bottom: 4rem;
  font-weight: 400;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.cta-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 40rem;
  margin: 1.5rem auto 0;
  align-items: center;
}

.cta-btn-group .btn-primary,
.cta-btn-group .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  min-height: 3.25rem;
  box-sizing: border-box;
  text-align: center;
  line-height: 1;
  margin: 0 auto;
}

@media (min-width: 576px) {
  .cta-btn-group {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
  }

  .cta-btn-group .btn-primary,
  .cta-btn-group .btn-secondary {
    flex: 1 1 0;
    width: 0;
    max-width: none;
  }
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-accent);
  color: #0F1620;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-btn-cta);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 4px 16px rgba(200,169,91,0.25);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(200,169,91,0.35);
  color: #0F1620;
}

.btn-primary:focus-visible {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(200, 169, 91, 0.28), 0 8px 24px rgba(200,169,91,0.35);
  color: #0F1620;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.btn-lg {
  font-size: var(--text-lg);
  padding: 1rem 2rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-btn-cta);
  padding: calc(0.85rem - 1px) 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-secondary:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  background: var(--color-paper-muted);
}

.btn-secondary:focus-visible {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  background: var(--color-paper-muted);
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(200, 169, 91, 0.25);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-sm);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  transition: all 160ms ease;
}

.btn-outline:hover {
  background: var(--color-paper-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn-outline:focus-visible {
  background: var(--color-paper-muted);
  border-color: var(--color-border-strong);
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(200, 169, 91, 0.25);
}

.hero-social-proof {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.proof-avatars {
  display: flex;
}

.proof-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-bg);
  background: var(--color-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent);
  margin-left: -8px;
}

.proof-avatar:first-child { margin-left: 0; }
.proof-avatar:nth-child(1) { background: #1E3A2F; }
.proof-avatar:nth-child(2) { background: #2A1E3A; }
.proof-avatar:nth-child(3) { background: #3A2A1E; }
.proof-avatar:nth-child(4) { background: #1E2A3A; }
.proof-avatar:nth-child(5) { background: #3A1E2A; }

.proof-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0;
  display: flex;
  align-items: center;
}

/* Hero visual (orbiting rings) */
.hero-visual {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.visual-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--color-accent-dim);
}

.visual-ring-1 { width: 300px; height: 300px; animation: rotate 30s linear infinite; }
.visual-ring-2 { width: 220px; height: 220px; border-style: dashed; animation: rotate 20s linear infinite reverse; border-color: rgba(200,169,91,0.1); }
.visual-ring-3 { width: 140px; height: 140px; animation: rotate 15s linear infinite; border-color: rgba(200,169,91,0.2); }

.visual-ring-1::before,
.visual-ring-2::before,
.visual-ring-3::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--color-accent);
}

.visual-core {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  background: var(--color-accent-dim);
  border: 1px solid rgba(200,169,91,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 900;
  font-size: var(--text-3xl);
  color: var(--color-accent);
}

.visual-orbit-label {
  position: absolute;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.6rem;
}

.orbit-label-1 { top: 30px; right: 30px; color: var(--color-accent); border-color: rgba(200,169,91,0.3); background: var(--color-accent-dim); }
.orbit-label-2 { bottom: 50px; left: 20px; }
.orbit-label-3 { top: 50%; left: 10px; transform: translateY(-50%); }
.orbit-label-4 { bottom: 30px; right: 20px; }

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Section commons */
.landing-problem-section,
.landing-founder-section,
.landing-build-section,
.landing-cta-section {
  padding: 5rem 0;
}

.landing-problem-section {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.landing-founder-section {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.landing-cta-section {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
}

.section-label {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.section-body {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text-muted);
  max-width: 580px;
}

.section-divider {
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  margin: 1.5rem 0;
  border-radius: 2px;
}

/* Pain cards */
.pain-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.pain-card {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.pain-card:hover {
  border-color: rgba(200,169,91,0.35);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(200,169,91,0.10);
}

.pain-card-icon {
  margin-bottom: 0.75rem;
  color: var(--color-accent);
}

.pain-card-icon .material-icons-outlined {
  font-size: var(--icon-lg);
}

.pain-card-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.pain-card-body {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Identity contrast list (NO → SÌ) */
.identity-contrast-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.identity-contrast-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.identity-not {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
  opacity: 0.7;
}

.identity-not .material-icons-outlined {
  font-size: var(--icon-sm);
  color: var(--color-text-muted);
}

.identity-arrow {
  font-size: var(--icon-sm);
  color: var(--color-accent);
  flex-shrink: 0;
}

.identity-yes {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.identity-yes .material-icons-outlined {
  font-size: var(--icon-sm);
  color: var(--color-accent);
}

/* Tools used */
.tools-used {
  margin-top: 3rem;
  padding: 1.75rem;
  background: linear-gradient(135deg, var(--color-paper) 0%, rgba(200,169,91,0.05) 100%);
  border: 1px solid rgba(200,169,91,0.4);
  border-radius: var(--radius-xl);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.tools-used:hover {
  border-color: rgba(200,169,91,0.6);
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(200,169,91,0.12);
}

.tools-used-title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.tools-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-chip {
  padding: 0.3rem 0.75rem;
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.tools-note {
  margin-top: 1rem;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Founder quote */
.founder-quote {
  padding: 2rem 1.75rem;
  background: linear-gradient(135deg, var(--color-paper) 0%, rgba(200,169,91,0.05) 100%);
  border: 1px solid rgba(200,169,91,0.4);
  border-radius: var(--radius-xl);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.founder-quote:hover {
  border-color: rgba(200,169,91,0.6);
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(200,169,91,0.12);
}

.founder-quote-text {
  font-style: italic;
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.founder-quote-name {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-accent);
}

/* Tarot feature */
.cards-feature {
  position: relative;
  background: linear-gradient(135deg, var(--color-paper) 0%, rgba(200,169,91,0.05) 100%);
  border: 1px solid rgba(200,169,91,0.4);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  overflow: hidden;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.cards-feature::after {
  content: "";
  position: absolute;
  left: 72%;
  top: 50%;
  width: min(55%, 260px);
  aspect-ratio: 63/88;
  background: url("../img/cards/00-TheFool.png") no-repeat center;
  background-size: contain;
  transform: translate(-50%, -50%) rotate(20deg);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.cards-feature > * {
  position: relative;
  z-index: 1;
}

.cards-feature::before {
  content: attr(data-badge);
  z-index: 2;
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border: 1px solid rgba(200,169,91,0.3);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.5rem;
}

.cards-feature:not([data-badge])::before,
.cards-feature[data-badge=""]::before {
  content: none;
  display: none;
}

.cards-feature:hover {
  border-color: rgba(200,169,91,0.6);
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(200,169,91,0.12);
}

.cards-feature-icon {
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.cards-feature-icon .material-icons-outlined {
  font-size: var(--icon-xl);
}

.cards-logo-icon {
  display: inline-block;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--color-accent);
  -webkit-mask: var(--psaicards-logo-url, var(--logo-url)) no-repeat center;
  mask: var(--psaicards-logo-url, var(--logo-url)) no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

[data-theme="light"] .cards-logo-icon {
  background-color: var(--color-text);
}

.cards-feature-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.cards-feature-name {
  font-family: var(--font);
  font-weight: 800;
  font-size: var(--text-3xl);
  color: var(--color-text);
  margin-bottom: 1rem;
}

.cards-feature-headline {
  font-size: var(--text-base);
  font-style: italic;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.cards-feature-desc {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text-muted);
  margin: 0;
}

.cards-feature-context {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(200,169,91,0.15);
  margin-bottom: 0;
}

.cards-feature-planned {
  opacity: 0.6;
  pointer-events: none;
}

.cards-feature-planned::after {
  display: none;
}

.cards-feature-no-card::after {
  display: none;
}

.cards-feature-card-major::after {
  background: url("../img/cards/01-TheMagician.png") no-repeat center !important;
  background-size: contain !important;
}

.cards-feature-card-minor::after {
  background: url("../img/cards/Wands02.png") no-repeat center !important;
  background-size: contain !important;
}

.cards-feature-planned::before {
  background: var(--color-text-muted);
  color: var(--color-bg);
}

/* Product cards */
.product-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.product-card:hover {
  border-color: rgba(200,169,91,0.4);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(200,169,91,0.10);
}

.product-card.active-card {
  border-color: rgba(200,169,91,0.35);
  background: linear-gradient(135deg, var(--color-paper) 0%, rgba(200,169,91,0.04) 100%);
}

.product-card.active-card::before {
  content: attr(data-badge);
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border: 1px solid rgba(200,169,91,0.3);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.5rem;
}

.product-card.future-card {
  opacity: 0.6;
}

.product-card.future-card::before {
  content: attr(data-badge);
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-paper-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.5rem;
}

.product-name {
  font-family: var(--font);
  font-weight: 800;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.product-accent {
  color: var(--color-accent);
}

.product-desc {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.product-icon {
  margin-bottom: 0.85rem;
  color: var(--color-accent);
}

.product-icon .material-icons-outlined {
  font-size: var(--icon-lg);
}

/* CTA box */
.cta-box {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.cta-title {
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.cta-sub {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.cta-meta {
  margin-top: 1.25rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cta-meta-icon {
  font-size: var(--text-base);
}

.cta-meta-reward {
  color: var(--color-accent);
  font-weight: 600;
}

.cta-reward-hint {
  position: absolute;
  bottom: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  pointer-events: none;
  z-index: 4;
}

.cta-reward-hint-text {
  display: inline-block;
  transform: rotate(-5deg);
  transform-origin: left bottom;
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.cta-reward-hint-text .material-icons-outlined {
  font-size: var(--icon-xs);
  color: var(--color-accent);
  vertical-align: middle;
}

.cta-reward-hint-arrow {
  font-size: var(--icon-arrow);
  line-height: 1;
  color: var(--color-accent);
  transform: scaleX(-1) rotate(-90deg);
  transform-origin: center;
  margin-left: 0.15rem;
}

.cta-instagram-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.cta-instagram-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.build-method-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.coming-next-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

.cards-no-preview {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  opacity: 0.7;
}

.product-cards-spaced {
  margin-top: 3rem;
}

.build-approach-row {
  margin-top: 2rem;
}


.cards-hero-col {
  position: relative;
  overflow: visible;
}

.cards-hero-col::before {
  content: "";
  position: absolute;
  left: 78%;
  top: 50%;
  width: min(55%, 320px);
  aspect-ratio: 63/88;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%) rotate(20deg);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.cards-home-hero .hero-headline {
  max-width: 760px;
}

.cards-home-sub {
  max-width: 700px;
  margin-bottom: 2.5rem;
}

.cards-feature-home {
  height: 100%;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.1s; }
.reveal-delay-3 { transition-delay: 0.15s; }
.reveal-delay-4 { transition-delay: 0.2s; }
.reveal-delay-5 { transition-delay: 0.25s; }

/* Tile hover lift — re-asserted here to win over .reveal.visible cascade */
.pain-card:hover,
.cards-feature:hover,
.home-pricing-card:hover,
.home-story-card:hover,
.tools-used:hover,
.founder-quote:hover,
.home-how-step .card:hover {
  transform: translateY(-5px);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  transition-delay: 0s;
}

/* Landing animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === SIDEBAR (offcanvas) === */
.site-sidebar {
  --bs-offcanvas-width: 280px;
  background: var(--color-paper);
  border-left: 1px solid var(--color-border);
}

.site-sidebar .offcanvas-header {
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-md) var(--spacing-lg);
}

.site-sidebar .offcanvas-body {
  padding: var(--spacing-md) var(--spacing-sm);
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 0.55rem var(--spacing-md);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-base);
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-nav-item:hover,
.sidebar-nav-item:focus-visible {
  background: var(--color-accent-dim);
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-nav-item.active {
  background: var(--color-accent-dim);
  color: var(--color-accent);
  font-weight: 600;
}

.sidebar-nav-item--accent {
  color: var(--color-accent);
  font-weight: 600;
}

.sidebar-nav-item--accent:hover,
.sidebar-nav-item--accent:focus-visible {
  color: var(--color-accent);
}

.sidebar-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--spacing-sm) var(--spacing-md);
}

/* Landing responsive */
@media (max-width: 767px) {
  .landing-hero { padding: 1.5rem 0 1.25rem; min-height: auto; }
  .hero-visual { height: 260px; margin-top: 2.5rem; }
  .visual-ring-1 { width: 200px; height: 200px; }
  .visual-ring-2 { width: 140px; height: 140px; }
  .visual-ring-3 { width: 90px; height: 90px; }
  .orbit-label-1, .orbit-label-2, .orbit-label-3, .orbit-label-4 { display: none; }
  .landing-problem-section,
  .landing-founder-section,
  .landing-build-section,
  .landing-cta-section { padding: 3.5rem 0; }
  .cards-feature { padding: 1.5rem; }
  .cards-home-sub { margin-bottom: 2rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Reading chat page (reading_resume.html)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Full-viewport layout ───────────────────────────────────────────────── */
/*
 * reading-root is a direct flex column with a fixed viewport height.
 * The card is its only child and fills all available space.
 * No Bootstrap row/col wrappers — they add gutter margins that break
 * the height chain.
 */
body.reading-body {
  overflow: hidden;
  height: 100dvh;
}

body.reading-body .layout-above-starfield {
  min-height: 0;
  height: 100dvh;
  overflow: hidden;
}

body.reading-body .site-main {
  overflow: hidden;
}

.reading-root {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--navbar-height));
  box-sizing: border-box;
  padding: var(--spacing-sm);
  overflow: visible;
}

/* ── Chat card fills remaining height ──────────────────────────────────── */
.reading-chat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Watermark carta corrente (ghost fisso, bottom-right) ───────────────── */
#reading-card-watermark {
  position: absolute;
  left: 82%;
  top: 72%;
  width: min(55%, 300px);
  aspect-ratio: 63/88;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%) rotate(20deg);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.5s ease;
}

#reading-card-watermark.watermark-visible {
  opacity: 0.18;
}

.reading-chat-card .card-header,
.reading-chat-card .card-footer {
  padding: var(--spacing-sm) var(--spacing-md);
}

@media (max-width: 575.98px) {
  .reading-chat-card .card-footer .btn-primary {
    font-size: var(--text-sm);
    padding: 0.65rem 1.1rem;
  }
}

.reading-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
}

.reading-msg-batch {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
}

.reading-msg-batch-pending {
  opacity: 0;
  visibility: hidden;
}

/* ── Card bubble in chat ───────────────────────────────────────────────── */
.reading-msg-card {
  align-self: center;
  text-align: center;
  padding: var(--spacing-md);
  background: var(--color-paper);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(200, 169, 91, 0.35);
  min-width: 200px;
  max-width: 300px;
}

.reading-msg-card--static {
  animation: none;
}

@keyframes card-reveal {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reading-msg-card img {
  width: 180px;
  height: 311px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  display: block;
  margin: 0 auto var(--spacing-md);
}

.reading-msg-card .card-reveal-position {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.reading-msg-card .card-reveal-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-accent);
}

/* ── Message bubbles ────────────────────────────────────────────────────── */
.reading-msg {
  max-width: 85%;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.6;
  white-space: pre-wrap;
}

.reading-msg-ai {
  align-self: flex-start;
  background: var(--color-paper);
  color: var(--color-text);
  border: 1px solid rgba(200, 169, 91, 0.35);
  border-bottom-left-radius: var(--radius-xs);
}

.reading-msg-ai .msg-focus-section {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(200, 169, 91, 0.30);
  color: var(--color-accent);
  font-weight: 500;
  white-space: pre-wrap;
  line-height: 1.6;
}

.reading-msg-ai .msg-closing-section {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--text-base);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* Closing phrase inside card tile (synthesis view) */
.reading-msg-card .msg-closing-section {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(200, 169, 91, 0.30);
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--text-sm);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── Synthesis grid: pain-card overrides for card and summary tiles ─────── */
.reading-msg-card.pain-card {
  min-width: 0;
  max-width: none;
  width: 100%;
  align-self: stretch;
}
.reading-msg-card.pain-card img {
  width: 100%;
  max-width: 160px;
  height: auto;
  aspect-ratio: 180 / 311;
}
.reading-msg-summary.pain-card {
  max-width: none;
  width: 100%;
  align-self: stretch;
}

.reading-msg-user {
  align-self: flex-end;
  background: var(--color-paper);
  color: var(--color-text);
  border: 1px solid rgba(200, 169, 91, 0.35);
  border-bottom-right-radius: var(--radius-xs);
}

.reading-msg-system {
  align-self: center;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-style: italic;
  padding: var(--spacing-xs) 0;
  max-width: 100%;
  text-align: center;
}

/* ── Phase divider (chapter separator between positions) ───────────────── */
.reading-phase-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0 var(--spacing-xs);
  width: 100%;
}

.reading-phase-divider::before,
.reading-phase-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.35;
}

.reading-phase-divider-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: normal;
  text-align: center;
  color: var(--color-accent);
}

/* ── Block summary (milestone card) ────────────────────────────────────── */
.reading-msg-summary {
  align-self: flex-start;
  max-width: 90%;
  background: var(--color-accent-glow);
  border: 1px solid rgba(200, 169, 91, 0.30);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  text-align: left;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
}

/* ── Message reveal animation ───────────────────────────────────────────── */
@keyframes msg-reveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reading-msg-reveal {
  animation: msg-reveal 0.45s ease-out both;
}

.reading-msg-batch-reveal {
  animation: msg-reveal 0.45s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .reading-msg-reveal,
  .reading-msg-batch-reveal { animation: none; }
}

/* ── Input wrapper (textarea + counter + round send button) ────────────── */
.reading-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.reading-textarea {
  resize: none;
  font-size: var(--text-base);
  min-height: 80px;
  background-color: var(--color-paper-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.reading-input-footer {
  padding: 0.35rem 0.75rem;
  background-color: var(--color-paper-muted);
  border: 1px solid var(--color-border-strong);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  min-height: 2.05rem;
}

.reading-textarea:focus {
  background-color: var(--color-paper-muted);
  border-color: var(--color-accent);
  color: var(--color-text);
  box-shadow: none;
}

.reading-input-wrapper:focus-within .reading-textarea,
.reading-input-wrapper:focus-within .reading-input-footer {
  border-color: var(--color-accent);
}

.reading-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.9;
}

.reading-textarea:disabled {
  background-color: var(--color-paper-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text-muted);
  -webkit-text-fill-color: var(--color-text-muted);
  opacity: 1;
}

#reading-char-counter {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  opacity: 0.6;
  pointer-events: none;
  line-height: 1;
}

#reading-send-btn {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 0;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

#reading-send-btn .material-icons {
  font-size: 1.15rem;
  line-height: 1;
}

#reading-send-btn .spinner-border {
  display: none;
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* ── Report block ───────────────────────────────────────────────────────── */
#reading-report-block h4,
#reading-report-block h5,
#reading-report-block h6 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}

#reading-report-block ul {
  padding-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

#reading-report-block p { margin-bottom: var(--spacing-sm); }

.reading-report h4,
.reading-report h5,
.reading-report h6 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-xs);
  color: var(--color-accent);
}

.reading-report ul {
  padding-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.reading-report p { margin-bottom: var(--spacing-sm); }

/* ── Mobile: tighter padding, smaller textarea ──────────────────────────── */
@media (max-width: 991px) {
  .reading-root {
    padding: var(--spacing-xs);
  }
  .reading-chat-messages {
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: var(--spacing-sm);
  }
  .reading-textarea { min-height: 64px; }
}
