:root {
  color-scheme: dark;
  --bg: #030711;
  --panel: #0b1422;
  --panel-strong: #101d2e;
  --panel-soft: #07101d;
  --text: #f7f8fc;
  --muted: #93a3b8;
  --line: #203149;
  --line-bright: #304764;
  --accent: #7c5cff;
  --accent-bright: #9b87ff;
  --accent-2: #25d0ab;
  --danger: #ff6b7a;
  --danger-soft: rgba(255, 107, 122, 0.13);
  --success-soft: rgba(37, 208, 171, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  flex-direction: column;
  background:
    radial-gradient(circle at 8% -5%, rgba(92, 74, 181, 0.3) 0, transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(37, 208, 171, 0.08) 0, transparent 28rem),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(155, 135, 255, 0.78);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.tv-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  width: 100%;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(48, 71, 100, 0.72);
  background: rgba(3, 7, 17, 0.84);
  backdrop-filter: blur(20px);
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.2rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.tv-brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #4778ff);
  box-shadow: 0 10px 30px rgba(92, 74, 255, 0.32);
  font-size: 0.76rem;
}

.tv-header-actions,
.language-switcher,
.tv-user {
  display: flex;
  align-items: center;
}

.tv-header-actions {
  margin-left: auto;
  gap: 32px;
}

.language-switcher {
  flex: 0 0 auto;
  gap: 10px;
}

.language-switcher form,
.tv-user form {
  margin: 0;
}

.tv-user {
  gap: 18px;
  color: var(--muted);
}

.link-button,
.icon-button {
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.link-button {
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1;
  transition: color 180ms ease, background-color 180ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.flag-button {
  position: relative;
  display: grid;
  width: 56px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(5, 11, 20, 0.35);
  color: #fff;
  cursor: pointer;
  filter: saturate(0.6) brightness(0.72);
  opacity: 0.44;
  transition:
    opacity 180ms ease,
    filter 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.flag-button-da {
  background-color: #c8102e;
  background-image:
    linear-gradient(to bottom, transparent 41%, #fff 41%, #fff 58%, transparent 58%),
    linear-gradient(to right, transparent 31%, #fff 31%, #fff 43%, transparent 43%);
}

.flag-button-en {
  background-color: #012169;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 36'%3E%3Crect width='60' height='36' fill='%23012169'/%3E%3Cpath d='M0 0L60 36M60 0L0 36' stroke='%23fff' stroke-width='7.2'/%3E%3Cpath d='M0 0L60 36M60 0L0 36' stroke='%23c8102e' stroke-width='2.4'/%3E%3Cpath d='M30 0V36M0 18H60' stroke='%23fff' stroke-width='12'/%3E%3Cpath d='M30 0V36M0 18H60' stroke='%23c8102e' stroke-width='7.2'/%3E%3C/svg%3E");
}

.flag-code {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px #000, 0 0 5px #000;
}

.flag-button:hover {
  filter: saturate(0.9) brightness(0.92);
  opacity: 0.82;
  transform: translateY(-1px);
}

.flag-button.is-active {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 0 2px rgba(124, 92, 255, 0.55),
    0 0 22px rgba(124, 92, 255, 0.72);
  filter: saturate(1.08) brightness(1.08);
  opacity: 1;
  transform: translateY(-1px);
}

.flag-button.is-active::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(5, 11, 20, 0.45);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.95);
  content: "";
}

.tv-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 88px;
  flex: 1 0 auto;
}

.hero,
.search-panel,
.wishes,
.login-card {
  border: 1px solid var(--line);
  background: rgba(11, 20, 34, 0.92);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  min-height: 280px;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  padding: 48px;
  overflow: hidden;
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.2), rgba(37, 208, 171, 0.055)),
    rgba(11, 20, 34, 0.95);
}

.hero-copy {
  max-width: 820px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 800px;
  margin: 0.12em 0 0.28em;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  letter-spacing: -0.058em;
  line-height: 0.98;
}

h2 {
  margin: 0.1em 0;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  letter-spacing: -0.035em;
}

h3 {
  margin: 0.25rem 0 0.65rem;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #4d80ff);
  box-shadow: 0 12px 28px rgba(83, 88, 255, 0.25);
  color: #fff;
}

.button.primary:not(:disabled):hover {
  box-shadow: 0 15px 34px rgba(83, 88, 255, 0.36);
}

.button.secondary {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, 0.035);
}

.button.secondary:not(:disabled):hover {
  border-color: rgba(155, 135, 255, 0.7);
  background: rgba(124, 92, 255, 0.09);
}

.button.compact {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 0.88rem;
}

.button.discord {
  width: 100%;
  background: #5865f2;
}

