:root {
  --paper: #f6f2ea;
  --ink: #28231f;
  --muted: #766e65;
  --line: #dcd5c9;
  --wine: #743d41;
  --wine-dark: #50292e;
  --gold: #b28b4c;
  --white: #fffdf8;
  --green: #50745b;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55
}

button,
input,
select {
  font: inherit
}

button,
a,
input,
select {
  touch-action: manipulation
}

button {
  cursor: pointer
}

button:disabled {
  opacity: .45;
  cursor: wait
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px
}

a {
  color: inherit
}

button {
  border: 0
}

.masthead {
  max-width: 1320px;
  margin: auto;
  padding: 30px 46px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line)
}

.brand {
  display: grid;
  grid-template-columns: 38px auto;
  text-decoration: none;
  letter-spacing: 3px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4
}

.brand-icon {
  grid-row: span 2;
  font-size: 31px;
  line-height: 1;
  color: var(--wine)
}

.brand-sub {
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 500;
  color: var(--muted)
}

.network {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px
}

.network i {
  height: 6px;
  width: 6px;
  background: var(--green);
  border-radius: 50%
}

main {
  max-width: 1228px;
  margin: auto;
  padding: 0 42px;
  min-height: 70vh
}

h1,
h2,
h3,
p {
  margin: 0
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400
}

h1 {
  font-size: clamp(44px, 5.7vw, 76px);
  letter-spacing: -3px;
  line-height: 1.05
}

h1 em {
  font-weight: 400;
  color: var(--wine)
}

h2 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1px
}

h3 {
  font-size: 25px;
  line-height: 1.2
}

p {
  color: var(--muted)
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--wine);
  margin-bottom: 18px
}

.hero {
  padding: 60px 0 44px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: center
}

.hero p {
  max-width: 480px;
  margin-top: 20px;
  line-height: 1.7
}

.hero-ticket {
  border: 1px solid var(--line);
  padding: 26px;
  background: #eee7db;
  transform: rotate(2deg);
  max-width: 320px;
  justify-self: end;
  width: 100%;
  position: relative
}

.hero-ticket:before,
.hero-ticket:after {
  position: absolute;
  content: '';
  background: var(--paper);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: 63%;
  border: 1px solid var(--line)
}

.hero-ticket:before {
  left: -12px;
  border-left: 0
}

.hero-ticket:after {
  right: -12px;
  border-right: 0
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 2px
}

.ticket-number {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1.2;
  padding: 15px 0;
  color: var(--wine)
}

.ticket-bottom {
  border-top: 1px dashed #bfb29d;
  padding-top: 18px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 1px
}

.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px
}

.tab {
  background: transparent;
  padding: 14px 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px
}

.tab.active {
  color: var(--wine);
  border-color: var(--wine);
  font-weight: 700
}

.tab.logout {
  margin-left: auto;
  font-size: 11px
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 22px
}

.section-head p {
  font-size: 13px;
  margin-top: 6px
}

.btn {
  background: var(--wine);
  color: white;
  padding: 12px 20px;
  border-radius: 3px;
  font-size: 12px;
  letter-spacing: .25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  min-height: 44px;
  transition: background .15s, transform .15s
}

.btn:hover {
  background: var(--wine-dark)
}

.btn.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink)
}

.btn.secondary:hover {
  background: #eae3d9
}

.btn.small {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 11px
}

.link-btn {
  background: none;
  padding: 8px 0;
  color: var(--wine);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 26px;
  border-radius: 4px
}

.rounds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px
}

.round-card {
  display: flex;
  flex-direction: column;
  gap: 20px
}

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

.pill {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
  color: var(--muted)
}

.pill.complete {
  background: #eaf0e7;
  color: var(--green);
  border-color: #d6e0d2
}

.round-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px
}

.person {
  border-top: 1px solid #ece6dc;
  padding-top: 15px
}

.person-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 16px
}

.progress-track {
  height: 4px;
  background: #e9e3d9;
  margin: 10px 0 12px;
  border-radius: 4px;
  overflow: hidden
}

.progress-fill {
  height: 100%;
  background: var(--wine)
}

.person-actions {
  display: flex;
  gap: 10px
}

