:root { color-scheme: dark; --page-blue: #0826a8; --brand-accent: #59dcff; --text: #fff; --muted: #d1dcff; --line: #ffffff2b; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page-blue); color: var(--text); font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; line-height: 1.55; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; padding: .55rem 1rem; color: #fff; background: #ffffff08; border: 1px solid #ffffff38; border-radius: 9px; cursor: pointer; transition: border-color .15s, background .15s; }
button:hover:not(:disabled), button[aria-pressed="true"] { background: #ffffff16; border-color: #a6caff; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; }
input, textarea { width: 100%; min-width: 0; padding: .95rem 1rem; border: 1px solid #ffffff42; border-radius: 10px; color: #fff; background: #061c7b40; }
textarea { resize: vertical; min-height: 114px; }
input::placeholder, textarea::placeholder { color: #c5d3f5; opacity: 1; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-size: 1.4rem; font-weight: 620; letter-spacing: -.025em; margin-bottom: .85rem; }
h3 { font-size: 1.3rem; line-height: 1.3; margin-bottom: .35rem; font-weight: 650; }
p { margin-bottom: .75rem; }
.site-header, main, footer { width: min(100% - 4rem, 1180px); margin-inline: auto; }
.site-header { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; font-size: 1.15rem; letter-spacing: -.025em; font-weight: 600; }
.brand img { border-radius: 10px; }
.brand strong { color: var(--brand-accent); font-weight: inherit; }
.site-header nav { display: flex; gap: .5rem; }
.site-header nav a { padding: .65rem .85rem; text-decoration: none; border-radius: 8px; color: var(--muted); }
.site-header nav a[aria-current="page"] { color: #fff; background: #ffffff0e; }
main { padding: 1.2rem 0 3rem; }
.panel { background: #ffffff06; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 12px #00135a10; }
.translation-panel { padding: 1.6rem 1.8rem; margin-bottom: 2rem; }
.translation-heading { flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: .9rem; }
.translation-heading h1 { margin-bottom: 0; }
.translation-meta { margin: 0 0 0 auto; color: var(--muted); font-size: .78rem; text-align: right; }
.translation-panel .form-actions { justify-content: flex-end; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.quiet, .sidebar-note { font-size: .87rem; color: var(--muted); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; }
.form-actions p { margin: 0; }
.primary { padding-inline: 1.6rem; background: #ffffff15; border-color: #a2c5ff; font-weight: 600; }
.status { font-size: .9rem; margin: .65rem 0; color: var(--muted); }
.status:empty { display: none; }
.status[data-error="true"] { color: #ffe1d1; }
.dictionary-layout { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 2rem; align-items: start; }
aside { padding-top: .2rem; }
.view-navigation { display: grid; gap: .35rem; }
.view-navigation button { text-align: left; border-color: transparent; }
.view-navigation button[aria-pressed="true"] { border-color: var(--line); }
details { margin-top: 1.5rem; }
summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: .5rem .4rem; }
#alphabet { display: grid; grid-template-columns: repeat(4, 1fr); gap: .12rem; margin-top: .45rem; }
#alphabet button { padding: .25rem; min-height: 36px; border-color: transparent; font-size: .8rem; }
.sidebar-note { padding: .5rem; margin: 1.5rem 0 0; font-size: .8rem; line-height: 1.8; }
.results-column { min-width: 0; padding: 1.3rem 1.7rem; }
.dictionary-search { display: flex; align-items: stretch; gap: .6rem; }
.dictionary-search input { flex: 1; }
.search-note { margin: .55rem 0 1rem; }
.dictionary-entry { padding: 1.4rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.entry-heading { display: flex; align-items: baseline; gap: .65rem; position: relative; }
.entry-heading h3 { margin-right: .15rem; }
.term-group { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.term-text { min-width: 0; }
.language-indicator { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; width: 20px; height: 20px; align-self: flex-start; margin-top: .15em; border-radius: 50%; background: #101010; color: #e3ebff; font-size: .6rem; font-weight: 600; line-height: 1; object-fit: contain; }
.language-indicator--en { background: transparent; border-radius: 3px; }
.part-of-speech { color: var(--muted); font-size: .8rem; }
.entry-translation { font-size: 1.15rem; color: #b9ebff; font-weight: 500; margin-bottom: .45rem; }
.entry-note, .entry-meaning { font-size: .9rem; margin-bottom: .3rem; color: var(--muted); }
.raw-entry { white-space: pre-wrap; margin-bottom: 0; }
.dictionary-entry--raw { padding-block: 1rem; }
.dictionary-entry--raw h3 { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.raw-details { margin-top: .35rem; font-size: .85rem; color: var(--muted); }
.raw-details summary { display: list-item; min-height: 0; padding: .3rem 0; }
.review-indicator { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid #d1dcff80; border-radius: 50%; font-size: .75rem; color: var(--muted); flex: none; }
.review-indicator .review-help { display: none; position: absolute; top: 100%; left: 0; width: 205px; max-width: 100%; padding: .6rem .75rem; background: #06218e; border: 1px solid #a3b8ed; border-radius: 8px; font-size: .8rem; z-index: 2; box-shadow: 0 3px 8px #00135a30; }
.review-indicator:hover .review-help, .review-indicator:focus .review-help { display: block; }
.review-indicator[data-tooltip-dismissed="true"] .review-help { display: none; }
.load-more { display: flex; justify-content: center; margin-top: .9rem; }
.translation-card { border-top: 1px solid var(--line); padding: 1.3rem 0 .2rem; margin-top: 1rem; overflow-wrap: anywhere; }
.translation-card .section-heading { align-items: center; }
.translation-card h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 500; color: var(--muted); }
.source-output, .translated-output, .suggestion-output { white-space: pre-wrap; }
.translated-output { font-size: 1.15rem; }
.translation-arrow { color: var(--muted); margin-bottom: .45rem; }
.rating-question { margin: 1.3rem 0 .5rem; font-size: .87rem; color: var(--muted); }
.rating-controls { display: flex; flex-wrap: wrap; gap: .4rem; }
.rating-controls button { font-size: .85rem; padding-inline: .85rem; }
.rating-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: .85rem; font-size: .85rem; color: var(--muted); }
.rating-change { padding: .25rem .4rem; border-color: transparent; background: transparent; font-size: .8rem; text-decoration: underline; text-underline-offset: .2em; }
.feedback .status { font-size: .8rem; }
.suggestion-action { margin-top: .85rem; font-size: .85rem; }
.suggestion-form { margin-top: .85rem; }
.suggestion-form label { display: block; font-size: .85rem; margin-bottom: .4rem; }
.suggestion-form button { margin-top: .5rem; }
.saved-suggestion { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.history-date { color: var(--muted); font-size: .8rem; margin-bottom: .85rem; }
.copy-button { font-size: .8rem; }
.immediate-translation { padding-top: 1.2rem; }
.translation-label-row { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; }
.immediate-translation .translation-label { margin: 0; text-transform: none; letter-spacing: 0; font-size: .85rem; }
.saved-state { font-size: .75rem; color: var(--muted); }
.immediate-translation .translated-output { font-size: clamp(1.5rem, 2.3vw, 1.9rem); line-height: 1.5; margin: 1rem 0 1.3rem; }
.immediate-translation .copy-button { border-color: transparent; background: transparent; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 0 2rem; color: var(--muted); font-size: .78rem; }
.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; }
.skip-link { position: absolute; left: 1rem; top: -60px; padding: .6rem 1rem; background: #061d85; z-index: 3; }
.skip-link:focus { top: 1rem; }
@media (max-width: 900px) {
  .site-header, main, footer { width: min(100% - 2.5rem, 1180px); }
  .dictionary-layout { grid-template-columns: 140px minmax(0, 1fr); gap: 1.2rem; }
  .section-heading > .quiet { display: none; }
}
@media (max-width: 640px) {
  .site-header, main, footer { width: calc(100% - 1.5rem); }
  .site-header { min-height: 84px; flex-wrap: wrap; padding: .8rem 0; gap: .25rem; }
  .brand { font-size: .95rem; gap: .5rem; }
  .brand img { width: 34px; height: 34px; }
  .site-header nav a { font-size: .85rem; padding: .5rem .65rem; }
  main { padding-top: .5rem; }
  .translation-panel, .results-column { padding: 1.15rem; }
  .translation-panel { margin-bottom: 1rem; }
  .dictionary-layout { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  aside { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .4rem; }
  .view-navigation { display: flex; }
  details { margin: 0; max-width: 100%; }
  details[open] { flex-basis: 100%; }
  summary { min-height: 44px; padding: .6rem; }
  #alphabet { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  #alphabet button { min-height: 44px; }
  .sidebar-note { display: none; }
  .form-actions { align-items: flex-end; }
  .translation-heading { align-items: flex-start; }
  .translation-meta { flex-basis: 100%; font-size: .72rem; }
  .primary { padding-inline: 1.2rem; }
  .dictionary-search { gap: .4rem; }
  .dictionary-search input { padding-inline: .7rem; }
  .dictionary-search button { padding-inline: .7rem; }
  .rating-controls button { flex: 1 0 auto; min-height: 44px; }
  .entry-heading { flex-wrap: wrap; }
  footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
