/* ============================================================
   Windows 10 Simulator — style.css
   ============================================================ */
:root{
  --accent:#0078d7;
  --accent-dark:#005a9e;
  --taskbar-bg:rgba(0,0,0,.72);
  --start-bg:rgba(16,20,28,.98);
  --win-title-bg:#f3f3f3;
  --win-border:#8a8a8a;
  --mobile-tb-h:58px;
  --noise:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iMTQwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC44NSIgbnVtT2N0YXZlcz0iMiIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCUyM24pIi8+PC9zdmc+");
  --wallpaper:
    var(--noise),
    radial-gradient(circle at 78% 12%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 38%),
    radial-gradient(circle at 15% 88%, rgba(70,160,255,.4) 0%, rgba(70,160,255,0) 48%),
    linear-gradient(155deg,#04255c 0%,#0b3d91 24%,#1a5fc4 48%,#3e8fe0 68%,#123a76 100%);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{
  margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:#000;
  font-family:'Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;
  color:#1a1a1a;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
}
button,input,textarea{font-family:inherit}
::selection{background:var(--accent);color:#fff}

/* ===================== ICON SYSTEM ===================== */
.icon{width:16px;height:16px;flex-shrink:0;display:inline-block;vertical-align:-3px}
.icon.i-13{width:13px;height:13px}
.icon.i-14{width:14px;height:14px}
.icon.i-16{width:16px;height:16px}
.icon.i-18{width:18px;height:18px}
.icon.i-20{width:20px;height:20px}
.icon.i-22{width:22px;height:22px}
.icon.i-26{width:26px;height:26px}
.icon.i-30{width:30px;height:30px}
.icon.i-36{width:36px;height:36px}
.icon.i-44{width:44px;height:44px}
/* folders get a warm tint in file-browsing contexts, like a real file manager */
.fe-item .icon[data-icon="folder"], .d-icon .icon[data-icon="folder"],
.rb-item .icon[data-icon="folder"], .fe-sb-item .icon[data-icon="folder"]{
  fill:#ffca55;stroke:#dc9e2e;fill-opacity:.95;
}
.fe-item .icon[data-icon="file-text"], .d-icon .icon[data-icon="file-text"],
.rb-item .icon[data-icon="file-text"], .sm-app-ic .icon{color:#7d8b99}

#setup-banner{
  display:none;position:fixed;top:0;left:0;right:0;z-index:9999;
  background:#442600;color:#ffd58a;text-align:center;font-size:.78rem;padding:5px;
}

/* ===================== BOOT SCREEN ===================== */
#boot-screen{
  position:fixed;inset:0;background:#000;z-index:9000;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:36px;
}
.boot-logo{opacity:.95}
.boot-dots{display:flex;gap:10px}
.boot-dots span{
  width:9px;height:9px;border-radius:50%;background:#00adef;
  animation:bootpulse 1.1s infinite ease-in-out;
}
.boot-dots span:nth-child(2){animation-delay:.1s}
.boot-dots span:nth-child(3){animation-delay:.2s}
.boot-dots span:nth-child(4){animation-delay:.3s}
.boot-dots span:nth-child(5){animation-delay:.4s}
@keyframes bootpulse{0%,80%,100%{opacity:.25;transform:scale(.8)}40%{opacity:1;transform:scale(1.15)}}

/* ===================== LOCK SCREEN ===================== */
#lock-screen{
  position:fixed;inset:0;z-index:8000;display:none;
  color:#fff;cursor:pointer;overflow:hidden;
}
.lock-bg{
  position:absolute;inset:0;
  background-image:var(--wallpaper);
  background-size:140px 140px,cover,cover,cover;
  background-repeat:repeat,no-repeat,no-repeat,no-repeat;
  background-blend-mode:overlay,normal,normal,normal;
}
.lock-bg::after{content:'';position:absolute;inset:0;background:rgba(0,0,0,.12)}
.lock-time{position:absolute;top:14%;left:6%;font-size:5.5rem;font-weight:200;text-shadow:0 2px 14px rgba(0,0,0,.4)}
.lock-date{position:absolute;top:14%;left:6%;margin-top:5.8rem;font-size:1.6rem;font-weight:400;text-shadow:0 2px 10px rgba(0,0,0,.4)}
.lock-hint{
  position:absolute;bottom:6%;left:50%;transform:translateX(-50%);
  font-size:.95rem;opacity:.85;animation:hintfade 2.4s infinite;
}
@keyframes hintfade{0%,100%{opacity:.55}50%{opacity:1}}
@media (max-width:480px){
  .lock-time{font-size:3.6rem}
  .lock-date{font-size:1.15rem;margin-top:4.1rem}
}

