/* ============ VixOS — forex.vixtab.cz ============ */
:root {
  --bg: #050514;
  --card: rgba(96, 78, 220, 0.22);
  --card-border: rgba(167, 139, 250, 0.35);
  --glass: rgba(17, 14, 50, 0.72);
  --txt: #f1efff;
  --txt-dim: #b8b3e0;
  --neon: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #e879f9;
  --green: #34d399;
  --red: #f87171;
  --radius: 28px;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-body);
  overflow-x: hidden;
}

#bg3d {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ============ scene / layout ============ */
#scene {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  perspective: 1400px;
  padding: 18px clamp(12px, 4vw, 60px) 80px;
}

#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 0 26px;
}

#clock {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px);
  border-radius: 22px;
  padding: 8px 26px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
  animation: floaty 7s ease-in-out infinite;
}
#clock .time { font-size: 19px; color: var(--neon); }

#aimode {
  flex: 1 1 320px;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 6px 8px 6px 18px;
  transition: box-shadow .3s, border-color .3s;
  animation: floaty 8s ease-in-out infinite reverse;
}
#aimode:focus-within {
  border-color: var(--neon);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.45);
}
#aimode input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 8px 0;
}
#aimode input::placeholder { color: var(--txt-dim); }
.iconbtn {
  width: 38px; height: 38px;
  border-radius: 14px;
  border: none;
  background: rgba(139, 92, 246, 0.35);
  color: var(--txt);
  font-size: 17px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.iconbtn:hover { background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.iconbtn:active { transform: scale(0.86); }
.iconbtn.recording {
  background: var(--red);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.7); }
  50% { box-shadow: 0 0 0 12px rgba(248,113,113,0); }
}

#profilebtn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--card-border);
  font-size: 22px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
#profilebtn:hover { box-shadow: 0 0 22px var(--magenta); transform: rotate(12deg) scale(1.08); }

#aimode-status {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--neon);
  min-height: 18px;
  text-shadow: 0 0 12px rgba(34,211,238,.6);
}

/* ============ widget grid ============ */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
  max-width: 1500px;
  margin: 0 auto;
  transform-style: preserve-3d;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 20px 18px;
  min-height: 290px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .3s, border-color .3s;
  animation: floaty var(--float-dur, 9s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%),
              rgba(34,211,238,.18), transparent 55%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.card:hover { border-color: var(--neon); box-shadow: 0 0 34px rgba(34,211,238,.35), 0 18px 50px rgba(0,0,0,.5); }
.card:hover::before { opacity: 1; }
.card.bounce { animation: bounce .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes bounce {
  0% { transform: scale(1); }
  35% { transform: scale(.92); }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes floaty {
  0%,100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: .05em;
  text-shadow: 0 0 16px rgba(139,92,246,.7);
}
.card .preview { font-size: 13px; color: var(--txt-dim); }
.card .bigplus {
  position: absolute;
  bottom: 16px; left: 50%;
  translate: -50% 0;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2.5px solid var(--txt);
  display: grid; place-items: center;
  font-size: 26px;
  transition: transform .2s, border-color .2s, color .2s;
}
.card:hover .bigplus { border-color: var(--neon); color: var(--neon); transform: scale(1.12) rotate(90deg); }

.card.wide { grid-column: span 2; }
@media (max-width: 640px) { .card.wide { grid-column: span 1; } }

/* mini previews */
.mini-task {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.9);
  color: #1b1b2e;
  border-radius: 14px;
  padding: 7px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.mini-task .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.mini-task.done { opacity: .55; text-decoration: line-through; }

.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 12px; }
.mini-cal span {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 9px;
  color: var(--txt-dim);
  border-radius: 6px;
}
.mini-cal span.has { background: rgba(232,121,249,.4); color: var(--txt); box-shadow: 0 0 8px rgba(232,121,249,.5); }
.mini-cal span.today { outline: 1.5px solid var(--neon); color: var(--neon); }

.mini-msg {
  background: rgba(255,255,255,.92);
  color: #1b1b2e;
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
  max-width: 88%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-msg.me { margin-left: auto; background: rgba(34,211,238,.85); }

.mini-mail { font-size: 12px; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-mail b { color: var(--neon); }

.appgrid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.appicon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.appicon:hover { transform: translateY(-5px) scale(1.07); box-shadow: 0 0 20px var(--magenta); }
.appicon:active { transform: scale(.9); }

.weather-row { display: flex; justify-content: space-around; text-align: center; margin-top: 10px; }
.weather-row .wd { font-size: 12px; color: var(--txt-dim); }
.weather-row .wi { font-size: 34px; filter: drop-shadow(0 0 10px rgba(255,255,255,.3)); }
.weather-row .wt { font-size: 14px; font-weight: 700; color: var(--neon); }

.wx-loc { font-family: var(--font-display); font-size: 13px; color: var(--neon); margin-bottom: 8px; text-align: center; }
.wx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wx-chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid var(--card-border); color: var(--txt); transition: all .15s;
}
.wx-chip:hover { border-color: var(--violet); }
.wx-chip.active { background: rgba(139,92,246,.35); border-color: var(--violet); }
.wx-chip.add { color: var(--neon); border-style: dashed; }
.wx-chip .x { opacity: .5; padding-left: 2px; }
.wx-chip .x:hover { opacity: 1; color: var(--red); }

/* ====== Apple-weather ====== */
.wx-hero { text-align: center; padding: 18px 0 22px; }
.wx-now-temp { font-family: var(--font-display); font-size: 84px; line-height: .9; font-weight: 300; letter-spacing: -2px;
  background: linear-gradient(180deg,#fff,#bcd4ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.wx-now-cond { font-size: 18px; color: var(--txt); margin-top: 4px; }
.wx-now-hl { font-size: 15px; color: var(--txt-dim); margin-top: 4px; }
.wx-card { background: rgba(255,255,255,.05); border: 1px solid var(--card-border); border-radius: 18px; padding: 12px; margin-top: 12px; backdrop-filter: blur(8px); }
.wx-h { margin: 18px 0 6px; font-family: var(--font-display); font-size: 12px; color: var(--txt-dim); text-transform: uppercase; letter-spacing: .08em; }
.wx-hourly { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; cursor: grab; scroll-behavior: smooth; }
.wx-hourly.dragging { cursor: grabbing; scroll-behavior: auto; }
.wx-hourly::-webkit-scrollbar { height: 8px; }
.wx-hourly::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 4px; }
.wx-hourly::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 4px; }
.wx-hourly { scrollbar-width: thin; scrollbar-color: var(--violet) rgba(255,255,255,.05); }
.wx-hwrap { position: relative; }
.wx-harrow { position: absolute; top: 32%; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--card-border); background: rgba(20,16,40,.85); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.wx-harrow.l { left: -6px; } .wx-harrow.r { right: -6px; }
.wx-hcell { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 52px; padding: 6px 2px; }
.wx-hcell .h { font-size: 12px; color: var(--txt-dim); }
.wx-hcell .ic { font-size: 22px; }
.wx-hcell .pp { font-size: 10.5px; color: #5bc8ff; min-height: 13px; }
.wx-hcell .tp { font-size: 15px; font-weight: 700; }
.wx-drow { display: grid; grid-template-columns: 44px 28px 34px 1fr 34px; align-items: center; gap: 8px; padding: 7px 2px; }
.wx-drow + .wx-drow { border-top: 1px solid rgba(255,255,255,.06); }
.wx-drow .dn { font-size: 14px; }
.wx-drow .di { font-size: 19px; text-align: center; }
.wx-drow .lo { font-size: 14px; color: var(--txt-dim); text-align: right; }
.wx-drow .hi { font-size: 14px; font-weight: 700; text-align: right; }
.wx-drow .bar { position: relative; height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; }
.wx-drow .bar .fill { position: absolute; top: 0; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg,#34d3ee,#facc15,#f97316); }
.weather-week { display: flex; flex-direction: column; gap: 4px; }
.wx-wday { display: grid; grid-template-columns: 42px 28px 1fr 1fr; align-items: center; gap: 6px; font-size: 13px; padding: 2px 2px; }
.wx-wday .wd { color: var(--txt-dim); }
.wx-wday .wi2 { font-size: 17px; }
.wx-wday .wt { color: var(--neon); font-weight: 700; text-align: right; }
.wx-wday .wmin { color: var(--txt-dim); text-align: right; }

.spark-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.9); color: #1b1b2e;
  border-radius: 14px; padding: 6px 10px; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 600;
}
.spark-row canvas { margin-left: auto; }
.spark-row .chg.up { color: #059669; }
.spark-row .chg.down { color: #dc2626; }

/* ============ windows (popupy) ============ */
#winlayer {
  position: fixed; inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(3, 3, 16, 0.6);
  backdrop-filter: blur(6px);
  padding: 18px;
}
#winlayer.open { display: grid; }

.win {
  width: min(960px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  box-shadow: 0 0 60px rgba(139,92,246,.45), 0 40px 90px rgba(0,0,0,.6);
  backdrop-filter: blur(24px);
  animation: winin .44s cubic-bezier(.34,1.5,.5,1);
  transform-origin: center center;
  overflow: hidden;
}
@keyframes winin {
  0%   { transform: scale(.08); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.win.closing { animation: winout .26s cubic-bezier(.5,0,.75,0) forwards; }
@keyframes winout { to { transform: scale(.08); opacity: 0; } }

.win-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .04em;
}
.win-head .spacer { flex: 1; }
.win-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(248,113,113,.25);
  color: var(--red);
  font-size: 17px;
  cursor: pointer;
  transition: transform .15s, background .2s;
}
.win-close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }

.win-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}
.win-body::-webkit-scrollbar { width: 8px; }
.win-body::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 8px; }

/* ============ shared controls ============ */
.btn {
  background: linear-gradient(135deg, var(--violet), #6d4df0);
  border: none;
  color: #fff;
  border-radius: 14px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:hover { box-shadow: 0 0 22px rgba(139,92,246,.7); filter: brightness(1.12); }
.btn:active { transform: scale(.92); }
.btn.ghost { background: rgba(255,255,255,.08); border: 1px solid var(--card-border); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: wait; }

.input, textarea.input, select.input {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--neon); box-shadow: 0 0 16px rgba(34,211,238,.3); }
label.fld { display: block; font-size: 12px; color: var(--txt-dim); margin: 12px 0 5px; letter-spacing: .04em; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--txt-dim); font-size: 13px; }
.err { color: var(--red); font-size: 13px; }
.ok { color: var(--green); font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  background: rgba(255,255,255,.07);
  border: 1px solid transparent;
  color: var(--txt-dim);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.tab.active { background: rgba(139,92,246,.4); color: #fff; border-color: var(--violet); box-shadow: 0 0 14px rgba(139,92,246,.4); }

/* ============ kalendar ============ */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h4 { font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--txt-dim); padding-bottom: 4px; }
.cal-day {
  min-height: 72px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid transparent;
  padding: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-day:hover { border-color: var(--neon); transform: translateY(-2px); }
.cal-day.other { opacity: .3; }
.cal-day.today { border-color: var(--magenta); box-shadow: 0 0 14px rgba(232,121,249,.4); }
.cal-day.selected { background: rgba(139,92,246,.3); border-color: var(--violet); }
.cal-day .dnum { font-weight: 600; font-size: 13px; }
.cal-day.today .dnum { color: var(--magenta); }
.cal-dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-nav {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--card-border);
  background: rgba(255,255,255,.05); color: var(--txt); font-size: 18px; cursor: pointer;
  transition: all .2s;
}
.cal-nav:hover { background: rgba(139,92,246,.3); border-color: var(--violet); }
.apple-cal-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.apple-day {
  background: rgba(255,255,255,.04); border: 1px solid var(--card-border);
  border-radius: 18px; padding: 16px; min-height: 200px;
}
.apple-day-h { font-family: var(--font-display); font-size: 15px; font-weight: 500; margin-bottom: 12px; text-transform: capitalize; }
@media (max-width: 760px) { .apple-cal-layout { grid-template-columns: 1fr; } }
.cal-ev {
  font-size: 10px;
  border-radius: 6px;
  padding: 1.5px 5px;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-line {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.ev-line .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
.color-pick { display: flex; gap: 8px; }
.color-pick span {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .15s;
}
.color-pick span:hover { transform: scale(1.2); }
.color-pick span.sel { border-color: #fff; box-shadow: 0 0 12px currentColor; }

/* ============ tasks ============ */
.task-line {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.92);
  color: #16162a;
  border-radius: 16px;
  padding: 11px 14px;
  margin-bottom: 10px;
  animation: slidein .3s ease;
}
@keyframes slidein { from { transform: translateX(-26px); opacity: 0; } }
.task-line.done span { text-decoration: line-through; opacity: .5; }
.task-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--violet);
  background: none;
  cursor: pointer;
  flex: none;
  transition: all .2s;
}
.task-line.done .task-check { background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.task-del { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; opacity: .5; transition: opacity .2s, transform .15s; }
.task-del:hover { opacity: 1; transform: scale(1.2); }

/* ============ mail ============ */
.mail-layout { display: grid; grid-template-columns: 170px 1fr; gap: 16px; min-height: 420px; }
@media (max-width: 700px) { .mail-layout { grid-template-columns: 1fr; } }
.mail-side { display: flex; flex-direction: column; gap: 8px; }
.mail-side .tab { text-align: left; }
.mail-item {
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
  font-size: 13px;
}
.mail-item:hover { background: rgba(139,92,246,.25); transform: translateX(4px); }
.mail-item.unread { border-left: 3px solid var(--neon); }
.mail-item .mfrom { font-weight: 700; }
.mail-item .msub { color: var(--txt-dim); }
.mail-item .mdate { float: right; font-size: 11px; color: var(--txt-dim); }
.mail-detail-body {
  background: #fff; color: #111;
  border-radius: 16px;
  padding: 18px;
  font-size: 14px;
  overflow-x: auto;
  max-height: 45vh; overflow-y: auto;
}
.rt-toolbar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.rt-toolbar button {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,.07);
  color: var(--txt);
  cursor: pointer;
  font-size: 14px;
}
.rt-toolbar button:hover { background: var(--violet); }
.rich {
  min-height: 140px;
  background: #fff; color: #111;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  outline: none;
  max-height: 320px; overflow-y: auto;
}
.att-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,211,238,.18);
  border: 1px solid rgba(34,211,238,.4);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  margin: 4px 6px 0 0;
}
.att-chip button { background: none; border: none; color: var(--red); cursor: pointer; }
.mass-result { font-size: 13px; padding: 4px 0; }

