/* =========================================================
   Shared styles for every page of the electronics tools hub.
   ========================================================= */
:root {
  --bg: #0c1311;
  --bg2: #13221d;
  --ink: #e4efe9;
  --muted: #97ada3;
  --accent: #39c37f;
  --card: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.11);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* pin types */
  --p-3v3: #f39c3c;
  --p-5v: #e5534b;
  --p-gnd: #3b4440;
  --p-gpio: #39c37f;
  --p-special: #e7d15a;
  --p-other: #8aa0b4;
}
* { box-sizing: border-box; min-width: 0; }
html { background-color: #0c1311; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1400px 700px at 60% 0%, var(--bg2), var(--bg)) #0c1311;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
button { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hidden { display: none !important; }
code, pre { font-family: var(--mono); }

/* ===== header ===== */
.site-header, .site-footer { width: 100%; background: rgba(0, 0, 0, 0.35); }
.site-header { border-bottom: 1px solid var(--line); }
.site-bar { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.logo svg { width: 34px; height: 34px; }
.top-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top-nav a { color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: 0.92rem; }
.top-nav a:hover, .top-nav a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, 0.07); }

/* ===== ads ===== */
.ad { width: 100%; text-align: center; }
.ad small { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
.ad-slot { margin: 0 auto; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; background: rgba(255, 255, 255, 0.025); }
.ad-top, .ad-bottom { max-width: 1240px; margin: 12px auto; padding: 0 20px; }
.ad-top .ad-slot, .ad-bottom .ad-slot { max-width: 728px; min-height: 90px; }
@media (max-width: 600px) { .ad-top .ad-slot, .ad-bottom .ad-slot { max-width: 320px; min-height: 100px; } }

/* ===== layout: sidebar + main ===== */
.layout { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; flex: 1; }
.sidebar { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .main { order: 1; }
}
.side-block { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.side-block h2 { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 0.94rem; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); }
.side-nav a[aria-current="page"] { background: rgba(57, 195, 127, 0.15); color: var(--accent); font-weight: 600; }
.side-nav small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.product { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.product:first-of-type { border-top: none; padding-top: 0; }
.cover { width: 58px; height: 58px; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.6rem; font-weight: 700; line-height: 1.2; padding: 4px; color: #eaf5ef; }
.cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.product h3 { font-size: 0.9rem; margin: 0 0 2px; }
.product p { margin: 0 0 6px; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.product a.buy { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--accent); color: #0c1311; text-decoration: none; }
.disclosure { font-size: 0.72rem; color: var(--muted); margin: 8px 0 0; }
.ad-side .ad-slot { width: 100%; max-width: 300px; min-height: 250px; }

/* ===== main ===== */
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 6px 0 4px; line-height: 1.15; }
.lede { color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: rgba(229, 83, 75, 0.12); border: 1px solid rgba(229, 83, 75, 0.35); font-size: 0.9rem; margin-bottom: 14px; line-height: 1.5; }
.warn b { color: #ff9b94; }
.btn { border: none; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; min-height: 36px; font-size: 0.86rem; }
.btn-ghost { background: rgba(255, 255, 255, 0.09); color: var(--ink); }
.btn-main { background: var(--accent); color: #0c1311; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input { flex: 1 1 200px; background: rgba(0, 0, 0, 0.3); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 6px 11px; cursor: pointer; font-size: 0.84rem; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip[aria-pressed="true"] { background: var(--ink); color: #0c1311; border-color: var(--ink); font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.seg button { border: none; background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 0.84rem; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #0c1311; font-weight: 600; }

.pin-area { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pin-area { grid-template-columns: 1fr; } }

/* ===== the header diagram ===== */
.board { background: linear-gradient(180deg, #0f3a28, #0b2a1d); border: 1px solid rgba(57, 195, 127, 0.35); border-radius: 16px; padding: 12px 8px; overflow-x: auto; }
.edge { text-align: center; font-size: 0.72rem; color: #b8d8c8; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 0 8px; }
.edge.bottom { padding: 8px 0 4px; }
.rows { display: grid; gap: 3px; min-width: 330px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 30px 30px minmax(0, 1fr); gap: 6px; align-items: center; }
.row.single { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); }
.lbl { display: flex; flex-direction: column; line-height: 1.15; padding: 3px 7px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; background: none; color: inherit; text-align: inherit; }
.lbl.l { align-items: flex-end; text-align: right; }
.lbl.r { align-items: flex-start; text-align: left; }
.lbl .nm { font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.lbl .fn { font-size: 0.7rem; color: #b8d8c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pin {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85);
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; cursor: pointer; color: #0c1311;
  font-variant-numeric: tabular-nums; padding: 0; transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}
.pin.square { border-radius: 5px; }
.pin.t-3v3 { background: var(--p-3v3); }
.pin.t-5v { background: var(--p-5v); }
.pin.t-gnd { background: var(--p-gnd); color: #dfe8e3; border-color: #7f8c86; }
.pin.t-gpio { background: var(--p-gpio); }
.pin.t-special { background: var(--p-special); }
.pin.t-other { background: var(--p-other); }
.pin:hover, .lbl:hover + .pin, .pin.sel { transform: scale(1.15); }
.pin.sel { box-shadow: 0 0 0 3px #fff, 0 0 14px rgba(255, 255, 255, 0.6); }
.lbl.sel { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.dim { opacity: 0.22; }
.hl .nm { color: #fff; }
.lbl.hl { background: rgba(255, 255, 255, 0.08); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255, 255, 255, 0.5); }

/* ===== details panel ===== */
.details h2 { font-size: 1.35rem; margin: 0 0 2px; }
.details .sub { color: var(--muted); margin: 0 0 10px; font-size: 0.9rem; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #0c1311; text-transform: uppercase; letter-spacing: 0.06em; }
.fnlist { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.fnlist span { font-size: 0.8rem; padding: 4px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); border-left: 3px solid var(--c, #888); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.9rem; margin: 8px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.note { font-size: 0.9rem; line-height: 1.55; color: #cfe0d7; margin: 8px 0; }
.code { position: relative; margin-top: 10px; }
.code pre { background: #06100c; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; margin: 6px 0 0; color: #d6f5e4; }
.code .head { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ===== table ===== */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
tbody tr.sel { background: rgba(57, 195, 127, 0.14); }
td .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.board-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.board-links a { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.board-links a:hover { border-color: var(--accent); }
.board-links small { display: block; color: var(--muted); margin-top: 2px; }
.content p, .content li { color: var(--muted); line-height: 1.65; }
.content h3 { font-size: 1rem; margin: 18px 0 4px; color: var(--ink); }
.content code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 4px; font-size: 0.88em; color: var(--ink); }

/* ===== footer ===== */
.site-footer { border-top: 1px solid var(--line); margin-top: 28px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 8px 20px 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.footer-nav { display: flex; gap: 6px 14px; justify-content: center; flex-wrap: wrap; margin: 14px 0 0; }
.footer-nav a { color: var(--muted); }
.share-title { margin: 16px 0 8px; color: var(--ink); font-size: 0.9rem; }
.share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.share a, .share button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); text-decoration: none; font-size: 0.85rem; cursor: pointer; }
.footer-links { margin: 16px 0 6px; }
.footer-links a { color: var(--muted); margin: 0 8px; }
.copyright { margin: 6px 0 0; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #e4efe9; color: #0c1311; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 60; max-width: calc(100% - 40px); text-align: center; }

/* ===== hub additions ===== */
.top-nav { align-items: center; }
.install-btn { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; }
.search input { width: 100%; background: rgba(0, 0, 0, 0.35); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px 8px 34px; font: inherit; font-size: 16px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.05rem; pointer-events: none; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #13221d; border: 1px solid var(--line); border-radius: 14px; padding: 6px; z-index: 50; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); max-height: 60vh; overflow-y: auto; }
.results a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.results a small { display: block; color: var(--muted); font-size: 0.78rem; }
.results a:hover, .results a.on { background: rgba(57, 195, 127, 0.16); }
.results .none { padding: 10px; color: var(--muted); font-size: 0.9rem; }
.hero .search { max-width: 560px; margin-top: 14px; }
.hero .search input { padding: 13px 16px 13px 40px; font-size: 1.05rem; }
.hero .search::before { left: 15px; font-size: 1.2rem; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin: 4px 0 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { opacity: 0.6; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.tile { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, 0.03); transition: border-color 0.15s ease; }
.tile:hover { border-color: var(--accent); }
.tile .ic { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.tile strong { display: block; }
.tile small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.tile .count { display: inline-block; margin-top: 8px; font-size: 0.75rem; color: var(--accent); font-weight: 700; }
.fam-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fam-head a { font-size: 0.85rem; }
.site-box { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-color: rgba(57, 195, 127, 0.45); background: rgba(57, 195, 127, 0.08); }
.site-box p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.site-box a.btn { text-decoration: none; }
.side-nav .fam { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 2px; }

.row-sep { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #b8d8c8; padding: 12px 6px 4px; border-top: 1px dashed rgba(255, 255, 255, 0.15); margin-top: 6px; text-align: center; }
.row-sep:first-child { border-top: none; margin-top: 0; padding-top: 2px; }
/* DIP chip view */
.edge:empty { display: none; }
.board.chip { background: #1c2421; border-color: rgba(255, 255, 255, 0.14); }
.board.chip .rows { gap: 0; }
.board.chip .row { grid-template-columns: minmax(0, 1fr) 30px 92px 30px minmax(0, 1fr); gap: 0; padding: 2px 0; }
.board.chip .row .lbl.l { margin-right: 6px; }
.board.chip .row .lbl.r { margin-left: 6px; }
.board.chip .body { align-self: stretch; background: #0a0d0c; margin: -2px 0; border-left: 2px solid #2b3330; border-right: 2px solid #2b3330; }
.board.chip .row:first-child .body { border-top: 2px solid #2b3330; border-radius: 8px 8px 0 0; position: relative; }
.board.chip .row:first-child .body::before { content: ""; position: absolute; left: 50%; top: -2px; width: 24px; height: 12px; transform: translateX(-50%); background: #1c2421; border-radius: 0 0 12px 12px; border: 2px solid #2b3330; border-top: none; }
.board.chip .row:first-child .body::after { content: ""; position: absolute; left: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: #3a4440; }
.board.chip .row:last-child .body { border-bottom: 2px solid #2b3330; border-radius: 0 0 8px 8px; }
.board.chip .pin { border-radius: 4px; width: 30px; height: 24px; border-color: #c9d1cd; }
.board.chip .chip-name { writing-mode: vertical-rl; transform: rotate(180deg); }
.chip-label { position: absolute; }
.board.module { background: linear-gradient(180deg, #0f2a3a, #0b1e2a); border-color: rgba(74, 163, 255, 0.35); }

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .ad, .sidebar, .toolbar, .chips, .details, .actions, .content, .board-links-card, .site-box, .crumbs { display: none !important; }
  .layout { display: block; }
  .pin-area { display: block; }
  .card { border: none; background: none; }
  .board { background: #fff; border: 1px solid #999; }
  .edge, .lbl .fn { color: #333; }
  .lbl .nm { color: #000; }
  th, td { color: #000; border-color: #ccc; }
}

/* ===== calculators ===== */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
label.field, .field { display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .calc input[type="text"], .calc select {
  background: rgba(0, 0, 0, 0.35); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; width: 100%;
}
.field small { font-weight: 400; color: var(--muted); }
.calc .seg { margin-bottom: 14px; }
.answer { border-radius: 16px; padding: 16px; background: linear-gradient(135deg, rgba(57, 195, 127, 0.18), rgba(57, 195, 127, 0.05)); border: 1px solid rgba(57, 195, 127, 0.4); margin-bottom: 14px; }
.answer .k { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.answer .big { font-size: clamp(1.5rem, 4.5vw, 2.2rem); font-weight: 800; margin: 2px 0; font-variant-numeric: tabular-nums; }
.answer .sub { color: var(--muted); font-size: 0.92rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-top: 12px; }
.stat { background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 10px 12px; }
.stat .v { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.78rem; }
.formula { font-family: var(--mono); background: #06100c; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: #d6f5e4; font-size: 0.92rem; line-height: 1.7; overflow-x: auto; }
.warn.soft { background: rgba(231, 209, 90, 0.1); border-color: rgba(231, 209, 90, 0.35); }
.warn.soft b { color: #f1dd7a; }
.colour-select { display: flex; align-items: center; gap: 8px; }
.colour-select i { width: 18px; height: 18px; border-radius: 4px; flex: none; border: 1px solid rgba(255, 255, 255, 0.4); }
.resistor-svg { width: 100%; max-width: 460px; height: auto; display: block; margin: 6px auto 12px; }
.bits { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.bit { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bit button { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--muted); font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.bit button[aria-pressed="true"] { background: var(--accent); color: #0c1311; border-color: var(--accent); }
.bit small { font-size: 0.7rem; color: var(--muted); }
.bit input { width: 100%; text-align: center; background: transparent; color: var(--ink); border: 1px dashed var(--line); border-radius: 6px; font-size: 0.72rem; padding: 3px; }
@media (max-width: 520px) { .bits { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
[hidden] { display: none !important; }

/* ===== tools ===== */
.pixgrid { display: grid; gap: 3px; touch-action: none; user-select: none; background: #0a1a12; padding: 10px; border-radius: 12px; width: fit-content; max-width: 100%; }
.pixgrid button { width: 34px; height: 34px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.08); background: #12352a; padding: 0; cursor: pointer; }
.pixgrid button.on { background: #b6ff6e; box-shadow: 0 0 8px rgba(182, 255, 110, 0.6); }
.pixgrid.lcd { background: #1c3d8a; }
.pixgrid.lcd button { background: #2a52b0; border-color: rgba(255, 255, 255, 0.05); width: 30px; height: 30px; border-radius: 2px; }
.pixgrid.lcd button.on { background: #e8f0ff; box-shadow: none; }
.pixgrid.led button { border-radius: 50%; background: #2a0f0f; }
.pixgrid.led button.on { background: #ff3b30; box-shadow: 0 0 10px rgba(255, 59, 48, 0.8); }
.slots { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.slot { border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 0.72rem; }
.slot[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); }
.slot canvas { image-rendering: pixelated; display: block; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.tool-split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 760px) { .tool-split { grid-template-columns: 1fr; } }
.preview-canvas { image-rendering: pixelated; background: #000; border-radius: 8px; max-width: 100%; border: 1px solid var(--line); cursor: crosshair; display: block; }
.term { background: #050b08; border: 1px solid var(--line); border-radius: 12px; height: 420px; overflow-y: auto; padding: 10px 12px; font-family: var(--mono); font-size: 0.84rem; line-height: 1.45; white-space: pre-wrap; word-break: break-all; color: #d6f5e4; }
.term .ts { color: #6f8a7d; }
.term .tx { color: #7fb8ff; }
.term .sys { color: #f1dd7a; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #5a6460; margin-right: 6px; vertical-align: 0; }
.status-dot.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.plan-table td:first-child { font-weight: 600; }
.pill { display: inline-block; font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); margin: 1px 3px 1px 0; }
.content code { overflow-wrap: anywhere; }