.round-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  font-size: 11px;
  color: var(--muted)
}

.empty {
  padding: 42px;
  text-align: center;
  border: 1px dashed #c9bdaa;
  border-radius: 4px;
  background: #f0eade
}

.empty-symbol {
  font-family: var(--serif);
  font-size: 52px;
  color: var(--wine);
  margin-bottom: 12px
}

.empty p {
  max-width: 440px;
  margin: 14px auto 22px;
  font-size: 13px
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 45px 0;
  gap: 30px
}

.step {
  border-top: 1px solid var(--line);
  padding-top: 18px
}

.step .num {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 1px
}

.step h3 {
  font-size: 21px;
  margin: 9px 0
}

.step p {
  font-size: 12px;
  line-height: 1.7
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.field label,
.field-label {
  font-size: 11px;
  font-weight: 600
}

.field input,
.field select,
.search {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  min-height: 45px;
  padding: 10px 12px;
  color: var(--ink)
}

.field small,
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6
}

.span-2 {
  grid-column: span 2
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line)
}

.form-card {
  max-width: 820px
}

.notice {
  border-left: 3px solid var(--gold);
  padding: 14px 17px;
  background: #efe6d4;
  color: #67543b;
  font-size: 12px;
  margin: 20px 0
}

.notice.error {
  border-color: #b85750;
  background: #f4e5e1;
  color: #843f38
}

.notice.success {
  border-color: var(--green);
  background: #e9eee4;
  color: #45644d
}

.notice p {
  color: inherit
}

.source-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px
}

.source-count {
  font: 52px var(--serif);
  color: var(--wine);
  padding-right: 20px;
  border-right: 1px solid var(--line)
}

.source-box h3 {
  font-size: 23px
}

.source-box p {
  font-size: 12px;
  margin-top: 5px
}

.toolbar {
  display: flex;
  gap: 15px;
  align-items: center;
  margin: 20px 0
}

.toolbar .search {
  flex: 1
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted)
}

.movie-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 3px
}

.movie-row {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  display: flex;
  gap: 12px;
  align-items: start
}

.movie-row:last-child {
  border-bottom: 0
}

.movie-row input {
  margin-top: 5px
}

.movie-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px
}

.movie-genre {
  color: var(--muted);
  line-height: 1.7
}

.muted {
  color: var(--muted)
}

.compact {
  font-size: 12px
}

.spaced {
  margin-top: 20px
}

.auth-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 65px;
  align-items: start;
  padding: 75px 0
}

.auth-wrap p {
  margin: 25px 0;
  max-width: 420px
}

.auth-card {
  margin-top: 20px
}

.auth-card h2 {
  font-size: 28px;
  margin-bottom: 12px
}

.auth-card p {
  font-size: 13px;
  margin: 0 0 25px
}

.auth-card .btn {
  width: 100%;
  margin-top: 16px
}

.vote-wrap {
  max-width: 930px;
  margin: 0 auto;
  padding: 40px 0
}

.vote-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px
}

.vote-heading {
  text-align: center;
  margin: 48px 0 35px
}

.vote-heading h1 {
  font-size: 47px;
  letter-spacing: -1.5px
}

.vote-heading p {
  margin-top: 15px;
  font-size: 13px
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 46px 1fr;
  align-items: stretch
}

.choice {
  background: var(--white);
  border: 1px solid var(--line);
  min-height: 285px;
  border-radius: 5px;
  padding: 30px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 25px;
  transition: transform .15s, border-color .15s, box-shadow .15s
}

.choice:hover {
  border-color: var(--wine);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px #3c2d2310
}

.choice-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted)
}

.genre-text {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.45;
  letter-spacing: -.4px;
  flex: 1
}

.genre-tags {
  display: block;
  width: 100%;
}

.genre-tag {
  display: block;
}

.choice-footer {
  font-size: 11px;
  color: var(--wine);
  display: flex;
  justify-content: space-between
}

.versus {
  align-self: center;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 17px
}

.vote-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 26px 0
}

.vote-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px
}

.sealed {
  max-width: 620px;
  text-align: center;
  padding: 65px 25px;
  margin: 40px auto
}

