/* ───────────────────────────────────────────────
   GINGA CONTENT ENGINE — Design System
   Dark editorial. Football heritage. Streetwear.
─────────────────────────────────────────────── */

/* ── Google Fonts already loaded in HTML ── */

/* ── CSS Custom Properties ── */
:root {
  --black: #080808;
  --black-2: #111111;
  --black-3: #191919;
  --black-4: #222222;
  --grey-1: #2a2a2a;
  --grey-2: #3a3a3a;
  --grey-3: #555555;
  --grey-4: #888888;
  --white: #f0ede8;
  --white-dim: #a09c98;
  --orange: #e85d04;
  --orange-dim: #7a3102;
  --green: #2a9d5c;
  --blue: #3a7bd5;
  --purple: #8866ff;
  --red: #e63946;
  --yellow: #f4a261;

  /* Event type colors */
  --birthday: #f4a261;
  --match: #3a7bd5;
  --anniversary: #8866ff;
  --culture: #2a9d5c;
  --milestone: #e63946;
  --hype: #e85d04;

  --sidebar-w: 260px;
  --panel-w: 440px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.22s ease;
  --font-head: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--black-2);
}

::-webkit-scrollbar-thumb {
  background: var(--grey-2);
  border-radius: 2px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--black-2);
  border-right: 1px solid var(--grey-1);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 24px;
  gap: 32px;
  overflow-y: auto;
  z-index: 10;
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  background: var(--orange);
  color: var(--black);
  font-family: var(--font-head);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  letter-spacing: 0;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--white);
}

.brand-sub {
  font-size: 10px;
  color: var(--grey-4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--grey-4);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  width: 100%;
  text-align: left;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: var(--black-3);
  color: var(--white);
}

.nav-btn.active {
  background: var(--grey-1);
  color: var(--orange);
}

.nav-btn-discover {
  margin-top: 6px;
  border: 1px solid rgba(232, 93, 4, 0.3);
  color: var(--orange) !important;
  background: rgba(232, 93, 4, 0.05) !important;
}

.nav-btn-discover:hover {
  background: rgba(232, 93, 4, 0.12) !important;
  border-color: var(--orange);
}

/* Filters */
.filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--grey-3);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.filter-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tag-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--grey-4);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}

.tag-btn:hover {
  background: var(--black-3);
  color: var(--white);
}

.tag-btn.active {
  background: var(--grey-1);
  color: var(--white);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-birthday {
  background: var(--birthday);
}

.dot-match {
  background: var(--match);
}

.dot-anniversary {
  background: var(--anniversary);
}

.dot-culture {
  background: var(--culture);
}

.dot-milestone {
  background: var(--milestone);
}

.dot-hype {
  background: var(--hype);
}

/* Range */
.range-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.range-btn {
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--grey-2);
  background: transparent;
  color: var(--grey-4);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}

.range-btn:hover {
  border-color: var(--grey-3);
  color: var(--white);
}

.range-btn.active {
  background: var(--grey-1);
  border-color: var(--grey-2);
  color: var(--white);
}

/* Philosophy */
.sidebar-footer {
  margin-top: auto;
}

.philosophy {
  font-size: 11px;
  font-style: italic;
  color: var(--grey-3);
  line-height: 1.7;
  border-left: 2px solid var(--orange-dim);
  padding-left: 12px;
}

/* ── Main Area ── */
.main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1;
  padding: 28px 32px;
}

.hidden {
  display: none !important;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.main-title {
  font-family: var(--font-head);
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--white);
}

.event-count {
  font-size: 12px;
  color: var(--grey-4);
  font-weight: 500;
}

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--black-3);
  border: 1px solid var(--grey-1);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  transition: border-color var(--transition);
}

.search-box:focus-within {
  border-color: var(--grey-3);
}

.search-box svg {
  width: 14px;
  height: 14px;
  color: var(--grey-4);
  flex-shrink: 0;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  width: 200px;
}

.search-box input::placeholder {
  color: var(--grey-4);
}

