:root {
  --al-red: #da0000;
  --al-burgundy: #830f10;
  --al-black: #1c1c1c;
  --al-white: #ffffff;
  --al-charcoal: #574d4c;
  --al-cream: #faf3e3;
  --al-bg: var(--al-cream);
  --al-panel: #ffffff;
  --al-panel-2: #faf6ef;
  --al-text: #1c1c1c;
  --al-muted: #6b5f5e;
  --al-line: rgba(28, 28, 28, 0.1);
  --al-radius: 18px;
  --al-font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --al-font-display: "Fraunces", Georgia, serif;
  --al-font-mono: "DM Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--al-bg);
  color: var(--al-text);
  font-family: var(--al-font-body);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--al-burgundy); }

.serif { font-family: var(--al-font-display); font-weight: 500; }
.brand-mono { font-family: var(--al-font-mono); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout: floating rounded sidebar + scrollable right panel (mirrors index.html) */
.page-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px;
  gap: 16px;
}

@media (min-width: 768px) {
  html, body { height: 100vh; overflow: hidden; }
  .page-main {
    flex-direction: row;
    height: 100vh;
    min-height: 100vh;
    padding: 16px 40px 16px 16px;
    gap: 16px;
  }
}

.al-sidebar {
  flex-shrink: 0;
  background: var(--al-burgundy);
  color: var(--al-white);
  border-radius: var(--al-radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .al-sidebar {
    width: 300px;
    height: 100%;
    overflow-y: auto;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .al-sidebar { width: 340px; }
}

.al-sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.al-sidebar-title {
  display: block;
  font-family: var(--al-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--al-white);
  text-decoration: none;
}

.al-sidebar-title:hover { color: var(--al-white); opacity: 0.9; }

.al-sidebar-tagline {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.6);
}

.al-sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.al-sidebar-stats-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.al-sidebar-stats-heading {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.al-sidebar-stat {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 10px 10px 8px;
  min-width: 0;
}

.al-sidebar-stat-label {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

.al-sidebar-stat-value {
  margin-top: 2px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--al-font-mono);
  color: var(--al-white);
  font-variant-numeric: tabular-nums;
}

.al-sidebar-stat-value.is-savings { color: #8fe8b8; }
.al-sidebar-stat-value.is-cost { color: #ffb4b4; }

.al-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -20px;
}

.al-nav-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 0;
}

.al-nav-link:hover {
  color: var(--al-white);
  background: rgba(0, 0, 0, 0.12);
}

.al-nav-link.is-active {
  color: var(--al-white);
  background: rgba(0, 0, 0, 0.22);
  font-weight: 600;
}

.al-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.al-sidebar-footer a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.al-sidebar-footer a:hover { color: var(--al-white); }

.al-content-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .al-content-scroll {
    overflow-y: auto;
    height: 100%;
    padding: 0 0 16px;
  }
}

/* Quick-log bar: compact primary row + smooth expandable extras */
.al-quicklog {
  flex-shrink: 0;
  margin-bottom: 12px;
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  border-radius: var(--al-radius);
  padding: 8px 10px;
}

.al-quicklog-primary {
  display: grid;
  grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.al-quicklog:not(.has-title) .al-quicklog-field--location,
.al-quicklog:not(.has-title) .al-quicklog-field--ticket {
  display: none;
}

.al-quicklog.has-title:not(.is-off-theater) .al-quicklog-primary {
  grid-template-columns: minmax(0, 120px) minmax(0, 2fr) minmax(0, 1.5fr) minmax(5.5rem, 7rem) auto;
}

@media (max-width: 720px) {
  .al-quicklog-primary {
    grid-template-columns: 1fr 1fr;
  }
  .al-quicklog-field--title { grid-column: 1 / -1; }
  .al-quicklog-field--location { grid-column: 1 / -1; }
  .al-quicklog-field--submit { grid-column: 1 / -1; }
}

.al-quicklog-field {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.al-quicklog-field label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--al-muted);
  line-height: 1.2;
}

.al-quicklog-field--submit {
  justify-content: flex-end;
}

.al-quicklog-field--submit label {
  visibility: hidden;
  user-select: none;
}

.al-quicklog-actions {
  display: none;
}

.al-quicklog-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--al-line);
  background: var(--al-panel-2);
  color: var(--al-text);
  font: inherit;
  font-size: 0.86rem;
  min-height: 34px;
}

.al-quicklog-input:focus {
  outline: 2px solid rgba(218, 0, 0, 0.18);
  border-color: var(--al-red);
  background: var(--al-white);
}

.al-quicklog-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease, margin-top 0.35s ease;
  margin-top: 0;
}

.al-quicklog.is-expanded .al-quicklog-expand {
  grid-template-rows: 1fr;
  margin-top: 8px;
}

.al-quicklog-expand-inner {
  overflow: hidden;
  min-height: 0;
}

.al-quicklog-extra {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--al-line);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease 0.05s, transform 0.35s ease;
}

.al-quicklog.is-expanded .al-quicklog-extra {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 720px) {
  .al-quicklog-extra {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .al-quicklog-field--notes { grid-column: span 3; }
  .al-quicklog-field--checks { grid-column: span 2; }
  .al-quicklog-field--seen-with { grid-column: 1 / -1; }
}

.al-seen-with {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.al-seen-with-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
}

.al-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f0ea;
  color: #2f5d3a;
  font-size: 0.78rem;
  font-weight: 600;
}

.al-chip.is-locked {
  background: #f0ece8;
  color: var(--al-muted);
}

.al-chip-remove {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 2px;
}

.al-add-viewer-search {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 280px;
  position: relative;
}

.al-bulk-add-user {
  position: relative;
}

.al-quicklog-field--checks {
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.al-quicklog-field--checks .al-check {
  font-size: 0.8rem;
}

.al-quicklog-submit {
  padding: 7px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--al-red);
  color: var(--al-white);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  height: 34px;
  min-width: 88px;
}

.al-quicklog-submit:hover {
  background: var(--al-burgundy);
}

.al-quicklog-status {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--al-muted);
  min-height: 1.1em;
}

.al-quicklog-status.is-success { color: #0d7a42; }
.al-quicklog-status.is-error { color: var(--al-red); }

.al-quicklog-mode {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.al-quicklog-mode-btn {
  border: 1px solid var(--al-line);
  background: transparent;
  color: var(--al-muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.al-quicklog-mode-btn.is-active {
  background: var(--al-black);
  border-color: var(--al-black);
  color: #fff;
}

.al-quicklog.is-off-theater [data-theater-only] {
  display: none !important;
}

.al-quicklog-hint {
  margin: 4px 0 0;
  font-size: 0.74rem;
}

.al-section-title {
  margin: 0;
  font-family: var(--al-font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.al-panel--watchlist {
  margin-bottom: 12px;
  padding: 10px 12px;
  overflow: visible;
}

.al-panel--tv {
  overflow: hidden;
}

.al-watchlist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.al-watchlist-header--compact {
  align-items: center;
  margin-bottom: 6px;
}

.al-rank-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.al-watchlist-segment {
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  display: flex;
}

.al-watchlist-segment .al-segment-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.al-segment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.68rem;
  line-height: 1.4;
}

.al-segment-btn.is-active .al-segment-count {
  background: rgba(218, 0, 0, 0.12);
  color: var(--al-red);
}

.al-watchlist-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.al-already-out-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--al-line);
  background: var(--al-panel-2);
  color: var(--al-text);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.al-already-out-btn:hover {
  border-color: var(--al-red);
  color: var(--al-red);
}

.al-already-out-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--al-red);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.4;
}

.al-already-out-btn--empty .al-already-out-count {
  background: var(--al-muted);
}

.al-watchlist-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-bottom: 4px;
}

.al-watchlist-add .al-input {
  padding: 6px 8px;
  font-size: 0.86rem;
  min-height: 34px;
}

.al-watchlist-add .al-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  min-height: 34px;
}

.al-watchlist-add-field {
  position: relative;
}

.al-watchlist-status {
  min-height: 1em;
  margin: 0 0 6px;
  font-size: 0.76rem;
}

.al-watchlist-scroll-hint {
  margin: 2px 0 12px;
  font-size: 0.7rem;
}

.al-watchlist-strip-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 -2px;
  padding: 0 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.al-watchlist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.al-watchlist-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  overflow: visible;
  padding: 4px 0 10px;
  margin: 0;
  align-items: flex-start;
  scroll-snap-type: x proximity;
}

.al-watchlist-strip-item {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  outline: none;
  cursor: default;
  scroll-snap-align: start;
}

.al-watchlist-strip-poster {
  position: relative;
  width: 64px;
  height: 96px;
  flex-shrink: 0;
}