.sealed .seal {
  height: 80px;
  width: 80px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  color: var(--wine);
  font: 44px var(--serif)
}

.sealed h1 {
  font-size: 46px;
  letter-spacing: -1.5px
}

.sealed p {
  font-size: 14px;
  max-width: 420px;
  margin: 20px auto;
  line-height: 1.8
}

.result-row {
  display: grid;
  grid-template-columns: 45px 1fr auto;
  gap: 14px;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
  align-items: start
}

.result-rank {
  font: 28px var(--serif);
  color: var(--wine)
}

.result-label {
  font: 22px/1.45 var(--serif)
}

.result-score {
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px
}

.result-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0
}

.about {
  max-width: 760px
}

.about h3 {
  margin: 30px 0 12px
}

.about p {
  font-size: 14px;
  line-height: 1.85;
  margin: 12px 0
}

.loading {
  text-align: center;
  padding: 100px 0;
  color: var(--muted)
}

footer {
  max-width: 1228px;
  margin: 70px auto 0;
  padding: 24px 42px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 25px;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--muted)
}

footer span {
  letter-spacing: .2px;
  font-size: 10px
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 12px;
  display: none;
  max-width: 90%;
  box-shadow: 0 6px 25px #0002;
  z-index: 10
}

#toast.show {
  display: block
}

.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
}

[hidden] {
  display: none !important
}

code {
  background: #eae3d9;
  padding: 2px 5px;
  border-radius: 2px;
  font-size: 12px
}

@media(max-width:720px) {
  .masthead {
    padding: 22px 22px 20px
  }

  .brand {
    font-size: 14px;
    letter-spacing: 2px
  }

  .brand-sub {
    font-size: 7px
  }

  .network {
    font-size: 9px
  }

  main {
    padding: 0 22px
  }

  .hero {
    padding: 40px 0 30px;
    grid-template-columns: 1fr;
    gap: 28px
  }

  .hero h1 {
    font-size: 52px
  }

  .hero p {
    font-size: 13px;
    max-width: 380px
  }

  .hero-ticket {
    display: none
  }

  .rounds {
    grid-template-columns: 1fr
  }

  .steps {
    gap: 18px;
    margin: 34px 0;
    grid-template-columns: 1fr
  }

  .step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 0 8px
  }

  .step h3 {
    margin: 0;
    font-size: 21px
  }

  .step p {
    grid-column: 2;
    margin-top: 8px
  }

  .section-head {
    align-items: start
  }

  .section-head h2 {
    font-size: 29px
  }

  .card {
    padding: 21px
  }

  .form-grid {
    grid-template-columns: 1fr
  }

  .span-2 {
    grid-column: 1
  }

  .auth-wrap {
    grid-template-columns: 1fr;
    padding: 45px 0;
    gap: 12px
  }

  .auth-wrap h1 {
    font-size: 54px
  }

  .auth-wrap p {
    margin: 20px 0
  }

  .auth-card {
    margin-top: 0
  }

  .toolbar {
    flex-wrap: wrap
  }

  .toolbar .search {
    min-width: 100%
  }

  .vote-wrap {
    padding-top: 25px
  }

  .vote-heading {
    margin: 32px 0 25px
  }

  .vote-heading h1 {
    font-size: 37px
  }

  .comparison {
    grid-template-columns: 1fr;
    gap: 11px
  }

  .versus {
    display: none
  }

  .choice {
    min-height: 185px;
    padding: 22px;
    gap: 14px
  }

  .genre-text {
    font-size: 23px
  }

  .choice:hover {
    transform: none
  }

  .vote-actions {
    margin: 20px 0
  }

  .vote-bottom {
    font-size: 9px;
    gap: 15px
  }

  .tabs {
    gap: 22px
  }

  .tab {
    font-size: 12px
  }

  .source-box {
    gap: 15px
  }

  .source-count {
    font-size: 40px;
    padding-right: 15px
  }

  .source-box h3 {
    font-size: 20px
  }

  .result-row {
    grid-template-columns: 30px 1fr
  }

  .result-score {
    grid-column: 2
  }

  .result-label {
    font-size: 20px
  }

  footer {
    margin-top: 45px;
    padding: 20px 22px;
    flex-direction: column;
    gap: 8px
  }

  .sealed {
    padding: 42px 0
  }

  .sealed h1 {
    font-size: 39px
  }

  .form-actions {
    flex-wrap: wrap
  }

  .form-actions .btn {
    flex: 1
  }
}