/* ============ ai chat ============ */
.chat-box { display: flex; flex-direction: column; gap: 10px; min-height: 320px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.chat-msg {
  max-width: 78%;
  border-radius: 18px;
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  animation: slidein .25s ease;
}
.chat-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--neon), #0ea5e9); color: #06222e; }
.chat-msg.ai { align-self: flex-start; background: rgba(255,255,255,.92); color: #17172b; }
.chat-msg.thinking { opacity: .6; font-style: italic; }

/* ============ bars ============ */
.bars-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 700px) { .bars-layout { grid-template-columns: 1fr; } }
.bars-editor {
  min-height: 380px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.9;
  padding: 16px;
  resize: vertical;
  outline: none;
}
.bars-editor:focus { border-color: var(--magenta); box-shadow: 0 0 18px rgba(232,121,249,.3); }
.rhyme-cloud { display: flex; flex-wrap: wrap; gap: 8px; max-height: 380px; overflow-y: auto; }
.rhyme-chip {
  background: rgba(232,121,249,.18);
  border: 1px solid rgba(232,121,249,.4);
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.rhyme-chip:hover { background: var(--magenta); color: #fff; transform: scale(1.08); box-shadow: 0 0 14px var(--magenta); }
.rhyme-chip.strong { border-color: var(--neon); background: rgba(34,211,238,.18); }

/* ============ weather ============ */
.wx-hour {
  display: grid; grid-template-columns: 60px 40px 1fr 70px;
  align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13.5px;
}
.wx-hour:nth-child(odd) { background: rgba(255,255,255,.05); }
.wx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 14px 0; }
.wx-stat {
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}
.wx-stat .v { font-family: var(--font-display); font-size: 17px; color: var(--neon); }
.wx-stat .l { font-size: 11px; color: var(--txt-dim); margin-top: 4px; }
canvas.chart { width: 100%; border-radius: 16px; background: rgba(255,255,255,.04); }

/* ============ markets win ============ */
.mk-result {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 12px;
  cursor: pointer; font-size: 13.5px;
  transition: background .2s;
}
.mk-result:hover { background: rgba(139,92,246,.25); }
.mk-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 12px; align-items: center;
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .2s;
}
.mk-row:hover { background: rgba(139,92,246,.2); transform: translateX(4px); }
.mk-row .sym { font-weight: 700; }
.mk-row .nm { font-size: 11.5px; color: var(--txt-dim); }
.chg.up { color: var(--green); }
.chg.down { color: var(--red); }

/* toast */
#toast {
  position: fixed;
  bottom: 26px; left: 50%;
  translate: -50% 0;
  z-index: 99;
  background: var(--glass);
  border: 1px solid var(--neon);
  border-radius: 16px;
  padding: 12px 22px;
  font-size: 14px;
  box-shadow: 0 0 30px rgba(34,211,238,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, translate .3s;
}
#toast.show { opacity: 1; translate: -50% -8px; }

iframe.embed { width: 100%; height: 70vh; border: none; border-radius: 18px; background: #0a0a1e; }

/* ============ login ============ */
#loginlayer {
  position: fixed; inset: 0; z-index: 200;
  display: none; place-items: center;
  background: rgba(3,3,16,.82); backdrop-filter: blur(10px);
  padding: 20px;
}
.login-card {
  width: min(420px, 94vw);
  background: var(--glass);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 0 60px rgba(139,92,246,.45);
  backdrop-filter: blur(24px);
  animation: winin .5s cubic-bezier(.34,1.56,.64,1);
}
.login-logo {
  font-family: var(--font-display);
  font-size: 38px; text-align: center;
  letter-spacing: .04em;
  background: linear-gradient(120deg, var(--neon), var(--violet), var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(139,92,246,.5);
}

/* ============ hero / bublina ============ */
#hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(10px, 3vw, 40px);
  min-height: 64vh;
  position: relative;
  margin-bottom: 30px;
}
#bubble-wrap {
  justify-self: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all .4s cubic-bezier(.34,1.3,.5,1);
}
#bubble-wrap.corner {
  position: fixed; right: 8px; bottom: 8px; z-index: 120;
  justify-self: auto; margin: 0; pointer-events: auto;
  transform: scale(.34); transform-origin: bottom right;
  animation: cornerPop .42s cubic-bezier(.34,1.5,.5,1);
  cursor: pointer;
}
@keyframes cornerPop {
  0%   { transform: scale(.05); opacity: .3; }
  100% { transform: scale(.34); opacity: 1; }
}
#bubble-wrap.corner #bubble-hint { display: none; }
#bubble {
  width: clamp(240px, 40vw, 360px);
  height: clamp(240px, 40vw, 360px);
  filter: drop-shadow(0 0 50px rgba(139,92,246,.55));
  transition: transform .25s;
}
#bubble-wrap:hover #bubble { transform: scale(1.04); }
#bubble-hint {
  margin-top: 8px; font-size: 12.5px; color: var(--txt-dim);
  letter-spacing: .03em;
}
.hero-side {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 18px;
  max-width: 280px;
  animation: floaty 9s ease-in-out infinite;
}
#hero-markets { animation-direction: reverse; margin-left: auto; }
#hero-weather { margin-right: auto; }
.hero-loc { font-family: var(--font-display); font-size: 13px; margin-bottom: 10px; color: var(--neon); }
.hero-temp { font-family: var(--font-display); font-size: 40px; line-height: 1; margin-bottom: 12px; }
.hero-days { display: flex; flex-direction: column; gap: 6px; }
.hero-day { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.hero-day b { margin-left: auto; }
.hero-stock { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 4px 0; }
#scroll-cue {
  position: absolute; bottom: -6px; left: 50%; translate: -50% 0;
  font-size: 12px; color: var(--txt-dim);
  animation: floaty 2.4s ease-in-out infinite;
}

/* ============ fashion ============ */
.fashion-body h3 { font-family: var(--font-display); font-size: 15px; margin: 16px 0 6px; color: var(--magenta); }
.fashion-body p { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.fashion-body ul { margin: 6px 0 10px 18px; }
.fashion-body li { font-size: 14px; line-height: 1.6; }

/* ikona karty — skryta na desktopu, app-icon na mobilu */
.card-icon { display: none; }

/* ============ mobil responsivita ============ */
@media (max-width: 760px) {
  #grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px 10px;
    padding: 10px 6px 40px;
  }
  /* karta = app ikona */
  .card {
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(140deg, rgba(139,92,246,.4), rgba(232,121,249,.28));
    border-radius: 22px;
    animation: none;
    overflow: visible;
  }
  .card:hover { transform: none; }
  .card .preview, .card .bigplus { display: none !important; }
  .card .card-icon {
    display: block;
    font-size: 30px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
  }
  .card h3 {
    position: absolute; bottom: -22px; left: 50%; translate: -50% 0;
    font-size: 10.5px; font-weight: 500; line-height: 1.15;
    white-space: normal; text-align: center; margin: 0;
    text-shadow: 0 1px 4px #000;
    color: var(--txt);
    width: 100%; max-width: 100%;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .card.wide { grid-column: span 1; }

  #hero { grid-template-columns: 1fr; gap: 18px; min-height: auto; padding-top: 6px; }
  #hero .hero-side { max-width: 100%; margin: 0; }
  #bubble-wrap { order: -1; }
  #scroll-cue { display: none; }
  #winlayer { padding: 0; align-items: stretch; }
  .win { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .win-body { padding: 16px 14px; }
  .mail-layout { grid-template-columns: 1fr; }
  .bars-layout { grid-template-columns: 1fr; }
  #topbar { gap: 10px; }
  #aimode { flex: 1 1 100%; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, .card, .win { animation: none !important; transition: none !important; }
}

/* ---- potvrzovaci lista (rizikove akce) ---- */
.confirm-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: rgba(20,16,40,.95); border: 1px solid var(--violet);
  padding: 12px 18px; border-radius: 16px; z-index: 200;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); backdrop-filter: blur(12px);
  animation: cbIn .25s ease;
}
@keyframes cbIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---- efemerni okynko (vyjizdi z bubliny) ---- */
.eph-back {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,4,15,0); transition: background .35s ease;
}
.eph-back.show { background: rgba(5,4,15,.55); backdrop-filter: blur(3px); }
.eph-win {
  width: min(720px, 94vw);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 18px; overflow: hidden;
  transform: scale(.05); opacity: 0;
  transform-origin: center center;
  transition: transform .46s cubic-bezier(.34,1.5,.45,1), opacity .28s ease;
  box-shadow: 0 24px 80px rgba(139,92,246,.5);
}
.eph-back.show .eph-win { transform: scale(1); opacity: 1; }
.eph-back.hide .eph-win { transform: scale(.05); opacity: 0; }
.eph-win.eph-saved { transform: scale(.2) translate(46vw, 42vh); opacity: 0;
  transition: transform .5s cubic-bezier(.5,0,.7,0), opacity .5s ease; }
.eph-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-family: var(--font-display); font-size: 15px;
  background: linear-gradient(90deg, rgba(139,92,246,.3), rgba(232,121,249,.2));
}
.btn.small { padding: 6px 12px; font-size: 13px; }

/* ---- fashion tagy ---- */
.fa-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.fa-tag {
  padding: 7px 13px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: linear-gradient(135deg, rgba(236,72,153,.25), rgba(139,92,246,.25));
  border: 1px solid var(--card-border); color: var(--txt); transition: all .15s;
}
.fa-tag:hover { border-color: var(--magenta); transform: translateY(-1px); }
.chat-msg.thinking { opacity: .7; font-style: italic; }

/* ---- spinner "Vytvarim..." ---- */
.vix-spinner {
  width: 46px; height: 46px; margin: 0 auto; border-radius: 50%;
  border: 4px solid rgba(139,92,246,.25); border-top-color: var(--violet);
  animation: vixspin .8s linear infinite;
}
@keyframes vixspin { to { transform: rotate(360deg); } }
/* mazani okynka viditelne i na mobilu (mimo skryty preview) */
.cw-del-card {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(239,68,68,.85); color: #fff; border: none; cursor: pointer;
  font-size: 13px; line-height: 26px; text-align: center; padding: 0;
}
@media (max-width: 760px) { .cw-del-card { top: 2px; right: 2px; } }

