/* ============ Masoud Borodayeh portfolio layer styles ============ */
:root { --accent: #C2EF06; }
::selection { background: rgba(0,122,255,.35); color: inherit; }
.boot-bar-fill { background: #f5f5f7 !important; }  /* authentic Mac boot bar */

/* brand mark in menubar / boot */
.pf-mark svg { width: 100%; height: auto; display: block; }
html[data-theme="light"] .pf-mark { color: #231F20; }
html[data-theme="dark"] .pf-mark { color: #f2f2f2; }
#boot-logo span svg { width: 100%; height: auto; }

/* lock screen identity */
.lock-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* rtl for persian content panes */
[data-pflang="fa"] .pf-rtl { direction: rtl; text-align: right; }
[data-pflang="fa"] .pf-rtl .pf-back { transform: scaleX(-1); }

/* shared pieces */
.pf-btn {
  display: inline-block; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #231F20; border: none; font-weight: 600; font-size: 12.5px;
  text-decoration: none;
}
.pf-btn:hover { filter: brightness(1.07); }
.pf-btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.pf-side-h { font-size: 11px; font-weight: 700; opacity: .55; padding: 10px 14px 6px; text-transform: uppercase; letter-spacing: .04em; }
.pf-side { width: 190px; flex: none; border-right: 1px solid rgba(128,128,128,.25); overflow-y: auto; padding-bottom: 10px; }
[dir="rtl"] .pf-side, .pf-rtl .pf-side { border-right: none; border-left: 1px solid rgba(128,128,128,.25); }
.pf-cat { padding: 6px 14px; font-size: 12.5px; cursor: pointer; border-radius: 8px; margin: 1px 8px; display: flex; justify-content: space-between; gap: 6px; }
.pf-cat:hover { background: rgba(128,128,128,.14); }
.pf-cat.on { background: rgba(128,128,128,.22); font-weight: 600; } /* macOS sidebar selection */
.pf-cat i { font-style: normal; opacity: .55; }
.pf-main { flex: 1; overflow-y: auto; padding: 14px 16px; }

/* finder work browser */
.pf-finder { display: flex; height: 100%; }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pf-card { border-radius: 12px; overflow: hidden; cursor: pointer; background: rgba(128,128,128,.10); transition: transform .18s var(--ease, ease); }
.pf-card:hover { transform: translateY(-3px); }
.pf-card-img { height: 120px; background: #231F20; display: flex; align-items: center; justify-content: center; }
.pf-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pf-noimg { color: var(--accent); font-size: 30px; }
.pf-card-t { font-size: 12.5px; font-weight: 600; padding: 8px 10px 2px; }
.pf-card-c { font-size: 11px; opacity: .55; padding: 0 10px 9px; }
.pf-detail h3 { margin: 4px 0 6px; font-size: 17px; }
.pf-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pf-meta span { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #231F20; font-weight: 600; }
.pf-cover { border-radius: 12px; overflow: hidden; margin: 10px 0; background: #231F20; }
.pf-cover img { width: 100%; display: block; }
.pf-detail p { font-size: 13px; line-height: 1.8; opacity: .85; }
.pf-tools { font-size: 12px; opacity: .7; margin: 6px 0; }
.pf-back { border: none; background: rgba(128,128,128,.15); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 14px; }

/* photos */
.pf-photos { height: 100%; overflow-y: auto; }
.pf-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 10px 16px 16px; }
.pf-pitem { border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 1; background: #231F20; }
.pf-pitem img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.pf-pitem:hover img { transform: scale(1.05); }
.pf-light { position: fixed; inset: 0; z-index: 400; background: rgba(10,10,12,.88); backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: zoom-out; }
.pf-light img { max-width: 88vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.pf-light-cap { color: #eee; font-size: 12px; opacity: .8; }

/* notes */
.pf-notes { display: flex; height: 100%; }
.pf-note-body h3 { font-size: 15px; margin-bottom: 8px; }
.pf-note-body p { font-size: 13px; line-height: 2; }
.pf-src { margin-top: 14px; font-size: 11px; opacity: .5; }

/* terminal keeps authentic engine prompt colors */

/* music */
.pf-music { display: flex; gap: 22px; padding: 26px; height: 100%; box-sizing: border-box; align-items: center; }
.pf-mu-cover { width: 220px; height: 220px; flex: none; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.35); background: #231F20; display: flex; align-items: center; justify-content: center; font-size: 60px; }
.pf-mu-cover img { width: 100%; height: 100%; object-fit: cover; }
.pf-mu-t { font-size: 20px; font-weight: 700; }
.pf-mu-a { font-size: 14px; opacity: .7; margin: 2px 0 4px; }
.pf-mu-sub { font-size: 11.5px; color: #231F20; background: var(--accent); display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 600; margin-bottom: 14px; }
.pf-mu-row { display: flex; align-items: center; gap: 12px; }
.pf-play { width: 40px; height: 40px; border-radius: 50%; font-size: 15px; padding: 0; }
.pf-mu-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(128,128,128,.25); cursor: pointer; overflow: hidden; }
.pf-mu-fill { height: 100%; width: 0; background: #FA2D48; } /* Apple Music red */
.pf-mu-time { font-size: 11px; opacity: .6; min-width: 34px; }

/* about */
.pf-about { text-align: center; }
.pf-avatar { width: 92px !important; height: 92px !important; margin: 18px auto 8px; border-radius: 50%; overflow: hidden; background: none !important; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-about .pf-fa { display: block; font-size: 13px; opacity: .6; font-weight: 400; margin-top: 2px; }
.pf-about .ab-bio { font-size: 12px; line-height: 1.9; opacity: .85; margin: 10px 18px; text-align: center; }
.pf-about .pf-btnrow { justify-content: center; }
.pf-sig { max-width: 200px; margin: 4px auto 14px; opacity: .85; }
.pf-sig svg { width: 100%; height: auto; }
html[data-theme="dark"] .pf-sig svg path { fill: #f2f2f2; }
html[data-theme="light"] .pf-sig svg path { fill: #231F20; }

/* empty state (phone) */
.pf-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; }
.pf-empty-ico { font-size: 44px; }
.pf-empty h3 { font-size: 15px; }
.pf-empty .pf-btnrow { justify-content: center; }

/* pdf viewer */
.pf-pdf { display: flex; flex-direction: column; height: 100%; }
.pf-pdf-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid rgba(128,128,128,.25); }
.pf-pdf iframe { flex: 1; border: none; width: 100%; background: #525659; }

/* menubar language switcher + phone contact card */
#mb-lang { min-width: 24px; font-size: 12.5px; font-weight: 600; }
/* input-source indicator: plain menubar text, exactly like macOS */
.pf-contact { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 8px 8px 4px; border-radius: 12px; background: var(--accent); color: #231F20; }
.pfc-av { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.pfc-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-contact b { font-size: 12.5px; }
.pfc-call { margin-left: auto; padding: 5px 10px; }

/* ── round 8: micro-interactions, guestbook, easter eggs, print ── */

/* project cards: staggered entrance + pointer tilt */
@keyframes pfIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.pf-card { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); animation: pfIn .45s cubic-bezier(.2,.8,.2,1) both; }
.pf-card:hover { --ty: -3px; transform: perspective(700px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(var(--ty)); }
.pf-cards .pf-card:nth-child(1){animation-delay:.02s}.pf-cards .pf-card:nth-child(2){animation-delay:.06s}
.pf-cards .pf-card:nth-child(3){animation-delay:.10s}.pf-cards .pf-card:nth-child(4){animation-delay:.14s}
.pf-cards .pf-card:nth-child(5){animation-delay:.18s}.pf-cards .pf-card:nth-child(6){animation-delay:.22s}
.pf-cards .pf-card:nth-child(7){animation-delay:.26s}.pf-cards .pf-card:nth-child(8){animation-delay:.30s}
.pf-cards .pf-card:nth-child(9){animation-delay:.34s}.pf-cards .pf-card:nth-child(10){animation-delay:.38s}
.pf-cards .pf-card:nth-child(11){animation-delay:.42s}.pf-cards .pf-card:nth-child(12){animation-delay:.46s}

/* guestbook */
.pf-guest { padding: 18px 20px; height: 100%; overflow-y: auto; box-sizing: border-box; }
.pf-guest h3 { margin: 0 0 4px; }
.pf-guest .pf-sub { font-size: 11.5px; opacity: .6; margin: 0 0 12px; }
#gb-f { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
#gb-f input, #gb-f textarea { border-radius: 10px; border: 1px solid rgba(128,128,128,.3); background: var(--field, rgba(128,128,128,.12)); padding: 8px 10px; font: inherit; font-size: 12.5px; resize: vertical; }
#gb-f button { align-self: flex-start; }
.gb-item { background: rgba(128,128,128,.10); border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; }
.gb-item b { font-size: 12px; display: block; margin-bottom: 2px; }
.gb-item span { font-size: 12.5px; opacity: .85; }
.gb-empty { font-size: 12px; opacity: .55; padding: 10px 2px; }

/* terminal easter eggs */
.pf-coffee { color: #c8a165; line-height: 1.15; font-size: 12px; }
.pf-mx { color: #33ff66; opacity: .75; font-size: 10.5px; line-height: 1.15; text-shadow: 0 0 6px rgba(51,255,102,.6); }

/* print = clean one-page resume */
#pf-print { display: none; }
@media print {
  body > *:not(#pf-print) { display: none !important; }
  #pf-print { display: block !important; color: #111; background: #fff; font: 12px/1.6 -apple-system, 'Helvetica Neue', sans-serif; padding: 24px; }
  #pf-print h1 { font-size: 22px; margin: 0; }
  #pf-print h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #999; margin: 16px 0 6px; }
  #pf-print .pp-head span { color: #555; margin-right: 12px; }
  #pf-print ul { margin: 4px 0; padding-left: 18px; }
}

/* ── round 10: dock pop-in, wallpapers app, studio store ── */
@keyframes dockpop {
  0% { transform: scale(.15) translateY(34px); opacity: 0; }
  62% { transform: scale(1.12) translateY(-4px); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.dock-enter .dock-item { animation: dockpop .6s cubic-bezier(.3,1.3,.4,1) both; }

/* wallpapers app */
.pf-walls { height: 100%; overflow-y: auto; }
.pf-wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 10px 16px 16px; }
.pf-wcard { border-radius: 12px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: rgba(128,128,128,.08); }
.pf-wcard.on { border-color: var(--accent, #C2EF06); }
.pf-wimg { height: 100px; background-size: cover; background-position: center; }
.pf-wname { font-size: 11.5px; padding: 6px 9px; }

/* studio store */
.pf-store { padding: 16px 18px; overflow-y: auto; height: 100%; box-sizing: border-box; }
.pfs-head h2 { margin: 0; font-size: 18px; }
.pfs-head span { font-size: 12px; opacity: .6; }
.pfs-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid rgba(128,128,128,.18); }
.pfs-ico { width: 46px; height: 46px; border-radius: 11px; background: linear-gradient(180deg,#38c7f5,#0a63d8); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.pfs-t { flex: 1; min-width: 0; }
.pfs-t b { display: block; font-size: 13px; }
.pfs-t span { font-size: 11.5px; opacity: .6; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfs-get { border: none; border-radius: 999px; padding: 4px 16px; font-weight: 700; font-size: 12px; background: rgba(0,122,255,.15); color: #0a84ff; cursor: pointer; }
.pfs-get.got { background: rgba(52,199,89,.18); color: #34c759; }

/* ── round 11: launchpad, messages bot, hello saver, night shift ── */
#launchpad { position: fixed; inset: 0; z-index: 8500; background: rgba(20,20,24,.55); backdrop-filter: blur(28px) saturate(180%); display: none; flex-direction: column; align-items: center; padding: 60px 40px 40px; }
#launchpad.open { display: flex; animation: pfIn .25s ease both; }
#lp-q { width: 240px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.14); color: #fff; padding: 7px 12px; font: inherit; font-size: 13px; margin-bottom: 34px; outline: none; }
#lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 26px 18px; max-width: 880px; width: 100%; overflow-y: auto; }
.lp-item { text-align: center; cursor: pointer; border-radius: 14px; padding: 8px 4px; }
.lp-item:hover { background: rgba(255,255,255,.12); }
.lp-ico { width: 74px; height: 74px; margin: 0 auto 8px; }
.lp-name { color: #fff; font-size: 12px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* messages */
.pf-msgs { display: flex; flex-direction: column; height: 100%; }
.pfm-head { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 10px; border-bottom: 1px solid rgba(128,128,128,.2); }
.pfm-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.pfm-head b { font-size: 12.5px; display: block; }
.pfm-head span { font-size: 10.5px; color: #34c759; }
.pfm-thread { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pfm-b { max-width: 72%; padding: 7px 12px; border-radius: 16px; font-size: 12.5px; line-height: 1.5; }
.pfm-b.m { align-self: flex-start; background: rgba(128,128,128,.18); }
.pfm-b.u { align-self: flex-end; background: #0a84ff; color: #fff; }
.pfm-dots i { display: inline-block; width: 6px; height: 6px; margin: 0 1.5px; border-radius: 50%; background: rgba(128,128,128,.7); animation: pfmblink 1s infinite; }
.pfm-dots i:nth-child(2) { animation-delay: .2s; } .pfm-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pfmblink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.pfm-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(128,128,128,.2); }
.pfm-in input { flex: 1; border-radius: 999px; border: 1px solid rgba(128,128,128,.3); background: var(--field, rgba(128,128,128,.12)); padding: 7px 14px; font: inherit; font-size: 12.5px; outline: none; }

/* hello screen saver */
#saver { position: fixed; inset: 0; z-index: 9500; background: #000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sv-hello { font-size: min(16vw, 150px); font-weight: 700; background: linear-gradient(90deg,#ff3759,#ff9f0a,#ffd60a,#32d74b,#0a84ff,#bf5af2,#ff3759); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: svgrad 6s linear infinite; }
.sv-in { animation: svgrad 6s linear infinite, svpop 2.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes svgrad { to { background-position: 300% 0; } }
@keyframes svpop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* night shift warm overlay */
#nightshift { position: fixed; inset: 0; z-index: 9400; pointer-events: none; background: rgba(255,147,41,.15); }

/* ⌘Tab switcher */
#switcher { position: fixed; inset: 0; z-index: 8600; display: flex; align-items: flex-start; justify-content: center; padding-top: 18vh; background: rgba(20,20,26,.35); backdrop-filter: blur(24px) saturate(180%); }
.sw-box { display: flex; gap: 10px; padding: 14px 18px; border-radius: 20px; background: rgba(40,40,48,.6); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.sw-item { width: 76px; text-align: center; padding: 10px 4px; border-radius: 12px; }
.sw-item.sel { background: rgba(255,255,255,.18); outline: 1px solid rgba(255,255,255,.35); }
.sw-ico { width: 52px; height: 52px; margin: 0 auto 6px; }
.sw-item span { color: #fff; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* guided tour */
#tour-tip { position: fixed; z-index: 9600; max-width: 280px; background: var(--glass-strong, #fff); border-radius: 14px; padding: 12px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.4); font-size: 12.5px; line-height: 1.6; }
#tour-tip b { display: block; margin-bottom: 3px; }
#tour-tip .tt-row { display: flex; gap: 8px; margin-top: 9px; }
#tour-ring { position: fixed; z-index: 9590; border: 2px solid var(--accent, #C2EF06); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none; transition: all .3s cubic-bezier(.2,.8,.2,1); }

/* ── round 13: notification center, quick look, dock dnd ── */
#cal-pop { width: auto; }
.cp-wrap { display: flex; gap: 16px; align-items: flex-start; }
.nc-col { width: 240px; }
.nc-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nc-h b { font-size: 12px; }
#nc-clear { border: none; background: none; color: var(--accent, #0a84ff); font-size: 11px; cursor: pointer; }
#nc-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.nc-item { display: flex; gap: 8px; background: rgba(128,128,128,.12); border-radius: 10px; padding: 7px 8px; }
.nc-ico { width: 26px; height: 26px; flex: none; }
.nc-t { min-width: 0; font-size: 11px; }
.nc-app { opacity: .55; font-size: 10px; display: block; }
.nc-t b { font-size: 11.5px; display: block; }
.nc-m { opacity: .75; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-empty { font-size: 11px; opacity: .5; }

/* quick look */
#ql { position: fixed; inset: 0; z-index: 8800; background: rgba(15,15,20,.6); backdrop-filter: blur(24px) saturate(180%); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#ql .ql-bar { width: min(84vw, 860px); display: flex; justify-content: space-between; padding: 8px 14px; color: #fff; font-size: 12px; }
#ql .ql-body { width: min(84vw, 860px); max-height: 76vh; background: rgba(30,30,36,.75); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
#ql img { max-width: 100%; max-height: 76vh; display: block; margin: 0 auto; }
#ql iframe { width: 100%; height: 76vh; border: none; }
#ql pre { color: #eee; padding: 20px; font-size: 12.5px; line-height: 1.7; max-height: 76vh; overflow: auto; }

/* dock dnd */
.dock-item.dragging { opacity: .35; }
.dock-item.drop, #dock .dock-item[data-app="trash"].drop .dock-icon { transform: scale(1.12); }
@keyframes poof { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.dock-item.poof .dock-icon { animation: poof .45s var(--ease, ease); }

/* ── round 14: tiling menu, sheet, HUD, spaces, auto-hide menubar ── */
.mc-spaces { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 2; }
.mc-space { padding: 10px 16px; border-radius: 12px; background: rgba(40,40,46,.55); backdrop-filter: blur(10px); color: #fff; font-size: 11px; cursor: pointer; text-align: center; border: 1px solid rgba(255,255,255,.08); }
.mc-space b { display: block; font-size: 12px; margin-bottom: 2px; }
.mc-space span { opacity: .6; }
.mc-space.cur { border-color: rgba(255,255,255,.55); background: rgba(70,70,78,.65); }
.win-sheet { position: absolute; top: 40px; left: 50%; transform: translateX(-50%) translateY(-120%); min-width: 240px; max-width: 340px; border-radius: 12px; background: rgba(52,52,58,.92); backdrop-filter: blur(14px) saturate(160%); color: #fff; padding: 16px 18px; box-shadow: 0 14px 44px rgba(0,0,0,.45); transition: transform .3s var(--ease, ease); z-index: 6; }
.win-sheet.in { transform: translateX(-50%) translateY(0); }
#volhud { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); z-index: 9600; display: flex; align-items: center; gap: 10px; background: rgba(45,45,50,.85); backdrop-filter: blur(14px); color: #fff; padding: 10px 14px; border-radius: 14px; transition: opacity .4s; }
#volhud.fade { opacity: 0; }
#volhud .vh-bars { display: flex; gap: 2px; }
#volhud .vh-bars i { width: 3px; height: 12px; border-radius: 1px; background: rgba(255,255,255,.25); }
#volhud .vh-bars i.on { background: #fff; }
body.mb-autohide #menubar { transform: translateY(-24px); transition: transform .25s var(--ease, ease); }
body.mb-autohide #menubar:hover,
body.mb-autohide #menubar.peek { transform: translateY(0); }

/* ── round 15: photos albums, music repeat ── */
.pf-rep { opacity: .45; }
.pf-rep.on { opacity: 1; color: var(--brand, #C2EF06); }
.ph-album { background: rgba(128,128,128,.1); border-radius: 12px; overflow: hidden; cursor: pointer; }
.ph-album img { width: 100%; height: 120px; object-fit: cover; display: block; }
.pf-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(30,30,34,.55); color: #fff; font-size: 20px; cursor: pointer; backdrop-filter: blur(8px); }
.pf-lb-nav.prev { left: 18px; } .pf-lb-nav.next { right: 18px; }
.pf-lb-nav.x { top: 16px; right: 16px; transform: none; font-size: 15px; }
.pf-light { position: relative; }
.pf-alb, .pf-alb-back, .pf-slide { font-size: 11.5px; padding: 4px 10px; }

/* ── round 16: preview app ── */
.pv-stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; background: rgba(128,128,128,.08); }
.pv-stage img { max-width: 100%; display: block; }
.pv-stage iframe { width: 100%; height: 100%; border: none; }
.pv-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(128,128,128,.18); }

/* ── round 17: confirm-sheet buttons ── */
.sh-btn { border: none; border-radius: 8px; padding: 6px 14px; font-size: 12px; cursor: pointer; background: rgba(128,128,128,.25); color: inherit; }
.sh-btn.primary { background: #0a84ff; color: #fff; }
.sh-btn.danger { background: #ff453a; color: #fff; }

/* ── Responsive Mobile & Tablet Overhauls ── */
@media (max-width: 768px) {
  :root {
    --mb-h: 30px;
  }
  html, body {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Menubar */
  #menubar {
    padding: 0 max(8px, env(safe-area-inset-left, 8px)) 0 max(8px, env(safe-area-inset-right, 8px));
    font-size: 12px;
  }
  #mb-left .mb-menu:not(.mb-appname) {
    display: none !important;
  }
  #mb-left .mb-appname {
    font-size: 13px;
    font-weight: 700;
  }
  #mb-batt span {
    display: none !important;
  }

  /* Dock */
  #dock-wrap {
    bottom: max(4px, env(safe-area-inset-bottom, 4px));
    max-width: calc(100vw - 8px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 4px;
  }
  #dock-wrap::-webkit-scrollbar {
    display: none;
  }
  #dock {
    padding: 4px 6px;
    gap: 4px;
  }
  .dock-item {
    width: 38px !important;
    height: 38px !important;
    flex: none !important;
  }
  .dock-item .dock-tip {
    display: none !important;
  }
  .dock-sep {
    height: 22px;
    margin: 0 2px;
  }

  /* Windows */
  .window {
    left: 4px !important;
    top: calc(var(--mb-h) + 4px) !important;
    width: calc(100vw - 8px) !important;
    max-width: calc(100vw - 8px) !important;
    height: calc(100vh - var(--mb-h) - 62px) !important;
    max-height: calc(100vh - var(--mb-h) - 62px) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45) !important;
  }
  .window .resizer {
    display: none !important;
  }
  .titlebar {
    height: 38px;
    padding: 0 10px;
  }
  .traffic-lights {
    gap: 7px;
  }
  .tl {
    width: 13px;
    height: 13px;
  }

  /* Finder & Portfolio Case Studies */
  .pf-finder {
    flex-direction: column;
    height: 100%;
  }
  .pf-side {
    width: 100% !important;
    max-height: 96px !important;
    flex: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    border-right: none !important;
    border-bottom: 0.5px solid var(--divider) !important;
    -webkit-overflow-scrolling: touch;
  }
  .pf-side .side-item {
    flex: none;
    font-size: 12px;
    padding: 4px 8px;
  }
  .pf-main {
    flex: 1;
    overflow-y: auto;
    padding: 10px !important;
  }
  .pf-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .pf-card {
    border-radius: 12px;
    overflow: hidden;
  }
  .pf-card img {
    height: 160px !important;
    object-fit: cover;
  }
  .pfd-body {
    padding: 12px !important;
  }
  .pfd-hero {
    max-height: 220px !important;
  }
  .pfd-gallery {
    grid-template-columns: 1fr !important;
  }
  .pfd-meta {
    flex-direction: column;
    gap: 8px;
  }

  /* Notes */
  .app-notes .window-body {
    flex-direction: column !important;
  }
  .notes-list {
    width: 100% !important;
    max-height: 120px !important;
    flex: none !important;
    border-right: none !important;
    border-bottom: 0.5px solid var(--divider) !important;
    overflow-y: auto;
  }
  .notes-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px !important;
  }

  /* Settings */
  .settings-wrap {
    flex-direction: column !important;
  }
  .settings-side {
    width: 100% !important;
    max-height: 96px !important;
    flex: none !important;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    border-right: none !important;
    border-bottom: 0.5px solid var(--divider) !important;
    padding: 4px;
  }
  .settings-side .side-item {
    flex: none;
    font-size: 12px;
    padding: 4px 8px;
  }
  .settings-main {
    flex: 1;
    overflow-y: auto;
    padding: 12px !important;
  }

  /* Calculator */
  .calc-shell {
    max-width: 270px;
    margin: 0 auto;
  }
  .calc-disp {
    font-size: 36px;
  }

  /* Photos */
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
    gap: 6px !important;
    padding: 8px !important;
  }

  /* Spotlight */
  .sp-shell {
    width: calc(100vw - 16px) !important;
    max-width: 100vw !important;
    left: 8px !important;
    top: calc(var(--mb-h) + 8px) !important;
  }
  #sp-input {
    font-size: 16px !important;
  }

  /* Control Center & Notification Center */
  #cc, #notif-center {
    position: fixed !important;
    top: calc(var(--mb-h) + 6px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: 340px !important;
    margin: 0 auto;
  }

  /* Launchpad */
  #launchpad {
    padding: calc(var(--mb-h) + 16px) 14px 70px !important;
  }
  #lp-q {
    width: 90% !important;
    max-width: 280px;
    font-size: 16px !important;
    margin-bottom: 20px !important;
  }
  #lp-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)) !important;
    gap: 14px 6px !important;
  }
  .lp-ico {
    width: 52px !important;
    height: 52px !important;
    margin-bottom: 4px !important;
  }
  .lp-name {
    font-size: 11px !important;
  }

  /* Lock Screen */
  .lock-time {
    font-size: clamp(48px, 16vw, 76px) !important;
  }
  .lock-date {
    font-size: 16px !important;
  }
  .lock-user {
    bottom: max(12vh, calc(env(safe-area-inset-bottom, 0px) + 60px)) !important;
  }
  #lock-pass {
    font-size: 16px !important;
    width: 140px !important;
  }

  /* Notifications */
  #notifs {
    left: 8px !important;
    right: 8px !important;
    top: calc(var(--mb-h) + 6px) !important;
    max-width: calc(100vw - 16px) !important;
  }
  .notif {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  #mb-wifi, #mb-weather, #mb-search {
    display: none !important;
  }
  .dock-item {
    width: 34px !important;
    height: 34px !important;
  }
  #dock {
    gap: 3px;
    padding: 3px 5px;
  }
  .window {
    left: 2px !important;
    width: calc(100vw - 4px) !important;
    max-width: calc(100vw - 4px) !important;
  }
}

