:root {
  color-scheme: dark;
  --ground: #16151c;
  --rail: #24212e;
  --panel: #302c3b;
  --input: #1d1a25;
  --ink: #f4f0fa;
  --muted: #c0b6cf;
  --accent: #d4b7ff;
  --selected: #503e6c;
  --focus: #e2caff;
  font: 15px/1.5 "Inter", "Noto Sans", system-ui, sans-serif;
  background: var(--ground);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { color: var(--ink); border: 0; border-radius: 8px; padding: 10px 16px; background: #494151; font-weight: 600; transition: background 160ms ease, box-shadow 160ms ease; }
button:hover { background: #5b5068; }
button:active { background: #6b5b7e; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: #291b3b; }
button.primary:hover:enabled { background: #e3d0ff; }
button.quiet { background: transparent; color: var(--muted); }
button.quiet:hover { background: #ffffff0d; color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: #775997; color: #fff; }
input, select, textarea { background: var(--input); border: 1px solid #62556f; border-radius: 8px; padding: 10px 12px; caret-color: var(--accent); }
input::placeholder { color: var(--muted); }
textarea { resize: vertical; width: 100%; min-height: 108px; line-height: 1.6; }
textarea:focus { border-color: var(--accent); }
h1, h2, p { margin: 0; }
h2, label { font-weight: 600; }
h2 { font-size: 15px; }
.app-header { min-height: 80px; padding: 16px 28px; background: #352943; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1 { font-size: 20px; letter-spacing: -.025em; font-weight: 750; }
h1 span { color: #d9cce7; font-weight: 450; margin-left: 5px; }
.header-actions, .header-actions label { display: flex; align-items: center; gap: 16px; }
.header-actions label { font-size: 13px; color: #e1d4ed; gap: 12px; }
.header-actions select { min-width: 155px; font-size: 14px; }
main { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 80px); }
.strings { background: var(--rail); display: flex; flex-direction: column; min-width: 0; padding: 24px 12px 16px; height: calc(100vh - 80px); position: sticky; top: 0; }
.list-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 12px; }
#progress { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.search-label { display: block; padding: 16px 12px; }
#search { width: 100%; font-size: 13px; }
#texts { overflow-y: auto; flex: 1; min-height: 150px; scrollbar-width: thin; scrollbar-color: #6b5d7b transparent; }
.text-row { display: block; width: 100%; text-align: left; padding: 12px; margin-bottom: 4px; background: transparent; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.text-row span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-row small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-row:hover { background: #393242; }
.text-row[aria-pressed="true"] { background: var(--selected); color: #fff; }
.text-row[aria-pressed="true"] small { color: #e1d3f2; }
.text-row small.reviewed { color: #afdcbe; }
.coverage { margin: 16px 12px 0; font-size: 12px; color: var(--muted); overflow-y: auto; max-height: 30vh; }
summary { cursor: pointer; font-weight: 500; }
details p { margin-top: 12px; }
.coverage ul { padding-left: 18px; }
.workspace { min-width: 0; max-width: 1240px; width: 100%; padding: 24px 32px 0; margin-inline: auto; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.preview-toolbar label { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.preview-toolbar select { background: #302b39; border-color: transparent; max-width: 100%; }
.preview-stage { min-height: 300px; display: flex; align-items: center; justify-content: center; padding: 28px; background: #201c29; border-radius: 14px; }
#picture { position: relative; width: 620px; max-width: 100%; line-height: 0; filter: drop-shadow(0 12px 18px #00000030); }
#preview { width: 100%; display: block; border-radius: 10px; }
#picture[aria-busy="true"] { opacity: .65; }
#picture { transition: opacity 160ms ease; }
#regions { position: absolute; inset: 0; }
.region { position: absolute; padding: 0; border-radius: 4px; background: transparent; border: 2px solid transparent; }
.region:hover { background: #d4b7ff20; border-color: #d4b7ff99; }
.region.selected { border-color: var(--accent); background: #d4b7ff18; }
.region.clipped { border-color: #ff8a9a; background: #ff8a9a22; }
.region.clipped.selected { box-shadow: 0 0 0 2px var(--accent); }
.preview-stage.actual-size { overflow: auto; max-height: 72vh; justify-content: flex-start; align-items: flex-start; }
.preview-stage.actual-size #picture { max-width: none; flex-shrink: 0; margin: auto; }
#zoom { font-size: 12px; padding: 6px 12px; }
#zoom[aria-pressed="true"] { background: var(--selected); color: var(--ink); }
.preview-caption { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0 20px; font-size: 12px; color: var(--muted); }
#render-status { font-size: 11px; }
#fit:not(:empty), #error:not(:empty) { background: #50313b; color: #ffced4; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; white-space: pre-line; }
.editor-pane { background: var(--panel); border-radius: 14px; padding: 24px; }
.editor-fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; }
.source h2 { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
#english { font-size: 20px; font-weight: 550; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-details { margin-top: 16px; font-size: 12px; color: var(--muted); }
#context { white-space: pre-wrap; overflow-wrap: anywhere; }
.target label { display: block; margin-bottom: 10px; font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; }
#fields { margin-top: 8px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
#reset { margin-right: auto; }
#review span { margin-left: 12px; }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0; font-size: 12px; color: var(--muted); }
footer button { font-size: 12px; padding: 8px 12px; white-space: nowrap; }
#empty { padding: 16px 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 1600px) {
  .workspace { padding-top: 36px; }
  .preview-stage { padding: 40px; }
}
@media (max-width: 1100px) {
  main { grid-template-columns: 240px minmax(0, 1fr); }
  .workspace { padding: 24px 24px 0; }
  .preview-stage { padding: 20px; }
  .editor-fields { gap: 24px; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); }
  .app-header { padding-inline: 24px; }
}
@media (max-width: 760px) {
  .app-header { padding: 16px; flex-wrap: wrap; gap: 16px; }
  .header-actions { width: 100%; justify-content: space-between; gap: 12px; }
  .header-actions label { font-size: 0; gap: 0; }
  main { display: block; }
  .strings { position: static; height: auto; padding: 20px 12px 12px; }
  #texts { display: flex; gap: 8px; overflow-x: auto; min-height: 0; max-height: 140px; }
  .text-row { flex: 0 0 190px; margin: 0; }
  .coverage { max-height: 160px; margin-top: 12px; }
  .search-label { padding-block: 12px; }
  .workspace { padding: 20px 16px 0; }
  .preview-toolbar label { gap: 8px; min-width: 0; }
  .preview-toolbar select { min-width: 0; width: 100%; }
  .preview-toolbar button { padding-inline: 8px; }
  .preview-stage { min-height: 180px; padding: 12px; }
  .editor-pane { padding: 20px; }
  .editor-fields { grid-template-columns: 1fr; gap: 24px; }
  .editor-actions { flex-wrap: wrap; }
  footer { align-items: baseline; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

#breadcrumb:empty { display: none; }
#breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; }
#breadcrumb a { color: #e1d4ed; text-decoration: none; text-underline-offset: 4px; }
#breadcrumb a:hover { text-decoration: underline; }
#breadcrumb > * + *::before { content: '/'; color: #bca8cc; margin-right: 10px; }
#breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }
.overview { max-width: 1100px; margin: 0 auto; padding: 48px 32px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.overview h2 { font-size: 28px; letter-spacing: -.025em; }
.overview-heading p { color: var(--muted); margin-top: 8px; }
.overview-heading h2:focus { outline: none; }
.overview-heading input { width: 240px; }
#overview-status:empty { display: none; }
#overview-status { padding: 16px 0; color: var(--muted); }
.language-columns, .language-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, .85fr) 155px; align-items: center; gap: 32px; padding: 20px 24px; }
.language-columns { color: var(--muted); font-size: 12px; padding-block: 0; margin-bottom: 12px; }
.language-columns > :last-child { text-align: right; }
.language-row { color: var(--ink); text-decoration: none; background: var(--rail); border-radius: 10px; margin-bottom: 8px; min-height: 90px; transition: background 160ms ease; }
.language-row:hover { background: #393242; }
.language-row strong { display: block; font-size: 16px; }
.language-row strong + span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.language-progress { display: flex; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
.language-progress > span { min-width: 88px; font-size: 13px; text-align: right; font-weight: 600; }
progress { width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; background: #4c4259; accent-color: #9ad3ae; }
progress::-webkit-progress-bar { background: #4c4259; border-radius: 4px; }
progress::-webkit-progress-value { background: #9ad3ae; border-radius: 4px; }
progress::-moz-progress-bar { background: #9ad3ae; border-radius: 4px; }
.remaining { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.remaining small { display: block; color: var(--accent); margin-top: 4px; }
.overview-note { color: var(--muted); font-size: 13px; margin-top: 24px; max-width: 70ch; }
#language-empty { padding: 24px; background: var(--rail); border-radius: 10px; }
.language-summary { display: flex; align-items: center; gap: 24px; margin-bottom: 48px; color: var(--muted); }
#language-meter { width: 240px; }
.overview h3 { font-size: 16px; margin: 0 0 16px; }
.area-list { display: grid; gap: 12px; }
.area-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px; background: var(--panel); border-radius: 12px; text-decoration: none; color: var(--ink); }
.area-row:hover { background: #40364e; }
.area-row strong { font-size: 18px; }
.area-row p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.area-progress { display: flex; align-items: center; gap: 24px; font-size: 13px; color: var(--muted); }
.open-label { background: #ffffff14; color: var(--ink); border-radius: 8px; padding: 10px 16px; font-weight: 600; white-space: nowrap; }
.area-row:hover .open-label, .area-row:focus-visible .open-label { background: var(--accent); color: #291b3b; }
@media (max-width: 760px) {
  .app-header .header-actions { width: auto; }
  .overview { padding: 28px 16px; }
  .overview-heading { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 24px; }
  .overview-heading label, .overview-heading input { width: 100%; }
  .language-columns { display: none; }
  .language-row { grid-template-columns: minmax(0, 1fr) 120px; gap: 12px 20px; padding: 20px; }
  .language-row > div:first-child { grid-column: 1 / -1; }
  .language-progress { gap: 10px; }
  .remaining { font-size: 12px; }
  .language-summary { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 32px; }
  .area-row, .area-progress { align-items: flex-start; flex-direction: column; gap: 20px; }
  .area-progress { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; font-size: 12px; gap: 12px; }
  .overview h2 { font-size: 24px; }
}
.completion-meter { display: flex; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; background: #55535c; }
.completion-meter .human { background: #92d2a8; }
.completion-meter .machine { background: #84b7ef; }
.completion-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.completion-legend span { display: flex; align-items: center; gap: 8px; }
.completion-legend span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: #77747d; }
.completion-legend .machine::before { background: #84b7ef; }
.completion-legend .human::before { background: #92d2a8; }
.language-summary { margin-bottom: 16px; }
.language-progress > span { color: #b4dfc3; }
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.brand { color: var(--ink); text-decoration: none; border-radius: 4px; }
.brand:hover { color: #e2caff; }
.mode-link { color: #e1d4ed; font-size: 13px; display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; background: #44364f; }
.mode-link:hover { background: #554260; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mode-options > section { padding: 28px; background: var(--panel); border-radius: 14px; }
.mode-options h3 { font-size: 20px; }
.mode-options p { color: var(--muted); margin-bottom: 24px; max-width: 55ch; }
.mode-options .muted { margin: 16px 0 0; }
.button-link { display: inline-block; background: var(--accent); color: #291b3b; text-decoration: none; border-radius: 8px; padding: 10px 16px; font-weight: 600; }
.button-link:hover { background: #e3d0ff; }
.button-link.secondary { background: #494151; color: var(--ink); }
.button-link.secondary:hover { background: #5b5068; }
.overview-heading p a { color: var(--ink); text-underline-offset: 3px; }
.admin-import { margin: 24px 0 32px; padding: 24px; background: var(--rail); border-radius: 12px; }
.admin-import p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.admin-import label { display: block; margin-bottom: 16px; font-size: 13px; }
.admin-import input { display: block; max-width: 100%; margin-top: 6px; }
.editor-actions { flex-wrap: wrap; }
@media (max-width: 760px) { .mode-options { grid-template-columns: 1fr; } .header-actions { flex-wrap: wrap; } }
.account-menu { position: relative; font-size: 14px; }
.account-menu > summary { list-style: none; padding: 10px 16px; border-radius: 8px; background: #494151; font-weight: 600; }
.account-menu > summary:hover { background: #5b5068; }
.account-menu nav { position: absolute; z-index: 5; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 8px; background: var(--panel); border-radius: 12px; box-shadow: 0 12px 24px #0005; }
.account-menu nav a, .account-menu nav button { display: block; text-align: left; width: 100%; padding: 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; background: transparent; font-weight: 500; }
.account-menu nav a:hover, .account-menu nav button:hover { background: #494151; }
.account-view { max-width: 760px; }
#account-form { background: var(--panel); padding: 28px; border-radius: 14px; }
#account-form > label { display: block; margin-bottom: 8px; }
#account-form > textarea, #account-form > select { margin-bottom: 24px; }
#account-form fieldset { border: 0; padding: 0; margin: 0 0 24px; }
#account-form legend { margin-bottom: 12px; font-weight: 600; }
.language-choices { display: grid; gap: 12px; }
.language-picker { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.language-picker input { width: 100%; min-width: 0; }
#native-language { margin-bottom: 24px; }
.language-options { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 8px); max-height: 260px; overflow-y: auto; background: var(--input); padding: 6px; border-radius: 10px; box-shadow: 0 12px 24px #0005; scrollbar-width: thin; scrollbar-color: #6b5d7b transparent; }
.language-option { padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.language-option small { display: block; color: var(--muted); }
.language-option:hover, .language-option.active { background: var(--selected); }
.language-option[aria-selected="true"] { background: #44364f; }
.language-options > p { padding: 10px 12px; color: var(--muted); }
.remove-language { font-size: 12px; }
.language-tools { display: flex; align-items: center; gap: 12px; }
.language-tools .button-link { white-space: nowrap; font-size: 14px; }
#language-create-form { padding: 28px; background: var(--panel); border-radius: 14px; }
#language-create-form > label { display: block; margin-bottom: 8px; }
#create-language-field { margin-bottom: 24px; }
#language-create-status { color: var(--muted); margin-top: 16px; }
.creation-setting { display: flex; align-items: center; gap: 8px; margin: 20px 0; font-weight: 400; }
@media (max-width: 760px) { .language-tools { width: 100%; flex-wrap: wrap; } }
input[type="checkbox"] { accent-color: var(--accent); }
#account-status, #admin-status { margin-top: 16px; color: var(--muted); }
.delete-account { margin-top: 32px; }
.delete-account p { margin: 16px 0; color: var(--muted); max-width: 65ch; }
#delete-account { background: #683744; color: #ffe1e5; }
.admin-tools { padding: 20px 24px; background: var(--rail); border-radius: 12px; margin: 24px 0; }
.admin-tools summary { font-size: 16px; font-weight: 600; }
.admin-tool-group { margin-top: 28px; }
.admin-tool-group p { margin-bottom: 16px; color: var(--muted); }
.admin-tool-group input, .admin-tool-group select, .admin-tool-group button { margin: 0 8px 12px 0; max-width: 100%; }
.review-queue { margin-top: 32px; }
.pending-row, .conflict-row { padding: 24px; margin-bottom: 12px; border-radius: 12px; background: var(--panel); overflow-wrap: anywhere; }
.pending-row p, .conflict-row p { margin: 8px 0 16px; white-space: pre-wrap; }
.pending-row small, .conflict-row small { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; }
#role-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; overflow-wrap: anywhere; }

.suggestions { margin-top: 24px; padding-top: 20px; border-top: 1px solid #ffffff14; }
.suggestions h3 { font-size: 14px; margin-bottom: 12px; }
#suggestion-list { list-style: none; display: grid; gap: 10px; padding: 0; margin: 0; }
.suggestion { padding: 14px 16px; background: #2a2433; border-radius: 10px; }
.suggestion-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.suggestion-head small { color: var(--muted); font-size: 12px; }
.suggestion p { margin: 8px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.suggestion .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.suggestion button { font-size: 13px; padding: 8px 12px; }
.suggestion-empty { color: var(--muted); font-size: 13px; }
.person-link { background: none; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #ffffff40; }
.person-link:disabled { text-decoration: none; }
#person { background: var(--panel); color: var(--ink); border: 0; border-radius: 14px; padding: 24px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 16px 40px #0007; }
#person::backdrop { background: #0009; }
.person-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
#person-avatar { border-radius: 50%; background: #494151; }
#person .row-actions { display: flex; gap: 8px; margin-top: 20px; }
.tip { position: absolute; pointer-events: none; z-index: 2; height: auto; box-shadow: 0 4px 14px #0008; }
.suggestion-head .avatar { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex: none; align-self: center; display: grid; place-items: center; background: #494151; color: var(--muted); font-size: 11px; font-weight: 700; }
.suggestion-head .avatar img { width: 100%; height: 100%; display: block; }
.suggestion-head .avatar.machine { background: var(--selected); color: var(--accent); letter-spacing: .02em; }
.suggestion-head { align-items: center; }
.person-name { font-weight: 600; }
.badge { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--selected); color: var(--accent); }
.suggestion .row-actions { align-items: center; }
.votes { display: flex; gap: 4px; margin-left: auto; }
.suggestion button.vote { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: transparent; color: var(--muted); font-variant-numeric: tabular-nums; }
.suggestion button.vote:hover:enabled { background: #ffffff10; color: var(--ink); }
.suggestion button.vote[aria-pressed="true"] { background: var(--selected); color: var(--accent); }
.suggestion button.vote:disabled { opacity: .6; }
#person-languages strong { color: var(--ink); font-weight: 650; }
.suggestion .person-link { padding: 0; font-size: inherit; }
.suggestion-head .avatar { margin-right: -2px; }
.scene-steps { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.scene-steps button { padding: 6px 12px; font-size: 16px; line-height: 1; }

.fit-warning { margin: 6px 0 0; color: #ffced4; font-size: .85rem; }