/* ---- rohovy orb (mini-bublina u vsech oken) ---- */
#corner-orb {
  position: fixed; right: 18px; bottom: 18px; z-index: 130;
  width: 66px; height: 66px; border-radius: 50%;
  display: none; place-items: center; cursor: pointer;
  background: transparent; border: none; padding: 4px;
  filter: drop-shadow(0 8px 26px rgba(139,92,246,.6));
  transition: transform .15s ease, filter .2s ease;
  animation: orbFloat 3.2s ease-in-out infinite;
}
#corner-orb svg { display: block; border-radius: 50%; }
#corner-orb.show { display: grid; animation: orbPop .42s cubic-bezier(.34,1.6,.5,1), orbFloat 3.2s ease-in-out infinite .42s; }
#corner-orb:hover { transform: scale(1.1); filter: drop-shadow(0 10px 32px rgba(232,121,249,.8)); }
#corner-orb:active { transform: scale(.93); }
#corner-orb.listening { filter: drop-shadow(0 0 4px #34d399) drop-shadow(0 8px 28px rgba(52,211,153,.7)); }
#corner-orb.thinking { animation: orbThink 1s ease-in-out infinite; }
@keyframes orbPop { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes orbFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes orbThink { 0%,100% { filter: drop-shadow(0 8px 26px rgba(139,92,246,.6)); } 50% { filter: drop-shadow(0 0 8px rgba(232,121,249,.9)) drop-shadow(0 8px 30px rgba(232,121,249,.85)); } }
@media (max-width: 760px) { #corner-orb { right: 14px; bottom: 14px; width: 58px; height: 58px; } }

/* ---- presouvani karet ---- */
.card.dragging { opacity: .55; outline: 2px dashed var(--magenta); outline-offset: 4px; transform: scale(.97) !important; }
.card.drop-target { outline: 2px solid var(--neon); outline-offset: 4px; }

/* ---- layout "seznam aplikaci" (AI theme) ---- */
body.layout-list #grid { grid-template-columns: 1fr; max-width: 640px; margin-left: auto; margin-right: auto; }
body.layout-list .card { min-height: 84px; display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
body.layout-list .card .preview { display: none; }
body.layout-list .card .card-icon { display: block; font-size: 26px; }
body.layout-list .card h3 { margin: 0; }
body.layout-list .card .bigplus { position: static; font-size: 26px; margin-left: auto; }

/* orb = ziva mini bublina (canvas) */
#corner-orb canvas { width: 100%; height: 100%; display: block; }

/* ---- Davka 18: zvonek zprav (vedle profilu) ---- */
#msgs-bell {
  position: relative; background: var(--card, rgba(255,255,255,.06));
  border: 1px solid var(--card-border, rgba(255,255,255,.14)); color: var(--txt, #eee);
  border-radius: 12px; padding: 8px 12px; cursor: pointer; font-size: 16px; margin-right: 8px;
  transition: transform .12s ease;
}
#msgs-bell:hover { transform: scale(1.06); }
.msgs-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
  display: none; place-items: center; padding: 0 4px;
  background: var(--red, #f87171); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; box-shadow: 0 0 8px rgba(248,113,113,.6);
}
.msg-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.07); }
.msg-line.unread { background: rgba(139,92,246,.10); border-radius: 10px; }

/* ---- Davka 18: IDE ---- */
.ide-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ide-tab {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: var(--txt-dim, #aaa);
  padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
}
.ide-tab.on { color: var(--txt, #fff); border-color: var(--violet, #8b5cf6); background: rgba(139,92,246,.16); }
.ide-filebar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.ide-file {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); color: var(--txt-dim, #aaa);
  padding: 4px 10px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 12px; font-family: ui-monospace, monospace;
}
.ide-file.on { color: var(--neon, #22d3ee); border-bottom-color: transparent; background: rgba(34,211,238,.08); }
.ide-file.add { color: var(--green, #34d399); }
.ide-editor { height: 40vh; border: 1px solid rgba(255,255,255,.12); border-radius: 0 10px 10px 10px; overflow: hidden; }
.ide-plain { width: 100%; height: 100%; font-family: ui-monospace, monospace; font-size: 13px; background: #0d0d20; border: none; resize: none; }
.ide-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ide-console {
  background: #0a0a18; border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 10px; height: 24vh; overflow: auto; font-family: ui-monospace, monospace; font-size: 12px;
}
.ide-con-line { padding: 2px 0; color: #9fe8d0; white-space: pre-wrap; word-break: break-word; }
.ide-con-line.err { color: var(--red, #f87171); }
.ide-con-line.warn { color: #fbbf24; }
.ide-preview { background: #0a0a1e; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; height: 24vh; overflow: auto; }
.ide-frame { width: 100%; height: 100%; border: none; background: #fff; border-radius: 10px; }
.ide-fixed {
  background: #0d0d20; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  padding: 12px; font-size: 12px; overflow: auto; max-height: 40vh; white-space: pre-wrap;
}
@media (max-width: 760px) { .ide-split { grid-template-columns: 1fr; } .ide-editor { height: 34vh; } }

/* ---- Davka 19: IDE strom + layout + modal ---- */
.ide-layout { display: grid; grid-template-columns: 190px 1fr; gap: 8px; }
.ide-tree {
  background: #0b0b1c; border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 8px 6px; height: 40vh; overflow: auto; font-size: 12px;
}
.ide-tree-dir { padding: 3px 6px; cursor: pointer; color: var(--txt-dim,#aaa); border-radius: 6px; user-select: none; }
.ide-tree-dir:hover { background: rgba(255,255,255,.05); }
.ide-tree-file { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; color: var(--txt,#ddd); }
.ide-tree-file:hover { background: rgba(255,255,255,.05); }
.ide-tree-file.on { background: rgba(34,211,238,.10); color: var(--neon,#22d3ee); }
.ide-tree-del { background: none; border: none; color: rgba(255,255,255,.25); cursor: pointer; font-size: 11px; }
.ide-tree-file:hover .ide-tree-del { color: var(--red,#f87171); }
.ide-modal-ov {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(5,5,20,.72); backdrop-filter: blur(3px); border-radius: inherit;
}
.ide-modal {
  background: #12122a; border: 1px solid var(--violet,#8b5cf6); border-radius: 16px;
  padding: 18px; width: min(420px, 92%); box-shadow: 0 18px 50px rgba(0,0,0,.6);
  animation: orbPop .28s cubic-bezier(.34,1.6,.5,1);
}
@media (max-width: 760px) { .ide-layout { grid-template-columns: 1fr; } .ide-tree { height: 18vh; } }

/* ---- Davka 20: kalendar chips (iOS styl) ---- */
.cal-day.has-ev { background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.35); }
.cal-day.today { background: transparent; border: 2px solid var(--neon,#22d3ee); }
.cal-day.today.has-ev { background: rgba(139,92,246,.16); }
.cal-chips { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; overflow: hidden; }
.cal-chip {
  font-size: 9px; line-height: 1.3; padding: 1px 4px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
  color: var(--txt,#eee);
}
.cal-chip.more { background: rgba(255,255,255,.08); border-left: none; text-align: center; }
.cal-dots, .cal-dot { display: none; }

/* ---- Davka 20: potvrzeni cteni + fronta ---- */
.vix-confirm-ov {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center;
  background: rgba(5,5,20,.7); backdrop-filter: blur(4px);
}
.vix-confirm {
  background: #12122a; border: 1px solid var(--violet,#8b5cf6); border-radius: 16px;
  padding: 20px; width: min(400px, 92%); box-shadow: 0 18px 50px rgba(0,0,0,.6);
  animation: orbPop .28s cubic-bezier(.34,1.6,.5,1);
}

/* ---- Davka 20: IDE mobil ---- */
.ide-langwrap { display: flex; flex-direction: column; }
@media (max-width: 760px) {
  .ide-plain { font-size: 16px; }              /* iOS pod 16px zoomuje pri fokusu */
  .win { max-width: 100vw !important; width: 100vw !important; resize: none !important; }
  .ide-split { grid-template-columns: 1fr; }
  .ide-console, .ide-preview { height: 20vh; }
  .ide-tabs { position: sticky; top: 0; z-index: 5; background: inherit; }
}
#micbtn.recording { color: var(--red,#f87171); animation: orbThink 1s ease-in-out infinite; }

/* ---- fix: dropdowny (select) - citelne a hezke ---- */
select.input, select {
  color: var(--txt, #eef) !important;
  background: rgba(18,18,42,.95);
  border: 1px solid rgba(139,92,246,.4);
  border-radius: 10px;
  padding: 8px 10px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%238b5cf6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 30px; cursor: pointer;
}
select.input:focus, select:focus { outline: none; border-color: var(--neon, #22d3ee); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
/* rozbaleny seznam: tmave pozadi + svetly text (Chrome/FF to respektuji);
   kdyby prohlizec vnutil bily seznam, cerny text zustane citelny diky color-scheme */
select.input option, select option {
  background: #12122a;
  color: #eef;
}
select.input, select { color-scheme: dark; }
:root { color-scheme: dark; }   /* nativni prvky (dropdown popup, scrollbary) rovnou tmave - zadne bile bliknuti */

/* ---- Davka 21 ---- */
#bgfx { z-index: -1; }
html { background: var(--bg, #050514); }
body { background: transparent; }   /* hvezdy (canvas z:-1) lezi mezi html pozadim a obsahem */
* { -webkit-tap-highlight-color: transparent; }
select.input:active, select:active { background-color: rgba(18,18,42,.95); }

.msg-line.clickable { cursor: pointer; }
.msg-line.clickable:hover { background: rgba(139,92,246,.14); border-radius: 10px; }

.ide-empty { text-align: center; padding: 26px 10px; }

.share-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.share-col { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 8px; }
.share-col-h { font-size: 12px; font-weight: 700; color: var(--neon,#22d3ee); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08); }

.inv-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.06); flex-wrap: wrap; }
.inv-pl.pos { color: var(--green,#34d399); }
.inv-pl.neg { color: var(--red,#f87171); }

/* ---- Davka 23: banner nove verze ---- */
.sw-update {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 300; display: flex; gap: 12px; align-items: center;
  background: rgba(18,18,42,.97); border: 1px solid var(--violet,#8b5cf6);
  border-radius: 14px; padding: 10px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: orbPop .3s cubic-bezier(.34,1.6,.5,1); max-width: 92vw;
}
@media (max-width: 760px){ .sw-update { bottom: 84px; font-size: 13px; } }

/* ============ Davka 24: KONZOLE (vlevo vedle bubliny) ============ */
#vix-console {
  max-width: 340px; width: 340px; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; height: 420px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  animation: floaty 9s ease-in-out infinite;
}
.con-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--card-border); }
.con-title { font-family: var(--font-display); font-size: 13px; color: var(--neon); letter-spacing: .5px; }
.con-mini { background: rgba(255,255,255,.06); border: 1px solid var(--card-border); color: var(--txt-dim);
  border-radius: 8px; width: 26px; height: 24px; cursor: pointer; font-size: 12px; }
.con-mini:hover { color: var(--txt); border-color: var(--violet); }
.con-tabs { display: flex; gap: 4px; padding: 6px 10px 0; flex-wrap: wrap; }
.con-tab { background: rgba(255,255,255,.04); border: 1px solid var(--card-border); color: var(--txt-dim);
  border-radius: 8px 8px 0 0; padding: 4px 10px; font-size: 11px; cursor: pointer; display: flex; gap: 5px; align-items: center; }
.con-tab.on { color: var(--neon); border-color: var(--violet); background: rgba(139,92,246,.12); }
.con-x { opacity: .6; }
.con-body { flex: 1; overflow-y: auto; padding: 8px 12px; font-size: 11.5px; line-height: 1.5;
  scrollbar-width: thin; scrollbar-color: var(--violet) transparent; }
.con-body::-webkit-scrollbar { width: 6px; }
.con-body::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 3px; }
.con-line { display: flex; gap: 6px; padding: 1px 0; align-items: baseline; }
.con-ts { color: rgba(255,255,255,.28); font-size: 10px; flex-shrink: 0; }
.con-ic { flex-shrink: 0; width: 15px; text-align: center; opacity: .85; }
.con-tx { flex: 1; word-break: break-word; white-space: pre-wrap; }
.con-link { cursor: pointer; text-decoration: underline dotted rgba(255,255,255,.3); }
.con-link:hover { color: var(--neon); }
.lvl-think .con-tx { color: rgba(200,200,220,.65); font-style: italic; }
.lvl-search .con-tx { color: #7dd3fc; }
.lvl-source .con-tx, .lvl-cite .con-tx { color: #a5b4fc; }
.lvl-task .con-tx { color: #fcd34d; }
.lvl-info .con-tx { color: var(--txt-dim); }
.lvl-warn .con-tx { color: #fbbf24; }
.lvl-error .con-tx { color: var(--red); }
.lvl-ai .con-tx { color: var(--neon); font-weight: 600; }
.lvl-user .con-tx { color: #f9a8d4; }
.lvl-sys .con-tx { color: rgba(255,255,255,.4); }
.con-inrow { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--card-border); background: rgba(0,0,0,.2); }
.con-prompt { color: var(--neon); font-weight: 700; }
.con-input { flex: 1; background: transparent; border: none; outline: none; color: var(--txt);
  font-family: inherit; font-size: 12px; }
.con-input::placeholder { color: rgba(255,255,255,.3); }

/* mobil: konzole jako plovouci panel vyvolatelny (default schovana pod bublinou) */
@media (max-width: 760px) {
  #vix-console {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100vw; max-width: none;
    height: 72vh; z-index: 2000; animation: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.6);
    background: rgba(12,12,26,.98); backdrop-filter: blur(12px);
    transform: translateY(100%); transition: transform .28s cubic-bezier(.34,1.4,.5,1);
    display: flex; flex-direction: column;
  }
  #vix-console.open { transform: translateY(0); }
  #con-fab {
    position: fixed; left: 14px; bottom: 14px; z-index: 1999; width: 52px; height: 52px;
    border-radius: 16px; border: 1px solid var(--violet); background: rgba(18,18,42,.95);
    color: var(--neon); font-size: 20px; display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 8px 24px rgba(139,92,246,.4);
  }
  #vix-console .con-body { flex: 1; min-height: 0; }
}
@media (min-width: 761px) { #con-fab { display: none; } }

/* ---- Davka 25: Plany (orchestrator) ---- */
.plan-card { background: rgba(255,255,255,.04); border: 1px solid var(--card-border); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.plan-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.plan-steps { display: flex; flex-direction: column; gap: 6px; padding-left: 4px; }
.plan-step { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-left: 2px solid rgba(139,92,246,.3); padding-left: 10px; }

/* ---- Davka 26: thinking grupy (rozklikavaci), FS, rizeni procesu ---- */
.con-think-group { margin: 1px 0; }
.con-think-head { display: flex; gap: 6px; align-items: baseline; cursor: pointer; padding: 1px 0; opacity: .85; }
.con-think-head:hover { opacity: 1; }
.con-think-label { color: #a5b4fc; font-size: 11px; }
.con-think-prev { color: rgba(200,200,220,.5); font-style: italic; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-think-detail { margin: 2px 0 4px 22px; padding: 6px 10px; border-left: 2px solid rgba(139,92,246,.4);
  background: rgba(139,92,246,.06); border-radius: 0 8px 8px 0; }
.con-think-line { color: rgba(210,210,230,.75); font-style: italic; font-size: 11px; line-height: 1.5; margin-bottom: 3px; white-space: pre-wrap; }
.con-cwd { color: var(--neon); font-size: 10px; opacity: .7; }
.con-ctrl { display: inline-flex; gap: 3px; margin-left: auto; }
.con-cbtn { background: rgba(255,255,255,.08); border: 1px solid var(--card-border); color: var(--txt-dim);
  border-radius: 6px; width: 20px; height: 18px; font-size: 10px; cursor: pointer; padding: 0; }
.con-cbtn:hover { color: var(--neon); border-color: var(--violet); }
.lvl-fs .con-tx { color: #7dd3fc; font-weight: 600; }

/* ---- Davka 27: widgety v boardu + AI okynka ---- */
.board-widget { background: rgba(255,255,255,.03); border: 1px solid var(--card-border); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.board-widget-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--neon); border-bottom: 1px solid var(--card-border); }
.board-wframe { width: 100%; height: 42vh; border: none; background: #0a0a1e; display: block; }
@media (max-width: 760px){ .board-wframe { height: 50vh; } }

/* ---- OS-dependency hlaska u IDE appek co pouzivaji VixAI/VixStore ---- */
.ide-os-note { margin-top: 8px; padding: 7px 11px; font-size: 11px; color: #fbbf24; background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.25); border-radius: 10px; text-align: center; }

/* ---- fix33: zive psani kodu v konzoli ---- */
.con-think-detail.con-code { max-height: 320px; overflow-y: auto; background: rgba(34,211,238,.05); border-left-color: rgba(34,211,238,.4); }
.con-think-line.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-style: normal; color: #bfe3ff; white-space: pre; font-size: 10.5px; line-height: 1.45; margin-bottom: 0; }
.lvl-code .con-tx { color: #7dd3fc; }

/* ---- fix34: kredity + kod v konzoli ---- */
.usage-box { margin-top: 10px; padding: 9px 11px; background: rgba(139,92,246,.06); border: 1px solid var(--card-border); border-radius: 10px; }
.lvl-sys .con-tx { color: #9fbdac; }

/* ============================================================================
   MOBILNI OS SHELL (davka A-E) — jen na uzkych displejich.
   Zadny scroll stranky, 3 swipe obrazovky, trvaly top bar, app switcher.
============================================================================ */
@media (max-width: 760px) {
  body.m-os { overflow: hidden; height: 100dvh; position: fixed; inset: 0; width: 100vw;
    background-size: cover; background-position: center; background-attachment: scroll; }

  #m-shell { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 40; }

  /* --- TOP BAR --- */
  #m-topbar { display: flex; gap: 8px; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
    background: linear-gradient(180deg, rgba(10,10,24,.92), rgba(10,10,24,.55)); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--card-border); flex: 0 0 auto; }
  #m-input-wrap { flex: 1; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.07);
    border: 1px solid var(--card-border); border-radius: 999px; padding: 4px 6px 4px 14px; }
  #m-ai-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; padding: 7px 0; }
  #m-ai-input::placeholder { color: var(--muted); }
  .m-bar-btn { background: rgba(255,255,255,.07); border: 1px solid var(--card-border); border-radius: 999px;
    width: 38px; height: 38px; color: var(--text); font-size: 16px; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
  #m-input-wrap .m-bar-btn { width: 32px; height: 32px; border: none; background: rgba(139,92,246,.25); }

  /* --- PAGER + OBRAZOVKY --- */
  #m-pager { flex: 1; display: flex; width: 300vw; transform: translateX(-100vw);
    transition: transform .32s cubic-bezier(.3,.9,.35,1); min-height: 0; }
  .m-screen { width: 100vw; height: 100%; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; padding: 10px 12px 84px; }
  .m-scr-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em;
    margin: 2px 0 10px; text-align: center; }

  /* home: bublina + widget pod ni */
  #m-scr-home { display: flex; flex-direction: column; justify-content: flex-start; }
  #m-scr-home #hero { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 0; padding: 0; }
  #m-scr-home #bubble-wrap { order: 0; margin: 6px auto 2px; }
  #m-scr-home .hero-side { width: 100%; max-width: 420px; margin: 0 auto; }
  #m-scr-home #hero-weather { display: none; }        /* na home jen JEDEN vymenitelny widget */

  /* konzole vlevo */
  #m-scr-console { padding-bottom: 84px; }
  #vix-console.m-embed { position: static !important; transform: none !important; width: 100% !important;
    height: calc(100dvh - 190px) !important; max-width: none; border-radius: 14px; z-index: auto !important;
    display: flex !important; flex-direction: column; box-shadow: none; border: 1px solid var(--card-border);
    animation: none; }
  #vix-console.m-embed .con-body { flex: 1; min-height: 0; overflow-y: auto; }
  body.m-os #con-fab { display: none !important; }     /* FAB neni potreba, konzole ma vlastni obrazovku */

  /* aplikace vpravo */
  .m-scr-apps #grid { padding: 0 0 20px; gap: 22px 10px; }

  /* --- SPODNI NAVIGACE --- */
  #m-navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: flex; justify-content: center; align-items: center; gap: 14px;
    background: linear-gradient(0deg, rgba(10,10,24,.92), transparent); pointer-events: none; }
  #m-navbar > * { pointer-events: auto; }
  #m-dots { display: flex; gap: 8px; background: rgba(18,18,42,.85); border: 1px solid var(--card-border);
    border-radius: 999px; padding: 5px 8px; backdrop-filter: blur(10px); }
  .m-dot { background: none; border: none; color: var(--muted); font-size: 15px; width: 40px; height: 30px;
    border-radius: 999px; cursor: pointer; }
  .m-dot.on { color: var(--neon); background: rgba(139,92,246,.22); }
  #m-android { display: none; gap: 10px; }
  body.nav-buttons #m-android { display: flex; }
  body.nav-buttons #m-dots { display: none; }
  .m-nav-btn { background: rgba(18,18,42,.85); border: 1px solid var(--card-border); color: var(--text);
    width: 46px; height: 34px; border-radius: 10px; font-size: 15px; cursor: pointer; }

  /* --- APP SWITCHER --- */
  #m-switcher { position: fixed; inset: 0; z-index: 3000; background: rgba(6,6,16,.86); backdrop-filter: blur(16px);
    display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top,0px) + 16px) 12px 16px; }
  .m-sw-head { display: flex; justify-content: space-between; align-items: center; color: var(--text);
    font-family: var(--font-display); margin-bottom: 12px; }
  .m-sw-x { background: rgba(255,255,255,.08); border: none; color: var(--text); width: 34px; height: 34px;
    border-radius: 50%; font-size: 15px; cursor: pointer; }
  .m-sw-strip { flex: 1; display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding: 4px; }
  .m-sw-card { flex: 0 0 62vw; max-width: 260px; height: 62vh; background: rgba(20,20,45,.9);
    border: 1px solid var(--card-border); border-radius: 18px; padding: 12px; position: relative;
    display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
  .m-sw-card.live { border-color: var(--neon); box-shadow: 0 0 24px rgba(34,211,238,.18); }
  .m-sw-title { font-size: 13px; color: var(--text); font-weight: 600; padding-right: 26px; }
  .m-sw-thumb { flex: 1; display: grid; place-items: center; font-size: 46px; color: var(--muted);
    background: rgba(255,255,255,.04); border-radius: 12px; }
  .m-sw-tag { font-size: 10px; color: var(--neon); text-align: center; }
  .m-sw-close { position: absolute; right: 8px; top: 8px; background: rgba(255,255,255,.1); border: none;
    color: var(--text); width: 24px; height: 24px; border-radius: 50%; font-size: 11px; cursor: pointer; }
  .m-sw-empty { color: var(--muted); font-size: 13px; margin: auto; }

  /* okna pres shell */
  body.m-os #winlayer { z-index: 2500; }
  body.m-os #corner-orb { bottom: calc(env(safe-area-inset-bottom,0px) + 58px); }
}

/* ---- vymenitelny postranni widget ---- */
.hero-swap { margin-top: 10px; width: 100%; background: rgba(139,92,246,.16); border: 1px solid var(--card-border);
  color: var(--muted); border-radius: 8px; padding: 5px; font-size: 10px; cursor: pointer; letter-spacing: .06em; }
.hero-swap:hover { color: var(--neon); border-color: var(--neon); }
.hero-swap-menu { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 3200;
  background: rgba(16,16,36,.98); border: 1px solid var(--card-border); border-radius: 16px; padding: 14px;
  min-width: 240px; max-height: 70vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6); backdrop-filter: blur(16px); }
.hero-swap-title { font-family: var(--font-display); font-size: 13px; color: var(--neon); margin-bottom: 10px; }
.hero-swap-opt { display: block; width: 100%; text-align: left; background: rgba(255,255,255,.05);
  border: 1px solid transparent; color: var(--text); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px;
  font-size: 13px; cursor: pointer; }
.hero-swap-opt:hover { background: rgba(139,92,246,.2); }
.hero-swap-opt.on { border-color: var(--neon); color: var(--neon); }
.hero-swap-x { width: 100%; background: none; border: 1px solid var(--card-border); color: var(--muted);
  border-radius: 10px; padding: 8px; margin-top: 4px; cursor: pointer; font-size: 12px; }

/* ---- mobilni nastaveni v profilu ---- */
.mob-settings { border-top: 1px solid var(--card-border); margin-top: 12px; padding-top: 4px; }
.seg { display: flex; gap: 6px; margin-top: 6px; }
.seg-btn { flex: 1; background: rgba(255,255,255,.05); border: 1px solid var(--card-border); color: var(--muted);
  border-radius: 10px; padding: 9px 6px; font-size: 11px; cursor: pointer; }
.seg-btn.on { border-color: var(--neon); color: var(--neon); background: rgba(34,211,238,.1); }

/* ---- ziva miniatura vlastni appky v postrannim panelu ---- */
.hero-mini { position: relative; width: 100%; height: 190px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--card-border); background: rgba(0,0,0,.25); margin-top: 6px; }
.hero-mini-frame { width: 200%; height: 380px; border: 0; transform: scale(.5); transform-origin: 0 0; }
.hero-mini-open { width: 100%; margin-top: 6px; background: rgba(34,211,238,.12); border: 1px solid var(--card-border);
  color: var(--neon); border-radius: 8px; padding: 5px; font-size: 10px; cursor: pointer; }

/* ---- DESKTOP: styl "aplikace" = karty jako app ikony (ikonky se zobrazi) ---- */
@media (min-width: 761px) {
  body.layout-apps #grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 26px 14px; }
  body.layout-apps .card { min-height: 0; aspect-ratio: 1; padding: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px; background: transparent; border: none; box-shadow: none; }
  body.layout-apps .card .preview,
  body.layout-apps .card .bigplus { display: none; }
  body.layout-apps .card .card-icon { display: grid; place-items: center; width: 62px; height: 62px; font-size: 30px;
    background: linear-gradient(145deg, rgba(139,92,246,.35), rgba(34,211,238,.18)); border: 1px solid var(--card-border);
    border-radius: 18px; box-shadow: 0 8px 22px rgba(0,0,0,.35); transition: transform .18s; }
  body.layout-apps .card:hover .card-icon { transform: translateY(-4px) scale(1.06); }
  body.layout-apps .card h3 { font-size: 11px; text-align: center; margin: 0; }
  body.layout-apps .card .card-icon.ai-icon { padding: 8px; }
}
@media (max-width: 760px) {
  .m-sw-card.ghost { opacity: .55; height: 38vh; }
  .m-sw-card { transition: transform .12s, opacity .12s; }
}

/* ============================================================================
   MOBIL: aplikace pres CELOU plochu + long-press menu + OPTIMALIZACE (baterie)
============================================================================ */
@media (max-width: 760px) {
  /* --- appky fullscreen (jako mobilni OS) --- */
  body.m-os #winlayer { padding: 0; align-items: stretch; justify-items: stretch; }
  body.m-os #winlayer .win {
    width: 100vw !important; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: none; margin: 0; animation: mWinIn .22s ease-out;
  }
  body.m-os #winlayer .win.closing { animation: mWinOut .2s ease-in forwards; }
  @keyframes mWinIn { from { transform: translateY(16px); opacity: .6 } to { transform: none; opacity: 1 } }
  @keyframes mWinOut { to { transform: translateY(14px); opacity: 0 } }
  body.m-os #winlayer .win-head {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    position: sticky; top: 0; z-index: 5;
  }
  body.m-os #winlayer .win-body { height: auto; max-height: none; flex: 1;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 62px); }
  /* spodni lista (gesta/tlacitka) je vzdy nad appkou -> jde zavrit */
  body.m-os #m-navbar { z-index: 2600; }
  /* ZADNY krizek v rohu — appka se zavira gestem zespodu nebo tlacitkem ◁ (dle nastaveni) */
  body.m-os #winlayer .win-close { display: none !important; }
  body.m-os #winlayer .win-head { justify-content: center; }
  body.m-os #winlayer .win-head > span { text-align: center; }
  /* iOS gesto: uchyt dole pro zavreni appky */
  body.m-os.nav-gestures #winlayer .win::after { display: none; }

  /* --- long-press menu --- */
  .m-appmenu-ov { position: fixed; inset: 0; z-index: 3500; background: rgba(4,4,12,.6);
    display: flex; align-items: flex-end; padding: 14px; }
  .m-appmenu { width: 100%; background: rgba(22,22,44,.98); border: 1px solid var(--card-border);
    border-radius: 18px; padding: 8px; animation: mMenuIn .18s ease-out; }
  @keyframes mMenuIn { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
  .m-appmenu-title { font-family: var(--font-display); font-size: 12px; color: var(--muted);
    padding: 8px 12px 10px; }
  .m-appmenu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: none; border: none; color: var(--text); font-size: 15px; padding: 13px 12px;
    border-radius: 12px; cursor: pointer; }
  .m-appmenu-item:active { background: rgba(255,255,255,.08); }
  .m-appmenu-item.danger { color: #f87171; }
  .m-appmenu-ic { font-size: 17px; width: 22px; text-align: center; }
  .m-appmenu-x { width: 100%; background: rgba(255,255,255,.06); border: none; color: var(--muted);
    border-radius: 12px; padding: 12px; margin-top: 6px; font-size: 14px; cursor: pointer; }
  /* rezim posunu ikon */
  body.m-moving .card { animation: mJiggle .28s ease-in-out infinite alternate; }
  body.m-moving .card.m-drag { opacity: .65; transform: scale(1.12); z-index: 10; }
  @keyframes mJiggle { from { transform: rotate(-1.4deg) } to { transform: rotate(1.4deg) } }

  /* --- OPTIMALIZACE BATERIE: pryc s drahymi efekty na mobilu --- */
  .card { animation: none !important; }                 /* plovouci animace = trvaly repaint */
  #hero-weather, #hero-markets, .hero-side { animation: none !important; }
  /* backdrop-filter je na iOS extremne drahy -> nahrad plnou barvou */
  #m-topbar, #m-dots, #m-switcher, #vix-console.m-embed, .m-appmenu, .win, .card {
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  }
  #m-topbar { background: rgba(10,10,24,.96); }
  #m-switcher { background: rgba(6,6,16,.97); }
  #m-dots { background: rgba(18,18,42,.96); }
  /* pri parkovani/prepinani obrazovek nekresli bublinu vubec */
}

/* ============================================================================
   MOBILNI OS — hodiny, panel oznameni, seznam aplikaci, slozky, widgety, upravy
============================================================================ */
@media (max-width: 760px) {
  /* --- plocha = IKONY (ne karty s nahledem) --- */
  body.m-os .m-scr-apps #grid { grid-template-columns: repeat(4, 1fr); gap: 20px 6px; padding: 4px 2px 24px; }
  body.m-os .m-scr-apps .card { min-height: 0; aspect-ratio: auto; padding: 0; background: none; border: none;
    box-shadow: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  body.m-os .m-scr-apps .card .preview, body.m-os .m-scr-apps .card .bigplus { display: none !important; }
  body.m-os .m-scr-apps .card .card-icon { display: grid !important; place-items: center; width: 58px; height: 58px;
    font-size: 27px; background: linear-gradient(150deg, rgba(139,92,246,.42), rgba(34,211,238,.22));
    border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; }
  body.m-os .m-scr-apps .card h3 { font-size: 10.5px; text-align: center; margin: 0; line-height: 1.25;
    max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* --- hodiny --- */
  .m-clock { text-align: center; color: var(--text); }
  .m-clock-time { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: .02em; }
  .m-clock-date { font-size: 11px; color: var(--muted); text-transform: capitalize; }
  .m-clock.home .m-clock-time { font-size: 44px; }
  .m-clock.big .m-clock-time { font-size: 40px; }
  #m-home-clock { padding: 6px 0 2px; }

  /* --- panel oznameni (shora) --- */
  #m-notif { position: fixed; inset: 0 0 auto 0; z-index: 3200; transform: translateY(-102%);
    transition: transform .3s cubic-bezier(.3,.9,.35,1); max-height: 88dvh; }
  #m-notif.open { transform: translateY(0); }
  .m-notif-inner { background: rgba(10,10,26,.985); border-bottom: 1px solid var(--card-border);
    border-radius: 0 0 22px 22px; padding: calc(env(safe-area-inset-top,0px) + 16px) 14px 10px;
    box-shadow: 0 16px 50px rgba(0,0,0,.6); max-height: 88dvh; overflow-y: auto; }
  .m-notif-h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin: 16px 0 8px; }
  .m-notif-item { background: rgba(255,255,255,.05); border: 1px solid var(--card-border); border-radius: 12px;
    padding: 11px 12px; font-size: 13px; margin-bottom: 7px; color: var(--text); touch-action: pan-y; }
  .m-notif-item.unread { border-color: rgba(34,211,238,.5); }
  .m-notif-empty { color: var(--muted); font-size: 12px; padding: 8px 2px; }
  .m-notif-acct { display: flex; gap: 8px; margin-top: 10px; }
  .m-notif-btn { flex: 1; background: rgba(139,92,246,.18); border: 1px solid var(--card-border); color: var(--text);
    border-radius: 12px; padding: 11px; font-size: 12px; cursor: pointer; }
  .m-notif-grip { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.35);
    margin: 12px auto 2px; cursor: pointer; }

  /* --- seznam aplikaci (tazeni dolu) --- */
  #m-drawer { position: fixed; inset: 0; z-index: 3100; background: rgba(6,6,16,.55);
    display: flex; align-items: flex-end;
    opacity: 0; transition: opacity .2s ease; }
  #m-drawer.open { opacity: 1; }
  .m-drawer-hint { text-align: center; color: var(--muted); font-size: 10px; margin: 14px 0 4px; }
  .m-drawer-box { width: 100%; max-height: 82dvh; overflow-y: auto;
    background: rgba(13,13,27,.99); border-top: 1px solid rgba(255,255,255,.07);
    border-radius: 22px 22px 0 0; padding: 6px 14px calc(env(safe-area-inset-bottom,0px) + 16px); }
  .m-drawer-h { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; text-align: center; }
  .m-drawer-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; }
  .m-drawer-app { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
  .m-drawer-ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 25px;
    background: linear-gradient(150deg, rgba(139,92,246,.4), rgba(34,211,238,.2)); border: 1px solid var(--card-border); overflow: hidden; }
  .m-drawer-lbl { font-size: 10px; color: var(--text); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* --- slozky --- */
  .m-folder { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
  .m-folder-mini { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.09);
    border: 1px solid var(--card-border); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; }
  .m-folder-dot { background: rgba(139,92,246,.3); border-radius: 5px; display: grid; place-items: center;
    font-size: 11px; overflow: hidden; }
  .m-folder-name { font-size: 10.5px; color: var(--text); max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-fold-ov { position: fixed; inset: 0; z-index: 3300; background: rgba(6,6,16,.9); display: grid; place-items: center; padding: 16px; }
  .m-fold-box { width: 100%; max-width: 380px; background: rgba(20,20,44,.98); border: 1px solid var(--card-border);
    border-radius: 20px; padding: 16px; }
  .m-fold-name { width: 100%; background: rgba(255,255,255,.06); border: 1px solid var(--card-border); color: var(--text);
    border-radius: 10px; padding: 9px 12px; font-size: 15px; text-align: center; margin-bottom: 14px; }
  .m-fold-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; }
  .m-fold-app { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
  .m-fold-ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 23px;
    background: linear-gradient(150deg, rgba(139,92,246,.4), rgba(34,211,238,.2)); border: 1px solid var(--card-border); overflow: hidden; }
  .m-fold-lbl { font-size: 9.5px; color: var(--text); max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-fold-x { width: 100%; margin-top: 14px; background: rgba(255,255,255,.06); border: none; color: var(--muted);
    border-radius: 12px; padding: 11px; cursor: pointer; }

  /* --- widgety na plose --- */
  #m-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
  .m-widget { position: relative; background: rgba(255,255,255,.06); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 10px 11px; min-height: 92px; }
  .m-widget-h { font-size: 10px; color: var(--muted); margin-bottom: 6px; }
  .m-widget-line { font-size: 11px; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-widget .m-clock-time { font-size: 26px; }
  .m-widget-x { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%;
    background: #ef4444; color: #fff; border: none; font-size: 11px; cursor: pointer; }

  /* --- rezim uprav plochy --- */
  #m-editbar { position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom,0px) + 62px);
    z-index: 2700; background: rgba(20,20,44,.98); border: 1px solid var(--neon); border-radius: 14px;
    padding: 9px 10px; display: flex; align-items: center; gap: 8px; }
  .m-edit-hint { flex: 1; font-size: 10px; color: var(--muted); }
  .m-edit-add, .m-edit-done { background: rgba(139,92,246,.28); border: none; color: var(--text);
    border-radius: 9px; padding: 7px 10px; font-size: 11px; cursor: pointer; }
  .m-edit-done { background: var(--neon); color: #06202a; font-weight: 700; }
  body.m-editing .card, body.m-editing .m-folder { animation: mJig .3s ease-in-out infinite alternate; }
  @keyframes mJig { from { transform: rotate(-1.5deg) } to { transform: rotate(1.5deg) } }
  body.m-editing .card.m-drag, body.m-editing .m-folder.m-drag { animation: none; z-index: 20; opacity: .8; }
  .m-over .card-icon, .m-over .m-folder-mini { outline: none !important;
    transform: scale(1.14); transition: transform .15s ease;
    box-shadow: 0 0 0 4px rgba(255,255,255,.28), 0 10px 26px rgba(0,0,0,.45); }

  /* --- zavrit vse ve switcheru --- */
  .m-sw-all { margin-top: 10px; background: rgba(239,68,68,.18); border: 1px solid rgba(239,68,68,.5);
    color: #fca5a5; border-radius: 12px; padding: 12px; font-size: 13px; cursor: pointer; }
}
/* --- oznameni na PC: odsunutim do strany zmizi --- */
.msg-line { touch-action: pan-y; }

/* ---- nastaveni: rozklikavaci kategorie + prepinace ---- */
.set-sect { border: 1px solid var(--card-border); border-radius: 12px; margin-bottom: 8px; overflow: hidden;
  background: rgba(255,255,255,.03); }
.set-head { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none;
  border: none; color: var(--text); font-size: 13px; font-weight: 600; padding: 13px 14px; cursor: pointer;
  font-family: var(--font-display); }
.set-arrow { color: var(--muted); transition: transform .2s; font-size: 17px; }
.set-sect.open .set-arrow { transform: rotate(90deg); }
.set-body { display: none; padding: 0 14px 14px; }
.set-sect.open .set-body { display: block; }
.set-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 11px 12px; color: var(--text); font-size: 13px; cursor: pointer; }
.set-toggle-lbl { flex: 1; text-align: left; }
.set-knob { width: 40px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.16); position: relative;
  transition: background .18s; flex: 0 0 auto; }
.set-knob::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .18s; }
.set-toggle.on .set-knob { background: var(--neon); }
.set-toggle.on .set-knob::after { transform: translateX(18px); }

/* ============================================================================
   MOBIL: schovat PUVODNI stranku (prekryvala se s OS) + vratit pozadi
============================================================================ */
@media (max-width: 760px) {
  /* stara hlavicka (hodiny, AI radek, profil), zvonek, mini bublina v rohu, scroll napoveda
     — v OS rezimu je vsechno nahore v m-topbaru, tohle se jen prekreslovalo pres sebe a zralo vykon */
  body.m-os > #topbar,
  body.m-os #topbar,
  body.m-os #aimode,
  body.m-os #aimode-status,
  body.m-os #clock,
  body.m-os #profilebtn,
  body.m-os #msgs-bell,
  body.m-os #scroll-cue,
  body.m-os #corner-orb { display: none !important; }

  /* OPRAVA: AI mode radek ZIJE v #m-topbaru (presunuty ze stare stranky) —
     pravidlo vyse ho schovavalo i tam a input "zmizel". Tady ho vracime. */
  body.m-os #m-topbar #aimode { display: flex !important; }
  body.m-os #m-topbar #aimode-status { display: block !important; }
  body.m-os #m-topbar #aimode-status:empty { display: none !important; }

  /* POZADI (hvezdy) zpatky — canvas ma z-index -1, shell je nad nim a je pruhledny */
  body.m-os #bgfx { display: block !important; position: fixed !important; inset: 0 !important;
    z-index: 0 !important; opacity: .85; pointer-events: none; }
  body.m-os #m-shell { background: transparent; }
  body.m-os .m-screen { background: transparent; }
  body.m-os.has-custom-bg #bgfx { opacity: .3; }   /* pri vlastni fotce hvezdy jen jemne */
}

/* ---- mobil: nazvy aplikaci maji misto (2 radky), stejne jako slozky ---- */
@media (max-width: 760px) {
  body.m-os .m-scr-apps #grid { grid-template-columns: repeat(4, 1fr); gap: 26px 8px; align-items: start; }
  body.m-os .m-scr-apps .card h3,
  .m-folder-name, .m-drawer-lbl {
    font-size: 10.5px; font-weight: 500; line-height: 1.3; text-align: center; margin: 0;
    max-width: 82px; white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;   /* max 2 radky */
    text-overflow: ellipsis; color: var(--text); font-family: inherit; letter-spacing: 0;
  }
  .m-drawer-lbl { max-width: 76px; }
  body.m-os .m-scr-apps .card { justify-content: flex-start; }

  /* tecky (iOS styl) — zadne ikonky, jen kde jsem */
  #m-dots { gap: 9px; padding: 7px 12px; }
  .m-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.3);
    border: none; font-size: 0; transition: background .2s, transform .2s; }
  .m-dot.on { background: var(--neon); transform: scale(1.3); }
  /* navigace az POD teckami */
  #m-navbar { flex-direction: column; gap: 8px; }
  body.nav-buttons #m-dots { display: flex; }        /* tecky jsou videt i u tlacitek */

  /* ✕ odznak na mazani v rezimu uprav */
  .m-del { position: absolute; left: 4px; top: -4px; width: 20px; height: 20px; border-radius: 50%;
    background: #ef4444; color: #fff; border: none; font-size: 10px; line-height: 1; cursor: pointer; z-index: 5; }
  body.m-os .m-scr-apps .card { position: relative; }
  body:not(.m-editing) .m-del { display: none; }

  /* smazat vse v panelu zprav */
  .m-notif-btn.danger { background: rgba(239,68,68,.16); color: #fca5a5; }
}

/* ---- widgety patri mezi aplikace (ne na plochu s bublinou) ---- */
@media (max-width: 760px) {
  .m-scr-apps #m-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
  #m-scr-home #m-widgets { display: none; }
}

/* ---- mobil: navigacni tlacitka po CELE spodni hrane, bez orámování ---- */
@media (max-width: 760px) {
  body.nav-buttons #m-navbar { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2px); gap: 4px; }
  #m-android { display: none; width: 100%; }
  body.nav-buttons #m-android {
    display: flex; justify-content: space-around; align-items: center; width: 100%;
    padding: 4px 0 2px;
  }
  body.nav-buttons .m-nav-btn {
    flex: 1; background: none !important; border: none !important; box-shadow: none !important;
    color: var(--text); opacity: .78; height: 42px; width: auto; border-radius: 0;
    font-size: 17px; display: grid; place-items: center;
  }
  body.nav-buttons .m-nav-btn:active { opacity: 1; transform: scale(.9); }
  body.nav-buttons #m-dots { background: none; border: none; padding: 2px 0 0; }
}

/* ---- postranni widget = ZIVA mini verze appky (jako okynko na PC) ---- */
.hero-embed { position: relative; width: 100%; height: 200px; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--card-border); background: rgba(0,0,0,.22); margin-top: 6px; cursor: pointer; }
.hero-embed-in { width: 320%; transform: scale(.3125); transform-origin: 0 0; pointer-events: none; }
@media (max-width: 760px) {
  .m-widget .hero-embed { height: 120px; }
  #m-widgets .m-widget { min-height: 0; }
}

/* ---- widget = presne ctverec o 4 ikonach (2x2), sedi primo v mrizce aplikaci ---- */
@media (max-width: 760px) {
  .m-scr-apps #m-widgets, #m-scr-home #m-widgets { display: none; }   /* stary kontejner uz nepotreba */
  body.m-os .m-scr-apps .m-widget {
    grid-column: span 2; grid-row: span 2; margin: 0; min-height: 0;
    aspect-ratio: 1; overflow: hidden;
    background: rgba(255,255,255,.07); border: 1px solid var(--card-border); border-radius: 18px;
    padding: 9px 10px; display: flex; flex-direction: column;
  }
  body.m-os .m-scr-apps .m-widget .m-widget-b { flex: 1; min-height: 0; overflow: hidden; }
  body.m-os .m-scr-apps .m-widget .hero-embed { height: 100%; border: none; margin: 0; background: none; }
  body.m-os .m-scr-apps #grid { grid-auto-rows: min-content; }
}

/* ---- mobil: AI mode v horni liste = TA SAMA komponenta jako na PC (real-time prepis reci) ---- */
@media (max-width: 760px) {
  #m-topbar { flex-direction: column; gap: 4px; align-items: stretch; }
  #m-bar-row { display: flex; gap: 8px; align-items: center; }
  #m-topbar #aimode { flex: 1; max-width: none; margin: 0; animation: none !important;
    backdrop-filter: none !important; background: rgba(255,255,255,.07); padding: 4px 6px 4px 14px; }
  #m-topbar #aimode input { font-size: 14px; }
  #m-topbar #aimode-status { font-size: 11px; min-height: 14px; padding: 0 2px 2px; }
  #m-topbar #aimode-status:empty { display: none; }
}

/* ============================================================================
   MOBIL: STRANKY PLOCH (nove appky/widgety jdou na dalsi plochu vpravo)
============================================================================ */
@media (max-width: 760px) {
  .m-scr-apps { display: flex; flex-direction: column; padding-bottom: 78px; overflow: hidden; }
  .m-page {
    width: 100%; flex: 1; min-height: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(var(--m-rows, 4), 86px);   /* explicitni radky = volne bunky */
    gap: 16px 8px; align-content: start; padding: 4px 2px 8px; overflow: hidden;
  }
  /* stary #grid uz jen sklad schovanych dlazdic (na mobilu se nikdy nekresli) */
  body.m-os #grid { display: none !important; }
  /* dlazdice na strankach */
  .m-page .card, .m-page .m-folder { min-height: 0; aspect-ratio: auto; padding: 0; background: none; border: none;
    box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 4px; position: relative; align-self: start; height: 86px; }
  .m-page .card .preview, .m-page .card .bigplus { display: none !important; }
  .m-page .card .card-icon { display: grid !important; place-items: center; width: 58px; height: 58px;
    font-size: 27px; background: linear-gradient(150deg, rgba(139,92,246,.42), rgba(34,211,238,.22));
    border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; }
  .m-page .card h3, .m-page .m-folder-name {
    font-size: 10.5px; font-weight: 500; line-height: 1.3; text-align: center; margin: 0; max-width: 82px;
    height: 24px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: clip; color: var(--text); }
  .m-page .m-widget { grid-column: span 2; grid-row: span 2; aspect-ratio: 1; margin: 0; min-height: 0;
    background: rgba(255,255,255,.07); border: 1px solid var(--card-border); border-radius: 18px;
    padding: 9px 10px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
  .m-page .m-widget .m-widget-b { flex: 1; min-height: 0; overflow: hidden; }
  .m-page .m-widget .hero-embed { height: 100%; border: none; margin: 0; background: none; }
  /* placeholder pri tazeni = misto, kam ikona dopadne (okoli se rozestupuje FLIPem) */
  .m-ph { border-radius: 16px; background: rgba(255,255,255,.07); }
  .m-drag .card-icon, .m-drag .m-folder-mini { box-shadow: 0 14px 34px rgba(0,0,0,.55); }
  /* nativni aplikace: smazat nejde */
  .m-appmenu-item.disabled { opacity: .38; pointer-events: none; }
}

/* ============================================================================
   Dávka 38 — mobilni doladeni
============================================================================ */
@media (max-width: 760px) {
  /* 1) nazvy APLIKACI i SLOZEK vypadaji uplne stejne (font, rez, zadny stin) */
  body.m-os .m-page .card h3,
  body.m-os .m-page .m-folder-name {
    font-family: var(--font-body, inherit) !important;
    font-size: 10px !important; font-weight: 500 !important; line-height: 1.15 !important;
    letter-spacing: 0 !important; text-transform: none !important; text-shadow: none !important;
    color: var(--text) !important; margin: 0 !important; text-align: center !important;
    max-width: 82px; height: 28px; white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: clip;
  }

  /* 6) KALENDAR na telefonu jako iOS: cely mesic se vejde, zadne scrollovani okna;
        bunky kompaktni se ctverecky, udalosti dole (agenda skroluje jen uvnitr).
        Desktop se NEMENI (vse jen pod body.m-os). */
  body.m-os #winlayer .win-body:has(.apple-cal-layout),
  body.m-os #winlayer .win-body.cal-fit { overflow: hidden; display: flex; flex-direction: column; }
  body.m-os .apple-cal-layout { display: flex !important; flex-direction: column; gap: 10px;
    flex: 1; min-height: 0; }
  body.m-os .apple-cal { flex: 0 0 auto; }
  body.m-os .cal-head { margin-bottom: 8px; }
  body.m-os .cal-grid { gap: 4px; }
  body.m-os .cal-day { min-height: 0 !important; aspect-ratio: 1 / 1; padding: 2px !important;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 10px; transform: none !important; overflow: hidden; }
  body.m-os .cal-day .dnum { font-size: 12px; }
  body.m-os .cal-day .cal-chips { display: flex; gap: 3px; margin-top: 3px; justify-content: center; flex-wrap: nowrap; }
  body.m-os .cal-day .cal-chip { width: 14px; height: 3px; padding: 0 !important; font-size: 0 !important;
    line-height: 0; border-radius: 2px; overflow: hidden; border-left-width: 6px !important; }
  body.m-os .cal-day .cal-chip.more { display: none; }
  body.m-os .apple-day { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* ============================================================================
   Dávka 39 — mobilni doladeni II (poradek v lište, textech, oknech a navigaci)
============================================================================ */
@media (max-width: 760px) {
  /* 5(38)/1(39): AI prompt VLEVO — stare responsivni pravidlo #aimode{order:3}
     ho posilalo az ZA tlacitka. Tady ma poradi natvrdo. */
  body.m-os #m-bar-row #aimode { order: 0 !important; flex: 1 1 auto !important; min-width: 0; }
  body.m-os #m-bar-row .m-bar-btn { order: 1; flex: 0 0 auto; }

  /* 2(39): nazvy aplikaci PRESNE jako u slozek — stejny font, stejne mezery, nula marginu */
  body.m-os .m-page .card,
  body.m-os .m-page .m-folder {
    gap: 4px !important; padding: 0 !important; margin: 0 !important;
    justify-content: flex-start !important; align-self: start !important; height: 86px !important;
  }
  body.m-os .m-page .card h3,
  body.m-os .m-page .m-folder-name {
    font-family: var(--font-body, inherit) !important;
    font-size: 10.5px !important; font-weight: 500 !important; line-height: 1.3 !important;
    letter-spacing: 0 !important; text-transform: none !important; text-shadow: none !important;
    color: var(--text) !important; margin: 0 !important; padding: 0 !important;
    text-align: center !important; max-width: 82px !important; width: 82px !important;
    height: 24px !important; white-space: normal !important;
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden !important; text-overflow: clip !important;
  }

  /* 4(39): AI okynka pres CELOU obrazovku — iframe vyplni telo okna */
  body.m-os #winlayer .win-body.app-fit {
    display: flex; flex-direction: column; overflow: hidden;
    padding: 0 !important;
  }
  body.m-os.nav-buttons #winlayer .win-body.app-fit { padding-bottom: 62px !important; }  /* at obsah nekonci pod ◁ ○ ▢ */
  body.m-os #winlayer .win-body.app-fit > iframe {
    flex: 1 1 auto; min-height: 0; width: 100%; height: auto !important; border: none; border-radius: 0;
  }

  /* 5(39): NAVIGACE — iOS home indicator lista: jen v rezimu gest a jen kdyz bezi appka */
  #m-homebar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2700;
    height: calc(env(safe-area-inset-bottom, 0px) + 28px); touch-action: none; }
  #m-homebar::before { content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); width: 132px; height: 5px;
    border-radius: 3px; background: rgba(255,255,255,.6); box-shadow: 0 0 8px rgba(0,0,0,.4); }
  body.m-os.nav-gestures #m-homebar { display: block; }   /* home indicator vzdy v rezimu gest */
  /* v gestech pri otevrene appce tecky prekazi — misto nich je home indicator */
  body.m-os.nav-gestures #winlayer.open ~ #m-navbar { display: none; }
  /* v rezimu tlacitek zustava lista ◁ ○ ▢ VIDET i nad appkou (navbar zije na <body>) */
  body.m-os.nav-buttons #winlayer.open ~ #m-navbar { background: linear-gradient(180deg, transparent, rgba(4,4,14,.85) 45%); }
}

/* ============================================================================
   Dávka 40 — presouvani a widgety presne podle iOS
============================================================================ */
@media (max-width: 760px) {
  /* NALEZENA PRICINA odsazeni: zakladni .card h3 je position:absolute; bottom:-22px
     — nazev visel 22 px POD dlazdici. Slozky ho maji ve flow. Ted OBA stejne. */
  body.m-os .m-page .card h3,
  body.m-os .card.m-drag h3,
  body.m-os .m-page .m-folder-name,
  body.m-os .m-folder.m-drag .m-folder-name {
    position: static !important; bottom: auto !important; left: auto !important;
    translate: none !important; transform: none !important; width: 82px !important;
  }
  body.m-os .m-page .card .card-icon, body.m-os .card.m-drag .card-icon { margin: 0 !important; }

  /* tazena ikona VYPADAVALA ze selektoru .m-page (zije docasne na <body>)
     a chytala desktopovy vzhled karty — velke ramy/outliny. Tady drzi mobilni look. */
  body.m-os .card.m-drag, body.m-os .m-folder.m-drag, body.m-os .m-widget.m-drag {
    background: none !important; border: none !important; box-shadow: none !important;
    padding: 0 !important; outline: none !important; border-radius: 0 !important;
    display: flex !important; flex-direction: column; align-items: center; gap: 6px !important;
    aspect-ratio: auto !important; min-height: 0 !important;
  }
  body.m-os .card.m-drag .preview, body.m-os .card.m-drag .bigplus { display: none !important; }
  body.m-os .card.m-drag .card-icon { display: grid !important; place-items: center;
    width: 58px !important; height: 58px !important; font-size: 27px;
    background: linear-gradient(150deg, rgba(139,92,246,.42), rgba(34,211,238,.22));
    border: 1px solid var(--card-border) !important; border-radius: 16px !important; overflow: hidden;
    box-shadow: 0 16px 36px rgba(0,0,0,.6) !important; }
  body.m-os .m-folder.m-drag .m-folder-mini { box-shadow: 0 16px 36px rgba(0,0,0,.6) !important; }

  /* zadne oznacovani textu — vybrat jde JEN skutecny text/vstupy (inputy, konzole, kod) */
  body.m-os, body.m-os * { -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  body.m-os input, body.m-os textarea, body.m-os [contenteditable],
  body.m-os pre, body.m-os pre *, body.m-os code,
  body.m-os #vix-console, body.m-os #vix-console * {
    -webkit-user-select: text; user-select: text; }

  /* iOS editacni rezim: ＋ vlevo nahore, Hotovo vpravo nahore (pilulky) */
  #m-editbar { position: fixed; left: 12px; right: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 10px); bottom: auto;
    display: flex; justify-content: space-between; align-items: center;
    background: none; border: none; box-shadow: none; padding: 0; z-index: 2450;
    pointer-events: none; }
  #m-editbar .m-edit-plus { pointer-events: auto; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--card-border); background: rgba(18,18,34,.92); color: var(--text);
    font-size: 20px; line-height: 1; display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.45); }
  #m-editbar .m-edit-done { pointer-events: auto; padding: 9px 18px; border-radius: 999px;
    border: none; background: var(--neon); color: #08131a; font-weight: 700; font-size: 13px;
    box-shadow: 0 6px 18px rgba(0,0,0,.45); }

  /* galerie widgetu — spodni sheet jako na iOS */
  #m-wsheet { position: fixed; inset: 0; z-index: 3200; background: rgba(4,4,14,.55);
    opacity: 0; transition: opacity .2s ease; }
  #m-wsheet.open { opacity: 1; }
  #m-wsheet .m-wsheet-box { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72dvh;
    background: rgba(14,14,28,.97); border-radius: 22px 22px 0 0;
    border-top: 1px solid var(--card-border); padding: 10px 14px calc(env(safe-area-inset-bottom,0px) + 16px);
    transform: translateY(24px); transition: transform .22s ease; overflow-y: auto; }
  #m-wsheet.open .m-wsheet-box { transform: translateY(0); }
  .m-wsheet-grip { width: 42px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 2px auto 10px; }
  .m-wsheet-h { font-size: 16px; font-weight: 700; margin: 0 0 12px; text-align: center; }
  .m-wsheet-row { display: flex; align-items: center; gap: 12px; padding: 9px 2px;
    border-bottom: 1px solid rgba(255,255,255,.06); }
  .m-wsheet-prev { flex: 0 0 auto; width: 74px; height: 74px; border-radius: 18px;
    background: linear-gradient(150deg, rgba(139,92,246,.30), rgba(34,211,238,.14));
    border: 1px solid var(--card-border); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; }
  .m-wsheet-ic { font-size: 25px; }
  .m-wsheet-nm { font-size: 8.5px; color: var(--muted); }
  .m-wsheet-lbl { flex: 1; font-size: 13.5px; }
  .m-wsheet-add { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--card-border);
    background: rgba(255,255,255,.08); color: var(--text); font-size: 12px; }
  .m-wsheet-add.on { background: rgba(34,211,238,.18); border-color: var(--neon); color: var(--neon); }
}

/* Dávka 41 — plynulost dojezdu ikon pri preskupovani */
@media (max-width: 760px) {
  body.m-os .m-page .card, body.m-os .m-page .m-folder, body.m-os .m-page .m-widget { will-change: transform; }
}

/* ============================================================================
   Dávka 42 — slozky, widget-duch, iOS kalendar
============================================================================ */
@media (max-width: 760px) {
  /* WIDGET pri tazeni = jen seda dlazdice (zadny zivy render) */
  body.m-os .m-widget.m-widget-ghost > * { visibility: hidden !important; }
  body.m-os .m-widget.m-widget-ghost {
    background: rgba(150,150,170,.26) !important;
    border: none !important; border-radius: 20px !important;
    box-shadow: 0 18px 40px rgba(0,0,0,.5) !important; backdrop-filter: none !important;
  }

  /* slozka se rodi s "pop" efektem cilove ikony (jako iOS) */
  body.m-os .m-fold-pop .card-icon { animation: mFoldPop .36s cubic-bezier(.3,1.4,.5,1); }
  @keyframes mFoldPop { 0%{transform:scale(1)} 45%{transform:scale(.82)} 100%{transform:scale(1)} }

  /* dialog na jmeno slozky */
  #m-name-ov, .m-name-ov { position: fixed; inset: 0; z-index: 3400; background: rgba(4,4,14,.6);
    display: grid; place-items: center; padding: 22px; }
  .m-name-box { width: 100%; max-width: 320px; background: rgba(16,16,32,.98);
    border: 1px solid var(--card-border); border-radius: 20px; padding: 18px; text-align: center; }
  .m-name-h { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
  .m-name-inp { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--card-border);
    background: rgba(255,255,255,.06); color: var(--text); font-size: 15px; text-align: center; }
  .m-name-ok { margin-top: 14px; width: 100%; padding: 11px; border-radius: 999px; border: none;
    background: var(--neon); color: #08131a; font-weight: 700; font-size: 14px; }

  /* ---- iOS KALENDAR na mobilu: mesic bez udalosti v bunkach, den se vysune zespoda ---- */
  body.m-os .apple-cal-layout.m-cal-m { display: block !important; padding: 0; }
  body.m-os .apple-cal.cal-fit-m { display: block; }
  body.m-os .m-cal-m .cal-grid { gap: 6px; }
  body.m-os .m-cal-m .cal-dow { font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; }
  /* bunka = jen cislo dne, hezky velka, ctvercova; ZADNE chipy/text uvnitr (konec prekryvu) */
  body.m-os .m-cal-m .cal-day { aspect-ratio: 1/1; min-height: 0 !important; padding: 0 !important;
    display: flex; align-items: center; justify-content: center; position: relative;
    border-radius: 12px; background: rgba(255,255,255,.03); transform: none !important; overflow: visible; }
  body.m-os .m-cal-m .cal-day .dnum { font-size: 15px; font-weight: 500; }
  body.m-os .m-cal-m .cal-day.other { opacity: .32; }
  body.m-os .m-cal-m .cal-day.today { background: var(--neon); }
  body.m-os .m-cal-m .cal-day.today .dnum { color: #08131a; font-weight: 800; }
  body.m-os .m-cal-m .cal-day.selected { outline: 2px solid var(--neon); }
  /* udalosti v mesici jen jako tecky pod cislem */
  body.m-os .m-cal-m .cal-day .cal-chips { position: absolute; bottom: 5px; left: 0; right: 0;
    display: flex; gap: 3px; justify-content: center; }
  body.m-os .m-cal-m .cal-day .cal-chip { width: 5px; height: 5px; padding: 0 !important; margin: 0 !important;
    border: none !important; border-radius: 50%; font-size: 0 !important; line-height: 0; overflow: hidden;
    background: currentColor !important; }
  body.m-os .m-cal-m .cal-day .cal-chip.more { display: none; }

  /* denni SHEET zespoda */
  body.m-os .m-day-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2680;
    max-height: 72dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: rgba(14,14,28,.98); border-top: 1px solid var(--card-border);
    border-radius: 22px 22px 0 0; padding: 6px 16px calc(env(safe-area-inset-bottom,0px) + 18px);
    transform: translateY(102%); transition: transform .28s cubic-bezier(.22,.7,.25,1); }
  body.m-os .m-day-sheet.open { transform: translateY(0); }
  .m-day-grip { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3);
    margin: 8px auto 12px; }
  /* v sheetu at se "od-do" a "opakovani" NEPREKRYVAJI — pod sebou */
  body.m-os .m-day-sheet .row { flex-wrap: wrap; gap: 8px; }
  body.m-os .m-day-sheet .row > div { flex: 1 1 100% !important; }
  body.m-os .m-day-sheet .input { width: 100%; }
}

/* ============================================================================
   Dávka 43 — drag, gesta, swipe-hledani, kalendar/widget prekryv
============================================================================ */
@media (max-width: 760px) {
  /* 2: tecky ploch VIDET jen na plose/aplikacich, ne pri otevrene appce (uz reseno v gestech,
        tady i pro tlacitkovy rezim skryjeme pri otevrenem okne) */
  body.m-os #winlayer.open ~ #m-navbar #m-dots { display: none; }

  /* full-screen appka LEHCE NAD tlacitka (nie pod ne) */
  body.m-os.nav-buttons #winlayer .win { height: calc(100dvh - 54px) !important; }
  body.m-os.nav-buttons #winlayer .win-body { padding-bottom: 12px !important; }

  /* 6: widget na HLAVNI plose se nesmi prekryvat s teckami — kalendar/vetsi widgety zkrotit */
  body.m-os #m-scr-home .hero-side .hero-embed,
  body.m-os #hero-markets .hero-embed { max-height: 210px; overflow: hidden; }
  body.m-os #m-scr-home { padding-bottom: 80px; }   /* rezerva nad teckami */

  /* 5: SWIPE-DOWN hledani — fialovy input vyjede shora, jako iOS Spotlight */
  #m-search { position: fixed; inset: 0; z-index: 3300; background: rgba(4,4,16,.55);
    opacity: 0; transition: opacity .2s ease; }
  #m-search.open { opacity: 1; }
  #m-search-inp { position: absolute; top: calc(env(safe-area-inset-top,0px) + 74px); left: 16px; right: 16px;
    padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(139,92,246,.6);
    background: linear-gradient(180deg, rgba(139,92,246,.28), rgba(88,28,180,.22));
    color: #fff; font-size: 16px; box-shadow: 0 12px 34px rgba(88,28,180,.4);
    transform: translateY(-18px); transition: transform .24s cubic-bezier(.22,.7,.25,1); }
  #m-search.open #m-search-inp { transform: translateY(0); }
  #m-search-inp::placeholder { color: rgba(255,255,255,.7); }

  /* homebar switcher hint: pri vytazeni vys se lehce zvyrazni */
  #m-homebar.pull::before { background: var(--neon); width: 150px; }
}

/* ============================================================================
   Dávka 44 — dolaďení navigace, switcher a přechodů (iOS)
============================================================================ */
@media (max-width: 760px) {
  /* iOS "odhození" okna při gestu domů */
  body.m-os #winlayer .win.m-tossed {
    transition: transform .24s cubic-bezier(.4,0,.6,1), opacity .24s ease;
    transform: translateY(46vh) scale(.72); opacity: 0; transform-origin: 50% 100%;
  }

  /* přepínač spuštěných aplikací — iOS karty */
  #m-switcher { position: fixed; inset: 0; z-index: 3260; background: rgba(4,4,14,.72);
    display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top,0px) + 22px) 0 24px;
    opacity: 0; transition: opacity .2s ease; backdrop-filter: blur(6px); }
  #m-switcher.open { opacity: 1; }
  .m-sw-head { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; letter-spacing: .04em; }
  .m-sw-strip { flex: 1; display: flex; gap: 14px; overflow-x: auto; padding: 6px 20px; align-items: center;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .m-sw-strip::-webkit-scrollbar { display: none; }
  .m-sw-card { flex: 0 0 auto; width: 60vw; max-width: 300px; height: 62vh; scroll-snap-align: center;
    border-radius: 22px; background: linear-gradient(160deg, rgba(30,30,52,.96), rgba(16,16,32,.96));
    border: 1px solid var(--card-border); box-shadow: 0 20px 50px rgba(0,0,0,.6);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    position: relative; transition: transform .22s cubic-bezier(.22,.7,.25,1); will-change: transform; }
  #m-switcher.open .m-sw-card { animation: swIn .32s cubic-bezier(.22,.9,.3,1) backwards; }
  @keyframes swIn { from { transform: translateY(30px) scale(.94); opacity: 0; } }
  .m-sw-card.live { border-color: var(--neon); box-shadow: 0 20px 54px rgba(34,211,238,.28); }
  .m-sw-thumb { width: 74px; height: 74px; border-radius: 20px; display: grid; place-items: center;
    font-size: 34px; font-weight: 700; color: #fff;
    background: linear-gradient(150deg, rgba(139,92,246,.5), rgba(34,211,238,.32)); }
  .m-sw-title { font-size: 16px; font-weight: 600; }
  .m-sw-tag { font-size: 11px; color: var(--muted); }
  .m-sw-all { margin: 12px auto 0; padding: 10px 26px; border-radius: 999px; border: 1px solid var(--card-border);
    background: rgba(255,255,255,.08); color: var(--text); font-size: 13px; }

  /* drawer aplikací: vyjíždí ZESPODA (a zavírá se tažením dolů) */
}

/* ============================================================================
   Dávka 46 — drawer scroll + hledání, jistota dragu
============================================================================ */
@media (max-width: 760px) {
  /* scroll v seznamu aplikací VŽDY plynulý */
  #m-drawer .m-drawer-box { touch-action: pan-y; overscroll-behavior: contain; }

  /* pilulka Hledat dole (overlay nad seznamem) */
  .m-drawer-find { position: absolute; left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 2;
    padding: 11px 26px; border-radius: 999px; border: 1px solid var(--card-border);
    background: rgba(20,20,40,.96); color: var(--text); font-size: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.5); }

  /* radek hledani nad aplikacemi (objevi se po kliknuti na pilulku) */
  .m-drawer-srch { display: none; gap: 8px; align-items: center; margin: 4px 2px 12px; }
  .m-drawer-srch.on { display: flex; }
  .m-drawer-srch-inp { flex: 1; padding: 11px 14px; border-radius: 14px;
    border: 1px solid rgba(139,92,246,.55); background: rgba(139,92,246,.16);
    color: var(--text); font-size: 15px; }
  .m-drawer-srch-x { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--card-border); background: rgba(255,255,255,.07); color: var(--text); }
}

/* Dávka 51 — badge verze v notif panelu */
@media (max-width: 760px) {
  .m-build { font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: .02em; }
}

/* ============================================================================
   Dávka 52 — vstupni vrstva v2 (pointer events)
   touch-action:none na dlazdicich a plochach aplikaci = prohlizec NIKDY nesebere
   gesto pro nativni pan; kazdy pohyb prstu jde nam. TOHLE je fix pro realny telefon.
============================================================================ */
@media (max-width: 760px) {
  body.m-os .m-scr-apps .m-page,
  body.m-os .m-page .card,
  body.m-os .m-page .m-folder,
  body.m-os .m-page .m-widget,
  body.m-os .m-fold-app { touch-action: none; -webkit-user-drag: none; }
  body.m-os .m-page .card *, body.m-os .m-page .m-folder *, body.m-os .m-page .m-widget * { -webkit-user-drag: none; }
}

/* Dávka 54 — debug vypis (5x tuk na badge verze) */
@media (max-width: 760px) {
  #m-dbg { position: fixed; left: 8px; bottom: 92px; z-index: 5000; font: 11px/1.4 monospace;
    background: rgba(0,0,0,.75); color: #7CFC9A; padding: 6px 9px; border-radius: 8px; pointer-events: none; }
}

/* Dávka 55 — volne bunky: ph je pozicovany grid-areou (zadny min-content kolaps) */
@media (max-width: 760px) {
  body.m-os .m-page .m-ph { width: auto; height: auto; min-height: 0; }
}

/* Dávka 56 — widget nekrade pointer eventy (drag chytne vzdy kontejner widgetu) */
@media (max-width: 760px) {
  body.m-os .m-page .m-widget .m-widget-b, body.m-os .m-page .m-widget .m-widget-b *,
  body.m-os .m-page .m-widget .hero-embed, body.m-os .m-page .m-widget iframe { pointer-events: none !important; }
  body.m-os #m-editbar { z-index: 2460; }
}

/* ============================================================================
   Dávka 57 — Upravit aplikaci + Vix Store
============================================================================ */
.ae-h { font-size: 13px; color: var(--muted); margin-bottom: 6px; letter-spacing: .03em; }
.ae-prompt { width: 100%; padding: 12px 14px; border-radius: 14px; resize: vertical;
  border: 1px solid rgba(139,92,246,.5); background: rgba(139,92,246,.12);
  color: var(--text); font-size: 15px; font-family: inherit; margin-bottom: 10px; }
.ae-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.ae-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--card-border);
  background: rgba(255,255,255,.06); color: var(--text); font-size: 12px; cursor: pointer; }
.ae-chip:hover { background: rgba(255,255,255,.12); }
.ae-status { min-height: 20px; font-size: 12px; color: var(--muted); margin: 6px 0; }
.ae-status.ok { color: var(--green); } .ae-status.err { color: var(--red); }
.ae-status.busy { color: var(--neon); }
.ae-colls { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.ae-data { margin: 12px 0 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,.03); }
.ae-data-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ae-drow { display: flex; align-items: baseline; gap: 8px; padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; }
.ae-dname { color: var(--neon); flex: 0 0 auto; }
.ae-dcount { color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.ae-dlast { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 11px ui-monospace, Menlo, monospace; color: var(--muted); background: none; }
.ae-codewrap { border-top: 1px solid var(--card-border); padding-top: 10px; margin-top: 4px; }
.ae-codewrap summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.ae-code { width: 100%; min-height: 260px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: #0a0a1e; color: #d6e0ff;
  font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }


@media (max-width: 760px) {
  body.m-os .ae-code { min-height: 180px; }
  body.m-os .vs-app { padding: 10px; gap: 10px; }
  body.m-os .vs-ic { width: 42px; height: 42px; font-size: 22px; }
}

/* ============================================================================
   Dávka 58 — Vix Store: na počítači jako Microsoft Store, na telefonu jako App Store
============================================================================ */
.vs-body { padding: 0 !important; }
.vs-shell { display: flex; min-height: 60vh; }
.vs-nav { flex: 0 0 190px; padding: 18px 10px; border-right: 1px solid var(--card-border);
  display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,.02); }
.vs-navbtn { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; text-align: left; }
.vs-navbtn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.vs-navbtn.on { background: rgba(139,92,246,.22); color: var(--text); font-weight: 600; }
.vs-navic { font-size: 17px; }
.vs-main { flex: 1; min-width: 0; padding: 22px 26px 30px; overflow-y: auto; }
.vs-h1 { font-size: 26px; margin: 0 0 16px; letter-spacing: -.02em; }
.vs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vs-head .vs-h1 { margin-bottom: 12px; }
.vs-share { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--card-border);
  background: rgba(255,255,255,.08); color: var(--text); font-size: 16px; cursor: pointer; }
.vs-back { background: none; border: 0; color: var(--neon); font-size: 15px; cursor: pointer; padding: 0; }
.vs-card, .vs-hero, .vs-sect { min-width: 0; }
.vs-cname, .vs-cdev, .vs-hero-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-get { flex-shrink: 0; }
.vs-search { width: 100%; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,.06); color: var(--text); font-size: 14px; }

.vs-hero { display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: 20px; margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(139,92,246,.34), rgba(34,211,238,.18));
  border: 1px solid rgba(139,92,246,.35); }
.vs-hero-txt { flex: 1; min-width: 0; }
.vs-hero-tag { font-size: 10px; letter-spacing: .12em; color: var(--neon); margin-bottom: 4px; }
.vs-hero-name { font-size: 20px; font-weight: 700; }
.vs-hero-desc { font-size: 13px; color: var(--muted); margin: 3px 0 6px; }

.vs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vs-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--card-border); background: rgba(255,255,255,.04); transition: background .15s, transform .15s; }
.vs-card:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.vs-cmeta { flex: 1; min-width: 0; }
.vs-cname { font-size: 15px; font-weight: 600; }
.vs-cdev { font-size: 11px; color: var(--neon); }
.vs-cdesc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-ic { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center;
  font-size: 28px; object-fit: cover;
  background: linear-gradient(150deg, rgba(139,92,246,.42), rgba(34,211,238,.26)); }
