@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #f7f8f2;
  --paper: #fff;
  --ink: #21352f;
  --muted: #69736b;
  --line: #e0e5db;
  --lime: #d6f35e;
  --lime-dark: #315017;
  --blue: #dcebf9;
  --purple: #e9e0fb;
  --orange: #ffe6cf;
  --green: #e0ecd4;
  --radius: 20px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 450 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-underline-offset: 4px; }
svg { width: 21px; height: 21px; flex-shrink: 0; vertical-align: middle; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .flashcard:focus-visible { outline: 3px solid #596bdb; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); }
::selection { color: var(--ink); background: var(--lime); }
.container { width: min(1184px, calc(100% - 80px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 200; top: 12px; left: 16px; padding: 12px 18px; border: 2px solid var(--ink); border-radius: 10px; background: var(--lime); color: var(--ink); font-weight: 700; text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Small, calm navigation keeps the learning activity at the center. */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 30px/1 var(--display); letter-spacing: -1.8px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--lime); color: var(--ink); border-radius: 50%; transform: rotate(-12deg); }
.brand-mark svg { width: 22px; height: 22px; }
.header-links { display: flex; align-items: center; gap: 26px; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; background: #fff8; padding: 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.text-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 12px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 15px; height: 15px; }
.profile-link .profile-icon { display: inline-flex; }
.profile-link .profile-icon svg { width: 17px; height: 17px; }
button.text-link { padding: 0; border: 0; background: transparent; }
.lang-switch { position: relative; display: inline-flex; align-items: center; min-height: 44px; }
.lang-icon { position: absolute; inset-inline-start: 10px; display: grid; pointer-events: none; color: var(--muted); }
.lang-icon svg { width: 16px; height: 16px; }
.lang-switch select { appearance: none; -webkit-appearance: none; min-height: 36px; padding: 6px 28px 6px 32px; padding-inline: 32px 28px; border: 1px solid var(--line); border-radius: 99px; background: #fff8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2321352f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 11px; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.lang-switch select:hover { background-color: #fff; }
[dir="rtl"] .lang-switch select { background-position: left 11px center; }
.portugal-dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(90deg,#458160 43%,#d06a55 43%); }

/* An airy, editorial introduction with playful vocabulary objects. */
.hero { display: grid; grid-template-columns: 1.07fr 1fr; align-items: center; gap: 60px; padding: 66px 0 58px; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #7a9d2b; }
.hero-title { margin: 0 0 20px; font-size: clamp(46px, 5.3vw, 69px); font-weight: 600; letter-spacing: -.065em; line-height: 1.04; }
.hero-title em, .hero-title strong, .hero-title .accent { position: relative; display: inline-block; font-style: normal; font-weight: inherit; z-index: 0; }
.hero-title em::after, .hero-title strong::after, .hero-title .accent::after { content: ''; position: absolute; z-index: -1; height: .25em; inset: auto -.025em .06em; background: var(--lime); transform: rotate(-1deg); }
.hero-description { max-width: 410px; margin-bottom: 25px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.hero-caption { margin: 15px 0 0; font-size: 10px; color: var(--muted); letter-spacing: .015em; }
.hero-caption .caption-arrow { padding-inline: 4px; }
.tiny-spark { font-size: 15px; line-height: 1; color: #758f32; }
.eyebrow:has(.tiny-spark)::before { display: none; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 46px; padding: 12px 20px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; font-size: 13px; text-decoration: none; transition: background .18s, transform .18s, box-shadow .18s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #365342; box-shadow: 0 5px 16px #21352f15; }
.btn-secondary { background: var(--lime); color: var(--ink); }
.btn-secondary:hover { background: #c8e64d; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: #fff; }
.btn svg { width: 17px; height: 17px; }
.hero-art { position: relative; height: 315px; min-width: 0; isolation: isolate; }
.hero-grid { position: absolute; inset: 14px 0; background-image: radial-gradient(#b6c2b3 1px, transparent 1px); background-size: 20px 20px; mask-image: radial-gradient(ellipse, #000 15%, transparent 73%); opacity: .8; z-index: -3; }
.orbit { position: absolute; width: 260px; height: 260px; border: 1px dashed #a9b8a0; border-radius: 50%; left: 50%; top: 48%; transform: translate(-50%, -50%) rotate(-25deg); z-index: -2; }
.orbit::after { content: ''; position: absolute; width: 170px; height: 170px; background: var(--lime); opacity: .4; filter: blur(12px); border-radius: 50%; left: 43px; top: 43px; }
.floating-word { position: absolute; width: 232px; padding: 19px 22px; border: 1px solid #21352f12; border-radius: 15px; box-shadow: 0 9px 0 -5px #21352f08, 0 15px 38px #21352f0d; background: white; }
.floating-word .word-label { display: block; margin-bottom: 12px; font: 700 8px/1.3 var(--font); letter-spacing: .065em; color: #52655d; }
.floating-word > strong { display: block; font: 600 25px/1.2 var(--display); letter-spacing: -.045em; }
.floating-word .word-translation { display: block; margin-top: 7px; font-size: 12px; color: #556451; }
.floating-word svg { width: 24px; height: 24px; margin-bottom: 10px; }
.word-a { left: 2%; top: 22px; transform: rotate(-9deg); background: var(--blue); z-index: 2; }
.word-b { right: 0; top: 114px; transform: rotate(7deg); background: var(--purple); z-index: 3; }
.word-c { left: 9%; bottom: 0; transform: rotate(-4deg); background: var(--orange); z-index: 4; }
.hero-sticker { position: absolute; right: 26px; top: 8px; display: grid; place-items: center; width: 77px; height: 77px; padding: 12px; background: var(--lime); color: var(--ink); border-radius: 50%; transform: rotate(14deg); font: 700 15px/1.15 var(--display); text-align: center; z-index: 4; }
.hero-sticker small { display: block; font: 700 7px/1.15 var(--font); letter-spacing: .04em; }
.art-plus, .art-swoosh { position: absolute; right: 12px; bottom: 10px; font: 400 29px/1 var(--display); opacity: .2; }
.art-swoosh { font-size: 39px; }

/* Progress is visible without turning the interface into a scoreboard. */
.overview { position: relative; margin-bottom: 28px; padding: 21px 25px; border: 1px solid var(--line); border-radius: 15px; background: #fff9; }
.progress-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.progress-heading h2 { margin: 0; font-family: var(--font); font-size: 13px; font-weight: 700; }
.progress-heading .eyebrow { margin: 0; font-size: 10px; }
.progress-heading .eyebrow::before { display: none; }
.progress-heading .progress-note { margin-top: 3px; }
.progress-numbers { color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.progress-numbers strong { color: var(--ink); font-weight: 700; }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e9ede3; }
.progress-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: #abc43f; transition: width .3s ease; }
.progress-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

/* Four subjects, clearly differentiated by color and pictogram. */
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 30px 0 14px; }
.section-heading h2 { font-size: 23px; letter-spacing: -.045em; font-weight: 600; margin: 0; }
.section-heading .text-link { flex-shrink: 0; font-size: 11px; }
.section-heading .text-link[aria-pressed='true'] { color: #5b762b; }
.topic-grid { display: grid; grid-template-columns: repeat(var(--topic-columns, 4), minmax(0,1fr)); gap: 12px; margin: 0 0 43px; }
.topic-grid[data-count='1'] { grid-template-columns: minmax(0,1fr) !important; }
.topic-card { position: relative; display: flex; align-items: center; text-align: start; gap: 12px; min-width: 0; min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: transparent; transition: background .18s, border-color .18s, transform .18s; }
.topic-card:hover { transform: translateY(-2px); background: #fff; }
.topic-card.active { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 1px var(--ink); }
.topic-icon { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green); }
[data-tone='blue'] { --topic-color: var(--blue); --topic-ink: #42678d; }
[data-tone='purple'] { --topic-color: var(--purple); --topic-ink: #7a51a5; }
[data-tone='green'] { --topic-color: var(--green); --topic-ink: #4d7244; }
[data-tone='orange'] { --topic-color: var(--orange); --topic-ink: #a35d27; }
.topic-card .topic-icon { background: var(--topic-color, var(--green)); color: var(--topic-ink, var(--ink)); }
.topic-copy { min-width: 0; flex: 1; }
.topic-title { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; }
.topic-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.topic-arrow { font-size: 14px; color: #8d9889; align-self: flex-start; margin-inline-start: -5px; }
.topic-count { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.topic-progress { display: block; height: 3px; border-radius: 3px; background: #dce3d8; margin-top: 7px; overflow: hidden; }
.topic-progress span { display: block; height: 100%; background: var(--topic-ink, #6f8940); }

/* Workspace controls stay compact while preserving comfortable targets. */
.workspace { padding-bottom: 54px; scroll-margin-top: 24px; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.workspace-header h2 { font-size: 25px; letter-spacing: -.04em; font-weight: 600; margin: 0; }
.workspace-context { color: var(--muted); font-size: 11px; }
.mode-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #e9ede3; border-radius: 12px; }
.mode-tab { min-height: 40px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.mode-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 5px #21352f09; }
.mode-tab svg { width: 17px; height: 17px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-wrap { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 190px; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.search-wrap > svg { width: 17px; height: 17px; color: var(--muted); }
.search-icon svg { width: 17px; height: 17px; color: var(--muted); }
.search-wrap:focus-within { outline: 2px solid #98a75c; outline-offset: 2px; }
.search-input { width: 100%; min-width: 0; min-height: 44px; border: 0; outline: none !important; box-shadow: none; background: transparent; color: var(--ink); font-size: 12px; }
.search-input::placeholder { color: #8b9388; }
.select-wrap { display: flex; align-items: center; gap: 6px; }
.filter-select { min-height: 46px; max-width: 100%; padding: 8px 28px 8px 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--ink); font-size: 12px; }
.result-count { margin: 0 0 14px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.toolbar .btn { min-height: 46px; padding: 10px 14px; font-size: 12px; }

/* Vocabulary cards read like small dictionary entries, not flashcards. */
.word-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.word-card { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: stretch; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: border-color .2s; }
.word-card:hover { border-color: #b4c0ac; }
.word-number { color: #9ba395; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.word-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.word-card > .word-number { position: absolute; right: 22px; top: 22px; }
.topic-badge { display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; max-width: calc(100% - 32px); padding: 4px 8px; border-radius: 5px; color: var(--topic-ink, #5e6c51); background: var(--topic-color, #e9eedf); font-size: 9px; font-weight: 700; letter-spacing: .035em; line-height: 1.4; text-transform: uppercase; }
.topic-badge svg { width: 12px; height: 12px; }
.word-pair { margin: 18px 0 14px; }
.word-de { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 4px; }
.word-pt + .word-de { margin: 5px 0 0; }
.word-pt { display: block; margin: 0; font-family: var(--display); font-size: clamp(20px, 2vw, 25px); font-weight: 600; letter-spacing: -.04em; line-height: 1.25; overflow-wrap: anywhere; }
.example { margin: 0 0 4px; font-size: 12px; line-height: 1.6; }
.example-translation { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0 0 4px; }
.word-card details { margin-top: 5px; font-size: 11px; color: var(--muted); }
.word-card summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; font-weight: 600; list-style: none; }
.word-card summary::-webkit-details-marker { display: none; }
.word-card details[open] summary { margin-bottom: 2px; }
.word-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 15px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: background .18s; }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 18px; height: 18px; }
.known-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 600; }
.known-btn svg { width: 14px; height: 14px; }
.known-btn:hover { background: #f5f8ef; }
.known-btn.is-known { background: #ebf3d9; color: #4c6a24; border-color: #d7e5ba; }
.empty-state { grid-column: 1 / -1; padding: 60px 24px; text-align: center; border: 1px dashed #c5cfbe; border-radius: 18px; background: #fff6; }
.empty-state h3 { font-size: 23px; letter-spacing: -.04em; }
.empty-state p { color: var(--muted); max-width: 420px; margin-inline: auto; }

/* Focused retrieval practice; the response always has enough room to wrap. */
.practice { max-width: 760px; margin: 0 auto; }
.practice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }
.direction-btn { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 600; }
.direction-btn svg { width: 16px; height: 16px; }
.round-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.flashcard { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; padding: 62px 42px 35px; border: 1px solid #ccd6c4; border-radius: 23px; background: #fff; box-shadow: 0 6px 0 -1px #e7ecdf, 0 7px 0 #ccd6c4; text-align: center; overflow: hidden; }
.flashcard::before { content: ''; position: absolute; width: 240px; height: 240px; border: 1px solid #ecf0e5; border-radius: 50%; top: -170px; right: -50px; pointer-events: none; }
.card-meta { position: absolute; top: 23px; left: 25px; right: 25px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-language { margin: 0 0 14px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.card-prompt { margin: 0 0 20px; font-family: var(--display); font-size: clamp(28px, 3.6vw, 40px); line-height: 1.2; font-weight: 600; letter-spacing: -.05em; overflow-wrap: anywhere; }
.card-front, .card-back { width: 100%; }
.card-meta .card-language { margin: 0; font-size: 9px; }
.card-answer { width: 100%; margin: 5px 0 14px; padding-top: 23px; border-top: 1px solid var(--line); font: 600 clamp(27px, 3.4vw, 37px)/1.2 var(--display); letter-spacing: -.045em; overflow-wrap: anywhere; }
.card-answer h3, .card-answer .word-pt { margin: 0 0 14px; font-size: clamp(27px, 3.4vw, 37px); letter-spacing: -.045em; }
.card-example { margin: 5px 0; font-size: 14px; line-height: 1.65; }
.card-example p { margin: 5px 0; }
.card-speak { margin-top: 12px; }
.card-example .example-translation, .card-answer .example-translation { display: block; font-size: 12px; }
.card-hint { color: var(--muted); font-size: 12px; margin: 2px 0 20px; }
.reveal-btn { margin-top: 8px; min-width: 180px; background: var(--lime); color: var(--ink); }
.practice-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 25px 0 12px; flex-wrap: wrap; }
.practice-actions .btn { min-width: 155px; }
.keyboard-hint { text-align: center; margin: 17px 0 0; color: #8a9383; font-size: 10px; }
kbd { display: inline-block; padding: 1px 5px; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: inherit; }
.session-summary { text-align: center; border: 1px solid var(--line); border-radius: 23px; background: #fff; padding: 48px 28px; }
.session-summary h3 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.05em; margin-bottom: 10px; }
.session-summary p { color: var(--muted); }
.summary-symbol { display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 24px; border-radius: 50%; background: var(--lime); color: var(--ink); font: 600 47px/1 var(--display); }
.session-summary .summary-score { margin: 0 auto 12px; max-width: 430px; color: var(--ink); font: 600 18px/1.5 var(--font); }
.session-summary .hero-actions { justify-content: center; }
.session-summary .eyebrow { margin-bottom: 14px; }
.session-summary .eyebrow::before { display: none; }
.session-summary .btn { margin-top: 10px; }

.learning-tip { display: flex; align-items: center; gap: 17px; margin: 0 0 40px; padding: 21px 24px; background: #e9eedf; border-radius: 14px; }
.learning-tip > span { font-size: 36px; color: #748a39; line-height: 1; }
.learning-tip strong { font-size: 13px; font-weight: 700; }
.learning-tip p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.app-footer { padding: 24px 0 30px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 11px; }
.footer-inner p { margin: 0; }
.footer-inner a, .footer-inner button { color: var(--muted); font-size: 11px; }
.footer-inner .brand { color: var(--ink); font-size: 25px; flex-shrink: 0; }
.footer-inner .brand-mark { width: 28px; height: 28px; }
.footer-inner button { border: 0; background: transparent; padding: 10px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.footer-inner > div { display: flex; align-items: center; gap: 20px; }
.source-note { margin-top: 14px; font-size: 10px; color: var(--muted); line-height: 1.7; }
.source-note summary { display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; font-weight: 600; }
.source-note summary::before { content: '+'; margin-inline-end: 8px; font-size: 14px; }
.source-note[open] summary::before { content: '−'; }
.source-note summary::-webkit-details-marker { display: none; }
.source-note p { max-width: 850px; margin: 4px 0 8px; }
.noscript-message { margin: 30px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: min(450px,calc(100% - 32px)); padding: 13px 20px; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: 0 8px 28px #21352f22; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
dialog { width: min(480px,calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 100px #0003; }
dialog::backdrop { background: #21352f55; backdrop-filter: blur(4px); }
.dialog-body { padding: 30px 28px 24px; }
.dialog-body h2 { font-size: 25px; line-height: 1.2; letter-spacing: -.045em; }
.dialog-body p { color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

@media (min-width: 1400px) {
  .hero { padding-top: 80px; padding-bottom: 68px; }
  .hero-art { margin-inline: 22px; }
}
@media (max-width: 1050px) {
  .container { width: min(100% - 48px, 1184px); }
  .hero { gap: 28px; }
  .hero-title { font-size: 56px; }
  .floating-word { width: 210px; }
  .word-a { left: 0; }
  .word-b { right: 0; }
  .topic-card { padding: 13px 11px; gap: 9px; }
  .topic-icon { flex-basis: 35px; width: 35px; height: 35px; border-radius: 10px; }
  .topic-title { font-size: 12px; }
  .topic-subtitle { display: none; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 36px); }
  .header-inner { min-height: 73px; gap: 12px; }
  .brand { font-size: 27px; }
  .brand-mark { width: 30px; height: 30px; }
  .header-links { gap: 14px; }
  .header-links .text-link { font-size: 11px; gap: 5px; }
  .header-links .text-link svg { width: 20px; height: 20px; }
  .hero { grid-template-columns: 1fr 1fr; gap: 15px; padding: 43px 0 38px; }
  .hero-title { font-size: 43px; }
  .hero-description { font-size: 13px; }
  .hero-art { height: 265px; }
  .floating-word { width: 170px; padding: 15px 16px; }
  .floating-word > strong { font-size: 22px; }
  .floating-word .word-label { font-size: 7px; margin-bottom: 9px; }
  .floating-word .word-translation { font-size: 11px; }
  .floating-word svg { width: 20px; height: 20px; margin-bottom: 7px; }
  .word-a { top: 14px; }
  .word-b { top: 104px; }
  .word-c { bottom: 0; left: 0; }
  .hero-sticker { right: 0; top: 0; width: 60px; height: 60px; font-size: 12px; }
  .orbit { width: 210px; height: 210px; }
  .overview { margin-bottom: 18px; padding: 18px; }
  .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 32px; }
  .topic-card { padding: 15px; min-height: 82px; gap: 12px; }
  .topic-icon { flex-basis: 40px; width: 40px; height: 40px; }
  .topic-title { font-size: 13px; }
  .topic-subtitle { display: block; font-size: 9px; }
  .workspace-header { gap: 12px; }
  .workspace-header h2 { font-size: 23px; }
  .mode-tab { padding: 8px 12px; }
  .word-list { gap: 10px; }
  .word-card { padding: 17px; }
  .word-card > .word-number { top: 17px; right: 17px; }
  .word-pt { font-size: 22px; }
  .word-actions { gap: 6px; }
  .known-btn { padding: 8px; font-size: 10px; }
  .footer-inner { align-items: flex-start; }
}
@media (max-width: 560px) {
  .container { width: calc(100% - 32px); }
  .header-links .pill { display: none; }
  .profile-link .profile-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lang-switch select { font-size: 11px; padding-inline: 30px 24px; }
  .header-links .pdf-link { font-size: 11px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 34px; padding-bottom: 28px; }
  .hero-title { font-size: clamp(43px, 11vw, 58px); }
  .eyebrow { margin-bottom: 15px; font-size: 10px; }
  .hero-description { font-size: 14px; max-width: 330px; margin-bottom: 20px; }
  .hero-actions { gap: 9px; }
  .hero-actions .btn { padding: 11px 15px; }
  .hero-art { height: 176px; max-width: 400px; width: 100%; margin: 0 auto; }
  .hero-grid { inset: -8px 0; }
  .orbit { width: 160px; height: 160px; left: 48%; }
  .orbit::after { width: 105px; height: 105px; left: 26px; top: 26px; }
  .floating-word { width: 157px; padding: 12px 13px; border-radius: 12px; }
  .floating-word svg { display: none; }
  .floating-word > strong { font-size: 21px; }
  .floating-word .word-label { font-size: 6.5px; margin-bottom: 7px; }
  .floating-word .word-translation { margin-top: 5px; font-size: 10px; }
  .word-a { left: 3%; top: 7px; }
  .word-b { right: 2%; top: 60px; }
  .word-c { left: 10%; bottom: 0; }
  .hero-sticker { right: 13%; top: -8px; width: 55px; height: 55px; font-size: 11px; }
  .hero-sticker small { font-size: 5.5px; }
  .overview { padding: 16px; }
  .progress-heading h2 { font-size: 12px; }
  .progress-numbers { font-size: 11px; }
  .topic-card { padding: 12px; gap: 9px; min-height: 80px; }
  .topic-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .topic-icon svg { width: 19px; height: 19px; }
  .topic-title { font-size: 12px; }
  .topic-subtitle { display: none; }
  .topic-arrow { display: none; }
  .topic-count { font-size: 10px; }
  .section-heading h2 { font-size: 20px; }
  .section-heading .text-link { font-size: 10px; }
  .workspace-header { flex-direction: column; align-items: flex-start; margin-bottom: 17px; }
  .mode-tabs { width: 100%; }
  .mode-tab { flex: 1; font-size: 12px; min-height: 42px; }
  .toolbar { gap: 8px; }
  .search-wrap { flex: 1 0 100%; }
  .filter-select { min-height: 44px; font-size: 11px; }
  .toolbar .btn { min-height: 44px; padding-inline: 12px; font-size: 11px; }
  .result-count { margin-inline-start: auto; font-size: 10px; }
  .word-list { grid-template-columns: 1fr; gap: 12px; }
  .word-card { padding: 20px; }
  .word-card > .word-number { top: 20px; right: 20px; }
  .word-pt { font-size: 26px; }
  .word-de { font-size: 12px; }
  .word-pair { margin-top: 17px; }
  .example { font-size: 13px; }
  .example-translation { font-size: 12px; }
  .known-btn { padding: 10px 12px; font-size: 11px; min-height: 44px; }
  .practice-toolbar { gap: 8px; }
  .direction-btn { padding: 8px 9px; font-size: 11px; }
  .round-count { font-size: 11px; }
  .flashcard { min-height: 335px; padding: 65px 22px 30px; border-radius: 19px; }
  .card-meta { top: 21px; left: 20px; right: 20px; }
  .card-prompt { font-size: 30px; }
  .card-answer h3, .card-answer .word-pt { font-size: 30px; }
  .card-answer { font-size: 30px; }
  .card-example { font-size: 13px; }
  .practice-actions { gap: 9px; }
  .practice-actions .btn { flex: 1; min-width: 0; padding: 12px 10px; font-size: 12px; }
  .keyboard-hint { display: none; }
  .footer-inner { flex-direction: column; gap: 8px; font-size: 10px; }
  .footer-inner > div { gap: 18px; flex-wrap: wrap; }
  .footer-inner .brand { font-size: 25px; }
  .learning-tip { padding: 18px; gap: 13px; margin-bottom: 28px; }
  .learning-tip p { font-size: 11px; }
  .learning-tip strong { font-size: 12px; }
  .learning-tip > span { font-size: 29px; }
  .app-footer { padding-top: 20px; }
}
/* Keep the decorative vocabulary readable on narrow screens. */
@media (max-width: 1050px) {
  .hero-art { height: 270px; }
  .floating-word { width: 205px; padding: 17px; }
  .floating-word > strong { font-size: 20px; }
  .word-a { top: 12px; left: 0; }
  .word-b { top: 150px; right: 0; }
  .word-c { display: none; }
}
@media (max-width: 900px) {
  .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .hero-art { height: 218px; }
  .floating-word { width: 220px; padding: 14px 16px; }
  .word-a { top: 8px; left: 4px; }
  .word-b { top: 119px; right: 4px; }
  .hero-sticker { top: 3px; right: 3px; }
  .search-input, .filter-select { font-size: 16px; }
  .word-de { font-size: 14px; }
}
.known-btn { min-height: 44px; }
/* Hebrew: right-to-left layout with a Hebrew-capable fallback font; Portuguese stays left-to-right. */
[dir="rtl"] body { --font: 'DM Sans', 'Segoe UI', Arial, 'Noto Sans Hebrew', sans-serif; --display: 'Space Grotesk', 'Segoe UI', Arial, 'Noto Sans Hebrew', sans-serif; }
[dir="rtl"] .hero-title, [dir="rtl"] .eyebrow, [dir="rtl"] .word-label { letter-spacing: 0; }
[dir="rtl"] [lang="pt-PT"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .word-card { text-align: right; }
[dir="rtl"] .hero-art { direction: ltr; }
[dir="rtl"] .hero-art .word-translation, [dir="rtl"] .hero-art .word-label, [dir="rtl"] .hero-sticker small { direction: rtl; unicode-bidi: isolate; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  body { background: white; color: #111; }
  .site-header, .hero-art, .hero-actions, .overview, .topic-grid, .mode-tabs, .toolbar, .word-actions, .app-footer, .toast { display: none !important; }
  .container { width: 100%; }
  .hero { display: block; padding: 0 0 20px; }
  .hero-title { font-size: 30px; }
  .word-list { grid-template-columns: 1fr 1fr; }
  .word-card { break-inside: avoid; padding: 15px; }
  .word-pt { font-size: 19px; }
}
