/* =========================================================================
   Billal OS — os.css
   Bureau façon macOS (desktop) / écran d'accueil façon iOS (mobile).
   ========================================================================= */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ink: #111113;
  --ink-2: #3a3a3c;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --win-bg: rgba(255, 255, 255, 0.97);
  --win-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.22), 0 22px 70px rgba(0, 0, 0, 0.38), 0 8px 18px rgba(0, 0, 0, 0.16);
  --accent: #0a84ff;
  --menubar-h: 28px;
  --spring: linear(0, 0.05, 0.166, 0.309, 0.456, 0.591, 0.707, 0.801, 0.874, 0.928, 0.966, 0.992, 1.007, 1.015, 1.019, 1.019, 1.018, 1.015, 1.012, 1.009, 1.007, 1.005, 1);
  --spring-pop: linear(0, 0.08, 0.264, 0.483, 0.69, 0.86, 0.982, 1.058, 1.095, 1.103, 1.093, 1.073, 1.05, 1.029, 1.012, 1, 0.993, 0.99, 0.989, 0.991, 0.993, 0.995, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: #1b1b1c; overflow: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; }
img { display: block; max-width: 100%; -webkit-user-drag: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
input, textarea, select { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --------------------------------------------------------------------------
   Fond d'écran
   -------------------------------------------------------------------------- */
.wallpaper { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #a9a9ab 0%, #8a8a8d 38%, #5d5d60 72%, #3b3b3d 100%); }
.wallpaper .wp-photo { position: absolute; left: 50%; bottom: 0; height: 104%; width: auto; max-width: none; transform: translateX(-50%); filter: grayscale(1) contrast(1.08) brightness(0.9); -webkit-mask-image: radial-gradient(ellipse 46% 62% at 50% 46%, #000 52%, rgba(0, 0, 0, 0.55) 72%, transparent 92%); mask-image: radial-gradient(ellipse 46% 62% at 50% 46%, #000 52%, rgba(0, 0, 0, 0.55) 72%, transparent 92%); opacity: 0; transition: opacity 1.4s var(--ease-out), transform 1.8s var(--ease-out); }
.booted .wallpaper .wp-photo { opacity: 1; }
.wallpaper .wp-vignette { position: absolute; inset: 0; background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.38) 100%); }
.wallpaper .wp-grain { position: absolute; inset: -50%; width: 200%; height: 200%; opacity: 0.2; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 0.8s steps(2) infinite; pointer-events: none; }
@keyframes grain { 0% { transform: translate(0, 0); } 50% { transform: translate(-1.5%, 1%); } 100% { transform: translate(1%, -1.5%); } }

/* --------------------------------------------------------------------------
   Barre de menus
   -------------------------------------------------------------------------- */
.menubar { position: fixed; top: 0; left: 0; right: 0; height: var(--menubar-h); z-index: 9000; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #fff; font-size: 13px; background: rgba(40, 40, 42, 0.28); backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); text-shadow: 0 0 1px rgba(0, 0, 0, 0.2); transform: translateY(-100%); transition: transform 0.8s var(--ease-out) 0.3s; }
.booted .menubar { transform: none; }
.menubar .left, .menubar .right { display: flex; align-items: center; gap: 2px; height: 100%; }
.menubar button, .menubar a { height: 22px; padding: 0 9px; border-radius: 5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.menubar button:hover, .menubar a:hover, .menubar button.open { background: rgba(255, 255, 255, 0.2); }
.menubar .logo { font-weight: 800; letter-spacing: -0.04em; font-size: 14px; }
.menubar .logo span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #fff; color: #111; font-size: 9.5px; letter-spacing: -0.03em; }
.menubar .app-name { font-weight: 700; }
.menubar .lang button { padding: 0 6px; opacity: 0.6; font-weight: 600; font-size: 12px; }
.menubar .lang button.active { opacity: 1; }
.menubar .clock { font-variant-numeric: tabular-nums; }
.menubar .status { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; }
.menubar .status i { width: 7px; height: 7px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25); }
.menubar svg { width: 15px; height: 15px; fill: currentColor; }

/* --------------------------------------------------------------------------
   Icônes du bureau
   -------------------------------------------------------------------------- */
.desktop { position: fixed; inset: var(--menubar-h) 0 0 0; z-index: 10; }
.dicon { position: absolute; width: 132px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 4px 5px; border-radius: 10px; transform: translate(-50%, 0) scale(0.6); opacity: 0; touch-action: none; }
.booted .dicon { opacity: 1; transform: translate(-50%, 0) scale(1); transition: opacity 0.5s var(--ease-out), transform 0.8s var(--spring-pop); transition-delay: calc(0.55s + var(--i) * 70ms); }
.dicon.dragging { transition: none !important; z-index: 5; }
.dicon .thumb { width: 82px; height: 82px; padding: 5px; border-radius: 14px; }
.dicon .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 9px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(255, 255, 255, 0.35); transition: transform 0.4s var(--spring); }
.dicon:hover .thumb img { transform: translateY(-2px) scale(1.04); }
.dicon .label { max-width: 128px; padding: 2px 6px; border-radius: 5px; color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.25; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 1px rgba(0, 0, 0, 0.6); }
.dicon.selected .thumb { background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.dicon.selected .label { background: #0a5bd8; text-shadow: none; }

/* --------------------------------------------------------------------------
   Dock
   -------------------------------------------------------------------------- */
.dock-wrap { position: fixed; left: 50%; bottom: 10px; z-index: 8000; transform: translate(-50%, 140%); transition: transform 0.9s var(--spring) 0.35s; }
.booted .dock-wrap { transform: translate(-50%, 0); }
.dock { display: flex; align-items: flex-end; gap: 8px; padding: 7px 8px; border-radius: 22px; background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.45), 0 10px 40px rgba(0, 0, 0, 0.28); }
.dock .sep { width: 1px; align-self: stretch; margin: 6px 3px; background: rgba(255, 255, 255, 0.35); }
.dapp { position: relative; width: 50px; height: 50px; transition: width 0.32s var(--spring), height 0.32s var(--spring), transform 0.32s var(--spring); transform-origin: 50% 100%; }
.dapp .ico { width: 100%; height: 100%; border-radius: 22.5%; overflow: hidden; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.dapp .ico img { width: 100%; height: 100%; object-fit: cover; }
.dapp .tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px); padding: 4px 10px; border-radius: 7px; background: rgba(30, 30, 32, 0.82); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.25s var(--ease-out); backdrop-filter: blur(10px); }
.dapp:hover .tip { opacity: 1; transform: translateX(-50%); }
.dapp .run { position: absolute; left: 50%; bottom: -6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); opacity: 0; transition: opacity 0.3s; }
.dapp.running .run { opacity: 1; }
.dapp.bounce .ico { animation: bounce 0.62s var(--ease-out); }
@keyframes bounce { 0% { transform: translateY(0); } 35% { transform: translateY(-16px); } 60% { transform: translateY(0); } 78% { transform: translateY(-5px); } 100% { transform: translateY(0); } }

/* Icônes d'applications (dessinées en CSS / SVG) */
.ico.avatar { background: #f2f2f7; }
.ico.avatar img { object-position: 50% 22%; }
.ico.notes { background: linear-gradient(#ffd54f 0 26%, #fff 26% 100%); position: relative; }
.ico.notes::after { content: ""; position: absolute; inset: 38% 16% 14%; background: repeating-linear-gradient(#fff 0 7px, #d7d7dc 7px 8px); }
.ico.mail { background: linear-gradient(180deg, #5ac8fa, #0a84ff); }
.ico.stocks { background: #111; }
.ico.wa { background: linear-gradient(180deg, #5bf07c, #1dbb4a); color: #fff; }
.ico.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); color: #fff; }
.ico.finder { background: linear-gradient(90deg, #6ec6ff 50%, #e9f5ff 50%); }
.ico svg { width: 62%; height: 62%; fill: currentColor; }
.ico.mail svg, .ico.stocks svg, .ico.finder svg { width: 72%; height: 72%; }

/* --------------------------------------------------------------------------
   Fenêtres
   -------------------------------------------------------------------------- */
.windows { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.win { position: absolute; display: flex; flex-direction: column; min-width: 320px; min-height: 200px; border-radius: 12px; background: var(--win-bg); box-shadow: var(--win-shadow); overflow: hidden; pointer-events: auto; transform-origin: var(--ox, 50%) var(--oy, 50%); }
.win.inactive { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.18), 0 12px 40px rgba(0, 0, 0, 0.22); }
.win.maximized { border-radius: 0; }
.win.animating { transition: left 0.45s var(--spring), top 0.45s var(--spring), width 0.45s var(--spring), height 0.45s var(--spring), border-radius 0.3s; }
.titlebar { position: relative; flex: none; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(250, 250, 250, 0.9); cursor: grab; touch-action: none; }
.titlebar:active { cursor: grabbing; }
.titlebar .title { position: absolute; left: 90px; right: 90px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.win.inactive .titlebar .title { color: #a1a1a6; }
.lights { display: flex; gap: 8px; }
.lights button { position: relative; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); cursor: pointer; }
.lights .l-close { background: #ff5f57; } .lights .l-min { background: #febc2e; } .lights .l-max { background: #28c840; }
.win.inactive .lights button { background: #dcdcde; }
.lights button svg { position: absolute; inset: 2px; width: 8px; height: 8px; fill: none; stroke: rgba(0, 0, 0, 0.55); stroke-width: 1.4; stroke-linecap: round; opacity: 0; }
.lights:hover button svg { opacity: 1; }
.win .body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; user-select: text; -webkit-user-select: text; }
.win .body::-webkit-scrollbar { width: 10px; }
.win .body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.win .resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; }
.sheet-grabber { display: none; }

/* À propos */
.about { padding: 22px 22px 24px; }
.about h1 { margin: 0 0 18px; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.about .card { display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: end; }
.about .card img { width: 116px; height: 136px; border-radius: 10px; object-fit: cover; object-position: 50% 20%; filter: grayscale(1) contrast(1.05); }
.kv { display: grid; gap: 0; }
.kv div { display: grid; grid-template-columns: 78px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink); }
.kv dd { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv dd a { color: var(--accent); }
.about .bio { margin: 18px 0 0; padding: 14px 16px; border-radius: 10px; background: #f2f2f4; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.about .bio p { margin: 0 0 10px; } .about .bio p:last-child { margin: 0; }
.about .avail { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: #1f8f45; font-weight: 500; }
.about .avail i { width: 7px; height: 7px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.2); }
.about h3 { margin: 20px 0 10px; font-size: 14px; font-weight: 600; }
.map { position: relative; height: 190px; border-radius: 10px; overflow: hidden; background: #e5e5ea; }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.2); }
.map .open { position: absolute; left: 10px; top: 10px; padding: 6px 10px; border-radius: 7px; background: #fff; color: var(--accent); font-size: 12px; font-weight: 500; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.about .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; background: #e9e9ed; color: var(--ink); cursor: pointer; transition: background 0.15s, transform 0.2s var(--spring); }
.btn:hover { background: #dfdfe4; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #0071e3; }
.btn.wa { background: #25d366; color: #fff; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }

/* Notes */
.notes { display: grid; grid-template-columns: 230px 1fr; height: 100%; }
.notes .list { border-right: 1px solid var(--line); padding: 10px 8px; overflow: auto; background: #fbfbfd; }
.notes .item { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.notes .item b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notes .item span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes .item span em { font-style: normal; color: var(--ink-2); margin-right: 6px; }
.notes .item.active { background: #ffe082; }
.notes .item + .item { margin-top: 2px; }
.notes .page { overflow: auto; padding: 16px 28px 30px; user-select: text; -webkit-user-select: text; }
.notes .page .date { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.notes .page h2 { margin: 0 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.notes .page p, .notes .page li { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.notes .page p { margin: 0 0 12px; }
.notes .page ul, .notes .page ol { margin: 0 0 14px; padding-left: 20px; }
.notes .page a { color: var(--accent); }
.notes .page .fade { animation: notein 0.35s var(--ease-out); }
@keyframes notein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Projet */
.project { padding: 26px 30px 34px; max-width: 900px; margin: 0 auto; }
.project h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.project .lede { margin: 0 0 22px; max-width: 62ch; font-size: 15px; line-height: 1.55; color: var(--muted); }
.project .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin-bottom: 22px; }
.project .meta b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.project .meta span { font-size: 13.5px; color: var(--muted); }
.project .cta { display: flex; gap: 8px; margin-bottom: 24px; }
.project .shots { display: grid; gap: 14px; }
.project .shots figure { margin: 0; border-radius: 12px; overflow: hidden; background: #f2f2f4; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1); }
.project .shots img { width: 100%; height: auto; }
.project .shots .pair { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; align-items: start; }
.project .shots .pair figure:last-child img { aspect-ratio: 500 / 1000; object-fit: cover; object-position: top; }
.project .next { margin-top: 34px; }
.project .next h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.project .next button { display: block; width: 100%; text-align: left; cursor: pointer; }
.project .next figure { margin: 0 0 8px; height: 220px; border-radius: 12px; overflow: hidden; }
.project .next img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.8s var(--ease-out); }
.project .next button:hover img { transform: scale(1.03); }
.project .next b { font-size: 14px; font-weight: 600; }
.project .reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s var(--ease-out) forwards; animation-delay: calc(var(--d, 0) * 70ms + 120ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Mail */
.mail { display: flex; flex-direction: column; height: 100%; }
.mail .toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.mail .rows { padding: 0 16px; }
.mail .row { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mail .row > span:first-child { color: var(--muted); min-width: 64px; }
.mail .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: #e8f0fe; color: #0b57d0; font-size: 12.5px; }
.mail form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mail .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 0 16px; }
.mail .field { position: relative; border-bottom: 1px solid var(--line); }
.mail .field.full { grid-column: 1 / -1; }
.mail .field input, .mail .field select { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; font-size: 13.5px; }
.mail .field select { appearance: none; cursor: pointer; color: var(--ink); }
.mail .field select.empty { color: #a1a1a6; }
.mail .field input::placeholder { color: #a1a1a6; }
.mail .field .err { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: #ff3b30; display: none; background: var(--win-bg); padding-left: 6px; }
.mail .field.error .err { display: block; }
.mail .field.error { border-bottom-color: #ff3b30; }
.mail textarea { flex: 1; min-height: 150px; width: 100%; resize: none; border: 0; outline: 0; padding: 14px 16px; font-size: 14px; line-height: 1.55; background: transparent; }
.mail .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.mail .foot small { color: var(--muted); font-size: 12px; }
.mail .status { margin: 0 16px 10px; padding: 9px 12px; border-radius: 8px; background: #fff2f1; color: #d70015; font-size: 13px; display: none; }
.mail .status.on { display: block; }
.mail .hp { position: absolute; left: -9999px; width: 0; height: 0; overflow: hidden; }
.mail .sent { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px; text-align: center; }
.mail.is-sent form { display: none; }
.mail.is-sent .sent { display: flex; }
.mail .sent .check { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #e8f8ee; color: #1f8f45; animation: pop 0.6s var(--spring-pop); }
.mail .sent .check svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mail .sent h3 { margin: 6px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.mail .sent p { margin: 0 0 10px; color: var(--muted); max-width: 36ch; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Quant Lab (fenêtre sombre) */
.win.dark { background: #0c0c0d; color: #f4f0e8; }
.win.dark .titlebar { background: #161618; border-bottom-color: rgba(255, 255, 255, 0.08); }
.win.dark .titlebar .title { color: rgba(244, 240, 232, 0.7); }
.stocks { display: flex; flex-direction: column; height: 100%; }
.stocks .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: rgba(244, 240, 232, 0.65); cursor: pointer; }
.seg button.active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.stocks .bar .rerun { font-size: 12.5px; color: rgba(244, 240, 232, 0.8); padding: 6px 12px; border-radius: 7px; background: rgba(255, 255, 255, 0.07); cursor: pointer; }
.stocks .content { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 260px; }
.stocks .chart { position: relative; min-height: 300px; }
.stocks .chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stocks .chart .legend { position: absolute; top: 12px; left: 16px; display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; color: rgba(244, 240, 232, 0.6); pointer-events: none; }
.stocks .chart .legend span { display: inline-flex; align-items: center; gap: 6px; }
.stocks .chart .legend i { width: 12px; height: 2px; border-radius: 2px; background: #f4f0e8; }
.stocks .side { border-left: 1px solid rgba(255, 255, 255, 0.08); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.stocks .side h4 { margin: 0; font-size: 15px; font-weight: 600; }
.stocks .side p { margin: 0; font-size: 12.5px; line-height: 1.5; color: rgba(244, 240, 232, 0.6); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.kpi span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(244, 240, 232, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi span i { font-style: normal; text-transform: none; }
.kpi b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 14px; font-weight: 500; }
.kpi b.up { color: #3ddc97; } .kpi b.down { color: #ff5c5c; } .kpi b.gold { color: #ffb02e; }
.stocks .note { margin-top: auto; font-family: var(--mono); font-size: 10.5px; color: rgba(244, 240, 232, 0.45); line-height: 1.5; }

/* Toast */
.hint { position: fixed; left: 50%; top: calc(var(--menubar-h) + 14px); z-index: 50; transform: translate(-50%, -8px); padding: 7px 14px; border-radius: 999px; background: rgba(30, 30, 32, 0.55); color: #fff; font-size: 12.5px; backdrop-filter: blur(16px); opacity: 0; transition: opacity 0.6s, transform 0.6s var(--ease-out); pointer-events: none; }
.hint.on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Mobile : écran d'accueil + fenêtres en feuilles
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --menubar-h: 44px; }
  .menubar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 15px; font-weight: 600; padding: 0 22px; }
  .menubar .left > :not(.clock-m), .menubar .right > :not(.lang):not(.sig) { display: none; }
  .menubar .clock-m { display: inline-flex !important; font-size: 15px; font-weight: 600; padding: 0; }
  .menubar .sig { display: inline-flex !important; gap: 5px; }
  .desktop { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 22px 8px; padding: 22px 16px 150px; overflow-y: auto; overscroll-behavior: contain; }
  .dicon { position: static; width: auto; transform: scale(0.6); padding: 0; }
  .booted .dicon { transform: none; }
  .dicon .thumb { width: 66px; height: 66px; padding: 0; background: none !important; box-shadow: none !important; }
  .dicon .thumb img { border-radius: 16px; }
  .dicon .label { font-size: 11.5px; background: none !important; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wallpaper .wp-photo { height: 88%; bottom: 0; -webkit-mask-image: radial-gradient(ellipse 80% 64% at 50% 44%, #000 50%, transparent 95%); mask-image: radial-gradient(ellipse 80% 64% at 50% 44%, #000 50%, transparent 95%); }
  .dock-wrap { bottom: 12px; width: calc(100% - 24px); }
  .dock { justify-content: space-around; padding: 12px; border-radius: 30px; }
  .dock .sep, .dapp .tip, .dapp.desk-only { display: none; }
  .dapp { width: 58px; height: 58px; }
  .win { left: 0 !important; top: auto !important; bottom: 0; width: 100% !important; height: calc(100% - 38px) !important; border-radius: 18px 18px 0 0; min-width: 0; }
  .win .resize, .lights { display: none; }
  .titlebar { height: 52px; justify-content: center; cursor: default; padding: 0 16px; }
  .titlebar .title { position: static; font-size: 15px; }
  .titlebar .done { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 600; font-size: 15px; cursor: pointer; }
  .win.dark .titlebar .done { color: #ffb02e; }
  .sheet-grabber { display: block; position: absolute; left: 50%; top: 6px; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: rgba(0, 0, 0, 0.18); }
  .win.dark .sheet-grabber { background: rgba(255, 255, 255, 0.25); }
  .notes { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .notes .list { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .notes .item { flex: none; width: auto; padding: 8px 12px; }
  .notes .item span { display: none; }
  .notes .page { padding: 16px 20px 40px; }
  .project { padding: 18px 18px 40px; }
  .project .meta { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .project .shots .pair { grid-template-columns: 1fr; }
  .mail .fields { grid-template-columns: 1fr; }
  .stocks .content { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 1fr) auto; overflow: auto; }
  .stocks .side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .about .card { grid-template-columns: 96px 1fr; }
  .about .card img { width: 96px; height: 116px; }
  .hint { display: none; }
}
.menubar .clock-m, .menubar .sig { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* Projets (Finder) */
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 14px; }
.fcard { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 8px; border-radius: 12px; cursor: pointer; transition: background 0.15s; }
.fcard:hover { background: #f2f2f4; }
.fcard .fthumb { display: block; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.fcard .fthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s var(--ease-out); }
.fcard:hover .fthumb img { transform: scale(1.04); }
.fcard b { font-size: 13px; font-weight: 600; }
.fcard > span:last-child { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .finder-grid { grid-template-columns: 1fr 1fr; } }

/* --------------------------------------------------------------------------
   v4.1 — corrections après vérification visuelle
   -------------------------------------------------------------------------- */
.titlebar .done { display: none; }
.wallpaper { background: radial-gradient(120% 95% at 50% 42%, #3a3a3d 0%, #232325 45%, #121213 78%, #0b0b0c 100%); }
.wallpaper .wp-photo { height: 100%; filter: grayscale(1) contrast(1.06) brightness(0.92); -webkit-mask-image: radial-gradient(ellipse 58% 88% at 50% 58%, #000 38%, rgba(0, 0, 0, 0.6) 62%, transparent 96%); mask-image: radial-gradient(ellipse 58% 88% at 50% 58%, #000 38%, rgba(0, 0, 0, 0.6) 62%, transparent 96%); }
.wallpaper .wp-vignette { background: radial-gradient(140% 110% at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.5) 100%); }
.dicon .thumb { width: 104px; height: 72px; padding: 5px; }
.dicon .thumb img { object-fit: cover; object-position: top center; border-radius: 7px; }
@media (max-width: 760px) {
  .titlebar .done { display: block; }
  .dicon .thumb { width: 66px; height: 66px; padding: 0; }
  .dicon .thumb img { border-radius: 16px; }
  .wallpaper .wp-photo { height: 92%; -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 50%, #000 40%, transparent 96%); mask-image: radial-gradient(ellipse 95% 80% at 50% 50%, #000 40%, transparent 96%); }
}

.win[hidden] { display: none !important; }