.vs-ic.big { width: 78px; height: 78px; border-radius: 20px; font-size: 40px; }
.vs-get { flex: 0 0 auto; padding: 8px 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--violet), var(--neon)); color: #08081a;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.vs-get.got { background: rgba(255,255,255,.14); color: var(--text); }
.vs-empty { padding: 40px 10px; text-align: center; color: var(--muted); }
.vs-sub { font-size: 11px; color: var(--muted); }
.vs-dhead { display: flex; gap: 16px; align-items: center; padding: 20px 22px 6px; }
.vs-ddesc { padding: 0 22px; font-size: 14px; }
.vs-warn { margin: 12px 22px 20px; padding: 12px 14px; border-radius: 14px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); font-size: 12px; }
.vs-warn ul { margin: 6px 0; padding-left: 18px; }
.vs-ok { margin: 12px 22px 20px; padding: 10px 14px; border-radius: 14px; font-size: 12px;
  background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: var(--green); }
.vs-sect { margin-bottom: 22px; padding: 16px; border-radius: 18px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,.03); }
.vs-sect-h { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.vs-sect .input, .vs-sect textarea { width: 100%; margin-bottom: 8px; }
.vs-srcrow { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.vs-src { font-size: 12px; margin: 6px 0 4px; }
.vs-iconprev { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center;
  font-size: 28px; background: rgba(255,255,255,.08); border: 1px solid var(--card-border); }

/* TELEFON: opravdový App Store — plná výška, spodní navigace, nic nepřetéká */
@media (max-width: 760px) {
  body.m-os .vs-body { display: flex; flex-direction: column; overflow: hidden; }
  body.m-os .vs-shell { flex: 1 1 auto; min-height: 0; flex-direction: column-reverse; width: 100%; }
  body.m-os .vs-nav { flex: 0 0 auto; flex-direction: row; border-right: 0;
    border-top: 1px solid rgba(255,255,255,.08); padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 6px);
    background: rgba(10,10,24,.97); backdrop-filter: blur(14px); }
  body.m-os .vs-navbtn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px;
    border-radius: 12px; font-size: 10px; text-align: center; }
  body.m-os .vs-navbtn.on { background: none; color: var(--neon); }
  body.m-os .vs-navic { font-size: 20px; line-height: 1; }
  body.m-os .vs-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; padding: 14px 14px 18px; width: 100%; }
  body.m-os .vs-main * { max-width: 100%; }
  body.m-os .vs-h1 { font-size: 28px; font-weight: 800; margin: 2px 0 12px; }
  body.m-os .vs-search { padding: 11px 14px; font-size: 15px; border-radius: 12px; margin-bottom: 14px; }

  /* hero jako "App dne" */
  body.m-os .vs-hero { display: block; padding: 16px; border-radius: 18px; margin-bottom: 18px; text-align: left; }
  body.m-os .vs-hero .vs-ic.big { width: 66px; height: 66px; font-size: 34px; margin-bottom: 10px; }
  body.m-os .vs-hero-name { font-size: 19px; }
  body.m-os .vs-hero-desc { white-space: normal; }
  body.m-os .vs-hero .vs-get { margin-top: 10px; }

  /* seznam aplikací jako v App Storu */
  body.m-os .vs-grid { grid-template-columns: 1fr; gap: 0; }
  body.m-os .vs-card { border: 0; border-radius: 0; background: none; padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,.07); gap: 12px; }
  body.m-os .vs-card:last-child { border-bottom: 0; }
  body.m-os .vs-card:hover { background: none; transform: none; }
  body.m-os .vs-ic { width: 60px; height: 60px; border-radius: 14px; font-size: 30px; }
  body.m-os .vs-cname { font-size: 15px; }
  body.m-os .vs-cdesc { font-size: 12px; }
  body.m-os .vs-get { padding: 7px 16px; font-size: 11px; }

  /* detail a sekce vývojáře */
  body.m-os .vs-dhead { padding: 16px 14px 4px; }
  body.m-os .vs-ddesc, body.m-os .vs-warn, body.m-os .vs-ok { margin-left: 14px; margin-right: 14px; padding-left: 12px; padding-right: 12px; }
  body.m-os .vs-ddesc { padding: 0 0 4px; }
  body.m-os .vs-sect { padding: 14px; border-radius: 16px; }
  body.m-os .vs-sect .input, body.m-os .vs-sect textarea, body.m-os .vs-sect select { width: 100%; box-sizing: border-box; }
  body.m-os .vs-srcrow { flex-direction: column; }
  body.m-os .vs-srcrow .btn { width: 100%; }
  body.m-os .vs-sect .row { flex-wrap: wrap; }
  body.m-os .vs-empty { padding: 48px 12px; }
  body.m-os .ae-code { min-height: 150px; font-size: 11px; }
}

