:root {
  --bg: #f3f5f4;
  --surface: #fff;
  --sidebar: #101820;
  --sidebar-2: #18232d;
  --text: #172126;
  --muted: #708087;
  --line: #dfe5e3;
  --green: #19a96b;
  --green-dark: #108557;
  --green-soft: #e8f7f0;
  --red: #dc5656;
  --blue: #4a86e8;
  --purple: #8868db;
  --orange: #ee9155;
  --shadow: 0 10px 30px rgba(19, 37, 31, .06);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
body { background: var(--bg); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 25px 18px 20px; color: #d9e2e4; background: linear-gradient(180deg, var(--sidebar), #0d141a); display: flex; flex-direction: column; z-index: 20; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 41px; height: 41px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 14px; font-weight: 900; letter-spacing: -.5px; box-shadow: 0 7px 20px rgba(25,169,107,.25); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.4px; }
.brand small { color: #7f939c; font-size: 9px; letter-spacing: 1.8px; margin-top: 3px; }
.main-nav { display: grid; gap: 7px; }
.nav-item { border: 0; width: 100%; color: #899aa2; background: transparent; border-radius: 10px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; text-align: left; padding: 12px 13px; font-size: 14px; font-weight: 650; transition: .18s ease; }
.nav-item > span { font-size: 18px; color: #70838c; }
.nav-item b { font-size: 10px; min-width: 24px; padding: 3px 7px; border-radius: 20px; text-align: center; color: #70838c; background: #1d2a34; }
.nav-item:hover { color: #dce5e6; background: #162129; }
.nav-item.active { color: #fff; background: #1a2a31; box-shadow: inset 3px 0 var(--green); }
.nav-item.active > span { color: #43d696; }
.sidebar-foot { margin-top: auto; }
.security-note { border: 1px solid #24333c; border-radius: 11px; display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-bottom: 14px; }
.security-note > span { color: var(--green); font-size: 9px; margin-top: 4px; }
.security-note strong, .security-note small { display: block; }
.security-note strong { font-size: 11px; color: #b7c4c8; }
.security-note small { margin-top: 3px; font-size: 9px; color: #667a83; }
.back-link { display: block; padding: 8px 12px; color: #71848c; font-size: 11px; text-decoration: none; }
.back-link:hover { color: #fff; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { height: 74px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 15; }
.device-summary { display: flex; align-items: center; gap: 11px; min-width: 0; }
.device-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #8c9ba0; font-size: 13px; font-weight: 800; }
.device-summary strong, .device-summary small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-summary strong { font-size: 13px; }
.device-summary small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.connection-pill { display: flex; align-items: center; gap: 7px; color: #819096; font-size: 11px; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: #a5b0b3; }
.connection-pill.connected { color: var(--green-dark); }
.connection-pill.connected i { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.button { border: 0; border-radius: 9px; padding: 11px 16px; font-size: 12px; font-weight: 750; transition: .18s ease; white-space: nowrap; }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 6px 18px rgba(25,169,107,.18); }
.button.primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.secondary { color: #334147; background: #fff; border: 1px solid var(--line); }
.button.secondary:hover { background: #f7f9f8; border-color: #c9d3cf; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.content { padding: 34px; max-width: 1600px; margin: 0 auto; }
.view { display: none; animation: viewIn .22s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hero { min-height: 164px; border-radius: 16px; padding: 29px 32px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(40,196,130,.28), transparent 27%), linear-gradient(120deg, #122129, #1a3635); display: flex; align-items: center; justify-content: space-between; gap: 30px; box-shadow: var(--shadow); overflow: hidden; }
.eyebrow { color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: 1.6px; }
.hero h1 { margin: 8px 0 7px; font-size: clamp(27px, 3vw, 38px); line-height: 1.05; letter-spacing: -1.2px; }
.hero p { margin: 0; max-width: 620px; color: #aababc; font-size: 13px; line-height: 1.6; }
.hero-connect { min-width: 185px; background: #20b977 !important; }
.hero-connect span { margin-left: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 17px; }
.stat-card { min-height: 115px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; gap: 15px; align-items: flex-start; box-shadow: var(--shadow); }
.stat-card.accent { border-color: #bde8d5; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #f1f5f3; color: #53656c; font-size: 19px; }
.stat-card.accent .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-card small, .stat-card strong, .stat-card p { display: block; }
.stat-card small { color: #87969b; font-size: 8px; font-weight: 850; letter-spacing: 1.3px; }
.stat-card strong { margin-top: 8px; font-size: 19px; letter-spacing: -.5px; }
.stat-card p { margin: 4px 0 0; color: #92a0a5; font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 17px; margin-top: 17px; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.quick-panel, .activity-panel { min-height: 330px; padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-head h2 { margin: 6px 0 0; font-size: 17px; letter-spacing: -.35px; }
.text-button { color: var(--green-dark); background: none; border: 0; font-size: 10px; font-weight: 700; }
.quick-actions { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-actions > button { min-height: 95px; border: 1px solid #e8edeb; border-radius: 11px; background: #fbfcfc; padding: 14px; display: grid; grid-template-columns: 40px 1fr 10px; align-items: center; gap: 11px; text-align: left; color: var(--text); transition: .18s ease; }
.quick-actions > button:hover { border-color: #b9dcca; transform: translateY(-2px); background: #fff; box-shadow: 0 8px 22px rgba(23,51,41,.07); }
.quick-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; }
.quick-icon.green { color: var(--green); background: var(--green-soft); }
.quick-icon.blue { color: var(--blue); background: #eaf2ff; }
.quick-icon.purple { color: var(--purple); background: #f0edfc; }
.quick-icon.orange { color: var(--orange); background: #fff0e7; }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-size: 12px; }
.quick-actions small { color: #91a0a5; font-size: 9px; margin-top: 4px; }
.quick-actions b { color: #9aabab; font-size: 18px; }
.activity-list { height: 245px; overflow: auto; margin-top: 17px; }
.empty-activity { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #91a0a5; }
.empty-activity > span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--green); background: var(--green-soft); margin-bottom: 10px; }
.empty-activity strong { color: #66767c; font-size: 11px; }
.empty-activity p { font-size: 9px; margin: 5px 0 0; }
.activity-item { position: relative; padding: 10px 6px 10px 28px; border-bottom: 1px solid #eef1f0; }
.activity-item::before { content: ""; position: absolute; left: 7px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 11px; }
.activity-item small { margin-top: 3px; font-size: 9px; color: #94a0a4; }

.support-panel { margin: 0 0 22px; padding: 24px 28px; display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 28px; overflow: hidden; background: radial-gradient(circle at 90% 15%, rgba(25,169,107,.13), transparent 32%), var(--surface); }
.support-copy h2 { margin: 7px 0 8px; font-size: 21px; letter-spacing: -.5px; }
.support-copy p { max-width: 650px; margin: 0 0 17px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.support-link { display: inline-block; text-decoration: none; }
.support-qr { justify-self: end; width: 142px; color: #637278; text-align: center; text-decoration: none; font-size: 8px; line-height: 1.35; }
.support-qr img { width: 132px; height: 132px; display: block; margin: 0 auto 7px; padding: 7px; border: 1px solid #dce7e2; border-radius: 12px; background: #fff; box-shadow: 0 7px 24px rgba(18,53,40,.09); }
.support-en { display: none; }
html[lang="en"] .support-ru { display: none; }
html[lang="en"] .support-en.support-link { display: inline-block; }
html[lang="en"] .support-en.support-qr { display: block; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; margin: 5px 0 25px; }
.page-head h1 { margin: 7px 0 4px; font-size: 30px; letter-spacing: -1px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.apps-toolbar { padding: 14px; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.search-box { width: min(360px, 42%); height: 38px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: #f9fbfa; }
.search-box span { color: #819196; font-size: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 9px; background: #f0f3f2; }
.segmented button { border: 0; border-radius: 7px; background: transparent; color: #748389; padding: 7px 10px; font-size: 9px; font-weight: 700; }
.segmented button span { margin-left: 4px; color: #98a4a8; }
.segmented button.active { color: #17342a; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.05); }
.bulk-bar { display: none; position: sticky; top: 86px; z-index: 14; align-items: center; gap: 7px; margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: #173128; color: #fff; box-shadow: 0 10px 28px rgba(10,28,22,.22); font-size: 10px; overflow-x: auto; scrollbar-width: thin; }
.bulk-bar.visible { display: flex; }
.bulk-bar span { flex: 0 0 auto; margin-right: auto; white-space: nowrap; }
.bulk-bar button { flex: 0 0 auto; border: 1px solid #395248; border-radius: 7px; padding: 6px 9px; color: #dfeae6; background: #243f35; font-size: 9px; white-space: nowrap; }
.danger-text { color: var(--red) !important; }
.app-table-panel { margin-top: 14px; min-height: 390px; overflow: hidden; }
.table-scroll { overflow: auto; }
.app-table { width: 100%; border-collapse: collapse; }
.app-table th { padding: 12px 15px; color: #829096; background: #fafbfb; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; letter-spacing: .9px; text-transform: uppercase; }
.app-table td { padding: 12px 15px; border-bottom: 1px solid #edf1ef; font-size: 10px; }
.app-table tbody tr:hover { background: #fbfdfc; }
.app-cell { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.app-icon { flex: 0 0 auto; width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: #16734e; background: #e8f5ef; font-size: 12px; font-weight: 850; text-transform: uppercase; }
.app-icon img, .app-identity > span img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: contain; }
.app-cell strong, .app-cell small { display: block; }
.app-cell strong { font-size: 11px; }
.app-cell small { margin-top: 3px; color: #839196; font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.type-badge, .status-badge { display: inline-block; border-radius: 20px; padding: 5px 8px; font-size: 8px; font-weight: 750; }
.type-badge { color: #56686e; background: #f0f3f2; }
.type-badge.user { color: #3a6dae; background: #eaf2fc; }
.status-badge { color: var(--green-dark); background: var(--green-soft); }
.status-badge.disabled { color: #a36b2c; background: #fff2df; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button { border: 0; background: transparent; color: #738389; padding: 6px; font-size: 15px; }
.row-actions button:hover { color: var(--green-dark); }
.table-empty { display: flex; min-height: 335px; flex-direction: column; align-items: center; justify-content: center; color: #8c999e; }
.table-empty.hidden { display: none; }
.table-empty > span { font-size: 30px; color: #b4c0bc; }
.table-empty strong { margin-top: 12px; color: #5d6d72; font-size: 12px; }
.table-empty p { margin: 5px 0; font-size: 9px; }

.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 17px; }
.terminal { overflow: hidden; background: #101820; border-color: #17242c; min-height: 580px; display: flex; flex-direction: column; }
.terminal-bar { height: 46px; padding: 0 16px; color: #7e9198; background: #18232b; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font: 9px ui-monospace, Consolas, monospace; }
.terminal-bar > div { display: flex; gap: 6px; }
.terminal-bar i { width: 8px; height: 8px; border-radius: 50%; background: #e36b62; }
.terminal-bar i:nth-child(2) { background: #d9ac4d; }
.terminal-bar i:nth-child(3) { background: #4fbd75; }
.terminal-bar button { justify-self: end; color: #87989e; background: transparent; border: 0; font-size: 9px; }
.terminal-output { flex: 1; max-height: 485px; overflow: auto; padding: 18px; color: #c8d7d3; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.terminal-output p { margin: 0 0 6px; }
.terminal-output .command-line { color: #58d49d; }
.terminal-output .error-line { color: #ff8f87; }
.terminal-suggestions { max-height: 150px; overflow: auto; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid #27343b; background: #111b22; }
.terminal-suggestions[hidden] { display: none; }
.terminal-suggestions button { border: 1px solid #304149; border-radius: 6px; padding: 5px 8px; color: #a9c5bc; background: #18252c; font: 9px ui-monospace, Consolas, monospace; }
.terminal-suggestions button:hover { color: #fff; border-color: #3d9470; background: #1c382f; }
.terminal-suggestions small { align-self: center; color: #73878d; font-size: 8px; }
.muted-line { color: #60757c; }
.terminal-input-row { height: 56px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border-top: 1px solid #27343b; background: #141f26; }
.terminal-input-row > span { color: #4bd397; font: 14px ui-monospace, monospace; }
.terminal-input-row input { flex: 1; min-width: 0; border: 0; outline: 0; color: #e0e8e6; background: transparent; font: 11px ui-monospace, Consolas, monospace; }
.terminal-input-row button { border: 0; border-radius: 7px; padding: 8px 11px; color: #fff; background: var(--green); font-size: 9px; font-weight: 700; }
.terminal-input-row .tab-button { color: #9eb4ad; border: 1px solid #34464e; background: #1a2830; font: 9px ui-monospace, Consolas, monospace; }
.terminal-input-row .tab-button:hover { color: #fff; border-color: #4a9a78; }
.presets-panel { padding: 20px; }
.presets-panel > button { width: 100%; border: 0; border-bottom: 1px solid #edf0ef; padding: 14px 3px; display: grid; grid-template-columns: 30px 1fr; gap: 9px; color: var(--text); background: transparent; text-align: left; }
.presets-panel > button > span { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.presets-panel strong, .presets-panel small { display: block; }
.presets-panel strong { font-size: 10px; }
.presets-panel small { margin-top: 3px; color: #8b999e; font: 8px ui-monospace, Consolas, monospace; }

.live-switch { display: flex; align-items: center; gap: 8px; color: #617178; font-size: 10px; cursor: pointer; }
.live-switch input { display: none; }
.live-switch > span { width: 34px; height: 19px; border-radius: 20px; background: #cdd6d3; position: relative; transition: .2s; }
.live-switch > span::after { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; left: 3px; top: 3px; background: #fff; transition: .2s; }
.live-switch input:checked + span { background: var(--green); }
.live-switch input:checked + span::after { transform: translateX(15px); }
.screen-fit-controls { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f4f7f6; }
.screen-fit-controls button { border: 0; border-radius: 6px; padding: 7px 9px; color: #718087; background: transparent; font-size: 9px; font-weight: 700; white-space: nowrap; }
.screen-fit-controls button.active { color: #176849; background: #fff; box-shadow: 0 1px 5px rgba(15, 37, 29, .12); }
.screen-layout { display: grid; grid-template-columns: minmax(360px, 1fr) 300px; gap: 17px; }
.device-stage { min-height: 650px; padding: 28px; display: flex; flex-direction: column; align-items: center; background: #e9eeec; }
.device-frame { --screen-aspect: .5625; position: relative; width: min(340px, 100%); aspect-ratio: 9 / 16; padding: 9px; border-radius: 30px; background: #0b1115; box-shadow: 0 25px 55px rgba(7,16,20,.25), inset 0 0 0 1px #3a454a; overflow: hidden; }
.device-stage.mode-fit .device-frame { width: min(100%, calc((100vh - 220px) * var(--screen-aspect))); max-width: 960px; }
.device-stage.mode-width .device-frame { width: 100%; max-width: none; }
.device-notch { position: absolute; z-index: 3; top: 14px; left: 50%; width: 62px; height: 6px; transform: translateX(-50%); border-radius: 5px; background: #05090b; }
.device-frame canvas { display: none; width: 100%; height: 100%; object-fit: contain; border-radius: 22px; background: #020303; cursor: crosshair; touch-action: none; user-select: none; }
.device-frame.landscape { width: min(760px, 100%); }
.device-frame.landscape .device-notch { display: none; }
.device-frame.wide { border-radius: 22px; }
.device-frame.wide canvas, .device-frame.wide .screen-placeholder { border-radius: 14px; }
.device-frame canvas.visible { display: block; }
.screen-placeholder { height: 100%; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #63757c; background: linear-gradient(145deg, #17242b, #10191e); text-align: center; }
.screen-placeholder.hidden { display: none; }
.screen-placeholder > span { font-size: 34px; color: #3c5555; }
.screen-placeholder strong { margin-top: 12px; color: #8ca0a4; font-size: 12px; }
.screen-placeholder p { max-width: 180px; font-size: 9px; line-height: 1.5; }
.screen-hint { margin: 17px 0 0; color: #7f8d92; font-size: 9px; }
.remote-panel { padding: 21px; }
.remote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.remote-grid button { border: 1px solid #e1e7e4; border-radius: 9px; padding: 12px 7px; color: #56676d; background: #fbfcfc; font-size: 9px; font-weight: 700; }
.remote-grid button span { display: block; color: var(--green); font-size: 18px; margin-bottom: 5px; }
.remote-grid button:hover { border-color: #aad8c3; background: var(--green-soft); }
.remote-text { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.remote-text > label { display: block; margin-bottom: 7px; color: #64757b; font-size: 9px; font-weight: 750; }
.remote-text > div { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.remote-text input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 9px 10px; font-size: 10px; }
.remote-text button { border: 0; padding: 0 10px; color: #fff; background: var(--green); font-size: 9px; font-weight: 750; }
.remote-text small { display: block; margin-top: 6px; color: #96a2a6; font-size: 8px; }
.screen-meta { display: grid; gap: 12px; margin: 24px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.screen-meta > div { display: flex; justify-content: space-between; gap: 10px; }
.screen-meta span { color: #839196; font-size: 9px; }
.screen-meta strong { font-size: 9px; }
.info-box { padding: 12px; border-radius: 9px; color: #5f7770; background: var(--green-soft); font-size: 9px; line-height: 1.55; }
.stream-error { margin-top: 10px; padding: 12px; border-radius: 9px; color: #9f352f; background: #fff0ee; font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.stream-error[hidden] { display: none; }
.device-stage:fullscreen { min-height: 100vh; padding: 0; border-radius: 0; justify-content: center; background: #000; }
.device-stage:fullscreen .device-frame { width: min(100vw, calc(100vh * var(--screen-aspect))); max-width: none; padding: 0; border-radius: 0; box-shadow: none; }
.device-stage:fullscreen .device-notch, .device-stage:fullscreen .screen-hint { display: none; }
.device-stage:fullscreen .device-frame canvas { border-radius: 0; }

.files-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.transfer-card { min-height: 270px; padding: 29px; text-align: center; }
.transfer-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; margin: 0 auto 16px; color: var(--green); background: var(--green-soft); font-size: 24px; }
.transfer-card h2 { margin: 0; font-size: 16px; }
.transfer-card p { color: var(--muted); font-size: 10px; margin: 8px 0 22px; }
.path-input { display: flex; text-align: left; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; margin: 0 auto 12px; max-width: 440px; }
.path-input span { color: #8a989d; font-size: 8px; padding-right: 9px; border-right: 1px solid var(--line); }
.path-input input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 7px 9px; font: 9px ui-monospace, Consolas, monospace; }
.transfer-progress { display: none; width: 70%; height: 5px; margin: 20px auto 0; border-radius: 5px; background: #e7ecea; overflow: hidden; }
.transfer-progress.visible { display: block; }
.transfer-progress i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.file-help { margin-top: 17px; padding: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-help strong { font-size: 10px; }
.file-help code { color: #38735d; background: var(--green-soft); padding: 6px 8px; border-radius: 6px; font-size: 9px; }
.file-help p { margin: 0 0 0 auto; color: var(--muted); font-size: 9px; }

.app-dialog { width: min(780px, calc(100vw - 32px)); max-height: 82vh; padding: 0; border: 0; border-radius: 15px; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.app-dialog::backdrop { background: rgba(9,17,20,.55); backdrop-filter: blur(3px); }
.dialog-shell { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.app-identity { display: flex; align-items: center; gap: 12px; }
.app-identity > span { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; color: #16734e; background: var(--green-soft); font-weight: 850; }
.app-identity h2 { margin: 0; font-size: 17px; }
.app-identity p { margin: 4px 0 0; color: #75858b; font: 9px ui-monospace, Consolas, monospace; }
.dialog-close { border: 0; background: transparent; color: #7e8b90; font-size: 23px; }
.dialog-actions { display: flex; gap: 7px; margin: 20px 0 14px; flex-wrap: wrap; }
.dialog-actions button { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: #54666c; background: #fff; font-size: 9px; font-weight: 700; }
.dialog-actions button:hover { background: #f5f8f6; }
.app-dialog pre { max-height: 45vh; overflow: auto; margin: 0; padding: 15px; border-radius: 9px; color: #cbd8d5; background: #111a20; font: 9px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.backup-dialog { width: min(780px, calc(100vw - 28px)); max-height: 88vh; padding: 0; border: 0; border-radius: 15px; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.backup-dialog::backdrop { background: rgba(9,17,20,.6); backdrop-filter: blur(3px); }
.backup-shell { padding: 23px; }
.backup-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.backup-head h2 { margin: 4px 0 0; font-size: 18px; }
.backup-head > strong { color: var(--green); font-size: 12px; white-space: nowrap; }
.backup-progress { height: 7px; margin: 18px 0; border-radius: 8px; background: #e6ece9; overflow: hidden; }
.backup-progress i { display: block; width: 0; height: 100%; background: var(--green); transition: width .2s; }
.backup-counters { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; }
.backup-counters > div { padding: 12px; border-radius: 9px; background: #f4f7f6; }
.backup-counters span, .backup-current span { display: block; color: #849297; font-size: 8px; }
.backup-counters strong { display: block; margin-top: 3px; font-size: 17px; }
.backup-current { margin: 12px 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.backup-current code { display: block; margin-top: 5px; color: #50646b; font-size: 9px; overflow-wrap: anywhere; }
.backup-results { height: min(300px, 34vh); overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.backup-result { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 8px; padding: 8px 10px; border-bottom: 1px solid #edf1ef; }
.backup-result > span { color: var(--green); font-weight: 800; }
.backup-result.skip > span { color: #cb604f; }
.backup-result strong, .backup-result small { display: block; overflow-wrap: anywhere; }
.backup-result strong { color: #53666c; font: 9px ui-monospace, Consolas, monospace; }
.backup-result small { margin-top: 2px; color: #8b999e; font-size: 8px; }
.backup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }

.language-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.08); }
.language-switch a { min-width: 31px; padding: 6px 7px; border-radius: 5px; color: #839197; font-size: 9px; font-weight: 800; text-align: center; text-decoration: none; }
.language-switch a.active { color: #fff; background: var(--green); }
.sidebar-foot .language-switch { margin-bottom: 13px; border-color: rgba(255,255,255,.14); }
.sidebar-foot .language-switch a { color: #9eada9; }
.top-language-switch { display: none; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border: 1px solid #cbe6da; border-radius: 10px; background: #fff; box-shadow: 0 15px 40px rgba(0,0,0,.14); animation: toastIn .2s ease; font-size: 10px; }
.toast.error { border-color: #f0c9c9; }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { color: #77868b; margin-top: 4px; line-height: 1.4; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.busy-overlay { position: fixed; inset: 0; z-index: 90; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 13px; color: #fff; background: rgba(10,18,21,.45); backdrop-filter: blur(2px); }
.busy-overlay.visible { display: flex; }
.busy-overlay strong { font-size: 11px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { width: 76px; padding: 22px 10px; }
  .brand { padding: 0 7px 28px; }
  .brand > span:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { grid-template-columns: 1fr; place-items: center; padding: 13px 8px; }
  .nav-item > span { font-size: 19px; }
  .nav-item b, .sidebar-foot { display: none; }
  .workspace { grid-column: 2; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .console-layout, .screen-layout { grid-template-columns: 1fr; }
  .presets-panel, .remote-panel { min-height: auto; }
  .top-language-switch { display: inline-flex; }
}

@media (max-width: 700px) {
  .device-stage.mode-fit .device-frame { width: 100%; max-width: 100%; }
  .screen-fit-controls { width: 100%; }
  .screen-fit-controls button { flex: 1; }
}

@media (max-width: 700px) {
  .app-shell { display: block; padding-bottom: 67px; }
  .sidebar { inset: auto 0 0; width: auto; height: 67px; padding: 8px; display: block; }
  .brand, .sidebar-foot { display: none; }
  .main-nav { height: 100%; grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .nav-item, .nav-item.active { box-shadow: none; font-size: 8px; padding: 5px 2px; grid-template-columns: 1fr; gap: 1px; text-align: center; }
  .nav-item > span { font-size: 16px; }
  .nav-item b { display: none; }
  .workspace { display: block; }
  .topbar { height: 64px; padding: 0 15px; }
  .connection-pill { display: none; }
  .top-language-switch { display: inline-flex; }
  .top-actions .button { padding: 9px 11px; font-size: 10px; }
  .content { padding: 20px 14px; }
  .hero { padding: 23px; display: block; }
  .hero-connect { margin-top: 20px; }
  .stats-grid, .files-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .support-panel { grid-template-columns: 1fr; text-align: center; padding: 24px 20px; }
  .support-copy p { margin-inline: auto; }
  .support-qr { justify-self: center; }
  .page-head { display: block; }
  .page-actions { margin-top: 15px; flex-wrap: wrap; }
  .apps-toolbar { display: block; }
  .search-box { width: 100%; }
  .segmented { overflow-x: auto; margin-top: 10px; }
  .app-table th:nth-child(3), .app-table td:nth-child(3) { display: none; }
  .bulk-bar { top: 72px; margin-inline: -4px; }
  .device-stage { min-height: 560px; padding: 18px; }
}
