/* ===================================================
   SCS Archive — Design System
   Aligned with sonocoseserie.it main site
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
  /* Background */
  --bg-color: #222222;
  --panel-bg: #2a2a2a;
  --panel-bg-hover: #313131;

  /* Borders */
  --border-color: #303030;
  --border-accent: #ff580c;
  --border-silver: #C0C0C0;

  /* Text */
  --text-main: #ffffff;
  --text-muted: #b7b7b7;
  --text-light: #999999;

  /* Accent */
  --accent: #ff580c;
  --accent-hover: #e84e08;

  /* Topic type colors */
  --type-recensione: #ff580c;
  --type-news: #3b82f6;
  --type-wip: #eab308;
  --type-editoriale: #FF0000;
  --type-originals: #10b981;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

/* ---- Reset ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Body ---- */
body {
  font-family: 'Ubuntu', 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Layout ---- */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.utility-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  gap: 0.8rem;
  font-size: 0.85rem;
  margin: 0 0 0.25rem 0;
  width: 100%;
  box-sizing: border-box;
}

.utility-bar .btn {
  margin: 0 !important;
}

.utility-bar .btn-left {
  margin-right: auto !important;
}

/* ---- Panels ---- */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease;
}

/* ---- Header with background image ---- */
.glass-header {
  text-align: left;
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  background: 
    linear-gradient(to right, rgba(34, 34, 34, 0.92), rgba(34, 34, 34, 0.75)),
    url('img/background_2020.jpg') center/cover no-repeat;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-logo {
  width: 76px;
  height: 76px;
  border-radius: 0;
  flex-shrink: 0;
}

.glass-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
  color: var(--text-main);
  position: relative;
  display: inline-block;
}

.glass-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 3rem;
  padding: 2rem;
  background:
    linear-gradient(to right, rgba(34, 34, 34, 0.92), rgba(34, 34, 34, 0.78)),
    url('img/background_2020.jpg') center bottom/cover no-repeat;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  opacity: 0.9;
}

.footer-brand span {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.footer-text {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 300;
}

.footer-text a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-text a:hover {
  color: var(--text-main);
}

/* ---- Controls / Filters ---- */
.controls {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-bar input[type="text"] {
  width: 100%;
}

input[type="text"], select {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 300;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

select option {
  background-color: var(--bg-color);
  color: var(--text-main);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b7b7b7' d='M6 8.4L1.2 3.6h9.6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 88, 12, 0.15);
}

input[type="text"]::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

/* ---- Buttons ---- */
.btn {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-main);
  background: var(--bg-color);
  margin: 0;
}

.btn:hover {
  border-color: var(--border-silver);
  background: var(--panel-bg-hover);
  transform: translateY(-1px);
}

/* Primary button — orange */
.primary-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
}
.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 88, 12, 0.3);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ---- Topics Grid ---- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.topic-card {
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ---- Badge / Pill ---- */
.badge {
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.type-recensione { background-color: var(--type-recensione); }
.type-news { background-color: var(--type-news); }
.type-wip { background-color: var(--type-wip); }
.type-editoriale { background-color: var(--type-editoriale); }
.type-originals { background-color: var(--type-originals); }
.type-product { background-color: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; }
.type- { background-color: #64748b; }

.episode-code {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Ubuntu Mono', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
}

/* ---- Certification Badges ---- */
.cert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  box-shadow: 0 0 15px rgba(0,0,0,0.6);
  z-index: 5;
  flex-shrink: 0;
}

.cert-badge:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
}

.topic-card .cert-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.cert-ai {
  background: #ef4444; /* Solid Red */
  color: #ffffff;
}

.cert-verified {
  background: #10b981; /* Solid Green */
  color: #ffffff;
}

.cert-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-icon svg {
  width: 100%;
  height: 100%;
  stroke: #ffffff;
}

.cert-tooltip {
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 200px;
  padding: 0.75rem;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 100;
  pointer-events: none;
  text-align: center;
  font-weight: 400;
}

.cert-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #1e1e1e transparent transparent transparent;
}