.btn {
  white-space: nowrap
}

.btn:disabled {
  cursor: default
}

.vote-top>span:first-child {
  min-width: 0;
  overflow-wrap: anywhere
}

.movie-title {
  overflow-wrap: anywhere
}

@media(max-width:420px) {
  .section-head {
    flex-direction: column
  }

  .tabs {
    gap: 18px
  }

  .tab {
    white-space: nowrap;
    font-size: 11px
  }

  .card-top {
    flex-wrap: wrap
  }

  .person-actions {
    flex-wrap: wrap
  }

  .vote-top {
    font-size: 10px
  }
}

/* Movie-night choices remain square, independent checkboxes. */
.setup-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label.setup-choice {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  background: var(--paper);
  font-size: 12px;
}

.setup-choice>span:not(.boolean-value) {
  flex: 1;
}

.setup-choice strong,
.setup-choice small {
  display: block;
}

.setup-choice small {
  font-weight: 400;
  margin-top: 3px;
}

.field input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--wine);
  cursor: pointer;
}

.setup-choice:has(input:checked),
.heaviness-choice:has(input:checked) {
  border-color: var(--wine);
  background: #f3e9e3;
}

.boolean-value {
  font-size: 10px;
  color: var(--muted);
}

.heaviness-field {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.heaviness-field legend {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 0;
}

.heaviness-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field label.heaviness-choice {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 3px;
  cursor: pointer;
}

.cloud-match {
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  border: 1px solid var(--line);
}

.cloud-match>span {
  overflow-wrap: anywhere;
}

.round-settings {
  margin: -8px 0 24px;
}

@media (max-width: 600px) {
  .setup-choices {
    grid-template-columns: 1fr;
  }

  .heaviness-options {
    gap: 8px;
  }

  .field label.heaviness-choice {
    padding: 14px 9px;
    gap: 7px;
  }

  .cloud-match {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Download progress deliberately contains counts instead of movie identities. */
.media-card { margin: 24px 0 36px; }
.media-card .eyebrow { margin-bottom: 8px; }
.media-description { font-size: 14px; line-height: 1.7; margin: 18px 0; }
.media-counts { display: flex; gap: 36px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.media-counts strong { display: block; font-size: 25px; margin-bottom: 5px; }
.media-counts span { font-size: 12px; color: var(--muted); }
.media-card .result-actions { margin-bottom: 0; align-items: center; }
.media-updated { margin: 0; }

/* Phone voting fits the visible viewport. JS sizes the two genre stacks
   together, without truncation; deliberate accessibility zoom stays available. */
@media (max-width: 720px), (max-width: 960px) and (max-height: 500px) {
  body.vote-page {
    height: 100vh;
    height: min(100svh, var(--vote-viewport-height, 100svh));
    display: flex;
    flex-direction: column;
  }

  .vote-page .masthead {
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
  }

  .vote-page .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 1.6px;
  }

  .vote-page .brand-icon { font-size: 24px; }
  .vote-page .brand-sub,
  .vote-page .vote-night,
  .vote-page > footer,
  .vote-page .vote-heading .eyebrow,
  .vote-page .vote-heading p,
  .vote-page .choice-footer,
  .vote-page .versus { display: none; }

  .vote-page main {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    margin: 0 auto;
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  }

  .vote-page .vote-wrap {
    height: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 4px auto minmax(0, 1fr) auto auto;
    gap: 9px;
  }

  .vote-page .vote-top {
    min-width: 0;
    gap: 10px;
    margin: 0;
    font-size: 11px;
    line-height: 16px;
  }

  .vote-page .vote-top > span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vote-page .vote-top > span:last-child { flex-shrink: 0; white-space: nowrap; }
  .vote-page .progress-track { height: 4px; }
  .vote-page .vote-heading { margin: 4px 0 5px; }
  .vote-page .vote-heading h1 { font-size: 27px; line-height: 1.08; letter-spacing: -.7px; }

  .vote-page .comparison {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 9px;
    min-width: 0;
    min-height: 0;
  }

  .vote-page .choice {
    min-height: 0;
    min-width: 0;
    padding: 13px 16px;
    gap: 8px;
    border-radius: 6px;
  }

  .vote-page .choice:hover { transform: none; }
  .vote-page .choice:active { background: #f0e8de; border-color: var(--wine); }
  .vote-page .choice-label { font-size: 10px; line-height: 14px; letter-spacing: 1.4px; }

  .vote-page .genre-text {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    font-size: var(--picker-genre-size, 21px);
    line-height: 1.2;
    letter-spacing: -.2px;
    overflow-wrap: anywhere;
  }

  .vote-page .vote-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
  }

  .vote-page .vote-actions .btn { min-height: 44px; padding: 10px 8px; font-size: 12px; }
  .vote-page #vote-error:empty { display: none; }
  .vote-page .vote-bottom {
    border: 0;
    padding: 0;
    gap: 8px;
    font-size: 10px;
    line-height: 16px;
  }

  .vote-page .vote-bottom .link-btn { font-size: 10px; padding: 0; line-height: 16px; }
  .vote-page .vote-bottom .link-btn:not(:disabled) { min-height: 44px; }
  .vote-page .vote-bottom > span { text-align: right; }
  .vote-page .sealed { padding: 20px 8px; margin: 0 auto; }
  .vote-page .sealed .seal { height: 56px; width: 56px; font-size: 32px; margin-bottom: 18px; }
  .vote-page .sealed h1 { font-size: 34px; }
  .vote-page .sealed p { margin: 16px auto; line-height: 1.5; }
}

@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .vote-page .masthead { min-height: 36px; padding-top: 4px; padding-bottom: 4px; }
  .vote-page .vote-wrap { gap: 5px; }
  .vote-page .vote-heading { margin: 0; }
  .vote-page .vote-heading h1 { font-size: 23px; }
  .vote-page .comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  .vote-page .genre-text { font-size: var(--picker-genre-size, 19px); }
}

.media-issue strong { font-size: 13px; }
.media-issue p { margin-top: 8px; line-height: 1.6; }
.media-issue-scope { margin-top: 4px; font-size: 11px; }
.media-retry-help { margin-top: 14px; }

/* Host database controls are isolated from the compact voting page. */
.watchlist-database .db-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 24px;
}
.watchlist-database .db-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0;
}
.watchlist-database .db-toolbar > .field { min-width: 120px; }
.watchlist-database .db-search-field { flex: 1; min-width: 200px; }
.watchlist-database .db-sort-direction { min-height: 45px; }
.watchlist-database .db-table-scroll {
  overflow: auto;
  max-height: 660px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}
