/* =====================================================================
   Kambana OS - touch: native-style menus, the home dot and app ring,
   the phone / tablet home screen and drawer, desktop icon sizes, and
   bars that never jump (system/touch.js, system/home.js, system/shell.js)
   ===================================================================== */

/* no grey flash, no "save image" callout, no text selection on long press */
#os { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
:where(.touch-ui #os) :where(button, [role="button"], .files-item, .desk-icon) { touch-action: manipulation; }

/* ---------------------------------------------------------------------
   Native-style context menu
   --------------------------------------------------------------------- */
:root { --nm-bg: rgba(36, 40, 52, .78); --nm-sep: rgba(0, 0, 0, .28); --nm-line: rgba(255, 255, 255, .09); --nm-danger: #ff6369; --nm-shade: rgba(6, 9, 16, .32); }
:root[data-theme="light"] { --nm-bg: rgba(250, 250, 252, .84); --nm-sep: rgba(20, 30, 50, .07); --nm-line: rgba(20, 30, 50, .1); --nm-danger: #e5484d; --nm-shade: rgba(20, 26, 40, .18); }
.menu.nm-layer {
  position: fixed; inset: 0; z-index: 8600; min-width: 0; max-width: none; padding: 0; border-radius: 0;
  background: none; animation: none; font-size: calc(15px * var(--fs, 1)); touch-action: none; -webkit-user-select: none; user-select: none;
}
.nm-shade {
  position: absolute; inset: 0; background: var(--nm-shade); opacity: 0; transition: opacity .28s ease;
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
}
.nm-layer.on .nm-shade { opacity: 1; }
.nm-layer.closing .nm-shade { transition-duration: .18s; }
.nm-ghost { border-radius: 14px; }
.nm-panel {
  position: absolute; z-index: 2; overflow: hidden auto; max-height: calc(100% - 32px); outline: none;
  border-radius: 16px; background: var(--nm-bg); color: var(--text);
  -webkit-backdrop-filter: blur(40px) saturate(1.8); backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: 0 22px 60px -14px rgba(0, 0, 0, .5), 0 0 0 .5px rgba(0, 0, 0, .25), inset 0 .5px 0 rgba(255, 255, 255, .12);
  overscroll-behavior: contain;
}
.no-glass .nm-panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
.nm-panel.nm-sheet {
  left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; max-width: 560px; margin: 0 auto;
  max-height: 74%; border-radius: 24px; padding-bottom: 6px;
}
.nm-grab { width: 100%; height: 24px; margin-bottom: -4px; padding: 0; border: 0; background: none; touch-action: none; cursor: grab; display: grid; place-items: center; }
.nm-grab::before { content: ''; width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: .6; }
.nm-sheet .nm-title { touch-action: none; }
.nm-sheet .nm-body { touch-action: pan-y; }
.nm-body { position: relative; }
.nm-group + .nm-group { border-top: 7px solid var(--nm-sep); }
.nm-title { padding: 11px 16px 9px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-item {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 0; background: none;
  color: var(--text); font: inherit; font-size: calc(15.5px * var(--fs, 1)); text-align: left; position: relative; transition: background .12s;
}
.nm-sheet .nm-item { min-height: 52px; font-size: calc(16px * var(--fs, 1)); }
.nm-item + .nm-item::before, .nm-title + .nm-item::before { content: ''; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--nm-line); }
.nm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-ic { display: grid; place-items: center; width: 22px; color: var(--text-2); flex: none; }
.nm-item.checked .nm-ic { color: var(--accent); }
.nm-item.danger, .nm-item.danger .nm-ic { color: var(--nm-danger); }
.nm-item:disabled { color: var(--text-3); }
.nm-item:disabled .nm-ic { opacity: .5; }
.nm-item:not(:disabled):active, .nm-item.hot { background: var(--press); }
@media (hover: hover) { .nm-item:not(:disabled):hover { background: var(--hover); } }
.nm-item:focus-visible { outline: none; background: rgba(var(--accent-rgb), .18); box-shadow: inset 3px 0 0 var(--accent); }
.nm-back { color: var(--accent); font-weight: 600; }
.nm-back .nm-ic { color: var(--accent); order: -1; width: 18px; }
[data-device="tv"] .nm-item { min-height: 58px; font-size: calc(19px * var(--fs, 1)); }
[data-device="car"] .nm-item { min-height: 64px; font-size: calc(20px * var(--fs, 1)); }

/* ---------------------------------------------------------------------
   Home dot (phone + tablet) and its first-time tip
   --------------------------------------------------------------------- */
:root #home-bar button.hb-dot {
  width: 76px; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  display: grid; place-items: center; cursor: pointer; touch-action: none; color: #fff; transition: transform .35s var(--spring);
}
.hb-disc {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(16, 20, 30, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 .5px rgba(255, 255, 255, .3), 0 2px 8px rgba(0, 0, 0, .35); transition: transform .3s var(--spring), box-shadow .2s;
}
.hb-logo { width: 16px; height: 16px; color: color-mix(in srgb, var(--accent) 55%, #fff); --sun: #ffb27a; }
.hb-dot.pressed .hb-disc { transform: scale(1.3); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .4), 0 0 16px rgba(var(--accent-rgb), .7); }
.hb-dot:focus-visible { outline: none; }
.hb-dot:focus-visible .hb-disc { box-shadow: 0 0 0 2px var(--accent); }
#home-bar.hinting .hb-disc { animation: hb-pulse 1.6s ease-in-out infinite; }
@keyframes hb-pulse { 0%, 100% { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .3), 0 0 0 0 rgba(var(--accent-rgb), .6); } 50% { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .3), 0 0 0 9px rgba(var(--accent-rgb), 0); } }
.hb-hint {
  position: absolute; z-index: 4700; left: 50%; bottom: 34px; width: min(320px, calc(calc(100 * var(--vw, 1vw)) - 32px)); padding: 12px 38px 12px 12px;
  display: flex; align-items: center; gap: 10px; border-radius: 16px; font-size: calc(13.5px * var(--fs, 1)); line-height: 1.4; color: var(--text);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); box-shadow: var(--shadow-pop);
  transform: translate(-50%, 14px) scale(.96); opacity: 0; transition: transform .45s var(--spring), opacity .25s; pointer-events: none;
}
.hb-hint.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.hb-hint::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: inherit; border-radius: 0 0 3px 0; }
.hb-hint-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .16); color: var(--accent); }
.hb-hint-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--tile); color: var(--text-2); display: grid; place-items: center; }