/* ===================== AUTH SCREEN ===================== */
#auth-screen{
  position:fixed;inset:0;z-index:7000;display:none;
  align-items:center;justify-content:center;color:#fff;
}
.auth-bg{
  position:absolute;inset:0;filter:blur(2px) brightness(.85);
  background-image:var(--wallpaper);
  background-size:140px 140px,cover,cover,cover;
  background-repeat:repeat,no-repeat,no-repeat,no-repeat;
  background-blend-mode:overlay,normal,normal,normal;
}
.auth-card{
  position:relative;z-index:1;width:320px;padding:34px 30px;text-align:center;
}
.auth-avatar{
  width:88px;height:88px;border-radius:50%;background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;margin:0 auto 18px;
  border:1px solid rgba(255,255,255,.4);color:#fff;
}
.auth-tabs{display:flex;gap:6px;margin-bottom:16px;background:rgba(255,255,255,.08);border-radius:4px;padding:3px}
.auth-tab{
  flex:1;background:transparent;border:none;color:#fff;opacity:.7;padding:7px 0;
  font-size:.84rem;border-radius:3px;cursor:pointer;
}
.auth-tab.on{background:rgba(255,255,255,.2);opacity:1}
.auth-input{
  width:100%;padding:10px 12px;margin-bottom:10px;border:none;border-bottom:1px solid rgba(255,255,255,.5);
  background:rgba(255,255,255,.08);color:#fff;font-size:.92rem;border-radius:2px;
}
.auth-input::placeholder{color:rgba(255,255,255,.7)}
.auth-input:focus{outline:none;background:rgba(255,255,255,.16);border-bottom-color:#fff}
.auth-btn{
  width:38px;height:38px;border-radius:50%;border:none;background:rgba(255,255,255,.15);
  color:#fff;cursor:pointer;margin-top:4px;display:inline-flex;align-items:center;justify-content:center;
  transition:background .12s ease;
}
.auth-btn:hover{background:var(--accent)}
.auth-btn:active{transform:scale(.94)}
.auth-msg{min-height:18px;font-size:.8rem;margin-top:10px}
.auth-msg.err{color:#ff8a8a}
.auth-msg.ok{color:#8affa0}
.auth-corner{position:fixed;bottom:18px;right:22px;z-index:2;display:flex;gap:18px}
.corner-btn{color:#fff;cursor:pointer;opacity:.9;display:flex;align-items:center}
.corner-btn:hover{opacity:1}

/* ===================== SHUTDOWN SCREEN ===================== */
#shutdown-screen{
  display:none;position:fixed;inset:0;background:#000;color:#ccc;z-index:9500;
  align-items:center;justify-content:center;flex-direction:column;gap:16px;font-size:1rem;
}
.shutdown-hint{font-size:.82rem;opacity:.6;cursor:pointer;text-decoration:underline}

/* ===================== POWER FLYOUT ===================== */
.power-flyout{
  display:block;position:fixed;background:#2c2c2c;color:#fff;border:1px solid rgba(255,255,255,.15);
  border-radius:2px;min-width:170px;box-shadow:0 6px 24px rgba(0,0,0,.5);z-index:6500;padding:4px 0;
  opacity:0;visibility:hidden;pointer-events:none;transform:translateY(6px);
  transition:opacity .12s ease,transform .12s ease,visibility 0s linear .12s;
}
.power-flyout.show{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);transition:opacity .12s ease,transform .12s ease}
.pf-item{padding:9px 16px;font-size:.85rem;cursor:pointer;display:flex;align-items:center;gap:10px}
.pf-item:hover{background:var(--accent)}

/* ===================== DESKTOP ===================== */
#desktop{
  position:fixed;inset:0;z-index:1;display:none;
  background-image:var(--wallpaper);
  background-size:140px 140px,cover,cover,cover;
  background-repeat:repeat,no-repeat,no-repeat,no-repeat;
  background-blend-mode:overlay,normal,normal,normal;
}
#desktop-icons{
  position:absolute;top:10px;left:10px;display:flex;flex-direction:column;flex-wrap:wrap;
  gap:2px;height:calc(100% - 60px);align-content:flex-start;
}
.d-icon{
  width:80px;padding:6px 2px;display:flex;flex-direction:column;align-items:center;gap:5px;
  border:1px solid transparent;border-radius:2px;cursor:pointer;text-align:center;
}
.d-icon.sel{background:rgba(255,255,255,.22);border-color:rgba(255,255,255,.4)}
.d-icon:active{background:rgba(255,255,255,.16)}
.d-icon .d-ic{
  width:42px;height:42px;display:flex;align-items:center;justify-content:center;color:#fff;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.55));
}
.d-icon .d-label{
  color:#fff;font-size:.74rem;text-shadow:1px 1px 2px rgba(0,0,0,.85);line-height:1.15;
  max-width:78px;overflow-wrap:break-word;
}