/* ============================================================================
   Dávka 61 — widgety na ploše: pevná výška, nic nepřetéká přes tečky ani gesta
============================================================================ */
@media (max-width: 760px) {
  /* dlaždice widgetu = přesně 2x2 buňky a NIC z ní nevyleze */
  body.m-os .m-page .m-widget { overflow: hidden; display: flex; flex-direction: column; }
  body.m-os .m-page .m-widget .m-widget-h { flex: 0 0 auto; font-size: 10px; opacity: .75;
    padding: 6px 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.m-os .m-page .m-widget .m-widget-b { flex: 1 1 auto; min-height: 0; overflow: hidden;
    padding: 0 8px 8px; }
  body.m-os .m-page .m-widget .hero-embed,
  body.m-os .m-page .m-widget .m-widget-mini { height: 100%; overflow: hidden; }
  /* velké obsahy (kalendář, trhy) se do dlaždice zmenší místo aby přetekly */
  body.m-os .m-page .m-widget .hero-embed-in { transform: scale(.78); transform-origin: top left;
    width: 128%; height: 128%; pointer-events: none; }
  body.m-os .m-page .m-widget-frame { width: 100%; height: 100%; border: 0; background: none; }
  body.m-os .m-page .m-widget .m-widget-line { font-size: 11px; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* kompaktní počasí */
  .wx-mini { height: 100%; display: flex; flex-direction: column; justify-content: center; }
  .wx-mini-ic { font-size: 26px; line-height: 1; }
  .wx-mini-t { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
  .wx-mini-p { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wx-mini-r { font-size: 10px; color: var(--muted); }
}

/* Dávka 63 — ověření aplikace (modrá hvězdička se zámkem) + síťová oprávnění */
.vs-verif { display: inline-flex; vertical-align: -3px; margin-left: 6px; }
.vs-blocked { margin-left: 8px; font-size: 10px; color: var(--red); }
.vs-net { margin: 12px 22px 0; padding: 9px 12px; border-radius: 12px; font-size: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--card-border); }
.vs-net.ok { color: var(--green); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }
.vs-chk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--card-border); cursor: pointer; }
.vs-chk input { margin-top: 3px; }
@media (max-width: 760px) {
  body.m-os .vs-net { margin-left: 14px; margin-right: 14px; }
}

/* Dávka 64 — Vývojář: krokované kategorie + aplikace přes odkaz */
.vs-acc { border: 1px solid var(--card-border); border-radius: 14px; margin-bottom: 10px;
  background: rgba(255,255,255,.03); overflow: hidden; }
.vs-acc > summary { cursor: pointer; padding: 12px 14px; display: flex; align-items: baseline; gap: 10px;
  list-style: none; font-size: 13px; }
.vs-acc > summary::-webkit-details-marker { display: none; }
.vs-acc > summary::after { content: '⌄'; margin-left: auto; color: var(--muted); transition: transform .2s; }
.vs-acc[open] > summary::after { transform: rotate(180deg); }
.vs-acc[open] > summary { border-bottom: 1px solid var(--card-border); }
.vs-acc-t { font-weight: 600; }
.vs-acc-s { font-size: 11px; color: var(--muted); }
.vs-acc > *:not(summary) { margin: 10px 14px; }
.vs-acc.sub { background: none; border-style: dashed; }
.vs-pick { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04);
  border: 1px solid var(--card-border); }
