/* Windows 98 look: bevels, title bars, tabs, taskbar. No images, no JS cost. */
:root {
  --face: #c0c0c0; --hi: #fff; --lt: #dfdfdf; --sh: #808080; --dk: #000;
  --navy: #000080; --navy2: #1084d0; --desk: #008080;
  --font: Tahoma, "MS Sans Serif", "Segoe UI", Verdana, Arial, sans-serif;
  --raised: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--sh), inset 2px 2px var(--lt);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px var(--lt), inset 2px 2px var(--sh);
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--sh), inset -2px -2px var(--lt), inset 2px 2px var(--dk);
  --fs: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
@supports (height: 100dvh) { html, body { height: 100dvh; } }
:root { --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
body {
  background: var(--desk); color: var(--dk); font: var(--fs)/1.25 var(--font);
  overflow: hidden; -webkit-font-smoothing: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ic { width: 16px; height: 16px; flex: none; image-rendering: pixelated; vertical-align: middle; }
.ic32 { width: 32px; height: 32px; }
.ic64 { width: 64px; height: 64px; }
.ic96 { width: 96px; height: 96px; }

/* ---------- desktop / window ---------- */
/* el escritorio va por encima del post-it (z 0) pero deja pasar los clics a lo que haya debajo */
#desktop { position: fixed; inset: 0 var(--sar) calc(30px + var(--sab)) var(--sal); overflow: hidden; z-index: 1; pointer-events: none; }
.window { background: var(--face); box-shadow: var(--raised), 2px 2px 0 var(--dk); padding: 3px; display: flex; flex-direction: column; min-height: 0; }
/* ventanas de las utilidades: se mueven, redimensionan, maximizan y minimizan (geometría por JS) */
.app-win { position: absolute; min-width: 0; pointer-events: auto; }
.app-win:not(.focus) .titlebar { background: linear-gradient(90deg, #808080, #b8b8b8); color: #dfdfdf; }
.titlebar { touch-action: none; }
.app-win:not(.max) .titlebar { cursor: default; }
.tb-btn::before { content: ''; display: block; }
.tb-min::before { width: 7px; height: 2px; background: var(--dk); margin-top: 5px; }
.tb-max::before { width: 9px; height: 8px; border: 1px solid var(--dk); border-top-width: 2px; }
.tb-res::before { width: 6px; height: 5px; border: 1px solid var(--dk); border-top-width: 2px; background: var(--face); box-shadow: 2px -2px 0 -1px var(--face), 2px -2px 0 0 var(--dk); margin: 2px 0 0 -2px; }
.tb-x::before { content: '\00d7'; font: bold 12px/1 var(--font); }
.tb-btn + .tb-btn { margin-left: 0; }
.tb-x { margin-left: 2px; }
.rz { position: absolute; z-index: 3; touch-action: none; }
.rz.rz-n, .rz.rz-s { left: 8px; right: 8px; height: 5px; cursor: ns-resize; }
.rz.rz-e, .rz.rz-w { top: 8px; bottom: 8px; width: 5px; cursor: ew-resize; }
.rz.rz-n { top: -2px; } .rz.rz-s { bottom: -2px; } .rz.rz-e { right: -2px; } .rz.rz-w { left: -2px; }
.rz.rz-ne, .rz.rz-nw, .rz.rz-se, .rz.rz-sw { width: 12px; height: 12px; }
.rz.rz-ne { top: -2px; right: -2px; cursor: nesw-resize; } .rz.rz-nw { top: -2px; left: -2px; cursor: nwse-resize; }
.rz.rz-se { bottom: -2px; right: -2px; cursor: nwse-resize; } .rz.rz-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.app-win.max .rz { display: none; }
.titlebar {
  display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 3px; height: 20px; flex: none;
  background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; font-weight: bold;
}
.titlebar .ttl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn {
  width: 16px; height: 14px; padding: 0; border: 0; background: var(--face); box-shadow: var(--raised);
  font: bold 9px/1 var(--font); color: var(--dk); display: flex; align-items: center; justify-content: center; cursor: default;
}
.tb-btn:active { box-shadow: var(--pressed); }

/* ---------- buttons / fields ---------- */
.btn {
  background: var(--face); border: 0; box-shadow: var(--raised); color: var(--dk); font: var(--fs) var(--font);
  min-width: 75px; min-height: 23px; padding: 3px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: default;
}
.btn:active:not(:disabled), .btn.on { box-shadow: var(--pressed); padding: 4px 9px 2px 11px; }
.btn:focus-visible { outline: 1px dotted var(--dk); outline-offset: -5px; }
.btn.default { box-shadow: 0 0 0 1px var(--dk), var(--raised); }
.btn:disabled { color: var(--sh); text-shadow: 1px 1px 0 var(--hi); }
.btn:disabled .ic { opacity: .45; filter: grayscale(1); }
.btn.sq { min-width: 0; width: 28px; padding: 3px; }
.field {
  background: #fff; border: 0; box-shadow: var(--sunken); padding: 3px 4px; font: var(--fs) var(--font); color: var(--dk);
  user-select: text; -webkit-user-select: text; min-height: 23px;
}
.field:focus { outline: none; }
.sunken { box-shadow: var(--sunken); }
.groove { border: 1px solid var(--sh); box-shadow: 1px 1px 0 var(--hi), inset 1px 1px 0 var(--hi); padding: 8px; position: relative; }
.groove > legend, .groove > .gl { position: absolute; top: -8px; left: 8px; background: var(--face); padding: 0 3px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0; padding: 4px 4px 0; margin-top: 3px; flex: none; position: relative; z-index: 1; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; background: var(--face); border: 0; font: var(--fs) var(--font); color: var(--dk); cursor: default;
  padding: 3px 12px 2px; margin-top: 2px; display: flex; align-items: center; gap: 5px; white-space: nowrap;
  box-shadow: inset 1px 1px var(--hi), inset -1px 0 var(--dk), inset -2px 0 var(--sh), inset 0 1px var(--lt);
}
.tab[aria-selected="true"] { margin-top: 0; padding: 4px 14px 4px; margin: 0 -2px -2px; z-index: 2; font-weight: normal; }
.tab:focus-visible > span { outline: 1px dotted var(--dk); outline-offset: 2px; }
.tabpanel {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px; position: relative;
  box-shadow: var(--raised); background: var(--face);
}
.panel { margin-top: 3px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.statusbar { display: flex; gap: 2px; padding-top: 3px; flex: none; }
.sb-cell { box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi); padding: 2px 6px; min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-cell:first-child { flex: 1; }

/* ---------- taskbar ---------- */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(30px + var(--sab)); background: var(--face); padding: 2px calc(2px + var(--sar)) calc(2px + var(--sab)) calc(2px + var(--sal));
  box-shadow: inset 0 1px var(--lt), inset 0 2px var(--hi); display: flex; align-items: center; gap: 4px; z-index: 50;
}
#start-btn { font-weight: bold; min-width: 0; padding: 2px 8px; height: 24px; }
.tb-sep { width: 2px; height: 22px; box-shadow: inset 1px 0 var(--sh), inset -1px 0 var(--hi); }
#tasks { display: flex; gap: 3px; flex: 1 1 auto; min-width: 0; }
.task { flex: 0 1 160px; min-width: 0; height: 24px; justify-content: flex-start; padding: 2px 6px; overflow: hidden; }
.task.on { font-weight: bold; background-image: repeating-conic-gradient(var(--face) 0 25%, var(--hi) 0 50%); background-size: 2px 2px; }
.task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tray { margin-left: auto; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 8px; height: 24px; box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi); }
#startmenu { position: fixed; left: calc(2px + var(--sal)); bottom: calc(30px + var(--sab)); width: 200px; background: var(--face); box-shadow: var(--raised), 2px 2px 0 var(--dk); padding: 3px; display: flex; z-index: 60; }
.sm-side { width: 24px; background: linear-gradient(0deg, var(--navy2), var(--navy)); color: #fff; position: relative; flex: none; min-height: 150px; }
.sm-side b { position: absolute; left: 0; bottom: 6px; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 15px; width: 24px; text-align: center; letter-spacing: 1px; }
.sm-items { flex: 1; display: flex; flex-direction: column; }
.sm-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border: 0; background: none; font: var(--fs) var(--font); text-align: left; color: var(--dk); cursor: default; }
.sm-item:hover, .sm-item:focus-visible { background: var(--navy); color: #fff; outline: none; }
.sm-item .ic { width: 24px; height: 24px; }
.sm-line { height: 2px; margin: 2px 2px; box-shadow: inset 0 1px var(--sh), inset 0 -1px var(--hi); }

/* ---------- dialogs ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(0, 0, 0, .15); }
.dialog { min-width: 260px; max-width: min(420px, 100%); }
.dialog .body { display: flex; gap: 14px; padding: 16px 14px 8px; align-items: flex-start; }
.dialog .msg { padding-top: 4px; user-select: text; -webkit-user-select: text; }
.dialog .btns { display: flex; justify-content: center; gap: 8px; padding: 8px 8px 10px; }

/* ---------- progress / sliders / lists ---------- */
.pbar { height: 20px; padding: 2px; box-shadow: var(--sunken); background: var(--face); }
.pbar > i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 8px, transparent 8px 10px); }
.pbar.busy > i { width: 40% !important; animation: slide 1.4s steps(14) infinite; }
@keyframes slide { from { margin-left: -40%; } to { margin-left: 100%; } }

input[type=range] { -webkit-appearance: none; appearance: none; background: none; height: 22px; margin: 0; padding: 0; width: 100%; cursor: default; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--face); box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi), inset 2px 2px var(--dk); }
input[type=range]::-moz-range-track { height: 4px; background: var(--face); box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi), inset 2px 2px var(--dk); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 21px; margin-top: -9px; border: 0; border-radius: 0; background: var(--face); box-shadow: var(--raised); }
input[type=range]::-moz-range-thumb { width: 11px; height: 21px; border: 0; border-radius: 0; background: var(--face); box-shadow: var(--raised); }
input[type=range]:focus-visible::-webkit-slider-thumb { outline: 1px dotted var(--dk); outline-offset: -4px; }

