/* Рабочий стол ОГМ: значки, записка «Парк сегодня», окна */
:root {
  --asphalt: #22262B;     /* стол */
  --asphalt-2: #2C3137;
  --grid: rgba(255,255,255,.045);
  --signal: #FF9A1F;      /* своя техника */
  --steel: #3E7BFA;       /* аренда */
  --paper: #F6F7F4;
  --ink: #1E2228;
  --red: #E5484D;
  --green: #2FA36B;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
.desk-body { margin: 0; font: 15px/1.45 var(--font); color: #fff; background: var(--asphalt); overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ── строка меню ── */
.menubar { position: fixed; inset: 0 0 auto 0; height: calc(34px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top) !important; z-index: 10000; display: flex; align-items: center; gap: 18px;
  padding: 0 14px; background: rgba(20, 23, 27, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07); font-size: 14px; }
.mb-logo { font-family: var(--display); font-weight: 700; letter-spacing: .02em; color: var(--signal); text-decoration: none; font-size: 15px; }
.mb-menu { display: flex; gap: 2px; }
.mb-menu button, .mb-user { background: none; border: 0; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: #E9ECEF; }
.mb-menu button:hover, .mb-user:hover { background: rgba(255,255,255,.1); }
.mb-right { margin-left: auto; display: flex; gap: 12px; align-items: center; color: #C9CED4; font-variant-numeric: tabular-nums; }

/* ── стол ── */
.desktop { position: fixed; inset: calc(34px + env(safe-area-inset-top)) 0 0 0; overflow: hidden;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(120% 90% at 70% 10%, var(--asphalt-2), var(--asphalt) 70%); }
/* единственное фоновое движение: медленно перетекающее пятно */
.blob { position: absolute; width: 62vmax; height: 62vmax; right: -18vmax; bottom: -26vmax; pointer-events: none;
  background: conic-gradient(from 0deg, var(--signal), #FF5F3D, var(--steel), #7FB2FF, var(--signal));
  filter: blur(80px); opacity: .32; border-radius: 42% 58% 61% 39% / 47% 39% 61% 53%;
  animation: morph 28s ease-in-out infinite alternate, spin 60s linear infinite; }
@keyframes morph { to { border-radius: 61% 39% 33% 67% / 58% 63% 37% 42%; } }
@keyframes spin { to { rotate: 360deg; } }

/* значки */
.icon { position: absolute; left: 20px; top: calc(18px + var(--i) * 108px); width: 104px; padding: 8px 4px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 1px solid transparent;
  border-radius: 10px; cursor: default; user-select: none; touch-action: none; }
.icon-img { width: 60px; height: 60px; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); transition: transform .12s; }
.icon-img svg { width: 100%; height: 100%; }
.icon-label { font-size: 13px; font-weight: 500; line-height: 1.25; text-align: center; padding: 1px 6px; border-radius: 5px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.icon-label small { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red);
  font-size: 11px; text-shadow: none; }
.icon:hover { background: rgba(255,255,255,.06); }
.icon.selected { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }
.icon.selected .icon-label { background: var(--steel); text-shadow: none; }
.icon.dragging { z-index: 9000; opacity: .9; }
.icon.dragging .icon-img { transform: scale(1.08); }

/* записка «Парк сегодня» */
.note { position: absolute; right: 28px; top: 22px; width: 300px; color: var(--ink); background: #FFE9A8;
  border-radius: 4px 4px 4px 18px; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 18px 40px -12px rgba(0,0,0,.55);
  rotate: -1.2deg; touch-action: none; }
.note-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px 6px; cursor: grab; }
.note-head b { font-family: var(--display); font-weight: 700; font-size: 15px; }
.note-head span { font-size: 13px; color: #7A6526; }
.note ul { list-style: none; margin: 0; padding: 0 8px; }
.note-row { width: 100%; display: grid; grid-template-columns: 10px 1fr; column-gap: 9px; align-items: center; text-align: left;
  background: none; border: 0; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.note-row:hover:not(:disabled) { background: rgba(0,0,0,.06); }
.note-row:disabled { cursor: default; }
.note-row i { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; background: var(--green); }
.n-name { font-weight: 600; }
.n-text { font-size: 13px; color: #5E5130; }
.st-half i { background: var(--signal); } .st-busy i { background: #8A7A4A; }
.st-closed i { background: var(--red); } .st-closed .n-text { color: #B4232A; font-weight: 600; }
.note-foot { margin: 6px 16px 12px; font-size: 12px; color: #7A6526; }
.note.dragging { cursor: grabbing; z-index: 9000; }

.hint-line { position: absolute; left: 20px; bottom: 12px; margin: 0; font-size: 12px; color: rgba(255,255,255,.45); }

/* ── окна ── */
.win { position: absolute; display: flex; flex-direction: column; min-width: 360px; min-height: 240px; max-width: 100%;
  background: var(--paper); color: var(--ink); border-radius: 12px; overflow: hidden; resize: both;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 30px 70px -20px rgba(0,0,0,.7);
  transform-origin: var(--ox, 50%) var(--oy, 50%); animation: win-open .22s cubic-bezier(.2,.9,.3,1.1); }
.win.closing { animation: win-close .16s ease-in forwards; }
@keyframes win-open { from { transform: scale(.2); opacity: 0; } }
@keyframes win-close { to { transform: scale(.2); opacity: 0; } }
.win.inactive { box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 16px 40px -18px rgba(0,0,0,.6); }
.win.inactive .win-bar { background: #DCE0E3; color: #6B7280; }
.win.maxed { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.win-bar { flex: none; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #E7EAEC;
  border-bottom: 1px solid #D3D7DB; cursor: grab; user-select: none; touch-action: none; }
.win-bar:active { cursor: grabbing; }
.win-dots { display: flex; gap: 7px; }
.wd { width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; }
.wd-close { background: var(--red); } .wd-max { background: var(--green); }
.wd:hover { filter: brightness(1.15); box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
.win-title { flex: 1; text-align: center; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-pop { color: inherit; text-decoration: none; opacity: .55; padding: 2px 6px; border-radius: 5px; }
.win-pop:hover { opacity: 1; background: rgba(0,0,0,.07); }
.win-body { position: relative; flex: 1; }
.win-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--paper); }
/* пока тащим окно — щит, чтобы iframe не перехватывал мышь */
.win-shield { position: absolute; inset: 0; display: none; }
.desktop.busy .win-shield { display: block; }

/* ── телефон: значки сеткой, без окон ── */
@media (max-width: 720px) {
  .desk-body { overflow: auto; }
  .desktop { position: static; min-height: calc(100vh - 34px); margin-top: calc(34px + env(safe-area-inset-top)); padding: 18px 12px 60px;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start; }
  .icon { position: static; width: auto; }
  .note { position: static; grid-column: 1 / -1; width: auto; rotate: 0deg; margin-top: 14px; }
  .note-head { cursor: default; }
  .mb-menu { display: none; }
  .hint-line, .blob { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .win, .win.closing { animation: none; }
}