.vs-pick + .vs-pick { margin-top: 8px; }
.vs-pick-h { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.vs-pick-hint { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.vs-pick .input, .vs-pick select { width: 100%; }
.vs-src.ok { color: var(--green); }
.vs-src.err { color: var(--red); }
.cw-extbar { margin-bottom: 8px; padding: 8px 12px; border-radius: 12px; font-size: 12px;
  background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.35); }
@media (max-width: 760px) {
  body.m-os .vs-pick { padding: 10px; }
  body.m-os .vs-acc > *:not(summary) { margin: 8px 10px; }
  body.m-os .vs-pick .row { flex-direction: column; align-items: stretch; }
}

/* ============================================================================
   Dávka 65 — widget pod bublinou, přepínač s náhledy
============================================================================ */
@media (max-width: 760px) {
  /* widget pod bublinou má PEVNOU výšku a nikdy nesahá na tečky obrazovek */
  body.m-os #m-scr-home #hero-markets.hero-side {
    height: 132px; max-height: 132px; overflow: hidden; display: flex; flex-direction: column;
    padding: 10px 12px; box-sizing: border-box;
  }
  body.m-os #m-scr-home .hero-side .hero-embed { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  body.m-os #m-scr-home .hero-side .hero-temp { font-size: 30px; line-height: 1.1; }
  body.m-os #m-scr-home .hero-side .hero-days { display: flex; gap: 10px; font-size: 10px; }
  body.m-os #m-scr-home .hero-side .hero-day { display: flex; gap: 4px; }
  body.m-os #m-scr-home .hero-side .hero-loc { font-size: 10px; color: var(--muted); }

  /* přepínač: živý náhled aplikace místo písmena */
  .m-sw-thumb.shot { width: 78%; height: 46%; border-radius: 14px; overflow: hidden; padding: 0;
    background: #0a0a1e; border: 1px solid var(--card-border); }
  /* .m-sw-frame: stary orez (200% + scale .5) odstranen — nahled se dopocitava v JS */
}

/* ============ TELEFON: opravy nahledu a widgetu (davka v25) ============ */
@media (max-width: 760px) {
  /* nahled spustene aplikace ukazuje CELOU aplikaci, ne jen jeji roh */
  .m-sw-thumb.shot { position: relative; }
  .m-sw-frame { position: absolute; left: 0; top: 0; width: auto; height: auto;
    border: 0; transform-origin: top left; pointer-events: none; background: #0a0618; }

  /* widget na hlavnim screenu: vsechno se musi vejit bez scrollovani */
  .m-widget { --wf: 1; display: flex; flex-direction: column; overflow: hidden; }
  .m-widget-h { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
  .m-widget-swap { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; border: 0;
    background: rgba(255,255,255,.10); color: var(--muted); font-size: 12px; line-height: 1;
    display: grid; place-items: center; }
  .m-widget-swap:active { background: rgba(139,92,246,.35); color: #fff; }
  .m-widget-b { flex: 1 1 auto; min-height: 0; overflow: hidden;
    font-size: calc(11px * var(--wf)); line-height: 1.35; }
  .m-widget-b .m-widget-line { font-size: calc(11px * var(--wf)); margin-bottom: 2px; }
  .m-widget .m-clock-time { font-size: calc(26px * var(--wf)); }
  .m-widget-b * { max-width: 100%; }

  /* vyber widgetu */
  .m-wpick { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center;
    background: rgba(4,2,12,.62); backdrop-filter: blur(8px); }
  .m-wpick-b { width: min(86vw, 340px); max-height: 70vh; overflow: auto; padding: 16px;
    border-radius: 20px; background: rgba(16,10,32,.97); border: 1px solid var(--card-border);
    box-shadow: 0 24px 60px rgba(0,0,0,.7); }
  .m-wpick-t { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
  .m-wpick-i { padding: 12px 12px; border-radius: 12px; font-size: 14px; color: var(--text);
    background: rgba(255,255,255,.05); margin-bottom: 8px; }
  .m-wpick-i:active { background: rgba(139,92,246,.32); }
  .m-wpick-x { width: 100%; height: 40px; border: 0; border-radius: 12px; margin-top: 4px;
    background: rgba(255,255,255,.08); color: var(--text); font-size: 14px; }
}