/* ── Event Grid ── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Loading */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: var(--grey-4);
  font-size: 13px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--grey-2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Event Card ── */
.event-card {
  background: var(--black-3);
  border: 1px solid var(--grey-1);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: var(--grey-2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.event-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.event-card.type-birthday::after {
  background: var(--birthday);
}

.event-card.type-match::after {
  background: var(--match);
}

.event-card.type-anniversary::after {
  background: var(--anniversary);
}

.event-card.type-culture::after {
  background: var(--culture);
}

.event-card.type-milestone::after {
  background: var(--milestone);
}

.event-card.type-hype::after {
  background: var(--hype);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-type-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 100px;
}

.type-birthday .card-type-tag {
  background: rgba(244, 162, 97, 0.12);
  color: var(--birthday);
}

.type-match .card-type-tag {
  background: rgba(58, 123, 213, 0.12);
  color: var(--match);
}

.type-anniversary.card-type-tag,
.type-anniversary .card-type-tag {
  background: rgba(136, 102, 255, 0.12);
  color: var(--anniversary);
}

.type-culture .card-type-tag {
  background: rgba(42, 157, 92, 0.12);
  color: var(--culture);
}

.type-milestone .card-type-tag {
  background: rgba(230, 57, 70, 0.12);
  color: var(--milestone);
}

.type-hype .card-type-tag {
  background: rgba(232, 93, 4, 0.12);
  color: var(--hype);
}

.card-days {
  font-size: 11px;
  color: var(--grey-4);
  background: var(--grey-1);
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.card-days.today {
  background: rgba(232, 93, 4, 0.15);
  color: var(--orange);
  font-weight: 600;
}

.card-days.soon {
  background: rgba(244, 162, 97, 0.1);
  color: var(--yellow);
}

.card-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.2;
}

.card-subtitle {
  font-size: 12px;
  color: var(--grey-4);
  line-height: 1.5;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-tag {
  font-size: 10px;
  color: var(--grey-4);
  background: var(--grey-1);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: lowercase;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.card-date {
  font-size: 11px;
  color: var(--grey-3);
  letter-spacing: 0.05em;
}

.btn-generate {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--orange);
  color: var(--black);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  white-space: nowrap;
}

.btn-generate:hover {
  background: #ff7b28;
}

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

.btn-generate svg {
  width: 13px;
  height: 13px;
}

/* Post status badge on card */
.card-status-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-approved {
  background: rgba(42, 157, 92, 0.15);
  color: var(--green);
}

.badge-used {
  background: rgba(136, 102, 255, 0.15);
  color: var(--purple);
}

.badge-draft {
  background: rgba(255, 255, 255, 0.05);
  color: var(--grey-4);
}

/* ── Posts Saved View ── */
.status-filters {
  display: flex;
  gap: 6px;
}

.status-btn {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--grey-2);
  background: transparent;
  color: var(--grey-4);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.status-btn:hover {
  border-color: var(--grey-3);
  color: var(--white);
}

.status-btn.active {
  background: var(--grey-1);
  color: var(--white);
  border-color: var(--grey-2);
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-row {
  background: var(--black-3);
  border: 1px solid var(--grey-1);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  animation: fadeUp 0.3s ease both;
}

.post-row:hover {
  border-color: var(--grey-2);
  transform: translateX(2px);
}

.post-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-row-title {
  font-family: var(--font-head);
  font-size: 17px;
  letter-spacing: 0.03em;
  color: var(--white);
}

.post-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--grey-4);
}

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 80px 40px;
  color: var(--grey-4);
  text-align: center;
}

.empty-state p {
  font-size: 16px;
  font-weight: 500;
  color: var(--white-dim);
}

.empty-state span {
  font-size: 13px;
}

/* ── Content Panel (right slide-in) ── */
.content-panel {
  width: var(--panel-w);
  min-width: var(--panel-w);
  height: 100vh;
  background: var(--black-2);
  border-left: 1px solid var(--grey-1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

.content-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--grey-1);
  gap: 12px;
  flex-shrink: 0;
}

.panel-event-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.panel-event-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
}

