/* Новый интерфейс: окно взаимодействия, КПК, мини-карта и компас, навыки, корпус, статусы.
   Окна создаются из client/src/ui.rs (init_dom). Стиль — как у HUD: тёмные панели, пиксельные заголовки. */

/* ---- свои статусы под полосками ---- */
#ui-st { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
#ui-st:empty { display: none; }
.st { display: inline-block; font-size: 10px; line-height: 14px; padding: 0 5px; border-radius: 3px; background: #241e44; color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.st.ok { color: #3cff9e; border-color: #1a6a4a; background: #0e2a1e; }
.st.bad { color: #ff6a6a; border-color: #7a2a2a; background: #2a0e12; }
.st.warn { color: #ffc05a; border-color: #7a5a1a; background: #2a1e0a; }
.st.dim { color: var(--dim); }
.st.cyan { color: var(--cyan); border-color: #1a5a6a; }
.gold { color: var(--gold); }
.bad { color: #ff6a6a; }

/* ---- компас и мини-карта ---- */
#ui-compass { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); width: min(340px, 52vw); height: 38px; pointer-events: none; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
#ui-compass canvas { width: 100%; height: 100%; display: block; }
#ui-mm { position: absolute; right: max(8px, env(safe-area-inset-right, 0px)); top: 112px; box-sizing: border-box; width: 132px; height: 132px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px #000; cursor: pointer; }
#ui-mm canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#ui-mm-z { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; text-align: center; background: rgba(0,0,0,0.6); color: var(--cyan); pointer-events: none; }
#ui-body { position: absolute; left: 186px; top: 8px; background: rgba(10, 8, 20, 0.7); border: 2px solid var(--line); border-radius: 6px; padding: 2px; cursor: pointer; }
#ui-body canvas { width: 40px; height: 56px; display: block; image-rendering: pixelated; }
#ui-air { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); background: rgba(10, 8, 20, 0.85); border: 2px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; }
#ui-down { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); background: rgba(40, 6, 10, 0.88); border: 3px solid #ff4a4a; border-radius: 10px; padding: 14px 18px; text-align: center; z-index: 3; }
#ui-down b { font-family: "Press Start 2P", monospace; font-size: 14px; color: #ff6a6a; display: block; margin-bottom: 8px; }
#ui-down button { margin-top: 10px; }
#ui-down:has(.recovery-state) { background: rgba(6, 32, 26, .95); border-color: #58d9a7; }
#ui-down .recovery-state b { color: #73f0bf; }
#medical-invite { position: fixed; top: 15%; left: 50%; width: min(340px, calc(100vw - 24px)); transform: translateX(-50%); padding: 12px; z-index: 34; }
.medical-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#medical-invite button { flex: 1; min-height: 44px; }
#medical-chart > button { min-height: 44px; margin-top: 8px; }
.medical { min-width: 0; padding-bottom: 6px; }
.medical header { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid #58d9a7; border-radius: 6px; }
.medical header strong { color: #73f0bf; font-size: 16px; }
.medical h3 { margin: 14px 0 7px; font-size: 13px; color: var(--gold); }
.medical small { display: block; color: var(--dim); overflow-wrap: anywhere; }
.medical-result { padding: 8px; border-radius: 5px; background: rgba(88, 217, 167, .10); }
.medical-vitals { list-style: none; padding: 0; margin: 0; }
.medical-vitals li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(36px, 20%) 37px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.medical-vitals meter { width: 100%; min-width: 0; accent-color: #58d9a7; }
.medical-vitals b { text-align: right; }
.medical-procedures { display: grid; gap: 7px; }
.medical-procedures article { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.medical-procedures article > div { min-width: 0; }
.medical-procedures button { min-height: 44px; flex: 0 0 auto; }
.medical-procedures button:disabled { opacity: .48; }
.medical .medical-block { color: #ffc58c; }
.medical-donation { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid #ffc58c; border-radius: 6px; }
.medical-donation h3 { margin: 0 0 6px; }
.medical-donation label, .medical-donation output { display: block; margin-top: 8px; }
.medical-donation input[type="range"] { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: #58d9a7; touch-action: none; }
.medical-donation button { min-height: 44px; width: 100%; margin-top: 8px; }
.medical-donation button:disabled { opacity: .48; }
.clinical { margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.clinical h3 { margin: 0 0 8px; }
.clinical-view { background: rgba(10,20,32,.7); border-radius: 5px; }
#clinical-model { display: block; width: 100%; height: clamp(140px, 28dvh, 230px); object-fit: contain; cursor: pointer; }
.clinical-turn { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.clinical-turn button { min-width: 48px; }
.clinical-turn button, .clinical-zones button { min-height: 42px; }
.clinical-zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.clinical-zones button { overflow-wrap: anywhere; }
.clinical-zones [data-severity="1"] { border-color: #c7a759; }
.clinical-zones [data-severity="2"] { border-color: #d78059; }
.clinical-zones [data-severity="3"] { border-color: #ed6782; }
.clinical-zones button[aria-pressed="true"] { background: #1c4a59; color: #e1fcff; }
#clinical-findings { padding-top: 8px; }
#clinical-findings ul { padding-left: 20px; }
#combat-feedback { position: fixed; top: max(60px, 12vh); left: 50%; transform: translateX(-50%); z-index: 10;
    max-width: calc(100vw - 24px); padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
    background: rgba(15,12,28,.88); color: #e6f2fa; white-space: nowrap; pointer-events: none; }
#ui-pop { position: absolute; right: 8px; top: 108px; z-index: 6; max-height: calc(100vh - 130px); overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 3px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 0 0 3px #000; width: min(300px, calc(100vw - 16px)); }
#ui-pop button { text-align: left; }
kbd { font-size: 11px; background: #120f22; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--dim); }

/* ---- общие окна ---- */
.uiw { position: fixed; z-index: 14; background: var(--panel); border: 3px solid var(--line); border-radius: 10px; box-shadow: 0 0 0 3px #000, 0 10px 30px #000; display: flex; flex-direction: column; }
.uiw button { padding: 6px 9px; font-size: 13px; }
.uiw button.ok { border-color: #1a8a5a; }
.uiw button.bad { border-color: #8a2a2a; }
.uiw button.warn { border-color: #8a6a1a; }
.uiw button.cyan { border-color: #1a7a8a; }
.uiw button.cx { padding: 4px 9px; }
.uiw input.sm { width: 110px; padding: 5px; font-size: 13px; }
.uiw .sec { color: var(--gold); margin: 12px 0 6px; font-weight: bold; }
.uiw label { margin: 8px 0 3px; }
.emb { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; border: 1px solid #000; }
.crow, .row { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.crow input, .row input { flex: 1; }

/* ---- окно взаимодействия ---- */
#sess { left: 12px; bottom: calc(76px + var(--safe-b)); width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 150px); overflow-y: auto; touch-action: pan-y; }
#sess > * { flex: none; }
.sw-head { display: flex; gap: 10px; padding: 8px 10px; border-bottom: 2px solid var(--line); align-items: flex-start; position: sticky; top: 0; background: #100e1e; z-index: 1; }
#sess-face { width: 48px; height: 72px; image-rendering: pixelated; background: #000; border: 2px solid #fff; flex: none; }
.sw-who { flex: 1; min-width: 0; }
.sw-who .nm { font-family: "Press Start 2P", monospace; font-size: 11px; }
.sw-sub { font-size: 12px; color: var(--dim); margin: 4px 0; }
.sw-hints { display: flex; flex-wrap: wrap; gap: 3px; }
.sw-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 10px 0; }
.sw-tabs:empty { display: none; }
.sw-tabs button { padding: 3px 7px; font-size: 12px; }
#sess-invite:empty { display: none; }
/* приглашение к разговору: плашка сверху по центру, без карточки и журнала */
#sess.inviting { top: calc(8px + var(--safe-t, 0px)); bottom: auto; left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 24px)); max-height: 40vh; }
#sess.inviting .sw-card, #sess.inviting #sess-log, #sess.inviting #sess-inrow, #sess.inviting #sess-acts, #sess.inviting #sess-arg, #sess.inviting #sess-trade { display: none !important; }
#sess.inviting .sw-inv { margin: 6px 8px 8px; }
#sess.inviting .sw-inv .sw-acts button { min-height: 44px; flex: 1; }
.sw-inv { margin: 8px 10px 0; padding: 8px; border: 2px dashed var(--line); border-radius: 8px; }
.sw-inv.surr { border: 3px solid #ff4a4a; background: #2a0e12; animation: pulse 1s infinite alternate; }
.sw-inv.warnb { border-color: #ffb03a; background: #2a1e0a; }
@keyframes pulse { from { box-shadow: 0 0 0 #ff4a4a; } to { box-shadow: 0 0 14px #ff4a4a; } }
#sess-log { min-height: 60px; max-height: 28vh; overflow-y: auto; padding: 6px 10px; font-size: 14px; touch-action: pan-y; }
#sess-log .l { margin-bottom: 3px; }
#sess-log .l.sess-typing { opacity: .7; font-style: italic; }
#sess-log .l.sess-typing span { display: inline-block; animation: sess-typing-dots 1.2s infinite; }
@keyframes sess-typing-dots { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
#sess-log .l b { color: var(--gold); }
#sess-log .me b { color: var(--cyan); }
#sess-log .sys { color: var(--dim); font-style: italic; }
.sw-acts { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 10px; align-items: center; }
.sw-acts:empty { display: none; }
.sw-arg { display: flex; gap: 6px; padding: 4px 10px; align-items: center; }
.sw-arg span { font-size: 12px; color: var(--gold); white-space: nowrap; }
.sw-in { display: flex; gap: 6px; padding: 8px 10px; border-top: 2px solid var(--line); position: sticky; bottom: 0; background: #100e1e; }
.sw-in input { flex: 1; }
#sess-wh.on { background: #2a1e48; border-color: var(--pink); }
#sess-trade { padding: 6px 10px; border-top: 2px solid var(--line); }
.tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-col { background: #120f22; border: 2px solid var(--line); border-radius: 6px; padding: 6px; }
.tr-col > b { color: var(--gold); font-size: 13px; }
.tr-col button { margin-top: 6px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 26px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; font-size: 12px; background: #221d3c; border: 1px solid var(--line); border-radius: 4px; }
.chip img { width: var(--ic24, 20px); height: var(--ic24, 20px); image-rendering: var(--icr24, pixelated); }
.tr-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; margin-top: 6px; }
.tr-inv .slot { width: auto; height: auto; aspect-ratio: 1; }
.tr-want { display: flex; gap: 6px; margin-top: 6px; }
.tr-want input { width: 70px; }
.tr-table { margin-top: 8px; font-size: 13px; }
.tr-table > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }

/* ---- КПК ---- */
#pda { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(900px, calc(100vw - 16px)); height: min(680px, calc(100vh - 16px)); z-index: 17; overflow: hidden;
  background: var(--os-bg2); border: 3px solid #4a5a6a; border-radius: 18px; box-shadow: 0 0 0 3px #000, 0 0 0 9px #232a34, 0 0 0 11px #000, 0 14px 44px #000; }
.pda-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.pda-tabs button { padding: 5px 10px; font-size: 12px; background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); border-radius: 999px; }
.pda-tabs button.on { background: color-mix(in srgb, var(--os-acc) 28%, transparent); border-color: var(--os-acc); color: #fff; }
#pda-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px calc(10px + 0px); touch-action: pan-y; display: flex; flex-direction: column; min-height: 0; }
.map-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.map-lay { display: flex; flex-wrap: wrap; gap: 3px; }
.map-lay button { padding: 3px 6px; font-size: 11px; opacity: 0.6; }
.map-lay button.on { opacity: 1; }
.map-wrap { flex: 1; min-height: 200px; position: relative; border: 2px solid #2a3a44; border-radius: 6px; overflow: hidden; }
#pda-map { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
#pda-mapinfo { font-size: 13px; padding-top: 6px; min-height: 60px; }
#pda-mapmarks { flex: 0 0 auto; max-height: 24vh; overflow-y: auto; }
#pda-mapmarks .li { margin-bottom: 3px; padding: 4px 6px; }
.map-body { white-space: nowrap; }
.map-floor { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.map-floor b { min-width: 72px; text-align: center; font-size: 12px; }
.li { padding: 6px 8px; margin-bottom: 5px; background: rgba(20, 30, 40, 0.6); border: 1px solid #2a3a44; border-radius: 6px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.li > b { color: var(--text); }
.li small { color: var(--dim); }
.li .hint { flex-basis: 100%; margin: 0; }
.li .acts { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; align-items: center; }
.li .acts select { width: auto; padding: 4px; font-size: 12px; }
.li.ct.illegal { border-color: #6a2a3a; }
.li .rw { color: var(--gold); font-weight: bold; }
.li.note { align-items: flex-start; }
.li.note textarea { flex: 1; font: inherit; color: var(--text); background: #0c1018; border: 1px solid #2a3a44; border-radius: 4px; padding: 6px; resize: vertical; user-select: text; -webkit-user-select: text; }
.pin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #000; }
.pin.ring { background: transparent; border-width: 3px; }
.swatches { display: flex; gap: 4px; }
.swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.swatch.on { box-shadow: 0 0 0 2px #fff; }
#pda-cm-log { flex: 1; min-height: 120px; max-height: 40vh; overflow-y: auto; font-size: 13px; background: #0a0d14; border: 1px solid #2a3a44; border-radius: 6px; padding: 6px; margin-top: 6px; }
#pda-cm-log .t { color: var(--dim); margin-right: 4px; }
#cm-ch button { flex: none; }
details.post { margin-top: 12px; border-top: 2px solid #2a3a44; padding-top: 8px; }
.rb { display: grid; grid-template-columns: 150px 1fr 44px; gap: 8px; align-items: center; margin: 4px 0; font-size: 13px; }
.rb i { position: relative; height: 10px; background: #1a1428; border-radius: 3px; overflow: hidden; }
.rb i u { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cyan); }
.rb.rep i em { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: #fff6; }
.rb b { text-align: right; }

/* ---- малое окно: навыки, корпус ---- */
#uiwin { right: 12px; top: 64px; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 150px); z-index: 16; }
#uiwin-b { overflow-y: auto; padding: 10px; touch-action: pan-y; }
.sk-build { margin-top: 8px; color: var(--cyan); font-size: 13px; }
.sk-list .sk { display: grid; grid-template-columns: 1fr 26px 90px 36px; gap: 6px; align-items: center; font-size: 13px; margin-bottom: 3px; }
.sk-list .sk.main span { color: var(--gold); }
.sk-list .sk b { text-align: right; color: var(--cyan); }
.sk-list .sk i { height: 7px; background: #1a1428; border-radius: 3px; overflow: hidden; display: block; }
.sk-list .sk i u { display: block; height: 100%; background: linear-gradient(90deg, #1a8a5a, #3cff9e); }
.sk-list .sk small { color: var(--dim); text-align: right; }
.doll-wrap { display: flex; gap: 12px; align-items: flex-start; }
#doll-big { width: 120px; height: 168px; image-rendering: pixelated; background: #0a0814; border: 2px solid var(--line); border-radius: 6px; flex: none; }
.doll-parts { flex: 1; font-size: 13px; }
.doll-parts div { display: grid; grid-template-columns: 1fr 44px; gap: 0 6px; margin-bottom: 4px; }
.doll-parts small { grid-column: 1 / -1; color: var(--dim); font-size: 11px; }
.doll-flags { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }

@media (max-width: 640px) {
  #ui-mm { width: 92px; height: 92px; }
  #ui-compass { top: 64px; width: 46vw; height: 20px; left: 44%; border-width: 1px; }
  #ui-body { left: 136px; }
  #sess { left: 6px; right: 6px; width: auto; bottom: calc(6px + var(--safe-b)); max-height: 70vh; }
  #pda { width: 100vw; height: 100%; border-radius: 0; top: 0; left: 0; transform: none; }
  .tr-cols { grid-template-columns: 1fr; }
  .rb { grid-template-columns: 110px 1fr 38px; }
  #uiwin { left: 6px; right: 6px; width: auto; top: 50px; }
}
body.chat-open #sess { bottom: 46vh; }

.market-chart { width: 100%; height: auto; display: block; margin: .4em 0; }
.market-chart text { fill: currentColor; font-size: 10px; }
.market-axis { stroke: currentColor; opacity: .25; fill: none; }
.market-volume { fill: #63a4c8; opacity: .65; }
.market-range { stroke: #82a8ae; fill: none; }
.market-price { stroke: #65dfad; fill: none; stroke-width: 1.3; }
.market-point { fill: #65dfad; }
.market-catalog { display: grid; gap: 7px; }
.market-resource { border: 1px solid #39415c; border-radius: 8px; overflow: hidden; background: #12182a; }
.market-resource.is-open { border-color: #547981; }
#pda .market-resource-toggle { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 14px; width: 100%;
  align-items: center; gap: 10px; margin: 0; padding: 7px 10px; border: 0; border-radius: 0; text-align: left;
  background: #1b2339; color: inherit; box-shadow: none; white-space: normal; }
#pda .market-resource-toggle:hover, #pda .market-resource-toggle:focus-visible { background: #25324b; }
.market-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 6px; background: #0e1424; }
.market-icon img { image-rendering: pixelated; object-fit: contain; }
.market-name, .market-quote { display: grid; gap: 3px; overflow-wrap: anywhere; }
.market-name small, .market-quote small, .market-offer small { color: var(--dim); }
.market-quote { text-align: right; }
.market-quote b { color: var(--gold); }
.market-stock { display: block; height: 3px; width: min(100%, 105px); background: #2a3650; border-radius: 3px; overflow: hidden; }
.market-stock i { display: block; height: 100%; background: #63b9ae; }
.market-chevron { justify-self: center; color: #85c7c6; }
.market-resource.is-open .market-chevron { transform: rotate(180deg); }
.market-detail { padding: 10px; }
.market-detail-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; }
.market-detail-head b { color: #8ce4b8; margin-inline-start: 4px; }
.market-period { display: flex; gap: 4px; }
.market-period button[aria-pressed="true"] { border-color: #65c9bd; color: #9cebdc; }
.market-offer { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid #2a3149; }
.market-offer span { display: grid; gap: 3px; }
.market-offer span:last-child { text-align: right; flex-shrink: 0; }
@media (max-width: 420px) {
  #pda .market-resource-toggle { grid-template-columns: 42px minmax(0, 1fr) auto 10px; gap: 6px; padding: 6px; }
  .market-icon { width: 40px; height: 40px; }
  .market-icon img { width: 38px; height: 38px; }
}
.market-toolbar { position: sticky; top: 0; z-index: 2; background: #141a26; padding: 5px 0 8px;
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.market-toolbar input { flex: 1 1 9rem; min-width: 0; }
#pda .market-resource-toggle { border: 1px solid #39415c; border-radius: 8px; }
#pda .market-resource-toggle[hidden] { display: none; }
.market-hero { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.market-hero h2 { margin: 0; font-size: 1.2em; overflow-wrap: anywhere; }
#pda-market button[aria-pressed="true"] { border-color: #65c9bd; color: #9cebdc; }
.market-location { margin-top: 7px; padding: 0 8px 5px; background: #151d30; border-radius: 7px; }
.market-location .market-offer { border-top: 0; }
.chat-mark { margin-top: 6px; padding: 6px 8px; border: 1px solid #3d7f6c; border-radius: 7px; background: #12251f; display: grid; gap: 3px; }
.chat-mark small { color: #9fc9bb; }
.chat-mark .actions { margin-top: 4px; }

/* ================= «Винтоуз» — оболочка КПК (client/src/pda_os.rs) ================= */
#pda { --os-acc: #6af0c0; --os-acc2: #e8c45a; --os-bg1: #0c1d20; --os-bg2: #0b0f18; --os-panel: rgba(10, 14, 22, 0.93); --os-glass: rgba(14, 20, 30, 0.72);
  font-size: 14px; }
#pda[data-theme="autobot"] { --os-acc: #ff6a52; --os-acc2: #5a9aff; --os-bg1: #240c14; --os-bg2: #0b1226; }
#pda[data-theme="decepticon"] { --os-acc: #b88aff; --os-acc2: #ff4a7a; --os-bg1: #1a0c2c; --os-bg2: #0a0812; }
#pda[data-theme="neutral"] { --os-acc: #6af0c0; --os-acc2: #e8c45a; --os-bg1: #0c1d20; --os-bg2: #0b0f18; }
#pda.hidden { display: none; }

/* строка состояния */
.os-status { flex: none; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 14px; background: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 12px; position: relative; z-index: 6; white-space: nowrap; }
.os-clock { font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--os-acc); letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.os-sb { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.os-gps { font-size: 10px; font-weight: bold; letter-spacing: .5px; }
.os-gps.ok { color: #3cff9e; } .os-gps.bad { color: #ff6a6a; } .os-gps.warn { color: #ffc05a; }
.os-sig { display: inline-flex; align-items: flex-end; gap: 1px; height: 12px; }
.os-sig i { width: 3px; background: rgba(255,255,255,0.2); }
.os-sig i.on { background: #e8eef8; }
.os-bat { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }
.os-bat i { position: relative; width: 22px; height: 10px; border: 1px solid #c8d0dc; border-radius: 2px; padding: 1px; box-sizing: border-box; }
.os-bat i::after { content: ""; position: absolute; right: -3px; top: 2px; width: 2px; height: 4px; background: #c8d0dc; }
.os-bat u { display: block; height: 100%; }
#pda .os-bell, #pda .os-x { position: relative; padding: 2px 6px; min-width: 30px; height: 24px; background: transparent; border: 1px solid transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
#pda .os-bell svg { width: 16px; height: 16px; }
#pda .os-bell.has svg { animation: osring 2.4s ease-in-out infinite; }
#pda .os-bell:hover, #pda .os-x:hover { border-color: rgba(255,255,255,0.2); }
@keyframes osring { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
.os-badge { position: absolute; top: -4px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #ff3a4a; color: #fff;
  font: bold 10px/16px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #000; pointer-events: none; }
#ui-pda-btn { position: relative; }

/* экран: рабочий стол и приложение */
.os-screen { flex: 1; position: relative; min-height: 0; overflow: hidden; background: var(--os-bg2); }
.os-home, .os-app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.os-home.hidden, .os-app.hidden { display: none; }
/* обои */
#pda[data-wall="0"] .os-screen { background:
  linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 24px 24px,
  conic-gradient(from 200deg at 50% 118%, transparent 0 30deg, color-mix(in srgb, var(--os-acc) 22%, transparent) 30deg 34deg, transparent 34deg 60deg, color-mix(in srgb, var(--os-acc2) 20%, transparent) 60deg 64deg, transparent 64deg 96deg, color-mix(in srgb, var(--os-acc) 18%, transparent) 96deg 100deg, transparent 100deg),
  radial-gradient(90% 70% at 85% 0%, color-mix(in srgb, var(--os-acc) 55%, transparent), transparent 62%),
  radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--os-acc2) 50%, transparent), transparent 62%), linear-gradient(160deg, var(--os-bg1), var(--os-bg2)); }
#pda[data-wall="1"] .os-screen { background: radial-gradient(circle at 50% 30%, #fff6d0 0, #ffd060 4%, #ff8a2a 9%, rgba(255,90,30,0.35) 18%, transparent 34%),
  repeating-radial-gradient(circle at 50% 30%, transparent 0 22px, rgba(255,160,60,0.08) 23px 24px), linear-gradient(#1a0c08, var(--os-bg2)); animation: ospulse 8s ease-in-out infinite; }
@keyframes ospulse { 50% { filter: brightness(1.18); } }
#pda[data-wall="2"] .os-screen { background: repeating-linear-gradient(115deg, transparent 0 38px, color-mix(in srgb, var(--os-acc) 18%, transparent) 38px 40px, transparent 40px 76px, color-mix(in srgb, var(--os-acc2) 14%, transparent) 76px 78px),
  linear-gradient(180deg, #08060f, var(--os-bg1)); }
#pda[data-wall="3"] .os-screen { background:
  linear-gradient(90deg, transparent 0 31%, rgba(0,0,0,0.5) 31% 33%, transparent 33% 67%, rgba(0,0,0,0.5) 67% 69%, transparent 69%),
  linear-gradient(180deg, color-mix(in srgb, var(--os-acc2) 36%, #000) 0%, transparent 70%), linear-gradient(90deg, #0d2a4a, #2a2a10 50%, #3a0c34); }
#pda[data-wall="4"] .os-screen { background: #07080c; }
#pda .os-app { background: var(--os-panel); }

.os-in-a { animation: osin-a .22s ease-out; } .os-in-b { animation: osin-b .22s ease-out; }
@keyframes osin-a { from { opacity: 0; transform: scale(0.965); } to { opacity: 1; transform: none; } }
@keyframes osin-b { from { opacity: 0; transform: scale(0.965); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .os-in-a, .os-in-b, #pda .os-bell.has svg, #pda[data-wall="1"] .os-screen { animation: none; } }

/* шапка приложения */
.os-appbar { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 6px 10px; background: rgba(0,0,0,0.35); border-bottom: 1px solid rgba(255,255,255,0.08); }
#pda .os-back { width: 34px; height: 34px; padding: 0; font-size: 22px; line-height: 1; border-radius: 50%; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
.os-apptitle { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.os-apptitle b { font-family: "Press Start 2P", monospace; font-size: 11px; color: #fff; letter-spacing: .5px; }
.pda-tabs.hidden { display: none; }

/* значки */
.os-ic { position: relative; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; font-style: normal; box-sizing: border-box;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tile) 70%, #fff) 0%, var(--tile) 38%, color-mix(in srgb, var(--tile) 60%, #000) 100%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.22), 0 0 0 2px rgba(0,0,0,0.6), 0 4px 10px rgba(0,0,0,0.4); }
.os-ic::before { content: ""; position: absolute; inset: 4px; border: 1px dashed rgba(255,255,255,0.13); border-radius: 10px; pointer-events: none; }
.os-ic svg { width: 64%; height: 64%; image-rendering: pixelated; position: relative; }
.os-ic.sm { width: 28px; height: 28px; border-radius: 8px; } .os-ic.sm::before { display: none; }
.os-ic.xs { width: 24px; height: 24px; border-radius: 7px; flex: none; } .os-ic.xs::before { display: none; }
.os-ic.lg { width: 64px; height: 64px; flex: none; }

/* рабочий стол */
.os-home { overflow-y: auto; padding: 12px 14px 8px; gap: 12px; }
.os-hello { color: rgba(255,255,255,0.75); font-size: 13px; text-shadow: 0 1px 2px #000; }
.os-widget { background: var(--os-glass); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; gap: 8px; }
.os-w-time { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.os-w-time b { font-family: "Press Start 2P", monospace; font-size: 22px; color: #fff; text-shadow: 0 0 12px color-mix(in srgb, var(--os-acc) 70%, transparent); }
.os-w-time span { color: var(--os-acc); font-size: 14px; }
.os-pulse { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.os-pulse i { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
.os-pulse u { display: block; height: 100%; background: linear-gradient(90deg, #ffb03a, #ffe48a); }
.os-w-loc { font-size: 12px; color: rgba(255,255,255,0.75); }
.os-w-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 18px 6px; align-content: start; flex: 1; }
@media (min-width: 641px) { .os-home .os-ic { width: 64px; height: 64px; border-radius: 16px; } .os-home { padding: 16px 22px 10px; } #pda .os-tile { font-size: 13px; } }
.os-dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 6px 4px; background: var(--os-glass); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#pda .os-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 2px; background: none; border: 0; border-radius: 12px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px #000; min-width: 0; }
#pda .os-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pda .os-tile.dock span { display: none; }
#pda .os-tile:hover .os-ic, #pda .os-tile:focus-visible .os-ic { transform: translateY(-2px); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.22), 0 0 0 2px var(--os-acc), 0 6px 14px rgba(0,0,0,0.5); }
#pda .os-tile:active .os-ic { transform: scale(0.92); }
.os-tile .os-ic { transition: transform .12s ease; }

/* нижняя панель навигации */
.os-nav { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); height: 44px; padding-bottom: var(--safe-b); background: rgba(0,0,0,0.7); border-top: 1px solid rgba(255,255,255,0.08); position: relative; z-index: 6; }
#pda .os-nav button { background: none; border: 0; border-radius: 0; font-size: 20px; color: #dfe6f0; padding: 0; }
#pda .os-nav button:active { background: rgba(255,255,255,0.08); }
#pda.os-at-home .os-nav button[data-act="os-back"] { opacity: 0.35; }

/* шторки: уведомления и недавние */
.os-ov { position: absolute; inset: 0; z-index: 5; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; flex-direction: column; animation: osfade .18s ease-out; }
.os-ov.hidden { display: none; }
@keyframes osfade { from { opacity: 0; } }
.os-sheet { margin: 0 auto; width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; background: rgba(12, 16, 26, 0.98); border: 1px solid rgba(255,255,255,0.12); border-top: 0;
  border-radius: 0 0 18px 18px; box-shadow: 0 10px 30px #000; animation: osdrop .22s ease-out; }
@keyframes osdrop { from { transform: translateY(-24px); opacity: 0; } }
.os-sheet-h { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.os-sheet-h b { flex: 1; font-family: "Press Start 2P", monospace; font-size: 11px; color: var(--os-acc); }
.os-nlist { overflow-y: auto; padding: 6px; display: grid; gap: 4px; overscroll-behavior: contain; }
#pda .os-note { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 8px; font-size: 13px; }
#pda .os-note.new { border-color: color-mix(in srgb, var(--os-acc) 60%, transparent); }
.os-note small { display: block; color: var(--dim); font-size: 11px; margin-bottom: 2px; }
.os-empty { padding: 18px; color: var(--dim); text-align: center; }
.os-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 12px; overflow-y: auto; }
.os-card { position: relative; border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--tile) 55%, #000), #0a0d14); border: 1px solid rgba(255,255,255,0.12); }
#pda .os-card-b { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 6px 12px; background: none; border: 0; color: #fff; }
#pda .os-card-x { position: absolute; top: 4px; right: 4px; padding: 0 6px; font-size: 12px; background: rgba(0,0,0,0.4); }

/* заставка */
.os-boot { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, #0d2a5a, #03050a 70%); animation: osboot 1.7s ease-in forwards; text-align: center; padding: 16px; }
.os-boot.hidden, .os-boot.gone { display: none; }
.os-boot-logo svg { width: 96px; height: 96px; image-rendering: pixelated; filter: drop-shadow(0 0 14px #3af0ff88); animation: oslogo 1.2s ease-out; }
.os-boot b { font-family: "Press Start 2P", monospace; font-size: 20px; color: #fff; letter-spacing: 2px; }
.os-boot small { color: #9fc4ff; font-size: 12px; }
.os-boot em { color: #5a6a8a; font-size: 11px; font-style: normal; }
.os-boot-bar { width: 140px; height: 6px; border-radius: 3px; background: #1a2a44; overflow: hidden; }
.os-boot-bar u { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3af0ff, #ffe14a, #ff4ad0); transform-origin: left; animation: osbar 1.3s ease-out forwards; }
@keyframes osbar { from { transform: scaleX(0); } }
@keyframes oslogo { from { transform: perspective(300px) rotateY(80deg); opacity: 0; } }
@keyframes osboot { 0%, 78% { opacity: 1; } 100% { opacity: 0; visibility: hidden; pointer-events: none; } }

/* Скобка */
.os-tip { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 4; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; animation: ostip .3s ease-out; }
.os-tip.hidden { display: none; }
@keyframes ostip { from { transform: translateY(30px); opacity: 0; } }
.os-skobka { flex: none; display: inline-block; width: 52px; height: 52px; animation: osbob 2s ease-in-out infinite; }
.os-skobka svg { width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 3px 3px #000); }
.os-skobka.big { width: 84px; height: 84px; }
@keyframes osbob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.os-bubble { pointer-events: auto; max-width: 460px; background: #fff8d8; color: #2a2410; border: 2px solid #000; border-radius: 12px 12px 12px 2px; padding: 8px 10px; box-shadow: 3px 3px 0 #000; font-size: 13px; }
.os-bubble b { color: #8a5a00; font-size: 12px; }
.os-bubble p { margin: 3px 0 6px; }
.os-tip-acts { display: flex; flex-wrap: wrap; gap: 4px; }
#pda .os-tip-acts button { padding: 4px 8px; font-size: 12px; color: #2a2410; background: #ffe9a0; border: 1px solid #8a6a20; }
.os-sk-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.os-sk-hero p { margin: 4px 0 0; color: var(--dim); font-size: 13px; }
.os-tipli { align-items: flex-start; flex-wrap: nowrap; }
.os-tipli small { color: var(--os-acc); }

/* настройки */
.os-set .sec, .os-sk-hero b, #pda .web-page .sec { color: var(--os-acc); }
.os-seg { gap: 0 !important; flex-wrap: wrap; }
#pda .os-seg button { border-radius: 0; margin-right: -2px; }
#pda .os-seg button:first-child { border-radius: 8px 0 0 8px; } #pda .os-seg button:last-child { border-radius: 0 8px 8px 0; }
#pda .os-seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--os-acc) 30%, #111); border-color: var(--os-acc); color: #fff; position: relative; z-index: 1; }
.os-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
#pda .os-wall-pick { display: flex; flex-direction: column; gap: 4px; padding: 4px; font-size: 12px; align-items: stretch; }
#pda .os-wall-pick[aria-pressed="true"] { border-color: var(--os-acc); }
.os-wall-pick i { display: block; height: 52px; border-radius: 6px; }
.os-wall-pick[data-w="0"] i { background: radial-gradient(100% 80% at 80% 0%, color-mix(in srgb, var(--os-acc) 40%, transparent), transparent 60%), linear-gradient(160deg, var(--os-bg1), var(--os-bg2)); }
.os-wall-pick[data-w="1"] i { background: radial-gradient(circle at 50% 30%, #fff6d0 0, #ffd060 8%, #ff8a2a 16%, transparent 40%), #1a0c08; }
.os-wall-pick[data-w="2"] i { background: repeating-linear-gradient(115deg, transparent 0 10px, var(--os-acc) 10px 11px, transparent 11px 20px, var(--os-acc2) 20px 21px), #08060f; }
.os-wall-pick[data-w="3"] i { background: linear-gradient(90deg, transparent 0 31%, #000 31% 34%, transparent 34% 66%, #000 66% 69%, transparent 69%), linear-gradient(90deg, #0d2a4a, #2a2a10 50%, #3a0c34); }
.os-wall-pick[data-w="4"] i { background: #07080c; border: 1px solid #222; }
#pda .os-row { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; margin-bottom: 6px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
.os-row > span { flex: 1; display: grid; gap: 2px; }
.os-row small { color: var(--dim); font-size: 12px; }
.os-sw { flex: none; position: relative; width: 42px; height: 24px; border-radius: 12px; background: #3a3f4a; transition: background .15s; }
.os-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.os-sw.on { background: var(--os-acc); } .os-sw.on::after { transform: translateX(18px); }
.os-about { display: flex; gap: 12px; align-items: center; } .os-about small { display: block; color: var(--dim); }

/* «Сквозняк» */
.web-bar { display: flex; gap: 6px; align-items: center; position: sticky; top: -8px; z-index: 2; background: var(--os-panel); padding: 2px 0 8px; }
.web-addr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 12px; border-radius: 999px; background: #05070c; border: 1px solid rgba(255,255,255,0.12); color: #9fc4ff; font-size: 13px; }
.web-page { background: linear-gradient(#f2f4f8, #e4e8f0); color: #1a2230; border-radius: 12px; padding: 14px; }
.web-page p { line-height: 1.45; }
.web-page .hint { color: #5a6474; }
#pda .web-page button { color: #1a2230; background: #fff; border: 1px solid #c4ccd8; }
.web-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.web-hero h2 { margin: 0 0 4px; font-size: 15px; color: #0b3a8a; text-shadow: none; }
.web-hero.ms h2 { color: #0b2a5a; } .web-hero p { margin: 0; color: #4a5464; }
.web-search { display: flex; gap: 6px; margin-bottom: 12px; }
.web-search input { background: #fff; color: #1a2230; border: 1px solid #b4bccb; border-radius: 999px; padding: 8px 14px; }
.web-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
#pda .web-link { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 10px; }
#pda .web-link:hover { border-color: #2a6aff; }
.web-link span, .web-org, .web-list > div { display: grid; gap: 2px; }
.web-link small, .web-org small, .web-list small { color: #5a6474; font-size: 12px; }
.web-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 8px 0; }
#pda .web-org, .web-list > div { text-align: left; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid #c4ccd8; }
.web-list > div.off { opacity: 0.55; }
.web-page .sec { color: #0b3a8a !important; }

/* Искра-чат */
.cm-seg { margin-bottom: 8px; }
.cm-seg small { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--os-acc); color: #000; font-size: 10px; }
#pda-cm-log { background: rgba(0,0,0,0.35); border-color: rgba(255,255,255,0.1); border-radius: 12px; }
#pda-cm-log > div { padding: 4px 8px; margin: 3px 0; border-radius: 10px 10px 10px 2px; background: rgba(255,255,255,0.05); width: fit-content; max-width: 92%; }
.market-chat-log { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding: 8px; margin: 6px 0; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; }
.market-chat-line { align-self: flex-start; max-width: 85%; padding: 6px 10px; border-radius: 14px 14px 14px 3px; background: #1d2a40; border: 1px solid #2c3e5c; }
.market-chat-line.sent { align-self: flex-end; border-radius: 14px 14px 3px 14px; background: color-mix(in srgb, var(--os-acc) 26%, #101820); border-color: color-mix(in srgb, var(--os-acc) 50%, transparent); }
.market-chat-line small { color: var(--dim); font-size: 11px; }
#pda .market-contact-row { display: grid; width: 100%; text-align: left; gap: 2px; padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }
.market-contact-row small { color: var(--dim); }

/* свайп «назад» от левого края — только на сенсорных экранах */
.os-edge { position: absolute; left: 0; top: 40px; bottom: 0; width: 16px; z-index: 3; touch-action: none; display: none; }
@media (pointer: coarse) { .os-edge { display: block; } }
#pda.os-at-home .os-edge { display: none; }

@media (max-width: 640px) {
  #pda { width: 100vw; height: 100%; height: 100dvh; border-radius: 0; border: 0; top: 0; left: 0; transform: none; box-shadow: none; }
  .os-status { padding-top: env(safe-area-inset-top, 0px); height: calc(30px + env(safe-area-inset-top, 0px)); }
  .os-grid { grid-template-columns: repeat(4, 1fr); gap: 16px 4px; }
  .os-ic { width: 54px; height: 54px; }
  .os-nav { height: calc(50px + var(--safe-b)); }
  #pda .os-nav button { font-size: 22px; }
  .os-apptitle b { font-size: 10px; }
  .os-sb { gap: 6px; }
  .web-links { grid-template-columns: 1fr; }
  .os-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
  #pda .os-card-b { padding: 14px 4px 10px; font-size: 12px; }
  .os-card .os-ic { width: 46px; height: 46px; }
  .os-tip { left: 6px; right: 6px; bottom: 6px; gap: 4px; }
  .os-skobka { width: 38px; height: 38px; }
  .os-bubble { font-size: 12px; padding: 6px 8px; }
  .os-bubble p { margin: 2px 0 4px; line-height: 1.3; }
  #pda .os-tip-acts button { padding: 3px 6px; font-size: 11px; }
}
@media (max-width: 380px) { .os-gps { display: none; } .os-clock { font-size: 8px; } }

.os-w-date { font-size: 12px; color: #ffc03a; margin-bottom: 2px; }


.exam-findings { margin: .6rem 0; padding: .55rem .7rem; border: 1px solid #403961; border-radius: .5rem; }
.exam-findings ul { margin: .35rem 0 0; padding-inline-start: 1.2rem; }
.exam-findings li { margin-block: .22rem; }
/* ---- анатомия (ветка anatomy): окно «Анатомия», схема корпуса, список узлов */
.anat { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; align-items: start; }
.anat-fig svg { width: 120px; height: 120px; background: #0a1420; border-radius: 6px; }
.anat-fig circle { cursor: pointer; }
.anat-list { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.anat-list.ro { max-height: none; }
.anat-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 6px; align-items: center; text-align: left; padding: 3px 6px; background: rgba(255,255,255,0.04); border: 1px solid transparent; border-radius: 4px; color: inherit; font: inherit; }
.anat-row.on { border-color: #3af0ff; background: rgba(58,240,255,0.08); }
.anat-row i { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.anat-row small { grid-column: 2; opacity: .75; font-size: 11px; }
.anat-sel { margin: 8px 0; } .anat-sel p { margin: 3px 0; }
@media (max-width: 520px) { .anat { grid-template-columns: 1fr; } .anat-fig svg { width: 100%; height: 160px; } }
