/* RudyOS — app layer: explorer, detail card, roulette and the small apps. */

.gf-a { fill: var(--icon-a); } .gf-b { fill: var(--icon-b); } .gf-c { fill: var(--icon-c); } .gf-d { fill: var(--icon-d); } .gf-e { fill: var(--icon-e); }
.gs-stroke { stroke: var(--icon-e); opacity: 0.85; } .gs-stroke-a { stroke: var(--icon-a); }
.flip-x { transform: scaleX(-1); }
.win { transform-origin: 0 0; }
.win-body { container-type: inline-size; }
.task-pins { display: none; }
.tray-desk { width: 14px; height: var(--taskbar-h); margin-left: 6px; border-left: 1px solid var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .tray-desk:hover { background: var(--surface-3); } }
@media (max-width: 759px) {
  .task-apps { display: none; }
  .task-pins { display: flex; flex: 1; justify-content: space-around; }
}

.app-scroll { height: 100%; overflow: auto; overscroll-behavior: contain; padding: 28px clamp(18px, 3.2vw, 38px) 40px; }
.app-h { margin: 0; font: 400 clamp(30px, 3.4vw, 46px)/1 var(--display-font); letter-spacing: var(--display-tracking); text-wrap: balance; }
.app-lead { margin: 10px 0 0; color: var(--text-2); max-width: 58ch; font-size: 14.5px; line-height: 1.5; }
.app-empty, .xp-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 60px 20px; color: var(--text-2); }
.app-empty .ico, .xp-empty .ico { font-size: 44px; color: var(--text-3); }
.app-empty h4, .xp-empty h3 { margin: 4px 0 0; font-size: 17px; font-weight: 600; color: var(--text); }
.app-empty p, .xp-empty p { margin: 0 0 8px; max-width: 42ch; }

