/* ==========================================================================
   Geddi's Rec — styles
   Visual language follows shadcn/ui (neutral palette, hairline borders,
   8–12px radii, Geist type, lucide icons). Plain CSS, no build step.
   Class names and IDs are the contract with app.js; keep them stable.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens. Dark is the default theme; light is [data-theme="light"],
   toggled on <html> by app.js.
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #111111;
  --popover: #0a0a0a;
  --muted: #1c1c1c;
  --muted-foreground: #a1a1a1;
  --border: #262626;
  --input: #2e2e2e;
  --ring: #737373;
  --primary: #fafafa;
  --primary-foreground: #0a0a0a;
  --secondary: #1f1f1f;
  --destructive: #f87171;
  --destructive-bg: rgba(248, 113, 113, 0.1);
  --live: #22c55e;
  --live-ring: rgba(34, 197, 94, 0.18);
  --offline: #f87171;

  /* Single warm accent: IMDb ratings, "beg" votes, brand highlight */
  --accent: #f5a524;
  --accent-foreground: #fbbf24;
  --accent-bg: rgba(245, 165, 36, 0.09);
  --accent-border: rgba(245, 165, 36, 0.3);

  --overlay: rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --content-width: 880px;

  /* Read by inline styles that app.js writes */
  --text-dim: var(--muted-foreground);
  --accent-imdb: var(--accent-foreground);

  /* Lucide icons used as CSS masks for emoji spans rendered by app.js */
  --icon-flame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
  --icon-message: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.9 20A9 9 0 1 0 4 16.1L2 22Z'/%3E%3C/svg%3E");
  --icon-clapper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z'/%3E%3Cpath d='m6.2 5.3 3.1 3.9'/%3E%3Cpath d='m12.4 3.4 3.1 4'/%3E%3Cpath d='M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/%3E%3C/svg%3E");
  --icon-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
  --icon-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  color-scheme: light;

  --background: #fafafa;
  --foreground: #09090b;
  --card: #ffffff;
  --popover: #ffffff;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --destructive: #dc2626;
  --destructive-bg: rgba(220, 38, 38, 0.08);
  --live: #16a34a;
  --live-ring: rgba(22, 163, 74, 0.15);
  --offline: #dc2626;

  --accent: #d97706;
  --accent-foreground: #a16207;
  --accent-bg: #fffbeb;
  --accent-border: #fcd34d;

  --overlay: rgba(9, 9, 11, 0.4);
  --shadow-lg: 0 24px 64px rgba(9, 9, 11, 0.18);
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.06);

  --icon-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Guard against any stray wide content making phones zoom out; set on
     html so it applies to the viewport and keeps the sticky header working */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, h4, p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex: none;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-bg);
  color: var(--foreground);
}

.hidden {
  display: none !important;
}

.icon {
  width: 16px;
  height: 16px;
}

.icon-tiny {
  width: 14px;
  height: 14px;
}

/* Shared mask-icon treatment for emoji spans that app.js renders */
.beg-fire-icon,
.quote-icon,
.comment-icon,
.empty-bubble-icon,
.rec-empty-icon,
.select-arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  font-size: 0;
  line-height: 0;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--icon-message) center / contain no-repeat;
  mask: var(--icon-message) center / contain no-repeat;
}

/* Ambient poster glow behind the page (set by app.js); kept faint */
.ambient-backdrop {
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  z-index: -2;
  background-size: cover;
  background-position: center 30%;
  filter: blur(80px) saturate(1.2);
  opacity: 0.14;
  pointer-events: none;
  transition: background-image 0.6s ease;
}

.ambient-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent 0, var(--background) 520px);
  pointer-events: none;
}

[data-theme="light"] .ambient-backdrop {
  opacity: 0.08;
}

/* --------------------------------------------------------------------------
   Buttons (shadcn variants mapped onto the app's existing class names)
   -------------------------------------------------------------------------- */