.panel-event-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.panel-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.panel-action-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--grey-1);
  background: transparent;
  color: var(--grey-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.panel-action-btn svg {
  width: 15px;
  height: 15px;
}

.panel-action-btn:hover {
  background: var(--grey-1);
  color: var(--white);
  border-color: var(--grey-2);
}

/* Status bar */
.panel-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--grey-1);
  flex-shrink: 0;
}

.status-label {
  font-size: 11px;
  color: var(--grey-4);
}

.status-btns-inline {
  display: flex;
  gap: 5px;
  flex: 1;
}

.inline-status-btn {
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--grey-2);
  background: transparent;
  color: var(--grey-4);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.inline-status-btn:hover {
  color: var(--white);
  border-color: var(--grey-3);
}

.inline-status-btn.active-draft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  border-color: var(--grey-3);
}

.inline-status-btn.active-approved {
  background: rgba(42, 157, 92, 0.15);
  color: var(--green);
  border-color: var(--green);
}

.inline-status-btn.active-used {
  background: rgba(136, 102, 255, 0.15);
  color: var(--purple);
  border-color: var(--purple);
}

.cached-badge {
  font-size: 10px;
  color: var(--orange);
  background: rgba(232, 93, 4, 0.1);
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Panel body */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Content Section */
.content-section {
  background: var(--black-3);
  border: 1px solid var(--grey-1);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeUp 0.3s ease both;
  flex-shrink: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-1);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.section-header:hover {
  background: var(--black-4);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  font-size: 14px;
  width: 22px;
  text-align: center;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-4);
}

.section-chevron {
  color: var(--grey-3);
  transition: transform var(--transition);
  font-size: 12px;
}

.content-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.content-section.collapsed .section-body {
  display: none;
}

.section-actions {
  display: flex;
  gap: 4px;
}

.copy-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--grey-2);
  background: transparent;
  color: var(--grey-4);
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.copy-btn:hover {
  color: var(--white);
  border-color: var(--grey-3);
}

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

.section-body {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.7;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  max-height: 250px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.section-body:hover {
  background: rgba(255, 255, 255, 0.02);
}

.section-body:hover::after {
  content: '⤢  Expandir';
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(232, 93, 4, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* Caption variants */
.caption-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--grey-1);
}

.caption-tab {
  flex: 1;
  padding: 7px;
  background: transparent;
  border: none;
  color: var(--grey-4);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  border-right: 1px solid var(--grey-1);
}

.caption-tab:last-child {
  border-right: none;
}

.caption-tab:hover {
  background: var(--grey-1);
  color: var(--white);
}

.caption-tab.active {
  background: var(--grey-1);
  color: var(--orange);
}

.caption-content {
  display: none;
}

.caption-content.active {
  display: block;
}

/* Reels ideas */
.reels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reel-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  background: var(--black-4);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--white-dim);
  line-height: 1.6;
}

.reel-num {
  background: var(--orange);
  color: var(--black);
  width: 20px;
  min-width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

/* Trivia items */
.trivia-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trivia-item {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--white-dim);
  line-height: 1.6;
}

.trivia-item::before {
  content: '▸';
  color: var(--orange);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Hashtags */
.hashtag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hashtag {
  font-size: 11px;
  color: var(--blue);
  background: rgba(58, 123, 213, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Image prompt */
.image-prompt-box {
  background: var(--black-4);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  color: var(--white-dim);
  line-height: 1.7;
  font-style: italic;
  border-left: 2px solid var(--purple);
}

/* Hook */
.hook-box {
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.08), rgba(232, 93, 4, 0.02));
  border: 1px solid rgba(232, 93, 4, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.3;
}

/* Panel loading */
.panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  color: var(--grey-4);
  font-size: 13px;
}

/* ── Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--grey-1);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  transition: transform 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Expand Modal ── */
.expand-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.expand-modal.open {
  opacity: 1;
  pointer-events: all;
}

.expand-modal-inner {
  background: var(--black-2);
  border: 1px solid var(--grey-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.expand-modal.open .expand-modal-inner {
  transform: translateY(0) scale(1);
}

.expand-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grey-1);
  flex-shrink: 0;
  gap: 16px;
}

.expand-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.expand-modal-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.expand-modal-title {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expand-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.expand-copy-btn {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--orange);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}

.expand-copy-btn:hover {
  background: var(--orange);
  color: var(--black);
}

.expand-copy-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: var(--black);
}

