:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #172338;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.sync-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.sync-gate-card { width: min(100%, 430px); padding: 36px; border-radius: 24px; background: #fff; box-shadow: 0 24px 60px #17243b1d; text-align: center; }
.sync-gate-card .brand-mark { margin: 0 auto 22px; }
.sync-gate-card h1 { margin: 0 0 12px; font-size: 25px; }
.sync-gate-card p { margin: 0; color: #64748b; line-height: 1.6; }
.data-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 0 16px 30px; }
.data-tools p { width: 100%; margin: 0 0 3px; color: #64748b; font-size: 12px; }
.data-tools button, .import-label { border: 1px solid #d5dce7; border-radius: 10px; background: #fff; padding: 9px 12px; color: #1d2b45; font-size: 12px; font-weight: 700; cursor: pointer; }
.data-tools button:hover, .import-label:hover { background: #edf2f8; }

.app-shell { max-width: 1160px; margin: auto; padding: 0 28px; }
.topbar { height: 88px; display: flex; align-items: center; gap: 12px; }
.brand-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.top-home { margin-left: auto; padding: 9px 12px; border-radius: 9px; color: #64748b; font-size: 12px; font-weight: 700; text-decoration: none; }
.top-home:hover { background: #e9edf4; color: #172338; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #f2a76b; color: #152038; box-shadow: 0 7px 16px #f2a76b45; }
.brand-mark span { font-size: 15px; margin-left: 2px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 17px; letter-spacing: -.03em; }
.brand-copy span { color: #7e899b; font-size: 11px; margin-top: 4px; }

.intro { position: relative; overflow: hidden; padding: 60px 64px 52px; border-radius: 28px; color: #fff; background: radial-gradient(circle at 83% 18%, #344762 0, transparent 31%), linear-gradient(130deg, #121d31, #1d2b45); box-shadow: 0 28px 60px #17243b1d; }
.intro::before { content: ''; position: absolute; width: 340px; height: 340px; border: 1px solid #ffffff16; border-radius: 50%; right: -80px; top: -90px; box-shadow: 0 0 0 45px #ffffff08, 0 0 0 92px #ffffff06; pointer-events: none; }
.intro::after { content: '▶'; position: absolute; right: 12%; top: 85px; font-size: 125px; color: #f2a76b21; transform: rotate(-12deg); pointer-events: none; }
.intro-kicker, .eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.intro-kicker { color: #f6b77f; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { position: relative; z-index: 1; font-size: clamp(36px, 5vw, 58px); letter-spacing: -.055em; line-height: 1.1; margin: 18px 0; }
h1 em { font-style: normal; color: #f2a76b; }
.intro > p:not(.search-status) { position: relative; z-index: 1; max-width: 500px; color: #c0c9d8; font-size: 15px; line-height: 1.6; margin-bottom: 30px; }
.home-intro { padding-bottom: 64px; }
.home-intro > p:not(.search-status) { margin-bottom: 22px; }
.home-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: -26px 26px 38px; position: relative; z-index: 2; }
.home-tile { position: relative; display: flex; flex-direction: column; min-height: 155px; padding: 20px; border: 1px solid #e8ecf1; border-radius: 17px; background: #fff; box-shadow: 0 12px 30px #13213a16; color: #172338; text-align: left; text-decoration: none; transition: transform .18s, box-shadow .18s; }
.home-tile:hover { transform: translateY(-3px); box-shadow: 0 17px 36px #13213a26; }
.tile-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 10px; background: #fff0e3; color: #d9874c; font-size: 21px; }
.home-tile strong { font-size: 16px; }
.home-tile > span:not(.tile-icon):not(.tile-arrow) { margin-top: 5px; color: #8a96a5; font-size: 11px; }
.tile-arrow { position: absolute; right: 20px; bottom: 20px; color: #dd925b; font-size: 19px; }
.back-link { display: inline-block; margin: 11px 0 16px; color: #68778b; font-size: 12px; font-weight: 700; text-decoration: none; }
.back-link:hover { color: #172338; }
.back-button { padding: 0; border: 0; background: none; }
.search-box { position: relative; z-index: 2; display: flex; align-items: center; max-width: 620px; padding: 6px; border: 1px solid #ffffff2c; border-radius: 16px; background: #fff; box-shadow: 0 15px 32px #00000021; }
.search-icon { width: 42px; text-align: center; color: #7a8799; font-size: 28px; line-height: 1; transform: rotate(-15deg); }
.search-box input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; color: #19253a; background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #9aa5b3; }
.search-box button { border: 0; border-radius: 11px; color: #132036; background: #f2a76b; font-weight: 800; font-size: 13px; padding: 14px 22px; }
.search-box button:hover { background: #f7bb8b; }
.search-status { position: relative; z-index: 2; min-height: 18px; color: #d3dded; font-size: 12px; margin: 12px 0 0; }
.search-results { position: relative; z-index: 3; display: grid; max-width: 620px; max-height: 340px; overflow-y: auto; border-radius: 14px; }
.search-results:not(:empty) { margin-top: 6px; padding: 5px; background: #fff; box-shadow: 0 18px 35px #0a13265c; }
.result-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px; border: 0; border-radius: 9px; background: transparent; text-align: left; color: #172338; }
.result-row:hover, .result-row:focus-visible { background: #f4f6fa; }
.result-poster { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 50px; border-radius: 5px; overflow: hidden; background: #e2e8ef; color: #64748b; }
.result-poster img, .card-poster img, .hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.result-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.result-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.result-copy small { color: #788599; font-size: 11px; }
.result-status { width: fit-content; padding: 3px 7px; border-radius: 6px; font-size: 10px; font-weight: 750; }
.result-status.favorite { color: #a86332; background: #fff0e3; }
.result-status.archive { color: #28644a; background: #eaf8ef; }
.result-add { color: #df8d4e; font-size: 22px; padding: 0 7px; }

.workspace { padding: 52px 0 35px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 21px; }
.eyebrow { color: #df8d4e; }
.section-heading h2 { font-size: 26px; letter-spacing: -.04em; margin: 8px 0 0; }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; vertical-align: 2px; background: #e9edf4; color: #5c6b81; font-size: 12px; border-radius: 8px; letter-spacing: 0; }
.total-progress { color: #8793a3; font-size: 12px; padding-bottom: 5px; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.empty-library { grid-column: 1 / -1; display: flex; align-items: center; flex-direction: column; text-align: center; padding: 42px 20px; border: 1px dashed #cbd4df; border-radius: 18px; background: #fff; }
.empty-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 15px; border-radius: 15px; background: #fff2e7; color: #e39150; font-size: 27px; }
.empty-library h3 { margin: 0 0 5px; font-size: 17px; }
.empty-library p { max-width: 280px; margin: 0; color: #8a96a5; font-size: 12px; line-height: 1.5; }
.empty-link { margin-top: 15px; color: #b66b35; font-size: 12px; font-weight: 700; text-decoration: none; }
.empty-link:hover { text-decoration: underline; }
.show-card { display: flex; gap: 13px; width: 100%; min-height: 126px; padding: 10px; border: 1px solid #e8ecf1; border-radius: 16px; background: #fff; text-align: left; color: inherit; box-shadow: 0 6px 20px #14244108; transition: transform .18s, border-color .18s, box-shadow .18s; }
.show-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px #14244113; }
.show-card.active { border-color: #eeb488; box-shadow: 0 0 0 2px #f2a76b26; }
.card-poster { display: grid; place-items: center; flex: 0 0 72px; width: 72px; height: 104px; overflow: hidden; border-radius: 9px; background: #dbe3eb; color: #8090a3; }
.show-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 4px 0; }
.show-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.show-card-body > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8a96a4; font-size: 11px; margin: 5px 0 auto; }
.show-card-body small { margin-top: 6px; color: #8a96a4; font-size: 10px; }
.card-arrow { align-self: center; padding: 0 2px; font-size: 24px; color: #9da8b6; }
.progress-track { height: 6px; width: 100%; border-radius: 99px; overflow: hidden; background: #e9edf2; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: #eea066; transition: width .2s; }

.detail { margin-top: 30px; scroll-margin-top: 20px; }
.detail-page { padding: 12px 0 38px; }
.detail-page .detail { margin-top: 0; }
.detail:empty { display: none; }
.detail-hero { display: flex; gap: 24px; min-height: 216px; padding: 24px; border: 1px solid #e7ebf1; border-radius: 20px; background: #fff; box-shadow: 0 8px 26px #14244109; }
.hero-poster { display: grid; place-items: center; flex: 0 0 114px; width: 114px; min-height: 168px; overflow: hidden; border-radius: 11px; background: #dce4ec; color: #8798a9; font-size: 28px; }
.hero-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.hero-copy h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.045em; margin: 6px 0 5px; }
.hero-meta { color: #8591a0; font-size: 12px; margin: 0 0 7px; }
.source-link { width: fit-content; color: #b66b35; font-size: 11px; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.hero-progress { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 6px 12px; margin-top: auto; padding-top: 18px; }
.hero-progress strong { font-size: 26px; line-height: 1; letter-spacing: -.05em; }
.hero-progress > span { color: #8a96a4; font-size: 11px; }
.hero-progress .progress-track { grid-column: 1 / -1; height: 7px; }
.show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; }
.show-actions button { padding: 9px 12px; border: 1px solid #e5e9ef; border-radius: 9px; background: #fff; color: #45566b; font-size: 11px; font-weight: 750; }
.show-actions button:hover { border-color: #efb78e; }
.show-actions .favorite-button.selected { color: #ae6b35; border-color: #f0d7c2; background: #fff6ed; }
.show-actions .archive-button { border-color: #d6e8df; color: #28644a; background: #eef9f2; }
.archive-badge { color: #28644a; font-size: 11px; font-weight: 800; }
.archive-prompt { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 13px; padding: 17px 19px; border: 1px solid #cce7d7; border-radius: 14px; background: #eef9f2; }
.archive-prompt strong { color: #28644a; font-size: 13px; }
.archive-prompt p { margin: 4px 0 0; color: #5d7467; font-size: 11px; }
.archive-prompt-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.archive-prompt-actions button { padding: 9px 11px; border: 0; border-radius: 8px; font-size: 11px; font-weight: 750; }
.archive-confirm { color: #fff; background: #28644a; }
.archive-later { color: #456251; background: #dcefe3; }
.detail-notice { margin: 12px 0 0; padding: 12px 15px; border-radius: 10px; color: #7d541f; background: #fff1de; font-size: 12px; }
.loading-panel { margin-top: 18px; padding: 26px; border-radius: 14px; background: #fff; color: #8895a4; font-size: 13px; text-align: center; }
.season-shortcuts { margin-top: 18px; padding: 19px 20px; border: 1px solid #e7ebf1; border-radius: 16px; background: #fff; }
.shortcut-list { display: flex; gap: 9px; overflow-x: auto; margin-top: 12px; padding-bottom: 3px; scrollbar-width: thin; }
.season-shortcut { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; padding: 10px 12px; border: 1px solid #e7ebf0; border-radius: 10px; background: #f8f9fc; color: #28374d; }
.season-shortcut:hover { border-color: #efb78e; background: #fff7f0; }
.season-shortcut strong { font-size: 12px; }
.season-shortcut small { color: #8995a3; font-size: 10px; }
.next-episode { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 20px 22px; border-radius: 16px; background: #fff0e3; }
.next-copy { flex: 1; min-width: 0; }
.next-copy h3 { margin: 6px 0 3px; font-size: 18px; letter-spacing: -.03em; }
.next-copy p { margin: 0; color: #8e715f; font-size: 11px; line-height: 1.5; }
.next-copy .next-position { margin-bottom: 10px; }
.next-dates { display: grid; gap: 4px; }
.next-dates p { color: #624935; font-weight: 650; }
.next-dates small { color: #987b69; font-size: 10px; line-height: 1.4; }
.german-date-editor { margin-top: 10px; color: #765a44; font-size: 11px; }
.german-date-editor summary { width: fit-content; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.german-date-form { display: grid; grid-template-columns: minmax(140px, 220px) auto; align-items: end; gap: 7px; margin-top: 10px; }
.german-date-form label { grid-column: 1 / -1; font-weight: 700; }
.german-date-form input { min-width: 0; padding: 8px; border: 1px solid #e8cdb8; border-radius: 8px; color: #172338; background: #fff; }
.german-date-form button { padding: 9px 10px; border: 0; border-radius: 8px; background: #172338; color: #fff; font-size: 11px; font-weight: 700; }
.german-date-form .clear-date-button { grid-column: 1 / -1; width: fit-content; padding-left: 0; color: #765a44; background: transparent; text-decoration: underline; }
.next-jump { flex: 0 0 auto; padding: 10px 13px; border: 0; border-radius: 10px; background: #172338; color: #fff; font-size: 11px; font-weight: 700; }
.next-jump:hover { background: #2b3b56; }
.next-done { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; color: #28644a; background: #e4f4e8; font-weight: 800; }
.episodes-heading { margin: 32px 0 14px; }
.episodes-heading h3 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.035em; }
.season { margin-bottom: 11px; overflow: hidden; border: 1px solid #e7ebf0; border-radius: 15px; background: #fff; scroll-margin-top: 18px; }
.season-toggle { display: flex; align-items: center; gap: 12px; padding: 17px 19px; cursor: pointer; list-style: none; }
.season-toggle::-webkit-details-marker { display: none; }
.season-toggle strong { flex: 1; font-size: 14px; }
.season-toggle > span:not(.chevron) { color: #8894a3; font-size: 11px; }
.chevron { margin-left: 8px; color: #8793a1; font-size: 20px; transition: transform .2s; }
.season[open] .chevron { transform: rotate(180deg); }
.season-actions { display: flex; justify-content: flex-end; padding: 11px 18px; border-top: 1px solid #edf0f4; background: #fbfcfe; }
.mark-season-button { padding: 9px 12px; border: 1px solid #cce7d7; border-radius: 9px; color: #28644a; background: #eaf8ef; font-size: 11px; font-weight: 700; }
.mark-season-button:hover:not(:disabled) { background: #d7f0e0; }
.mark-season-button:disabled { opacity: .7; cursor: default; }
.mark-season-button.is-complete { border-color: #e8d8c8; color: #765a44; background: #fff7ee; }
.mark-season-button.is-complete:hover { background: #f9ebdc; }
.episode-list { border-top: 1px solid #edf0f4; }
.episode { padding: 19px; border-top: 1px solid #f0f2f5; scroll-margin-top: 18px; }
.episode:first-child { border-top: 0; }
.episode.watched { background: #fcfdfc; }
.episode-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.episode-title-box { min-width: 0; }
.episode-number { display: block; margin-bottom: 4px; color: #db8d54; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.episode h4 { margin: 0; font-size: 14px; line-height: 1.35; }
.watch-button { flex: 0 0 auto; padding: 9px 13px; border: 1px solid #e4e9ef; border-radius: 9px; color: #45566b; background: #fff; font-size: 11px; font-weight: 700; }
.watch-button:hover { border-color: #f2a76b; }
.watch-button.is-watched { color: #28644a; border-color: #cce7d7; background: #eaf8ef; }
.episode-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 10px 0; color: #909baa; font-size: 11px; }
.episode-meta .watched-date { color: #3a8a62; font-weight: 700; }
.episode-summary { margin: 0; color: #657387; font-size: 12px; line-height: 1.55; }

footer { display: flex; justify-content: space-between; gap: 16px; padding: 22px 0 32px; border-top: 1px solid #e6eaf0; color: #99a4b1; font-size: 10px; line-height: 1.5; }
footer a { color: #6f7b8d; }
.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; }
:focus-visible { outline: 3px solid #f2a76b; outline-offset: 3px; }

@media (max-width: 700px) {
  .app-shell { padding: 0 16px; }
  .topbar { height: 72px; }
  .intro { padding: 38px 23px 30px; border-radius: 21px; }
  .intro::after { right: 5%; top: 47px; font-size: 90px; }
  .intro > p:not(.search-status) { font-size: 13px; max-width: 290px; }
  .home-intro { padding-bottom: 54px; }
  .home-menu { grid-template-columns: 1fr; gap: 10px; margin: -22px 10px 24px; }
  .home-tile { min-height: 99px; padding: 15px 18px 15px 66px; justify-content: center; }
  .tile-icon { position: absolute; left: 18px; top: 28px; margin: 0; }
  .tile-arrow { bottom: 38px; right: 16px; }
  .search-box input { font-size: 13px; }
  .search-box button { padding: 13px 15px; }
  .workspace { padding-top: 38px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 22px; }
  .total-progress { max-width: 100px; text-align: right; line-height: 1.4; }
  .library { grid-template-columns: 1fr; }
  .show-card { min-height: 108px; }
  .card-poster { height: 88px; width: 62px; flex-basis: 62px; }
  .detail-hero { gap: 15px; padding: 16px; min-height: 180px; }
  .hero-poster { width: 87px; flex-basis: 87px; min-height: 130px; }
  .hero-copy h2 { font-size: 22px; }
  .hero-progress strong { font-size: 22px; }
  .archive-prompt { align-items: stretch; flex-direction: column; }
  .archive-prompt-actions { flex-wrap: wrap; }
  .season-shortcuts { padding: 16px; }
  .next-episode { flex-direction: column; align-items: stretch; padding: 18px; }
  .next-copy h3 { font-size: 16px; }
  .next-jump { align-self: flex-end; padding: 9px; }
  .episode { padding: 16px; }
  .watch-button { padding: 8px 10px; }
  footer { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