.al-watchlist-strip-item .al-poster--watchlist-strip,
.al-watchlist-strip-item .al-poster--empty {
  display: block;
  width: 64px;
  height: 96px;
  max-width: none;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.al-watchlist-strip-item:hover .al-poster--watchlist-strip,
.al-watchlist-strip-item:focus-within .al-poster--watchlist-strip,
.al-watchlist-strip-item.is-open .al-poster--watchlist-strip {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(28, 28, 28, 0.16);
}

.al-watchlist-strip-date {
  display: block;
  width: 100%;
  min-height: 2.3em;
  font-family: var(--al-font-mono);
  font-size: 0.6rem;
  line-height: 1.25;
  text-align: center;
  color: var(--al-muted);
  white-space: normal;
  overflow: hidden;
}

.al-watchlist-popup {
  position: absolute;
  z-index: 80;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 12px 14px;
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(28, 28, 28, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.al-watchlist-popup-title {
  display: block;
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--al-text);
}

.al-watchlist-popup-date {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
}

.al-watchlist-strip-item:hover .al-watchlist-popup,
.al-watchlist-strip-item:focus-within .al-watchlist-popup,
.al-watchlist-strip-item.is-open .al-watchlist-popup {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.al-watchlist-popup-notes {
  margin: 6px 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

.al-watchlist-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.al-watchlist-popup-actions .al-link-btn {
  font-size: 0.78rem;
}

.al-watchlist-empty {
  margin: 0;
  font-size: 0.82rem;
}

.al-watchlist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border-bottom: 1px solid var(--al-line);
}

.al-watchlist-row:last-child {
  border-bottom: 0;
}

.al-poster--watchlist-sm {
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.al-watchlist-row-body {
  min-width: 0;
  flex: 1;
}

.al-watchlist-row-title {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.al-watchlist-row-meta {
  margin: 1px 0 0;
  font-size: 0.72rem;
}

.al-watchlist-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.al-watchlist-row-actions .al-link-btn {
  font-size: 0.76rem;
}

/* Legacy card styles kept for any residual markup */
.al-watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.al-watchlist-card {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--al-line);
  border-radius: 10px;
  background: #fff;
}

.al-watchlist-card-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  line-height: 1.25;
}

.al-watchlist-card-notes {
  margin: 0 0 6px;
  font-size: 0.8rem;
}

.al-watchlist-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Mobile key-stats header (title + home + stats at top) */
.al-mobile-header {
  display: none;
}

.al-mobile-stats {
  display: none;
}


.al-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: middle;
}

.al-badge--muted {
  background: #f0ece8;
  color: var(--al-muted);
}

.al-badge--together {
  background: #e8f0ea;
  color: #2f5d3a;
}

.al-panel--invites {
  margin-bottom: 16px;
  padding: 14px 18px;
}

.al-panel--invites.is-collapsed {
  padding: 12px 18px;
}

.al-invites-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  min-height: 2rem;
}

.al-invites-toggle:focus-visible {
  outline: 2px solid var(--al-burgundy);
  outline-offset: 2px;
  border-radius: 6px;
}

.al-invites-toggle-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.al-invites-header {
  margin-bottom: 12px;
}

.al-invites-title {
  margin: 0;
  font-family: var(--al-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.al-invites-count {
  font-size: 0.88rem;
  color: var(--al-muted);
  font-weight: 500;
  line-height: 1.3;
}

.al-invites-chevron {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--al-muted);
  border-bottom: 2px solid var(--al-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-right: 2px;
}

.al-invites-toggle[aria-expanded="true"] .al-invites-chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}

.al-invites-body {
  padding-top: 10px;
  padding-bottom: 2px;
}

.al-invites-help {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.al-invites-subhead {
  margin: 14px 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--al-muted);
}

.al-invites-outgoing-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--al-muted);
  font-size: 0.9rem;
}

.al-invites-outgoing-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--al-rule, #e6e0d8);
}

.al-invites-outgoing-item:first-child {
  border-top: 0;
  padding-top: 2px;
}

.al-invites-outgoing-text {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.4;
  color: var(--al-charcoal, #1c1c1c);
}

.al-invites-outgoing-text strong {
  font-weight: 600;
}

.al-invites-cancel {
  flex: 0 0 auto;
  margin-top: 1px;
}

.al-invites-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.al-invite-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--al-rule, #e6e0d8);
}

.al-invite-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.al-invite-card-title {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.al-invite-card-body {
  min-width: 0;
}

.al-invite-card-body .al-muted {
  margin: 0;
  font-size: 0.85rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.al-invite-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.al-add-viewer {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px 16px;
  border: 1px solid var(--al-line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #faf8f5;
  margin-top: -8px;
}

.al-add-viewer:has(+ .al-log-detail) {
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  padding-bottom: 12px;
}

.al-add-viewer-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.al-add-viewer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.al-add-viewer-row .al-input {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 260px;
  width: 100%;
}

.al-add-viewer-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .al-invite-card {
    grid-template-columns: auto 1fr;
  }

  .al-invite-card-actions {
    grid-column: 1 / -1;
  }

  .al-invite-card-actions .al-btn {
    flex: 1 1 auto;
  }
}

.al-page-header {
  margin-bottom: 16px;
}

.al-page-title {
  margin: 0;
  font-family: var(--al-font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--al-black);
}

.al-page-sub {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--al-muted);
}

.al-main {
  flex: 1 1 auto;
  padding-bottom: 28px;
}

.al-panel {
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  border-radius: var(--al-radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.al-panel h2 {
  margin: 0 0 10px;
  font-family: var(--al-font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.al-insight .al-insight-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
}

.al-insight.is-expanded .al-insight-header {
  margin-bottom: 12px;
}

.al-insight-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.al-insight-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.al-insight-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--al-muted);
}

.al-insight-toggle h2 {
  margin: 0;
  font-size: 1.12rem;
}

.al-insight-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--al-muted);
  border-bottom: 2px solid var(--al-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.al-insight.is-expanded .al-insight-chevron {
  transform: rotate(45deg);
}

.al-insight-body {
  display: none;
}

.al-insight.is-expanded .al-insight-body {
  display: block;
}

.al-insight-actions {
  flex-shrink: 0;
}

.al-main--insights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.al-main--insights > .al-panel {
  margin-bottom: 0;
}

.al-insights-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.al-insights-overview > .al-insight {
  min-width: 0;
  margin-bottom: 0;
}

@media (min-width: 1080px) {
  .al-insights-overview {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    align-items: start;
  }
}

.al-insights-spotlight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 2px;
}

@media (min-width: 560px) and (max-width: 1099px) {
  .al-insights-spotlight {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .al-insights-spotlight--value,
  .al-insights-spotlight--habits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .al-insights-spotlight {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }

  .al-insights-spotlight--value,
  .al-insights-spotlight--habits {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.al-insights-spot {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--al-line);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(250, 246, 239, 0.96)),
    var(--al-panel);
}

.al-insights-spot::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--al-burgundy);
  opacity: 0.55;
}

.al-insights-spot.is-accent::before { background: var(--al-red); opacity: 0.85; }
.al-insights-spot.is-good::before { background: #0d7a42; opacity: 0.8; }
.al-insights-spot.is-warn::before { background: #a85b00; opacity: 0.8; }

.al-insights-spot-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--al-muted);
}

.al-insights-spot-value {
  margin: 6px 0 4px;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--al-black);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.al-insights-spot-note {
  margin: 0;
  font-size: 0.74rem;
  color: var(--al-muted);
  line-height: 1.3;
}

.al-insight {
  border-color: rgba(28, 28, 28, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.al-insight.is-expanded {
  border-color: rgba(131, 15, 16, 0.18);
  box-shadow: 0 8px 24px rgba(28, 28, 28, 0.05);
}

.al-insight-lede {
  margin: 0 0 8px;
}

.al-rating-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.al-rating-summary > div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--al-line);
  border-radius: 9px;
  background: var(--al-panel-2);
}

.al-rating-summary span,
.al-rating-summary strong {
  display: block;
}

.al-rating-summary span {
  margin-bottom: 3px;
  color: var(--al-muted);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.al-rating-summary strong {
  font-family: var(--al-font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.al-rating-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.al-rating-bar-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 2rem;
  gap: 10px;
  align-items: center;
  padding: 4px 2px;
  border-radius: 8px;
  cursor: default;
}

.al-rating-bar-row.al-hover-target {
  display: grid;
}

.al-rating-bar-row:hover,
.al-rating-bar-row:focus-within {
  background: rgba(218, 0, 0, 0.04);
}

.al-rating-bar-label {
  font-family: var(--al-font-mono);
  font-size: 0.82rem;
  font-weight: 500;
}

.al-rating-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(28, 28, 28, 0.06);
  overflow: hidden;
}

.al-rating-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--al-burgundy), var(--al-red));
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.al-rating-bar-count {
  font-family: var(--al-font-mono);
  font-size: 0.78rem;
  text-align: right;
  color: var(--al-muted);
}

