/* Classic desktop chrome. The user-supplied reference pins this visual language. */
.desktop-shortcuts { position: fixed; top: 24px; left: 10px; display: grid; gap: 15px; width: 83px; }
.desktop-shortcut { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; width: 83px; min-height: 76px; padding: 4px 1px; color: #fff; border: 1px solid transparent; background: transparent; font-size: 12px; line-height: 1.35; }
.desktop-shortcut:hover { background: rgb(0 0 0 / .08); }
.desktop-shortcut:focus-visible { outline: 1px dotted #fff; outline-offset: -1px; }
.desktop-shortcut span { padding: 1px 3px; text-align: center; text-shadow: 1px 1px #004343; }
.pixel-icon { display: block; width: 34px; height: 34px; shape-rendering: crispEdges; image-rendering: pixelated; filter: drop-shadow(1px 1px #004343); }
/* Centred in the desktop right of the shortcut column (left edge 112px, 1190px cap); at 1302px and below it stays at 112px. */
.app-shell { position: fixed; display: flex; flex-direction: column; top: 38px; left: max(112px, 50% - 539px); width: min(1190px, calc(100% - 150px)); height: calc(100dvh - 105px); min-height: 0; padding: 3px; background: var(--canvas); border: 1px solid; border-color: var(--bevel-light) var(--edge-dark) var(--edge-dark) var(--bevel-light); box-shadow: inset 1px 1px var(--surface), inset -1px -1px var(--edge-mid), 2px 2px #004343; }
.app-shell.maximized { top: 5px; left: 5px; width: calc(100% - 10px); height: calc(100dvh - 46px); }
.window-titlebar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; min-height: 29px; padding: 2px 3px 2px 5px; color: #fff; background: #000080; }
.window-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.window-title img { image-rendering: pixelated; }
.window-title strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-controls { display: flex; gap: 3px; flex-shrink: 0; }
.window-controls button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 2px; background: #c0c0c0; color: #000; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080; }
.window-controls button .icon { width: 16px; height: 16px; flex-basis: 16px; stroke-width: 2; }
.window-controls button:active { box-shadow: inset 1px 1px #808080; border-color: #000 #fff #fff #000; }
.window-controls button:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.window-menubar { position: relative; display: flex; align-items: center; flex-shrink: 0; gap: 2px; min-height: 30px; border-bottom: 1px solid var(--line); padding: 1px 5px; }
.desktop-menu { position: relative; }
.desktop-menu > summary { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px; list-style: none; cursor: pointer; border: 1px solid transparent; }
.desktop-menu > summary::-webkit-details-marker { display: none; }
.desktop-menu > summary:hover, .desktop-menu[open] > summary { background: var(--blue); color: var(--on-blue); }
.desktop-menu-popup { position: absolute; left: 0; top: 100%; z-index: 10; width: 226px; padding: 3px; background: var(--canvas); border: 1px solid; border-color: var(--bevel-light) var(--edge-dark) var(--edge-dark) var(--bevel-light); box-shadow: inset -1px -1px var(--edge-mid), 1px 1px var(--edge-dark); }
.desktop-menu-popup button { display: block; width: 100%; padding: 9px 12px; font-size: 12px; text-align: left; background: transparent; border: 0; }
.desktop-menu-popup button:hover, .desktop-menu-popup button:focus-visible { color: var(--on-blue); background: var(--blue); }
.desktop-menu-popup a { display: block; padding: 9px 12px; font-size: 12px; color: inherit; text-decoration: none; }
.desktop-menu-popup a:hover, .desktop-menu-popup a:focus-visible { color: var(--on-blue); background: var(--blue); }
.desktop-menu-popup hr { border: 0; height: 2px; background: var(--line); box-shadow: 0 1px var(--bevel-light); margin: 4px 3px; }
.window-statusbar { display: flex; flex-shrink: 0; gap: 4px; padding: 2px 1px 0; font-size: 12px; }
.window-statusbar span { min-width: 0; padding: 4px 8px; border: 1px solid; border-color: var(--line) var(--bevel-light) var(--bevel-light) var(--line); }
.window-statusbar span:first-child { flex: 1; }
.desktop-taskbar { position: fixed; inset: auto 0 0; z-index: 14; display: flex; align-items: center; gap: 6px; height: 38px; padding: 3px 5px; background: var(--canvas); border-top: 2px solid var(--bevel-light); box-shadow: inset 0 1px var(--line-soft); }
.launcher-menu > .launcher-button { padding: 2px 7px 2px 4px; min-height: 29px; background: var(--canvas); color: var(--ink); border: 1px solid; border-color: var(--bevel-light) var(--edge-dark) var(--edge-dark) var(--bevel-light); box-shadow: inset -1px -1px var(--edge-mid); }
.launcher-button strong { font-size: 14px; }
.launcher-menu .desktop-menu-popup { top: auto; bottom: calc(100% + 5px); width: 230px; }
.launcher-name { color: var(--on-blue); background: var(--blue); padding: 12px; font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.taskbar-separator { width: 3px; height: 25px; border-left: 1px solid var(--line); border-right: 1px solid var(--bevel-light); }
.taskbar-window { display: flex; align-items: center; gap: 7px; width: 220px; max-width: 32vw; min-width: 0; height: 29px; padding: 3px 9px; background: var(--canvas); border: 1px solid; border-color: var(--bevel-light) var(--edge-dark) var(--edge-dark) var(--bevel-light); box-shadow: inset -1px -1px var(--edge-mid); font-size: 12px; }
.taskbar-window[aria-pressed="true"] { font-weight: 700; background: var(--surface); border-color: var(--edge-mid) var(--bevel-light) var(--bevel-light) var(--edge-mid); box-shadow: inset 1px 1px var(--edge-dark); }
.taskbar-window span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbar-preview { margin-left: auto; padding: 0 9px; font-size: 12px; color: var(--muted); }
.taskbar-clock { display: flex; align-items: center; justify-content: center; gap: 8px; height: 29px; min-width: 113px; padding: 3px 9px; border: 1px solid; border-color: var(--line) var(--bevel-light) var(--bevel-light) var(--line); font-size: 12px; }
.taskbar-clock .icon { width: 15px; height: 15px; flex-basis: 15px; }
.taskbar-clock time { white-space: nowrap; }
.about-content { display: flex; align-items: flex-start; gap: 20px; margin-top: 24px; }
.about-content > img { image-rendering: pixelated; }
.about-content strong { font-size: 19px; }
.about-content p, .about-preview { font-size: 13px; line-height: 1.8; }
.about-preview { margin: 24px 0 0; padding-top: 15px; border-top: 1px solid var(--line); }
.about-dialog .dialog-header, .settings-dialog .dialog-header, .history-dialog .dialog-header { margin: -19px -19px 18px; padding: 4px 7px; background: #000080; color: #fff; }
.about-dialog .dialog-header h2, .settings-dialog .dialog-header h2, .history-dialog .dialog-header h2 { font-size: 14px; letter-spacing: 0; }
.about-dialog .dialog-header .icon-button, .settings-dialog .dialog-header .icon-button, .history-dialog .dialog-header .icon-button { width: 27px; height: 26px; flex-basis: 27px; background: #c0c0c0; color: #000; border: 1px solid; border-color: #fff #000 #000 #fff; }
/* Portfolio: a shortcut that opens like a desktop icon, and a window that loads the /portfolio/ page. */
.desktop-shortcut.portfolio-shortcut { text-decoration: none; }
.portfolio-window { position: fixed; display: flex; flex-direction: column; top: 54px; left: 214px; width: min(740px, calc(100% - 234px)); max-height: calc(100dvh - 108px); padding: 3px; background: var(--canvas); border: 1px solid; border-color: var(--bevel-light) var(--edge-dark) var(--edge-dark) var(--bevel-light); box-shadow: inset 1px 1px var(--surface), inset -1px -1px var(--edge-mid), 2px 2px #004343; }
.portfolio-window-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 26px; scrollbar-width: thin; }
.portfolio-window-body:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }
.portfolio-status { margin: 0; font-size: 14px; line-height: 1.7; }
.portfolio a:not(.primary-button):not(.secondary-button), .portfolio-status a { color: var(--blue); text-underline-offset: 2px; }
.portfolio h1 { font-size: 23px; letter-spacing: -.5px; line-height: 1.3; white-space: normal; overflow: visible; }
.portfolio-headline { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.portfolio-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.portfolio-links .secondary-button { min-height: 30px; padding: 4px 12px; font-size: 12px; text-decoration: none; }
.portfolio-contact { margin: 10px 0 0; font-size: 13px; line-height: 1.5; }
.portfolio-intro { margin-top: 16px; }
.portfolio-intro p { max-width: 68ch; margin: 0 0 .8em; font-size: 15px; line-height: 1.7; }
.portfolio-section { margin-top: 30px; }
.portfolio-section > h2, .portfolio-locked h2 { margin: 0 0 12px; font-size: 15px; line-height: 1.4; }
.portfolio-section > h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); box-shadow: 0 1px var(--bevel-light); }
.portfolio h3 { margin: 0; font-size: 16px; line-height: 1.4; }
.portfolio-project, .portfolio-locked { padding: 15px 17px 16px; background: var(--surface); border: 1px solid; border-color: var(--edge-mid) var(--bevel-light) var(--bevel-light) var(--edge-mid); box-shadow: inset 1px 1px var(--edge-dark); }
.portfolio-project + .portfolio-project { margin-top: 10px; }
.portfolio-project-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.portfolio-badge { padding: 1px 7px; font-size: 12px; font-weight: 700; color: var(--on-blue); background: var(--blue); }
.portfolio-meta { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.portfolio-project > p:not(.portfolio-meta), .portfolio-entry > p:not(.portfolio-meta) { max-width: 70ch; margin: 9px 0 0; font-size: 15px; line-height: 1.65; }
.portfolio-details { max-width: 70ch; margin: 8px 0 0; padding-left: 19px; font-size: 14px; line-height: 1.65; }
.portfolio-details li + li { margin-top: 3px; }
.portfolio-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 0; padding: 0; list-style: none; }
.portfolio-section > .portfolio-tags { margin-top: 0; }
.portfolio-tags li { padding: 2px 8px; font-size: 12px; line-height: 1.5; background: var(--canvas); border: 1px solid; border-color: var(--bevel-light) var(--edge-mid) var(--edge-mid) var(--bevel-light); }
.portfolio .portfolio-link { margin: 12px 0 0; font-size: 14px; font-weight: 600; }
.portfolio-entry + .portfolio-entry { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.portfolio-locked { display: grid; grid-template-columns: 34px 1fr; gap: 0 14px; margin-top: 30px; }
.portfolio-locked .pixel-icon { grid-row: span 3; filter: none; }
.portfolio-locked p { margin: 0; font-size: 14px; line-height: 1.7; }
.portfolio-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.portfolio-actions a { min-width: 112px; text-decoration: none; }
@media (max-width: 1100px) {
  .app-shell { left: 96px; top: 22px; width: calc(100% - 116px); height: calc(100dvh - 81px); }
  .portfolio-window { top: 40px; left: 150px; width: min(740px, calc(100% - 170px)); max-height: calc(100dvh - 92px); }
  .desktop-shortcuts { left: 5px; }
  .conversation-header { padding: 13px 15px; }
}
@media (max-width: 760px) {
  .desktop-shortcuts { display: none; }
  .app-shell, .app-shell.maximized { top: 5px; left: 5px; width: calc(100% - 10px); height: calc(100dvh - 49px); }
  .portfolio-window { top: 5px; left: 5px; width: calc(100% - 10px); max-height: none; height: calc(100dvh - 49px); }
  .portfolio-window-body { padding: 19px 16px 22px; }
  .portfolio-locked { grid-template-columns: 1fr; }
  .portfolio-locked .pixel-icon { grid-row: auto; margin-bottom: 10px; }
  .window-titlebar { min-height: 31px; }
  .window-title strong { font-size: 12px; }
  .window-titlebar #maximize-window, .window-titlebar [data-window-action="maximize"] { display: none; }
  .window-menubar { min-height: 28px; }
  .window-statusbar { display: none; }
  .window-workspace { flex: 1; }
  .conversation-header { min-height: 72px; padding: 9px 7px; gap: 5px; }
  .header-actions .icon-button { width: 28px; flex-basis: 28px; }
  .human-label { font-size: 12px; }
  .label-divider { padding: 0 2px; }
  .conversation-header h1 { font-size: 14px; }
  .header-identity { min-width: 0; }
  .composer-area { width: calc(100% - 14px); padding-bottom: 7px; }
  .waiting-copy { padding-left: 26px; }
  .example-tag { margin-left: auto; }
  .composer-footnote { font-size: 12px; }
  .taskbar-window { width: 170px; max-width: none; flex: 1; padding: 3px 5px; gap: 5px; }
  .taskbar-preview { display: none; }
  .taskbar-clock { min-width: 88px; padding: 3px 5px; gap: 4px; }
  .taskbar-clock .icon { display: none; }
  .desktop-taskbar { gap: 4px; }
  .launcher-button strong { font-size: 13px; }
  .desktop-menu-popup { width: 205px; }
  .message { margin-bottom: 24px; }
  .jake-note { padding: 13px 12px 10px; }
}
/* Maximized account and Portfolio windows fill the desktop with the inbox's 5px inset. */
@media (min-width: 761px) {
  .account-window.maximized, .portfolio-window.maximized { position: fixed; top: 5px; left: 5px; width: calc(100% - 10px); height: calc(100dvh - 46px); max-height: none; margin: 0; }
}
.window-resize { display: none; }
/* Movable windows (windows.js): mouse and pen on the desktop layout only. The CSS position stays the default. */
@media (pointer: fine) and (min-width: 761px) {
  .app-shell, .promotion-window, .account-window, .portfolio-window { translate: var(--win-x, 0px) var(--win-y, 0px); }
  .app-shell.maximized, .account-window.maximized, .portfolio-window.maximized { translate: none; }
  .app-shell, .promotion-window, .account-window, .portfolio-window { z-index: 1; }
  .app-shell.window-front, .promotion-window.window-front, .account-window.window-front, .portfolio-window.window-front { z-index: 2; }
  /* Resized windows (windows.js sets --win-w/--win-h). !important: a chosen size outranks every layout width,
     including live.css's Support-reserving inbox rule. */
  .is-sized:not(.maximized) { width: var(--win-w) !important; height: var(--win-h) !important; max-width: none; max-height: none; }
  /* 6px edge zones and 12px corners sit inside the frame (-1px covers the border), so nothing pokes past the window and widens the page.
     The top zones stay within the 4px frame above the title bar, clear of its double-click area and controls. */
  .window-resize { display: block; position: absolute; z-index: 3; }
  .maximized > .window-resize { display: none; }
  .window-resize[data-edge="n"], .window-resize[data-edge="s"] { left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
  .window-resize[data-edge="e"], .window-resize[data-edge="w"] { top: 3px; bottom: 12px; width: 6px; cursor: ew-resize; }
  .window-resize[data-edge="n"] { top: -1px; }
  .window-resize[data-edge="s"] { bottom: -1px; }
  .window-resize[data-edge="e"] { right: -1px; }
  .window-resize[data-edge="w"] { left: -1px; }
  .window-resize[data-edge="ne"], .window-resize[data-edge="se"], .window-resize[data-edge="sw"], .window-resize[data-edge="nw"] { width: 12px; height: 12px; }
  .window-resize[data-edge="n"], .window-resize[data-edge="ne"], .window-resize[data-edge="nw"] { height: 4px; }
  .window-resize[data-edge="ne"] { top: -1px; right: -1px; cursor: nesw-resize; }
  .window-resize[data-edge="sw"] { bottom: -1px; left: -1px; cursor: nesw-resize; }
  .window-resize[data-edge="nw"] { top: -1px; left: -1px; cursor: nwse-resize; }
  .window-resize[data-edge="se"] { bottom: -1px; right: -1px; cursor: nwse-resize; }
  /* The inbox's status bar carries a classic size grip in its corner. */
  .app-shell > .window-resize[data-edge="se"] { width: 18px; height: 18px; background: no-repeat right 3px bottom 3px / 14px 14px linear-gradient(135deg, transparent 0 46%, var(--bevel-light) 46% 51%, var(--edge-mid) 51% 60%, transparent 60% 65%, var(--bevel-light) 65% 70%, var(--edge-mid) 70% 79%, transparent 79% 84%, var(--bevel-light) 84% 89%, var(--edge-mid) 89% 98%, transparent 98%); }
  .app-shell:not(.maximized) .window-statusbar span:last-child { padding-right: 22px; }
  .window-titlebar { touch-action: none; user-select: none; }
  /* A resized inbox reflows to its own width (the container below), and a short one scrolls its sidebar. */
  .app-shell { container: inbox / inline-size; }
  .app-shell.is-sized .sidebar { overflow-y: auto; scrollbar-width: thin; }
}
/* Inbox windows resized below 860px borrow the compact header and wrapping availability strip. Only resized ones:
   the default layout at mid-size viewports keeps its own breakpoints. */
@container inbox (max-width: 860px) {
  .is-sized .window-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .is-sized .sidebar { padding-inline: 9px; }
  .is-sized .conversation-header { padding: 12px 14px; gap: 9px; }
  .is-sized .header-identity > .avatar { display: none; }
  .is-sized .waiting-strip { flex-wrap: wrap; row-gap: 3px; }
  .is-sized .waiting-copy { order: 4; border: 0; padding: 1px 0 0 28px; flex-basis: 100%; }
}
