:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f5f6f8; color: #17202a; }
main { max-width: 980px; margin: 0 auto; padding: 32px 20px 64px; }
main.home { max-width: 760px; padding-top: 64px; }
a { color: #274c77; }
h1 { margin: 12px 0 24px; }
.panel { background: white; border: 1px solid #dfe3e8; border-radius: 14px; padding: 20px; margin-bottom: 18px; box-shadow: 0 6px 22px #17202a0a; }
.eyebrow, .muted { color: #66788a; }
.primary-link, button { display: inline-block; border: 0; border-radius: 9px; padding: 12px 18px; background: #274c77; color: white; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
.primary-link:hover, button:hover { background: #1e3b5c; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, .choice:focus-within, a:focus-visible { outline: 3px solid #f4a261; outline-offset: 3px; }
.tool-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.score { background: #f8fafc; border-radius: 10px; padding: 14px; }
.label { color: #66788a; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.value { display: block; margin-top: 6px; font-size: 1.22rem; font-weight: 750; overflow-wrap: anywhere; }
.distribution { width: 100%; height: 82px; margin-top: 16px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fbfdff; }
form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
label { font-weight: 650; }
input[type=number], input[type=search], input[type=text], input[type=password], textarea { display: block; margin-top: 7px; max-width: 100%; padding: 10px; border: 1px solid #aab4be; border-radius: 8px; font: inherit; }
textarea { width: 100%; resize: vertical; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.vocabulary-form label { flex: 1 1 300px; }
textarea:focus-visible { outline: 3px solid #f4a261; outline-offset: 3px; }
input[type=number] { width: 150px; }
input[type=search] { width: min(460px, 75vw); }
#film-id { width: 220px; }
.error { border-color: #c53030; color: #9b2c2c; background: #fff5f5; }
.completion { border-color: #2f855a; background: #f0fff4; }
.hidden { display: none !important; }
.word { padding: 18px 0; border-bottom: 1px solid #edf0f2; }
.word:last-of-type { border-bottom: 0; }
.word-name { display: block; margin-bottom: 12px; font-size: 1.25rem; font-weight: 750; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: flex; min-height: 58px; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border: 2px solid #aab4be; border-radius: 12px; background: #f8fafc; cursor: pointer; font-size: 1.08rem; font-weight: 750; }
.choice:hover { border-color: #274c77; background: #edf5fc; }
.choice:has(input:checked) { border-color: #274c77; background: #dcecf8; color: #173b57; }
.choice input { width: 22px; height: 22px; margin: 0; accent-color: #274c77; }
.batch-footer { display: flex; justify-content: flex-end; margin-top: 18px; }
.film-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.film-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; min-height: 88px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; color: inherit; background: #fbfdff; text-decoration: none; }
.film-row:hover { border-color: #8aa4bc; background: #f1f6fa; }
.film-thumbnail-frame { display: flex; width: 48px; height: 72px; align-items: center; justify-content: center; overflow: hidden; border-radius: 5px; background: #e7edf2; }
.film-thumbnail { display: block; width: 48px; height: 72px; object-fit: cover; }
.film-thumbnail-placeholder { padding: 4px; color: #66788a; font-size: .65rem; text-align: center; }
.film-row-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; min-width: 0; }
.film-title { font-weight: 750; }
.film-meta, .film-original-title, .film-description { color: #66788a; font-size: .9rem; }
.film-original-title, .film-description { grid-column: 1 / -1; }
.film-original-title { font-style: italic; }
.film-description { display: -webkit-box; overflow: hidden; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.results-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.results-footer form { margin-left: auto; }
.film-details { display: grid; grid-template-columns: minmax(130px, .4fr) minmax(0, 1fr); gap: 0; margin: 0; }
.film-details dt, .film-details dd { margin: 0; padding: 11px 0; border-bottom: 1px solid #edf0f2; overflow-wrap: anywhere; }
.film-details dt { padding-right: 16px; color: #66788a; font-weight: 750; }
.film-poster { display: block; width: min(240px, 100%); height: auto; margin: 0 0 18px; border-radius: 10px; background: #edf0f2; }
.difficulty-details { margin: 0; }
.film-vocabulary { margin-top: 24px; }
.film-vocabulary summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
.film-vocabulary summary:focus-visible, .film-vocabulary-scroll:focus-visible { outline: 3px solid #f4a261; outline-offset: 3px; }
.film-vocabulary-scroll { max-height: 360px; overflow: auto; border: 1px solid #dfe3e8; border-radius: 8px; }
.film-vocabulary-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.film-vocabulary-table th, .film-vocabulary-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #edf0f2; }
.film-vocabulary-table th { position: sticky; top: 0; background: #f5f6f8; z-index: 1; }
.film-vocabulary-table td:first-child { overflow-wrap: anywhere; }
.film-vocabulary-table td:not(:first-child) { white-space: nowrap; }
.film-vocabulary-known td:first-child { font-weight: 750; }
.film-vocabulary-unknown td:first-child { color: #b91c1c; }
.film-vocabulary-nearest { background: #edf5fc; }

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .film-row-content { grid-template-columns: 1fr; }
  .film-original-title, .film-description { grid-column: auto; }
  .film-details { grid-template-columns: 1fr; }
  .film-details dt { padding-bottom: 0; border-bottom: 0; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.film-word-choices { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }
.film-word-choices label { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; }
.film-word-choices input { margin: 0; accent-color: #274c77; }
.film-vocabulary-table td:last-child { white-space: normal; min-width: 200px; }
.learning-membership { display: block; margin-top: 8px; font-size: .8rem; }
.learning-proceed { margin-top: 18px; }
.learning-history { display: inline-block; margin: 18px 0 0 16px; }
.learning-card-navigation { display: flex; justify-content: space-between; gap: 12px; }
#card-word, #card-content { overflow-wrap: anywhere; }
#card-level { margin: 8px 0 12px; padding: 10px; border: 1px solid #aab4be; border-radius: 8px; background: white; font: inherit; }
#card-content p, .film-example { white-space: pre-wrap; }
.film-example { margin: 12px 0 24px; padding: 12px 16px; border-left: 4px solid #8aa4bc; background: #f8fafc; }
.film-example mark { background: #fff1b8; }
.learning-picture { display: block; width: min(480px, 100%); height: auto; margin-top: 16px; border-radius: 10px; }
select:focus-visible { outline: 3px solid #f4a261; outline-offset: 3px; }