/* ===================== CONTEXT MENU ===================== */
#context-menu{
  display:block;position:fixed;background:#f3f3f3;border:1px solid #c1c1c1;box-shadow:0 6px 22px rgba(0,0,0,.32);
  z-index:9800;min-width:200px;padding:4px 0;border-radius:2px;
  opacity:0;visibility:hidden;pointer-events:none;transform:scale(.95);transform-origin:top left;
  transition:opacity .1s ease,transform .1s ease,visibility 0s linear .1s;
}
#context-menu.show{opacity:1;visibility:visible;pointer-events:auto;transform:scale(1);transition:opacity .1s ease,transform .1s ease}
.ctx-item{padding:8px 16px;font-size:.85rem;cursor:pointer;color:#1a1a1a;display:flex;align-items:center;gap:10px}
.ctx-item:hover{background:var(--accent);color:#fff}
.ctx-sep{height:1px;background:#ddd;margin:4px 0}

/* ===================== TASKBAR ===================== */
#taskbar{
  position:fixed;left:0;right:0;bottom:0;height:40px;background:var(--taskbar-bg);
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  display:none;align-items:stretch;z-index:5000;border-top:1px solid rgba(255,255,255,.08);
}
#start-btn{
  width:46px;background:transparent;border:none;color:#fff;display:flex;align-items:center;justify-content:center;
  cursor:pointer;transition:background .1s ease;
}
#start-btn:hover,#start-btn.on{background:rgba(255,255,255,.12)}
#start-btn:active{background:rgba(255,255,255,.2)}
.tb-search-box{
  display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.1);border-radius:3px;
  height:28px;margin:6px 6px 6px 4px;padding:0 10px;width:210px;flex-shrink:0;
}
.tb-search-ic{color:#fff;opacity:.8;display:flex;align-items:center;justify-content:center}
.tb-search-box input{
  background:transparent;border:none;color:#fff;outline:none;font-size:.82rem;width:100%;
}
.tb-search-box input::placeholder{color:rgba(255,255,255,.7)}
.tb-taskview{background:transparent;border:none;color:#fff;width:38px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.tb-taskview:hover{background:rgba(255,255,255,.12)}
.tb-pinned,.tb-running{display:flex;align-items:stretch}
#tb-tray{margin-left:auto;display:flex;align-items:center;padding-right:2px}
.tray-ic{color:#fff;padding:0 8px;height:100%;display:flex;align-items:center;cursor:pointer}
.tray-ic:hover{background:rgba(255,255,255,.12)}
.tray-clock{color:#fff;font-size:.72rem;text-align:right;line-height:1.25;padding:2px 10px;cursor:pointer;height:100%;display:flex;flex-direction:column;justify-content:center}
.tray-clock:hover{background:rgba(255,255,255,.12)}
.tb-showdesktop{width:6px;height:100%;border-left:1px solid rgba(255,255,255,.15);cursor:pointer}
.tb-showdesktop:hover{background:rgba(255,255,255,.25)}

.tb-app{
  position:relative;width:46px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;
}
.tb-app:hover{background:rgba(255,255,255,.12)}
.tb-app.active{background:rgba(255,255,255,.08)}
.tb-app .tb-indicator{
  position:absolute;bottom:0;left:50%;transform:translateX(-50%);height:2px;background:#fff;width:0;
  transition:width .15s;
}
.tb-app.open .tb-indicator{width:16px}
.tb-app.focused .tb-indicator{width:26px;background:var(--accent)}

/* flyouts (volume/network/calendar) */
.flyout{
  display:block;position:fixed;bottom:46px;right:8px;background:#2c2c2c;color:#fff;
  border:1px solid rgba(255,255,255,.15);border-radius:4px;box-shadow:0 6px 24px rgba(0,0,0,.5);
  z-index:6000;padding:14px;min-width:200px;
  opacity:0;visibility:hidden;pointer-events:none;transform:translateY(6px);
  transition:opacity .12s ease,transform .12s ease,visibility 0s linear .12s;
}
.flyout.show{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);transition:opacity .12s ease,transform .12s ease}
.flyout-label{font-size:.75rem;opacity:.75;margin-top:8px}
.net-row{font-size:.82rem;padding:6px 0;display:flex;align-items:center;gap:8px}
.calendar-flyout{width:260px}
.cal-big-time{font-size:1.6rem;font-weight:300}
.cal-big-date{font-size:.85rem;opacity:.85;margin-bottom:12px}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;font-size:.72rem;text-align:center}
.cal-grid .cal-dow{opacity:.55;padding-bottom:4px}
.cal-grid .cal-day{padding:4px 0;border-radius:50%}
.cal-grid .cal-day.today{background:var(--accent)}
.cal-grid .cal-day.blank{opacity:0}

/* ===================== START MENU ===================== */
#start-menu{
  display:flex;position:fixed;left:0;bottom:40px;width:640px;height:600px;max-height:calc(100vh - 60px);
  background:var(--start-bg);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  z-index:5500;box-shadow:0 0 40px rgba(0,0,0,.5);color:#fff;border-radius:0 6px 0 0;overflow:hidden;
  opacity:0;visibility:hidden;pointer-events:none;transform:translateY(10px);
  transition:opacity .15s ease,transform .15s ease,visibility 0s linear .15s;
}
#start-menu.show{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);transition:opacity .15s ease,transform .15s ease}
.sm-side{
  width:48px;background:rgba(0,0,0,.25);display:flex;flex-direction:column;align-items:stretch;
  padding:12px 0;gap:2px;flex-shrink:0;transition:width .15s ease;overflow:hidden;
}
.sm-side.expanded{width:200px}
.sm-side-item{
  height:38px;border-radius:0;display:flex;align-items:center;gap:16px;
  cursor:pointer;padding:0 5px;white-space:nowrap;
}
.sm-side-item .icon{flex-shrink:0;margin-left:5px}
.sm-side-item:hover{background:rgba(255,255,255,.12)}
#sm-power-btn{margin-top:auto}
.sm-avatar{
  width:32px;height:32px;border-radius:50%;background:var(--accent);flex-shrink:0;margin-left:5px;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.82rem;color:#fff;
}
.sm-side-label{font-size:.8rem;opacity:0;transition:opacity .1s ease;overflow:hidden}
.sm-side.expanded .sm-side-label{opacity:1}
.sm-main{flex:1;display:flex;flex-direction:column;min-width:0}
.sm-cols{flex:1;display:flex;overflow:hidden}
.sm-applist{width:230px;overflow-y:auto;padding:6px 0}
.sm-app-item{display:flex;align-items:center;gap:12px;padding:9px 16px;font-size:.85rem;cursor:pointer}
.sm-app-item:hover{background:rgba(255,255,255,.12)}
.sm-app-ic{width:22px;display:flex;align-items:center;justify-content:center}
.sm-group-label{padding:8px 16px 2px;font-size:.72rem;opacity:.55}
.sm-letter{padding:6px 16px 2px;font-size:.72rem;font-weight:700;color:var(--accent);background:rgba(255,255,255,.04)}
.sm-tiles{
  flex:1;padding:14px;display:grid;grid-template-columns:repeat(3,86px);
  grid-auto-rows:86px;gap:8px;align-content:start;overflow-y:auto;
}
.sm-tile{
  border-radius:2px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:#fff;cursor:pointer;gap:6px;position:relative;transition:outline-color .1s ease;
}
.sm-tile .tile-label{font-size:.62rem;text-align:center;padding:0 4px}
.sm-tile:hover{outline:1px solid rgba(255,255,255,.5)}
.sm-tile:active{filter:brightness(.9)}

/* ===================== WINDOWS ===================== */
#windows-container{position:fixed;inset:0;z-index:2000;pointer-events:none}
#snap-preview{
  position:fixed;background:rgba(0,120,215,.35);border:2px solid rgba(0,120,215,.6);
  z-index:2500;pointer-events:none;opacity:0;transition:opacity .1s ease;
}
#snap-preview.show{opacity:1}
.win{
  position:absolute;background:#fff;border:1px solid var(--win-border);
  box-shadow:0 10px 32px rgba(0,0,0,.3),0 2px 6px rgba(0,0,0,.16);display:flex;flex-direction:column;
  pointer-events:auto;min-width:340px;min-height:220px;
  transition:transform .14s ease,opacity .14s ease;transform:scale(1);opacity:1;
}
.win.win-enter,.win.win-exit{transform:scale(.96);opacity:0;pointer-events:none}
.win.maximized{border:none}
.win.maximized .resize-handle{display:none}
.win.minimized{display:none}
.win-titlebar{
  height:32px;background:var(--win-title-bg);display:flex;align-items:center;flex-shrink:0;
  cursor:default;border-bottom:1px solid #e2e2e2;
}
.win-title-ic{margin:0 8px 0 10px;color:#5a5a5a;display:flex}
.win-title-text{flex:1;font-size:.78rem;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.win-btn{
  width:44px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#444;
}
.win-btn:hover{background:#e5e5e5}
.win-btn.close:hover{background:#e81123;color:#fff}
.win-body{flex:1;overflow:auto;position:relative;background:#fff}
.resize-handle{position:absolute;z-index:2}
.rh-n{top:-3px;left:6px;right:6px;height:6px;cursor:n-resize}
.rh-s{bottom:-3px;left:6px;right:6px;height:6px;cursor:s-resize}
.rh-e{right:-3px;top:6px;bottom:6px;width:6px;cursor:e-resize}
.rh-w{left:-3px;top:6px;bottom:6px;width:6px;cursor:w-resize}
.rh-ne{top:-3px;right:-3px;width:10px;height:10px;cursor:ne-resize}
.rh-nw{top:-3px;left:-3px;width:10px;height:10px;cursor:nw-resize}
.rh-se{bottom:-3px;right:-3px;width:10px;height:10px;cursor:se-resize}
.rh-sw{bottom:-3px;left:-3px;width:10px;height:10px;cursor:sw-resize}

/* mobile full-screen app chrome */
.win.win-mobile{
  position:fixed;inset:0;bottom:var(--mobile-tb-h);top:0;left:0;right:0;
  width:auto;height:auto;min-width:0;min-height:0;border:none;box-shadow:none;z-index:3000;
}
.mwin-bar{
  height:52px;background:var(--win-title-bg);border-bottom:1px solid #e2e2e2;display:flex;
  align-items:center;gap:10px;padding:0 4px;flex-shrink:0;
}
.mwin-back{background:transparent;border:none;width:44px;height:44px;display:flex;align-items:center;justify-content:center;color:#222;cursor:pointer;border-radius:50%}
.mwin-back:active{background:#e2e2e2}
.mwin-ic{color:#555;display:flex}
.mwin-title{font-size:.95rem;font-weight:600;color:#222}

/* ===================== FILE EXPLORER ===================== */
.fe-wrap{display:flex;flex-direction:column;height:100%;font-size:.82rem}
.fe-toolbar{display:flex;align-items:center;gap:2px;padding:6px 8px;border-bottom:1px solid #e5e5e5;background:#fafafa;flex-shrink:0;flex-wrap:wrap}
.fe-tbtn{border:1px solid transparent;background:transparent;padding:6px 10px;font-size:.78rem;cursor:pointer;border-radius:2px;display:flex;align-items:center;gap:6px;color:#222}
.fe-tbtn:hover{background:#e8f1fb;border-color:#cfe3f7}
.fe-tbtn:disabled{opacity:.35;cursor:default}
.fe-tbtn:disabled:hover{background:transparent;border-color:transparent}
.fe-sep{width:1px;background:#ddd;height:20px;margin:0 4px}
.fe-path{
  flex:1;display:flex;align-items:center;gap:4px;background:#fff;border:1px solid #d8d8d8;
  border-radius:2px;padding:6px 10px;margin-left:6px;overflow:hidden;white-space:nowrap;min-width:80px;
}
.fe-crumb{cursor:pointer;color:#0066cc}
.fe-crumb:hover{text-decoration:underline}
.fe-crumb-sep{color:#888;margin:0 2px}
.fe-main{flex:1;display:flex;overflow:hidden}
.fe-sidebar{width:170px;background:#f7f7f7;border-right:1px solid #e5e5e5;overflow-y:auto;padding:8px 0;flex-shrink:0}
.fe-sb-label{padding:6px 14px 3px;font-size:.7rem;color:#888;font-weight:600}
.fe-sb-item{padding:7px 14px 7px 22px;cursor:pointer;display:flex;align-items:center;gap:9px}
.fe-sb-item:hover{background:#eaeaea}
.fe-sb-item.on{background:#cce4f7}
.fe-content{flex:1;overflow:auto;padding:12px;display:grid;grid-template-columns:repeat(auto-fill,88px);grid-auto-rows:86px;gap:4px;align-content:start}
.fe-empty{grid-column:1/-1;color:#999;text-align:center;padding-top:40px;font-size:.85rem}
.fe-item{
  display:flex;flex-direction:column;align-items:center;gap:5px;padding:6px 2px;border-radius:2px;
  cursor:pointer;border:1px solid transparent;text-align:center;
}
.fe-item .fi-ic{color:#5a6672}
.fe-item .fi-label{font-size:.72rem;line-height:1.2;max-width:82px;overflow-wrap:break-word;color:#222}
.fe-item.sel{background:#cce4f7;border-color:#99cbef}
.fe-status{border-top:1px solid #e5e5e5;padding:4px 12px;font-size:.72rem;color:#666;background:#fafafa;flex-shrink:0}

/* ===================== RECYCLE BIN ===================== */
.rb-wrap{display:flex;flex-direction:column;height:100%;font-size:.82rem}
.rb-toolbar{display:flex;gap:2px;padding:6px 8px;border-bottom:1px solid #e5e5e5;background:#fafafa;flex-wrap:wrap}
.rb-content{flex:1;overflow:auto;padding:12px;display:grid;grid-template-columns:repeat(auto-fill,110px);grid-auto-rows:96px;gap:6px;align-content:start}
.rb-item{display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 2px;border-radius:2px;cursor:pointer;border:1px solid transparent;text-align:center}
.rb-item.sel{background:#cce4f7;border-color:#99cbef}
.rb-item .fi-ic{color:#5a6672}
.rb-item .fi-label{font-size:.68rem;line-height:1.15;max-width:100px;overflow-wrap:break-word}
.rb-item .fi-from{font-size:.6rem;color:#888}
.rb-empty{grid-column:1/-1;color:#999;text-align:center;padding-top:40px}

/* ===================== STORE ===================== */
.st-wrap{display:flex;flex-direction:column;height:100%;font-size:.85rem;background:#fff}
.st-topbar{display:flex;align-items:center;gap:22px;padding:12px 22px;border-bottom:1px solid #e5e5e5;flex-shrink:0}
.st-brand{font-weight:700;font-size:1rem;color:#222;display:flex;align-items:center;gap:8px;flex-shrink:0}
.st-tabs{display:flex;gap:2px;flex:1;overflow-x:auto}
.st-tab{display:flex;align-items:center;gap:7px;padding:9px 14px;border-radius:4px;cursor:pointer;color:#444;white-space:nowrap}
.st-tab:hover{background:#f2f2f2}
.st-tab.on{background:#e8e8e8;font-weight:600;color:#111}
.st-searchwrap{display:flex;align-items:center;gap:8px;background:#f2f2f2;border-radius:20px;padding:8px 16px;width:230px;flex-shrink:0}
.st-searchwrap input{border:none;background:transparent;outline:none;flex:1;font-size:.82rem;min-width:0}
.st-main{flex:1;overflow-y:auto;padding:22px}
.st-hero{
  border-radius:8px;padding:30px 34px;margin-bottom:26px;color:#fff;
  background:linear-gradient(120deg,#0f2f66,#1f5fc4 60%,#3d8bdb);
  display:flex;flex-direction:column;gap:6px;
}
.st-hero-eyebrow{font-size:.7rem;text-transform:uppercase;letter-spacing:.07em;opacity:.85}
.st-hero-title{font-size:1.4rem;font-weight:600}
.st-hero-desc{font-size:.83rem;opacity:.9;max-width:460px}
.st-section-title{font-size:1rem;font-weight:600;margin:0 0 12px;color:#222}
.st-row{display:flex;gap:14px;overflow-x:auto;padding-bottom:10px;margin-bottom:26px}
.st-row .st-card{min-width:172px;flex-shrink:0}
.st-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
.st-card{border:1px solid #ececec;border-radius:6px;padding:14px;display:flex;flex-direction:column;gap:7px;transition:box-shadow .12s ease}
.st-card:hover{box-shadow:0 3px 14px rgba(0,0,0,.09)}
.st-card-ic{width:52px;height:52px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff}
.st-card-name{font-weight:600;font-size:.86rem;color:#111}
.st-card-dev{font-size:.7rem;color:#888}
.st-stars{display:inline-flex;gap:1px;color:#ffa000;vertical-align:-2px}
.st-card-rating{display:flex;align-items:center;gap:5px;font-size:.72rem;color:#666}
.st-card-desc{font-size:.74rem;color:#555;flex:1}
.st-card-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:2px}
.st-btn{border:1px solid var(--accent);background:#fff;color:var(--accent);padding:6px 16px;border-radius:16px;font-size:.76rem;cursor:pointer;font-weight:600}
.st-btn:hover{background:#e8f1fb}
.st-btn.filled{background:var(--accent);color:#fff}
.st-btn.filled:hover{background:var(--accent-dark)}
.st-btn.danger{border-color:#c0392b;color:#c0392b}
.st-btn.danger:hover{background:#fbe9e7}
.st-empty{color:#999;text-align:center;padding-top:50px;grid-column:1/-1}

/* ===================== BROWSER (Chrome) ===================== */
.browser-wrap{display:flex;flex-direction:column;height:100%;background:#e8eaed}
.browser-tabs{display:flex;align-items:flex-end;background:#dee1e6;padding:6px 6px 0;gap:2px;flex-shrink:0}
.browser-tab{background:#fff;border-radius:8px 8px 0 0;padding:8px 16px;font-size:.78rem;display:flex;align-items:center;gap:8px;color:#333;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.browser-toolbar{background:#fff;display:flex;align-items:center;gap:4px;padding:8px 10px;border-bottom:1px solid #dcdcdc;flex-shrink:0}
.browser-navbtn{background:transparent;border:none;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#5f6368;cursor:pointer;flex-shrink:0}
.browser-navbtn:hover{background:#eee}
.browser-navbtn:disabled{opacity:.35;cursor:default}
.browser-navbtn:disabled:hover{background:transparent}
.browser-address{flex:1;display:flex;align-items:center;gap:9px;background:#f1f3f4;border-radius:20px;padding:8px 16px;color:#3c4043;min-width:0}
.browser-address input{flex:1;border:none;background:transparent;outline:none;font-size:.85rem;color:#202124;min-width:0}
.browser-content{flex:1;position:relative;background:#fff}
.browser-frame{width:100%;height:100%;border:none;display:block}
.browser-newtab{position:absolute;inset:0;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px}
.browser-newtab-title{font-size:1.3rem;color:#5f6368;font-weight:400}
.browser-newtab-box{width:480px;max-width:86%;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #dfe1e5;border-radius:24px;padding:12px 20px;box-shadow:0 1px 6px rgba(32,33,36,.18)}
.browser-newtab-box input{flex:1;border:none;outline:none;font-size:.95rem;min-width:0}
.browser-note{font-size:.72rem;color:#9aa0a6;max-width:420px;text-align:center}


/* ===================== CALCULATOR ===================== */
.calc-wrap{display:flex;flex-direction:column;height:100%;background:#f3f3f3}
.calc-display{padding:16px 14px 4px;text-align:right;font-size:1.6rem;font-weight:300;color:#111;word-break:break-all;flex-shrink:0;min-height:2.2rem}
.calc-sub{text-align:right;padding:0 14px;color:#888;font-size:.72rem;min-height:16px}
.calc-grid{flex:1;display:grid;grid-template-columns:repeat(5,1fr);gap:1px;background:#ddd}
.calc-key{background:#fbfbfb;border:none;font-size:.84rem;cursor:pointer;color:#222;display:flex;align-items:center;justify-content:center}
.calc-key:hover{background:#e8e8e8}
.calc-key:active{background:#dcdcdc}
.calc-key.fn{background:#eef2f6;color:#333;font-size:.74rem}
.calc-key.fn:hover{background:#dde6ee}
.calc-key.mem{background:#eef2f6;color:#333;font-size:.7rem}
.calc-key.mem:hover{background:#dde6ee}
.calc-key.op{background:#eef4fb;color:var(--accent)}
.calc-key.op:hover{background:#d9e8f8}
.calc-key.eq{background:var(--accent);color:#fff}
.calc-key.eq:hover{background:var(--accent-dark)}
.calc-key.span2{grid-column:span 2}

/* ===================== STICKY NOTE / NOTEPAD ===================== */
.note-wrap{height:100%;display:flex;flex-direction:column}
.note-toolbar{padding:5px 8px;border-bottom:1px solid #e5e5e5;background:#fafafa;display:flex;gap:6px}
.note-textarea{
  flex:1;border:none;resize:none;padding:14px;font-family:'Consolas',monospace;font-size:.88rem;
  outline:none;line-height:1.5;
}
.sticky-textarea{
  flex:1;border:none;resize:none;padding:16px;font-family:'Segoe UI',sans-serif;font-size:.95rem;
  outline:none;background:#fff59d;line-height:1.5;
}

/* ===================== SETTINGS ===================== */
.set-wrap{display:flex;height:100%;font-size:.85rem}
.set-nav{width:180px;background:#f7f7f7;border-right:1px solid #e5e5e5;padding:14px 0;flex-shrink:0}
.set-nav-item{padding:10px 18px;cursor:pointer}
.set-nav-item:hover{background:#eee}
.set-nav-item.on{background:#e2e2e2;font-weight:600}
.set-main{flex:1;overflow-y:auto;padding:26px 30px}
.set-main h2{font-weight:400;margin:0 0 18px}
.set-row{margin-bottom:22px}
.set-label{font-size:.78rem;color:#555;margin-bottom:8px}
.accent-swatch{width:34px;height:34px;border-radius:50%;display:inline-block;margin:0 8px 8px 0;cursor:pointer;border:2px solid transparent}
.accent-swatch.on{border-color:#000}
.wall-swatch{width:80px;height:50px;display:inline-block;margin:0 8px 8px 0;cursor:pointer;border:2px solid transparent;border-radius:3px;background-size:cover}
.wall-swatch.on{border-color:var(--accent)}
.set-btn{border:1px solid #888;background:#fff;padding:8px 18px;border-radius:2px;cursor:pointer;font-size:.8rem}
.set-btn:hover{background:#f0f0f0}
.set-account-tile{width:64px;height:64px;border-radius:50%;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;font-size:1.6rem;font-weight:600;margin-bottom:10px}

/* ===================== GENERIC DEMO APP ===================== */
.demo-app{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#555;text-align:center;padding:20px}
.demo-app .demo-ic{color:#8a95a1}

/* ===================== MODALS ===================== */
.modal-overlay{
  display:flex;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:9700;
  align-items:center;justify-content:center;animation:modalFadeIn .14s ease;
}
.modal-box{background:#fff;width:360px;border-radius:3px;box-shadow:0 12px 40px rgba(0,0,0,.4);overflow:hidden;animation:modalScaleIn .14s ease}
@keyframes modalFadeIn{from{opacity:0}to{opacity:1}}
@keyframes modalScaleIn{from{transform:scale(.94);opacity:0}to{transform:scale(1);opacity:1}}
.modal-head{padding:12px 16px;font-size:.9rem;border-bottom:1px solid #eee;font-weight:600}
.modal-body{padding:16px}
.modal-body input{width:100%;padding:8px 10px;border:1px solid #ccc;border-radius:2px;font-size:.85rem;margin-bottom:6px}
.modal-msg{font-size:.75rem;color:#c0392b;min-height:16px}
.modal-foot{padding:10px 16px;display:flex;justify-content:flex-end;gap:8px;border-top:1px solid #eee}
.modal-foot button{padding:7px 16px;border-radius:2px;border:1px solid #ccc;background:#fff;cursor:pointer;font-size:.8rem}
.modal-foot button.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.modal-foot button.primary:hover{background:var(--accent-dark)}
.modal-foot button:hover{background:#f2f2f2}

/* ===================== TOASTS ===================== */
#toast-host{position:fixed;bottom:50px;right:14px;z-index:9900;display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.toast{
  background:#2c2c2c;color:#fff;padding:10px 16px;border-radius:3px;font-size:.8rem;
  box-shadow:0 6px 20px rgba(0,0,0,.4);max-width:280px;
}

/* ===================== WEATHER / MAPS (shared search bar) ===================== */
.weather-search,.maps-search{display:flex;gap:6px;padding:10px;border-bottom:1px solid #e5e5e5;background:#fafafa;flex-shrink:0}
.weather-search input,.maps-search input{flex:1;padding:8px 12px;border:1px solid #ccc;border-radius:16px;font-size:.85rem;outline:none}
.weather-wrap,.maps-wrap{display:flex;flex-direction:column;height:100%}
.weather-body{flex:1;overflow-y:auto;display:flex;align-items:center;justify-content:center;padding:20px}
.weather-placeholder{color:#888;text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.weather-current{text-align:center;display:flex;flex-direction:column;gap:6px;align-items:center}
.weather-loc{font-size:1.1rem;font-weight:600;color:#222}
.weather-temp{font-size:3rem;font-weight:200;color:#111}
.weather-desc{display:flex;align-items:center;gap:8px;color:#555;font-size:.95rem}
.weather-wind{color:#888;font-size:.82rem}
.maps-frame{flex:1;border:none;width:100%}

/* ===================== PHOTOS ===================== */
.photos-wrap{height:100%;overflow-y:auto;padding:16px}
.photos-grid{display:grid;grid-template-columns:repeat(auto-fill,140px);gap:12px}
.photos-thumb{width:140px;height:110px;border-radius:4px;overflow:hidden;cursor:pointer;border:1px solid #eee;background:#f2f2f2}
.photos-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.photos-viewer{background:transparent;box-shadow:none;display:flex;flex-direction:column;align-items:center;gap:14px;max-width:90vw;max-height:90vh}
.photos-viewer img{max-width:88vw;max-height:78vh;border-radius:4px;box-shadow:0 10px 40px rgba(0,0,0,.5)}
.photos-viewer-close{background:#fff}

/* ===================== MAIL ===================== */
.mail-wrap{display:flex;height:100%;font-size:.82rem}
.mail-sidebar{width:170px;background:#f7f7f7;border-right:1px solid #e5e5e5;padding:10px;flex-shrink:0;display:flex;flex-direction:column;gap:8px}
.mail-folder{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:3px;cursor:pointer}
.mail-folder.on{background:#dcebfa;font-weight:600}
.mail-list{width:260px;border-right:1px solid #e5e5e5;overflow-y:auto;flex-shrink:0}
.mail-item{padding:12px 14px;border-bottom:1px solid #f0f0f0;cursor:pointer}
.mail-item:hover{background:#f7f7f7}
.mail-item.sel{background:#e2f0ff}
.mail-item.unread .mail-subject{font-weight:700}
.mail-item-top{display:flex;justify-content:space-between;font-size:.72rem;color:#666;margin-bottom:3px}
.mail-subject{font-size:.82rem;color:#222;margin-bottom:3px}
.mail-preview{font-size:.74rem;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mail-reading{flex:1;overflow-y:auto;padding:22px}
.mail-read-head{border-bottom:1px solid #eee;padding-bottom:14px;margin-bottom:14px}
.mail-read-subject{font-size:1.1rem;font-weight:600;color:#222;margin-bottom:6px}
.mail-read-from{color:#777;font-size:.8rem}
.mail-read-body{white-space:pre-wrap;line-height:1.6;color:#333;font-size:.85rem}

/* ===================== MUSIC PLAYER ===================== */
.music-wrap{height:100%;display:flex;flex-direction:column;align-items:center;padding:26px 20px;gap:6px;background:linear-gradient(180deg,#faf7ff,#fff)}
.music-art{width:120px;height:120px;border-radius:8px;background:linear-gradient(135deg,#8e24aa,#5c2d91);display:flex;align-items:center;justify-content:center;color:#fff;margin-bottom:10px;box-shadow:0 8px 22px rgba(94,45,145,.3)}
.music-title{font-size:1.05rem;font-weight:600;color:#222}
.music-sub{font-size:.78rem;color:#888;margin-bottom:14px}
.music-controls{display:flex;align-items:center;gap:14px;margin-bottom:18px}
.music-play{background:var(--accent)!important;color:#fff!important;width:46px!important;height:46px!important}
.music-play:hover{background:var(--accent-dark)!important}
.music-list{width:100%;overflow-y:auto;border-top:1px solid #eee}
.music-track{display:flex;align-items:center;gap:10px;padding:9px 6px;font-size:.82rem;color:#444;cursor:pointer;border-radius:3px}
.music-track:hover{background:#f4f0fa}
.music-track.on{color:var(--accent);font-weight:600}

/* ===================== VIDEO PLAYER ===================== */
.video-wrap{height:100%;background:#000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.video-el{width:100%;flex:1;background:#000}
.video-caption{color:#aaa;font-size:.72rem;padding-bottom:8px}

/* ===================== PAINT ===================== */
.paint-wrap{display:flex;flex-direction:column;height:100%}
.paint-toolbar{display:flex;align-items:center;gap:12px;padding:8px 10px;border-bottom:1px solid #e5e5e5;background:#fafafa;flex-shrink:0;flex-wrap:wrap}
.paint-toolbar input[type=color]{width:34px;height:28px;border:1px solid #ccc;border-radius:3px;padding:0;cursor:pointer}
.paint-canvas{flex:1;width:100%;cursor:crosshair;touch-action:none;display:block}

/* ===================== SOLITAIRE ===================== */
.sol-wrap{height:100%;background:#1b6b39;padding:14px;display:flex;flex-direction:column;gap:16px;overflow:auto}
.sol-top{display:flex;align-items:center;gap:22px}
.sol-stockwaste{display:flex;gap:8px}
.sol-foundations{display:flex;gap:8px;margin-left:auto}
.sol-card{
  width:56px;height:78px;border-radius:5px;position:relative;flex-shrink:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  font-size:.85rem;font-weight:700;user-select:none;cursor:pointer;
}
.sol-card.back{background:repeating-linear-gradient(45deg,#1f5fc4,#1f5fc4 4px,#164a99 4px,#164a99 8px);border:1px solid #0f3a80}
.sol-card.empty{background:rgba(255,255,255,.08);border:1px dashed rgba(255,255,255,.3);cursor:default;color:rgba(255,255,255,.5)}
.sol-card.red,.sol-card.black{background:#fff;border:1px solid #ccc;align-items:flex-start;padding:4px 6px;gap:2px}
.sol-card.red{color:#c0392b}
.sol-card.black{color:#222}
.sol-card.sel{outline:3px solid #ffd54f;z-index:50!important}
.sol-suit-ghost{font-size:1.6rem}
.sol-rank{font-size:.8rem;line-height:1}
.sol-suit{font-size:1.1rem;line-height:1}
.sol-tableau{display:flex;gap:8px;flex:1}
.sol-col{position:relative;width:56px;min-height:200px;flex-shrink:0}
.sol-col .sol-card{position:absolute;left:0}

/* ===================== MINESWEEPER ===================== */
.mine-wrap{height:100%;display:flex;flex-direction:column;align-items:center;padding:14px;gap:12px;background:#c0c0c0}
.mine-head{display:flex;align-items:center;gap:16px;background:#bdbdbd;border:2px inset #eee;padding:6px 12px;border-radius:2px}
.mine-counter{background:#000;color:#e74c3c;font-family:'Consolas',monospace;font-weight:700;font-size:1.1rem;padding:2px 8px;border-radius:2px;min-width:48px;text-align:center}
.mine-face{width:34px;height:34px;border-radius:4px;border:2px outset #eee;background:#d8d8d8;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#333}
.mine-face:active{border-style:inset}
.mine-grid{display:grid;gap:1px;background:#7a7a7a;border:3px inset #eee}
.mine-cell{
  width:26px;height:26px;background:#d8d8d8;border:2px outset #eee;display:flex;align-items:center;
  justify-content:center;font-size:.78rem;font-weight:700;cursor:pointer;color:#222;user-select:none;
}
.mine-cell.revealed{border:1px solid #aaa;background:#c8c8c8;cursor:default}
.mine-cell.mine{background:#e74c3c}
.mine-cell.n1{color:#1565c0}
.mine-cell.n2{color:#2e7d32}
.mine-cell.n3{color:#c62828}
.mine-cell.n4{color:#4527a0}
.mine-cell.n5{color:#8d4b00}
.mine-cell.n6{color:#00838f}
.mine-cell.n7{color:#212121}
.mine-cell.n8{color:#616161}

/* scrollbars, windows style-ish */
::-webkit-scrollbar{width:11px;height:11px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#c1c1c1;border:3px solid transparent;background-clip:padding-box;border-radius:6px}
::-webkit-scrollbar-thumb:hover{background:#a6a6a6}

/* ============================================================
   MOBILE MODE — phones get an adapted shell (full-screen apps,
   simplified taskbar, full-screen Start). iPad/desktop untouched.
   ============================================================ */
html.mobile-mode #taskbar{height:var(--mobile-tb-h);padding-bottom:env(safe-area-inset-bottom,0)}
html.mobile-mode #start-btn{width:68px}
html.mobile-mode .tb-search-box,
html.mobile-mode .tb-taskview,
html.mobile-mode .tb-pinned,
html.mobile-mode .tb-running,
html.mobile-mode .tray-ic,
html.mobile-mode .tb-showdesktop{display:none}
html.mobile-mode .tray-clock{font-size:.82rem}

html.mobile-mode #start-menu{
  left:0;right:0;top:0;bottom:0;width:100%;height:100%;max-height:100%;
  border-radius:0;flex-direction:column-reverse;
}
html.mobile-mode .sm-side{width:100%;height:66px;flex-direction:row;justify-content:space-around;align-items:center;padding:0}
html.mobile-mode #sm-hamburger{display:none}
html.mobile-mode #sm-power-btn{margin-top:0}
html.mobile-mode .sm-cols{flex-direction:column}
html.mobile-mode .sm-applist{width:100%;max-height:36vh;border-bottom:1px solid rgba(255,255,255,.08)}
html.mobile-mode .sm-tiles{grid-template-columns:repeat(3,1fr);grid-auto-rows:96px}
html.mobile-mode .sm-search{padding:18px 18px 10px}
html.mobile-mode .sm-search input{padding:12px 14px;font-size:.95rem}

html.mobile-mode .d-icon{width:88px;padding:8px 2px}
html.mobile-mode .d-icon .d-ic{width:52px;height:52px}
html.mobile-mode .d-icon .icon{width:34px;height:34px}
html.mobile-mode .d-label{font-size:.8rem}

/* internal app layouts respond to real viewport width regardless of shell mode */
@media (max-width:767px){
  .fe-sidebar{display:none}
  .fe-tbtn .lbl{display:none}
  .fe-tbtn{padding:8px}
  .fe-toolbar{gap:4px}
  .fe-content{grid-template-columns:repeat(auto-fill,84px)}
  .set-nav{
    width:auto;display:flex;flex-direction:row;padding:6px 8px;overflow-x:auto;
    border-right:none;border-bottom:1px solid #e5e5e5;flex-shrink:0;
  }
  .set-nav-item{white-space:nowrap}
  .set-wrap{flex-direction:column}
  .set-main{padding:20px}
  .st-topbar{flex-wrap:wrap;gap:10px;padding:10px 14px}
  .st-brand{width:100%}
  .st-tabs{order:2;width:100%}
  .st-searchwrap{order:1;flex:1;width:auto}
  .st-grid{grid-template-columns:1fr 1fr}
  .st-main{padding:16px}
  .st-hero{padding:22px}
}
@media (max-width:480px){
  .st-grid{grid-template-columns:1fr}
}