.btn-main-recommend,
.btn-primary-large,
.btn-primary-compact,
.btn-stream-now,
.btn-compact-watch,
.btn-trailer-watch-full,
.social-share-btn,
.copy-btn,
.btn-control-toggle,
.btn-comment-toggle,
.btn-similar-movies,
.btn-trailer-small,
.btn-delete-rec,
.btn-change-movie,
.btn-profile-pill,
.btn-sync-pill,
.btn-theme-toggle,
.modal-close-btn,
.rec-share-quick-btn,
.search-clear-btn,
.rec-search-clear-btn,
.btn-post-comment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-main-recommend svg,
.btn-primary-large svg,
.btn-primary-compact svg,
.btn-stream-now svg,
.btn-compact-watch svg,
.btn-trailer-watch-full svg,
.social-share-btn svg,
.copy-btn svg,
.btn-control-toggle svg,
.btn-trailer-small svg,
.btn-delete-rec svg,
.btn-change-movie svg,
.modal-close-btn svg,
.rec-share-quick-btn svg,
.search-clear-btn svg,
.rec-search-clear-btn svg,
.btn-post-comment svg,
.btn-theme-toggle svg {
  width: 16px !important;
  height: 16px !important;
}

/* Primary */
.btn-main-recommend,
.btn-primary-large,
.btn-primary-compact,
.btn-stream-now,
.btn-compact-watch,
.btn-trailer-watch-full,
.social-share-btn,
.btn-post-comment {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-main-recommend:hover,
.btn-primary-large:hover,
.btn-primary-compact:hover,
.btn-stream-now:hover,
.btn-compact-watch:hover,
.btn-trailer-watch-full:hover,
.social-share-btn:hover,
.btn-post-comment:hover {
  opacity: 0.9;
}

/* Outline */
.copy-btn,
.btn-similar-movies,
.btn-trailer-small,
.btn-comment-toggle,
.btn-profile-pill {
  border-color: var(--border);
  background: var(--card);
}

.copy-btn:hover,
.btn-similar-movies:hover,
.btn-trailer-small:hover,
.btn-comment-toggle:hover,
.btn-profile-pill:hover {
  background: var(--muted);
}

/* Ghost */
.btn-control-toggle,
.btn-delete-rec,
.btn-change-movie,
.btn-sync-pill,
.btn-theme-toggle,
.modal-close-btn,
.rec-share-quick-btn,
.search-clear-btn,
.rec-search-clear-btn {
  color: var(--muted-foreground);
}

.btn-control-toggle:hover,
.btn-change-movie:hover,
.btn-sync-pill:hover,
.btn-theme-toggle:hover,
.modal-close-btn:hover,
.rec-share-quick-btn:hover,
.search-clear-btn:hover,
.rec-search-clear-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-delete-rec:hover {
  background: var(--destructive-bg);
  color: var(--destructive);
}

/* Icon-only */
.btn-theme-toggle,
.modal-close-btn,
.rec-share-quick-btn {
  width: 36px;
  padding: 0;
}

.modal-close-btn,
.rec-share-quick-btn {
  width: 32px;
  height: 32px;
}

/* Sizes */
.btn-main-recommend,
.btn-primary-large {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

.btn-primary-large {
  width: 100%;
}

.btn-control-toggle,
.btn-similar-movies,
.btn-trailer-small,
.btn-comment-toggle,
.btn-delete-rec,
.btn-change-movie,
.btn-compact-watch,
.btn-sync-pill,
.btn-primary-compact {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  gap: 6px;
}

button:disabled,
.btn-primary-large:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Shared bits: badges, inputs
   -------------------------------------------------------------------------- */
.meta-tag,
.imdb-chip-small,
.friends-pill-badge,
.compact-badge-hyped,
.compact-badge-loved,
.compact-badge-hated,
.compact-badge-comments,
.comment-count-pill,
.similar-match-pill,
.rec-preview-watch-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* Long values (several directors) wrap inside the chip instead of
   pushing the card wider than a phone screen */
.meta-tag {
  max-width: 100%;
  height: auto;
  min-height: 22px;
  padding-block: 4px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.imdb-chip-small {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent-foreground);
}

.comment-count-pill {
  height: 20px;
  padding: 0 6px;
  border: 0;
  background: var(--muted);
  color: var(--foreground);
  font-family: var(--font-mono);
}

.feed-filter-input,
.rec-search-input,
.text-input-field,
.textarea-field,
.comment-input-field,
.share-link-box input,
.filter-select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feed-filter-input::placeholder,
.rec-search-input::placeholder,
.text-input-field::placeholder,
.textarea-field::placeholder,
.comment-input-field::placeholder {
  color: var(--muted-foreground);
}

.feed-filter-input:focus,
.rec-search-input:focus,
.text-input-field:focus,
.textarea-field:focus,
.comment-input-field:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}

.textarea-field {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background: var(--icon-chevron-down) right 10px center / 16px no-repeat;
  cursor: pointer;
}

.filter-select option {
  background: var(--popover);
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  padding-top: env(safe-area-inset-top);
}

.header-container {
  max-width: var(--content-width);
  height: 60px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-radius: var(--radius-md);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.popcorn-icon {
  width: 18px;
  height: 18px;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sun-icon {
  display: block;
}

.moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: block;
}

.btn-profile-pill {
  height: 36px;
  padding: 0 10px 0 4px;
  font-size: 13px;
  max-width: 220px;
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.user-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-profile-pill .icon-tiny {
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------------------
   Main layout and hero
   -------------------------------------------------------------------------- */
.main-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.feed-hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.hero-top-row {
  min-width: 0;
}

.hero-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 560px;
}

.friends-pill-badge .icon {
  width: 12px;
  height: 12px;
}

.hero-title {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.gradient-text {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.recommend-center-cta {
  display: flex;
}

.btn-main-rec-icon {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Feed controls: search, filters, view toggle
   -------------------------------------------------------------------------- */
.feed-controls-bar {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-tools-left {
  display: flex;
  gap: 4px;
}

.btn-control-toggle {
  position: relative;
}

.btn-control-toggle.active,
.btn-control-toggle[aria-expanded="true"] {
  background: var(--muted);
  color: var(--foreground);
}

.filter-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* Segmented control, shadcn Tabs style */
.view-mode-toggle,
.sentiment-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--muted);
}

.btn-view-toggle,
.sentiment-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-view-toggle:hover,
.sentiment-tab-btn:hover {
  color: var(--foreground);
}

.btn-view-toggle.active,
.sentiment-tab-btn.active {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .btn-view-toggle.active,
[data-theme="light"] .sentiment-tab-btn.active {
  background: var(--card);
}

.view-icon {
  width: 15px;
  height: 15px;
}

.search-expand-panel,
.filter-expand-panel {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  animation: panelIn 0.16s ease-out;
}

.filter-expand-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.search-input-wrap,
.rec-search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon,
.rec-search-input-box .search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.feed-filter-input,
.rec-search-input {
  padding-left: 36px;
  padding-right: 40px;
}

.search-clear-btn,
.rec-search-clear-btn {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
}

.filter-dropdowns-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-dropdown-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  max-width: 280px;
}

.filter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.sentiment-filter-bar {
  align-self: flex-start;
  flex-wrap: wrap;
}

.tab-emoji {
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Feed heading
   -------------------------------------------------------------------------- */
.friends-feed-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-header-meta,
.feed-heading-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feed-heading-group {
  flex: 1;
}

.feed-section-heading {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#totalRecsCount {
  font-family: var(--font-mono);
  font-weight: 500;
}

.btn-sync-pill {
  font-size: 12px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.sync-dot.live {
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-ring);
}

.btn-sync-pill.syncing .sync-dot {
  background: var(--accent);
  animation: syncPulse 1s ease-in-out infinite;
}

.btn-sync-pill.offline {
  color: var(--offline);
}

.btn-sync-pill.offline .sync-dot {
  background: var(--offline);
}

@keyframes syncPulse {
  50% { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Recommendation card (cards view)
   app.js renders: header, [beg banner], [note], body(poster, details),
   stream CTA, footer(reactions, secondary actions), voters tray, comments.
   The body and footer wrappers dissolve so the card can place each part.
   -------------------------------------------------------------------------- */
.friends-feed-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.friend-rec-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto auto auto auto;
  grid-template-areas:
    "header   header"
    "beg      beg"
    "poster   details"
    "poster   note"
    "poster   cta"
    "poster   actions"
    "rx       rx"
    "want     want"
    "voters   voters"
    "comments comments";
  column-gap: 20px;
  padding: 16px 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  animation: cardIn 0.25s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.rec-card-body,
.rec-card-footer {
  display: contents;
}

.rec-card-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.recommender-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.recommender-avatar,
.comment-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
  background: var(--muted);
}

.recommender-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

.recommended-by-text,
.rec-timestamp {
  color: var(--muted-foreground);
}

.rec-timestamp {
  font-size: 12px;
}

.recommender-name {
  font-weight: 600;
}

.rec-card-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.beg-shoutout-banner {
  grid-area: beg;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-foreground);
  font-size: 13px;
}

.beg-fire-icon {
  -webkit-mask-image: var(--icon-flame);
  mask-image: var(--icon-flame);
}

.beg-banner-text strong {
  font-weight: 600;
}

.friend-note-bubble {
  grid-area: note;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 13px;
}

.quote-icon {
  margin-top: 2px;
  color: var(--muted-foreground);
}

.friend-note-text {
  font-style: italic;
  overflow-wrap: anywhere;
}

.rec-poster-wrapper {
  grid-area: poster;
  align-self: start;
  position: relative;
}

.rec-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
}

/* The rating is already shown as a chip beside the title */
.rec-poster-imdb-badge {
  display: none;
}

.rec-movie-details {
  grid-area: details;
  min-width: 0;
  margin-bottom: 12px;
}

.rec-movie-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rec-movie-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.rec-movie-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-foreground);
}

.rec-movie-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.rec-movie-synopsis {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-movie-synopsis.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.synopsis-toggle-btn {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rec-stream-cta-wrap {
  grid-area: cta;
  margin-bottom: 8px;
}

.stream-play-icon {
  width: 16px;
  height: 16px;
}

.rec-secondary-actions {
  grid-area: actions;
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-comment-toggle.active {
  background: var(--muted);
  border-color: var(--ring);
}

.comment-icon {
  width: 14px;
  height: 14px;
}

/* Separate standalone "Want to watch" button (positioned below the emojis) */
.want-to-watch-wrap {
  grid-area: want;
  margin-top: 6px;
  display: flex;
}

.btn-want-to-watch {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--foreground) 15%, var(--border));
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--foreground) 7%, transparent),
    0 1px 2px rgba(0, 0, 0, 0.2);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-want-to-watch:hover {
  background: var(--muted);
  border-color: color-mix(in srgb, var(--foreground) 26%, var(--border));
}

.btn-want-to-watch:active {
  transform: scale(0.98);
}

.btn-want-to-watch.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.18),
    0 0 0 1px rgba(56, 189, 248, 0.14);
}

.btn-want-to-watch.active .rxn-count {
  color: #38bdf8;
}

[data-theme="light"] .btn-want-to-watch {
  border-color: color-mix(in srgb, var(--foreground) 13%, var(--border));
  background: color-mix(in srgb, var(--muted) 60%, var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(9, 9, 11, 0.05);
}

[data-theme="light"] .btn-want-to-watch:hover {
  background: var(--muted);
  border-color: color-mix(in srgb, var(--foreground) 24%, var(--border));
}

[data-theme="light"] .btn-want-to-watch.active {
  background: #f0f9ff;
  border-color: #7dd3fc;
  color: #0369a1;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.14);
}

[data-theme="light"] .btn-want-to-watch.active .rxn-count {
  color: #0369a1;
}

/* Reactions: shadcn toggle buttons with very subtle highlight */
.reaction-buttons-deck {
  grid-area: rx;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--foreground) 12%, var(--border));
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--foreground) 6%, transparent),
    0 1px 2px rgba(0, 0, 0, 0.16);
  color: var(--foreground);
  font-size: 13px;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-reaction.btn-beg {
  grid-column: 1 / -1;
}