.al-theater-rating-list,
.al-format-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.al-theater-rating-row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.al-theater-rating-rank {
  font-family: var(--al-font-mono);
  font-size: 0.78rem;
  color: var(--al-muted);
  padding-top: 2px;
}

.al-theater-rating-body,
.al-format-row {
  min-width: 0;
}

.al-theater-rating-top,
.al-format-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.al-theater-rating-top > .al-hover-target,
.al-theater-rating-top > span:first-child,
.al-format-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.al-theater-rating-score,
.al-format-charged {
  flex-shrink: 0;
  font-family: var(--al-font-mono);
  font-size: 0.92rem;
  font-weight: 500;
}

.al-theater-rating-score {
  color: var(--al-burgundy);
}

.al-theater-rating-meta,
.al-format-meta {
  margin: 2px 0 6px;
  font-size: 0.74rem;
}

.al-format-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.al-meter--theater,
.al-meter--format {
  height: 7px;
  margin-top: 0;
}

.al-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--al-red);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.al-meter--theater .al-meter-fill {
  background: linear-gradient(90deg, #a31214, var(--al-red));
}

.al-meter--format .al-meter-fill {
  background: linear-gradient(90deg, var(--al-charcoal), var(--al-burgundy));
}

.al-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

@media (min-width: 720px) {
  .al-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .al-hud-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.al-stat {
  background: var(--al-panel-2);
  border: 1px solid var(--al-line);
  border-radius: 8px;
  padding: 10px 10px 8px;
  min-width: 0;
}

.al-stat-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--al-muted);
}

.al-stat-value {
  margin-top: 2px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--al-black);
  font-family: var(--al-font-mono);
  font-variant-numeric: tabular-nums;
}

.al-stat-value.is-savings { color: #0d7a42; }
.al-stat-value.is-cost { color: var(--al-burgundy); }

.al-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--al-line);
  background: var(--al-white);
  color: var(--al-text);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.al-btn:hover { border-color: var(--al-charcoal); }
.al-btn-primary {
  background: var(--al-red);
  border-color: var(--al-red);
  color: var(--al-white);
}
.al-btn-primary:hover { background: var(--al-burgundy); border-color: var(--al-burgundy); }

.al-table-wrap { overflow-x: auto; }

table.al-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.al-table th,
.al-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--al-line);
  text-align: left;
  vertical-align: top;
}

.al-table th {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--al-muted);
  font-family: var(--al-font-body);
  white-space: nowrap;
}

.al-table tr:hover td { background: rgba(0,0,0,0.02); }

.al-table .num {
  text-align: right;
  font-family: var(--al-font-mono);
  white-space: nowrap;
}

.al-leaderboard-table .al-leaderboard-rank {
  width: 2rem;
  color: var(--al-muted);
}

.al-profiles-panel h2 {
  margin: 0 0 2px;
}

.al-profile-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
}

.al-profile-toolbar .al-muted {
  margin: 0;
}

.al-profile-sort-field {
  min-width: min(100%, 200px);
  margin: 0;
}

.al-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.al-profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--al-line);
  border-radius: calc(var(--al-radius) + 2px);
  background: var(--al-panel-2);
}

.al-profile-card.is-you {
  border-color: rgba(218, 0, 0, 0.22);
  background: rgba(218, 0, 0, 0.03);
}

.al-profile-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.al-profile-rank {
  font-family: var(--al-font-mono);
  font-size: 0.72rem;
  color: var(--al-muted);
}

.al-profile-name {
  margin: 0;
  font-family: var(--al-font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.al-profile-name a {
  color: inherit;
  text-decoration: none;
}

.al-profile-name a:hover {
  color: var(--al-burgundy);
}

.al-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 0;
}

.al-profile-stat dt {
  margin: 0 0 2px;
  font-size: 0.68rem;
  color: var(--al-muted);
}

.al-profile-stat dd {
  margin: 0;
  font-family: var(--al-font-mono);
  font-size: 0.92rem;
  font-weight: 500;
}

.al-profile-view {
  align-self: flex-start;
  margin-top: auto;
  color: var(--al-burgundy);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.al-profile-view:hover {
  color: var(--al-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.al-leaderboard-table .num {
  text-align: left;
}

.al-leaderboard-table .al-sort-btn {
  text-align: left;
}

.al-leaderboard-name {
  font-weight: 500;
  white-space: nowrap;
}

.al-leaderboard-member-link {
  color: inherit;
  text-decoration: none;
}

.al-leaderboard-member-link:hover {
  color: var(--al-red);
  text-decoration: underline;
}

.al-leaderboard-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.al-member-back {
  margin: 0 0 12px;
}

.al-member-stats .al-section-title {
  margin: 0 0 12px;
}

.al-member-period {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--al-line);
}

.al-member-period-title {
  margin: 0 0 8px;
  font-family: var(--al-font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.al-member-compare {
  margin-top: 12px;
}

.al-log-list--readonly {
  grid-template-columns:
    36px
    6.75rem
    minmax(7rem, 1.15fr)
    minmax(8rem, 1.2fr)
    4.75rem
    6.25rem
    4.75rem
    3.25rem;
}

.al-leaderboard-table tr.is-you td {
  background: rgba(218, 0, 0, 0.04);
}

.al-you-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(218, 0, 0, 0.1);
  color: var(--al-burgundy);
  vertical-align: middle;
}

.al-sortable {
  padding: 0;
}

.al-sort-btn {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
  white-space: nowrap;
}

.al-sort-btn:hover,
.al-sortable.is-active .al-sort-btn {
  color: var(--al-ink);
}

.al-leaderboard-actions {
  width: 1%;
  white-space: nowrap;
}

.al-leaderboard-table tr.is-compare-target td {
  background: rgba(218, 0, 0, 0.06);
}

.al-compare-row-btn {
  padding: 4px 10px;
  font-size: 0.72rem;
}

.al-compare-panel {
  margin-top: 16px;
}

.al-compare-lead {
  margin: -4px 0 12px;
}

.al-compare-toolbar {
  margin-bottom: 0;
  align-items: flex-end;
}

.al-compare-field {
  flex: 1 1 220px;
  max-width: 280px;
  margin: 0;
}

.al-compare-select {
  width: 100%;
}

.al-compare-status {
  margin: 10px 0 0;
}

.al-compare-results {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--al-line);
}

.al-compare-section + .al-compare-section {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}

.al-compare-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.al-compare-section-head h3 {
  margin: 0;
  font-family: var(--al-font-display);
  font-size: 1rem;
  font-weight: 600;
}

.al-compare-section > .al-muted {
  margin: 2px 0 10px;
}

.al-compare-count {
  font-family: var(--al-font-mono);
  font-size: 0.72rem;
  color: var(--al-muted);
}

.al-poster-strip-meta {
  font-family: var(--al-font-mono);
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
  color: var(--al-burgundy);
}

.al-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  background: rgba(218,0,0,0.08);
  color: var(--al-burgundy);
  border: 1px solid rgba(218,0,0,0.18);
}

.al-muted { color: var(--al-muted); font-size: 0.82rem; }
.al-error { color: var(--al-red); }

.al-marketing h2 { font-size: 1.15rem; margin: 0 0 10px; }
.al-bullets { margin: 0; padding-left: 1.1rem; color: var(--al-muted); font-size: 0.88rem; }
.al-bullets li + li { margin-top: 4px; }

.al-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 8px;
}

.al-toolbar--log {
  margin-bottom: 10px;
}

.al-toolbar-search {
  flex: 1 1 200px;
  max-width: 280px;
  min-width: 0;
}

.al-toolbar-filter { max-width: 180px; }
.al-toolbar-filter--format { max-width: 140px; }

.al-toolbar--log .al-muted {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.78rem;
}

/* Desktop: search + filters stay inline in the toolbar flex wrap. */
.al-log-search-row,
.al-log-filters,
.al-log-filters-sheet,
.al-log-filters-body {
  display: contents;
}

.al-log-filter-btn,
.al-log-filters-backdrop,
.al-log-filters-head {
  display: none;
}

.al-bulk-ratings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.al-bulk-ratings-head,
.al-bulk-ratings-row {
  display: grid;
  grid-template-columns: 44px 88px minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
}

.al-bulk-ratings-head {
  padding: 0 8px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--al-muted);
}

