/* ============================================================
   GIGAWORKS OS — Gigaworks as an OS (Windows variant, v1)
   Dark acrylic + industrial orange. Evokes Windows 11, not a clone.
   ============================================================ */
:root {
  --orange: #F66014; --orange-deep: #F66014; --amber: #FFB224; /* orange-deep = exact logo orange */
  --ink: #14161A; --ink-2: #1C1F25; --ink-3: #2A2E36;
  --line: rgba(255,255,255,.09); --text: #F4F4F1; --muted: #A7ABB4;
  --task-h: 52px; --chat-w: 340px; --radius: 8px;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Archivo Black", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; font-family: var(--font-body); color: var(--text); background: var(--ink); }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ============ BOOT ============ */
.boot { position: fixed; inset: 0; z-index: 1000; background: #0B0C0F; display: grid; place-items: center; }
.boot-inner { width: min(560px, 88vw); text-align: center; }
.boot-logo { width: min(560px, 82vw); height: auto; }
.boot-sub { margin-top: .4rem; font-size: .72rem; letter-spacing: .28em; color: var(--muted); }
.boot-lines { margin: 1.6rem auto 1.2rem; min-height: 9.5em; text-align: left; font-family: "Cascadia Code","Consolas",monospace; font-size: .78rem; color: #7EE0A3; white-space: pre-wrap; }
.boot-bar { height: 4px; background: var(--ink-3); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--amber)); }
.boot-skip { margin-top: 1.4rem; background: none; border: 1px solid var(--line); color: var(--muted); padding: .4rem 1rem; border-radius: 999px; cursor: pointer; font-size: .8rem; }
.boot-skip:hover { color: #fff; border-color: var(--orange); }

/* ============ DESKTOP ============ */
.desktop { position: fixed; inset: 0; background: var(--ink); }
.desktop::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(80% 80% at 50% 30%, #000 30%, transparent 100%); }
.desktop::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 460px at 82% -10%, rgba(246,96,20,.22), transparent 65%); }
.wallpaper-mark { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(72vw, 1100px); height: auto;
  opacity: .05; pointer-events: none; user-select: none; }

/* desktop icons */
.desktop-icons { position: absolute; top: 1.1rem; left: 1rem; right: 1rem; bottom: calc(var(--task-h) + .6rem); z-index: 5; }
.dicon { position: absolute; display: grid; justify-items: center; gap: .5rem; width: 94px; padding: .55rem .25rem .5rem; background: none; border: 1px solid transparent; border-radius: 10px; cursor: grab; color: var(--text); touch-action: none; -webkit-user-select: none; user-select: none; }
.desktop-icons.dragging, .desktop-icons.dragging .dicon { cursor: grabbing; }
.dicon.dragging { z-index: 60; pointer-events: none; scale: 1.06; opacity: .95; }
.dicon.dragging .dock-ic { scale: 1; box-shadow: 0 16px 32px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.3); }
.drop-ring { position: fixed; z-index: 59; pointer-events: none; border: 2px dashed var(--orange); border-radius: 12px; background: rgba(246,96,20,.08); }
.drop-ring.swap { border-style: solid; border-color: var(--amber); background: rgba(255,178,36,.10); }
.desk-menu { position: fixed; z-index: 500; min-width: 216px; display: grid; gap: .1rem; padding: .35rem; background: rgba(28,31,37,.96); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.desk-menu button { display: flex; align-items: center; gap: .55rem; background: none; border: 0; color: var(--text); font: inherit; font-size: .8rem; padding: .5rem .6rem; border-radius: 7px; cursor: pointer; text-align: left; }
.desk-menu button:hover, .desk-menu button:focus-visible { background: rgba(255,255,255,.08); }
.dm-check { width: 1em; color: var(--orange); font-weight: 700; visibility: hidden; }
.desk-menu button[aria-checked="true"] .dm-check { visibility: visible; }
.desk-menu hr { border: 0; border-top: 1px solid var(--line); margin: .3rem .2rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dicon:hover { background: rgba(255,255,255,.06); border-color: var(--line); }
.dicon:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.dicon .dock-ic { width: 52px; height: 52px; border-radius: 14px; translate: 0 0; scale: 1;
  box-shadow: 0 6px 16px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.24);
  transition: translate .16s ease, box-shadow .16s ease, scale .1s ease; }
.dicon:hover .dock-ic { translate: 0 -3px; box-shadow: 0 12px 24px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.3); }
.dicon:active .dock-ic { scale: .93; }
.dicon span.lbl { font-size: .72rem; text-align: center; line-height: 1.25; text-shadow: 0 1px 3px rgba(0,0,0,.85); }