.btn-reaction:hover {
  background: var(--muted);
  border-color: color-mix(in srgb, var(--foreground) 22%, var(--border));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--foreground) 9%, transparent),
    0 2px 4px rgba(0, 0, 0, 0.22);
}

.btn-reaction:active {
  transform: scale(0.97);
}

[data-theme="light"] .btn-reaction {
  border-color: color-mix(in srgb, var(--foreground) 10%, var(--border));
  background: color-mix(in srgb, var(--muted) 50%, var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(9, 9, 11, 0.04);
}

[data-theme="light"] .btn-reaction:hover {
  background: var(--muted);
  border-color: color-mix(in srgb, var(--foreground) 20%, var(--border));
}

.rxn-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
}

.btn-reaction.active {
  background: color-mix(in srgb, var(--foreground) 9%, var(--muted));
  border-color: color-mix(in srgb, var(--foreground) 34%, var(--ring));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--foreground) 12%, transparent),
    0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent);
}

.btn-reaction.active .rxn-count {
  color: var(--foreground);
}

.btn-reaction.active.beg {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent-foreground);
}

.btn-reaction.active.beg .rxn-count {
  color: var(--accent-foreground);
}

/* Who reacted */
.reactions-breakdown-tray {
  grid-area: voters;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
}

.reactions-breakdown-tray:empty {
  display: none;
}

