/* ============================================================
   orOS Core v0.18.1 — Shell stylesheet (PWA / mobile-first)
   (version mirrors shell.js APP_VERSION — bumped at every release)
   Architecture:
     data-skin  = palette (16 skins)
     data-theme = light/dark (orthogonal to skin)
   Sections:
     0. Local fonts (Nunito, vendored)
     1. Skin palettes (16 skins)
     2. Reset & base
     3. Top bar (persistent, safe-area aware)
     4. Desktop
     5. Applications menu
     5bis. Running app (fullscreen takeover)
     7. Appearance controls (swatches + theme toggle)
        Wallpaper picker
     8. Mobile-first adaptations
     9. Sync section (in menu)
    10. Version toast
   Appended blocks (bottom of file):
     v0.18.0 — folder-row fix · taskbar sync dot · Info modal ·
               weather chip
   ============================================================ */

/* ---------- 0. Local fonts (Nunito, vendored) ---------- */
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-extrabold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Skin palettes ---------- */

/* Adwaita — GNOME-look */
[data-skin="adwaita"][data-theme="dark"] {
  --bg:           #1b1b1b;
  --bg-desktop:   #232225;
  --bar-bg:       rgba(48, 48, 51, 0.95);
  --text:         #ffffff;
  --text-dim:     #a8a8ac;
  --accent:       #3584e4;
  --accent-hover: #62a0ea;
  --accent-soft:  rgba(53, 132, 228, 0.22);
  --panel-bg:     #2a2a2e;
  --border:       #3a3a3f;
  --shadow:       rgba(0, 0, 0, 0.55);
}
[data-skin="adwaita"][data-theme="light"] {
  --bg:           #fafafa;
  --bg-desktop:   #f0f0f2;
  --bar-bg:       rgba(235, 236, 238, 0.95);
  --text:         #1c1b22;
  --text-dim:     #5e5c64;
  --accent:       #1c71d8;
  --accent-hover: #15539e;
  --accent-soft:  rgba(28, 113, 216, 0.14);
  --panel-bg:     #ffffff;
  --border:       #dcdcde;
  --shadow:       rgba(0, 0, 0, 0.18);
}