.expand-close-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--grey-2);
  background: transparent;
  color: var(--grey-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.expand-close-btn svg {
  width: 16px;
  height: 16px;
}

.expand-close-btn:hover {
  background: var(--grey-1);
  color: var(--white);
  border-color: var(--grey-3);
}

.expand-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  font-size: 15px;
  color: var(--white-dim);
  line-height: 1.8;
}

/* Expanded versions of section components */
.expand-modal-body .hook-box {
  font-size: 32px;
  padding: 24px;
  line-height: 1.2;
}

.expand-modal-body .image-prompt-box {
  font-size: 14px;
  padding: 20px;
  line-height: 1.8;
}

.expand-modal-body .caption-tabs {
  margin-bottom: 20px;
}

.expand-modal-body .caption-tab {
  font-size: 12px;
  padding: 10px;
}

.expand-modal-body .caption-content {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
}

.expand-modal-body .reel-item {
  font-size: 14px;
  padding: 14px;
  line-height: 1.7;
}

.expand-modal-body .reel-num {
  width: 26px;
  min-width: 26px;
  height: 26px;
  font-size: 13px;
}

.expand-modal-body .trivia-item {
  font-size: 14px;
  line-height: 1.8;
  padding: 8px 0;
  border-bottom: 1px solid var(--grey-1);
}

.expand-modal-body .trivia-item:last-child {
  border-bottom: none;
}

.expand-modal-body .hashtag {
  font-size: 14px;
  padding: 5px 12px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 220px;
    --panel-w: 100vw;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main {
    flex: 1;
  }

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

  .content-panel {
    width: 100vw;
    min-width: 100vw;
  }

  .expand-modal {
    padding: 12px;
  }

  .expand-modal-body {
    padding: 18px;
  }

  .discover-modal-inner,
  .results-modal-inner {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ── Discover Config Modal ── */
.discover-modal,
.results-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.discover-modal.open,
.results-modal.open {
  opacity: 1;
  pointer-events: all;
}

.discover-modal-inner {
  background: var(--black-2);
  border: 1px solid var(--grey-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.discover-modal.open .discover-modal-inner {
  transform: translateY(0) scale(1);
}

.discover-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
  gap: 16px;
}

.discover-modal-title {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 4px;
}

.discover-modal-sub {
  font-size: 12px;
  color: var(--grey-4);
  line-height: 1.5;
}

.discover-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.discover-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-4);
  margin-bottom: 12px;
}

/* Day chips */
.days-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.day-chip {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--grey-2);
  background: transparent;
  color: var(--grey-4);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.day-chip:hover {
  border-color: var(--grey-3);
  color: var(--white);
}

.day-chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--black);
  font-weight: 700;
}

/* Theme checklist */
.themes-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--grey-1);
  background: var(--black-3);
  cursor: pointer;
  font-size: 12px;
  color: var(--grey-4);
  transition: all var(--transition);
  user-select: none;
}

.theme-check:hover {
  border-color: var(--grey-2);
  color: var(--white);
}

.theme-check input[type="checkbox"] {
  accent-color: var(--orange);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-check:has(input:checked) {
  border-color: rgba(232, 93, 4, 0.3);
  background: rgba(232, 93, 4, 0.05);
  color: var(--white);
}

/* Discover footer */
.discover-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--grey-1);
  gap: 16px;
}

.discover-hint {
  font-size: 12px;
  color: var(--grey-4);
}

.discover-hint strong {
  color: var(--orange);
}

.btn-discover-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--orange);
  color: var(--black);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 16px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  white-space: nowrap;
}