.sk {
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-4) 50%, var(--surface-3) 100%);
  background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 6px;
}
.sk-line { display: block; height: 12px; width: 70%; margin-top: 8px; }
.sk-line.short { width: 40%; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── Explorer ───────────────────────────────────────────── */
.xp { container-type: inline-size; height: 100%; display: grid; grid-template-rows: auto auto auto 1fr auto; background: var(--surface); }
.xp-toolbar { display: flex; gap: 10px; align-items: center; padding: 10px 12px 8px; }
.xp-navbtns { display: flex; gap: 2px; }
.xp-nb { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); font-size: 17px; transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.xp-nb:disabled { opacity: 0.32; cursor: default; }
.xp-nb:not(:disabled):active { transform: scale(0.94); }
.xp-path {
  flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 1px; padding: 0 6px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; white-space: nowrap;
}
.xp-crumb { padding: 4px 7px; border-radius: 6px; font-size: 13px; color: var(--text-2); flex: none; }
.xp-crumb[aria-current='page'] { color: var(--text); font-weight: 600; }
.xp-crumb.is-query { color: var(--accent-2); }
.xp-crumb-sep { font-size: 11px; color: var(--text-3); flex: none; }
.xp-search { position: relative; width: clamp(200px, 26%, 330px); flex: none; }
.xp-search > .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; pointer-events: none; }
.xp-search input {
  width: 100%; height: 36px; padding: 0 34px 0 34px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; outline: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.xp-search input::placeholder { color: var(--text-3); }
.xp-search input:focus { border-color: var(--accent-line); background: var(--surface-3); }
.xp-search input::-webkit-search-cancel-button { filter: invert(0.6); }
.xp-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 500 11px var(--font-mono); color: var(--text-3); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.xp-search input:focus + kbd, .xp-search input:not(:placeholder-shown) + kbd { display: none; }
.xp-commands { display: flex; align-items: center; gap: 2px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.xp-cmd { height: 34px; padding: 0 10px; font-weight: 500; flex: none; }
.xp-cmd .caret { font-size: 11px; opacity: 0.6; }
.xp-cmd-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 6px; flex: none; }
.xp-cmd[data-cmd='lucky'] .ico { color: var(--accent); }
.xp-chips, .xp-phone-only { display: none; }
.xp-main { position: relative; min-height: 0; display: grid; grid-template-columns: 224px minmax(0, 1fr) 340px; }
.xp-tree { overflow: auto; overscroll-behavior: contain; padding: 8px 8px 18px; border-right: 1px solid var(--line); background: var(--surface-2); }
.tree-h { margin: 16px 10px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.tree-h:first-child { margin-top: 6px; }
.tree-item {
  width: 100%; height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  border-radius: 8px; font-size: 13.5px; color: var(--text-2); text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}
.tree-item .ico { font-size: 16px; flex: none; }
.tree-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item b { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tree-item.is-on { background: var(--accent-soft); color: var(--text); }
.tree-item.is-on .ico { color: var(--accent); }
.xp-content { min-height: 0; overflow: auto; overscroll-behavior: contain; }
/* ─── Персонализация ─────────────────────────────────────── */
.pers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 22px; }
.theme-card { display: grid; gap: 10px; align-content: start; padding: 10px 10px 14px; border-radius: 14px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); transition: border-color 150ms ease, transform 160ms var(--ease-out); }
.theme-card:active { transform: scale(0.98); }
.theme-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (hover: hover) and (pointer: fine) { .theme-card:not(.is-on):hover { border-color: var(--line-strong); } }
.theme-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--surface-3); }
.theme-thumb canvas { width: 100%; height: 100%; }
.theme-text { padding: 0 4px; }
.theme-text b { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; }
.theme-text small { display: block; margin-top: 4px; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.theme-state { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.theme-card.is-on .theme-state { color: var(--accent); }
.pers-options { margin-top: 24px; display: grid; gap: 8px; max-width: 760px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.switch-row b { display: block; font-size: 14px; font-weight: 600; }
.switch-row small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
input[role='switch'] { appearance: none; -webkit-appearance: none; margin: 0; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--surface-4); position: relative; cursor: pointer; transition: background-color 160ms ease; }
input[role='switch']::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 200ms var(--ease-out); }
input[role='switch']:checked { background: var(--accent); }
input[role='switch']:checked::before { transform: translateX(18px); }

/* ─── Диспетчер просмотров ───────────────────────────────── */
.tm { container-type: inline-size; height: 100%; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.tm-side { overflow: auto; padding: 12px 8px; border-right: 1px solid var(--line); background: var(--surface-2); display: grid; align-content: start; gap: 4px; }
.tm-tab { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: 10px; text-align: left; border: 1px solid transparent; transition: background-color 120ms ease, border-color 120ms ease; }
.tm-tab b { display: block; font-size: 14px; font-weight: 600; }
.tm-tab small { color: var(--text-3); font-size: 12px; }
.tm-tab.is-on { background: var(--accent-soft); border-color: var(--accent-line); }
@media (hover: hover) and (pointer: fine) { .tm-tab:not(.is-on):hover { background: var(--surface-3); } }
.tm-spark { width: 64px; height: 30px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); }
.tm-spark-area { fill: var(--accent); opacity: 0.22; }
.tm-spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tm-main { overflow: auto; overscroll-behavior: contain; padding: 24px clamp(18px, 3vw, 32px) 30px; display: grid; gap: 18px; align-content: start; }
.tm-loading { display: grid; gap: 16px; }
.tm-sk-graph { display: block; height: 220px; border-radius: 14px; }
.tm-graph-box { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tm-graph-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tm-graph-top h3, .tm-lower h3 { margin: 0; font-size: 14px; font-weight: 650; }
.tm-graph-top span { font-size: 12.5px; color: var(--text-3); }
.tm-graph { position: relative; height: clamp(170px, 26vh, 250px); border: 1px solid var(--accent-line); border-radius: 6px; overflow: hidden; background: linear-gradient(var(--accent-soft), transparent 75%); }
.tm-graph svg { width: 100%; height: 100%; }
.tm-grid { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tm-area { fill: var(--accent); opacity: 0.22; }
.tm-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 1; }
.tm-ymax { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--text-3); }
.tm-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.tm-hover { position: absolute; left: 0; top: 0; pointer-events: none; }
.tm-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tm-tip { position: absolute; left: 12px; top: -38px; white-space: nowrap; padding: 5px 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 12px; }
.tm-hover.is-left .tm-tip { left: auto; right: 12px; }
.tm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tm-kpis > div { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; align-content: start; min-width: 0; }
.tm-kpis small { color: var(--text-3); font-size: 12px; }
.tm-kpis b { font: 400 30px/1.1 var(--display-font); font-variant-numeric: tabular-nums; }
.tm-kpis em { font-style: normal; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.tm-lower > section { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.tm-genres ol, .tm-top ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-genres li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; align-items: center; gap: 10px; font-size: 13px; }
.tm-genres li span { display: block; }
.tm-genres li span::first-letter { text-transform: uppercase; }
.tm-genres i { height: 10px; border-radius: 999px; background: var(--accent); transform-origin: left; }
.tm-genres b { text-align: right; font-variant-numeric: tabular-nums; }
.tm-top button { width: 100%; display: grid; grid-template-columns: 22px 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px; border-radius: 10px; text-align: left; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .tm-top button:hover { background: var(--surface-3); } }
.tm-top img, .tm-top .cover-fallback { width: 40px; height: 60px; border-radius: 4px; object-fit: cover; font-size: 10px; }
.tm-place { font: 400 20px var(--display-font); color: var(--accent); text-align: center; }
.tm-top b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-top small { color: var(--text-3); font-size: 12px; }
@container (max-width: 720px) {
  .tm { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .tm-side { grid-auto-flow: column; grid-auto-columns: 190px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .tm-lower { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .dm-bar span, .sk, .zzz i, .stream-wait .ico { animation: none; }
  .rat img { animation: none; }
  .tape:hover .reel { animation: none; }
}
@keyframes pulse { 50% { opacity: 0.4; } }
