/* Forma — екран входу та хаб проєктів. */

/* ---------- перемикання екранів ---------- */
.app, .hub, .auth-screen { display: none; }
body.view-editor .app { display: grid; animation: viewIn .32s cubic-bezier(.2, .8, .2, 1); }
body.view-hub .hub { display: grid; animation: viewIn .32s cubic-bezier(.2, .8, .2, 1); }
body.view-auth .auth-screen { display: grid; animation: viewIn .4s ease; }
body.ready .app { opacity: 1; }
@keyframes viewIn { from { opacity: 0; transform: scale(.99); } }

.avatar { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 700; overflow: hidden; box-shadow: 0 0 0 2px var(--panel); letter-spacing: .02em; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- вхід ---------- */
.auth-screen { position: fixed; inset: 0; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); background: var(--bg); overflow: auto; }
.auth-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: 56px clamp(32px, 6vw, 96px);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(139, 108, 255, .28), transparent 60%), radial-gradient(800px 500px at 100% 100%, rgba(255, 111, 181, .18), transparent 60%), #0b0b0e;
  color: #f2f2f5;
}
.hero-shapes i { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: float 12s ease-in-out infinite; }
.hero-shapes .s1 { width: 120px; height: 120px; left: 8%; top: 12%; background: linear-gradient(135deg, #8b6cff, #5ee7df); }
.hero-shapes .s2 { width: 60px; height: 60px; right: 12%; top: 18%; background: #ff6fb5; animation-delay: -3s; border-radius: 16px; }
.hero-shapes .s3 { width: 34px; height: 34px; left: 46%; bottom: 10%; background: #ffd36e; animation-delay: -6s; }
.hero-shapes .s4 { width: 200px; height: 200px; right: -60px; bottom: -60px; background: linear-gradient(135deg, #ff6fb5, #8b6cff); opacity: .25; animation-delay: -2s; }
.hero-shapes .s5 { width: 18px; height: 18px; left: 30%; top: 40%; background: #fff; opacity: .3; animation-delay: -8s; }
@keyframes float { 50% { transform: translate(14px, -18px) rotate(12deg); } }
.hero-copy { position: relative; max-width: 560px; animation: fadeSlide .6s ease both; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 30px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: #d9d2ff; }
.auth-hero h1 { margin: 18px 0 14px; font: 800 clamp(32px, 3.6vw, 52px)/1.06 Manrope, Inter, sans-serif; letter-spacing: -.02em; }
.auth-hero p { margin: 0 0 22px; color: #b9b5c9; font-size: 15px; line-height: 1.6; max-width: 460px; }
.hero-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hero-list li { display: flex; align-items: center; gap: 10px; color: #dedbe8; font-size: 13.5px; }
.hero-list li .ic { color: #a891ff; }
.hero-mock { position: relative; max-width: 560px; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .6)); animation: popIn .8s cubic-bezier(.3, 1.3, .5, 1) .15s both; }
.hero-mock svg { display: block; width: 100%; height: auto; }
.mock-cursor { animation: mockCursor 6s ease-in-out infinite; }
.mock-sel { animation: mockSel 6s ease-in-out infinite; }
@keyframes mockCursor { 0%, 100% { transform: translate(0, 0); } 40% { transform: translate(-40px, -70px); } 60% { transform: translate(-40px, -70px); } }
@keyframes mockSel { 0%, 35% { opacity: 0; } 45%, 90% { opacity: 1; } 100% { opacity: 0; } }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--panel); }
.auth-card { width: 100%; max-width: 380px; animation: fadeSlide .5s ease .1s both; }
.auth-card.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font: 800 20px Manrope, Inter, sans-serif; }
.auth-title { margin: 0 0 6px; font: 750 26px/1.15 Manrope, Inter, sans-serif; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.auth-tabs { position: relative; display: flex; padding: 3px; background: var(--panel-2); border-radius: 10px; margin-bottom: 18px; }
.auth-tab { position: relative; z-index: 1; flex: 1; height: 32px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); font-weight: 600; transition: color .2s; }
.auth-tab.active { color: var(--text); }
.auth-tab-ink { position: absolute; top: 3px; left: 0; height: 32px; border-radius: 8px; background: var(--panel-4); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .3s cubic-bezier(.2, .8, .2, 1), width .3s; }
.google-wrap { display: flex; justify-content: center; min-height: 42px; }
.google-btn { width: 100%; height: 42px; gap: 10px; font-size: 13.5px; font-weight: 600; background: var(--panel); border-color: var(--border-strong); border-radius: 21px; }
.google-btn:hover { background: var(--panel-3); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--faint); font-size: 11.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-form { display: grid; gap: 12px; }
.auth-field { display: grid; gap: 6px; }
.auth-field > span { color: var(--muted); font-size: 12px; font-weight: 500; }
.auth-field .input { height: 40px; width: 100%; }
.name-row { display: none; }
.auth-card.is-register .name-row { display: grid; animation: fadeSlide .25s ease; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 40px; }
.pass-eye { position: absolute; right: 7px; top: 7px; }
.auth-error { min-height: 0; color: var(--danger); font-size: 12.5px; line-height: 1.45; }
.auth-error:empty { display: none; }
.auth-error.ok { color: var(--success); }
.auth-submit { height: 42px; font-size: 14px; font-weight: 650; margin-top: 2px; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.google-btn.loading::after { border-color: var(--border-strong); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.known-accounts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.known-accounts:empty { display: none; }
.known-cap { width: 100%; color: var(--faint); font-size: 11.5px; }
.known-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 4px; border: 1px solid var(--border-strong); border-radius: 15px; background: var(--panel-2); transition: background .15s, transform .15s; }
.known-chip:hover { background: var(--panel-3); transform: translateY(-1px); }
.auth-guest { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; min-height: 32px; border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 600; }
.auth-guest:hover { text-decoration: underline; }
.auth-note { margin: 20px 0 0; color: var(--faint); font-size: 11.5px; line-height: 1.55; }
.help-body ol { padding-left: 20px; line-height: 1.7; color: var(--muted); }
.help-body p { color: var(--muted); line-height: 1.55; }

/* ---------- хаб ---------- */
.hub { position: fixed; inset: 0; grid-template-columns: 264px minmax(0, 1fr); background: var(--bg); }
.hub-side { display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--border); overflow: auto; }
.hub-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; font: 800 18px Manrope, Inter, sans-serif; }
.beta { font: 600 10px Inter, sans-serif; padding: 2px 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-hi); }
.hub-account { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); text-align: left; transition: background .15s, border-color .15s; }
.hub-account:hover { background: var(--panel-3); border-color: var(--border-strong); }
.ha-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ha-text b, .ha-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ha-text small { color: var(--faint); font-size: 11px; }
.ha-chev { color: var(--faint); }
.hub-new { height: 40px; margin: 10px 0 8px; font-size: 13px; font-weight: 650; border-radius: 10px; }
.hub-nav { display: grid; gap: 2px; }
.hub-nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.hub-nav-item:hover { background: var(--panel-3); color: var(--text); }
.hub-nav-item.active { background: var(--accent-soft); color: var(--text); }
.hub-nav-item.active .ic { color: var(--accent); }
.hn-label { flex: 1; }
.hn-count { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.hub-spacer { flex: 1; min-height: 20px; }
.hub-cloud { display: flex; align-items: center; gap: 7px; padding: 6px 10px; color: var(--muted); font-size: 11.5px; }
.hub-cloud:empty { display: none; }
.hub-cloud.st-synced .ic { color: var(--success); }
.hub-cloud.st-syncing .ic { color: var(--accent); animation: pulse 1s infinite; }
.hub-cloud.st-error, .hub-cloud.st-offline, .hub-cloud.st-conflict, .hub-cloud.st-auth { color: var(--warn); }
.hub-storage { padding: 10px; border-radius: 10px; background: var(--panel-2); display: grid; gap: 6px; font-size: 11.5px; color: var(--muted); }
.hub-storage:empty { display: none; }
.hs-row { display: flex; justify-content: space-between; }
.hs-row b { color: var(--text); font-weight: 600; }
.hs-bar { height: 4px; border-radius: 4px; background: var(--panel-4); overflow: hidden; }
.hs-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff6fb5); border-radius: 4px; transition: width .6s ease; }
.hub-storage small { color: var(--faint); font-size: 10.5px; }
.guest-cta { margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: linear-gradient(135deg, var(--accent-soft), transparent); }
.guest-cta b { display: block; margin-bottom: 4px; }
.guest-cta p { margin: 0 0 10px; color: var(--muted); line-height: 1.45; font-size: 11.5px; }

.hub-main { overflow: auto; padding: 28px clamp(20px, 3.5vw, 48px) 60px; position: relative; }
.hub-main.drop::after { content: attr(data-drop); position: fixed; inset: 16px 16px 16px 280px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 18px; background: var(--accent-soft); font-size: 15px; font-weight: 600; color: var(--text); pointer-events: none; z-index: 5; }
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; animation: fadeSlide .35s ease both; }
.hub-title { margin: 0; font: 780 28px/1.15 Manrope, Inter, sans-serif; letter-spacing: -.015em; }
.hub-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.hub-tools { display: flex; align-items: center; gap: 8px; }
.hub-search { width: 240px; height: 34px; padding: 0 12px 0 34px; border: 1px solid var(--border-strong); border-radius: 9px; outline: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8e9a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 11px center; transition: border-color .15s, box-shadow .15s; }
.hub-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hub-sort { height: 34px; border-color: var(--border-strong); background: var(--panel); }
.hub-tools .btn { height: 34px; }
.hub-section { margin-bottom: 30px; }
.hub-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; font-weight: 650; color: var(--text); }
.grid-count { padding: 1px 8px; border-radius: 10px; background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 600; }
.grid-title .btn { margin-left: auto; }
.tpl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tpl-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); text-align: left; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), border-color .15s, box-shadow .2s; animation: fadeSlide .35s ease both; }
.tpl-tile:hover { transform: translateY(-3px); border-color: var(--accent-ring); box-shadow: var(--shadow-md); }
.tpl-tile:active { transform: scale(.97); }
.tpl-visual { width: 100%; height: 64px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 8px; background: var(--panel-2); }
.tpl-shape { display: grid; place-items: center; border-radius: 4px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: transform .25s; }
.tpl-tile:hover .tpl-shape { transform: scale(1.08); }
.tpl-tile.blank .tpl-visual { background: var(--accent-soft); }
.tpl-tile.blank .tpl-shape { background: var(--accent-btn); color: #fff; border-radius: 12px; }
.tpl-tile b { font-size: 12.5px; font-weight: 600; }
.tpl-tile small { color: var(--faint); font-size: 11px; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.proj-card { position: relative; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); overflow: hidden; cursor: pointer; outline: none;
  transition: transform .22s cubic-bezier(.3, 1.3, .5, 1), border-color .15s, box-shadow .25s; animation: cardIn .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.proj-card:hover, .proj-card:focus-visible { transform: translateY(-3px); border-color: var(--accent-ring); box-shadow: var(--shadow-md); }
.pc-thumb { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--canvas); overflow: hidden; border-bottom: 1px solid var(--border); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.proj-card:hover .pc-thumb img { transform: scale(1.03); }
.pc-empty { color: var(--faint); }
.pc-open { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 16 / 10; display: grid; place-items: center; background: rgba(10, 10, 14, .35); opacity: 0; transition: opacity .2s; pointer-events: none; }
.pc-open span { padding: 8px 16px; border-radius: 20px; background: #fff; color: #16161d; font-weight: 650; transform: translateY(6px); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.proj-card:hover .pc-open { opacity: 1; }
.proj-card:hover .pc-open span { transform: none; }
.pc-info { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; }
.pc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.pc-text small { color: var(--faint); font-size: 11.5px; }
.pc-cloud { color: var(--success); display: grid; }
.pc-rename { height: 26px; font-weight: 600; }
.proj-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 50px 20px; border: 1.5px dashed var(--border-strong); border-radius: 16px; color: var(--muted); text-align: center; animation: fadeSlide .4s ease; }
.proj-empty b { color: var(--text); font-size: 14px; }
.pe-ic { color: var(--accent); margin-bottom: 4px; }

.profile-body { display: grid; gap: 16px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-top b { display: block; }
.profile-top small { color: var(--faint); }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.cp { width: 28px; height: 28px; border-radius: 50%; border: 0; box-shadow: 0 0 0 2px var(--panel); transition: transform .15s, box-shadow .15s; }
.cp:hover { transform: scale(1.1); }
.cp.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }

/* ---------- адаптивність ---------- */
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .hub { grid-template-columns: 1fr; }
  .hub-side { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .hub-brand { padding: 0 8px 0 0; }
  .hub-account { width: auto; flex: 1; min-width: 180px; }
  .hub-new { margin: 0; }
  .hub-nav { display: flex; width: 100%; }
  .hub-spacer, .hub-storage, .guest-cta { display: none; }
  .hub-main { padding: 18px 16px 40px; }
  .hub-main.drop::after { inset: 16px; }
  .hub-search { width: 100%; }
  .hub-tools { width: 100%; flex-wrap: wrap; }
  .hub-tools .hub-search { flex: 1 1 100%; }
}

.tpl-tile.more .tpl-visual { background: linear-gradient(135deg, var(--accent-soft), rgba(255, 111, 181, .14)); }
.tpl-more-ic { color: var(--accent); display: grid; }

/* ---------- генератор макетів ---------- */
.gen-modal .modal-body { padding: 0; overflow: hidden; }
.gen { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; height: min(640px, calc(100vh - 170px)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.gen-left { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: 1px solid var(--border); overflow: auto; }
.gen-search { height: 32px; }
.gen-cats { display: grid; gap: 2px; }
.gen-cat { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; transition: background .15s, color .15s; }
.gen-cat:hover { background: var(--panel-3); color: var(--text); }
.gen-cat.active { background: var(--accent-soft); color: var(--text); }
.gen-cat.active .ic { color: var(--accent); }
.gen-mid { overflow: auto; padding: 12px; background: var(--bg); }
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.gen-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); text-align: left; animation: fadeSlide .25s ease both; transition: border-color .15s, transform .18s cubic-bezier(.3, 1.4, .5, 1); }
.gen-card:hover { transform: translateY(-2px); border-color: var(--accent-ring); }
.gen-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gen-card b { font-size: 12px; font-weight: 600; line-height: 1.3; }
.gen-card small { color: var(--faint); font-size: 11px; }
.gen-thumb { width: 100%; height: 70px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 7px; background: var(--panel-2); }
.gen-thumb i { display: block; background: #fff; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.gen-custom { grid-column: 1 / -1; padding: 30px; color: var(--muted); text-align: center; line-height: 1.6; }
.gen-custom b { color: var(--text); font-size: 14px; }
.gen-right { display: flex; flex-direction: column; overflow: auto; border-left: 1px solid var(--border); }
.gen-preview-wrap { padding: 12px; border-bottom: 1px solid var(--border); background: repeating-conic-gradient(var(--panel-3) 0 25%, var(--panel-2) 0 50%) 0 0 / 14px 14px; }
.gen-preview { display: block; width: 100%; height: auto; aspect-ratio: 52 / 30; }
.gen-info { margin-top: 6px; color: var(--muted); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.gen-side { padding: 12px; display: grid; gap: 10px; }
.gen-field { display: grid; gap: 5px; min-width: 0; }
.gen-field > span { color: var(--muted); font-size: 11px; }
.gen-ctrl { display: flex; gap: 6px; align-items: center; min-width: 0; }
.gen-ctrl > * { min-width: 0; }
.gen-ctrl .input, .gen-ctrl .sf { width: 100%; height: 30px; font-size: 12px; }
.gen-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gen-sep { height: 1px; background: var(--border); margin: 2px 0; }
.gen-num { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .gen { grid-template-columns: 1fr; height: auto; max-height: calc(100vh - 170px); overflow: auto; } .gen-left, .gen-right { border: 0; } }

/* ---------- плагіни ---------- */
.pl-modal .modal-body { padding-top: 0; }
.pl-tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 14px; background: var(--panel-2); border-radius: 10px; width: max-content; }
.pl-tab { height: 30px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; transition: all .15s; }
.pl-tab:hover { color: var(--text); }
.pl-tab.active { background: var(--panel-4); color: var(--text); }
.pl-view { min-height: 340px; max-height: calc(100vh - 260px); overflow: auto; animation: fadeSlide .2s ease; }
.pl-list { display: grid; gap: 10px; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.pl-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); animation: fadeSlide .25s ease both; }
.pl-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 12px; }
.pl-head { display: flex; align-items: center; gap: 10px; }
.pl-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); flex: none; }
.pl-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-title small, .pl-head small { color: var(--faint); font-size: 11px; }
.pl-perms { display: flex; flex-wrap: wrap; gap: 5px; }
.pl-perm { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; background: var(--panel-3); color: var(--muted); font-size: 10.5px; }
.pl-perm.warn { color: var(--warn); background: rgba(255, 181, 71, .12); }
.pl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pl-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 50px 20px; color: var(--muted); text-align: center; }
.pl-empty b { color: var(--text); }
.pl-dev { display: grid; gap: 10px; }
.pl-code { width: 100%; min-height: 300px; resize: vertical; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); outline: none; font: 12.5px/1.55 "JetBrains Mono", ui-monospace, monospace; tab-size: 2; white-space: pre; }
.pl-code:focus { border-color: var(--accent); }
.pl-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 10px; background: rgba(255, 181, 71, .1); color: var(--warn); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.pl-confirm { display: grid; gap: 10px; }
.danger-text:hover { color: var(--danger) !important; }
.plugin-form { display: grid; gap: 12px; }
.plugin-form .input { width: 100%; }
.plugin-form input[type=color].input { height: 34px; padding: 2px; }
.plugin-ta { min-height: 80px; padding: 8px 10px; resize: vertical; font: inherit; }
.plugin-by { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 11px; }

