[hidden] { display: none !important; }
:root {
  --bg: #f6f7fb; --card: #fff; --ink: #161a2b; --muted: #636a80; --line: #e4e7f0;
  --accent: #5b4fe0; --accent-soft: #eeecff; --ok: #157f4a; --ok-soft: #e6f6ee; --warn: #9a5b00; --warn-soft: #fff3df;
  --danger: #b42318; --radius: 16px;
  --font: "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(76px + env(safe-area-inset-bottom)) env(safe-area-inset-left); }
h1 { font-size: 17px; margin: 0; } h2 { font-size: 20px; margin: 4px 0 12px; } h3 { font-size: 16px; margin: 18px 0 8px; }
.card h3 { margin-top: 0; }
p { margin: 6px 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 12px; min-height: 44px; padding: 0 16px; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.primary { background: var(--accent); color: #fff; font-weight: 600; }
.secondary { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ghost { background: transparent; color: var(--accent); }
.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand p { margin: 0; font-size: 13px; color: var(--muted); }
.logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, #6f8df6, #a56cf4); }
main { padding: 14px 16px; max-width: 760px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; } .row.end { justify-content: flex-end; margin-top: 8px; } .row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 14px; }

.direction { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; margin-bottom: 10px; }
.lang { background: var(--bg); font-weight: 600; }
.swap { background: var(--accent-soft); color: var(--accent); width: 48px; padding: 0; font-size: 18px; }
textarea, input[type=search], input:not([type]), select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; min-height: 44px; }
textarea { resize: vertical; line-height: 1.45; }

.result-head { display: flex; justify-content: space-between; align-items: center; }
.label { font-size: 13px; color: var(--muted); font-weight: 600; }
.result-text { font-size: 19px; line-height: 1.5; margin: 8px 0 12px; white-space: pre-wrap; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.badge.memory, .badge.rules { background: var(--ok-soft); color: var(--ok); }
.similar { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 14px; }

.progress { position: sticky; top: 61px; z-index: 4; background: var(--accent-soft); padding: 8px 16px; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--accent); }
.progress .bar { flex: 1; height: 6px; background: #fff; border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.list { display: grid; gap: 8px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); }
.item button.ghost { padding: 0 10px; }
.empty { text-align: center; color: var(--muted); padding: 24px 12px; border: 1px dashed var(--line); border-radius: 14px; }

.film-top h2 { flex: 1; text-align: center; margin: 0; font-size: 17px; }
.player-box { position: relative; background: #000; border-radius: 14px; overflow: hidden; margin: 8px 0; }
#player-area { aspect-ratio: 16 / 9; display: grid; place-items: center; color: #c9cbe0; text-align: center; font-size: 14px; }
#player-area iframe, #player-area video { width: 100%; height: 100%; border: 0; display: block; }
#player-area .no-video { padding: 18px; }
.overlay { position: absolute; left: 6%; right: 6%; bottom: 12%; text-align: center; color: #fff; font-size: clamp(15px, 4.4vw, 24px); font-weight: 600; text-shadow: 0 1px 3px #000, 0 0 8px #000; pointer-events: none; line-height: 1.35; }
.film-actions { flex-wrap: wrap; margin: 6px 0; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; min-height: 38px; }
.filter { display: grid; grid-template-columns: 1fr 150px; gap: 8px; margin: 8px 0; }
.segments { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.seg { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; scroll-margin: 120px; }
.seg.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.seg .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.seg .time { background: none; color: var(--accent); min-height: 32px; padding: 0 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.seg .src { font-size: 14px; color: var(--muted); margin: 2px 0; }
.seg .tgt { font-size: 17px; width: 100%; text-align: left; background: none; padding: 4px 0; min-height: 36px; line-height: 1.45; }
.seg .tgt.pending { color: var(--muted); font-style: italic; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.tag.edited { background: var(--ok-soft); color: var(--ok); } .tag.rules { background: var(--warn-soft); color: var(--warn); }

.term-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.status-list { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 4px; font-size: 14px; }
.file-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: none; border-radius: 0; display: grid; justify-items: center; gap: 0; padding: 6px 2px; font-size: 12px; color: var(--muted); min-height: 58px; }
.tabs button span { font-size: 18px; line-height: 1.2; }
.tabs button.active { color: var(--accent); font-weight: 600; }

.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(15, 18, 35, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-head h3 { margin: 0; }
.sheet .field { display: grid; gap: 4px; margin: 10px 0; font-size: 14px; color: var(--muted); }
.sheet .src-box { background: var(--bg); border-radius: 12px; padding: 10px; font-size: 15px; }
.change { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin: 8px 0; }
.change .pair { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 16px; }
.change del { color: var(--danger); } .change ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { min-height: 34px; padding: 0 10px; border-radius: 99px; background: var(--bg); font-size: 14px; }
.chip.on { background: var(--accent); color: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; background: #1d2135; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
@media (min-width: 700px) { .seg .tgt { font-size: 18px; } }