.al-bulk-ratings-row {
  padding: 8px;
  border-radius: 10px;
  background: var(--al-panel-2);
  border: 1px solid transparent;
}

.al-bulk-ratings-row.is-changed {
  border-color: rgba(218, 0, 0, 0.25);
  background: #fff8f6;
}

.al-bulk-ratings-col--title {
  min-width: 0;
  font-weight: 600;
}

.al-bulk-ratings-col--date {
  font-family: var(--al-font-mono);
  font-size: 0.78rem;
  color: var(--al-muted);
}

.al-bulk-rating-select {
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.al-main--bulk-ratings.has-bulk-bar {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.al-bulk-ratings-bar {
  position: fixed;
  z-index: 50;
  left: 8px;
  right: 8px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  box-shadow: 0 8px 24px rgba(28, 28, 28, 0.08);
}

.al-bulk-ratings-bar[hidden] {
  display: none;
}

.al-bulk-ratings-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .al-main--bulk-ratings.has-bulk-bar {
    padding-bottom: 72px;
  }

  .al-bulk-ratings-bar {
    left: calc(16px + 300px + 16px);
    right: 40px;
    bottom: 16px;
  }
}

@media (min-width: 1024px) {
  .al-bulk-ratings-bar {
    left: calc(16px + 340px + 16px);
  }
}

@media (max-width: 640px) {
  .al-bulk-ratings-head { display: none; }

  .al-bulk-ratings-row {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "poster title"
      "poster rating";
    gap: 6px 10px;
  }

  .al-bulk-ratings-row .al-col-poster { grid-area: poster; }
  .al-bulk-ratings-col--title { grid-area: title; }
  .al-bulk-ratings-col--date { display: none; }
  .al-bulk-ratings-col--rating { grid-area: rating; }
}

.al-main--bulk-add.has-bulk-bar {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.al-toolbar--bulk-add {
  flex-wrap: wrap;
}

.al-bulk-add-user {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
}

.al-bulk-add-head,
.al-bulk-add-row {
  grid-template-columns: 28px 44px 88px minmax(0, 1.2fr) minmax(0, 1fr) 72px;
}

.al-bulk-add-row {
  cursor: pointer;
}

.al-bulk-add-row.is-selected {
  border-color: rgba(47, 93, 58, 0.28);
  background: #f3f8f4;
}

.al-bulk-add-row.is-tagged {
  opacity: 0.72;
  cursor: default;
}

.al-bulk-add-col-check {
  display: flex;
  justify-content: center;
}

.al-bulk-add-col-theater {
  min-width: 0;
  font-size: 0.85rem;
}

.al-bulk-add-col-ticket {
  font-family: var(--al-font-mono);
  font-size: 0.82rem;
  text-align: right;
}

@media (min-width: 768px) {
  .al-main--bulk-add.has-bulk-bar {
    padding-bottom: 72px;
  }
}

@media (max-width: 640px) {
  .al-bulk-add-row {
    grid-template-columns: 24px 40px minmax(0, 1fr);
    grid-template-areas:
      "check poster title"
      "check poster meta";
  }

  .al-bulk-add-row .al-bulk-add-col-check { grid-area: check; }
  .al-bulk-add-row .al-col-poster { grid-area: poster; }
  .al-bulk-add-row .al-bulk-ratings-col--title { grid-area: title; }
  .al-bulk-add-row .al-bulk-add-col-theater {
    grid-area: meta;
    display: block;
  }
  .al-bulk-add-row .al-bulk-ratings-col--date,
  .al-bulk-add-row .al-bulk-add-col-ticket {
    display: none;
  }
}

.al-input,
.al-select,
.al-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--al-line);
  background: var(--al-white);
  color: var(--al-text);
  font: inherit;
}

.al-input:focus,
.al-select:focus,
.al-textarea:focus {
  outline: 2px solid rgba(218,0,0,0.25);
  border-color: var(--al-red);
}

.al-form-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .al-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .al-form-grid .span-2 { grid-column: span 2; }
}

.al-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--al-muted);
  margin-bottom: 4px;
}

.al-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.al-check--block {
  align-items: flex-start;
  line-height: 1.35;
  margin-top: 10px;
}

.al-panel--setup {
  border-color: color-mix(in srgb, var(--al-burgundy) 35%, var(--al-line));
  background: color-mix(in srgb, var(--al-burgundy) 6%, var(--al-panel));
}