/* ---------------------------------------------------------------------
   App ring (hold the home dot)
   --------------------------------------------------------------------- */
.ring-layer { position: fixed; inset: 0; z-index: 8700; touch-action: none; -webkit-user-select: none; user-select: none; color: #fff; }
.ring-shade {
  position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(70% 55% at 50% 44%, rgba(var(--accent-rgb), .22), rgba(4, 7, 14, .78) 70%);
  -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
}
.ring-layer.on .ring-shade { opacity: 1; }
.ring-lines, .ring-lines svg { position: absolute; inset: 0; pointer-events: none; }
.ring-orbit { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 1.5; stroke-dasharray: 2 7; opacity: 0; transition: opacity .4s .15s, r .45s var(--spring); }
.ring-layer.on .ring-orbit { opacity: 1; }
.ring-ray { stroke: rgba(var(--accent-rgb), .9); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .2s; }
.ring-layer.tracking .ring-ray { opacity: .55; }
.ring-core {
  position: absolute; width: 132px; height: 132px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer;
  display: grid; place-items: center; color: color-mix(in srgb, var(--accent) 70%, #fff);
  transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(.16); opacity: .6;
  transition: transform .6s var(--spring), opacity .3s;
}
.ring-layer.on .ring-core { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.ring-layer.closing .ring-core { transition-duration: .3s; }
.ring-core.hot { transform: translate(-50%, -50%) scale(1.1) !important; }
.ring-logo-wrap { position: relative; display: grid; }
.ring-logo { --sun: #ffb27a; filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .55)); }
.ring-logo circle:first-child { stroke-dasharray: 70; stroke-dashoffset: 70; }
.ring-logo circle:last-child { transform-origin: 16px 16px; transform: scale(0); }
.ring-layer.on .ring-logo circle:first-child { animation: draw .8s .08s var(--ease) forwards; }
.ring-layer.on .ring-logo circle:last-child { animation: sun .5s .5s var(--spring) forwards; }
.ring-layer.on .ring-logo-wrap { animation: ring-spin 14s linear .9s infinite; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.ring-glow { position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb), .45), transparent 68%); filter: blur(10px); animation: ring-breathe 2.4s ease-in-out infinite; }
.ring-core.hot .ring-glow { background: radial-gradient(circle, rgba(var(--accent-rgb), .8), transparent 70%); }
@keyframes ring-breathe { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.12); opacity: 1; } }
.ring-caption { position: absolute; left: 16px; right: 16px; text-align: center; font-size: calc(14.5px * var(--fs, 1)); font-weight: 600; letter-spacing: .01em; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .3s .25s; pointer-events: none; }
.ring-layer.on .ring-caption { opacity: .92; }
.ring-card {
  position: absolute; width: 0; height: 0; z-index: 2;
  transform: translate(var(--fx), var(--fy)) scale(.15); opacity: 0;
  transition: transform .58s var(--spring) var(--d, 0ms), opacity .25s var(--d, 0ms), left .5s var(--spring), top .5s var(--spring);
}
.ring-layer.on .ring-card { transform: none; opacity: 1; }
.ring-layer.closing .ring-card { transition-delay: 0ms; transition-duration: .28s; }
.ring-card.gone { opacity: 0 !important; transform: translateY(-50px) scale(.5) !important; transition: transform .26s ease-in, opacity .22s !important; }
.ring-card-in { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-1 * var(--rs) / 2 - 4px)); width: calc(var(--rs) + 44px); display: flex; flex-direction: column; align-items: center; transition: transform .3s var(--spring), opacity .2s; }
.ring-app { border: 0; padding: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; font: inherit; }
.ring-app .appicon { --s: var(--rs) !important; box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .6) !important; transition: transform .3s var(--spring), box-shadow .2s; }
.ring-card.hot .ring-app .appicon { transform: scale(1.24); box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 28px rgba(var(--accent-rgb), .9), 0 14px 30px -6px rgba(0, 0, 0, .6) !important; }
.ring-app:focus-visible { outline: none; }
.ring-app:focus-visible .appicon { box-shadow: 0 0 0 3px var(--accent) !important; }
.ring-name { max-width: calc(var(--rs) + 40px); font-size: calc(12px * var(--fs, 1)); font-weight: 600; line-height: 1.2; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring-x {
  position: absolute; top: -8px; right: 10px; width: 26px; height: 26px; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; color: #fff; background: rgba(40, 44, 56, .92); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 4px 10px rgba(0, 0, 0, .4);
  opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s var(--spring); pointer-events: none;
}
.ring-layer.tap .ring-x { opacity: 1; transform: none; pointer-events: auto; }

/* ---------------------------------------------------------------------
   Phone + tablet home screen
   --------------------------------------------------------------------- */
#home { display: none; }
:root:is([data-layout="mobile"], [data-layout="tablet"]) :is(#desktop, #dock, #home-grid) { display: none !important; }
:root:is([data-layout="mobile"], [data-layout="tablet"]) #home {
  display: block; position: absolute; left: 0; right: 0; top: 34px; bottom: 0; overflow: hidden;
  touch-action: none; -webkit-user-select: none; user-select: none;
  transition: transform .5s cubic-bezier(.2, .9, .25, 1), opacity .4s ease;
}
[data-layout="tablet"] #home { top: 32px; }
#home.hm-behind { transform: scale(.94); opacity: .55; }
.locked #home { visibility: hidden; }
.unlocking #home { animation: unlock-in .8s var(--ease); }
.overview #home { opacity: 0; pointer-events: none; }
:root:is([data-layout="mobile"], [data-layout="tablet"]) #wallpaper { transform: translateX(var(--hm-par, 0px)) scale(1.08); transition: transform .5s cubic-bezier(.2, .9, .22, 1), filter .5s; }
.hm-paging #wallpaper { transition: none !important; }

.hm-view, .hm-foot, .hm-dock-wrap, .hm-editbar {
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, .9, .25, 1);
  opacity: calc(1 - var(--hm-dp, 0) * .92); transform: scale(calc(1 - var(--hm-dp, 0) * .05));
}
.hm-view { position: absolute; left: 0; right: 0; top: var(--hm-top, 10px); height: var(--hm-view-h, 70%); overflow: hidden; }
.hm-track { display: flex; height: 100%; will-change: transform; }
.hm-page {
  flex: 0 0 100%; height: 100%; box-sizing: border-box; padding: 0 var(--hm-pad, 16px);
  display: grid; grid-template-columns: repeat(var(--hm-cols, 4), minmax(0, 1fr)); grid-template-rows: repeat(var(--hm-rows, 6), minmax(0, 1fr));
  align-items: center; justify-items: center; transform: translateY(var(--hm-pull, 0px)); transition: transform .35s var(--spring);
}
.hm-icon {
  position: relative; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: #fff; font: inherit; font-size: var(--hm-label-size, 11.5px); font-weight: 500; line-height: 1.25; max-width: 100%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55); cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none;
}
[data-wp-tone="light"] .hm-page .hm-icon { color: #10131a; text-shadow: 0 1px 2px rgba(255, 255, 255, .55); }
.hm-icon .appicon { --s: var(--hm-icon, 60px) !important; transition: transform .28s var(--spring), filter .2s; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45); }
.hm-icon:active .appicon { transform: scale(.86); filter: brightness(.85); }
.hm-icon:focus-visible { outline: none; }
.hm-icon:focus-visible .appicon { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.hm-label { max-width: calc(var(--hm-icon, 60px) + 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-nolabels .hm-label { display: none; }
.hm-icon .app-badge { position: absolute; top: -5px; right: calc(50% - var(--hm-icon, 60px) / 2 - 7px); }
.hm-ph { visibility: hidden; width: var(--hm-icon, 60px); height: var(--hm-icon, 60px); }
.hm-flash .appicon { animation: hm-flash .9s var(--ease) 2; }
@keyframes hm-flash { 50% { transform: scale(1.14); box-shadow: 0 0 0 4px rgba(255, 255, 255, .8), 0 0 24px rgba(var(--accent-rgb), .8); } }

/* widgets on the first page */
.hm-widgets { grid-column: 1 / -1; grid-row: span var(--hm-wrows, 2); align-self: stretch; justify-self: stretch; display: flex; padding: 6px 2px 12px; min-height: 0; }
#home #widgets { position: static; display: grid; width: 100%; height: 100%; padding: 0; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); grid-auto-rows: 0; }
#home #widgets .widget { min-height: 0; overflow: hidden; }
#home :is(.w-batt, .w-photo) { display: none; }
#home:not(.hm-tablet) .w-next { display: none; }
#home.hm-tablet #widgets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
#home.hm-tablet .w-next { grid-column: span 2; }
.hide-widgets #home .hm-widgets { display: none; }

/* page dots + all apps */
.hm-foot { position: absolute; left: 0; right: 0; bottom: calc(var(--hm-dock-h, 80px) + var(--hm-dock-b, 24px) + 2px); height: 32px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.hm-dots { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 99px; pointer-events: auto; background: rgba(10, 14, 22, .18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.hm-foot.single .hm-dots { visibility: hidden; }
.hm-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .35s var(--spring), background .2s; }
.hm-dot.on { width: 18px; background: #fff; }
.hm-dot-add { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #10131a; background: rgba(255, 255, 255, .8); }
[data-wp-tone="light"] .hm-dots { background: rgba(255, 255, 255, .3); }
[data-wp-tone="light"] .hm-dot { background: rgba(10, 14, 22, .3); }
[data-wp-tone="light"] .hm-dot.on { background: #10131a; }
.hm-all {
  position: absolute; right: 12px; height: 28px; padding: 0 11px 0 9px; border: 0; border-radius: 99px; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: #fff; cursor: pointer;
  background: rgba(10, 14, 22, .24); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .22);
}
.hm-all:active { transform: scale(.95); }
[data-wp-tone="light"] .hm-all { color: #10131a; background: rgba(255, 255, 255, .45); }
.hm-editing .hm-all { display: none; }

/* dock */
.hm-dock-wrap { position: absolute; left: 0; right: 0; bottom: var(--hm-dock-b, 24px); display: flex; justify-content: center; pointer-events: none; }
.hm-dock {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-evenly; gap: 10px;
  width: calc(100% - 20px); height: var(--hm-dock-h, 80px); padding: 0 12px; box-sizing: border-box; border-radius: calc(var(--hm-dock-h, 80px) * .4);
  background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .07)); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 22px 46px -16px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(28px) saturate(1.9); backdrop-filter: blur(28px) saturate(1.9);
}
[data-theme="light"] .hm-dock { background: linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .34)); border-color: rgba(255, 255, 255, .6); }
.no-glass .hm-dock { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
.hm-tablet .hm-dock { width: auto; max-width: calc(100% - 40px); justify-content: center; gap: 14px; padding: 0 16px; }
.hm-dock.empty { min-width: 200px; }
.hm-dock .hm-icon { width: var(--hm-dock-icon, 58px); transition: width .35s var(--ease), opacity .3s, transform .35s var(--spring); }
.hm-dock .hm-label { display: none; }
.hm-dock .appicon { --s: var(--hm-dock-icon, 58px) !important; }
.hm-dock .hm-ph { width: var(--hm-dock-icon, 58px); height: var(--hm-dock-icon, 58px); }
.hm-dock .hm-icon.hm-enter { width: 0; opacity: 0; transform: scale(.3); }
.hm-tablet .hm-dock .hm-icon.running::after { content: ''; position: absolute; bottom: -8px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .8; }
.hm-dock-sep { width: 1px; height: 58%; flex: none; background: rgba(255, 255, 255, .32); }
[data-theme="light"] .hm-dock-sep { background: rgba(0, 0, 0, .16); }

/* edit mode: icons wiggle, a minus to remove, Done / Add page */
.hm-editing .hm-icon:not(.hm-ph):not(.hm-recent) > .appicon { animation: hm-wiggle .3s ease-in-out infinite alternate; animation-delay: var(--wd, 0ms); }
@keyframes hm-wiggle { from { transform: rotate(-2.4deg); } to { transform: rotate(2.4deg); } }
.hm-del {
  position: absolute; top: -7px; left: calc(50% - var(--hm-icon, 60px) / 2 - 7px); width: 22px; height: 22px; border-radius: 50%;
  display: none; place-items: center; color: #fff; background: rgba(58, 62, 72, .94); box-shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(255, 255, 255, .25); z-index: 2;
}
.hm-dock .hm-del { left: -6px; }
[data-theme="light"] .hm-del { color: #1a1f2b; background: rgba(232, 234, 239, .96); }
.hm-editing .hm-icon:not(.hm-recent) .hm-del { display: grid; animation: hm-pop .3s var(--spring); }
@keyframes hm-pop { from { transform: scale(0); } to { transform: none; } }
.hm-editbar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--hm-dock-h, 80px) + var(--hm-dock-b, 24px) + 4px); height: 28px; display: none; justify-content: space-between; align-items: center; pointer-events: none; z-index: 2; }
.hm-editing .hm-editbar { display: flex; }
.hm-eb-btn {
  pointer-events: auto; height: 28px; padding: 0 13px; border: 0; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: #10131a; background: rgba(255, 255, 255, .86); box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  animation: hm-pop .35s var(--spring);
}
.hm-done { color: var(--accent-fg); background: var(--accent); }
.hm-ghost { position: fixed; left: 0; top: 0; z-index: 8650; pointer-events: none; transform-origin: 0 0; will-change: transform; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .42)); }
.hm-dragging .hm-icon:active .appicon { transform: none; filter: none; }

/* app drawer */
.hm-drawer {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; visibility: hidden; color: var(--text);
  transform: translateY(100%); transition: transform .5s cubic-bezier(.25, 1.08, .4, 1), visibility 0s .5s;
  background: color-mix(in srgb, var(--surface) 74%, transparent); border-radius: 26px 26px 0 0;
  -webkit-backdrop-filter: blur(34px) saturate(1.6); backdrop-filter: blur(34px) saturate(1.6);
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .35), inset 0 .5px 0 rgba(255, 255, 255, .15);
}
.no-glass .hm-drawer { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
.hm-drawer:not(.open):not(.dragging) { pointer-events: none; }
.hm-drawer.open { transform: none; visibility: visible; transition: transform .5s cubic-bezier(.25, 1.08, .4, 1), visibility 0s; }
.hm-drawer.dragging { transition: none !important; visibility: visible; }
.hm-drawer.fast { transition-duration: .2s; }
.hmd-head { flex: none; padding: 0 14px 8px; touch-action: none; }
.hmd-grab { display: grid; place-items: center; width: 100%; height: 20px; border: 0; background: none; padding: 0; cursor: grab; }
.hmd-grab i { width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); }
.hmd-bar { display: flex; align-items: center; gap: 8px; }
.hmd-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--tile); color: var(--text-2); }
.hmd-q { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: calc(15px * var(--fs, 1)); }
.hmd-close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--tile); color: var(--text-2); display: grid; place-items: center; }
.hmd-body { flex: 1; min-height: 0; position: relative; display: flex; }
.hmd-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 34px 40px 10px; touch-action: pan-y; scrollbar-width: none; }
.hmd-list::-webkit-scrollbar { display: none; }
.hmd-sec { padding: 12px 8px 4px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 700; color: var(--text-3); letter-spacing: .02em; }
.hmd-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 7px 8px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; position: relative; }
.hmd-row:active { background: var(--press); }
@media (hover: hover) { .hmd-row:hover { background: var(--hover); } }
.hmd-row .appicon { box-shadow: 0 3px 8px -3px rgba(0, 0, 0, .35); }
.hmd-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.hmd-t b { font-size: calc(15px * var(--fs, 1)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hmd-t small { font-size: calc(12px * var(--fs, 1)); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hmd-run { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.hmd-get em { font-style: normal; font-size: calc(12.5px * var(--fs, 1)); font-weight: 700; padding: 5px 12px; border-radius: 99px; color: var(--accent); background: rgba(var(--accent-rgb), .14); }
.hmd-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px 10px; color: var(--text-2); text-align: center; }
.hmd-empty b { color: var(--text); }
.hmd-index { position: absolute; right: 2px; top: 4px; bottom: 16px; width: 26px; display: flex; flex-direction: column; justify-content: center; touch-action: none; }
.hmd-index button { flex: 0 1 18px; min-height: 0; border: 0; background: none; padding: 0; font: inherit; font-size: calc(10.5px * var(--fs, 1)); font-weight: 700; color: var(--accent); cursor: pointer; border-radius: 6px; }
.hmd-index button.on { color: var(--accent-fg); background: var(--accent); }
.hmd-bubble { position: absolute; right: 44px; top: 0; width: 58px; height: 58px; margin-top: -29px; border-radius: 50%; display: grid; place-items: center; font-size: calc(26px * var(--fs, 1)); font-weight: 700; color: var(--accent-fg); background: var(--accent); box-shadow: var(--shadow-pop); opacity: 0; transform: scale(.5); transition: opacity .15s, transform .2s var(--spring); pointer-events: none; }
.hmd-bubble.on { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   Desktop: icon size + grid spacing (Settings > Home screen), Settings and Trash icons
   --------------------------------------------------------------------- */
#desk-icons { zoom: var(--desk-zoom, 1); gap: var(--desk-gap, 6px); }
.di-app { display: grid; margin: 4px 0 2px; }
.di-app .appicon { box-shadow: 0 4px 12px -2px rgba(0, 0, 0, .4); }
.di-trash { display: grid; place-items: center; width: 56px; height: 56px; margin: 2px 0 0; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.di-trash svg { width: 100%; height: 100%; }
.desk-icon[data-sys="trash"].drop-on .di-trash { transform: scale(1.1); transition: transform .2s var(--spring); }

/* ---------------------------------------------------------------------
   Bars that never jump: new items grow in at the end, the taskbar keeps its pinned icons still
   --------------------------------------------------------------------- */
.dock-apps > .dock-item.dk-moving { transition: width .32s var(--ease), opacity .26s ease, transform .34s var(--spring) !important; }
.dock-apps > .dock-item.dk-enter, .dock-apps > .dock-item.dk-leave { width: 0 !important; opacity: 0; transform: scale(.3); pointer-events: none; }
.dock-balance { display: none; }
[data-layout="taskbar"] .dock-balance { display: block; flex: none; height: 1px; width: calc(var(--run, 0) * 46px); transition: width .32s var(--ease); }
.reduce-motion .dock-balance { transition: none; }
[data-layout="island"] .cb-tasks { flex: 4 1 0; transition: padding-left .35s var(--ease); }
[data-layout="island"] .cb-tasks.empty { justify-content: center; }
.cb-tab.leaving { max-width: 0 !important; min-width: 0 !important; padding: 0 !important; opacity: 0; margin: 0 -2px; pointer-events: none; transition: max-width .26s var(--ease), padding .26s var(--ease), opacity .18s, margin .26s; }

/* Settings > Home screen controls */
.hs-step { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: var(--tile); }
.hs-step .hs-btn { width: 30px; height: 30px; border-radius: 8px; }
.hs-step .hs-btn:disabled { opacity: .35; }
.hs-val { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; font-size: calc(14px * var(--fs, 1)); }
.hs-range { display: flex; align-items: center; gap: 10px; }
.hs-range .range { width: min(200px, calc(34 * var(--vw, 1vw))); }
.hs-range .hs-val { min-width: 42px; text-align: right; }
.hm-paging .hm-icon:active .appicon { transform: none; filter: none; }
@media (min-width: 700px) and (min-height: 700px) {
  .ring-core { width: 170px; height: 170px; }
  .ring-logo { width: 140px; height: 140px; }
  .ring-caption { font-size: calc(16px * var(--fs, 1)); }
}