.lv { background: #fff; box-shadow: var(--sunken); padding: 2px; overflow: auto; min-height: 0; }
.lv-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; white-space: nowrap; cursor: default; }
.lv-row.sel { background: var(--navy); color: #fff; }
.lv-row:focus-visible { outline: 1px dotted #ff0; outline-offset: -2px; }
.lv-row > .t { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.lv-row small { color: inherit; opacity: .7; }
.lv-empty { padding: 10px; color: var(--sh); }
.scrollbars { scrollbar-color: var(--face) #e8e8e8; scrollbar-width: auto; }

/* ---------- CD player ---------- */
.cd { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-toolbar { display: flex; gap: 6px; flex: none; align-items: center; }
.cd-body { flex: 1; min-height: 0; display: flex; gap: 8px; }
.cd-lib { width: 230px; flex: none; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.cd-lib .lv { flex: 1; }
.cd-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cd-view { flex: 1; min-height: 0; display: none; flex-direction: column; }
.cd-view.active { display: flex; }
.cd-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 14px; box-shadow: var(--sunken); background: #fff; }
.cd-center h2 { margin: 0; font-size: 14px; }
.cd-center p { margin: 0; color: #404040; }
.cd-steps { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 4px 0; }
.step { display: flex; align-items: center; gap: 8px; color: var(--sh); }
.step .ic { visibility: hidden; color: var(--dk); }
.step.active { color: var(--dk); font-weight: bold; }
.step.active .ic { visibility: visible; animation: blink 1s steps(2) infinite; }
.step.done { color: var(--dk); }
.step.done .ic { visibility: visible; color: #008000; }
@keyframes blink { 50% { opacity: .2; } }
.cd-wide { width: min(360px, 100%); }
.album { display: flex; gap: 12px; flex: none; padding: 8px; align-items: flex-start; }
.cover { width: 112px; height: 112px; flex: none; background: #fff; box-shadow: var(--sunken); padding: 2px; display: flex; align-items: center; justify-content: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.album-info h1 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.album-info p { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi); align-self: flex-start; }
.tracks { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 8px; }
.tracks .lv { flex: 1; padding: 0; }
.th, .tr { display: grid; grid-template-columns: 38px 1fr 58px; }
.th { flex: none; }
.th span { background: var(--face); box-shadow: var(--raised); padding: 2px 6px; }
.th span:last-child, .tr span:last-child { text-align: right; }
.tr { padding: 2px 0; cursor: default; }
.tr span { padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr.sel { background: var(--navy); color: #fff; }
.tr.playing span:nth-child(2) { font-weight: bold; }
.tr:focus-visible { outline: 1px dotted #ff0; outline-offset: -2px; }
.tracks-scroll { flex: 1; min-height: 0; overflow: auto; background: #fff; box-shadow: var(--sunken); display: flex; flex-direction: column; }
.tracks-scroll .th { position: sticky; top: 0; z-index: 1; }

.transport { flex: none; padding: 10px 8px 8px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; }
.lcd { background: #000; color: #00e000; font: 18px/1 "Lucida Console", "Courier New", monospace; padding: 5px 8px; box-shadow: var(--sunken); min-width: 118px; text-align: center; letter-spacing: 1px; }
.lcd-title { grid-column: 2 / 4; background: #000; color: #00e000; box-shadow: var(--sunken); padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 12px "Lucida Console", "Courier New", monospace; min-height: 24px; }
.tp-btns { display: flex; gap: 2px; }
.tp-btns .btn { min-width: 34px; width: 34px; min-height: 28px; padding: 2px; }
.tp-btns .btn .ic { width: 16px; height: 16px; }
.tp-seek { grid-column: 2; }
.tp-vol { display: flex; align-items: center; gap: 6px; width: 120px; }
.tp-vol .btn { min-width: 26px; width: 26px; min-height: 24px; padding: 2px; }

/* ---------- login ---------- */
.login-wrap { position: fixed; inset: 0 0 30px 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
.login { width: min(380px, 100%); }
.login .body { display: flex; gap: 14px; padding: 16px 14px 6px; }
.login .row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.login label { flex: none; }
.login .pt0 { padding-top: 0; }
.login .grow { flex: 1; }
.login .pt14 { padding-top: 14px; }
.login .field { flex: 1; min-width: 0; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  :root { --fs: 14px; }
  /* en el móvil solo se ve la ventana activa y siempre a pantalla completa */
  .app-win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: var(--raised); }
  .app-win:not(.focus) { display: none; }
  .app-win .rz, .app-win .tb-max, .app-win .tb-res { display: none; }
  .tabpanel { padding: 6px; }
  .cd-body { flex-direction: column; }
  .cd-lib { width: 100%; height: 34%; }
  .btn { min-height: 30px; }
  .album { flex-direction: row; padding: 4px; }
  .cover { width: 84px; height: 84px; }
  .transport { grid-template-columns: 1fr auto; }
  .lcd { grid-column: 1; }
  .lcd-title { grid-column: 1 / 3; grid-row: 2; }
  .tp-btns { grid-column: 2; grid-row: 1; }
  .tp-seek { grid-column: 1 / 3; grid-row: 3; }
  .tp-vol { grid-column: 1 / 3; grid-row: 4; width: 100%; }
  .th, .tr { grid-template-columns: 34px 1fr 72px; }
  .tp-btns .btn { min-width: 40px; width: 40px; min-height: 32px; }
  #tray .clock-date { display: none; }
}
@media (max-width: 720px) and (max-height: 640px) { .album .badge { display: none; } }
@media (prefers-reduced-motion: reduce) { .step.active .ic, .pbar.busy > i { animation: none; } }

/* ---------- checkbox / form ---------- */
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 13px; height: 13px; margin: 0; flex: none; background: #fff; box-shadow: var(--sunken); position: relative; vertical-align: middle; }
input[type=checkbox]:checked::after { content: ""; position: absolute; left: 3px; top: 1px; width: 3px; height: 6px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(40deg); }
input[type=checkbox]:focus-visible { outline: 1px dotted var(--dk); outline-offset: 2px; }
.chk { display: inline-flex; align-items: center; gap: 6px; }
.dialog.wide { width: 100%; max-width: 460px; }
.form-body { padding: 12px; max-height: calc(100vh - 150px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.frow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frow > label { min-width: 70px; }
.frow .field { flex: 1; min-width: 80px; }

/* ---------- Luces LED ---------- */
.lz { flex: 1; min-height: 0; display: flex; gap: 14px; overflow: auto; padding-top: 6px; }
.lz-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lz-col .groove { margin-top: 0; }
.lz-sched { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }
.lz-sched .lv { flex: 1; min-height: 90px; }
.lz .groove > .gl { font-weight: bold; }
.cp { display: flex; flex-direction: column; gap: 8px; }
.cp-sv { position: relative; height: 150px; box-shadow: var(--sunken); touch-action: none; cursor: crosshair; }
.cp-sv i { position: absolute; width: 11px; height: 11px; margin: -6px 0 0 -6px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #000; pointer-events: none; }
input[type=range].cp-hue::-webkit-slider-runnable-track { height: 14px; background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); box-shadow: var(--sunken); }
input[type=range].cp-hue::-moz-range-track { height: 14px; background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); box-shadow: var(--sunken); }
input[type=range].cp-hue::-webkit-slider-thumb { margin-top: -4px; }
.cp-fields { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cp-fields .field { width: 52px; min-width: 0; padding: 2px 3px; }
.cp-fields .hex { width: 78px; }
.cp-prev { width: 34px; height: 24px; box-shadow: var(--sunken); margin-left: auto; }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin-top: 8px; }
.sw { height: 22px; min-width: 0; padding: 0; border: 0; box-shadow: var(--sunken); cursor: default; }
.sw:focus-visible { outline: 1px dotted var(--dk); outline-offset: 1px; }
.lz-bright { display: flex; align-items: center; gap: 10px; }
.lz-bright output { min-width: 40px; text-align: right; }
.lz-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.lz-toolbar { display: flex; gap: 4px; flex-wrap: wrap; }
.lz-toolbar .btn { min-width: 0; padding: 3px 8px; }
.sc-dot { width: 14px; height: 14px; flex: none; box-shadow: var(--sunken); }
.sc-off { color: var(--sh); }
.sc-row small { margin-left: auto; padding-left: 8px; }
.lz-next { margin: 0; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .lz { flex-direction: column; gap: 14px; }
  .lz-col { flex: none; }
  .lz-sched { min-height: 240px; }
  .cp-sv { height: 130px; }
}

.form-inner { display: flex; flex-direction: column; gap: 10px; }
.frow input[type=range] { flex: 1; width: auto; min-width: 60px; }
.frow output { min-width: 40px; text-align: right; }

/* ---------- Recordatorios ---------- */
.tabpanel.flat { box-shadow: none; padding: 0; background: none; }
.rm-page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; box-shadow: var(--raised); background: var(--face); position: relative; z-index: 0; margin-top: -2px; }
.rm-bar { display: flex; gap: 6px; flex: none; flex-wrap: wrap; align-items: center; }
.rm-filter { display: flex; gap: 6px; flex: none; flex-wrap: wrap; align-items: center; }
.rm-filter .field { flex: 1 1 120px; min-width: 0; }
.rm-lbl { white-space: nowrap; }
.rm-listwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rm-lv { flex: 1; }
.rm-listwrap .rm-lv { flex: 1; }
/* tabla */
.rm-tbl { width: 100%; border-collapse: collapse; }
.rm-tbl th { position: sticky; top: 0; z-index: 1; background: var(--face); box-shadow: var(--raised); text-align: left; font-weight: normal; padding: 2px 6px; white-space: nowrap; }
.rm-tbl td { padding: 3px 6px; white-space: nowrap; max-width: 0; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #e0e0e0; }
.rm-tbl th:nth-child(1), .rm-tbl td.rm-c { width: 28px; max-width: none; text-align: center; padding: 0 4px; }
.rm-tbl .rm-title { width: 26%; }
.rm-tbl .rm-desc { width: 28%; color: var(--sh); }
.rm-tbl .rm-when, .rm-tbl .rm-rep, .rm-tbl .rm-st { max-width: none; }
.rm-tbl tr.sel td { background: var(--navy); color: #fff; }
.rm-tbl tr.sel .rm-desc, .rm-tbl tr.sel .rm-over { color: #ffff80; }
.rm-tbl tr:focus-visible { outline: 1px dotted #ff0; outline-offset: -2px; }
.rm-tbl tr.rm-h td { background: var(--navy); color: #fff; font-weight: bold; max-width: none; }
.rm-cat { display: inline-flex; align-items: center; gap: 5px; }
.rm-h { background: var(--navy); color: #fff; padding: 2px 6px; font-weight: bold; flex: none; }
.rm-over { color: #c00000; font-weight: bold; }
.lv-row.sel .rm-over { color: #ffff80; }
.rm-done .rm-title { text-decoration: line-through; }
.rm-dot { width: 12px; height: 12px; flex: none; box-shadow: var(--sunken); }
.rm-note { color: var(--sh); flex: none; }
.rm-calhead { display: flex; gap: 6px; align-items: center; flex: none; }
.rm-calttl { flex: 1; text-align: center; }
.rm-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; flex: none; }
.rm-wd { text-align: center; font-weight: bold; }
.rm-day { min-height: 44px; background: #fff; border: 0; box-shadow: var(--sunken); padding: 2px 3px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font: var(--fs) var(--font); color: var(--dk); cursor: default; }
.rm-blank { background: none; box-shadow: none; }
.rm-today .rm-dn { background: var(--navy); color: #fff; padding: 0 3px; }
.rm-day.on { outline: 2px solid var(--navy); outline-offset: -2px; }
.rm-day:focus-visible { outline: 1px dotted var(--dk); outline-offset: -3px; }
.rm-dots { display: flex; flex-wrap: wrap; gap: 2px; }
.rm-dots i { width: 8px; height: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.45); }
.rm-cfg { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 6px 2px; }
.rm-cats { max-height: 130px; margin-top: 6px; }
.rm-form { display: flex; flex-direction: column; gap: 8px; }
.rm-form .frow > label { min-width: 120px; }
.rm-sw { display: flex; flex-wrap: wrap; gap: 3px; }
.rm-swb { width: 20px; height: 20px; border: 0; padding: 0; box-shadow: var(--raised); }
.rm-swb.on { box-shadow: var(--pressed); outline: 1px dotted var(--dk); outline-offset: -4px; }
textarea.field { resize: vertical; min-height: 60px; }
select.field { min-height: 23px; }
@media (max-width: 720px) {
  .rm-page { padding: 6px; }
  .rm-day { min-height: 38px; }
  .rm-hm { display: none; }
  .rm-tbl .rm-title { width: auto; }
  .rm-tbl td.rm-c { width: 36px; }
  .rm-form .frow > label { min-width: 0; width: 100%; }
}

/* ---------- Simulador de préstamos ---------- */
.rm-tbl td.num, .rm-tbl th.num { text-align: right; max-width: none; }
.pm-sel { flex: 1 1 160px; min-width: 0; }
.pm-sum { flex: none; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; }
.pm-stat { display: flex; flex-direction: column; min-width: 0; }
.pm-stat small { color: var(--sh); }
.pm-stat b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.pm-big b { color: var(--navy); }
.pm-tbl tr.pm-paid td { color: var(--sh); }
.pm-tbl tr.pm-next td { font-weight: bold; box-shadow: inset 0 1px #000, inset 0 -1px #000; }
@media (max-width: 720px) { .pm-grid { grid-template-columns: repeat(2, 1fr); } .pm-tbl td, .pm-tbl th { padding: 3px 4px; } }

/* ---------- Docker ---------- */
.dk-dot { display: inline-block; width: 12px; height: 12px; box-shadow: var(--sunken); background: #808080; vertical-align: middle; }
.dk-dot.on { background: #00c000; }
.dk-dot.pa { background: #ffff00; }
.dk-dot.off { background: #c00000; }
.dk-tbl td.dk-st, .dk-tbl td.dk-sch { max-width: none; }
.dk-tbl td.dk-st { color: var(--sh); }
.dk-tbl tr.sel td.dk-st { color: #fff; }
@media (max-width: 720px) { .dk-tbl td.dk-st { display: none; } .dk-tbl th:nth-child(4) { display: none; } }

/* ---------- Monitoreo ---------- */
.mon-page { overflow: auto; gap: 14px; }
.mon-g { display: flex; flex-direction: column; gap: 6px; flex: none; padding-top: 12px; }
.mon-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 14px; flex: none; }
.mon-tw { overflow-x: auto; background: #fff; box-shadow: var(--sunken); }
.mon-tbl td, .mon-tbl th { white-space: nowrap; max-width: none; }
.mon-bar { height: 14px; min-width: 80px; flex: 1; }
.pbar.warm > i { background: repeating-linear-gradient(90deg, #808000 0 8px, transparent 8px 10px); }
.pbar.hot > i { background: repeating-linear-gradient(90deg, #c00000 0 8px, transparent 8px 10px); }
.mon-cell { display: flex; align-items: center; gap: 8px; }
.mon-cell span { min-width: 44px; text-align: right; }
.mon-row { display: flex; align-items: center; gap: 8px; }
.mon-row > span { width: 110px; flex: none; }
.mon-row > b { min-width: 110px; text-align: right; font-weight: normal; }
.mon-cores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 18px; }
.mon-cores .mon-row > span { width: 50px; }
.mon-cores .mon-row > b { min-width: 40px; }
.mon-h.ok { color: #006000; font-weight: bold; }
.mon-h.bad { color: #c00000; font-weight: bold; }
@media (max-width: 720px) { .mon-stats { grid-template-columns: repeat(2, 1fr); } .mon-cores { grid-template-columns: 1fr; } .mon-row > span { width: 80px; } }

/* ---------- post-it del escritorio ---------- */
#postit { position: fixed; top: 22px; right: 26px; width: 270px; max-height: calc(100vh - 100px); overflow: auto; z-index: 0; background: #ffff99;
  color: #000; padding: 12px 12px 10px; box-shadow: 3px 5px 0 rgba(0, 0, 0, .35); transform: rotate(1.2deg); display: flex; flex-direction: column; gap: 4px; }
#postit::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: rgba(0, 0, 0, .08); }
.pi-title { font-weight: bold; font-size: 15px; padding-top: 4px; border-bottom: 1px dashed rgba(0, 0, 0, .35); padding-bottom: 4px; margin-bottom: 2px; }
.pi-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.pi-item .pi-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-item small { opacity: .7; }
.pi-dot { width: 9px; height: 9px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.pi-over .pi-t, .pi-over small { color: #a00000; }
.pi-h { color: #a00000; font-weight: bold; margin-top: 4px; border-top: 1px dashed rgba(0, 0, 0, .35); padding-top: 4px; }
.pi-empty, .pi-more { padding: 6px 0; opacity: .75; }
.pi-open { align-self: flex-end; margin-top: 4px; background: none; border: 0; font: var(--fs) var(--font); text-decoration: underline; color: #000080; cursor: default; padding: 2px 0; }
@media (max-width: 720px) { #postit { left: 16px; right: 16px; width: auto; top: 16px; max-height: calc(100vh - 90px); } }
.pi-title + .pi-h { border-top: 0; margin-top: 0; padding-top: 0; }

/* ---------- Panel de control ---------- */
.cp-body { flex: 1; min-height: 0; display: flex; gap: 14px; }
.cp-left { flex: none; width: 220px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.cp-monitor { width: 200px; padding: 12px 12px 14px; background: var(--face); box-shadow: var(--raised); }
.cp-screen { width: 100%; aspect-ratio: 4 / 3; background: var(--desk); box-shadow: var(--sunken); }
.cp-stand { width: 70px; height: 8px; margin: 10px auto -14px; background: var(--face); box-shadow: var(--raised); }
.cp-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cp-g { display: flex; flex-direction: column; gap: 8px; flex: none; padding-top: 12px; }
.cp-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.cp-list { flex: 1; }
.cp-spacer { flex: 1; }
.cp-file { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.cp-list .rm-h { position: static; }
@media (max-width: 720px) { .cp-body { flex-direction: column; gap: 8px; overflow: auto; } .cp-left { width: 100%; flex-direction: row; justify-content: center; } .cp-monitor { width: 150px; } .cp-stand { display: none; } .cp-list { min-height: 180px; } }

/* ---------- Inventario de cables ---------- */
.iv-detail { flex: none; display: flex; gap: 12px; align-items: flex-start; padding-top: 12px; min-height: 80px; }
.iv-photo { max-width: 180px; max-height: 150px; object-fit: contain; background: #fff; box-shadow: var(--sunken); padding: 2px; flex: none; }
.iv-prev { max-width: 100%; align-self: center; }
.iv-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; user-select: text; -webkit-user-select: text; }
.iv-subs { display: flex; flex-direction: column; gap: 6px; }
.iv-subs .frow { flex-wrap: nowrap; }
@media (max-width: 720px) { .iv-detail { flex-direction: column; } .iv-photo { max-width: 100%; } }

/* ---------- Bloc de notas ---------- */
.np-body { flex: 1; min-height: 0; display: flex; gap: 8px; }
.np-left { flex: none; width: 190px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.np-list { flex: 1; }
.np-edit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.np-bar { flex-wrap: wrap; align-items: center; }
.np-trow { flex-wrap: nowrap; }
.np-title { flex: 1; min-width: 0; }
.np-size { width: auto; }
.np-text { flex: 1; min-height: 120px; resize: none; font-family: "Fixedsys", "Lucida Console", "Courier New", monospace; font-size: 13px; line-height: 1.25; white-space: pre; overflow: auto; tab-size: 4; -moz-tab-size: 4; user-select: text; -webkit-user-select: text; }
.np-text.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 720px) { .np-body { flex-direction: column; } .np-left { width: 100%; height: 110px; } }

/* ---------- Panel de control: avisos y seguridad ---------- */
.cp-form { max-width: 520px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }

/* ---------- Docker: logs y rendimiento ---------- */
.modal.dk-float { display: block; padding: 0; }
.dialog.dk-view { position: absolute; max-width: none; min-width: 0; }
.dk-view .titlebar { touch-action: none; }
@media (max-width: 720px) { .dialog.dk-view { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 30px - var(--sab)) !important; } .dk-view .rz { display: none; } }
.dk-vbody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.dk-vbar { flex-wrap: wrap; align-items: center; }
.dk-vbar .field[type=search] { flex: 1; min-width: 100px; }
.dk-log { flex: 1; min-height: 0; overflow: auto; background: #fff; box-shadow: var(--sunken); padding: 4px 6px; font-family: "Fixedsys", "Lucida Console", "Courier New", monospace; font-size: 12px; line-height: 1.3; user-select: text; -webkit-user-select: text; }
.dk-ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.dk-ln.er { color: #a00000; }
.dk-pg { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.dk-chart { width: 100%; max-width: 420px; height: 70px; background: #fff; box-shadow: var(--sunken); display: block; }
.dk-bw { flex: 1; min-width: 80px; display: flex; }
.dk-bw > .pbar { flex: 1; }
.dk-vals .mon-row > span { width: 130px; }
.dk-vals .mon-row > b { text-align: left; font-weight: normal; }
.app-win.min { display: none; }

/* ---------- menú contextual ---------- */
.ctxmenu { position: fixed; z-index: 200; min-width: 170px; background: var(--face); box-shadow: var(--raised), 2px 2px 0 var(--dk); padding: 3px; display: flex; flex-direction: column; }
.cm-item { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 22px 4px 22px; border: 0; background: none; font: var(--fs) var(--font); color: var(--dk); text-align: left; cursor: default; white-space: nowrap; }
.cm-item small { color: inherit; opacity: .75; }
.cm-item.bold { font-weight: bold; }
.cm-item:hover:not(:disabled), .cm-item:focus-visible { background: var(--navy); color: #fff; outline: none; }
.cm-item:disabled { color: var(--sh); text-shadow: 1px 1px 0 var(--hi); }
.ctxmenu.emoji { display: grid; grid-template-columns: repeat(8, 30px); gap: 1px; min-width: 0; }
.cm-emoji { width: 30px; height: 28px; padding: 0; border: 0; background: none; font: 18px/1 "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif; cursor: default; }
.cm-emoji:hover, .cm-emoji:focus-visible { background: var(--navy); outline: none; }
.app-win.shade > :not(.titlebar) { display: none; }

/* ---------- Registro contable ---------- */
.ct-page { gap: 8px; }
.ct-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.ct-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.ct-grow { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.ct-col { gap: 8px; }
.ct-tw { flex: 1 1 auto; min-height: 90px; max-height: 100%; }
.ct-scroll > .ct-tw { flex: none; max-height: 360px; }
.ct-tbl th:nth-child(1) { width: auto; text-align: left; padding: 2px 6px; }
.ct-tbl td { max-width: 340px; }
.ct-tbl td.rm-title { width: auto; max-width: 380px; }
.ct-tbl .rm-am, .ct-tbl th.rm-am { text-align: right; }
.ct-tbl .rm-desc { width: auto; max-width: 420px; }
.ct-tbl tr.ct-grp td { background: var(--navy); color: #fff; font-weight: bold; max-width: none; }
.ct-tbl tr.ct-day td { background: var(--lt); color: #000; font-weight: bold; max-width: none; padding: 1px 6px; border-bottom: 1px solid var(--sh); }
.ct-tbl tr.ct-off td { color: var(--sh); }
.ct-tbl .ct-sort { cursor: default; }
.ct-page .pos { color: #006000; }
.ct-page .neg { color: #c00000; }
.ct-page .mut { color: #404040; }
.ct-tbl tr.sel .pos, .ct-tbl tr.sel .neg, .ct-tbl tr.sel .mut { color: #fff; }
.ct-late { color: #c00000; }
.ct-tbl tr.sel .ct-late { color: #ffff80; }
.ct-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex: none; }
.ct-cards.c3 { grid-template-columns: repeat(3, 1fr); }
.ct-card { padding: 10px 8px 6px; }
.ct-card-l { color: var(--sh); }
.ct-card-v { font-size: 18px; font-weight: bold; padding-top: 2px; }
.ct-h { font-weight: bold; padding: 2px 0; flex: none; }
.ct-notices { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; flex: none; }
.ct-nrow { display: flex; align-items: center; gap: 8px; }
.ct-nrow .t { flex: 1; min-width: 0; }
.ct-nrow.warn .t { color: #805000; font-weight: bold; }
.ct-nrow .btn { min-width: 0; }
.ct-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.ct-stat { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ct-stat .groove, .groove.ct-stat { padding-top: 12px; }
.ct-donutrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ct-legend { display: flex; flex-direction: column; gap: 2px; min-width: 150px; flex: 1; }
.ct-legend > div { display: flex; align-items: center; gap: 6px; }
.ct-legend b { margin-left: auto; font-weight: normal; padding-left: 8px; }
.ct-sw { display: inline-block; width: 11px; height: 11px; box-shadow: var(--sunken); flex: none; vertical-align: middle; background: #808080; }
.ct-sw.g { background: #008000; } .ct-sw.r { background: #c00000; }
.ct-leg2 { display: flex; gap: 6px; align-items: center; color: var(--sh); }
.ct-chart { display: block; max-width: 100%; height: auto; box-shadow: var(--sunken); background: #fff; }
.ct-chart.ct-donut { box-shadow: none; flex: none; }
.ct-seg { display: inline-flex; gap: 0; flex: none; flex-wrap: wrap; }
.ct-segb { background: var(--face); border: 0; box-shadow: var(--raised); padding: 3px 12px; font: var(--fs) var(--font); color: var(--dk); cursor: default; min-height: 23px; }
.ct-segb[aria-selected="true"] { box-shadow: var(--pressed); background-image: repeating-conic-gradient(var(--face) 0 25%, var(--hi) 0 50%); background-size: 2px 2px; font-weight: bold; }
.ct-segb:focus-visible { outline: 1px dotted var(--dk); outline-offset: -4px; }
.ct-filter .field { flex: 1 1 110px; }
.ct-filter .field[type=date] { flex: 0 1 130px; }
.ct-more { padding: 6px; text-align: center; }
.ct-foot { flex: none; color: var(--dk); padding: 2px 4px; box-shadow: var(--sunken); background: var(--face); }
.ct-note { padding: 4px 6px; background: #ffffe1; box-shadow: var(--sunken); flex: none; user-select: text; -webkit-user-select: text; }
.ct-note.bad { color: #c00000; }
.ct-note .btn { min-width: 0; min-height: 20px; padding: 1px 8px; margin: 0 2px; }
.ct-sugg { display: flex; flex-direction: column; gap: 4px; }
.ct-form .frow > label { min-width: 120px; }
.ct-form .ct-seg { align-self: flex-start; }
.ct-g { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; flex: none; }
.ct-mono { font-family: "Lucida Console", "Courier New", monospace; }
.ct-grid { display: grid; gap: 2px; }
.ct-icons { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); max-height: 130px; overflow: auto; }
.ct-colors { grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); }
.ct-pick { height: 26px; border: 0; background: var(--face); box-shadow: var(--raised); font: 15px/1 "Segoe UI Emoji", "Noto Color Emoji", sans-serif; cursor: default; padding: 0; }
.ct-pick.on { box-shadow: var(--pressed), 0 0 0 2px #000080; }
.ct-calc-disp { font: 18px "Lucida Console", monospace; text-align: right; }
.ct-calc-out { text-align: right; min-height: 18px; color: var(--sh); }
.ct-calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ct-calc-pad .btn { min-width: 0; }
@media (max-width: 720px) {
  .ct-cards, .ct-cards.c3 { grid-template-columns: repeat(2, 1fr); }
  .ct-two { grid-template-columns: 1fr; }
  .ct-card-v { font-size: 15px; }
  .ct-tbl .rm-hm { display: none; }
  .ct-form .frow > label { min-width: 90px; }
}

/* ---------- impresión de reportes ("Exportar PDF") ---------- */
#print-root { display: none; }
@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; color: #000; font: 11px/1.35 Arial, Helvetica, sans-serif; padding: 0; }
  #print-root h1 { font-size: 18px; margin: 0 0 2px; }
  #print-root h2 { font-size: 13px; margin: 14px 0 4px; }
  #print-root .pr-meta { color: #555; margin-bottom: 10px; }
  #print-root .pr-tbl { width: 100%; border-collapse: collapse; margin: 6px 0; }
  #print-root .pr-tbl th, #print-root .pr-tbl td { border: 1px solid #999; padding: 2px 5px; text-align: left; }
  #print-root .pr-tbl th { background: #e6e6e6; }
  #print-root .pr-tbl .r { text-align: right; }
  #print-root .pr-tot { font-weight: bold; }
  #print-root svg { max-width: 100%; height: auto; border: 1px solid #ccc; }
  @page { margin: 12mm; }
}

/* ventanas emergentes flotantes (arrastrables; los formularios también se redimensionan) */
.modal.floated { display: block; padding: 0; }
.dialog.floated { position: absolute; max-width: none; margin: 0; }
.dialog.floated.sized { display: flex; }
.dialog.floated.sized .form-body { flex: 1; min-height: 0; max-height: none; }
.dialog.floated .titlebar { touch-action: none; }

/* ---------- campanita de notificaciones (ntfy) ---------- */
.bell { position: relative; background: none; border: 0; padding: 0 2px; height: 20px; display: flex; align-items: center; cursor: default; }
.bell:active, .bell[aria-expanded="true"] { box-shadow: var(--pressed); }
#bell-n { position: absolute; top: -4px; right: -5px; min-width: 14px; height: 14px; padding: 0 3px; background: #c00000; color: #fff; font: bold 9px/14px var(--font); text-align: center; border-radius: 7px; box-shadow: 0 0 0 1px #fff; }
#bellbox { position: fixed; right: calc(4px + var(--sar)); bottom: calc(32px + var(--sab)); width: 360px; max-width: calc(100vw - 8px); max-height: min(520px, calc(100vh - 44px)); z-index: 70; background: var(--face); box-shadow: var(--raised), 2px 2px 0 var(--dk); padding: 3px; display: flex; flex-direction: column; }
#bellbox .titlebar .tb-btn { margin-left: 2px; }
.bb-list { flex: 1; min-height: 80px; overflow: auto; background: #fff; box-shadow: var(--sunken); margin: 4px 0; }
.bb-item { padding: 5px 8px; border-bottom: 1px solid #e0e0e0; user-select: text; -webkit-user-select: text; }
.bb-item.new { background: #ffffe1; }
.bb-item.hi .bb-t { color: #c00000; }
.bb-t { font-weight: bold; display: flex; gap: 6px; align-items: baseline; }
.bb-t small { margin-left: auto; font-weight: normal; color: var(--sh); white-space: nowrap; }
.bb-m { white-space: pre-wrap; overflow-wrap: anywhere; }
.bb-x { color: var(--sh); font-size: 11px; }
.bb-bar { display: flex; gap: 6px; padding: 2px 2px 4px; }
.bb-bar .btn { min-width: 0; }
.bb-empty { padding: 14px 10px; color: var(--sh); }

/* submenú Juegos del menú Inicio */
.sm-wrap { position: relative; display: flex; flex-direction: column; }
.sm-has { width: 100%; }
.sm-has .sm-arrow { margin-left: auto; font-size: 9px; }
.sm-has.open { background: var(--navy); color: #fff; }
.sm-sub { position: absolute; left: 100%; bottom: -3px; width: 190px; background: var(--face); box-shadow: var(--raised), 2px 2px 0 var(--dk); padding: 3px; display: flex; flex-direction: column; z-index: 61; }
@media (max-width: 720px) {
  .sm-sub { position: static; width: auto; box-shadow: none; padding: 0 0 0 22px; }
  .sm-has .sm-arrow { transform: rotate(0); }
  .sm-has.open .sm-arrow { transform: rotate(90deg); }
  .sm-item { padding: 12px 8px; }
}

/* ---------- Sudoku ---------- */
.sd { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; box-shadow: var(--raised); background: var(--face); outline: none; position: relative; z-index: 0; margin-top: 3px; }
.sd-top { display: flex; gap: 8px; align-items: center; flex: none; flex-wrap: wrap; }
.sd-diff { flex: none; width: auto; }
.sd-time { font: bold 15px "Lucida Console", monospace; min-width: 52px; text-align: right; }
.sd-errs { color: #c00000; font-weight: bold; }
.sd-bw { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sd-board { display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); background: #fff; box-shadow: var(--sunken); border: 2px solid #000; box-sizing: content-box; padding: 0; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sd-cell { display: flex; align-items: center; justify-content: center; font: calc(var(--c, 40px) * .58) var(--font); border-right: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0; color: #000080; cursor: default; position: relative; overflow: hidden; }
.sd-cell.br { border-right: 2px solid #000; } .sd-cell.bb { border-bottom: 2px solid #000; }
.sd-cell.gv { color: #000; font-weight: bold; background: #ececec; }
.sd-cell.pe { background: #dfe6ff; } .sd-cell.gv.pe { background: #d0d8f0; }
.sd-cell.same { background: #bcd0ff; }
.sd-cell.sel { background: #000080; color: #fff; }
.sd-cell.bad { color: #d00000; background: #ffd8d8; } .sd-cell.sel.bad { background: #a00000; color: #fff; }
.sd-notes { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; font-size: calc(var(--c, 40px) * .24); color: #404040; line-height: 1; }
.sd-notes span { display: flex; align-items: center; justify-content: center; }
.sd-cell.sel .sd-notes { color: #fff; }
.sd-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; flex: none; }
.sd-pb { min-width: 0; flex-direction: column; gap: 0; padding: 4px 0; min-height: 44px; }
.sd-pb b { font-size: 20px; }
.sd-pb small { font-size: 10px; color: var(--sh); line-height: 1; }
.sd-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: none; }
.sd-act .btn { min-width: 0; min-height: 30px; }
.sd-act .btn.on { box-shadow: var(--pressed); background-image: repeating-conic-gradient(var(--face) 0 25%, var(--hi) 0 50%); background-size: 2px 2px; font-weight: bold; }
@media (max-width: 720px) { .sd { padding: 6px; gap: 6px; } .sd-act .btn { flex: 1 1 28%; min-height: 36px; } .sd-chk { flex: 1 1 100%; } .sd-pb { min-height: 48px; } }

/* ---------- Solitario ---------- */
.sl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px; box-shadow: var(--raised); background: #008000; position: relative; z-index: 0; margin-top: 3px; --cw: 70px; --g: 6px; }
.sl-bar { display: flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; padding: 4px; background: var(--face); box-shadow: var(--raised); }
.sl-bar .btn { min-width: 0; min-height: 28px; }
.sl-draw { width: auto; flex: none; }
.sl-info { font-weight: bold; white-space: nowrap; }
.sl-board { flex: 1; min-height: 0; overflow: auto; touch-action: none; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; gap: var(--g); }
.sl-row { display: grid; grid-template-columns: repeat(7, var(--cw)); column-gap: var(--g); justify-content: center; flex: none; }
.sl-gap { grid-column: span 1; }
.sl-slot { position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); border: 2px dashed rgba(255, 255, 255, .35); border-radius: 4px; box-sizing: border-box; color: rgba(255, 255, 255, .55); display: flex; align-items: center; justify-content: center; font-size: calc(var(--cw) * .4); }
.sl-slot.tabc { height: auto; align-items: flex-start; }
.sl-slot .rc { pointer-events: none; }
.sl-slot .cnt { position: absolute; right: 3px; bottom: 2px; font-size: 11px; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.sl-slot.full { cursor: pointer; }
.sl-card { position: absolute; left: 0; width: var(--cw); height: calc(var(--cw) * 1.4); background: #fff; border: 1px solid #000; border-radius: 4px; box-shadow: 1px 1px 0 rgba(0, 0, 0, .4); box-sizing: border-box; color: #000; font-weight: bold; }
.sl-slot:not(.tabc) .sl-card { top: -2px; left: -2px; }
.sl-slot.found .sl-card, .sl-slot.full .sl-card { left: -2px; }
.sl-card.rd { color: #c00000; }
.sl-card.dn { background: #000080 repeating-conic-gradient(#1084d0 0 25%, #000080 0 50%) 0 0 / 6px 6px; color: transparent; }
.sl-card .cr { position: absolute; top: 2px; left: 4px; font-size: calc(var(--cw) * .24); line-height: 1; }
.sl-card .cs { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font-size: calc(var(--cw) * .5); line-height: 1; }
.sl-card.sel { outline: 3px solid #ffd700; outline-offset: -1px; z-index: 5; }
.sl-card.lifted { visibility: hidden; }
.sl-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.sl-layer .ghost { visibility: visible; box-shadow: 3px 3px 6px rgba(0, 0, 0, .5); }
.sl-slot.found .sl-card, .sl-slot .sl-card { cursor: default; }
@media (max-width: 720px) { .sl { padding: 4px; } .sl-bar .btn { min-height: 34px; } }

/* ayuda del Sudoku */
.sd-help h3 { margin: 0 0 6px; font-size: 14px; }
.sd-help p, .sd-help ul { margin: 6px 0; user-select: text; -webkit-user-select: text; }
.sd-help ul { padding-left: 18px; }
.sd-hn { color: var(--sh); }
.sd-hbar { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sd-hbar .btn { min-width: 0; }
.sd-hd { color: var(--sh); }
.sd-mini { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 270px); aspect-ratio: 1; margin: 6px auto; border: 2px solid #000; background: #fff; }
.sd-mc { display: flex; align-items: center; justify-content: center; font-size: 12px; border-right: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0; font-weight: bold; }
.sd-mc.br { border-right: 2px solid #000; } .sd-mc.bb { border-bottom: 2px solid #000; }
.sd-mc.hl { background: #bcd0ff; } .sd-mc.tg { background: #9ee89e; } .sd-mc.nt { font-size: 7px; font-weight: normal; color: #404040; line-height: 1; text-align: center; }

/* ---------- Correo Proton ---------- */
.px { flex: 1; min-height: 0; display: flex; gap: 6px; padding: 6px; box-shadow: var(--raised); background: var(--face); margin-top: 3px; position: relative; z-index: 0; }
.px > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; }
.px-folders { flex: none; width: 190px; }
.px-list { flex: none; width: 320px; }
.px-msg { flex: 1; }
.px-h { background: var(--navy); color: #fff; padding: 2px 6px; font-weight: bold; flex: none; }
.px-fl, .px-ml { flex: 1; min-height: 0; }
.px-ro { color: var(--sh); font-size: 11px; padding: 2px; }
.px-bar { display: flex; gap: 6px; flex: none; align-items: center; }
.px-bar .field { flex: 1; min-width: 0; }
.px-bar .btn { min-width: 0; }
.px-back { display: none; }
.px-row { padding: 4px 8px; border-bottom: 1px solid #e0e0e0; cursor: default; }
.px-row.sel { background: var(--navy); color: #fff; }
.px-row:focus-visible { outline: 1px dotted #ff0; outline-offset: -2px; }
.px-r1 { display: flex; gap: 6px; align-items: baseline; }
.px-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-r1 small { opacity: .7; white-space: nowrap; }
.px-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.px-row.unread .px-from, .px-row.unread .px-subj { font-weight: bold; opacity: 1; }
.px-more { padding: 6px; text-align: center; background: #fff; }
.px-head { flex: none; padding: 6px 8px; background: #fff; box-shadow: var(--sunken); user-select: text; -webkit-user-select: text; }
.px-s { font-weight: bold; font-size: 14px; padding-bottom: 4px; overflow-wrap: anywhere; }
.px-hr { display: flex; gap: 6px; overflow-wrap: anywhere; } .px-hr b { flex: none; min-width: 48px; }
.px-atts { padding-top: 4px; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.px-att { color: #000080; }
.px-body { flex: 1; min-height: 0; overflow: auto; background: #fff; box-shadow: var(--sunken); padding: 8px 10px; user-select: text; -webkit-user-select: text; }
.px-body pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--fs) var(--font); }
.px-note { color: var(--sh); padding-bottom: 6px; font-size: 11px; }
@media (max-width: 720px) {
  .px > div { display: none; flex: 1; width: auto; }
  .px[data-pane="folders"] .px-folders, .px[data-pane="list"] .px-list, .px[data-pane="msg"] .px-msg { display: flex; }
  .px-back { display: inline-flex; }
}

/* visor de correo: HTML aislado, galería de imágenes, cuentas */
.px-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.px-frame { flex: 1; min-height: 120px; width: 100%; border: 0; background: #fff; box-shadow: var(--sunken); }
.px-warn { background: #ffffe1; color: #000; padding: 4px 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; box-shadow: var(--sunken); }
.px-warn .btn { min-width: 0; min-height: 22px; padding: 1px 8px; }
.px-gal { flex: none; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 4px; background: #fff; box-shadow: var(--sunken); max-height: 130px; overflow: auto; }
.px-gi img { max-height: 90px; max-width: 150px; display: block; box-shadow: 0 0 0 1px #808080; }
.px-arow { display: flex; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--sh); }
.px-an { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.px-an small { color: var(--sh); }
.px-help { min-height: 40px; }
.px-oauth { display: flex; flex-direction: column; gap: 6px; }
.px-code { font: bold 24px "Lucida Console", monospace; letter-spacing: 3px; text-align: center; padding: 6px; background: #fff; box-shadow: var(--sunken); user-select: all; -webkit-user-select: all; }

/* retorno de OAuth */
.oa-box { max-width: 420px; margin: 15vh auto 0; padding: 16px; background: var(--face); box-shadow: var(--raised), 2px 2px 0 var(--dk); text-align: center; }
.oa-box.ok h3 { color: #006000; } .oa-box.bad h3 { color: #c00000; }
body:has(.oa-box) { overflow: auto; }
.px-uri { font-size: 12px; letter-spacing: 0; text-align: left; word-break: break-all; user-select: all; }

/* ---------- Clima ---------- */
.cl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; box-shadow: var(--raised); background: var(--face); margin-top: 3px; position: relative; z-index: 0; }
.cl-sel { flex: 1 1 200px; min-width: 0; }
.cl-bar .btn { min-width: 0; }
.cl-body { gap: 8px; }
.cl-now { padding: 14px 10px 10px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; flex: none; background: linear-gradient(180deg, #d4e6ff, #f4f9ff); }
.cl-big { display: flex; align-items: center; gap: 12px; }
.cl-ico { font: 64px/1 "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif; }
.cl-temp { font-size: 44px; font-weight: bold; line-height: 1; }
.cl-desc { font-size: 15px; }
.cl-grid { flex: 1; min-width: 260px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 12px; }
.cl-c { display: flex; flex-direction: column; } .cl-c small { color: #505050; }
.cl-sec { padding: 14px 8px 8px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.cl-hours { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.cl-h { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 0; background: #fff; box-shadow: var(--sunken); }
.cl-h.now { background: #ffffe1; }
.cl-h span { font: 22px/1.2 "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cl-h small { color: #505050; font-size: 10px; } .cl-h .rn { color: #0050c0; }
.cl-d { display: grid; grid-template-columns: 92px 28px 1fr 52px 34px minmax(70px, 160px) 34px; gap: 6px; align-items: center; padding: 3px 4px; border-bottom: 1px solid #d0d0d0; }
.cl-d:last-child { border-bottom: 0; }
.cl-dn { display: flex; flex-direction: column; } .cl-dn small { color: #505050; }
.cl-de { font: 20px/1 "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cl-dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-dr { color: #0050c0; font-size: 11px; }
.cl-tn { text-align: right; color: #404040; } .cl-tx { font-weight: bold; }
.cl-track { position: relative; height: 8px; background: #fff; box-shadow: var(--sunken); }
.cl-track i { position: absolute; top: 1px; bottom: 1px; background: linear-gradient(90deg, #0080ff, #ff8000, #e00000); }
.cl-res { max-height: 260px; min-height: 120px; }
.cl-res .lv-row small { color: var(--sh); margin-left: auto; }
@media (max-width: 720px) {
  .cl { padding: 6px; }
  .cl-temp { font-size: 36px; } .cl-ico { font-size: 52px; }
  .cl-d { grid-template-columns: 70px 26px 30px 1fr 30px; } .cl-dt, .cl-dr { display: none; }
}
