:root {
  --bg: #0b0b0a;
  --bg2: #121211;
  --surface: #171715;
  --fg: #e8e6e1;
  --muted: #9a9890;
  --subtle: #6a6860;
  --steel: #c7c7c7;
  --accent: #7a2e2c;
  --ok: #3d8b5a;
  --warn: #c9a227;
  --bad: #b44532;
  --border: rgba(199, 199, 199, 0.12);
  --sans: "DM Sans", system-ui, sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.nav { border-bottom: 1px solid var(--border); background: rgba(11,11,10,.96); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: .6rem; }
.brand { display: flex; align-items: center; gap: .55rem; min-width: 0; flex: 1 1 auto; }
.brand img { width: 40px; height: 40px; flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand b { display: block; font-family: var(--display); letter-spacing: .02em; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { display: block; color: var(--subtle); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: none; height: 40px; padding: 0 12px; border: 1px solid var(--border); background: transparent; color: var(--fg); border-radius: 8px; flex: 0 0 auto; font: inherit; }
.nav-links { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: .92rem; flex: 0 0 auto; }
.nav-links a { position: relative; }
.nav-links a:after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a.active, .nav-links a:hover { color: var(--fg); }
.nav-links a:hover:after, .nav-links a.active:after { transform: scaleX(1); }
.hero { padding: 3.5rem 0 2.5rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.kicker { color: var(--accent); letter-spacing: .16em; text-transform: uppercase; font-size: .72rem; }
h1, h2, .display { font-family: var(--display); font-weight: 500; letter-spacing: -.03em; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: .95; max-width: 14ch; margin: .6rem 0 1rem; }
.lede { color: var(--muted); max-width: 38rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font: inherit; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--fg); font-weight: 600; }
.btn-secondary { background: transparent; color: var(--fg); }
.section { padding: 3rem 0; }
.facts { display: grid; gap: 1rem; }
@media (min-width: 800px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts article { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 1.25rem; }
.handle { border-top: 1px solid var(--border); background: var(--bg2); }
.handle-grid { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { .handle-grid { grid-template-columns: repeat(3, 1fr); } }
.handle-grid div { border-left: 2px solid var(--accent); padding-left: 1rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.card .ph { aspect-ratio: 4/3; background: #1a1a18; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 1rem; }
.card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); font-size: .8rem; }
.footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2.5rem; color: var(--subtle); font-size: .85rem; text-align: center; }
.field, select, textarea { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; height: 44px; padding: 0 12px; font: inherit; }
textarea { height: auto; min-height: 120px; padding: 10px 12px; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 .35rem; }
.form-group { margin-bottom: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--muted); font-weight: 500; }
td, th { padding: .7rem .6rem; border-top: 1px solid var(--border); vertical-align: top; }
.hidden { display: none !important; }
.wb-dock { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); background: rgba(11,11,10,.96); }
.wb-dock button { height: 56px; background: none; border: 0; color: var(--subtle); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.wb-dock button.on { color: var(--fg); }
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.dash button, .dash a { display: block; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 1rem; color: inherit; }
.site-grid {
  background-image:
    linear-gradient(to right, rgba(199,199,199,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(199,199,199,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.side-shaft { pointer-events: none; position: fixed; top: 64px; bottom: 0; width: 72px; opacity: .2; z-index: 0; overflow: hidden; }
.side-shaft.left { left: 0; }
.side-shaft.right { right: 0; }
main, .hero, .section, .footer, .nav { position: relative; z-index: 1; }
.machine { width: min(720px, 100%); height: auto; margin: 0 auto 1rem; display: block; }
.gear-stage { width: min(420px, 100%); height: 230px; margin: 0 auto; display: block; }
.pipe-flow { stroke-dasharray: 10 8; animation: pipe 1.1s linear infinite; }
.pipe-return { stroke-dasharray: 10 8; animation: pipe 1.4s linear infinite reverse; }
@keyframes pipe { to { stroke-dashoffset: -36; } }
@media (max-width: 1280px) { .side-shaft { display: none; } }
@media (min-width: 900px) {
  .gear-stage { margin-left: auto; margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pipe-flow, .pipe-return { animation: none; }
}
.sheet-bar { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; justify-content:space-between; margin-bottom:.6rem; }
.sheet-tools { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; }
.sheet-tools button, .sheet-tools input[type=color] {
  height: 32px; border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  border-radius: 6px; padding: 0 .6rem; font: inherit; font-size: .8rem;
}
.sheet-tools input[type=color] { width: 36px; padding: 0 2px; }
.sheet-scroller { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #10100e; }
table.sheet { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-family: "DM Sans", ui-sans-serif, sans-serif; }
table.sheet th, table.sheet td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .35rem .45rem; min-width: 110px; white-space: nowrap; }
table.sheet th { position: sticky; top: 0; background: #1a1a17; z-index: 2; font-weight: 600; color: var(--muted); }
table.sheet .sheet-n { min-width: 36px; width: 36px; text-align: center; color: var(--subtle); background: #141412; position: sticky; left: 0; }
table.sheet td.on { outline: 2px solid var(--accent); outline-offset: -2px; }
table.sheet td.computed { color: #c9a227; background: #16140f; }
table.sheet td.bold { font-weight: 700; }
.sheet-edit { width: 100%; height: 26px; border: 0; background: #0b0b0a; color: var(--fg); font: inherit; padding: 0 .2rem; }
.status-available { background: color-mix(in srgb, var(--ok) 18%, transparent); color: #b8e0c4; padding: .2rem .5rem; border-radius: 4px; font-size: .72rem; text-transform: uppercase; }
.status-servicing { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #f0d98a; padding: .2rem .5rem; border-radius: 4px; font-size: .72rem; text-transform: uppercase; }
.ebay-strip { margin-top: 3rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 1.1rem 1.25rem; }

.mail-app { display:grid; grid-template-columns: 140px 280px minmax(0,1fr); min-height: 62vh; border:1px solid var(--border); border-radius:10px; overflow:hidden; background:var(--surface); }
.mail-nav { border-right:1px solid var(--border); padding:.75rem; display:flex; flex-direction:column; gap:.4rem; }
.mail-nav button[data-folder] { height:36px; background:transparent; border:0; color:var(--muted); text-align:left; }
.mail-nav button.on { color:var(--fg); }
.mail-list { border-right:1px solid var(--border); overflow:auto; }
.mail-row { display:block; width:100%; text-align:left; background:transparent; border:0; border-bottom:1px solid var(--border); color:inherit; padding:.7rem .8rem; }
.mail-row b, .mail-row span { display:block; }
.mail-row.unread b { color:#fff; }
.mail-row i { color:var(--subtle); font-style:normal; font-size:.75rem; }
.mail-read { padding:1rem; overflow:auto; }
.mail-body { margin-top:1rem; }
.editor { min-height:220px; border:1px solid var(--border); border-radius:8px; padding:.75rem; background:var(--bg); }
.compose-tools { display:flex; gap:.35rem; margin:.4rem 0; }
.compose-tools button, .compose-tools select, .compose-tools input { height:32px; background:var(--bg); color:var(--fg); border:1px solid var(--border); border-radius:6px; }
@media (max-width: 900px) { .mail-app { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: calc(64px + env(safe-area-inset-top));
    flex-direction: column;
    gap: 0;
    background: rgba(11,11,10,.98);
    border-bottom: 1px solid var(--border);
    padding: .35rem 1rem 1rem;
    z-index: 50;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .85rem 0; font-size: 1rem; }
  .nav-links a:after { display: none; }
  .brand img { width: 36px; height: 36px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
  .brand b { font-size: .88rem; }
}