.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 15px; background: var(--panel-2); color: var(--muted); font-size: 12px; transition: background .15s, color .15s; }
.lang-btn:hover { background: var(--panel-3); color: var(--text); }
.lang-btn.top-lang { height: 30px; padding: 0 8px; gap: 5px; border-color: transparent; background: transparent; border-radius: 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.lang-btn.top-lang:hover { background: var(--panel-3); }
.auth-panel { position: relative; }
.auth-lang { position: absolute; top: 18px; right: 18px; }

/* ---------- Налаштування ---------- */
.set-body { display: flex; flex-direction: column; gap: 18px; max-height: min(64vh, 620px); overflow: auto; padding-right: 4px; margin-right: -4px; }
.set-group h3 { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.set-langs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.set-lang { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel-2); color: var(--muted); text-align: left; transition: border-color .15s, background .15s, color .15s, transform .15s; }
.set-lang b { font-size: 11px; letter-spacing: .06em; color: var(--faint); }
.set-lang span { font-size: 13px; color: var(--text); }
.set-lang:hover { background: var(--panel-3); transform: translateY(-1px); }
.set-lang.active { border-color: var(--accent); background: var(--accent-soft); }
.set-lang.active b { color: var(--accent); }
.set-note { margin: 8px 0 0; color: var(--faint); font-size: 11.5px; }
.set-field { display: flex; flex-direction: column; gap: 6px; }
.set-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.set-row.switch { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.set-text { display: flex; flex-direction: column; gap: 1px; }
.set-text small { color: var(--faint); font-size: 11.5px; }
.lang-switching body { opacity: .6; transition: opacity .12s; pointer-events: none; }
@media (max-width: 560px) { .set-langs { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Фільтри шару ---------- */
.flt-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.flt-chip { height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); color: var(--muted); font-size: 11px; transition: background .15s, color .15s, border-color .15s; }
.flt-chip:hover { color: var(--text); border-color: var(--accent-ring); background: var(--accent-soft); }
.flt-cell { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.flt-name { font-size: 10.5px; color: var(--faint); }

/* ---------- Фото-студія ---------- */
.ps-studio { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: var(--bg); color: var(--text); opacity: 0; transform: scale(.985); transition: opacity .2s ease, transform .22s cubic-bezier(.2,.9,.1,1); }
.ps-studio.open { opacity: 1; transform: none; }
.ps-studio.closing { opacity: 0; transform: scale(.985); pointer-events: none; }
.ps-head { height: 48px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.ps-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ps-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.ps-title small { color: var(--faint); font-variant-numeric: tabular-nums; }
.ps-logo { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: linear-gradient(135deg, #ff6fb5, #7c5cff); color: #fff; }
.ps-head-mid, .ps-head-right { display: flex; align-items: center; gap: 6px; }
.ps-100 { font-size: 11px; font-weight: 700; }
.ps-body { flex: 1; min-height: 0; display: flex; }
.ps-rail { width: 52px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-right: 1px solid var(--border); background: var(--panel); overflow: auto; }
.ps-tool { width: 36px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.ps-tool:hover { background: var(--panel-3); color: var(--text); }
.ps-tool.active { background: var(--accent-btn); color: #fff; box-shadow: 0 4px 14px -4px var(--accent); }
.ps-sep { width: 24px; height: 1px; margin: 4px 0; background: var(--border); flex: none; }
.ps-colors { position: relative; width: 40px; height: 44px; flex: none; margin-top: 6px; }
.ps-sw { position: absolute; width: 24px; height: 24px; border-radius: 6px; box-shadow: 0 0 0 1px var(--border-strong), inset 0 0 0 1px rgba(255,255,255,.2); overflow: hidden; cursor: pointer; }
.ps-sw input { position: absolute; inset: -8px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.ps-sw.fg { left: 0; top: 0; z-index: 1; }
.ps-sw.bg { right: 0; bottom: 0; }
.ps-swap { position: absolute; right: -2px; top: -2px; width: 16px; height: 16px; display: grid; place-items: center; border: 0; padding: 0; background: transparent; color: var(--muted); }
.ps-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-options { height: 42px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--panel); overflow-x: auto; white-space: nowrap; font-size: 12px; }
.ps-opt-name { font-weight: 600; }
.ps-hint { color: var(--faint); font-size: 11.5px; }
.ps-seg { flex: none; }
.ps-stage { flex: 1; min-height: 0; position: relative; background: var(--canvas); overflow: hidden; }
.ps-view { position: absolute; inset: 0; touch-action: none; }
.ps-bottom { height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; border-top: 1px solid var(--border); background: var(--panel); }
.ps-palette { display: grid; grid-template-columns: repeat(10, 16px); grid-template-rows: repeat(2, 14px); gap: 2px; }
.ps-pc { width: 16px; height: 14px; padding: 0; border: 0; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); transition: transform .12s; }
.ps-pc:hover { transform: scale(1.25); z-index: 1; }
.ps-status { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ps-side { width: 300px; flex: none; overflow: auto; padding: 10px 12px 24px; border-left: 1px solid var(--border); background: var(--panel); }
.ps-group { padding: 10px 0 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.ps-group h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.ps-row { display: flex; gap: 6px; }
.ps-row > * { flex: 1; }
.ps-act { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-size: 12.5px; text-align: left; transition: background .15s, border-color .15s; }
.ps-act:hover:not(:disabled) { background: var(--panel-3); border-color: var(--border); }
.ps-act:disabled { opacity: .35; }
.ps-act .ic { color: var(--muted); flex: none; }
.ps-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ps-preset { display: flex; flex-direction: column; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 10.5px; transition: border-color .15s, transform .15s, color .15s; }
.ps-preset:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.ps-pthumb { width: 100%; height: auto; aspect-ratio: 64 / 44; border-radius: 5px; background: var(--panel-3); }
.ps-adj { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ps-adj output { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.ps-range { width: 100%; accent-color: var(--accent); }
.ps-note { margin: 6px 0 0; color: var(--faint); font-size: 11px; line-height: 1.4; }
.ps-resize { display: flex; flex-direction: column; gap: 10px; }
.ps-lock { display: flex; gap: 8px; align-items: center; }
.ps-ins { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ps-ins-btn { justify-content: flex-start; gap: 6px; }
@media (max-width: 900px) { .ps-side { width: 240px; } .ps-palette { display: none; } }

/* ---------- Вибір шрифту ---------- */
.font-btn { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 28px; padding: 0 8px 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-2); color: var(--text); font-size: 13px; text-align: left; min-width: 0; transition: border-color .15s, background .15s; }
.font-btn:hover, .font-btn.open { border-color: var(--accent-ring); background: var(--panel-3); }
.font-btn-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-btn-chev { color: var(--muted); flex: none; display: grid; }
.font-pop { position: fixed; z-index: 950; display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--panel); box-shadow: 0 24px 60px -12px rgba(0,0,0,.55); opacity: 0; transform: translateY(-4px) scale(.985); transform-origin: top right; transition: opacity .14s ease, transform .16s cubic-bezier(.2,.9,.1,1); overflow: hidden; }
.font-pop.open { opacity: 1; transform: none; }
.font-pop.closing { opacity: 0; transform: translateY(-4px) scale(.985); }
.fp-top { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; }
.fp-search { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel-2); color: var(--text); outline: none; font-size: 13px; }
.fp-search:focus { border-color: var(--accent); }
.fp-cyr { font-size: 11.5px; color: var(--muted); gap: 6px; flex: none; white-space: nowrap; }
.fp-cats { display: flex; gap: 4px; padding: 2px 10px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.fp-cat { flex: none; height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--muted); font-size: 11.5px; }
.fp-cat:hover { color: var(--text); }
.fp-cat.active { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.fp-list { flex: 1; overflow: auto; padding: 4px 6px; border-top: 1px solid var(--border); }
.fp-item { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 7px 34px 7px 10px; border-radius: 8px; cursor: pointer; }
.fp-item.active { background: var(--accent-soft); }
.fp-item.current .fp-name { color: var(--accent); }
.fp-name { font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-sample { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-check { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--accent); display: grid; }
.fp-del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.fp-empty { padding: 30px 16px; text-align: center; color: var(--faint); font-size: 12.5px; line-height: 1.5; }
.fp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); flex: none; }
.fp-up { gap: 6px; }
.fp-hint { font-size: 11px; color: var(--faint); }

/* ---------- Таймлайн анімації ---------- */
:root { --tl-h: 260px; }
.app { grid-template-rows: 44px 40px minmax(0, 1fr) auto 26px; }
.timeline { height: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; background: var(--panel); border-top: 0 solid var(--border); transition: height .3s cubic-bezier(.2, .8, .2, 1); }
.app.tl-open .timeline { height: var(--tl-h); border-top-width: 1px; }
.tl-resizer { position: absolute; left: 0; right: 0; top: -3px; height: 7px; cursor: ns-resize; z-index: 3; }
.tl-bar { height: 40px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tl-play { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-btn); color: #fff; }
.tl-play:hover { background: var(--accent); filter: brightness(1.1); }
.tl-time { min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }
.tl-of, .tl-s { color: var(--faint); font-size: 12px; }
.tl-dur, .tl-kval { width: 58px; height: 26px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 12px; outline: none; }
.tl-dur:focus, .tl-kval:focus { border-color: var(--accent); }
input[type=color].tl-kval { padding: 2px; width: 34px; }
.tl-zoom { width: 90px; accent-color: var(--accent); }
.tl-keybar { display: flex; align-items: center; gap: 6px; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--border); }
.tl-keybar:empty { display: none; }
.tl-kb-label { display: inline-flex; align-items: center; gap: 5px; color: #ff4d8d; font-size: 12px; font-weight: 600; }
.tl-ease { height: 26px; max-width: 170px; }
.tl-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); overflow: auto; }
.tl-left { border-right: 1px solid var(--border); position: sticky; left: 0; background: var(--panel); z-index: 2; }
.tl-left-head { height: 24px; display: flex; align-items: center; padding: 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.tl-row { height: 26px; display: flex; align-items: center; gap: 6px; padding-right: 6px; font-size: 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.tl-node { cursor: pointer; font-weight: 500; }
.tl-node:hover { background: var(--panel-3); }
.tl-node.sel { background: var(--accent-soft); }
.tl-chev { width: 14px; height: 14px; border: 0; padding: 0; background: transparent; color: var(--muted); flex: none; position: relative; }
.tl-chev::before { content: ''; position: absolute; left: 4px; top: 3px; border: 4px solid transparent; border-left-color: currentColor; transition: transform .15s; transform-origin: 2px 4px; }
.tl-chev.open::before { transform: rotate(90deg); }
.tl-ic { color: var(--muted); display: grid; flex: none; }
.tl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-trig { font-size: 10px; color: var(--faint); white-space: nowrap; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
.tl-add { opacity: 0; }
.tl-node:hover .tl-add, .tl-node.sel .tl-add { opacity: 1; }
.tl-prop { color: var(--muted); }
.tl-pname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-pval { font-variant-numeric: tabular-nums; color: var(--text); font-size: 11px; }
.tl-kbtn, .ins-key { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--faint); padding: 0; }
.tl-kbtn:hover, .ins-key:hover { background: var(--panel-3); color: #ff4d8d; }
.tl-kbtn.on, .ins-key.on { color: #ff4d8d; }
.tl-kbtn.on .ic, .ins-key.on .ic { fill: currentColor; }
.ins-key.has:not(.on) { color: color-mix(in srgb, #ff4d8d 55%, var(--faint)); }
.tl-empty { padding: 14px 12px; color: var(--faint); font-size: 12px; line-height: 1.45; }
.tl-tracks { position: relative; min-width: 0; overflow: clip; }
.tl-ruler { height: 24px; position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--border); cursor: ew-resize; }
.tl-tick { position: absolute; top: 0; height: 100%; padding-left: 4px; border-left: 1px solid var(--border-strong); font-size: 10px; line-height: 24px; color: var(--faint); font-variant-numeric: tabular-nums; pointer-events: none; }
.tl-end { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--faint); opacity: .6; }
.tl-lane { position: relative; height: 26px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.tl-node-lane.sel { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.tl-clip { position: absolute; top: 6px; height: 14px; border-radius: 7px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, #ff4d8d 55%, transparent)); cursor: grab; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.tl-clip.loop::after { content: '↻'; position: absolute; right: -14px; top: -2px; font-size: 11px; color: var(--muted); }
.tl-clip:active { cursor: grabbing; }
.tl-dot { position: absolute; top: 11px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #fff; pointer-events: none; }
.tl-hint { position: absolute; left: 12px; top: 0; line-height: 26px; font-size: 11px; color: var(--faint); }
.tl-seg { position: absolute; top: 12px; height: 2px; background: color-mix(in srgb, #ff4d8d 45%, transparent); pointer-events: none; }
.tl-seg.e-linear { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.tl-seg.e-step { background: none; border-top: 2px dotted color-mix(in srgb, var(--muted) 60%, transparent); }
.tl-key { position: absolute; top: 7px; width: 12px; height: 12px; margin-left: -6px; background: var(--panel); border: 2px solid #ff4d8d; transform: rotate(45deg); border-radius: 2px; cursor: ew-resize; transition: transform .12s, background .12s; z-index: 1; }
.tl-key:hover { transform: rotate(45deg) scale(1.25); }
.tl-key.sel { background: #ff4d8d; box-shadow: 0 0 0 3px color-mix(in srgb, #ff4d8d 30%, transparent); }
.tl-key.lin { border-radius: 50%; transform: none; }
.tl-key.step { border-radius: 0; transform: none; }
.tl-head { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: #ff4d8d; z-index: 3; pointer-events: auto; cursor: ew-resize; will-change: transform; }
.tl-head::before { content: ''; position: absolute; top: 0; left: -6px; width: 14px; height: 12px; background: #ff4d8d; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
.tl-head::after { content: ''; position: absolute; top: 0; bottom: 0; left: -5px; width: 12px; }
/* інспектор */
.anim-ins-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.anim-t { display: inline-flex; align-items: center; gap: 5px; color: #ff4d8d; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.anim-ins-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.anim-badge { color: #ff4d8d; display: grid; }
/* пресети */
.ap-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; }
.ap-left { max-height: min(60vh, 560px); overflow: auto; padding-right: 4px; }
.ap-group { margin: 12px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.ap-group:first-child { margin-top: 0; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ap-grid .ap-group { grid-column: 1 / -1; }
.ap-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 11.5px; transition: border-color .15s, background .15s, color .15s; }
.ap-card:hover { color: var(--text); border-color: var(--border-strong); }
.ap-card.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.ap-stage { width: 72px; height: 48px; display: grid; place-items: center; border-radius: 7px; background: var(--panel-3); overflow: hidden; }
.ap-dot { display: block; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #7c5cff, #ff4d8d); }
.ap-side { display: flex; flex-direction: column; gap: 10px; }
.ap-note { margin: 0; color: var(--faint); font-size: 11.5px; line-height: 1.45; }
/* код */
.ac-body { display: flex; flex-direction: column; gap: 10px; }
.ac-tabs { display: flex; gap: 4px; }
.ac-tab { height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; }
.ac-tab.active { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.ac-info { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.ac-code { width: 100%; height: min(52vh, 480px); resize: vertical; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel-2); color: var(--text); font: 12px/1.55 'JetBrains Mono', ui-monospace, monospace; tab-size: 2; outline: none; white-space: pre; }
.ac-code:focus { border-color: var(--accent); }
.ac-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ac-preview { width: 100%; height: min(70vh, 720px); border: 0; border-radius: 10px; background: #fff; }
.vid-prog { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.vid-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff4d8d); transition: width .1s linear; }
@media (max-width: 820px) { .tl-body { grid-template-columns: 150px minmax(0, 1fr); } .ap-body { grid-template-columns: 1fr; } }

/* ---------- Прототип: вкладка ---------- */
.ptab[data-badge]:not([data-badge=""])::after { content: attr(data-badge); margin-left: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; line-height: 16px; display: inline-block; text-align: center; }
.px-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 4px; }
.px-head-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.px-head b { display: block; font-size: 13px; }
.px-head small { color: var(--faint); font-size: 11px; }
.px-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); animation: fadeSlide .2s ease both; }
.px-card-head { display: flex; align-items: center; gap: 6px; }
.px-num-badge { width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--accent-btn); color: #fff; font-size: 10.5px; font-weight: 700; }
.px-card .sf.grow, .px-act-head .sf.grow { flex: 1; min-width: 0; }
.px-action { display: flex; flex-direction: column; gap: 7px; padding: 8px; border-radius: 9px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.px-act-head { display: flex; align-items: center; gap: 6px; }
.px-act-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--panel-3); color: var(--accent); }
.px-row { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.px-row > * { flex: 1; min-width: 70px; }
.px-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.px-cap { font-size: 10.5px; color: var(--faint); }
.px-num { width: 100%; height: 26px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 12px; outline: none; }
.px-num:focus { border-color: var(--accent); }
.px-numwrap { position: relative; display: block; }
.px-numwrap span { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--faint); pointer-events: none; }
.px-numwrap .px-num { padding-right: 26px; }
.px-target { display: flex; align-items: center; gap: 6px; width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--panel-2); color: var(--text); font-size: 12px; text-align: left; }
.px-target span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-target:hover { border-color: var(--accent-ring); }
.px-target.empty { color: var(--accent); border-style: dashed; }
.px-target.broken { color: #ef4444; border-color: #ef4444; }
.px-url.broken { border-color: #ef4444; }
.px-check { font-size: 12px; }
.px-note { margin: 0; font-size: 11px; line-height: 1.45; color: var(--faint); }
.px-to { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 8px; background: var(--panel-2); }
.px-coloropt { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.px-color { width: 28px; height: 22px; padding: 0; border: 1px solid var(--border-strong); border-radius: 5px; background: transparent; }
.px-color:disabled { opacity: .35; }
.px-add-act { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px dashed var(--border-strong); border-radius: 7px; background: transparent; color: var(--muted); font-size: 11.5px; }
.px-add-act:hover { color: var(--accent); border-color: var(--accent); }
.px-issue { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border-radius: 7px; font-size: 11.5px; line-height: 1.35; }
.px-issue .ic { flex: none; margin-top: 1px; }
.px-issue.error { background: color-mix(in srgb, #ef4444 14%, transparent); color: #ff7b7b; }
.px-issue.warn { background: color-mix(in srgb, #f59e0b 14%, transparent); color: #fbbf24; }
.px-issue.info { background: var(--panel-2); color: var(--muted); }
.px-issue.clickable { cursor: pointer; }
.px-issue.clickable:hover { filter: brightness(1.15); }
.px-ok { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: 12px; }
.px-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.px-frame-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 12.5px; text-align: left; }
.px-frame-row:hover { background: var(--panel-3); }
.px-frame-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-frame-row small { color: var(--faint); }
.px-start-badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: color-mix(in srgb, #22c55e 18%, transparent); color: #22c55e; font-size: 12px; font-weight: 600; flex: none !important; }
.px-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; text-align: center; color: var(--faint); font-size: 12px; }
.px-empty b { color: var(--text); }
.px-hint { margin: 10px 14px; }
.px-pick { position: fixed; z-index: 960; display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--panel); box-shadow: 0 20px 50px -10px rgba(0,0,0,.5); animation: menuIn .14s ease; }
.px-pick .fp-search { margin-bottom: 6px; }
.px-pick-list { overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.px-pick-item { display: grid; grid-template-columns: 20px 1fr; grid-template-rows: auto auto; column-gap: 6px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; font-size: 12.5px; }
.px-pick-item small { grid-column: 2; color: var(--faint); font-size: 10.5px; }
.px-pick-ic { grid-row: 1 / span 2; color: var(--muted); display: grid; place-items: center; }
.px-pick-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-pick-item.active { background: var(--accent-soft); }
.px-pick-item.current .px-pick-l { color: var(--accent); font-weight: 600; }
/* плитка прикладу в хабі */
.tpl-proto { position: relative; width: 70px; height: 46px; }
.tpl-proto i { position: absolute; top: 4px; width: 20px; height: 38px; border-radius: 4px; background: linear-gradient(160deg, #8b6cff, #ff6fb5); }
.tpl-proto i:nth-child(1) { left: 0; }
.tpl-proto i:nth-child(2) { left: 25px; background: #fff; }
.tpl-proto i:nth-child(3) { left: 50px; background: linear-gradient(160deg, #ffcf99, #ff7a59); }
.tpl-proto::after { content: ''; position: absolute; left: 17px; top: 22px; width: 36px; height: 2px; background: #7c5cff; box-shadow: 0 0 0 1px rgba(255,255,255,.4); }

/* ---------- Прототип: перегляд ---------- */
.pv-root { position: fixed; inset: 0; z-index: 970; display: flex; flex-direction: column; background: #121216; opacity: 0; transition: opacity .2s ease; }
.pv-root.open { opacity: 1; }
.pv-root.closing { opacity: 0; pointer-events: none; }
.pv-bar { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #1b1b21; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; transition: transform .25s ease, opacity .25s ease; z-index: 2; }
.pv-logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #7c5cff, #ff6fb5); }
.pv-name { font-size: 13px; min-width: 80px; }
.pv-sep { width: 1px; height: 20px; background: rgba(255,255,255,.12); }
.pv-btn { height: 32px; min-width: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border: 0; border-radius: 8px; background: rgba(255,255,255,.07); color: #fff; font-size: 12.5px; }
.pv-btn:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.pv-btn:disabled { opacity: .35; }
.pv-btn.wide { padding: 0 12px; }
.pv-sel { height: 32px; max-width: 200px; background: rgba(255,255,255,.07); color: #fff; border-color: transparent; }
.pv-warn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: rgba(245,158,11,.15); color: #fbbf24; font-size: 12px; }
.pv-body { flex: 1; min-height: 0; position: relative; }
.pv-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #1b1b20; }
.pv-root.present .pv-bar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: .18; }
.pv-root.present .pv-bar:hover, .pv-root.present .pv-bar:focus-within { opacity: 1; }
.pv-root.present .pv-bar .pv-warn, .pv-root.present .pv-bar .grow { display: none; }
.top-play { color: #22c55e; }
.hub-mode { display: flex; align-items: center; gap: 7px; padding: 7px 10px; margin-bottom: 6px; border-radius: 9px; font-size: 11.5px; color: var(--muted); background: var(--panel-2); cursor: help; }
.hub-mode b { font-weight: 600; }
.hub-mode.local .ic { color: var(--accent); }
.hub-mode.cloud .ic { color: var(--success, #22c55e); }
.hub-mode.warn { color: #fbbf24; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.hub-mode.danger { color: #ff7b7b; background: color-mix(in srgb, #ef4444 14%, transparent); }
.hub-backup { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; margin-top: 2px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.hub-backup:hover { background: var(--panel-3); color: var(--text); }
.storage-banner { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 990; display: flex; align-items: center; gap: 10px; max-width: min(760px, calc(100vw - 24px)); padding: 10px 14px; border-radius: 12px; background: #3a1d1d; border: 1px solid #ef4444; color: #ffd7d7; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.storage-banner.warn { background: #3a2f12; border-color: #f59e0b; color: #ffeab0; }
.storage-banner .btn { flex: none; }
.busy-pill { position: fixed; right: 16px; bottom: 40px; z-index: 995; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 12.5px; color: var(--text); animation: fadeSlide .2s ease both; }
.busy-pill i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.corrupt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bk-list { margin: 8px 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.bk-last { margin: 6px 0 0; color: var(--faint); font-size: 12px; }
.corrupt-msg { max-height: 120px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); color: #ff9b9b; font: 11.5px/1.45 'JetBrains Mono', monospace; white-space: pre-wrap; }
.auth-forgot { justify-self: end; margin-top: -4px; border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.auth-forgot:hover, .auth-forgot:focus-visible { color: var(--accent); text-decoration: underline; }
.is-register .auth-forgot { display: none; }
/* ---- плагіни: дозволи, джерело, блокування ---- */
.pl-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0; font-size: 12.5px; }
.pl-facts dt { color: var(--muted); }
.pl-facts dd { margin: 0; overflow-wrap: anywhere; }
.pl-facts code, .pl-domains code { font: 11.5px/1.4 var(--mono, ui-monospace, monospace); background: var(--bg-2, rgba(127,127,127,.12)); padding: 1px 5px; border-radius: 5px; }
.pl-permlist { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; }
.pl-permlist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.pl-permlist li.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.pl-permlist b { display: block; font-size: 12.5px; }
.pl-permlist small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.pl-pi { color: var(--accent); padding-top: 2px; }
.pl-domains { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pl-warn.strong { color: var(--warn); font-weight: 600; }
.pl-note { color: var(--muted); font-size: 11.5px; margin: 6px 0 0; }
.pl-grants { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.pl-grant { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; cursor: pointer; }
.pl-grant.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.pl-grant input { margin: 0; accent-color: var(--accent); }
.pl-card.blocked { opacity: .75; }
.pl-top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.pl-top:empty { display: none; }
.pl-safe { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--warn); font-size: 12.5px; }
/* ---- підтримка ---- */
.sup-body .field-col { margin-bottom: 10px; }
.sup-body textarea.input { resize: vertical; min-height: 90px; font: inherit; }
.sup-diag { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.sup-diag input { margin-top: 3px; accent-color: var(--accent); }
.sup-diag b { display: block; font-size: 12.5px; }
.sup-diag small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.sup-preview { max-height: 200px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 8px; background: var(--bg-2, rgba(127,127,127,.1)); font: 11px/1.45 var(--mono, ui-monospace, monospace); white-space: pre-wrap; word-break: break-all; }
.sup-sec { display: flex; gap: 8px; color: var(--warn); font-size: 12px; margin: -4px 0 10px; }
.sup-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: 12.5px; }
.sup-list li { display: flex; gap: 8px; align-items: center; }
.sup-st { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg-2, rgba(127,127,127,.15)); }
.sup-st.st-pending { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sup-st.st-resolved, .sup-st.st-closed { color: var(--success); }
.env-badge { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 2000; padding: 2px 12px; border-radius: 0 0 8px 8px; background: #f59e0b; color: #1a1205; font: 700 11px/1.6 Inter, sans-serif; letter-spacing: .12em; pointer-events: none; }
/* ---- доступність (F-046): видимий фокус для всіх інтерактивних елементів ---- */
:is(button, select, input, textarea, a[href], summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible:not(.text-editor) { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.modal:focus { outline: none; }
.mobile-note { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 1500; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); font-size: 12.5px; line-height: 1.45; color: var(--text); }
.mobile-note .ic { color: var(--warn); flex: none; margin-top: 2px; }
.mobile-note p { margin: 0; flex: 1; }
.mobile-note button { flex: none; min-width: 32px; min-height: 32px; }
.auth-forgot { min-height: 28px; padding: 4px 2px; }
.pass-eye { min-width: 28px; min-height: 28px; top: 5px; right: 5px; }
@media (pointer: coarse) { .icon-btn.sm, .auth-forgot { min-width: 32px; min-height: 32px; } }
.auth-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 18px; font-size: 12.5px; }
.auth-legal a { color: var(--muted); text-decoration: none; padding: 4px 2px; min-height: 24px; }
.auth-legal a:hover { color: var(--text); text-decoration: underline; }