.button.danger,
.button.danger-outline {
  color: #ffd9dd;
}

.button.danger {
  background: #b93649;
}

.button.danger-outline {
  border-color: rgba(255, 107, 122, 0.46);
  background: var(--danger-soft);
}

.search-panel,
.wishes {
  margin-top: 28px;
  padding: 32px;
  border-radius: 26px;
}

.section-heading,
.stage-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading > div:first-child {
  max-width: 700px;
}

.section-heading p:last-child {
  margin: 0.65rem 0 0;
}

.request-steps {
  display: grid;
  margin: 32px 0;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

.request-steps li {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.request-steps li:not(:last-child)::after {
  height: 1px;
  min-width: 20px;
  margin: 0 14px;
  flex: 1;
  background: var(--line);
  content: "";
}

.request-steps li > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: var(--panel-soft);
  font-size: 0.76rem;
  font-weight: 850;
}

.request-steps li strong {
  font-size: 0.82rem;
}

.request-steps li.is-current,
.request-steps li.is-complete {
  color: var(--text);
}

.request-steps li.is-current > span {
  border-color: var(--accent-bright);
  background: rgba(124, 92, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.1);
}

.request-steps li.is-complete > span {
  border-color: rgba(37, 208, 171, 0.5);
  background: rgba(37, 208, 171, 0.13);
  color: #77f1d6;
}

.request-stage {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 16, 29, 0.72);
}

.stage-heading {
  margin-bottom: 22px;
}

.stage-heading h3 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
}

.stage-heading p:last-child {
  margin: 0.55rem 0 0;
}

.search-form {
  display: grid;
  margin: 0 0 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-form input,
.stack input,
.request-toolbar input,
.request-toolbar select,
.preference-grid select,
.cancel-confirmation textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #050d19;
  color: var(--text);
}

.search-form input,
.stack input,
.request-toolbar input,
.cancel-confirmation textarea {
  padding: 0 15px;
}

.request-toolbar select,
.preference-grid select {
  padding: 0 38px 0 13px;
}

.search-form input:focus,
.stack input:focus,
.request-toolbar input:focus,
.request-toolbar select:focus,
.preference-grid select:focus,
.cancel-confirmation textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

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

.result-card,
.wish-card {
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.result-card {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

.result-card > img,
.result-card > .poster-fallback,
.wish-card > img,
.wish-card > .poster-fallback {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.result-card > img,
.result-card > .poster-fallback {
  max-width: 92px;
}

.result-card-body,
.wish-card-body,
.review-card-body,
.detail-hero-body {
  min-width: 0;
}

.result-card-body {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.result-card-body .button {
  margin-top: auto;
}

.result-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.poster-fallback {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.2), rgba(37, 208, 171, 0.08)),
    #142237;
  color: var(--muted);
  font-weight: 900;
}

.wish-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.review-card {
  display: grid;
  margin-bottom: 20px;
  padding: 18px;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  border: 1px solid var(--line-bright);
  border-radius: 20px;
  background: var(--panel-strong);
}

.review-poster {
  width: 150px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  object-fit: cover;
}

.review-card-body h3 {
  margin-top: 0.5rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.preference-panel,
.scope-panel {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(5, 13, 25, 0.78);
}

.preference-panel legend,
.scope-panel legend {
  padding: 0 8px;
  color: var(--text);
  font-weight: 800;
}

.preference-panel p {
  margin: 10px 0 0;
}

.scope-panel {
  margin-bottom: 16px;
}

.scope-intro {
  margin: 0 0 14px;
}

.scope-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scope-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(16, 29, 46, 0.72);
  color: var(--text);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.scope-option:has(input:checked) {
  border-color: rgba(155, 135, 255, 0.76);
  background: rgba(124, 92, 255, 0.13);
}

.scope-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.scope-option input,
.scope-flags input,
.catalog-choice input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent-bright);
}

.scope-option span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.scope-option strong {
  font-size: 0.9rem;
}

.scope-option small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
}

.scope-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 16, 29, 0.78);
}

.scope-flags label,
.catalog-choice {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  color: #d9e2ee;
  cursor: pointer;
  font-size: 0.84rem;
}