.cert-badge:hover .cert-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Certification Modal ---- */
.cert-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 2rem;
}

.cert-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.cert-modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cert-modal-overlay.show .cert-modal-content {
  transform: translateY(0);
}

@media (max-width: 600px), (max-height: 750px) {
  .cert-modal-overlay {
    padding: 1rem;
    align-items: flex-start;
    overflow-y: auto;
  }

  .cert-modal-content {
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: none;
  }

  .cert-modal-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .monkey-item {
    padding: 0.85rem;
  }

  .monkey-item h4 {
    font-size: 0.95rem;
  }

  .monkey-item p {
    font-size: 0.8rem;
  }
}

.cert-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.cert-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.cert-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-align: center;
}

.cert-modal-grid {
  display: grid;
  gap: 2rem;
}

.cert-modal-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.cert-modal-item .cert-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
}

.cert-modal-item .cert-icon svg {
  width: 20px;
  height: 20px;
}

.cert-modal-text h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #ffffff;
}

.cert-modal-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 300;
}

/* ---- Monkey Scale Modal ---- */
.monkey-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.monkey-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.monkey-item.active {
  border-color: var(--accent);
  background: rgba(255, 88, 12, 0.08);
  box-shadow: 0 0 15px rgba(255, 88, 12, 0.1);
  position: relative;
}

.monkey-item.active::after {
  content: 'VOTO CORRENTE';
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.monkey-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.monkey-item.active h4 {
  color: var(--accent);
}

.monkey-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.monkey-score:hover {
  border-color: var(--accent);
  background: rgba(255, 88, 12, 0.05);
}

.topic-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.35;
  color: var(--text-main);
}

.synopsis {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  flex-grow: 1;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ---- Scores ---- */
.scores {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.score {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  min-width: 64px;
  text-align: center;
}

.topic-card .score {
  flex: 1;
}

.score-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.score-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.score-max {
  font-size: 0.75rem;
  opacity: 0.4;
  margin-left: 1px;
  font-weight: 300;
}

.score-segments {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.score-segment {
  height: 3px;
  width: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.score-segment.filled {
  background: #a6a6a6;
}

.score-segment.half::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: #a6a6a6;
}

/* ---- Tags ---- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--panel-bg);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: var(--border-silver);
  color: var(--text-main);
}

/* ---- Pagination ---- */
.pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
}

.page-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
}

/* ---- No Results ---- */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.no-results h3 {
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-weight: 700;
}

/* ---- Loading spinner ---- */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-weight: 300;
}
.loading::after {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 1rem auto;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ==============================================================
   Detail Page
   ============================================================== */

.detail-page .glass-header {
  padding: 2rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.back-btn {
  margin-bottom: 1.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  font-weight: 400;
}
.back-btn:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent);
  transform: translateX(-4px);
}

.title-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.main-title {
  font-size: 2.2rem;
  font-weight: 700;
}

.content-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.text-content {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.text-content h3, .meta-panel h3, .links-panel h3 {
  margin-bottom: 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}

.links-panel h3 {
  margin: 1.5rem 1.5rem 1.2rem 1.5rem;
}


.text-content p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1rem;
  font-weight: 300;
}