.voter-group {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.voter-group-label {
  color: var(--muted-foreground);
}

.voter-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voter-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
}

.no-reactions-hint {
  color: var(--muted-foreground);
  font-size: 13px;
}

/* Comments */
.movie-comments-section {
  grid-area: comments;
  margin: 20px -20px -20px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--background);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comments-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comments-title {
  font-size: 13px;
  font-weight: 600;
}

.comments-hint {
  font-size: 12px;
  color: var(--muted-foreground);
}

.comments-feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-bubble-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.comment-author-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.comment-author-name {
  font-size: 13px;
  font-weight: 600;
}

.comment-timestamp {
  font-size: 12px;
  color: var(--muted-foreground);
}

.comment-message-bubble {
  padding-left: 32px;
}

.comment-text-body {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.no-comments-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
}

.empty-bubble-icon {
  color: var(--muted-foreground);
}

.comment-input-row {
  display: flex;
  gap: 8px;
}

.btn-post-comment {
  padding: 0 12px;
}

.send-icon {
  width: 14px !important;
  height: 14px !important;
}

/* --------------------------------------------------------------------------
   Compact list view — each movie has a subtle highlight around it
   -------------------------------------------------------------------------- */
.compact-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--foreground) 15%, var(--border));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--foreground) 7%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.22);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-feed-item:hover {
  background: color-mix(in srgb, var(--muted) 60%, var(--card));
  border-color: color-mix(in srgb, var(--foreground) 26%, var(--border));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--foreground) 10%, transparent),
    0 4px 12px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] .compact-feed-item {
  border-color: color-mix(in srgb, var(--foreground) 13%, var(--border));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 4px rgba(9, 9, 11, 0.06);
}