/* ============ TASKBAR ============ */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--task-h); z-index: 500; display: flex; align-items: center; gap: .4rem; padding: 0 .7rem; background: rgba(24,26,31,.85); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.start-btn { width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.start-btn:hover { background: rgba(255,255,255,.08); }
.start-glyph { width: 20px; height: 20px; display: block;
  background: linear-gradient(var(--orange),var(--orange)) 0 0/9px 9px no-repeat, linear-gradient(var(--amber),var(--amber)) 11px 0/9px 9px no-repeat, linear-gradient(var(--amber),var(--amber)) 0 11px/9px 9px no-repeat, linear-gradient(var(--orange),var(--orange)) 11px 11px/9px 9px no-repeat; }
.task-apps { display: flex; align-items: center; gap: .25rem; flex: 1; }
.task-app { position: relative; width: 42px; height: 40px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.task-app:hover { background: rgba(255,255,255,.08); }
.task-app .dock-ic { width: 24px; height: 24px; }
.task-app.running::after { content: ""; position: absolute; bottom: 3px; left: 50%; translate: -50% 0; width: 5px; height: 3px; border-radius: 2px; background: var(--muted); }
.task-app.active { background: rgba(255,255,255,.10); }
.task-app.active::after { width: 16px; background: var(--orange); }
.task-tray { display: flex; align-items: center; gap: .8rem; }
.tray-chat { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font-size: .8rem; cursor: pointer; }
.tray-chat:hover { border-color: var(--orange); }
.tray-chat[aria-pressed="true"] { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.chat-dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; display: inline-block; }
.top-classic { color: var(--muted); text-decoration: none; font-size: .8rem; }
.top-classic:hover { color: var(--orange); }
.clock { font-size: .82rem; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

/* ============ START MENU ============ */
.start-menu { position: absolute; left: .7rem; bottom: calc(var(--task-h) + .6rem); z-index: 600; width: min(360px, 92vw); padding: 1rem; background: rgba(28,30,37,.94); backdrop-filter: blur(22px); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.start-head { margin: 0 0 .7rem; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.start-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.start-grid button { display: grid; justify-items: center; gap: .4rem; padding: .7rem .3rem; background: transparent; border: 0; border-radius: 8px; color: var(--text); cursor: pointer; font-size: .74rem; }
.start-grid button:hover { background: rgba(255,255,255,.08); }
.start-grid .dock-ic { width: 30px; height: 30px; }
.start-menu hr { border: 0; border-top: 1px solid var(--line); margin: .8rem 0; }
.start-menu a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.start-menu a:hover { color: var(--orange); }

/* ============ APP ICONS ============ */
.dock-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #fff; flex: none; }
.dock-ic svg { width: 62%; height: 62%; display: block; }
.ic-browser { background: linear-gradient(135deg, #38BDF8, #0369A1); }
.ic-hardware { background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
.ic-security { background: linear-gradient(135deg, #EF4444, #991B1B); }
.ic-connectivity { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.ic-software { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.ic-support { background: linear-gradient(135deg, #10B981, #047857); }
.ic-cctv { background: linear-gradient(135deg, #6366F1, #4338CA); }
.ic-contact { background: linear-gradient(135deg, var(--amber), #E08900); }
.ic-about { background: linear-gradient(135deg, #64748B, #334155); }

/* ============ WINDOWS ============ */
.windows { position: absolute; inset: 0 0 var(--task-h) 0; }
.win { position: absolute; display: flex; flex-direction: column; min-width: 300px; min-height: 200px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,.5); overflow: hidden; }
.win.active { border-color: rgba(246,96,20,.5); }
.win.maximized { border-radius: 0; }
.win-title { display: flex; align-items: center; gap: .6rem; height: 38px; padding: 0 .5rem 0 .8rem; background: var(--ink-3); cursor: grab; user-select: none; flex: none; }
.win.active .win-title { background: #31353F; }
.win-title .dock-ic { width: 18px; height: 18px; border-radius: 5px; }
.win-name { font-size: .82rem; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-controls { display: flex; }
.win-btn { width: 40px; height: 38px; border: 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: .9rem; }
.win-btn:hover { background: rgba(255,255,255,.10); }
.win-btn.close:hover { background: var(--orange-deep); filter: brightness(1.08); color: #fff; }
.win-body { flex: 1; overflow: auto; padding: 1.2rem 1.3rem; }
.win-body h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; margin: 0 0 .6rem; }
.win-lede { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }

/* browser app */
.browser-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; background: var(--ink-3); border-bottom: 1px solid var(--line); }
.browser-bar .nav-btn { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.browser-bar .nav-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.browser-url { flex: 1; background: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font-size: .8rem; color: var(--muted); }
.browser-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.win.browser-win .win-body { padding: 0; display: flex; flex-direction: column; }

/* presentation app */
.pres { display: flex; flex-direction: column; height: 100%; }
.pres-slide { flex: 1; overflow: auto; padding: 1.4rem 1.5rem; }
.pres-kicker { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--orange); margin: 0 0 .5rem; }
.pres-slide h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; margin: 0 0 .8rem; }
.pres-slide p { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.pres-slide ul { margin: .6rem 0 0; padding-left: 1.1rem; display: grid; gap: .5rem; font-size: .92rem; }
.pres-slide li strong { color: var(--amber); }
.pres-nav { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.2rem; border-top: 1px solid var(--line); background: var(--ink-3); }
.pres-nav button { background: var(--ink); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: .45rem .9rem; cursor: pointer; font-size: .85rem; }
.pres-nav button:hover:not(:disabled) { border-color: var(--orange); }
.pres-nav button:disabled { opacity: .4; cursor: default; }
.pres-dots { display: flex; gap: .35rem; flex: 1; justify-content: center; }
.pres-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); border: 1px solid var(--line); }
.pres-dots span.on { background: var(--orange); border-color: var(--orange); }
.pres-count { font-size: .78rem; color: var(--muted); }

/* contact / about content */
.contact-os { display: grid; gap: 1.2rem; }
.contact-os-info p { margin: 0 0 .7rem; font-size: .88rem; }
.contact-os-info em { color: var(--muted); font-style: normal; font-size: .75rem; }
.about-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .6rem; font-size: .92rem; }

/* ============ ASSISTANT CHAT ============ */
.chat { position: absolute; top: 0; right: 0; bottom: var(--task-h); width: var(--chat-w); z-index: 450; display: flex; flex-direction: column; background: rgba(24,26,31,.94); backdrop-filter: blur(20px); border-left: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.chat-avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--orange), var(--orange-deep)); display: grid; place-items: center; font-family: var(--font-display); color: #fff; }
.chat-head-txt { flex: 1; display: grid; }
.chat-head-txt strong { font-size: .9rem; }
.chat-status { font-size: .72rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.chat-close { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.chat-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.msg { max-width: 86%; padding: .6rem .8rem; border-radius: 12px; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; }
.msg.agent { align-self: flex-start; background: var(--ink-3); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--orange); color: var(--ink); border-bottom-right-radius: 4px; font-weight: 500; }
.msg .lead-card { display: grid; gap: .25rem; margin-top: .4rem; font-size: .8rem; }
.msg .lead-card b { color: var(--amber); }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .7rem .9rem; background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; }
.chip { background: var(--ink); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: .4rem .8rem; font-size: .78rem; cursor: pointer; }
.chip:hover { border-color: var(--orange); color: var(--orange); }
.chip.primary { background: var(--orange); color: var(--ink); border-color: var(--orange); font-weight: 600; }
.chat-input { display: flex; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; background: var(--ink); border: 1px solid var(--line); border-radius: 999px; color: var(--text); padding: .55rem .9rem; font-family: inherit; font-size: .86rem; }
.chat-input input:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.chat-input button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--orange); color: var(--ink); cursor: pointer; }
.chat-input button:hover { background: var(--orange-deep); filter: brightness(1.08); color: #fff; }
.chat-note { margin: 0; padding: 0 1rem .7rem; font-size: .68rem; color: var(--muted); }

/* ============ MOTION / RESPONSIVE ============ */
@media (prefers-reduced-motion: no-preference) {
  .win { animation: win-in .18s ease-out; }
  @keyframes win-in { from { opacity: 0; scale: .97; } }
  .boot-bar span { transition: width .25s ease; }
}
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }
.statusbar, .navbar, .hotseat, .heads-up { display: none; }
@media (max-width: 720px) {
  /* ---- Android phone mode ---- */
  .taskbar { display: none; }
  .statusbar { display: flex; position: absolute; top: 0; left: 0; right: 0; height: 28px; align-items: center; justify-content: space-between; padding: 0 .9rem; font-size: .72rem; font-weight: 600; color: var(--text); background: rgba(20,22,26,.6); backdrop-filter: blur(10px); z-index: 460; }
  .sb-icons { display: flex; gap: .45rem; align-items: center; }
  .sb-icons svg { width: 14px; height: 14px; }
  .navbar { display: flex; position: absolute; bottom: 0; left: 0; right: 0; height: 44px; align-items: center; justify-content: space-around; background: rgba(20,22,26,.6); backdrop-filter: blur(10px); z-index: 460; }
  .navbar button { background: none; border: 0; color: var(--text); font-size: 1.05rem; padding: .4rem 1.2rem; cursor: pointer; }
  .nav-home span { display: block; width: 108px; height: 5px; border-radius: 999px; background: var(--text); opacity: .85; }
  .hotseat { display: flex; position: absolute; bottom: 44px; left: 0; right: 0; height: 78px; align-items: center; justify-content: space-around; padding: 0 .4rem; z-index: 455; }
  .hotseat button { background: none; border: 0; display: grid; justify-items: center; gap: .25rem; color: var(--text); font-size: .62rem; cursor: pointer; }
  .hotseat .dock-ic { width: 46px; height: 46px; border-radius: 14px; }
  .desktop-icons { top: 36px; left: .6rem; right: .6rem; bottom: 126px; }
  .windows { inset: 0; }
  .dicon { width: 25%; padding: .4rem .1rem; gap: .35rem; }
  .dicon .dock-ic { width: 46px; height: 46px; border-radius: 14px; }
  .dicon span.lbl { font-size: .62rem; }
  .win { left: 0 !important; top: 28px !important; width: 100% !important; height: calc(100% - 72px) !important; border-radius: 0; border-left: 0; border-right: 0; }
  .win-btn.min, .win-btn.max { display: none; }
  .win-btn.close { font-size: 0; }
  .win-btn.close::before { content: '←'; font-size: 1.05rem; }
  .win-title { cursor: default; }
  .chat { top: 28px; bottom: 44px; width: 100%; }
  .start-menu { left: 0; right: 0; top: auto; bottom: 44px; max-height: 72%; overflow-y: auto; border-radius: 18px 18px 0 0; }
  .start-grid { grid-template-columns: repeat(4, 1fr); }
  .heads-up { display: flex; align-items: center; gap: .6rem; position: absolute; top: 34px; left: .6rem; right: .6rem; z-index: 470; padding: .6rem .8rem; background: rgba(28,31,37,.95); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; color: var(--text); font: inherit; font-size: .78rem; text-align: left; cursor: pointer; box-shadow: 0 10px 26px rgba(0,0,0,.45); }
  .heads-up .dock-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; }
  .hu-txt { display: grid; gap: .1rem; }
  .wallpaper-mark { width: 94vw; }
}

/* ---- Email app ---- */
.ic-email { background: linear-gradient(135deg, #2DD4BF, #0D9488); }
.mail-form { display: grid; gap: .7rem; }
.mail-form label { display: grid; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.mail-form input, .mail-form textarea { font: inherit; font-size: .85rem; color: var(--text); background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; resize: vertical; }
.mail-form input:focus-visible, .mail-form textarea:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.mail-to { font-size: .85rem; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.mail-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.mail-note { font-size: .72rem; color: var(--muted); }
.mail-status { font-size: .78rem; color: var(--amber); min-height: 1em; }

/* ---- Mail client (Contact app) ---- */
.win-body.mc-body { padding: 0; overflow: hidden; }
.mc { display: grid; grid-template-columns: 190px minmax(210px, 260px) 1fr; height: 100%; container-type: inline-size; background: var(--ink); }
.mc-side { display: flex; flex-direction: column; gap: .8rem; padding: .9rem .7rem; background: var(--ink-2); border-right: 1px solid var(--line); overflow-y: auto; }
.mc-new { background: var(--orange); color: var(--ink); border: 0; border-radius: 999px; padding: .55rem .8rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.mc-new:hover { background: var(--amber); }
.mc-folders { display: grid; gap: .2rem; }
.mc-folders button { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: none; border: 0; color: var(--muted); padding: .5rem .6rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .82rem; text-align: left; }
.mc-folders button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.mc-folders button[aria-current='true'] { background: rgba(246,96,20,.16); color: var(--text); font-weight: 600; }
.mc-badge { background: var(--orange); color: var(--ink); border-radius: 999px; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; }
.mc-badge:empty { display: none; }
.mc-card { margin-top: auto; display: grid; gap: .3rem; font-size: .72rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8rem; }
.mc-card strong { color: var(--text); font-size: .8rem; }
.mc-card .chip { justify-self: start; margin-top: .3rem; }
.mc-list { border-right: 1px solid var(--line); overflow-y: auto; }
.mc-list-head { padding: .8rem .9rem .5rem; font-weight: 700; font-size: .85rem; position: sticky; top: 0; background: var(--ink); border-bottom: 1px solid var(--line); }
.mc-item { display: grid; gap: .15rem; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; padding: .65rem .9rem; cursor: pointer; color: var(--text); font: inherit; }
.mc-item:hover { background: rgba(255,255,255,.05); }
.mc-item.on, .mc-item:focus-visible { background: rgba(246,96,20,.12); }
.mc-item.unread { border-left-color: var(--orange); }
.mc-item .who { font-size: .78rem; font-weight: 600; display: flex; justify-content: space-between; gap: .5rem; }
.mc-item .who time { color: var(--muted); font-weight: 400; font-size: .68rem; flex: none; }
.mc-item .subj { font-size: .8rem; }
.mc-item.unread .subj { font-weight: 700; }
.mc-item .prev { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-empty { padding: 1.2rem .9rem; color: var(--muted); font-size: .8rem; }
.mc-main { overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.mc-placeholder { margin: auto; text-align: center; display: grid; gap: .9rem; justify-items: center; color: var(--muted); font-size: .85rem; }
.mc-read-head h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.mc-meta { font-size: .75rem; color: var(--muted); display: grid; gap: .15rem; }
.mc-body-text { white-space: pre-wrap; font-size: .85rem; line-height: 1.55; }
.mc-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .8rem; }
.mc-flash { font-size: .78rem; color: var(--amber); min-height: 1em; }
.mc-compose { display: grid; gap: .6rem; }
.mc-compose label { display: grid; gap: .25rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.mc-compose input, .mc-compose textarea { font: inherit; font-size: .85rem; color: var(--text); background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.mc-compose input:focus-visible, .mc-compose textarea:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.mc-compose textarea { resize: vertical; min-height: 110px; }
.mc-to { font-size: .8rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.mc-back { display: none; justify-self: start; }
@container (max-width: 700px) {
  .mc { grid-template-columns: 160px 1fr; }
  .mc-main { display: none; }
  .mc.mc-reading .mc-list { display: none; }
  .mc.mc-reading .mc-main { display: flex; }
  .mc-back { display: inline-flex; }
}
@container (max-width: 480px) {
  .mc { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mc-side { flex-direction: row; align-items: center; gap: .5rem; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem .6rem; }
  .mc-new { flex: none; }
  .mc-folders { display: flex; gap: .2rem; }
  .mc-folders button { white-space: nowrap; }
  .mc-card { display: none; }
  .mc-list { border-right: 0; }
}

/* ---- Light theme ---- */
[data-theme="light"] { --ink: #F4F4F1; --ink-2: #FFFFFF; --ink-3: #E6E6E1; --text: #14161A; --muted: #5B6068; --line: rgba(20,22,26,.14); }
[data-theme="light"] .desktop::before { background-image: linear-gradient(rgba(20,22,26,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(20,22,26,.06) 1px, transparent 1px); }
[data-theme="light"] .taskbar, [data-theme="light"] .start-menu, [data-theme="light"] .chat, [data-theme="light"] .statusbar, [data-theme="light"] .navbar, [data-theme="light"] .heads-up, [data-theme="light"] .desk-menu { background: rgba(255,255,255,.92); }
[data-theme="light"] .boot-lines { color: #177245; }
[data-theme="light"] .boot-logo-light { display: block; }
[data-theme="light"] .boot-logo:not(.boot-logo-light) { display: none; }
.boot-logo-light { display: none; }
[data-theme="light"] .mark-light { display: block; opacity: .07; }
[data-theme="light"] .wallpaper-mark:not(.mark-light) { display: none; }
[data-theme="light"] .msg.user, [data-theme="light"] .chip.primary, [data-theme="light"] .mc-new, [data-theme="light"] .p-tabs button.on, [data-theme="light"] .mc-badge { color: #14161A; }
[data-theme="light"] .dicon span.lbl { text-shadow: 0 1px 2px rgba(255,255,255,.7); }
[data-theme="light"] .p-badge.st-resolved, [data-theme="light"] .p-badge.st-paid, [data-theme="light"] .p-badge.st-completed, [data-theme="light"] .p-badge.st-accepted { color: #177245; }
[data-theme="light"] .p-demo-code, [data-theme="light"] .mc-flash, [data-theme="light"] .p-msg, [data-theme="light"] .mail-status { color: #9A6A00; }
[data-theme="light"] .portal-banner { color: #9A4A00; background: rgba(246,96,20,.10); }
.start-theme { justify-self: start; margin-bottom: .6rem; }

/* ---- Phone shell defaults + crispness ---- */
body { -webkit-font-smoothing: antialiased; }
.heads-up[hidden] { display: none; }
.ic-chat { background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
.ic-drawer { background: linear-gradient(135deg, #64748B, #334155); }
.start-open { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.start-open button { background: var(--ink-3); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font-size: .75rem; cursor: pointer; }
.start-open .so-empty { font-size: .72rem; color: var(--muted); }

/* ---- Client portal ---- */
.ic-login { background: linear-gradient(135deg, #94A3B8, #475569); }
.ic-tickets { background: linear-gradient(135deg, #F43F5E, #BE123C); }
.ic-quotes { background: linear-gradient(135deg, #FFB224, #D97706); }
.ic-orders { background: linear-gradient(135deg, #22C55E, #15803D); }
.ic-setups { background: linear-gradient(135deg, #06B6D4, #0E7490); }
.ic-docs { background: linear-gradient(135deg, #EAB308, #A16207); }
.ic-account { background: linear-gradient(135deg, #EC4899, #BE185D); }
.ic-approvals { background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
.portal-banner { position: absolute; top: 0; left: 0; right: 0; z-index: 445; padding: .35rem .9rem; font-size: .72rem; font-weight: 600; color: var(--amber); background: rgba(246,96,20,.14); border-bottom: 1px solid rgba(246,96,20,.4); backdrop-filter: blur(8px); }
.portal-banner:not([hidden]) ~ .desktop-icons { top: 2.9rem; }
.p-body { padding: 1.1rem 1.2rem; }
.p-head h2 { font-size: 1.05rem; }
.p-head p { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.p-login { max-width: 340px; margin: 0 auto; display: grid; gap: .7rem; justify-items: stretch; }
.p-login h2 { text-align: center; }
.p-sub { font-size: .78rem; color: var(--muted); text-align: center; }
.p-lock { width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--orange), var(--orange-deep)); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.p-lock svg { width: 60%; height: 60%; }
.p-tabs { display: flex; gap: .4rem; }
.p-tabs button { flex: 1; background: var(--ink-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: .45rem .6rem; font: inherit; font-size: .76rem; cursor: pointer; }
.p-tabs button.on { background: var(--orange); border-color: var(--orange); color: var(--ink); font-weight: 700; }
.p-form { display: grid; gap: .6rem; }
.p-form label { display: grid; gap: .25rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.p-form input, .p-form textarea, .p-form select { font: inherit; font-size: .85rem; color: var(--text); background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.p-form input:focus-visible, .p-form textarea:focus-visible, .p-form select:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.p-form h3 { font-size: .9rem; }
.p-demo-code { font-size: .78rem; font-weight: 700; color: var(--amber); background: rgba(255,178,36,.10); border: 1px dashed rgba(255,178,36,.5); border-radius: 10px; padding: .55rem .8rem; }
.p-msg { font-size: .78rem; color: var(--amber); min-height: 1em; }
.p-hint { font-size: .72rem; color: var(--muted); }
.p-demo { font-size: .68rem; color: var(--muted); margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.p-list { display: grid; gap: .4rem; margin-top: .8rem; }
.p-row { display: grid; gap: .2rem; text-align: left; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }
.p-row.static { cursor: default; }
.p-row:hover:not(.static) { border-color: var(--orange); }
.p-row-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .78rem; }
.p-row-top time { color: var(--muted); font-size: .68rem; }
.p-badge { border-radius: 999px; padding: .1rem .5rem; font-size: .66rem; font-weight: 700; background: var(--ink-3); color: var(--muted); }
.p-badge.st-open, .p-badge.st-requested { background: rgba(246,96,20,.18); color: var(--amber); }
.p-badge.st-resolved, .p-badge.st-paid, .p-badge.st-completed, .p-badge.st-accepted { background: rgba(34,197,94,.16); color: #6EE7A0; }
.p-table { width: 100%; border-collapse: collapse; font-size: .78rem; margin-top: .8rem; }
.p-table th { text-align: left; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: .3rem .4rem; }
.p-table td { padding: .5rem .4rem; border-top: 1px solid var(--line); vertical-align: top; }
.p-thread { display: grid; gap: .5rem; margin: .6rem 0; }
.p-msg-b { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; font-size: .8rem; }
.p-msg-b.gigaworks { border-left: 3px solid var(--orange); }
.p-msg-b strong { font-size: .75rem; }
.p-msg-b time { color: var(--muted); font-size: .65rem; margin-left: .5rem; }
.p-msg-b p { margin: .3rem 0 0; white-space: pre-wrap; }
.p-docs { display: grid; gap: .5rem; margin-top: .8rem; }
.p-doc { display: flex; align-items: center; gap: .7rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; color: var(--text); text-decoration: none; }
.p-doc:hover { border-color: var(--orange); }
.p-doc-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #EAB308, #A16207); }
.p-doc-ic svg { width: 60%; height: 60%; }
.p-doc-t { display: grid; gap: .15rem; flex: 1; }
.p-doc-t strong { font-size: .82rem; }
.p-doc-t span { font-size: .68rem; color: var(--muted); }
.p-dl { color: var(--amber); }
.p-kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .8rem; margin-top: .6rem; }
.p-kv span { color: var(--muted); }
.p-actions { display: flex; gap: .4rem; margin-top: .3rem; }
.p-empty { color: var(--muted); font-size: .8rem; padding: .6rem 0; }
.p-detail h3 { font-size: .95rem; margin: .6rem 0 .3rem; }
@media (max-width: 720px) { .portal-banner { top: 28px; } .portal-banner:not([hidden]) ~ .desktop-icons { top: 62px; } }