.text-content.highlight {
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Meta / Links panels ---- */
.meta-panel {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}



.links-panel {
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
}



.links-thumb {
  aspect-ratio: 16 / 9;
  width: 90%;
  margin: 1.5rem auto 0 auto;
  background-size: cover;
  background-position: center;
  background-color: var(--panel-bg);
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.links-thumb .header-overlay {
  display: none; /* Rimosso overlay testo per evitare sovrapposizioni */
}

.links-panel .external-links {
  padding: 1.5rem;
}

.big-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.big-scores .score {
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius-md);
}
.big-scores .score-val {
  font-size: 2.2rem;
}

.big-scores .score-max {
  font-size: 1rem;
  margin-left: 2px;
}

.big-scores .score-segments {
  margin-top: 8px;
  gap: 5px;
}

.big-scores .score-segment {
  height: 5px;
  width: 24px;
}

/* ---- External Links (pill style, SCS main site) ---- */
.external-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.links-description {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-weight: 500;
  padding: 0;
}

.links-description strong {
  color: var(--accent);
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.link-btn:hover {
  border-color: var(--border-silver);
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.link-btn .link-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.link-btn:hover .link-icon {
  transform: scale(1.1);
}

.link-btn .link-icon svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.link-btn.spotify .link-icon  { background: #1DB954; }
.link-btn.apple .link-icon    { background: #ab47bc; }
.link-btn.youtube .link-icon  { background: #FF0000; }
.link-btn.gdrive .link-icon   { background: #4285F4; }


/* ==============================================================
   Episodes Table (embedded in episodes pages)
   ============================================================== */

.ep-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: flex-end;
}
.ep-filters select {
  width: auto;
  min-width: 150px;
  padding: 0.6rem 1rem;
}
.ep-filters .btn {
  padding: 0.6rem 1.2rem;
}
.filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.filter-group {
  display: flex;
  flex-direction: column;
}

.episodes-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-main);
}
.episodes-table th, .episodes-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.episodes-table th {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.episodes-table tr {
  transition: background 0.15s ease;
}
.episodes-table tr:hover td {
  background-color: rgba(255, 88, 12, 0.04);
}

/* ---- Status badges ---- */
.status-badge {
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 300;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}
.status-empty {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* ---- Link Indicators ---- */
.link-indicators { display: flex; gap: 0.4rem; }
.link-ind {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 0.65rem; font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.15s ease;
  text-transform: uppercase;
}
.link-ind:hover { transform: scale(1.15); }
.link-ind.ok {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}
.link-ind.nf {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
  opacity: 0.7;
}
.link-ind.missing {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.2);
  border-style: dashed;
}

/* ---- Action Button ---- */
.action-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
}
.action-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(255, 88, 12, 0.25);
}
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


.filter-toggle-btn {
  background: transparent;
  border-color: var(--border-color);
}

.filter-toggle-btn.active {
  background: rgba(255, 88, 12, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
}

.filters.show {
  max-height: 200px;
  opacity: 1;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==============================================================
   Sidebar Rankings
   ============================================================== */
.main-content-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.main-column {
  flex: 1;
  min-width: 0; 
}

.sidebar-column {
  width: 320px;
  flex-shrink: 0;
}

.sidebar-sticky-wrapper {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ranking-box {
  --box-color: var(--accent); /* Default fallback */
  padding: 1.5rem;
  background: color-mix(in srgb, var(--box-color) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--box-color) 20%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--box-color) 5%, transparent);
}

.lucky-box { --box-color: #eab308; } /* Yellow/Gold */
.box-top5 { --box-color: #10b981; }  /* Emerald Green */
.box-flop5 { --box-color: #ef4444; } /* Red */
.box-mtop { --box-color: #a855f7; }  /* Purple */
.box-mflop { --box-color: #3b82f6; } /* Blue */


.ranking-box h3 {
  font-size: 1rem;
  color: var(--box-color);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
}

.ranking-item:hover {
  background: color-mix(in srgb, var(--box-color) 12%, transparent);
  border-color: var(--box-color);
  transform: translateX(-2px);
}

.ranking-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.ranking-item-score {
  font-weight: 700;
  color: var(--box-color);
}

.lucky-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.lucky-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
  .main-content-wrapper {
    flex-direction: column;
  }
  .sidebar-column {
    width: 100%;
  }
  .sidebar-sticky-wrapper {
    position: static;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }

  .glass-header {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    text-align: left;
  }

  .header-brand {
    gap: 0.75rem;
    justify-content: flex-start;
    padding-right: 80px; /* Spazio per il tasto login a dx */
  }

  .header-logo {
    width: 44px;
    height: 44px;
  }

  .glass-header h1 {
    font-size: 1.15rem; /* Molto più piccolo per stare su una riga */
    line-height: 1.2;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .glass-header p {
    display: block; /* Ripristinato sottotitolo */
    font-size: 0.7rem;
    margin-top: 0.1rem;
    color: var(--text-muted);
  }

  /* Login in alto a destra */
  .header-content nav, .header-nav {
    position: absolute;
    top: -0.2rem;
    right: 0;
    gap: 0.4rem;
  }

  .header-content nav .btn, .header-nav .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
    min-width: 0;
  }

  /* Barra di ricerca su una sola riga */
  .search-bar {
    flex-direction: row;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }

  .search-input-wrapper {
    flex: 1;
    min-width: 0;
  }

  input[type="text"], select {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .btn.filter-toggle-btn, .search-bar .primary-btn {
    padding: 0.5rem 0.6rem;
    flex-shrink: 0;
  }

  .search-bar .primary-btn {
    font-size: 0.7rem;
  }

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

  .main-title {
    font-size: 1.5rem;
  }

  .ep-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .nav-text {
    display: none; /* Nasconde testo paginazione su mobile */
  }

  .hide-mobile {
    display: none !important;
  }

  /* Rendi le tabelle scrollabili orizzontalmente se necessario */
  main.glass-panel {
    overflow-x: auto;
    padding: 1rem !important;
  }

  .episodes-table {
    min-width: 450px; /* Garantisce leggibilità minima */
  }

  .episodes-table th, .episodes-table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* ==============================================================
   Auth — User Badge & Logout (area protetta)
   ============================================================== */

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 88, 12, 0.08);
  border: 1px solid rgba(255, 88, 12, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem 0.35rem 0.6rem;
  transition: border-color 0.2s ease;
}

.user-badge:hover {
  border-color: rgba(255, 88, 12, 0.5);
}

.user-icon {
  font-size: 1rem;
  line-height: 1;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid rgba(255, 88, 12, 0.4);
  color: var(--accent);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: none;
  box-shadow: 0 2px 8px rgba(255, 88, 12, 0.3);
}


/* ==============================================================
   Tabs Component
   ============================================================== */

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}

.tab-link {
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.tab-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-link.active {
  color: var(--accent);
  background: var(--panel-bg);
  border-color: var(--border-color);
  border-bottom-color: var(--panel-bg);
}

/* Management Topics Table (similar to episodes table) */
.topics-table {
  width: 100%;
  border-collapse: collapse;
}

.topics-table th, .topics-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.topics-table th {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.topics-table tr:hover td {
  background-color: rgba(255, 88, 12, 0.04);
}

.topic-title-cell {
  max-width: 300px;
}

.topic-title-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
}

.topic-title-link:hover {
  color: var(--accent);
}

.topic-meta-info {
  display: block;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Management UI */
.mgmt-topic-thumb {
    width: 70px;
    height: 40px;
    background-size: cover;
    background-position: center top;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.mgmt-topic-placeholder {
    width: 70px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
}

.mgmt-cert-badge-wrapper {
    width: 24px;
    height: 24px;
    cursor: default;
    margin: 0 auto;
}

.mgmt-cert-badge-wrapper .cert-icon {
    width: 12px;
    height: 12px;
}

/* Helper for responsive visibility */
.show-mobile { display: none !important; }

@media (max-width: 768px) {
  .show-mobile { display: block !important; }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
  }
}

/* Maintenance Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #f59e0b; }
input:focus + .slider { box-shadow: 0 0 1px #f59e0b; }
input:checked + .slider:before { transform: translateX(22px); }

/* ==============================================================
   Wizard — "Suggerisci una Serie"
   ============================================================== */

.wizard-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Welcome Screen ---- */
.wizard-welcome {
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

.wizard-welcome-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 88, 12, 0.08);
  border: 1px solid rgba(255, 88, 12, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wizard-pulse 2.5s ease-in-out infinite;
}

@keyframes wizard-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 88, 12, 0.15); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 8px rgba(255, 88, 12, 0.08); }
}

.wizard-welcome h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.wizard-welcome p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
  max-width: 460px;
  line-height: 1.6;
}

.wizard-start-btn {
  padding: 0.85rem 2.5rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* ---- Chat Area ---- */
.wizard-chat {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 200px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 800px;
  margin: 0 auto;
}

.wizard-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---- Messages ---- */
.wizard-message {
  display: flex;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-message.show {
  opacity: 1;
  transform: translateY(0);
}

.wizard-message-user {
  justify-content: flex-end;
}

.wizard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 88, 12, 0.1);
  border: 1px solid rgba(255, 88, 12, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wizard-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  padding: 0.85rem 1.15rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  max-width: 85%;
}

.wizard-bubble-user {
  background: rgba(255, 88, 12, 0.12);
  border-color: rgba(255, 88, 12, 0.25);
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  color: var(--text-main);
}

/* ---- Options Grid ---- */
.wizard-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wizard-option-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
}

.wizard-option-btn.show {
  opacity: 1;
  transform: translateY(0);
}

.wizard-option-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 88, 12, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 88, 12, 0.12);
}

.wizard-option-btn:active {
  transform: scale(0.97);
}

/* ---- Loading Dots ---- */
.wizard-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
}

.wizard-loading p {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 300;
}

.wizard-loading-dots {
  display: flex;
  gap: 4px;
}

.wizard-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: wizard-dot-bounce 1.2s ease-in-out infinite;
}

.wizard-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.wizard-loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wizard-dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Result Card ---- */
.wizard-result {
  max-width: 1200px;
  margin: 0 auto;
}

.wizard-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  align-items: stretch; /* Default: equal height */
}

/* Se una qualsiasi card ha i dettagli aperti, disabilita lo stretch per evitare l'effetto trascinamento */
.wizard-results-grid:has(details[open]) {
  align-items: start;
}

@media (min-width: 768px) {
  .wizard-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .wizard-results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wizard-result-card {
  padding: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-result-card.show {
  opacity: 1;
  transform: translateY(0);
}

.wizard-result-header {
  margin-bottom: 1rem;
}

.wizard-result-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(255, 88, 12, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 88, 12, 0.2);
}

.wizard-result-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.wizard-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.wizard-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

.wizard-meta-pill svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.wizard-result-motivation {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}

/* ---- Archive Section ---- */
.wizard-archive {
  margin-bottom: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.wizard-archive h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.wizard-archive-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.wizard-archive-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.wizard-archive-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.wizard-card-thumb {
  width: 100%;
  height: 140px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.wizard-card-body {
  padding: 1rem;
}

/* ---- Feedback Buttons ---- */
.wizard-feedback-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.wizard-fb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid transparent;
  cursor: pointer;
}

.wizard-fb-visto {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.wizard-fb-visto:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

.wizard-fb-dislike {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.wizard-fb-dislike:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
}

.wizard-fb-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.wizard-fb-counter {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  min-width: 22px;
  text-align: center;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wizard-feedback-restart {
  text-align: center;
  padding-top: 0.5rem;
}

.wizard-feedback-note {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Exhausted State ---- */
.wizard-exhausted {
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.wizard-exhausted h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.wizard-exhausted p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  max-width: 400px;
  line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .wizard-container {
    max-width: 100%;
  }

  .wizard-welcome {
    padding: 2rem 1.25rem;
  }

  .wizard-welcome h2 {
    font-size: 1.3rem;
  }

  .wizard-chat {
    padding: 1rem;
    max-height: 60vh;
  }

  .wizard-options {
    grid-template-columns: 1fr;
  }

  .wizard-result-card {
    padding: 1.25rem;
  }

  .wizard-result-title {
    font-size: 1.35rem;
  }

  .wizard-result-meta {
    flex-direction: column;
  }

  .wizard-feedback-btns {
    grid-template-columns: 1fr;
  }

  .wizard-bubble {
    max-width: 95%;
  }
}

/* ---- Wizard Sidebar Box ---- */
.box-wizard { --box-color: #a855f7; }
