/* Cinetrim — design tokens, base styles, shared components */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('vendor/fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('vendor/fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('vendor/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('vendor/fonts/jetbrains-mono-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0a0b10; --bg-2: #10121a; --bg-3: #171a25; --bg-4: #1e2230;
  --panel: rgba(18, 20, 30, 0.72); --glass: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14);
  --text: #e9ebf3; --text-2: #a5aabb; --text-3: #6f7488;
  --accent: #7c5cff; --accent-2: #19c6e6; --accent-3: #ff5ca8; --ok: #2ad17a; --warn: #ffb020; --danger: #ff4d6d;
  --grad: linear-gradient(135deg, #7c5cff 0%, #19c6e6 100%);
  --grad-text: linear-gradient(90deg, #a78bff, #19c6e6 55%, #ff5ca8);
  --radius: 16px; --radius-s: 10px; --radius-xs: 7px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5); --shadow-s: 0 8px 24px rgba(0, 0, 0, 0.35);
  --focus: 0 0 0 3px rgba(124, 92, 255, 0.45);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5fa; --bg-2: #ffffff; --bg-3: #eceef6; --bg-4: #e2e5f0;
  --panel: rgba(255, 255, 255, 0.78); --glass: rgba(20, 24, 50, 0.03);
  --line: rgba(15, 18, 40, 0.09); --line-2: rgba(15, 18, 40, 0.16);
  --text: #13151f; --text-2: #4b5068; --text-3: #8a8fa5;
  --shadow: 0 24px 70px rgba(30, 35, 80, 0.16); --shadow-s: 0 8px 24px rgba(30, 35, 80, 0.12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 15px; min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden, [hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ambient background */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; will-change: transform; }
.bg .b1 { width: 56vw; height: 56vw; left: -14vw; top: -22vw; background: radial-gradient(circle, #7c5cff 0%, rgba(124, 92, 255, 0) 70%); }
.bg .b2 { width: 48vw; height: 48vw; right: -16vw; top: 6vw; background: radial-gradient(circle, #19c6e6 0%, rgba(25, 198, 230, 0) 70%); opacity: 0.35; }
.bg .b3 { width: 40vw; height: 40vw; left: 30vw; bottom: -24vw; background: radial-gradient(circle, #ff5ca8 0%, rgba(255, 92, 168, 0) 70%); opacity: 0.3; }
[data-theme="light"] .bg .blob { opacity: 0.3; }
@media (prefers-reduced-motion: no-preference) {
  .bg .b1 { animation: drift 26s ease-in-out infinite alternate; }
  .bg .b2 { animation: drift 32s ease-in-out infinite alternate-reverse; }
  @keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vw, 4vw, 0) scale(1.08); } }
}
body.editor .bg .blob { opacity: 0.22; }

/* buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 11px 20px; font-weight: 600; border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(124, 92, 255, 0.45); }
.btn-secondary { background: var(--bg-3); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--accent); background: var(--bg-4); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); background: var(--glass); }
.btn-danger { background: rgba(255, 77, 109, 0.12); border-color: rgba(255, 77, 109, 0.35); color: #ff8aa0; }
.btn-danger:hover { background: rgba(255, 77, 109, 0.22); }
.btn-primary.small, .btn-secondary.small, .btn-ghost.small, .btn-danger.small { padding: 7px 14px; font-size: 13.5px; }
.btn-primary.big, .btn-secondary.big { padding: 15px 30px; font-size: 17px; }
.btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); color: var(--text-2); transition: 0.15s; padding: 0; }
.btn-icon:hover { color: var(--text); border-color: var(--line-2); }
.btn-icon.on { color: var(--accent); border-color: var(--accent); background: rgba(124, 92, 255, 0.12); }
.btn-icon:disabled { opacity: 0.35; cursor: default; }
.btn-link { background: none; border: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; font-size: 13px; }
.btn-link:hover { color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ico { display: inline-flex; }
.ico-sun { display: none; } [data-theme="light"] .ico-sun { display: block; } [data-theme="light"] .ico-moon { display: none; }

/* header */
.top, .sbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35); }
.brand-sub { color: var(--text-3); font-weight: 500; margin-left: -4px; font-size: 14px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { text-decoration: none; color: var(--text-2); padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--glass); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#langLabel { font-size: 12px; font-weight: 700; }

/* generic form bits */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field-row output { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.hint { font-size: 12.5px; color: var(--text-3); margin: 0; line-height: 1.45; }
.hint.warn { color: var(--warn); }
.hint a { color: var(--accent-2); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); margin-top: -6px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); cursor: grab; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
input[type="text"], input[type="number"], select, textarea { background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 8px 10px; color: var(--text); width: 100%; }
select.small, input.small { padding: 6px 8px; font-size: 13px; }
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
input[type="color"] { width: 36px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-3); padding: 2px; }
.color-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.switch { -webkit-appearance: none; appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: 0.2s; margin: 0; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2); font-size: 13px; font-weight: 500; transition: 0.15s; }
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.on { background: rgba(124, 92, 255, 0.18); border-color: var(--accent); color: var(--text); }
.chips.big .chip { padding: 10px 16px; font-size: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-s); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.15s linear; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font-family: var(--mono); font-size: 12px; background: var(--bg-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }

/* toasts & modals */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-s); font-size: 14px; opacity: 0; transform: translateY(10px); transition: 0.25s; max-width: min(90vw, 560px); }
.toast.in { opacity: 1; transform: none; }
.toast.ok { border-color: rgba(42, 209, 122, 0.5); } .toast.error { border-color: rgba(255, 77, 109, 0.6); } .toast.warn { border-color: rgba(255, 176, 32, 0.6); }
.modal-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(5, 6, 12, 0.6); backdrop-filter: blur(6px); opacity: 0; transition: 0.2s; padding: 16px; }
.modal-wrap.in { opacity: 1; }
.modal { width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.modal.wide { width: min(640px, 100%); }
.modal h3 { font-size: 19px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.coffee-card { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255, 176, 32, 0.4); background: linear-gradient(135deg, rgba(255, 176, 32, 0.12), rgba(255, 92, 168, 0.08)); color: #ffb020; }
.coffee-card > div { flex: 1; color: var(--text-2); font-size: 13.5px; }
.coffee-card b { color: var(--text); display: block; margin-bottom: 2px; }
.coffee-card .hint { margin: 0; }
.btn-icon.coffee { color: #ffb020; border-color: rgba(255, 176, 32, 0.35); }
.btn-icon.coffee:hover { background: rgba(255, 176, 32, 0.12); }
.trust { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-2); font-size: 13.5px; justify-content: center; }
.trust li { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(42, 209, 122, 0.15); }
.help-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.help-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.help-table td:first-child { width: 170px; }

/* language menu */
.lang-wrap { position: relative; display: inline-flex; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); z-index: 120; display: flex; flex-direction: column; gap: 2px; }
.lang-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; text-align: left; width: 100%; }
.lang-item:hover { background: var(--glass); color: var(--text); }
.lang-item.on { background: rgba(124, 92, 255, 0.15); color: var(--text); }
.lang-code { font-family: var(--mono); font-size: 11px; width: 24px; color: var(--text-3); }
.lang-item.on .lang-code { color: var(--accent); }
.lang-offer { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 16px; background: rgba(124, 92, 255, 0.12); border-bottom: 1px solid var(--line); font-size: 14px; }
.lang-offer a { color: var(--accent-2); }
.lang-offer .btn-icon { width: 28px; height: 28px; }