.al-howto-title {
  margin: 0 0 8px;
  font-family: var(--al-font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.al-howto-intro {
  margin: 0 0 12px;
}

.al-howto-summary {
  cursor: pointer;
  font-family: var(--al-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--al-black);
  list-style: none;
}

.al-howto-summary::-webkit-details-marker {
  display: none;
}

.al-howto-summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.al-howto-details[open] > .al-howto-summary::before {
  transform: rotate(90deg);
}

.al-howto-body {
  margin-top: 12px;
}

.al-howto-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 10px;
  color: var(--al-text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.al-howto-steps li::marker {
  color: var(--al-burgundy);
  font-weight: 600;
}

.al-howto-steps a {
  color: var(--al-burgundy);
  font-weight: 600;
  text-decoration: none;
}

.al-howto-steps a:hover {
  text-decoration: underline;
}

.al-howto-steps code {
  font-family: var(--al-font-mono);
  font-size: 0.85em;
}

.al-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--al-line);
  background: transparent;
  color: var(--al-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.al-toggle-btn:hover {
  color: var(--al-text);
  border-color: var(--al-charcoal);
}

.al-toggle-btn.is-active,
.al-toggle-btn[aria-pressed="true"] {
  background: var(--al-black);
  border-color: var(--al-black);
  color: #fff;
}

.al-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  margin-top: 6px;
}

.al-meter > span {
  display: block;
  height: 100%;
  background: var(--al-red);
  border-radius: inherit;
  transition: width 0.6s ease;
}

.al-search-results {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  border-radius: 8px;
  max-height: 220px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.al-quicklog .al-search-results {
  z-index: 40;
}

.al-search-results button {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.al-search-results button:hover { background: var(--al-panel-2); }

.al-search-wrap { position: relative; }

.al-toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--al-black);
  color: var(--al-white);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  transition: transform 0.25s ease;
  z-index: 50;
}

.al-toast.is-visible { transform: translateX(-50%) translateY(0); }

.al-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  justify-content: flex-start;
}
.al-link-btn {
  background: none;
  border: 0;
  color: var(--al-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.al-link-btn:hover { color: var(--al-red); }

.al-log-list-wrap { overflow-x: auto; }

.al-log-list {
  display: grid;
  grid-template-columns:
    44px
    7.25rem
    minmax(7rem, 1.25fr)
    minmax(4.25rem, 0.65fr)
    minmax(5.25rem, 0.8fr)
    4.25rem
    5rem
    4.25rem
    3.1rem
    minmax(5.5rem, 6.5rem);
  column-gap: 10px;
  row-gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 54rem;
}

.al-log-list > .al-log-head .al-col-poster,
.al-log-list > .al-log-entry .al-col-poster,
.al-log-row .al-col-poster {
  width: 44px;
  padding-right: 8px !important;
}

.al-log-head {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  padding: 0 14px 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--al-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.al-log-head .al-log-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.al-log-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  padding: 10px 14px;
  background: var(--al-panel-2);
  border: 1px solid var(--al-line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(28, 28, 28, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.al-log-row:hover {
  border-color: rgba(28, 28, 28, 0.16);
  box-shadow: 0 4px 14px rgba(28, 28, 28, 0.08);
}

.al-log-col {
  text-align: left;
  justify-self: start;
  min-width: 0;
  line-height: 1.35;
}

.al-log-col--date {
  white-space: nowrap;
  overflow: visible;
}

.al-log-col--title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.al-log-col--body {
  display: contents;
}

.al-log-col--num {
  font-family: var(--al-font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.al-log-col--with,
.al-log-col--with-head {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.al-log-head .al-log-col--with-head {
  font-size: 0.72rem;
}

.al-log-col--desktop.al-muted,
.al-log-col--format,
.al-log-col--seat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.al-log-row .al-row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 2px 6px;
  min-width: 0;
}

@media (min-width: 768px) and (max-width: 1200px) {
  .al-log-list {
    grid-template-columns:
      44px
      7rem
      minmax(6rem, 1.3fr)
      minmax(3.75rem, 0.7fr)
      minmax(4.75rem, 0.75fr)
      4rem
      4.25rem
      3rem
      minmax(5.25rem, 6.25rem);
    min-width: 46rem;
    column-gap: 8px;
  }

  .al-log-col--seat {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 920px) {
  .al-log-list {
    grid-template-columns:
      44px
      6.75rem
      minmax(5.5rem, 1.35fr)
      minmax(3.5rem, 0.65fr)
      minmax(4.5rem, 0.75fr)
      4rem
      3rem
      minmax(5rem, 6rem);
    min-width: 40rem;
  }

  .al-log-col--format {
    display: none;
  }
}

.al-log-entry {
  display: contents;
}

.al-log-row--clickable {
  cursor: pointer;
}

.al-log-row--clickable:focus-visible {
  outline: 2px solid var(--al-burgundy);
  outline-offset: 2px;
}

.al-log-row.is-expanded {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}

.al-log-row.is-expanded:hover {
  box-shadow: none;
}

.al-log-row:has(+ .al-add-viewer) {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}

.al-log-row:has(+ .al-add-viewer):hover {
  box-shadow: none;
}

.al-log-detail {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 14px 14px;
  background: var(--al-panel-2);
  border: 1px solid var(--al-line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  margin-top: -8px;
  box-shadow: 0 4px 14px rgba(28, 28, 28, 0.08);
}

.al-log-detail-inner {
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  border-radius: 10px;
  padding: 14px 16px;
}

.al-log-detail-title {
  margin: 0 0 14px;
  font-family: var(--al-font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}

.al-log-detail-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.al-log-detail-meta {
  flex: 1;
  min-width: 0;
}

.al-log-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.al-log-detail-fact {
  background: var(--al-panel-2);
  border: 1px solid var(--al-line);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}

.al-log-detail-facts dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--al-muted);
}

.al-log-detail-facts dd {
  margin: 4px 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--al-text);
}

.al-log-detail-overview-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--al-line);
}

.al-log-detail-subhead {
  margin: 0 0 8px;
  font-family: var(--al-font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.al-log-detail-overview {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--al-charcoal);
}

.al-poster--detail {
  flex-shrink: 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(28, 28, 28, 0.1);
}


.al-log-row--editing {
  display: block;
  grid-column: 1 / -1;
  padding: 14px;
}

.al-log-edit-form {
  margin: 0;
}

.al-stat-category {
  min-width: 0;
  padding-top: 4px;
}

.al-stat-category + .al-stat-category {
  padding-top: 12px;
  border-top: 1px solid rgba(28, 28, 28, 0.08);
}

.al-stat-category-head {
  margin-bottom: 10px;
}

.al-stat-category-head h2 {
  margin: 1px 0 3px;
  color: var(--al-black);
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 600;
}

.al-stat-category-head p {
  max-width: 700px;
  margin: 0;
  color: var(--al-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.al-stat-category-head .al-stat-category-kicker {
  color: var(--al-burgundy);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.al-stat-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr));
  gap: 10px;
}

.al-stat-block {
  min-width: 0;
  margin-bottom: 0;
}

.al-stat-block h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
}

.al-stat-category > .al-insights-spotlight {
  margin-bottom: 10px;
}

.al-insight-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.al-insight-stack > .al-insight {
  width: 100%;
  min-width: 0;
}

.al-insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.al-insight-grid > .al-insight {
  height: fit-content;
  min-width: 0;
}

.al-rank-table .al-rank-num {
  width: 1.75rem;
  color: var(--al-muted);
  font-variant-numeric: tabular-nums;
}

.al-rank-table td,
.al-rank-table th {
  padding-top: 6px;
  padding-bottom: 6px;
}

.al-stats-table {
  width: 100%;
  table-layout: fixed;
}

.al-stats-table th,
.al-stats-table td {
  box-sizing: border-box;
  vertical-align: middle;
}

.al-stats-table .al-rank-col {
  width: 2rem;
  padding-right: 4px;
  padding-left: 2px;
  color: var(--al-muted);
  text-align: center;
  font-family: var(--al-font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.al-stats-table .al-card-primary {
  overflow-wrap: anywhere;
  font-weight: 600;
  line-height: 1.3;
}

.al-stats-table .al-card-primary .al-hover-target {
  max-width: 100%;
}

.al-stats-table .al-stat-col--count {
  width: 4rem;
}

.al-stats-table .al-stat-col--percent {
  width: 4.5rem;
}

.al-stats-table .al-stat-col--money {
  width: 6.5rem;
}

.al-stats-table .al-stat-col--rating {
  width: 6rem;
}

.al-stats-table--rewatch th:nth-child(2),
.al-stats-table--rewatch td:nth-child(2) {
  width: 4.25rem;
}

.al-stats-table--rewatch th:nth-child(3),
.al-stats-table--rewatch td:nth-child(3) {
  width: 48%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.al-insight .al-rank-table {
  margin-top: 4px;
}

.al-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.al-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.al-bar > i {
  display: block;
  height: 100%;
  background: var(--al-red);
}

.al-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.al-panel-head h2 {
  margin: 0;
}

.al-segment {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--al-line);
  background: var(--al-panel-2);
}

.al-segment-btn {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--al-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.al-segment-btn:hover {
  color: var(--al-text);
}

.al-segment-btn.is-active {
  background: var(--al-white);
  color: var(--al-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.al-view-panel.is-hidden {
  display: none;
}

.al-by-month-hint {
  margin: -4px 0 10px;
}

.al-by-actor-hint {
  margin: -4px 0 10px;
}

.al-hint-touch { display: none; }

@media (hover: none) {
  .al-hint-hover { display: none; }
  .al-hint-touch { display: inline; }
}

.al-by-month .al-table-wrap {
  overflow: visible;
}

.al-by-month .al-month-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.al-by-month .al-th-short {
  display: none;
}

.al-insight .al-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.al-insight .al-table-wrap--cards {
  overflow: visible;
}

.al-insight .al-table-wrap--month {
  overflow: hidden;
}

.al-insight .al-card-table {
  width: 100%;
  min-width: 0;
}

.al-card-primary {
  min-width: 0;
}

.al-card-rank {
  display: inline-block;
  min-width: 1.25rem;
  margin-right: 6px;
  font-family: var(--al-font-mono);
  font-size: 0.78rem;
  color: var(--al-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .al-by-month .al-table-wrap--month {
    overflow: hidden;
    margin: 0 -2px;
  }

  .al-by-month .al-month-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.68rem;
  }

  .al-by-month .al-month-table thead {
    display: table-header-group;
  }

  .al-by-month .al-month-table tbody,
  .al-by-month .al-month-table tfoot {
    display: table-row-group;
  }

  .al-by-month .al-month-table tr.al-month-row,
  .al-by-month .al-month-table tr.al-month-total {
    display: table-row !important;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    grid-template-columns: none;
    gap: 0;
  }

  .al-by-month .al-month-table th,
  .al-by-month .al-month-table td {
    display: table-cell;
    padding: 6px 3px;
    border-bottom: 1px solid var(--al-line) !important;
    font-size: 0.68rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  .al-by-month .al-month-table th:first-child,
  .al-by-month .al-month-table td:first-child {
    width: 22%;
    padding-left: 2px;
    white-space: nowrap;
    font-weight: 600;
  }

  .al-by-month .al-month-table th.num,
  .al-by-month .al-month-table td.num {
    width: 19.5%;
    padding-right: 2px;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
  }

  .al-by-month .al-th-full {
    display: none;
  }

  .al-by-month .al-th-short {
    display: inline;
  }

  .al-by-month .al-month-table tfoot th {
    border-top: 2px solid var(--al-line);
    padding-top: 8px;
  }

  .al-insight .al-table-wrap--cards {
    overflow: visible;
  }

  .al-insight .al-card-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .al-insight .al-card-table thead {
    display: none;
  }

  .al-insight .al-card-table tbody,
  .al-insight .al-card-table tfoot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .al-insight .al-card-table tbody tr,
  .al-insight .al-card-table tfoot tr {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background: var(--al-panel-2);
    border: 1px solid var(--al-line);
    border-radius: 12px;
    box-shadow: none;
  }

  .al-insight .al-card-table tr.al-month-total {
    background: rgba(131, 15, 16, 0.04);
    border-color: rgba(131, 15, 16, 0.14);
  }

  .al-insight .al-card-table td,
  .al-insight .al-card-table tfoot th {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    padding: 0;
    border: 0 !important;
    text-align: left !important;
    white-space: normal;
    min-width: 0;
    width: auto;
    font-size: 0.88rem;
    line-height: 1.3;
  }

  .al-insight .al-card-table .al-card-primary {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--al-line) !important;
    font-family: var(--al-font-display);
    font-size: 1rem;
    font-weight: 600;
  }

  .al-insight .al-card-table tr.al-ranked-row {
    position: relative;
  }

  .al-insight .al-card-table tr.al-ranked-row .al-card-primary {
    padding-left: 28px;
  }

  .al-insight .al-card-table td.al-rank-col {
    position: absolute;
    top: 12px;
    left: 12px;
    display: block !important;
    width: 1.25rem;
    padding: 2px 0;
    color: var(--al-muted);
    text-align: left !important;
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .al-insight .al-card-table .al-card-span {
    grid-column: 1 / -1;
  }

  .al-insight .al-card-table td[data-label]::before,
  .al-insight .al-card-table tfoot th[data-label]::before {
    content: attr(data-label);
    font-family: var(--al-font-body);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--al-muted);
  }

  .al-insight .al-card-table .al-card-primary::before {
    content: none;
  }

  .al-insight .al-card-table .num {
    font-variant-numeric: tabular-nums;
  }

  .al-insight .al-card-table .al-card-rank {
    min-width: 1.1rem;
    margin-right: 2px;
    font-size: 0.8rem;
  }

  .al-month-row.al-hover-target:hover td,
  .al-month-row.al-hover-target:focus-within td,
  .al-rank-row.al-hover-target:hover td,
  .al-rank-row.al-hover-target:focus-within td {
    background: transparent;
  }

  .al-by-month .al-month-row.al-hover-target:hover td,
  .al-by-month .al-month-row.al-hover-target:focus-within td {
    background: rgba(0, 0, 0, 0.02);
  }

  .al-insight .al-card-table tbody tr:hover,
  .al-insight .al-card-table tbody tr:focus-within {
    border-color: rgba(218, 0, 0, 0.22);
  }

  /* Keep film popups on-screen as a bottom sheet */
  .al-insight .al-hover-popup {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(50vh, 320px);
    overflow: auto;
    z-index: 60;
    box-shadow: 0 12px 36px rgba(28, 28, 28, 0.22);
  }
}

.al-hover-target {
  position: relative;
  display: inline-block;
  cursor: default;
}

.al-hover-target--label {
  border-bottom: 1px dotted rgba(28, 28, 28, 0.22);
}

.al-month-row.al-hover-target {
  display: table-row;
}

.al-rank-row.al-hover-target {
  display: table-row;
}

.al-month-row.al-hover-target td:first-child,
.al-rank-row.al-hover-target td:first-child {
  position: relative;
}

.al-hover-popup {
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  max-width: 300px;
  padding: 10px 12px;
  background: var(--al-panel);
  border: 1px solid var(--al-line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(28, 28, 28, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  text-align: left;
}

.al-hover-target--label .al-hover-popup {
  left: 0;
}

.al-hover-target:hover .al-hover-popup,
.al-hover-target:focus-within .al-hover-popup,
.al-month-row.al-hover-target:hover .al-hover-popup,
.al-month-row.al-hover-target:focus-within .al-hover-popup,
.al-rank-row.al-hover-target:hover .al-hover-popup,
.al-rank-row.al-hover-target:focus-within .al-hover-popup,
.al-rating-bar-row.al-hover-target:hover .al-hover-popup,
.al-rating-bar-row.al-hover-target:focus-within .al-hover-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.al-month-row.al-hover-target:hover td,
.al-month-row.al-hover-target:focus-within td,
.al-rank-row.al-hover-target:hover td,
.al-rank-row.al-hover-target:focus-within td {
  background: rgba(218, 0, 0, 0.04);
}

.al-hover-popup-title {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--al-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.al-hover-popup-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.al-hover-popup-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.al-hover-popup-item-title {
  min-width: 0;
  font-weight: 500;
}

.al-hover-popup-item-date {
  flex-shrink: 0;
  color: var(--al-muted);
  font-family: var(--al-font-mono);
  font-size: 0.72rem;
}

.al-hover-popup--scroll .al-hover-popup-list {
  max-height: min(280px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.al-insight-hint {
  margin: -4px 0 10px;
  font-size: 0.82rem;
}

.al-month-table tfoot th {
  border-top: 2px solid var(--al-line);
  font-weight: 600;
  color: var(--al-text);
}

.al-month-table .is-savings { color: #0d7a42; }
.al-month-table .is-cost { color: var(--al-red); }

.al-empty {
  padding: 20px 10px;
  text-align: center;
  color: var(--al-muted);
  font-size: 0.88rem;
}

.al-tier-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--al-line);
}

.al-tier-header h2 {
  margin: 0 0 4px;
  font-family: var(--al-font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.al-tier-header .al-muted {
  margin: 0 0 10px;
}

.al-tier-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.al-tier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.al-tier-row--head {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--al-muted);
}

@media (max-width: 520px) {
  .al-tier-row {
    grid-template-columns: 1fr;
  }
  .al-tier-row--head { display: none; }
}

.al-tmdb-credit {
  margin: 8px 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.4);
}

.al-tmdb-credit a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.al-poster {
  display: block;
  border-radius: 4px;
  object-fit: cover;
  background: var(--al-panel-2);
  flex-shrink: 0;
}

.al-poster--empty {
  display: inline-block;
  border-radius: 4px;
  background: var(--al-panel-2);
  border: 1px dashed var(--al-line);
}

.al-col-poster {
  width: 36px;
  padding-right: 4px !important;
}

.al-poster-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.al-poster-strip-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
}

.al-poster-strip-item:hover .al-poster--strip {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(28, 28, 28, 0.12);
}

.al-poster--strip {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.al-poster-strip-label {
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
  color: var(--al-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.al-only-mobile { display: none; }

.al-mobile-nav { display: none; }

/* Mobile layout */
@media (max-width: 767px) {
  .page-main {
    padding: 8px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .al-content-scroll,
  .al-main,
  .al-panel,
  .al-panel--tv,
  .al-tv-add,
  .al-tv-add-row {
    max-width: 100%;
    min-width: 0;
  }

  .al-input,
  .al-select,
  .al-textarea,
  .al-quicklog-input,
  .al-watchlist-add .al-input,
  .al-toolbar-search,
  .al-toolbar-filter {
    font-size: 16px;
  }

  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .al-page-sub {
    max-width: 100%;
  }

  .al-mobile-header {
    display: block;
    flex-shrink: 0;
    order: 0;
  }

  .al-mobile-header-card {
    background: var(--al-burgundy);
    color: #fff;
    border-radius: 12px;
    padding: 8px 10px;
  }

  .al-mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    flex-wrap: wrap;
  }

  .al-mobile-header-title {
    font-family: var(--al-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .al-mobile-header-title:hover {
    color: #fff;
    opacity: 0.9;
  }

  .al-mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    max-width: 100%;
  }

  .al-mobile-home-link,
  .al-mobile-auth-link {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 0;
  }

  .al-mobile-home-link:hover,
  .al-mobile-auth-link:hover {
    color: #fff;
  }

  .al-content-scroll {
    order: 1;
    min-width: 0;
  }

  .al-sidebar {
    display: none;
  }

  .al-mobile-stats:not([hidden]) {
    display: block;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .al-mobile-stats-inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .al-mobile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
    text-align: center;
  }

  .al-mobile-stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.72;
    white-space: nowrap;
  }

  .al-mobile-stat-value {
    font-family: var(--al-font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
  }

  .al-mobile-stat-value.is-savings { color: #8fe8b8; }
  .al-mobile-stat-value.is-cost { color: #ffb4b4; }

  .al-page-header {
    margin-bottom: 12px;
  }

  .al-page-title {
    font-size: 1.45rem;
  }

  .al-page-sub {
    font-size: 0.88rem;
  }

  .al-main--insights {
    gap: 10px;
  }

  .al-insights-spotlight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .al-insights-spot {
    padding: 12px 12px 10px;
    border-radius: 12px;
  }

  .al-insights-spot-value {
    font-size: 1.05rem;
  }

  .al-insights-spot-note {
    font-size: 0.7rem;
  }

  .al-insight-stack,
  .al-insight-grid {
    gap: 10px;
  }

  .al-insight-toggle h2 {
    font-size: 1.02rem;
  }

  .al-rating-bar-row {
    grid-template-columns: 2rem minmax(0, 1fr) 1.75rem;
    gap: 8px;
  }

  .al-theater-rating-score,
  .al-format-charged {
    font-size: 0.86rem;
  }

  .al-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .al-quicklog {
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  .al-quicklog-primary {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .al-quicklog-field--submit {
    margin-top: 2px;
  }

  .al-quicklog-submit {
    width: 100%;
    height: 40px;
    min-height: 40px;
  }

  .al-quicklog-extra {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .al-quicklog-field--notes {
    grid-column: 1 / -1;
  }

  .al-quicklog-field--checks {
    grid-column: 1 / -1;
  }

  .al-quicklog-submit,
  .al-segment-btn,
  .al-mobile-nav-link {
    min-height: 40px;
  }

  .al-panel--watchlist {
    padding: 8px 10px;
  }

  .al-already-out-btn {
    font-size: 0.68rem;
    padding: 3px 8px;
  }


  .al-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .al-segment {
    width: 100%;
  }

  .al-segment-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 5px 6px;
    font-size: 0.7rem;
  }

  .al-segment-count {
    font-size: 0.65rem;
  }

  .al-panel--tv {
    padding: 10px;
  }

  .al-toolbar--log .al-toolbar-search,
  .al-toolbar--log .al-toolbar-filter {
    flex: 1 1 100%;
    min-width: 0;
  }

  .al-toolbar--log .al-check,
  .al-toolbar--log .al-toggle-btn {
    flex: 1 1 auto;
  }

  .al-log-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .al-toolbar--log .al-log-search-row .al-toolbar-search {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .al-log-filter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    align-self: stretch;
    width: 40px;
    min-height: 40px;
    height: auto;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--al-line);
    background: var(--al-white);
    color: var(--al-text);
    font: inherit;
    cursor: pointer;
  }

  .al-log-filter-btn:hover {
    border-color: var(--al-charcoal);
  }

  .al-log-filter-btn.is-filtered {
    background: var(--al-black);
    border-color: var(--al-black);
    color: #fff;
  }

  .al-log-filter-icon {
    width: 18px;
    height: 18px;
    display: block;
  }

  .al-log-filter-dot {
    position: absolute;
    display: block;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--al-red);
    box-shadow: 0 0 0 2px var(--al-white);
  }

  .al-log-filter-btn.is-filtered .al-log-filter-dot {
    background: #fff;
    box-shadow: 0 0 0 2px var(--al-black);
  }

  .al-log-filters {
    display: none;
  }

  .al-log-filters.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
  }

  .al-log-filters-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(28, 28, 28, 0.45);
    cursor: pointer;
  }

  .al-log-filters-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-height: min(80vh, calc(100% - 24px));
    overflow: auto;
    padding: 16px;
    border-radius: 16px;
    background: var(--al-panel);
    border: 1px solid var(--al-line);
    box-shadow: 0 8px 28px rgba(28, 28, 28, 0.22);
  }

  .al-log-filters-sheet:focus {
    outline: none;
  }

  .al-log-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .al-log-filters-title {
    margin: 0;
    font-family: var(--al-font-display);
    font-size: 1.35rem;
    font-weight: 600;
  }

  .al-log-filters-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .al-toolbar--log .al-log-filters-body .al-toolbar-filter,
  .al-toolbar--log .al-log-filters-body .al-toggle-btn {
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .al-log-filters-body .al-toggle-btn {
    grid-column: 1 / -1;
    min-height: 40px;
  }

  .al-mobile-nav {
    display: flex;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    padding: 4px;
    gap: 4px;
    background: var(--al-burgundy);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(28, 28, 28, 0.22);
  }

  .al-mobile-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    line-height: 1.15;
  }

  .al-mobile-nav-link.is-active {
    background: rgba(0, 0, 0, 0.22);
    color: var(--al-white);
  }

  .al-mobile-nav-link--icon {
    flex: 0 0 auto;
    min-width: 44px;
    padding-inline: 10px;
  }

  .al-mobile-nav-link .al-nav-icon {
    width: 18px;
    height: 18px;
    display: block;
  }

  .al-only-mobile { display: block; }

  .al-panel--log {
    width: 100%;
    padding: 0;
    margin-bottom: 0;
    border: 0;
    background: transparent;
  }

  .al-panel--log .al-toolbar {
    margin-bottom: 10px;
  }

  .al-main {
    width: 100%;
    min-width: 0;
    padding-bottom: 0;
  }

  .al-log-list-wrap {
    overflow-x: visible;
    width: 100%;
  }

  .al-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .al-log-head,
  .al-log-col--desktop {
    display: none;
  }

  .al-log-entry {
    display: block;
    width: 100%;
  }

  .al-log-row {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 72px;
    padding: 10px 12px;
    gap: 0;
  }

  .al-log-col.al-col-poster {
    flex: 0 0 28px;
    width: 28px;
    margin-right: 16px;
    padding-right: 0 !important;
    align-self: center;
  }

  .al-log-col--body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
  }

  .al-log-col--title {
    font-size: 0.92rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    text-overflow: unset;
  }

  .al-log-col--mobile-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    font-size: 0.72rem;
    color: var(--al-muted);
    line-height: 1.3;
  }

  .al-log-meta-primary,
  .al-log-meta-location,
  .al-log-meta-with {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .al-log-meta-with {
    color: #2f5d3a;
    font-weight: 500;
  }

  .al-add-viewer {
    margin-top: 0;
    border-radius: 0 0 12px 12px;
    padding: 12px;
  }

  .al-add-viewer-label {
    font-size: 0.88rem;
  }

  .al-add-viewer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .al-add-viewer-search {
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
  }

  .al-add-viewer-row .al-input {
    max-width: none;
  }

  .al-add-viewer-row .al-btn {
    width: 100%;
  }

  .al-add-viewer-hint {
    font-size: 0.78rem;
  }

  .al-log-row .al-row-actions {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    margin-left: 10px;
    gap: 2px;
  }

  .al-log-row .al-link-btn {
    font-size: 0.72rem;
    padding: 0;
    min-height: 0;
    line-height: 1.3;
  }

  .al-log-detail {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin-top: -4px;
  }

  .al-log-detail-inner {
    padding: 12px;
  }

  .al-log-detail-facts {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .al-log-detail-body {
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
  }

  .al-log-detail-fact {
    padding: 8px 10px;
  }

  .al-poster--detail {
    width: 72px;
    height: auto;
  }

  .al-log-row--editing {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
  }
}

.al-tv-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.al-tv-add-field {
  flex: 1 1 180px;
  min-width: 0;
  position: relative;
}

.al-tv-add-date {
  flex: 0 0 auto;
  width: 9.5rem;
}

.al-tv-add-season,
.al-tv-add-episode {
  flex: 0 0 auto;
  width: 4.5rem;
  text-align: center;
}

.al-tv-add-ep {
  flex: 0 0 auto;
  width: 4.5rem;
  text-align: center;
}

.al-tv-add-rating {
  flex: 0 0 auto;
  width: 5.75rem;
}

.al-tv-add-row .al-btn {
  flex: 0 0 auto;
  margin-left: 2px;
}

.al-log-list--tv {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 920px;
  min-width: 0;
}

.al-log-head--tv,
.al-log-row--tv {
  display: grid;
  grid-template-columns:
    36px
    6.75rem
    minmax(0, 1fr)
    5.5rem
    4.25rem
    5.75rem;
  column-gap: 12px;
  align-items: center;
  width: 100%;
}

.al-log-head--tv {
  grid-column: auto;
  padding: 0 14px 4px;
}

.al-log-row--tv {
  grid-column: auto;
}

.al-log-row--tv .al-col-poster,
.al-log-head--tv .al-col-poster {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.al-log-row--tv .al-row-actions {
  justify-self: start;
}

.al-watchlist-summary {
  margin: -2px 0 10px;
  font-size: 0.78rem;
}

.al-log-row--coming-soon {
  background: #f0ece6;
  border-color: rgba(28, 28, 28, 0.1);
}

.al-log-row--coming-soon:hover {
  background: #ebe6df;
  border-color: rgba(28, 28, 28, 0.14);
}

.al-log-entry.is-coming-soon .al-log-detail--coming-soon {
  background: #f0ece6;
}

.al-log-entry.is-coming-soon .al-log-detail--coming-soon .al-log-detail-inner {
  background: #f7f4ef;
}

.al-log-list--watchlist {
  display: grid;
  grid-template-columns:
    36px
    6.75rem
    minmax(0, 1.5fr)
    minmax(5.5rem, 0.55fr)
    minmax(10.5rem, auto);
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.al-log-head--watchlist,
.al-log-row--watchlist {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  width: 100%;
}

.al-log-head--watchlist {
  padding: 0 14px 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--al-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.al-log-row--watchlist {
  padding: 10px 14px;
}

/* iOS only emits click on non-button descendants if they (not just the row) are
   pointer-cursor. Action buttons keep their own cursor via .al-link-btn. */
.al-log-row--watchlist.al-log-row--clickable .al-log-col,
.al-log-row--watchlist.al-log-row--clickable .al-log-col--body,
.al-log-row--watchlist.al-log-row--clickable .al-col-poster {
  cursor: pointer;
}

.al-log-row--watchlist .al-col-poster,
.al-log-head--watchlist .al-col-poster {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.al-log-head--watchlist .al-log-col:last-child,
.al-log-row--watchlist .al-row-actions {
  justify-self: end;
  text-align: right;
}

.al-log-row--watchlist .al-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: flex-end;
}

.al-log-row--watchlist .al-log-col--desktop.al-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.al-watchlist-edit-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
  width: 100%;
}

.al-watchlist-edit-fields .al-input {
  flex: 1 1 160px;
  min-width: 0;
}

.al-tv-airing-segment {
  margin-top: 12px;
}

.al-tv-stats-note {
  margin: 0 0 12px;
  font-size: 0.86rem;
}

@media (max-width: 767px) {
  .al-tv-add-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .al-tv-add-field,
  .al-tv-add-date,
  .al-tv-add-row .al-btn {
    grid-column: 1 / -1;
    width: 100%;
    flex: none;
    min-width: 0;
    margin-left: 0;
  }

  .al-tv-add-season,
  .al-tv-add-episode,
  .al-tv-add-rating {
    width: 100%;
    flex: none;
    min-width: 0;
  }

  .al-tv-edit-form .al-tv-add-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .al-tv-edit-form .al-tv-add-row > .al-input:first-child,
  .al-tv-edit-form .al-tv-add-row .al-tv-add-date,
  .al-tv-edit-form .al-tv-add-row .al-btn-primary {
    grid-column: 1 / -1;
  }

  .al-tv-edit-form .al-tv-add-row .al-btn[type="button"] {
    grid-column: 1 / -1;
  }

  .al-log-list--tv {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .al-log-head--tv {
    display: none;
  }

  .al-log-row--tv {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 72px;
    padding: 10px 12px;
    gap: 0;
  }

  .al-log-row--tv .al-log-col--desktop {
    display: none;
  }

  .al-log-row--tv .al-col-poster {
    flex: 0 0 28px;
    width: 28px;
    margin-right: 16px;
    padding-right: 0 !important;
  }

  .al-log-row--tv .al-log-col--title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .al-log-row--tv .al-row-actions {
    flex: 0 0 auto;
    margin-left: 10px;
    min-width: 0;
  }

  .al-log-list--watchlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .al-log-head--watchlist {
    display: none;
  }

  .al-log-row--watchlist {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 72px;
    padding: 10px 12px;
    gap: 0;
  }

  .al-log-row--watchlist .al-log-col--desktop {
    display: none;
  }

  .al-log-row--watchlist .al-col-poster {
    flex: 0 0 28px;
    width: 28px;
    margin-right: 16px;
    padding-right: 0 !important;
  }

  .al-log-row--watchlist .al-log-col--body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
  }

  .al-log-row--watchlist .al-row-actions {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    margin-left: 10px;
    gap: 2px;
    min-width: 0;
  }

  .al-watchlist-edit-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .al-watchlist-edit-fields .al-input,
  .al-watchlist-edit-fields .al-btn {
    width: 100%;
    flex: none;
  }

  /* Coming Soon is add-only on phone — no sticky log bar or row log buttons. */
  [data-page="what-to-watch"] #al-quicklog {
    display: none;
  }

  [data-page="what-to-watch"] .al-log-list-wrap[data-wtw-list-view="coming-soon"] [data-log-watchlist] {
    display: none;
  }
}

.al-signin-body {
  min-height: 100%;
}

.al-signin-page {
  min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.al-signin-panel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.al-signin-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--al-muted);
}

.al-signin-title {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 5vw, 2.2rem);
}

.al-signin-sub {
  margin: 0 0 18px;
}

.al-signin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.al-signin-tab {
  border: 1px solid var(--al-line);
  background: var(--al-panel-2);
  color: var(--al-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--al-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.al-signin-tab.is-active {
  background: var(--al-burgundy);
  border-color: var(--al-burgundy);
  color: #fff;
}

.al-signin-form {
  display: grid;
  gap: 12px;
}

.al-signin-form.is-hidden,
.al-signin-error[hidden] {
  display: none !important;
}

.al-signin-form .al-field span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: var(--al-muted);
}

.al-signin-submit {
  width: 100%;
  margin-top: 4px;
}

.al-signin-error {
  margin: 12px 0 0;
}

.al-signin-back {
  margin: 16px 0 0;
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------
   Reduced motion
   The app animates HUD count-ups, meter/rating bar widths, the quick-log
   expand, poster hovers and smooth scrolling. None of it carries meaning, so
   honour the OS setting and cut it all.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Public profile panel in Settings. */
.al-privacy-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--al-rule, rgba(0, 0, 0, 0.12));
}

.al-privacy-detail {
  margin-top: 10px;
  padding-left: 26px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.al-privacy-detail.is-active {
  opacity: 1;
}

.al-field-hint {
  margin-top: 4px;
  font-size: 0.72em;
}

/* Keyboard-highlighted option in the movie/theater search dropdowns. */
.al-search-results button.is-active,
.al-search-results button:hover {
  background: var(--al-hover, rgba(0, 0, 0, 0.06));
}

.al-empty--first-run {
  text-align: left;
  line-height: 1.6;
}

.al-empty--first-run p + p {
  margin-top: 8px;
}

.al-by-month-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.al-by-month-year {
  flex: 0 0 auto;
  width: auto;
}

/* Rank — Beli-style stack */
.al-rank-segment {
  margin-bottom: 12px;
}

.al-rank-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.al-rank-poster,
.al-rank-chip-poster {
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--al-panel-2);
}

.al-rank-search {
  margin: 0;
}

.al-rank-unranked {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.al-rank-unranked-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--al-muted);
}

.al-rank-unranked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.al-rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--al-line);
  border-radius: 999px;
  background: var(--al-panel-2);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.al-rank-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.al-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--al-line);
}

.al-rank-num {
  flex: 0 0 2rem;
  font-family: var(--al-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--al-burgundy);
  text-align: center;
}

.al-rank-meta {
  flex: 1;
  min-width: 0;
}

.al-rank-title {
  font-weight: 650;
  font-size: 1.02rem;
  line-height: 1.25;
}

.al-rank-row-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.al-rank-row-actions .al-link-btn {
  min-height: 32px;
  padding: 4px 0;
}

.al-rank-modal,
.al-rank-compare {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--al-bg) 92%, #000 8%);
  display: flex;
  flex-direction: column;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.al-rank-modal {
  align-items: center;
  justify-content: center;
  background: rgba(28, 28, 28, 0.45);
}

.al-rank-modal-card {
  display: flex;
  gap: 14px;
  width: min(440px, 100%);
  padding: 16px;
  border-radius: 16px;
  background: var(--al-panel);
  border: 1px solid var(--al-line);
}

.al-rank-modal-title {
  margin: 0 0 4px;
  font-family: var(--al-font-display);
  font-size: 1.35rem;
}

.al-rank-modal-film {
  margin: 0 0 8px;
  font-weight: 600;
}

.al-rank-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.al-rank-compare {
  --al-rank-swipe: 0px;
  background: var(--al-bg);
  gap: 8px;
}

.al-rank-compare-kicker {
  margin: 0;
  font-size: 0.78rem;
  color: var(--al-muted);
}

.al-rank-compare-prompt {
  margin: 0;
  font-family: var(--al-font-display);
  font-size: 1.45rem;
  line-height: 1.2;
}

.al-rank-compare-hint {
  margin: 0;
  font-size: 0.82rem;
}

.al-rank-compare-cards {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.al-rank-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 2px solid var(--al-line);
  border-radius: 16px;
  background: var(--al-panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.al-rank-card--new {
  transform: translateX(var(--al-rank-swipe));
  border-color: var(--al-burgundy);
}

.al-rank-card-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--al-muted);
}

.al-rank-card-badge.is-new {
  color: var(--al-burgundy);
}

.al-rank-card-poster {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  background: var(--al-panel-2);
}

.al-rank-card-title {
  font-weight: 650;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.al-rank-card-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  background: var(--al-red);
  color: var(--al-white);
  font-size: 0.85rem;
  font-weight: 700;
}

.al-rank-card:not(.al-rank-card--new) .al-rank-card-cta {
  background: var(--al-burgundy);
}

.al-rank-compare-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body.al-rank-comparing,
body.al-log-filters-open {
  overflow: hidden;
}

body.al-rank-comparing .al-mobile-nav,
body.al-log-filters-open .al-mobile-nav {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 767px) {
  .al-rank-row {
    min-height: 96px;
    padding: 12px 2px;
  }

  .al-rank-title {
    font-size: 1.05rem;
  }

  .al-rank-compare-prompt {
    font-size: 1.25rem;
  }

  .al-rank-card {
    padding: 8px;
  }

  .al-rank-modal-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .al-rank-modal-actions {
    justify-content: center;
  }
}