.btn-discover-search:hover {
  background: #ff7b28;
}

.btn-discover-search:active {
  transform: scale(0.97);
}

.btn-discover-search:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Discover Results Modal ── */
.results-modal-inner {
  background: var(--black-2);
  border: 1px solid var(--grey-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
}

.results-modal.open .results-modal-inner {
  transform: translateY(0) scale(1);
}

.results-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--grey-1);
  flex-shrink: 0;
  gap: 16px;
}

.results-modal-title {
  font-family: var(--font-head);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 2px;
}

.results-modal-sub {
  font-size: 12px;
  color: var(--grey-4);
}

.btn-approve-all {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green);
  background: rgba(42, 157, 92, 0.08);
  color: var(--green);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-approve-all:hover {
  background: rgba(42, 157, 92, 0.18);
}

.results-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Day group */
.day-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.3s ease both;
}

.day-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.day-group-date {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--white);
}

.day-group-weekday {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey-4);
  background: var(--grey-1);
  padding: 3px 8px;
  border-radius: 4px;
}

.day-group-today .day-group-date {
  color: var(--orange);
}

.day-group-today .day-group-weekday {
  color: var(--orange);
  background: rgba(232, 93, 4, 0.1);
}

.day-group-empty {
  font-size: 12px;
  color: var(--grey-3);
  font-style: italic;
  padding: 4px 0;
}

/* Discovered event card */
.discovered-card {
  background: var(--black-3);
  border: 1px solid var(--grey-1);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color var(--transition), opacity var(--transition);
  position: relative;
  overflow: hidden;
}

.discovered-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.discovered-card.type-birthday::before {
  background: var(--birthday);
}

.discovered-card.type-match::before {
  background: var(--match);
}

.discovered-card.type-anniversary::before {
  background: var(--anniversary);
}

.discovered-card.type-culture::before {
  background: var(--culture);
}

.discovered-card.type-milestone::before {
  background: var(--milestone);
}

.discovered-card.type-hype::before {
  background: var(--hype);
}

.discovered-card.approved {
  border-color: var(--green);
  background: rgba(42, 157, 92, 0.04);
}

.discovered-card.rejected {
  opacity: 0.3;
}

.discovered-card-content {
  flex: 1;
  min-width: 0;
}

.discovered-card-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.discovered-card.type-birthday .discovered-card-type {
  color: var(--birthday);
}

.discovered-card.type-match .discovered-card-type {
  color: var(--match);
}

.discovered-card.type-anniversary .discovered-card-type {
  color: var(--anniversary);
}

.discovered-card.type-culture .discovered-card-type {
  color: var(--culture);
}

.discovered-card.type-milestone .discovered-card-type {
  color: var(--milestone);
}

.discovered-card.type-hype .discovered-card-type {
  color: var(--hype);
}

.discovered-card-title {
  font-family: var(--font-head);
  font-size: 18px;
  letter-spacing: 0.03em;
  color: var(--white);
  margin-bottom: 4px;
  line-height: 1.2;
}

.discovered-card-subtitle {
  font-size: 12px;
  color: var(--grey-4);
  margin-bottom: 8px;
  line-height: 1.5;
}

.discovered-card-context {
  font-size: 11px;
  color: var(--grey-3);
  line-height: 1.6;
  font-style: italic;
}

.discovered-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-approve,
.btn-reject {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid;
}

.btn-approve {
  background: rgba(42, 157, 92, 0.1);
  border-color: var(--green);
  color: var(--green);
}

.btn-approve:hover {
  background: var(--green);
  color: var(--black);
}

.btn-approve:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-reject {
  background: transparent;
  border-color: var(--grey-2);
  color: var(--grey-4);
}

.btn-reject:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Discover loading */
.discover-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 40px;
  color: var(--grey-4);
  font-size: 13px;
  text-align: center;
}

.discover-loading p {
  color: var(--white-dim);
  font-size: 14px;
}

.discover-loading span {
  font-size: 12px;
}