/* lumo — the house purple */
[data-skin="lumo"][data-theme="dark"] {
  --bg:           #0f1115;
  --bg-desktop:   #131820;
  --bar-bg:       rgba(15, 17, 21, 0.92);
  --text:         #e8eaf0;
  --text-dim:     #9aa0ae;
  --accent:       #6d4aff;
  --accent-hover: #8b6bff;
  --accent-soft:  rgba(109, 74, 255, 0.18);
  --panel-bg:     #171c24;
  --border:       #262c38;
  --shadow:       rgba(0, 0, 0, 0.45);
}
[data-skin="lumo"][data-theme="light"] {
  --bg:           #f5f6f8;
  --bg-desktop:   #eceef2;
  --bar-bg:       rgba(245, 246, 248, 0.92);
  --text:         #1a1d24;
  --text-dim:     #555c6b;
  --accent:       #6d4aff;
  --accent-hover: #5736e0;
  --accent-soft:  rgba(109, 74, 255, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d8dbe2;
  --shadow:       rgba(0, 0, 0, 0.18);
}

/* oros — the brand gold skin (DEFAULT) */
[data-skin="oros"][data-theme="dark"] {
  --bg:           #14120d;
  --bg-desktop:   #1a1712;
  --bar-bg:       rgba(20, 18, 13, 0.93);
  --text:         #f0ead9;
  --text-dim:     #a89f8a;
  --accent:       #d4af37;
  --accent-hover: #ecc75f;
  --accent-soft:  rgba(212, 175, 55, 0.20);
  --panel-bg:     #1d1a13;
  --border:       #322d20;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="oros"][data-theme="light"] {
  --bg:           #faf7ef;
  --bg-desktop:   #f2eddd;
  --bar-bg:       rgba(250, 247, 239, 0.95);
  --text:         #241f14;
  --text-dim:     #6b6250;
  --accent:       #b8860b;
  --accent-hover: #8f6a08;
  --accent-soft:  rgba(184, 134, 11, 0.14);
  --panel-bg:     #ffffff;
  --border:       #ddd5c0;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* ---------- Linux family skins (v0.4) — full palettes ---------- */

/* Ubuntu — aubergine warmth */
[data-skin="ubuntu"][data-theme="dark"] {
  --bg:           #1d0f16;
  --bg-desktop:   #251019;
  --bar-bg:       rgba(37, 16, 25, 0.95);
  --text:         #f5eee8;
  --text-dim:     #b3a09a;
  --accent:       #e95420;
  --accent-hover: #f0663a;
  --accent-soft:  rgba(233, 84, 32, 0.20);
  --panel-bg:     #2b1522;
  --border:       #41243a;
  --shadow:       rgba(0, 0, 0, 0.55);
}
[data-skin="ubuntu"][data-theme="light"] {
  --bg:           #faf6f4;
  --bg-desktop:   #f3ebe6;
  --bar-bg:       rgba(250, 246, 244, 0.95);
  --text:         #291612;
  --text-dim:     #705b56;
  --accent:       #c7431a;
  --accent-hover: #a53613;
  --accent-soft:  rgba(199, 67, 26, 0.14);
  --panel-bg:     #ffffff;
  --border:       #e3d3cb;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Fedora — cool navy slate */
[data-skin="fedora"][data-theme="dark"] {
  --bg:           #10141a;
  --bg-desktop:   #151b23;
  --bar-bg:       rgba(17, 22, 30, 0.94);
  --text:         #e9edf4;
  --text-dim:     #96a0b0;
  --accent:       #51a2da;
  --accent-hover: #74b8e6;
  --accent-soft:  rgba(81, 162, 218, 0.18);
  --panel-bg:     #18202a;
  --border:       #273242;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="fedora"][data-theme="light"] {
  --bg:           #f7f9fb;
  --bg-desktop:   #eef2f7;
  --bar-bg:       rgba(247, 249, 251, 0.94);
  --text:         #16202c;
  --text-dim:     #57647a;
  --accent:       #2f7dc0;
  --accent-hover: #24639b;
  --accent-soft:  rgba(47, 125, 192, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d3dde7;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Mint — deep olive green */
[data-skin="mint"][data-theme="dark"] {
  --bg:           #12160f;
  --bg-desktop:   #171d12;
  --bar-bg:       rgba(19, 25, 15, 0.94);
  --text:         #eaf0e4;
  --text-dim:     #9fae94;
  --accent:       #87cf3e;
  --accent-hover: #a2e05c;
  --accent-soft:  rgba(135, 207, 62, 0.18);
  --panel-bg:     #1b2115;
  --border:       #2c3521;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="mint"][data-theme="light"] {
  --bg:           #f8faf3;
  --bg-desktop:   #eff3e4;
  --bar-bg:       rgba(248, 250, 243, 0.94);
  --text:         #1d2415;
  --text-dim:     #5d6a4e;
  --accent:       #5e9f2f;
  --accent-hover: #4a7f24;
  --accent-soft:  rgba(94, 159, 47, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d7dec8;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Arch — near-black steel */
[data-skin="arch"][data-theme="dark"] {
  --bg:           #0c0e11;
  --bg-desktop:   #101318;
  --bar-bg:       rgba(12, 14, 17, 0.94);
  --text:         #e4e8ee;
  --text-dim:     #8b98a6;
  --accent:       #1793d1;
  --accent-hover: #45addb;
  --accent-soft:  rgba(23, 147, 209, 0.18);
  --panel-bg:     #13161b;
  --border:       #222731;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="arch"][data-theme="light"] {
  --bg:           #f6f8fa;
  --bg-desktop:   #eaeff4;
  --bar-bg:       rgba(246, 248, 250, 0.94);
  --text:         #14202b;
  --text-dim:     #4f6373;
  --accent:       #1073a6;
  --accent-hover: #0b5c86;
  --accent-soft:  rgba(16, 115, 166, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d2dae2;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Debian — warm dark red undertone */
[data-skin="debian"][data-theme="dark"] {
  --bg:           #170c11;
  --bg-desktop:   #1e0f16;
  --bar-bg:       rgba(23, 12, 17, 0.94);
  --text:         #f2e8ec;
  --text-dim:     #a893a0;
  --accent:       #d70a53;
  --accent-hover: #e93a77;
  --accent-soft:  rgba(215, 10, 83, 0.18);
  --panel-bg:     #241220;
  --border:       #3b2130;
  --shadow:       rgba(0, 0, 0, 0.55);
}
[data-skin="debian"][data-theme="light"] {
  --bg:           #faf5f7;
  --bg-desktop:   #f4eaee;
  --bar-bg:       rgba(250, 245, 247, 0.94);
  --text:         #260f1a;
  --text-dim:     #6f5a63;
  --accent:       #b20844;
  --accent-hover: #8c0634;
  --accent-soft:  rgba(178, 8, 68, 0.14);
  --panel-bg:     #ffffff;
  --border:       #e6d3da;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* elementary — cool gray with purple undertone */
[data-skin="elementary"][data-theme="dark"] {
  --bg:           #131318;
  --bg-desktop:   #18181f;
  --bar-bg:       rgba(19, 19, 24, 0.94);
  --text:         #eae8f0;
  --text-dim:     #9a97ab;
  --accent:       #8c5ec7;
  --accent-hover: #a67adb;
  --accent-soft:  rgba(140, 94, 199, 0.18);
  --panel-bg:     #1c1c25;
  --border:       #2c2b38;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="elementary"][data-theme="light"] {
  --bg:           #f8f7fa;
  --bg-desktop:   #f0eef5;
  --bar-bg:       rgba(248, 247, 250, 0.94);
  --text:         #1b1824;
  --text-dim:     #5c5870;
  --accent:       #6e46a8;
  --accent-hover: #573287;
  --accent-soft:  rgba(110, 70, 168, 0.14);
  --panel-bg:     #ffffff;
  --border:       #dddbe4;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Tux — pure monochrome */
[data-skin="tux"][data-theme="dark"] {
  --bg:           #131313;
  --bg-desktop:   #191919;
  --bar-bg:       rgba(19, 19, 19, 0.95);
  --text:         #f0f0f0;
  --text-dim:     #9c9c9c;
  --accent:       #e0e0e0;
  --accent-hover: #ffffff;
  --accent-soft:  rgba(224, 224, 224, 0.14);
  --panel-bg:     #1e1e1e;
  --border:       #333333;
  --shadow:       rgba(0, 0, 0, 0.55);
}
[data-skin="tux"][data-theme="light"] {
  --bg:           #fafafa;
  --bg-desktop:   #efefef;
  --bar-bg:       rgba(250, 250, 250, 0.95);
  --text:         #1a1a1a;
  --text-dim:     #5c5c5c;
  --accent:       #4d4d4d;
  --accent-hover: #2b2b2b;
  --accent-soft:  rgba(0, 0, 0, 0.10);
  --panel-bg:     #ffffff;
  --border:       #d6d6d6;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* ---------- Second Linux family (v0.12.0) — 6 new skins ---------- */

/* Manjaro — alpine green */
[data-skin="manjaro"][data-theme="dark"] {
  --bg:           #0d1410;
  --bg-desktop:   #121a14;
  --bar-bg:       rgba(13, 20, 16, 0.94);
  --text:         #e7f0e9;
  --text-dim:     #93a89a;
  --accent:       #35bf5c;
  --accent-hover: #54d478;
  --accent-soft:  rgba(53, 191, 92, 0.18);
  --panel-bg:     #16201a;
  --border:       #233129;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="manjaro"][data-theme="light"] {
  --bg:           #f7faf7;
  --bg-desktop:   #edf3ee;
  --bar-bg:       rgba(247, 250, 247, 0.94);
  --text:         #152016;
  --text-dim:     #556a5a;
  --accent:       #27994a;
  --accent-hover: #1e7a39;
  --accent-soft:  rgba(39, 153, 74, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d5dfd7;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* openSUSE — chameleon lime */
[data-skin="opensuse"][data-theme="dark"] {
  --bg:           #10140c;
  --bg-desktop:   #151a10;
  --bar-bg:       rgba(16, 20, 12, 0.94);
  --text:         #eaf0e2;
  --text-dim:     #9aab8a;
  --accent:       #73ba25;
  --accent-hover: #8fd142;
  --accent-soft:  rgba(115, 186, 37, 0.18);
  --panel-bg:     #1a2013;
  --border:       #28311c;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="opensuse"][data-theme="light"] {
  --bg:           #f9faf5;
  --bg-desktop:   #f0f3e6;
  --bar-bg:       rgba(249, 250, 245, 0.94);
  --text:         #1a2010;
  --text-dim:     #5d6a4a;
  --accent:       #5c941d;
  --accent-hover: #477516;
  --accent-soft:  rgba(92, 148, 29, 0.14);
  --panel-bg:     #ffffff;
  --border:       #dde3cc;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* NixOS — snowflake blue */
[data-skin="nixos"][data-theme="dark"] {
  --bg:           #0d1118;
  --bg-desktop:   #111623;
  --bar-bg:       rgba(13, 17, 24, 0.94);
  --text:         #e6eaf4;
  --text-dim:     #929cb5;
  --accent:       #5277c3;
  --accent-hover: #7492d6;
  --accent-soft:  rgba(82, 119, 195, 0.18);
  --panel-bg:     #151b29;
  --border:       #232b41;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="nixos"][data-theme="light"] {
  --bg:           #f7f9fc;
  --bg-desktop:   #edf1f8;
  --bar-bg:       rgba(247, 249, 252, 0.94);
  --text:         #131a28;
  --text-dim:     #52607a;
  --accent:       #3d5ea8;
  --accent-hover: #2f4986;
  --accent-soft:  rgba(61, 94, 168, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d4dce9;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Gentoo — royal purple */
[data-skin="gentoo"][data-theme="dark"] {
  --bg:           #120f16;
  --bg-desktop:   #17131c;
  --bar-bg:       rgba(18, 15, 22, 0.94);
  --text:         #ede8f2;
  --text-dim:     #a294ae;
  --accent:       #7d5ba6;
  --accent-hover: #9a79c2;
  --accent-soft:  rgba(125, 91, 166, 0.18);
  --panel-bg:     #1c1722;
  --border:       #2c2435;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="gentoo"][data-theme="light"] {
  --bg:           #f9f8fb;
  --bg-desktop:   #f0edf5;
  --bar-bg:       rgba(249, 248, 251, 0.94);
  --text:         #1b1524;
  --text-dim:     #635972;
  --accent:       #64498a;
  --accent-hover: #4f3a6e;
  --accent-soft:  rgba(100, 73, 138, 0.14);
  --panel-bg:     #ffffff;
  --border:       #ded8e8;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Pop!_OS — cosmic orange */
[data-skin="popos"][data-theme="dark"] {
  --bg:           #161009;
  --bg-desktop:   #1d160d;
  --bar-bg:       rgba(22, 16, 9, 0.94);
  --text:         #f4ece2;
  --text-dim:     #ab978a;
  --accent:       #ff7043;
  --accent-hover: #ff8b66;
  --accent-soft:  rgba(255, 112, 67, 0.18);
  --panel-bg:     #221a10;
  --border:       #38291a;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="popos"][data-theme="light"] {
  --bg:           #fbf8f4;
  --bg-desktop:   #f5efe7;
  --bar-bg:       rgba(251, 248, 244, 0.94);
  --text:         #241a10;
  --text-dim:     #72614f;
  --accent:       #e05a2b;
  --accent-hover: #b8461f;
  --accent-soft:  rgba(224, 90, 43, 0.14);
  --panel-bg:     #ffffff;
  --border:       #ead9ca;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Zorin — modern teal */
[data-skin="zorin"][data-theme="dark"] {
  --bg:           #0a1414;
  --bg-desktop:   #0e1a1a;
  --bar-bg:       rgba(10, 20, 20, 0.94);
  --text:         #e3f0f0;
  --text-dim:     #8ca4a4;
  --accent:       #15a6a0;
  --accent-hover: #3cc4be;
  --accent-soft:  rgba(21, 166, 160, 0.18);
  --panel-bg:     #122020;
  --border:       #1e3030;
  --shadow:       rgba(0, 0, 0, 0.50);
}
[data-skin="zorin"][data-theme="light"] {
  --bg:           #f6fafa;
  --bg-desktop:   #eaf3f3;
  --bar-bg:       rgba(246, 250, 250, 0.94);
  --text:         #0f1c1c;
  --text-dim:     #4f6a6a;
  --accent:       #108580;
  --accent-hover: #0c6965;
  --accent-soft:  rgba(16, 133, 128, 0.14);
  --panel-bg:     #ffffff;
  --border:       #d2e2e2;
  --shadow:       rgba(0, 0, 0, 0.16);
}

/* Safe fallback + platform scrollbars */
[data-theme="dark"]  { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

/* ---------- 2. Reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  height: 100dvh;              /* mobile: excludes URL bar height */
  overflow: hidden;
  overscroll-behavior: none;   /* no pull-to-refresh on the OS */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;  /* kills 300ms tap delay, no double-tap zoom on controls */
}

/* ---------- 3. Top bar (always visible, safe-area aware) ---------- */
#oros-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(40px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bar-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  z-index: 1000;
  user-select: none;
}
.bar-left, .bar-right { display: flex; align-items: center; gap: 8px; }

#btn-menu, #btn-lang {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
#btn-menu:hover, #btn-lang:hover { background: var(--accent-soft); }

#btn-menu {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;           /* Nunito ExtraBold — brand-forward button */
  letter-spacing: 0.5px;
}

#btn-menu.running { color: var(--accent-hover); }

#bar-clock {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

/* ---------- 4. Desktop ---------- */
#oros-desktop {
  position: fixed;
  top: calc(40px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0;
  background: var(--bg-desktop);
  overflow-y: auto;
  transition: background 0.4s ease;
}

/* ---------- 5. Applications menu ---------- */
#app-menu {
  position: fixed;
  top: calc(48px + env(safe-area-inset-top, 0px)); left: 12px;
  width: 320px;
  max-height: calc(100vh - 120px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 999;
  padding: 8px;
  display: none;
}
#app-menu.open { display: block; }

/* Themed slim scrollbars (menu + desktop) — the browser default
   was eating ~15px of menu width and clashing with every skin. */
#app-menu,
#oros-desktop {
  scrollbar-width: thin;                          /* Firefox */
  scrollbar-color: var(--border) transparent;
}
#app-menu::-webkit-scrollbar,
#oros-desktop::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#app-menu::-webkit-scrollbar-track,
#oros-desktop::-webkit-scrollbar-track {
  background: transparent;
}
#app-menu::-webkit-scrollbar-thumb,
#oros-desktop::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
#app-menu::-webkit-scrollbar-thumb:hover,
#oros-desktop::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

.menu-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 8px 10px 4px;
}

.menu-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}
.menu-empty .glyph { display: block; margin-bottom: 10px; opacity: 0.6; }
.menu-empty .glyph svg { display: block; margin: 0 auto; }
.menu-empty .hint { font-size: 12px; margin-top: 6px; opacity: 0.75; }

.menu-category { padding: 4px 0; }
.menu-category h4 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 6px 10px 4px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;             /* touch target ≥ 44px */
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.menu-item .app-ico {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.menu-item:hover { background: var(--accent-soft); }

/* Button labels never wrap — they ellipsize instead (the sync
   buttons' Greek labels sit right at the width limit). */
.menu-item > span:not(.app-ico) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---------- 5bis. Running app (fullscreen takeover) ---------- */
#oros-running {
  position: fixed;
  top: calc(40px + env(safe-area-inset-top, 0px));
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 900;
  display: none;
}
#oros-running.active { display: block; }
#oros-running iframe { width: 100%; height: 100%; border: none; display: block; }

/* ---------- 7. Appearance controls (in menu) ---------- */
.skin-section {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 6px;
}
.skin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 6px;
}
.skin-swatches {
  display: grid;
  grid-template-columns: repeat(8, auto);
  gap: 8px 6px;
  padding: 0 10px 8px;
}
.skin-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.skin-swatch:hover { transform: scale(1.12); }
.skin-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 3.5px var(--accent);
}
.skin-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}
.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  width: 28px;
  height: 28px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.theme-toggle:hover { background: var(--accent-soft); }

.install-section {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 6px;
}
.install-section .install-row {
  min-height: 40px;
  font-size: 13px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.install-section .install-row:hover { background: var(--accent-soft); }

/* ---------- Wallpaper picker ---------- */
.wallpaper-section {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 6px;
}
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 0 10px 8px;
}
.wp-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
  outline: none;
}
.wp-thumb:hover { transform: scale(1.05); }
.wp-thumb.active {
  border-color: var(--accent);
}
.wp-thumb:focus-visible {
  border-color: var(--accent);
}

/* ---------- 8. Mobile-first ---------- */

/* Phones & tablets: menu becomes a near-full-width sheet anchored left,
   everything comfortably tappable */
@media (max-width: 480px) {
  #app-menu {
    left: 6px;
    right: 6px;
    width: auto;
    max-height: calc(100dvh - 130px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  /* Top bar: keep everything on one row on narrow screens */
  #btn-menu { font-size: 13.5px; padding: 6px 8px; }
  #bar-clock { font-size: 12.5px; }
  #version-toast { font-size: 11.5px; padding: 7px 12px; }

  /* Respect the home-indicator / gesture area at the bottom */
  #oros-running { bottom: env(safe-area-inset-bottom, 0px); }
}

/* Very narrow phones (≤ 360px): relax the brand weight to Medium so
   the ExtraBold button doesn't crowd the bar */
@media (max-width: 360px) {
  #btn-menu { font-weight: 500; }
}

/* Landscape phones with notch: bottom inset flips to the side;
   env() handles it, we only widen the running-view breathing room */
@media (orientation: landscape) and (max-height: 500px) {
  #oros-running {
    left: env(safe-area-inset-left, 0px);
    right: env(safe-area-inset-right, 0px);
  }
}

/* ---------- 9. Sync section (in menu) ---------- */
.sync-section {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 6px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.sync-status-dot.on {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sync-status .email {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status-dot.pulse {
  animation: sync-pulse 1s ease infinite;
}
@keyframes sync-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

.sync-actions {
  display: flex;
  gap: 8px;
  padding: 0 10px 8px;
}
.sync-actions .menu-item {
  flex: 1;
  justify-content: center;
  min-height: 38px;
  font-size: 13px;
  border: 1px solid var(--border);
  padding: 6px 8px;
}
.sync-actions .menu-item:hover { background: var(--accent-soft); }

.sync-pass {
  padding: 0 10px 10px;
}
.sync-pass label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.sync-pass input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  min-height: 38px;
}
.sync-pass input:focus {
  border-color: var(--accent);
}
.sync-pass .hint {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 6px;
}
.sync-pass .row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.sync-pass .input-row {
  display: flex;
  gap: 8px;
}
.sync-pass .input-row input { flex: 1; }
.pass-eye {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  width: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sync-pass .remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.sync-pass .remember-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.sync-pass .remember-row:hover { color: var(--text); }

.pass-eye:hover { background: var(--accent-soft); color: var(--text); }

/* Status messages (success / error) under the section */
.sync-msg {
  font-size: 12px;
  padding: 6px 10px 8px;
  color: var(--text-dim);
}
.sync-msg.ok   { color: var(--accent-hover); }
.sync-msg.err  { color: #e06c75; }

.sync-interval {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 8px;
}
.sync-interval label { font-size: 12.5px; color: var(--text-dim); }
.sync-interval select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12.5px;
  min-height: 34px;
}

.sync-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 0 10px 8px;
}

/* ---------- 10. Version toast ---------- */
/* Sole update confirmation — the shell appends #version-toast after
   an auto-update (broker reloads the page; last-seen version differs). */
#version-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--shadow);
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
#version-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
#version-toast strong { color: var(--accent); }

/* ===== v0.18.0: folder row fix (Stop/Reconnect button) ===== */
.sync-interval label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-interval .menu-item {
  width: auto;
  flex-shrink: 0;
  min-height: 34px;
  padding: 5px 12px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
.sync-interval .menu-item:hover { background: var(--accent-soft); }

/* ===== v0.18.0: taskbar sync dot (single OS-wide indicator) ===== */
#sync-dot-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 34px; height: 34px;
  min-width: 34px;              /* flex won't squeeze the hit area */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
}
#sync-dot-btn:hover { background: var(--accent-soft); }
#sync-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.5;
  transition: background 0.2s, opacity 0.2s, box-shadow 0.2s;
}
#sync-dot[data-state="off"]     { background: var(--text-dim); opacity: 0.5; }
#sync-dot[data-state="locked"]  { background: transparent; border: 2px solid var(--text-dim); opacity: 0.8; }
#sync-dot[data-state="idle"]    { background: var(--text-dim); opacity: 0.7; }
#sync-dot[data-state="syncing"] { background: var(--accent); opacity: 1; animation: sync-pulse 1s ease infinite; }
#sync-dot[data-state="synced"]  { background: #3fbf6f; opacity: 1; box-shadow: 0 0 0 3px var(--accent-soft); }
#sync-dot[data-state="dirty"]   { background: #f28c5a; opacity: 1; }
#sync-dot[data-state="err"]     { background: #e06c75; opacity: 1; }

/* ===== v0.18.0: Info modal (Ctrl+Alt+Shift+I) ===== */
#sc-info-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1300;                 /* above version toast (1200) */
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.sc-box {
  width: min(420px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px var(--shadow);
  padding: 18px 20px;
}
.sc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.sc-title { font-size: 19px; font-weight: 800; color: var(--text); }
.sc-ver {
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.sc-tagline { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.sc-cap {
  font-size: 12px; color: var(--text-dim); line-height: 1.6;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.sc-sec {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); padding: 10px 0 4px;
}
.sc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 5px 0; font-size: 13px; color: var(--text);
}
.sc-key {
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.sc-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
}
.sc-foot a { color: var(--accent); text-decoration: none; }
.sc-foot a:hover { text-decoration: underline; }
.sc-cred { color: var(--text-dim); }

/* ===== v0.18.0: weather chip (taskbar) ===== */
#wx-chip {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 6px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: none;
}
#wx-chip:hover { background: var(--accent-soft); }
#wx-chip[data-state="off"] { color: var(--text-dim); opacity: 0.7; }
#wx-chip svg { display: block; flex-shrink: 0; pointer-events: none; }
#wx-chip .wx-temp { pointer-events: none; }

/* Very narrow phones: keep the icon, drop the number */
@media (max-width: 360px) {
  #wx-chip .wx-temp { display: none; }
}