.catalog-status {
  min-height: 1.35em;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.catalog-status.is-warning {
  color: #ffd087;
}

.catalog-options {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(3, 9, 18, 0.7);
}

.catalog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.catalog-heading > span {
  color: var(--muted);
  font-size: 0.76rem;
}

.catalog-list {
  display: grid;
  max-height: 340px;
  padding-right: 5px;
  overflow-y: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  scrollbar-color: var(--line-bright) transparent;
}

.catalog-choice {
  padding: 10px;
  border: 1px solid rgba(48, 71, 100, 0.68);
  border-radius: 12px;
  background: rgba(16, 29, 46, 0.64);
  line-height: 1.4;
}

.catalog-choice:has(input:checked) {
  border-color: rgba(37, 208, 171, 0.5);
  background: rgba(37, 208, 171, 0.08);
}

.catalog-choice span {
  min-width: 0;
}

.catalog-choice small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.scope-current-summary,
.scope-summary {
  color: #c9beff;
  font-size: 0.82rem;
  font-weight: 720;
}

.scope-current-summary {
  margin: 13px 0 0;
}

.scope-summary {
  margin: 0.65rem 0 0;
}

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

.preference-grid label,
.request-toolbar label,
.cancel-confirmation label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.stage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.request-success {
  padding: 44px 26px;
  border: 1px solid rgba(37, 208, 171, 0.34);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(37, 208, 171, 0.12), transparent 55%),
    rgba(7, 20, 28, 0.88);
  text-align: center;
}

.request-success .stage-actions {
  justify-content: center;
}

.success-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid rgba(37, 208, 171, 0.42);
  border-radius: 20px;
  background: rgba(37, 208, 171, 0.12);
  color: #84f8dc;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.notice {
  margin: 16px 0 0;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #14243a;
  color: var(--text);
}

.notice.error {
  border-color: rgba(255, 107, 122, 0.22);
  background: var(--danger-soft);
  color: #ffc1c7;
}

.notice.success {
  border-color: rgba(37, 208, 171, 0.22);
  background: var(--success-soft);
  color: #b6f9ea;
}

.notice.warning {
  border-color: rgba(255, 185, 77, 0.28);
  background: rgba(255, 185, 77, 0.11);
  color: #ffe0a9;
}

.duplicate-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(155, 135, 255, 0.35);
  border-radius: 15px;
  background: rgba(124, 92, 255, 0.1);
}

.duplicate-action strong {
  color: var(--text);
}

.duplicate-action p {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.request-summary {
  display: grid;
  margin: 28px 0 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.request-summary > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.08), transparent),
    var(--panel-soft);
}

.request-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.request-summary dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.request-toolbar {
  display: grid;
  margin-bottom: 20px;
  padding: 16px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 13, 25, 0.62);
}

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

.wish-card {
  padding: 14px;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 18px;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.wish-card:hover {
  border-color: var(--line-bright);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.wish-card-body {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.wish-card-body h3 {
  margin-top: 0.45rem;
}

.wish-detail-button {
  margin-top: auto;
}

.status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #263249;
  color: #dbe6f3;
  font-size: 0.76rem;
  font-weight: 780;
}

.status-approved,
.status-added,
.status-completed {
  background: rgba(37, 208, 171, 0.15);
  color: #68f4d5;
}

.status-reviewing {
  background: rgba(255, 185, 77, 0.15);
  color: #ffd087;
}

.status-rejected,
.status-cancelled,
.status-failed {
  background: rgba(255, 107, 122, 0.14);
  color: #ff9da7;
}

.status-new,
.status-pending {
  background: rgba(124, 92, 255, 0.16);
  color: #c9beff;
}

.language-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0.75rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.comment {
  margin: 0.9rem 0;
  padding-left: 11px;
  border-left: 2px solid var(--accent);
  color: #c7d2e0;
}

.small {
  color: var(--muted);
  font-size: 0.8rem;
}

.count {
  flex: 0 0 auto;
  color: var(--muted);
}

.empty-state {
  padding: 50px 20px;
  border: 1px dashed var(--line-bright);
  border-radius: 18px;
  text-align: center;
}

.compact-empty {
  padding: 30px 20px;
}

.request-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.62);
  color: var(--text);
}

.request-dialog::backdrop {
  background: rgba(1, 4, 10, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-shell {
  max-height: min(88vh, 900px);
  padding: 28px;
  overflow-y: auto;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  margin-top: 0.2rem;
}

.dialog-close {
  position: sticky;
  top: 0;
}

.detail-loading {
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

.detail-hero {
  display: grid;
  padding: 24px 0;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 24px;
}

.detail-poster {
  width: 132px;
  aspect-ratio: 2 / 3;
  border-radius: 15px;
  object-fit: cover;
}

.detail-hero-body .status {
  margin: 0.7rem 0 0.35rem;
}

.detail-facts {
  display: grid;
  margin: 0;
  padding: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.detail-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.detail-facts dd {
  margin: 0;
  color: var(--text);
  font-size: 0.93rem;
}

.detail-section {
  margin-top: 24px;
}

.status-timeline {
  display: grid;
  margin: 16px 0 0;
  padding: 0;
  gap: 0;
  list-style: none;
}

.status-timeline li {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0 0 22px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
}

.status-timeline li:not(:last-child)::before {
  position: absolute;
  top: 12px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--line-bright);
  content: "";
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(37, 208, 171, 0.13);
}

.timeline-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.timeline-heading time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-timeline p {
  margin: 0.45rem 0 0;
}

.cancel-zone {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid rgba(255, 107, 122, 0.28);
  border-radius: 18px;
  background: rgba(70, 18, 29, 0.16);
}

.cancel-zone h3 {
  margin-top: 0;
}

.cancel-confirmation {
  margin-top: 16px;
}

.cancel-prompt {
  color: #ffd9dd;
  font-weight: 700;
}

.cancel-confirmation textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 190px);
  align-items: center;
  grid-template-columns: 1.2fr minmax(320px, 460px);
  gap: 60px;
}

.login-shell.single {
  justify-content: center;
  grid-template-columns: minmax(320px, 560px);
}

.login-card {
  padding: 34px;
  border-radius: 24px;
}

.stack {
  display: grid;
  gap: 16px;
}

.stack label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
}

