/* Noda — веб-пульт. Клавиши как на макропаде (продавливаются при нажатии),
   тёмный приборный интерфейс внутри разделов, скроллятся только внутренние области. */

:root {
  --element: #dad9e0;
  --element-dim: rgba(184, 182, 195, .62);
  --ink: #edecf2;
  --muted: #86848f;
  --dim: #5f5d68;
  --line: #26252e;
  --panel: #0e0e12;
  --panel-2: #131318;
  --panel-3: #181820;

  /* клавиша макропада — точь-в-точь как на пульте */
  --button-bg: linear-gradient(rgb(35, 34, 42), rgb(35, 34, 42));
  --button-shadow:
    rgba(255, 255, 255, .55) 0 1px 0 0 inset,
    rgba(255, 255, 255, .13) 0 3px 5px -3px inset,
    rgba(0, 0, 0, .85) 0 -1px 1px 0 inset,
    rgba(13, 12, 12, .34) 0 .5px .6px 0,
    rgba(13, 12, 12, .34) 0 2.9px 3.3px -.4px,
    rgba(13, 12, 12, .34) 0 5.5px 6.2px -.7px,
    rgba(13, 12, 12, .34) -.1px 9px 10.1px -1.1px,
    rgba(13, 12, 12, .34) -.1px 14.4px 16.2px -1.4px,
    rgba(13, 12, 12, .34) -.2px 22.5px 25.3px -1.8px;
  --button-active: rgba(0, 0, 0, .886) 0 1px 5px inset;

  --ok: #6fbf95;
  --warn: #e0a33e;
  --bad: #e07a86;
  --vib: linear-gradient(90deg, #ff4d63 0%, #ff806f 34%, #fff1d6 50%, #69c8ff 68%, #238dff 100%);
  --font: "Arimo", Helvetica, "Helvetica Neue", sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  height: 100dvh; padding: 6px; overflow: hidden;
  color: var(--element); background: #0d0d11; font-family: var(--font); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 9px; background: #313039; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #43424c; background-clip: content-box; }

/* ---------- клавиши ---------- */

.key {
  height: 36px; padding: 0 14px; border: 0; border-radius: 6px; color: var(--element);
  background: var(--button-bg); box-shadow: var(--button-shadow); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
  transition: filter .1s, translate .1s, box-shadow .1s;
}
.key:hover { filter: brightness(1.09); }
.key:active, .key.active { filter: brightness(.9); translate: 0 .5px; box-shadow: var(--button-active); }
.key:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.key.wide { width: 100%; }
.key.sm { height: 30px; padding: 0 10px; font-size: 10px; }
.key.tall { height: 44px; }
.key.light { color: #17161b; background: linear-gradient(#e2e1e6, #bab8c6); }
.key.round { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.key.square { width: 36px; padding: 0; }
.key svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible { outline: 2px solid #8fc9ff; outline-offset: 2px; }

/* ---------- вход ---------- */

.login-gate { height: calc(100dvh - 12px); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: radial-gradient(circle at 50% 35%, #2b2934 0, #15151b 42%, #08080b 76%); }
.login-console { width: min(430px, calc(100vw - 38px)); padding: 26px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: #09090c; box-shadow: 0 30px 70px rgba(0,0,0,.6); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 30px; color: #efeff3; font: 600 22px "Orbitron", sans-serif; letter-spacing: .08em; }
.login-brand > span:last-child > span { color: #a9a7b3; }
.login-console label { display: block; margin-bottom: 8px; color: #777582; font-size: 10px; letter-spacing: .09em; }
.login-input-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.login-input-row input { min-width: 0; height: 42px; padding: 0 13px; border: 1px solid #32313a; border-radius: 6px; outline: 0; color: #fff; background: #16151b; box-shadow: inset 0 3px 8px rgba(0,0,0,.55); }
.login-input-row .key { height: 42px; }
.login-console p { min-height: 16px; margin-top: 10px; color: var(--bad); font-size: 12px; }

/* ---------- каркас ---------- */

.hardware {
  height: calc(100dvh - 12px); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px;
  padding: 12px; border: 1px solid rgba(255,255,255,.06); border-radius: 14px;
  background: linear-gradient(150deg, #3a3845 0%, #29272f 38%, #0b0b0e 100%);
}
.brand-row { height: 42px; display: grid; grid-template-columns: 168px minmax(80px, 1fr) auto; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--element); text-decoration: none; font: 500 18px "Orbitron", sans-serif; letter-spacing: .07em; }
.brand > span:last-child > span { color: var(--element-dim); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: #070708; }
.brand-mark img { width: 28px; height: 28px; object-fit: contain; }
.vib { position: relative; height: 6px; }
.vib i { position: absolute; inset: 0; border-radius: 999px; background: var(--vib); }
.vib .blur { filter: blur(6px) brightness(1.7); opacity: .5; }
.top-right { display: flex; align-items: center; gap: 10px; }
.search { width: min(300px, 32vw); height: 34px; display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 9px; padding: 0 10px; border-radius: 6px; background: #08080a; box-shadow: inset 0 2px 6px rgba(0,0,0,.85); }
.search svg { width: 15px; fill: none; stroke: var(--element-dim); stroke-width: 1.8; stroke-linecap: round; }
.search input { min-width: 0; border: 0; outline: 0; color: var(--element); background: transparent; font-size: 13px; }
.search kbd { padding: 2px 6px; border-radius: 4px; color: #777582; background: #1c1b21; font-size: 10px; }

.body-grid { min-height: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 12px; }
.left-panel { display: flex; flex-direction: column; padding: 13px 11px; overflow: hidden; border-radius: var(--radius); background: #060607; }
.work-panel { min-width: 0; min-height: 0; overflow: hidden; border-radius: var(--radius); background: #0a0a0d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--element-dim); font-size: 9px; letter-spacing: .08em; }
.group-title i { height: 1px; flex: 1; background: rgba(172,170,187,.24); }
.nav-grid, .filter-grid { display: grid; gap: 11px; margin-bottom: 20px; }
.panel-bottom { margin-top: auto; }
.device-strip { display: grid; gap: 6px; }
.strip-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px; background: #0d0d11; color: #a9a7b3; font-size: 11px; }
.strip-row > span:not(.ic) { flex: 1; }
.strip-row.muted { color: #55535e; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #45444d; }
.dot.on { background: var(--ok); }

/* ---------- общее для разделов ---------- */

.view { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.bar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.bar-spacer { flex: 1; }
.bar h1 { color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px; }
.content { width: 100%; max-width: 980px; margin: 0 auto; }
.view-loading, .empty-note { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.view-error { margin: 14px; padding: 12px 14px; border: 1px solid #543036; border-radius: var(--radius); color: #ffb0b8; background: #1c1215; font-size: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.panel-body { padding: 10px 12px; }
.empty-line { padding: 14px 12px; color: var(--dim); font-size: 12px; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 7px; background: #08080a; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); }
.seg button { min-width: 70px; height: 28px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.seg button.active { color: var(--ink); background: rgb(35,34,42); box-shadow: var(--button-shadow); }

/* иконки записей */
.ic { width: var(--ic, 40px); height: var(--ic, 40px); flex: none; display: grid; place-items: center; overflow: hidden; border-radius: calc(var(--ic, 40px) / 3.6); }
.ic-brand { background: #fff; }
.ic-brand img { width: 76%; height: 76%; object-fit: contain; }
.ic-glyph { background: color-mix(in srgb, var(--tint) 18%, #101015); }
.ic-glyph svg { width: 56%; height: 56%; fill: none; stroke: var(--tint); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic-letter { color: #fff; background: var(--tint); font-weight: 700; font-size: calc(var(--ic, 40px) / 2.4); }
.ic-stack { position: relative; background: none; overflow: visible; }
.ic-stack img { position: absolute; width: 64%; height: 64%; padding: 2px; border: 1.5px solid #0e0e12; border-radius: 50%; object-fit: contain; background: #fff; }
.ic-stack img:nth-child(1) { left: 0; top: 0; z-index: 3; }
.ic-stack img:nth-child(2) { right: 0; top: 4%; z-index: 2; }
.ic-stack img:nth-child(3) { left: 18%; bottom: 0; z-index: 1; }

/* ---------- финансы ---------- */

.fin-bar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.period { display: flex; align-items: center; gap: 6px; }
.period strong { min-width: 150px; color: var(--ink); font-size: 14px; text-align: center; white-space: nowrap; }
.fin-total { display: flex; flex-direction: column; justify-content: center; margin-left: 2px; padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
.fin-total b { color: var(--ink); font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fin-total span { color: var(--dim); font-size: 11px; }
@media (max-width: 1180px) { .fin-total span { display: none; } .period strong { min-width: 120px; font-size: 13px; } }
.mic-key { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: radial-gradient(circle at 50% 28%, #ff8ea1, #e8566f 62%, #b93a51); box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 -2px 4px rgba(0,0,0,.5) inset, 0 6px 14px -4px rgba(0,0,0,.7); }
.mic-key svg { width: 18px; height: 18px; stroke: #fff; }
.mic-key:active { translate: 0 1px; box-shadow: 0 2px 6px rgba(0,0,0,.8) inset; }

/* недели видно сразу: полоса-акцент, название и итог */
.week-block + .week-block { margin-top: 22px; }
.week-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 9px 12px; border-radius: var(--radius); background: linear-gradient(90deg, #1b1a22, #121218); box-shadow: inset 0 0 0 1px #26252e; }
.week-mark { width: 3px; height: 18px; border-radius: 2px; background: linear-gradient(#ff7a4d, #ff4d63); }
.week-head strong { color: var(--ink); font-size: 14px; text-transform: capitalize; }
.week-count { color: var(--dim); font-size: 11px; }
.week-head b { margin-left: auto; color: #d6d4de; font-size: 14px; font-variant-numeric: tabular-nums; }
.week-block .day-block { padding-left: 10px; border-left: 1px solid #201f27; margin-left: 4px; }

.day-block + .day-block { margin-top: 12px; }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 4px 7px; color: var(--muted); font-size: 11px; }
.day-head b { color: #b6b4bf; font-weight: 500; font-variant-numeric: tabular-nums; }
.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; }
.row + .row { border-top: 1px solid #1c1b23; }
.row:hover { background: var(--panel-2); }
.row.settled { opacity: .45; }
.row-main { min-width: 0; }
.row-main strong { display: block; color: var(--ink); font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.row-sum { min-width: 92px; color: var(--ink); font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.row-check { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: #17161c; box-shadow: inset 0 0 0 1px #2c2b34; cursor: pointer; display: grid; place-items: center; }
.row-check svg { width: 15px; height: 15px; fill: none; stroke: #5f5d68; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.row-check:hover svg { stroke: var(--ok); }
.row-check.on { background: rgba(111,191,149,.16); box-shadow: inset 0 0 0 1px rgba(111,191,149,.4); }
.row-check.on svg { stroke: var(--ok); }
.row-who { padding: 2px 7px; border-radius: 999px; color: #9ccfff; background: rgba(109,191,255,.12); font-size: 10px; }
.empty-block { padding: 44px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.empty-block span { display: block; margin-top: 6px; color: var(--dim); font-size: 12px; }

/* быстрый каршеринг */
.car-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.car-tile { display: flex; align-items: center; gap: 11px; padding: 11px; border: 0; border-radius: 8px; background: var(--button-bg); box-shadow: var(--button-shadow); cursor: pointer; text-align: left; transition: filter .1s, translate .1s; }
.car-tile:hover { filter: brightness(1.09); }
.car-tile.active { filter: brightness(.92); translate: 0 .5px; box-shadow: var(--button-active), 0 0 0 1px rgba(143,201,255,.35) inset; }
.car-tile b { color: var(--ink); font-size: 13px; font-weight: 500; }

/* ---------- модалки и формы ---------- */

.modal-layer { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(4,4,7,.74); opacity: 0; transition: opacity .15s; }
.modal-layer.open { opacity: 1; }
.modal-card { width: min(var(--modal-width, 460px), 100%); max-height: 88dvh; overflow: auto; padding: 18px; border: 1px solid #2c2b34; border-radius: 12px; background: #101015; box-shadow: 0 40px 90px rgba(0,0,0,.75); }
.modal-card h2 { margin-bottom: 14px; color: var(--ink); font-size: 16px; }
.modal-text { color: #b0aeb9; font-size: 13px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.heard { margin-bottom: 12px; padding: 8px 11px; border-radius: 6px; color: #b9d8f2; background: rgba(109,191,255,.08); font-size: 12px; }
.preview { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.preview strong { display: block; color: var(--ink); font-size: 14px; }
.preview small { color: var(--muted); font-size: 11px; }
.preview b { margin-left: auto; font-size: 17px; font-variant-numeric: tabular-nums; }
.form { display: grid; gap: 11px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field { display: grid; gap: 6px; position: relative; }
.field > span:first-child { color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; height: 38px; padding: 0 11px; border: 0; border-radius: 6px; outline: 0; color: var(--ink); background: #08080a; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 3; margin-top: 4px; overflow: hidden; border: 1px solid #2f2e37; border-radius: 8px; background: #15151a; box-shadow: 0 18px 36px rgba(0,0,0,.65); }
.suggest button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 12px; }
.suggest button:hover { background: #1e1d25; }
.suggest small { margin-left: auto; color: var(--dim); font-size: 10px; }
.menu-list { display: grid; gap: 7px; }
.menu-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); cursor: pointer; text-align: left; }
.menu-item:hover { border-color: #3c3b46; }
.menu-item b { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.menu-item small { color: var(--muted); font-size: 11px; }
.menu-item.danger b { color: #ffb0b8; }

/* ---------- диктовка ---------- */

.voice-panel {
  position: fixed; left: 50%; bottom: 22px; z-index: 50; width: min(460px, calc(100vw - 40px));
  translate: -50% 18px; opacity: 0; transition: opacity .16s, translate .16s;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center;
  padding: 13px 15px; border: 1px solid #302f39; border-radius: 14px; background: #101015;
  box-shadow: 0 28px 60px rgba(0,0,0,.8);
}
.voice-panel.open { opacity: 1; translate: -50% 0; }
.voice-wave { grid-column: 1 / -1; width: 100%; height: 46px; }
.voice-title { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; }
.voice-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8566f; animation: pulse 1.1s infinite; }
.voice-dot.busy { background: #6dbfff; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.voice-timer { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.voice-hint { margin-top: 2px; color: var(--muted); font-size: 11px; }
.voice-hint.warn { color: var(--warn); }
.voice-actions { display: flex; gap: 7px; }

/* ---------- помощник ---------- */

.chat-feed { flex: 1; min-height: 0; overflow: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 7px; }
.chat-day { align-self: center; margin: 8px 0; padding: 3px 10px; border-radius: 999px; color: var(--dim); background: #141419; font-size: 11px; }
.bubble { position: relative; max-width: min(620px, 76%); padding: 8px 44px 8px 12px; border-radius: 12px; color: #d9d7e0; background: #17171d; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; color: #e9f3fb; background: #23303c; }
.bubble.theirs { align-self: flex-start; }
.bubble code { padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.32); font-family: ui-monospace, monospace; font-size: 12px; }
.bubble-time { position: absolute; right: 10px; bottom: 6px; font-size: 10px; opacity: .5; }
.bubble.typing { display: flex; gap: 5px; padding: 13px; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: #6b6975; animation: blink 1.2s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .2s; }
.bubble.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-empty { margin: auto; display: grid; justify-items: center; gap: 7px; color: var(--muted); text-align: center; }
.chat-empty img { width: 48px; height: 48px; border-radius: 12px; }
.chat-empty strong { color: var(--ink); font-size: 15px; }
.chat-empty span { max-width: 400px; font-size: 12px; }
.composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.composer textarea { min-height: 36px; max-height: 150px; padding: 8px 11px; border: 0; border-radius: 7px; outline: 0; resize: none; color: var(--ink); background: #08080a; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); line-height: 1.45; }

/* карточка записи в переписке */
.chat-card { align-self: flex-start; width: min(430px, 88%); margin: 4px 0 6px; padding: 12px; border-radius: 12px; background: #15151b; box-shadow: inset 0 0 0 1px #2b2a33; }
.chat-card.done { opacity: .6; }
.chat-card-top { display: flex; align-items: center; gap: 11px; }
.chat-card-top strong { display: block; color: var(--ink); font-size: 14px; }
.chat-card-top small { color: var(--muted); font-size: 11px; }
.chat-card-top b { margin-left: auto; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.chat-card-actions { display: flex; gap: 7px; margin-top: 11px; }
.chat-card-actions .key { flex: 1; }

/* ---------- заметки ---------- */

.notes-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.notes-rail { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.notes-rail-head { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 8px; padding: 10px; }
.notes-rail-head input { height: 34px; padding: 0 10px; border: 0; border-radius: 6px; outline: 0; color: var(--ink); background: #08080a; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); font-size: 12px; }
.notes-list { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 10px; }
.note-item { width: 100%; display: block; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; }
.note-item:hover { background: var(--panel-2); }
.note-item.active { background: var(--panel-3); box-shadow: inset 0 0 0 1px #2f2e38; }
.note-item strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item span { display: block; margin-top: 3px; color: var(--dim); font-size: 10px; }
.note-page { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.note-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.note-state { color: var(--dim); font-size: 11px; }
.note-tools { display: flex; gap: 7px; }
.note-doc { flex: 1; min-height: 0; overflow: auto; padding: 20px; background: #0b0b0e; }
.note-sheet { width: 100%; max-width: 760px; margin: 0 auto; padding: 30px clamp(20px, 5%, 46px) 56px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px #1e1d25; }
.note-title { color: var(--ink); font-size: 28px; font-weight: 700; outline: 0; }
.note-blocks { margin-top: 12px; display: grid; gap: 2px; counter-reset: nb; }
[contenteditable][data-placeholder]:empty::before { content: attr(data-placeholder); color: #46454f; }
.nb { display: flex; align-items: flex-start; gap: 8px; padding: 2px 0; color: #c9c7d1; font-size: 15px; line-height: 1.6; }
.nb-body { flex: 1; outline: 0; }
.nb-h1 { color: var(--ink); font-size: 23px; font-weight: 700; margin-top: 10px; }
.nb-h2 { color: var(--ink); font-size: 18px; font-weight: 700; margin-top: 8px; }
.nb-h3 { color: #dedce6; font-size: 15px; font-weight: 600; }
.nb-quote { padding-left: 12px; border-left: 3px solid #33323c; color: #a5a3ae; font-style: italic; }
.nb-code { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #08080a; font-family: ui-monospace, monospace; font-size: 13px; white-space: pre-wrap; }
.nb-bullet::before { content: "•"; color: #63616d; }
.nb-number::before { counter-increment: nb; content: counter(nb) "."; color: #63616d; font-variant-numeric: tabular-nums; }
.nb-divider { padding: 9px 0; }
.nb-divider hr { flex: 1; border: 0; border-top: 1px solid #27262f; }
.nb-check { width: 17px; height: 17px; margin-top: 3px; border: 1.6px solid #464550; border-radius: 4px; background: transparent; cursor: pointer; }
.nb-todo.done .nb-check { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m5 13 4 4 10-10'/%3E%3C/svg%3E") center/12px no-repeat; }
.nb-todo.done .nb-body { color: #66646f; text-decoration: line-through; }
.note-hint { margin-top: 24px; color: #47464f; font-size: 11px; }
.note-hint b { color: #63616d; }
.note-blank { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.note-blank.small { height: auto; padding: 18px; font-size: 12px; }

/* ---------- файлы ---------- */

.drop { margin-bottom: 12px; padding: 12px; display: grid; place-items: center; border: 1px dashed #33323c; border-radius: var(--radius); color: var(--dim); background: var(--panel); font-size: 12px; }
.drop.drag { border-color: #6dbfff; color: #cfe8ff; background: rgba(109,191,255,.06); }
.row.file { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.row-thumb { width: 38px; height: 38px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: #14141a; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* галерея файлов */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.file-card { position: relative; overflow: hidden; border-radius: 10px; background: var(--panel); box-shadow: inset 0 0 0 1px #24232c; cursor: pointer; }
.file-card:hover { box-shadow: inset 0 0 0 1px #3a3945; }
.file-thumb { aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; background: #0b0b0e; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-loading { width: 22px; height: 22px; border: 2px solid #2c2b34; border-top-color: #6a6875; border-radius: 50%; animation: spin .8s linear infinite; }
.thumb-format { position: absolute; margin-top: 54px; padding: 1px 6px; border-radius: 4px; color: var(--dim); background: #17171d; font-size: 9px; font-style: normal; letter-spacing: .06em; }
.file-thumb { position: relative; }
@keyframes spin { to { rotate: 360deg; } }
.file-card figcaption { padding: 8px 10px 10px; }
.file-card strong { display: block; color: var(--ink); font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card span { color: var(--dim); font-size: 11px; }
.file-dl { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: rgba(10,10,13,.75); backdrop-filter: blur(4px); color: #d5d3dd; cursor: pointer; opacity: 0; transition: opacity .12s; }
.file-card:hover .file-dl { opacity: 1; }
.file-dl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tag { padding: 2px 8px; border-radius: 999px; color: var(--dim); background: #17171d; font-size: 10px; white-space: nowrap; }
.tag.ok { color: #93cfb0; background: rgba(111,191,149,.14); }

/* ---------- передача ---------- */

/* схема потоков: устройство ⇄ сервер */
.flow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-bottom: 12px; padding: 16px; border-radius: var(--radius); background: linear-gradient(160deg, #16161c, #0d0d11); box-shadow: inset 0 0 0 1px #23222b; }
.flow-node { display: grid; justify-items: center; gap: 6px; padding: 14px 10px; border-radius: 10px; background: #101015; box-shadow: inset 0 0 0 1px #23222b; }
.flow-node strong { color: var(--ink); font-size: 14px; }
.flow-node span { color: var(--dim); font-size: 11px; }
.flow-node.hot { box-shadow: inset 0 0 0 1px rgba(143,201,255,.3); }
.flow-link { display: grid; gap: 6px; justify-items: center; min-width: 120px; }
.flow-line { width: 100%; height: 1px; background: repeating-linear-gradient(90deg, #33323c 0 6px, transparent 6px 12px); }
.flow-arrow { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--dim); }
.flow-arrow.up.on { color: #9ad3ff; }
.flow-arrow.down.on { color: #ffd399; }

.tr-state { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tr-state .badge { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 20px; }
.tr-state.local .badge { color: #9ad3ff; background: rgba(109,191,255,.14); }
.tr-state.server .badge { color: #ffd399; background: rgba(224,163,62,.14); }
.tr-state.warn .badge { color: #ffb0b8; background: rgba(224,122,134,.14); }
.tr-state.ok .badge { color: #93cfb0; background: rgba(111,191,149,.14); }
.tr-state strong { display: block; color: var(--ink); font-size: 15px; }
.tr-state p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tr-btn { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 0; border-radius: var(--radius); background: var(--button-bg); box-shadow: var(--button-shadow); cursor: pointer; text-align: left; transition: filter .1s, translate .1s; }
.tr-btn:hover:not(:disabled) { filter: brightness(1.09); }
.tr-btn:active:not(:disabled) { filter: brightness(.9); translate: 0 .5px; box-shadow: var(--button-active); }
.tr-btn:disabled { opacity: .4; cursor: not-allowed; }
.tr-btn i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-style: normal; font-size: 17px; }
.tr-btn.up i { color: #9ad3ff; background: rgba(109,191,255,.14); }
.tr-btn.down i { color: #ffd399; background: rgba(224,163,62,.14); }
.tr-btn strong { display: block; color: var(--ink); font-size: 13px; }
.tr-btn small { color: var(--muted); font-size: 11px; }
.tr-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.tr-meta div { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.tr-meta span { display: block; color: var(--dim); font-size: 10px; }
.tr-meta b { display: block; margin-top: 3px; color: #c8c6d0; font-size: 12px; font-weight: 500; }
.tr-progress { margin-top: 12px; }
.tr-progress .line { height: 4px; overflow: hidden; border-radius: 999px; background: #1e1d25; }
.tr-progress .line i { display: block; height: 100%; background: linear-gradient(90deg, #ff5868, #62beff); transition: width .3s; }
.tr-progress span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.tr-changes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; padding: 10px 12px; }
.tr-change { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 6px; background: var(--panel-2); font-size: 12px; }
.tr-change strong { min-width: 0; overflow: hidden; color: #cdcbd5; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tr-change span { color: var(--dim); font-size: 11px; white-space: nowrap; }
.log-list { display: grid; gap: 3px; max-height: 190px; overflow: auto; padding: 10px 12px; }
.log-row { display: flex; gap: 9px; color: #a9a7b2; font-size: 11px; }
.log-row span { color: var(--dim); font-variant-numeric: tabular-nums; }
.log-row.ok { color: #93cfb0; }
.log-row.warn { color: #ffb0b8; }
.device-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; }
.device-row:hover { background: var(--panel-2); }
.device-row.active { background: var(--panel-3); box-shadow: inset 0 0 0 1px #2f2e38; }
.device-main { flex: 1; min-width: 0; }
.device-main strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; }
.device-main small { color: var(--muted); font-size: 11px; }

/* ---------- удалённый ПК ---------- */

.remote-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 232px; }
.remote-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #050506; outline: 0; }
.remote-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; cursor: none; }
.remote-stage.fit img { width: 100%; height: 100%; }
.remote-hint { display: grid; place-items: center; gap: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.remote-hint .frame { width: min(380px, 60%); aspect-ratio: 16/9; display: grid; place-items: center; padding: 18px; border: 5px solid #201f27; border-radius: 10px; background: #020203; color: var(--dim); font-size: 12px; }
.remote-stage.live .remote-hint { display: none; }
.remote-side { display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow: auto; border-left: 1px solid var(--line); background: var(--panel); }
.hint-list { padding-left: 15px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.state-chip { padding: 4px 10px; border-radius: 999px; color: var(--dim); background: #14141a; font-size: 11px; }
.state-chip.on { color: #93cfb0; background: rgba(111,191,149,.14); }
.state-chip.wait { color: #ffd399; background: rgba(224,163,62,.14); }
.remote-stage:fullscreen { background: #000; }
.remote-stage:fullscreen img { max-height: 100dvh; }

/* ---------- проекты ---------- */

/* проекты: сверху экран, снизу корпус с клавишами — как на пульте */
.view-case { display: grid; grid-template-rows: minmax(0, auto) minmax(0, 1fr); gap: 0; }
.hero.screen { margin: 12px; border-radius: 10px; background: #050506; box-shadow: inset 0 0 0 1px #1c1b23, 0 10px 30px -18px #000; }
.case { min-height: 0; overflow: auto; padding: 14px 16px 18px; background: linear-gradient(180deg, #2b2934 0%, #232128 42%, #1c1a21 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.case-rail { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: rgba(196,194,208,.55); font-size: 9px; letter-spacing: .12em; }
.case-rail i { height: 1px; flex: 1; background: rgba(255,255,255,.09); }

.hero { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.hero-head { display: flex; align-items: center; gap: 13px; }
.hero-head img { width: 50px; height: 50px; object-fit: contain; }
.hero-head p { color: var(--muted); font-size: 11px; }
.hero-head h1 { margin-top: 2px; color: var(--ink); font-size: 24px; }
.hero-text { margin-top: 12px; color: #adabb6; font-size: 13px; line-height: 1.55; }
.hero-stack { margin-top: 9px; color: var(--dim); font-size: 11px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: center; }
.hero-screens.phone { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-screens figure { overflow: hidden; border: 1px solid #23222b; border-radius: 6px; background: var(--panel-2); cursor: zoom-in; }
.hero-screens img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; aspect-ratio: 16/9; }
.hero-screens.phone img { aspect-ratio: 9/16; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.tile { display: flex; align-items: center; gap: 11px; padding: 10px; border: 0; border-radius: 7px; background: var(--button-bg); box-shadow: var(--button-shadow); cursor: pointer; text-align: left; transition: filter .1s, translate .1s; }
.tile:hover { filter: brightness(1.09); }
.tile:active, .tile.active { filter: brightness(.9); translate: 0 .5px; box-shadow: var(--button-active); }
.tile img { width: 40px; height: 40px; object-fit: contain; }
.tile strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; }
.tile small { color: var(--muted); font-size: 11px; }

/* ---------- уведомления и просмотр ---------- */

.toast { position: fixed; left: 50%; bottom: 20px; z-index: 60; padding: 10px 15px; border-radius: 8px; color: var(--element); background: #1e1d24; box-shadow: 0 18px 40px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,.06); opacity: 0; translate: -50% 12px; pointer-events: none; transition: .18s; font-size: 13px; }
.toast.show { opacity: 1; translate: -50% 0; }
.toast.warn { color: #ffd3d8; background: #271518; }
.lightbox { width: min(1400px, calc(100vw - 60px)); height: min(840px, calc(100dvh - 60px)); margin: auto; padding: 20px 58px 36px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: var(--element); background: #09090c; }
.lightbox::backdrop { background: rgba(2,2,4,.9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close, .lightbox-nav { position: absolute; border: 0; color: #d6d5dd; background: rgb(35,34,42); box-shadow: var(--button-shadow); cursor: pointer; }
.lightbox-close { width: 36px; height: 36px; top: 13px; right: 13px; border-radius: 6px; font-size: 23px; }
.lightbox-nav { width: 40px; height: 60px; top: calc(50% - 30px); border-radius: 6px; font-size: 30px; }
.lightbox-prev { left: 11px; }
.lightbox-next { right: 11px; }
#lightboxCount { position: absolute; left: 50%; bottom: 11px; translate: -50% 0; color: #6d6b76; font-size: 11px; }

/* ---------- адаптив ---------- */

@media (max-width: 1280px) {
  .hero { grid-template-columns: 1fr; }
  .remote-body { grid-template-columns: minmax(0, 1fr) 200px; }
}
@media (max-width: 900px) {
  body { height: auto; overflow: auto; padding: 0; }
  .hardware { height: auto; min-height: 100dvh; border-radius: 0; }
  .body-grid { grid-template-columns: 1fr; }
  .left-panel { overflow: visible; }
  .nav-grid { grid-template-columns: repeat(2, 1fr); }
  .work-panel { min-height: 72dvh; }
  .notes-split, .remote-body { grid-template-columns: 1fr; }
  .row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .row-time, .row-who { display: none; }
  .bar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