[data-theme="light"] .compact-feed-item:hover {
  background: var(--card);
  border-color: color-mix(in srgb, var(--foreground) 24%, var(--border));
  box-shadow: 0 4px 12px rgba(9, 9, 11, 0.1);
}

.compact-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.compact-movie-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.compact-by-prefix {
  color: var(--muted-foreground);
}

.compact-recommender-name {
  font-weight: 600;
}

.compact-actions-col {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.btn-compact-watch svg {
  width: 12px !important;
  height: 12px !important;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.empty-feed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.empty-icon .icon {
  width: 20px;
  height: 20px;
}

.empty-feed-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.empty-feed-card p {
  max-width: 380px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.empty-feed-card .btn-primary-compact {
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   User colour identity (inline custom properties written by app.js)
   -------------------------------------------------------------------------- */
.user-colored-name {
  color: var(--u-color-dark) !important;
}

.user-colored-avatar {
  background: var(--u-bg-dark) !important;
  color: var(--u-color-dark) !important;
}

.user-colored-voter {
  background: var(--u-bg-dark);
  color: var(--u-color-dark);
  border-color: color-mix(in srgb, var(--u-color-dark) 35%, transparent);
}

.voter-chip.is-you {
  border-color: var(--u-color-dark);
}

[data-theme="light"] .user-colored-name {
  color: var(--u-color-light) !important;
}

[data-theme="light"] .user-colored-avatar {
  background: var(--u-bg-light) !important;
  color: var(--u-color-light) !important;
}

[data-theme="light"] .user-colored-voter {
  background: var(--u-bg-light);
  color: var(--u-color-light);
  border-color: color-mix(in srgb, var(--u-color-light) 35%, transparent);
}

[data-theme="light"] .voter-chip.is-you {
  border-color: var(--u-color-light);
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--popover);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dialogIn 0.18s ease-out;
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  flex: none;
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.modal-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.modal-movie-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.modal-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.modal-close-btn {
  margin: -4px -6px 0 0;
}

/* Onboarding */
.onboarding-card {
  max-width: 420px;
  padding: 28px;
  gap: 20px;
}

.onboarding-graphic {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.graphic-popcorn {
  width: 24px;
  height: 24px;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.onboarding-subtitle {
  margin-top: -12px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label,
.form-step-label {
  font-size: 13px;
  font-weight: 500;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  display: inline-flex;
  color: var(--muted-foreground);
  pointer-events: none;
}

.input-with-icon .text-input-field {
  height: 40px;
  padding-left: 36px;
}

.onboarding-form .btn-primary-large {
  margin-top: 8px;
}

/* Recommend a movie */
.add-rec-card {
  max-width: 560px;
  height: min(720px, calc(100vh - 32px));
  height: min(720px, calc(100dvh - 32px));
}

.rec-stage-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rec-top-search-wrap {
  flex: none;
  padding: 0 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.rec-search-input {
  height: 40px;
}

.rec-search-helper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.rec-results-heading {
  font-weight: 500;
}

.rec-results-count {
  color: var(--muted-foreground);
}

.rec-results-scroll-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overscroll-behavior: contain;
}

.rec-movie-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.rec-movie-item:hover,
.rec-movie-item:focus-visible {
  background: var(--muted);
  border-color: var(--border);
  outline: none;
}

.rec-item-thumb {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--muted);
  flex: none;
}

.rec-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rec-item-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-item-meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.rec-item-year {
  font-family: var(--font-mono);
}

.rec-item-imdb {
  color: var(--accent-foreground);
}

.rec-item-director {
  flex-basis: 100%;
}

.rec-item-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  flex: none;
}

.select-arrow {
  width: 14px;
  height: 14px;
  -webkit-mask-image: var(--icon-arrow-right);
  mask-image: var(--icon-arrow-right);
}

.rec-movie-item:hover .rec-item-select-btn,
.rec-movie-item:focus-visible .rec-item-select-btn {
  background: var(--primary);
  color: var(--primary-foreground);
}

.rec-empty-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  text-align: center;
}

.rec-empty-icon {
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
  -webkit-mask-image: var(--icon-clapper);
  mask-image: var(--icon-clapper);
}

.rec-empty-results h4 {
  font-size: 15px;
  font-weight: 600;
}

.rec-empty-results p {
  font-size: 13px;
  color: var(--muted-foreground);
}

.rec-details-scroll-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.selected-movie-preview {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.rec-preview-poster {
  width: 72px;
  height: 108px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--muted);
  flex: none;
}

.rec-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-preview-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.rec-preview-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.btn-change-movie {
  height: 28px;
  margin: -2px -4px 0 0;
}

.rec-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rec-preview-meta .meta-tag:empty {
  display: none;
}

.rec-preview-watch-pill {
  color: var(--foreground);
  text-decoration: none;
}

.rec-preview-watch-pill:hover {
  background: var(--muted);
}

.rec-preview-synopsis {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.form-step-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-step-group .form-step-label:not(:first-child) {
  margin-top: 10px;
}

.verdict-options-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.verdict-radio-btn {
  position: relative;
  display: flex;
}

.verdict-radio-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.verdict-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.verdict-pill::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--ring);
  flex: none;
  box-sizing: border-box;
}

.verdict-pill:hover {
  background: var(--muted);
}

.verdict-radio-btn input:checked + .verdict-pill {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.verdict-radio-btn input:checked + .verdict-pill::before {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 3.5px, transparent 4px);
}

.verdict-radio-btn input:focus-visible + .verdict-pill {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.form-step-group .btn-primary-large {
  margin-top: 12px;
}

/* Similar movies */
.similar-movies-card {
  max-width: 760px;
}

.modal-body-scroll {
  overflow-y: auto;
  padding: 0 20px 20px;
}

.similar-movies-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.similar-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.similar-card:hover {
  border-color: var(--ring);
  transform: translateY(-2px);
}

.similar-poster-wrap {
  position: relative;
}

.similar-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--muted);
}

.similar-match-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  border: 0;
  background: color-mix(in srgb, var(--background) 85%, transparent);
  color: var(--foreground);
  backdrop-filter: blur(6px);
}

.similar-content {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.similar-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.similar-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Trailer */
.trailer-modal-card {
  max-width: 880px;
}

.trailer-player-container {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-block: 1px solid var(--border);
}

.trailer-player-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.trailer-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
}

/* Share */
.share-modal-card {
  max-width: 440px;
}

.share-modal-body {
  overflow-y: auto;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-instructions {
  font-size: 13px;
  color: var(--muted-foreground);
}

.qr-code-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.qr-caption {
  order: 2;
  font-size: 12px;
  text-align: center;
  color: var(--muted-foreground);
}

.qr-frame {
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
}

.qr-img {
  width: 160px;
  height: 160px;
}

.share-link-box {
  display: flex;
  gap: 8px;
}

.share-link-box input {
  height: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 0;
}

.copy-btn {
  height: 40px;
}

.share-platforms-row {
  display: flex;
}

.social-share-btn {
  width: 100%;
  height: 44px;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Toasts (sonner style)
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--popover);
  color: var(--foreground);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.22s ease-out;
}

.toast.toast-leave {
  animation: toastOut 0.2s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
  .toast-container {
    left: auto;
    right: 24px;
    transform: none;
    align-items: flex-end;
  }
}

@media (max-width: 720px) {
  .similar-movies-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-container {
    height: 56px;
    padding: 0 16px;
  }

  .btn-profile-pill {
    max-width: 150px;
  }

  .main-content {
    padding: 24px 16px 64px;
    gap: 24px;
  }

  .feed-hero-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .btn-main-recommend {
    width: 100%;
  }

  .tool-label,
  .view-btn-label {
    display: none;
  }

  .btn-control-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .filter-active-dot {
    position: absolute;
    top: 6px;
    right: 6px;
  }

  .btn-view-toggle {
    height: 32px;
    padding: 0 10px;
  }

  .filter-dropdown-wrap {
    max-width: none;
  }

  .sentiment-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: stretch;
  }

  .friend-rec-card {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "header   header"
      "beg      beg"
      "poster   details"
      "note     note"
      "cta      cta"
      "actions  actions"
      "rx       rx"
      "want     want"
      "voters   voters"
      "comments comments";
    column-gap: 14px;
    padding: 14px 14px 16px;
  }

  .rec-movie-title {
    font-size: 18px;
  }

  .rec-movie-synopsis {
    font-size: 13px;
  }

  .btn-stream-now {
    width: 100%;
    height: 44px;
  }

  .rec-secondary-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rec-secondary-actions > * {
    height: 40px;
  }

  .comment-toggle-label {
    display: none;
  }

  .reaction-buttons-deck {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
    padding-top: 14px;
  }

  .want-to-watch-wrap {
    margin-top: 6px;
  }

  .btn-want-to-watch {
    height: 40px;
  }

  .btn-reaction {
    justify-content: center;
    height: 40px;
    padding: 0 4px;
  }

  .btn-reaction.btn-beg {
    grid-column: 1 / -1;
  }

  /* Emoji + count only on phones; the beg button keeps its label */
  .btn-reaction:not(.btn-beg) > span:not(.rxn-icon):not(.rxn-count) {
    display: none;
  }

  .voter-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .movie-comments-section {
    margin: 16px -14px -16px;
    padding: 14px;
  }

  .compact-feed-item {
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheetIn 0.22s ease-out;
  }

  .add-rec-card {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
  }

  .onboarding-card {
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  }

  .verdict-options-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .similar-movies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes sheetIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