.divider::before,
.divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.error-page {
  margin-top: 12vh;
}

.tv-footer {
  border-top: 1px solid rgba(48, 71, 100, 0.62);
  background:
    linear-gradient(180deg, rgba(7, 16, 29, 0.74), rgba(3, 7, 17, 0.98)),
    var(--bg);
}

.tv-footer-inner {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 30px;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 36px 64px;
}

.tv-footer-copy {
  max-width: 700px;
}

.tv-footer-copy h2 {
  max-width: 680px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.tv-footer-copy p:last-child {
  margin-bottom: 0;
}

.tv-vision-points {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

.tv-vision-points span {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.055);
  color: #cbd5e3;
  font-size: 0.84rem;
  font-weight: 720;
}

.tv-footer-note {
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  font-size: 0.78rem;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .result-grid,
  .wish-grid {
    grid-template-columns: 1fr;
  }

  .request-toolbar {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(150px, 0.55fr));
  }
}

@media (max-width: 760px) {
  .tv-main {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .tv-header {
    padding: 0 14px;
  }

  .tv-header-actions {
    gap: 14px;
  }

  .language-switcher {
    gap: 7px;
  }

  .flag-button {
    width: 46px;
    height: 29px;
    border-radius: 8px;
  }

  .flag-code {
    font-size: 0.61rem;
  }

  .tv-user > span {
    display: none;
  }

  .hero {
    min-height: 250px;
    align-items: flex-start;
    padding: 28px;
    flex-direction: column;
  }

  .hero .button {
    width: 100%;
  }

  .search-panel,
  .wishes {
    padding: 19px;
  }

  .section-heading,
  .stage-heading-row {
    align-items: flex-start;
  }

  .request-steps li {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .request-steps li:not(:last-child)::after {
    position: absolute;
    top: 16px;
    right: 8px;
    left: 42px;
    margin: 0;
  }

  .request-stage {
    padding: 18px;
  }

  .search-form,
  .request-toolbar,
  .preference-grid,
  .scope-options {
    grid-template-columns: 1fr;
  }

  .catalog-list {
    grid-template-columns: 1fr;
  }

  .review-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
  }

  .review-poster {
    width: 96px;
  }

  .request-summary {
    gap: 8px;
  }

  .request-summary > div {
    padding: 14px 12px;
  }

  .request-summary dd {
    font-size: 1.65rem;
  }

  .detail-hero {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
  }

  .detail-poster {
    width: 96px;
  }

  .dialog-shell {
    padding: 20px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .login-copy {
    padding-top: 25px;
  }

  .tv-footer-inner {
    width: min(100% - 32px, 1180px);
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

@media (max-width: 520px) {
  .tv-brand > span:last-child {
    display: none;
  }

  .hero,
  .search-panel,
  .wishes {
    border-radius: 22px;
  }

  .section-heading,
  .stage-heading-row {
    flex-direction: column;
  }

  .stage-heading-row .button {
    width: 100%;
  }

  .request-steps li strong {
    font-size: 0.7rem;
  }

  .result-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .result-description {
    -webkit-line-clamp: 3;
  }

  .review-card,
  .detail-hero {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .review-poster,
  .detail-poster {
    width: 80px;
  }

  .wish-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 13px;
  }

  .stage-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .duplicate-action {
    align-items: stretch;
    flex-direction: column;
  }

  .duplicate-action .button {
    width: 100%;
  }

  .request-success .stage-actions {
    flex-direction: column;
  }

  .request-summary dt {
    font-size: 0.7rem;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }

  .timeline-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .button:hover,
  .wish-card:hover,
  .flag-button:hover,
  .flag-button.is-active {
    transform: none;
  }
}
