:root {
  --teal: #008080;
  --face: #c0c0c0;
  --hi: #ffffff;
  --lo: #808080;
  --dk: #000000;
  --navy: #000080;
  --navy2: #1084d0;
  --text: #000;
  --font: 'Pixelify Sans', Tahoma, 'MS Sans Serif', Geneva, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--teal); color: var(--text); font-family: var(--font); font-size: 15px; overflow: hidden; }
button, input { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ------------------------------------------------ bevels */
.win, .btn95, .tb, .start, .tray-btn, .startmenu, .presets button {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px #dfdfdf;
}
.btn95:active, .tb:active, .start.on, .presets button.on, .btn95.on, .tray-btn:active {
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px #dfdfdf, inset 2px 2px var(--lo);
}
.sunken { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); background: #fff; }

/* ------------------------------------------------ desktop */
#desktop { position: fixed; inset: 0 0 40px 0; overflow: hidden; }
.icons { position: absolute; left: 10px; top: 10px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(8, 86px); gap: 2px 12px; }
.icon { width: 84px; background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; cursor: pointer; text-decoration: none; font-size: 13px; text-align: center; }
.icon span:last-child { padding: 1px 3px; }
.icon:focus span:last-child, .icon:hover span:last-child { background: var(--navy); outline: 1px dotted #fff; }
.ico { width: 40px; height: 40px; image-rendering: pixelated; background-size: contain; background-repeat: no-repeat; }
.ico-buy { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='3' width='14' height='10' fill='%23c0c0c0' stroke='%23000'/%3E%3Crect x='2' y='4' width='12' height='2' fill='%23000080'/%3E%3Cpath d='M5 9h4l-2-2zM7 9v3' stroke='%23008000' fill='%23008000'/%3E%3C/svg%3E"); }
.ico-folder { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M1 4h5l1 1h8v9H1z' fill='%23ffd65c' stroke='%23000'/%3E%3Cpath d='M1 6h14' stroke='%23b8860b'/%3E%3C/svg%3E"); }
.ico-sell { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='3' width='14' height='10' fill='%23c0c0c0' stroke='%23000'/%3E%3Crect x='2' y='4' width='12' height='2' fill='%23000080'/%3E%3Cpath d='M5 8h4l-2 2zM7 8V5' stroke='%23c00000' fill='%23c00000'/%3E%3C/svg%3E"); }
.ico-wall { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 1h8l3 3v11H3z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M5 6h7M5 8h7M5 10h5M5 12h6' stroke='%23000080'/%3E%3C/svg%3E"); }
.ico-txt { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 1h8l3 3v11H3z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M5 6h7M5 8h7M5 10h7M5 12h4' stroke='%23808080'/%3E%3C/svg%3E"); }
.ico-bin { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 4h10l-1 11H4z' fill='%23dfdfdf' stroke='%23000'/%3E%3Cpath d='M2 3h12M6 2h4M6 6v7M8 6v7M10 6v7' stroke='%23000'/%3E%3C/svg%3E"); }
.ico-x { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='1' width='14' height='14' fill='%23000'/%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); }
.ico-chart { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='1' width='14' height='14' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M3 12l3-4 3 2 4-6' stroke='%23008000' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); }

/* ------------------------------------------------ windows */
.win { position: absolute; padding: 3px; min-width: 260px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; }
.win.focus .title { background: linear-gradient(90deg, var(--navy), var(--navy2)); }
.title { background: linear-gradient(90deg, #808080, #b5b5b5); color: #fff; font-weight: 700; padding: 3px 4px 3px 6px; display: flex; align-items: center; gap: 6px; user-select: none; cursor: move; font-size: 14px; }
.tico { width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect width='16' height='16' fill='%23c0c0c0'/%3E%3Cpath d='M12 6H5l2-2M5 6l2 2M5 6h5a3 3 0 0 1 0 6H7' stroke='%23000' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); }
.tbtns { margin-left: auto; display: flex; gap: 2px; }
.tb { width: 18px; height: 16px; border: 0; padding: 0; font-size: 12px; line-height: 12px; font-weight: 700; color: #000; cursor: pointer; }
.tb.close { margin-left: 2px; }
.menu { display: flex; gap: 14px; padding: 3px 6px; font-size: 13px; }
.body { padding: 10px; }
.status { display: flex; gap: 3px; padding: 2px; font-size: 12px; }
.status span { flex: 1; padding: 2px 6px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------ hero */
#w-hero { width: min(820px, calc(100vw - 120px)); }
.hero { display: flex; gap: 24px; align-items: center; background: #fff; margin: 0 2px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); padding: 22px; }
.hero-l { flex: 1; min-width: 0; }
.tick { display: inline-block; background: var(--navy); color: #fff; padding: 2px 8px; font-weight: 700; letter-spacing: 2px; }
.hero h1 { font-family: 'VT323', monospace; font-size: clamp(48px, 7vw, 86px); line-height: .85; margin: 12px 0 10px; font-weight: 400; }
.hero p { font-size: 16px; line-height: 1.45; margin: 0 0 16px; max-width: 470px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn95 { border: 0; padding: 6px 14px; cursor: pointer; color: #000; min-height: 28px; }
.btn95.big { padding: 10px 18px; font-size: 16px; font-weight: 700; }
.btn95.sm { padding: 3px 8px; min-height: 22px; font-size: 13px; }
.btn95.primary { outline: 1px solid #000; outline-offset: -5px; }
.btn95:disabled { color: #808080; text-shadow: 1px 1px #fff; cursor: default; }
.ca95 { margin-top: 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ca95 code { flex: 1; min-width: 0; padding: 4px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'VT323', monospace; font-size: 17px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); background: #fff; }
.ctrlz { border: 0; background: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px; flex-shrink: 0; }
.ctrlz .k { font-family: 'VT323', monospace; font-size: 56px; min-width: 104px; height: 104px; display: grid; place-items: center; background: var(--face); box-shadow: inset -2px -2px var(--dk), inset 2px 2px var(--hi), inset -4px -4px var(--lo), inset 4px 4px #dfdfdf, 4px 4px 0 rgba(0,0,0,.25); transition: transform .06s; }
.ctrlz .k.z { min-width: 104px; font-size: 72px; }
.ctrlz .plus { font-family: 'VT323', monospace; font-size: 44px; }
.ctrlz:hover .k { transform: translateY(-2px); }
.ctrlz:active .k, .ctrlz.press .k { transform: translateY(3px); box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -3px -3px #dfdfdf, inset 3px 3px var(--lo); }

/* ------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field { display: flex; align-items: center; gap: 6px; background: #fff; padding: 2px 4px 2px 8px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; font-family: 'VT323', monospace; font-size: 26px; padding: 2px 0; background: transparent; }
.field span { font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--navy); }
.presets { display: flex; gap: 4px; }
.presets button { flex: 1; border: 0; padding: 4px 0; cursor: pointer; font-size: 13px; }
.receipt { border: 1px solid var(--lo); box-shadow: 1px 1px #fff; padding: 6px 10px 10px; margin: 0; }
.receipt legend { padding: 0 4px; }
.receipt div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
.receipt .tot { border-top: 1px solid var(--lo); margin-top: 4px; padding-top: 6px; font-size: 16px; }
.note { font-size: 12.5px; color: #333; line-height: 1.35; display: block !important; }
.warn { background: #ffffe1; border: 1px solid #000; padding: 6px 8px; font-size: 13px; }
.msg { min-height: 18px; font-size: 13px; word-break: break-word; }
.msg a { color: var(--navy); }
.q { font-family: 'VT323', monospace; font-size: 22px; }

/* ------------------------------------------------ my windows */
.mine-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.list { background: #fff; max-height: 52vh; overflow: auto; padding: 4px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); }
.empty { padding: 18px; text-align: center; color: #555; font-size: 14px; }
.wrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px; border-bottom: 1px dotted #999; }
.wrow .t { font-family: 'VT323', monospace; font-size: 22px; }
.wrow .s { font-size: 12.5px; color: #333; }
.wrow .acts { grid-row: span 2; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.wrow .bar { grid-column: 1 / -1; height: 14px; padding: 2px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo); }
.wrow .bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--navy) 0 8px, transparent 8px 10px); }
.btn95.z { font-weight: 700; color: #a00000; }

/* ------------------------------------------------ regrets / bin / notepad */
.saved { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.saved b { font-family: 'VT323', monospace; font-size: 30px; color: #006400; }
.log { margin: 0; background: #000; color: #00ff66; font-family: 'VT323', monospace; font-size: 18px; padding: 10px; height: 280px; overflow: auto; white-space: pre-wrap; }
.notepad { background: #fff; margin: 0 2px 2px; font-family: 'VT323', monospace; font-size: 19px; line-height: 1.25; white-space: pre-wrap; max-height: 62vh; overflow: auto; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); }
.bin { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.bin b { font-family: 'VT323', monospace; font-size: 34px; }
.binico { width: 64px; height: 64px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 4h10l-1 11H4z' fill='%23dfdfdf' stroke='%23000'/%3E%3Cpath d='M2 3h12M6 2h4M6 6v7M8 6v7M10 6v7' stroke='%23000'/%3E%3Cpath d='M5 1l2 2M11 0l-2 3' stroke='%23c00000'/%3E%3C/svg%3E") center/contain no-repeat; image-rendering: pixelated; }

/* ------------------------------------------------ dialog */
.dialog-wrap { position: fixed; inset: 0; display: grid; place-items: center; z-index: 900; background: rgba(0,0,0,.05); }
.dialog { position: relative; width: min(400px, 92vw); }
.dlg { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.dico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: #ffd700; border: 2px solid #000; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.dico.err { background: #e00000; color: #fff; }
.dico.ok { background: #00a000; color: #fff; }
.dlg-btns { display: flex; justify-content: center; gap: 8px; padding: 0 10px 10px; }
.dlg-btns .btn95 { min-width: 86px; }

/* ------------------------------------------------ taskbar */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: 40px; background: var(--face); box-shadow: inset 0 1px #dfdfdf, inset 0 2px #fff; display: flex; align-items: center; gap: 4px; padding: 4px; z-index: 950; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
.start { border: 0; height: 30px; padding: 0 10px; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.flag { width: 20px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' shape-rendering='crispEdges'%3E%3Crect x='1' y='1' width='6' height='5' fill='%23e00'/%3E%3Crect x='8' y='1' width='6' height='5' fill='%230a0'/%3E%3Crect x='1' y='7' width='6' height='5' fill='%2300c'/%3E%3Crect x='8' y='7' width='6' height='5' fill='%23fc0'/%3E%3C/svg%3E") center/contain no-repeat; }
.tasks { flex: 1; display: flex; gap: 4px; overflow: hidden; }
.task { border: 0; height: 30px; min-width: 0; width: 150px; padding: 0 8px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: var(--face); box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px #dfdfdf; font-size: 13px; }
.task.on { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px #dfdfdf, inset 2px 2px var(--lo); background: repeating-conic-gradient(#c0c0c0 0 25%, #dfdfdf 0 50%) 0 0/2px 2px; font-weight: 700; }
.tray-btn { border: 0; height: 30px; padding: 0 10px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.tray { height: 30px; padding: 0 10px; display: flex; align-items: center; font-size: 13px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo); }
.startmenu { position: fixed; left: 4px; bottom: 40px; width: 240px; display: flex; z-index: 960; padding: 3px; }
.startmenu .side { width: 30px; background: linear-gradient(0deg, var(--navy), #1084d0); color: #fff; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; gap: 4px; padding: 8px 0; font-size: 20px; }
.startmenu .side span { color: #c0c0c0; }
.startmenu .items { flex: 1; display: flex; flex-direction: column; }
.startmenu .items button { border: 0; background: none; text-align: left; padding: 9px 10px; cursor: pointer; font-size: 15px; }
.startmenu .items button:hover { background: var(--navy); color: #fff; }
.startmenu hr { border: 0; border-top: 1px solid var(--lo); border-bottom: 1px solid #fff; margin: 2px 0; }

/* ------------------------------------------------ phones: windows stack, no dragging */
@media (max-width: 760px) {
  html, body { overflow: auto; }
  #desktop { position: static; padding: 8px 8px 60px; display: flex; flex-direction: column; gap: 10px; }
  .icons { position: static; grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-template-rows: none; gap: 4px; }
  .icon { width: auto; font-size: 12px; }
  .win { position: relative !important; left: auto !important; top: auto !important; width: 100% !important; max-width: none; }
  .title { cursor: default; }
  .hero { flex-direction: column-reverse; padding: 14px; gap: 6px; }
  .ctrlz .k { min-width: 74px; height: 74px; font-size: 40px; }
  .ctrlz .k.z { min-width: 74px; font-size: 52px; }
  .status { flex-wrap: wrap; }
  .status span { flex: 1 1 45%; }
  .tasks { display: none; }
  .tray-btn { margin-left: auto; }
}