.watchlist-database .db-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.watchlist-database .db-table th,
.watchlist-database .db-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  min-width: 115px;
  max-width: 280px;
  overflow-wrap: anywhere;
}
.watchlist-database .db-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  font-weight: 600;
  white-space: nowrap;
}
.watchlist-database .db-table td:first-child { min-width: 190px; font-weight: 600; }
.watchlist-database .db-table tr:last-child td { border-bottom: 0; }
.watchlist-database .db-table tbody tr:hover td { background: #f5f0e7; }
.watchlist-database .db-calculated-label {
  display: block;
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
}
.watchlist-database .db-computed { color: var(--muted); font-variant-numeric: tabular-nums; }
.watchlist-database .db-table .db-row-actions {
  position: sticky;
  right: 0;
  background: var(--white);
  min-width: 150px;
  box-shadow: -3px 0 6px #28231f08;
}
.watchlist-database .db-table th.db-row-actions { z-index: 2; background: var(--paper); }
.watchlist-database .db-row-actions .link-btn { display: inline-block; font-size: 12px; margin-right: 12px; }
.watchlist-database .db-archived-row { color: var(--muted); }
.watchlist-database .db-empty { padding: 32px; }
.watchlist-database .db-pagination { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 26px; gap: 12px; font-size: 12px; color: var(--muted); }
.watchlist-database .db-pagination > div { display: flex; gap: 10px; }
.watchlist-database .db-details { margin: 18px 0; padding: 20px 24px; }
.watchlist-database .db-details summary { cursor: pointer; color: var(--wine); font-weight: 600; }
.watchlist-database .db-details[open] summary { margin-bottom: 18px; }
.watchlist-database textarea {
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.watchlist-database textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.watchlist-database textarea.db-formula-text { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.watchlist-database .db-extra-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 3px; }
.watchlist-database .db-extra-row { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 14px; border-bottom: 1px solid var(--line); font-size: 12px; }
.watchlist-database .db-extra-row:last-child { border-bottom: 0; }
.watchlist-database .db-extra-row .hint { display: block; }
.watchlist-database .db-extra-row p { margin-top: 5px; overflow-wrap: anywhere; }
.watchlist-database .db-dialog {
  width: min(860px, calc(100vw - 36px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 20px 80px #28231f38;
}
.watchlist-database .db-dialog::backdrop { background: #28231f80; }
.watchlist-database .db-dialog .section-head { margin-top: 0; margin-bottom: 22px; }
.watchlist-database .db-dialog h3 { font-size: 25px; }
.watchlist-database .db-imdb-dialog { width: min(680px, calc(100vw - 36px)); }
.watchlist-database .db-connection-dialog { width: min(640px, calc(100vw - 36px)); }
.watchlist-database .db-connection-dialog .section-head { gap: 16px; align-items: start; }
.watchlist-database .db-connection-dialog .section-head > .link-btn { flex-shrink: 0; }
.watchlist-database .db-connection-access { padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.watchlist-database .db-connection-access h4 { font-family: var(--sans); font-size: 13px; margin: 0 0 5px; }
.watchlist-database .db-connection-access > .hint { margin: 0 0 16px; }
.watchlist-database .db-connection-access .field + .field { margin-top: 14px; }
.watchlist-database .db-connection-password { display: flex; align-items: center; gap: 12px; }
.watchlist-database .db-connection-password input { flex: 1; min-width: 0; }
.watchlist-database .db-connection-password .link-btn { flex-shrink: 0; font-size: 12px; }
.watchlist-database .db-connection-certificate { margin-top: 17px; }
.watchlist-database .db-connection-steps { margin: 16px 0 0; padding-left: 20px; font-size: 12px; line-height: 1.7; }
.watchlist-database .db-connection-steps li + li { margin-top: 6px; }
.watchlist-database .db-imdb-dialog .section-head > div { min-width: 0; }
.watchlist-database .db-imdb-dialog .section-head > .link-btn { flex-shrink: 0; }
.watchlist-database .db-imdb-links { min-height: 155px; font-size: 14px; line-height: 1.6; }
.watchlist-database .db-imdb-help { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.watchlist-database .db-imdb-help p { margin: 0; }
.watchlist-database #db-imdb-count { flex-shrink: 0; }
.watchlist-database .db-imdb-over-limit { color: #843f38; font-weight: 600; }
.watchlist-database .db-imdb-actions { align-items: center; flex-wrap: wrap; }
.watchlist-database .db-imdb-actions > .link-btn { margin-right: auto; font-size: 12px; }
.watchlist-database .db-imdb-results { list-style: none; padding: 0; margin: 18px 0 12px; border: 1px solid var(--line); border-radius: 4px; max-height: 290px; overflow: auto; }
.watchlist-database .db-imdb-result { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.watchlist-database .db-imdb-result:last-child { border-bottom: 0; }
.watchlist-database .db-imdb-result-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.watchlist-database .db-imdb-result strong { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.watchlist-database .db-imdb-result-label { flex-shrink: 0; font-size: 11px; color: var(--muted); }
.watchlist-database .db-imdb-added .db-imdb-result-label { color: var(--green); }
.watchlist-database .db-imdb-problem .db-imdb-result-label { color: #843f38; }
.watchlist-database .db-imdb-result p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.watchlist-database .db-imdb-result-input { font-size: 11px; }
.watchlist-database .db-origin-note { padding: 12px 14px; margin: 0 0 20px; background: var(--paper); border-radius: 4px; }
.watchlist-database .db-origin-note p { margin: 0; }
.watchlist-database .db-origin-note details { margin-top: 8px; }
.watchlist-database .db-origin-note summary { font-size: 12px; cursor: pointer; }
.watchlist-database .db-origin-note details p { margin-top: 8px; overflow-wrap: anywhere; }
.watchlist-database .db-output { display: block; padding: 10px 12px; min-height: 45px; background: #eee9e0; border-radius: 3px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.watchlist-database .db-boolean { min-height: 45px; }
.watchlist-database .db-boolean input { min-height: auto; width: auto; accent-color: var(--wine); }
.watchlist-database [aria-busy="true"] .db-table { opacity: .6; }
@media (max-width: 700px) {
  .watchlist-database .section-head { align-items: start; gap: 14px; }
  .watchlist-database .db-toolbar > .field { flex: 1; min-width: 130px; }
  .watchlist-database .db-toolbar .db-search-field { min-width: 100%; order: 2; }
  .watchlist-database .db-dialog { padding: 20px; }
  .watchlist-database .db-imdb-dialog .section-head { gap: 10px; }
  .watchlist-database .db-imdb-dialog h3 { font-size: 23px; }
  .watchlist-database .db-imdb-links { font-size: 16px; }
  .watchlist-database .db-imdb-help { flex-wrap: wrap; gap: 4px; }
  .watchlist-database .db-imdb-actions > .link-btn { flex-basis: 100%; text-align: left; }
  .watchlist-database .db-imdb-result-top { flex-wrap: wrap; gap: 4px; }
  .watchlist-database .db-details { padding: 16px; }
  .watchlist-database .db-pagination { flex-wrap: wrap; }
}
.watchlist-database .db-watchlist-shortcuts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.watchlist-database .db-cell-value { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; max-height: 4.65em; overflow: hidden; line-height: 1.55; }

.media-watchlist .db-search-field { flex: 3; }
.media-watchlist .db-toolbar { margin: 16px 0 6px; gap: 10px; }
.media-watchlist .db-toolbar .field { margin-bottom: 0; }
.db-filter-note { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.db-filter-note .link-btn { flex-shrink: 0; font-size: 11px; }
.db-filter-note [hidden] { display: none; }
.media-watchlist-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; gap: 12px; }
.media-watchlist-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.media-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.media-watchlist-card h3 { min-width: 0; margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.media-year { font-family: var(--sans); font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.media-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.media-card-meta a { text-underline-offset: 3px; }
.media-card-actions { display: flex; flex-shrink: 0; flex-direction: column; align-items: end; gap: 0; }
.media-card-actions .link-btn { font-size: 11px; min-height: 26px; padding: 2px 0 2px 8px; }
.media-scores { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 11px; }
.media-scores > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.media-scores span { font-size: 10px; line-height: 1.4; color: var(--muted); }
.media-scores strong { font-size: 18px; line-height: 1.2; font-weight: 600; }
.media-scores .media-heaviness { font-size: 15px; line-height: 1.2; }
.media-heaviness.light { color: var(--green); }
.media-heaviness.medium { color: #8b673a; }
.media-heaviness.heavy { color: var(--wine); }
.media-watchlist-card h4 { margin: 0 0 8px; color: var(--muted); font-family: var(--sans); font-size: 10px; line-height: 1.4; font-weight: 600; }
.media-tag-source { display: block; margin-top: 3px; font-size: 9px; font-weight: 400; }
.media-tags { display: flex; flex-wrap: wrap; align-items: start; gap: 4px; }
.media-tag { display: inline-block; padding: 2px 6px; border-radius: 3px; background: #f0ece6; color: #57504b; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.media-tag-positive .media-tag { background: #eaf0e7; color: #45644d; }
.media-tag-low .media-tag { background: #f4e8e5; color: #843f38; }
.media-traits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.media-traits-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 5px; margin: 12px 0 8px; font-size: 11px; color: var(--muted); }
.media-traits-heading .hint { font-size: 10px; }
.media-tag-group .hint { font-size: 11px; }
.media-tags-more { display: contents; }
.media-tags-more[hidden] { display: none; }
.media-tags-toggle { padding: 4px 2px; font-size: 11px; }
.media-watchlist-empty { grid-column: 1 / -1; }
.media-archived { background: #faf7f1; }
.runtime-field { padding: 0; border: 0; margin: 0; min-width: 0; }
.runtime-field legend { margin-bottom: 10px; }
.runtime-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 12px; }
.runtime-range > div { min-width: 0; }
.runtime-range > span { align-self: end; padding-bottom: 15px; color: var(--muted); font-size: 12px; }
.runtime-range label { font-size: 11px; color: var(--muted); }
.metadata-refresh-card { margin: 0 0 20px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.metadata-refresh-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 14px; font-size: 12px; }
.metadata-refresh-heading strong { font-weight: 600; }
.metadata-refresh-heading span { color: var(--muted); font-size: 11px; }
.metadata-refresh-card p { margin: 8px 0 0; font-size: 11px; line-height: 1.5; }
.metadata-refresh-card progress { display: block; width: 100%; height: 6px; margin-top: 12px; border: 0; border-radius: 3px; overflow: hidden; accent-color: var(--green); }
.metadata-refresh-card progress::-webkit-progress-bar { background: var(--line); }
.metadata-refresh-card progress::-webkit-progress-value { background: var(--green); }
.metadata-refresh-failed { border-color: var(--wine); }
.media-detail-panel { margin-top: 10px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 11px; }
.media-detail-panel > summary { cursor: pointer; color: var(--muted); font-size: 11px; padding: 3px 0; }
.media-detail-panel[open] > summary { margin-bottom: 10px; }
.media-release-note { margin: 0 0 10px; color: var(--muted); }
.media-metadata-details { margin-top: 16px; }
.media-detail-facts, .media-score-detail dl { margin: 0 0 15px; }
.media-detail-facts > div, .media-score-detail dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 12px; padding: 5px 0; }
.media-detail-facts dt, .media-score-detail dt { color: var(--muted); line-height: 1.45; }
.media-detail-facts dd, .media-score-detail dd { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.media-score-explanation { border-top: 1px solid var(--line); padding-top: 14px; }
.media-score-detail dd { text-align: right; font-variant-numeric: tabular-nums; }
.media-score-detail dl > div:last-child { font-weight: 600; }
.media-detail-panel .hint { font-size: 10px; line-height: 1.55; }
.media-source-note { margin-bottom: 0; }
.media-watchlist [aria-busy="true"] .media-watchlist-cards { opacity: .6; }
@media (max-width: 700px) {
  .media-watchlist > .section-head { flex-direction: row; align-items: start; gap: 10px; margin-bottom: 20px; }
  .media-watchlist > .section-head h2 { font-size: 28px; line-height: 1.15; }
  .media-watchlist > .section-head p { display: none; }
  .media-watchlist > .section-head > .btn { flex-shrink: 0; padding: 12px; font-size: 12px; }
  .media-watchlist .db-summary { margin-bottom: 18px; gap: 10px 16px; }
  .media-watchlist .db-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; align-items: end; gap: 10px; }
  .media-watchlist .db-toolbar > .field { min-width: 0; }
  .media-watchlist .db-toolbar > .db-search-field { grid-column: 1 / -1; min-width: 0; }
  .media-watchlist .db-toolbar > .db-search-field { order: 0; }
  .media-watchlist .db-heaviness-field { grid-column: 1; }
  .media-watchlist .db-quality-field { grid-column: 2 / -1; }
  .media-watchlist .db-sort-direction { align-self: end; min-width: 44px; padding: 12px; }
  .media-watchlist .media-sort-label { display: none; }
  .media-watchlist-card { padding: 14px; }
  .media-watchlist-card h3 { font-size: 20px; }
  .media-card-heading { gap: 10px; }
  .media-card-actions { flex-shrink: 0; flex-direction: column; align-items: end; }
  .media-scores { gap: 8px 18px; }
  .media-scores strong { font-size: 18px; }
  .media-scores .media-heaviness { font-size: 15px; }
  .media-traits { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .media-tag-group { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 8px; }
  .media-tag-group h4 { margin: 4px 0; }
}
