:root {
  --bg: #e2e1dc; --panel: #ecebe6; --paper: #f4f3ef; --ink: #161616; --ink2: #3d3d3a; --muted: #5f5f5a; --muted2: #9a9a95;
  --off: #d2d1cb; --accent: #ff5a1f; --accent-soft: #ffe2d6; --accent-ink: #a8380c;
  --line: 2px solid var(--ink);
  --mono: 'IBM Plex Mono', 'Apple SD Gothic Neo', 'IBM Plex Sans KR', ui-monospace, monospace;
  --sans: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--bg);
  background-image: linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 24px 24px; min-height: 100vh;
}
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
button, input { font: inherit; color: inherit; }

.head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--panel); border-bottom: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); }
.brand img { width: 28px; height: 28px; }
.brand b { font-size: 15px; letter-spacing: .04em; }
.tag { font-size: 10px; padding: 2px 6px; border: 1.5px solid var(--ink); background: var(--accent); color: #fff; font-weight: 600; }
.conn { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); }
.conn.on i { background: #2fae5b; box-shadow: 0 0 0 3px rgba(47,174,91,.18); }
.conn.warn i { background: var(--accent); }
.power { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.power input { display: none; }
.power .knob { width: 40px; height: 22px; border: var(--line); background: var(--off); position: relative; transition: background .15s; }
.power .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--ink); transition: transform .15s; }
.power input:checked + .knob { background: var(--accent); }
.power input:checked + .knob::after { transform: translateX(18px); }
.power .lbl { font-family: var(--mono); font-size: 12px; font-weight: 600; }

main { max-width: 1080px; margin: 0 auto; padding: 24px; display: grid; gap: 28px; }
section { display: grid; gap: 12px; }

.perm { border: var(--line); background: var(--accent-soft); padding: 16px 18px; gap: 8px; }
.perm-t { font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
.perm-t .mono { font-size: 11px; color: var(--accent-ink); }
.perm p { margin: 0; line-height: 1.6; color: var(--ink2); }
.btn { justify-self: start; border: var(--line); background: var(--paper); padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn.dark { background: var(--ink); color: #fff; }
.btn:hover { transform: translateY(-1px); }

.now { grid-template-columns: 220px 1fr; border: var(--line); background: var(--paper); gap: 0; }
.now-img { border-right: var(--line); background: var(--panel); display: grid; place-items: center; aspect-ratio: 1; }
.now-img img { width: 86%; height: 86%; object-fit: contain; }
.now-body { padding: 18px 22px; display: grid; gap: 10px; align-content: start; }
.now h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.now-sub { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row input[type=range] { flex: 1; max-width: 320px; accent-color: var(--accent); }
.ok { font-size: 12px; color: #1f7a40; font-weight: 600; }
.try { margin-top: 4px; border: var(--line); background: #fff; padding: 12px 14px; font-family: var(--mono); font-size: 14px; outline: none; }
.try:focus { box-shadow: 4px 4px 0 var(--accent); }

.sec-head { display: flex; align-items: baseline; gap: 10px; border-bottom: var(--line); padding-bottom: 6px; }
.sec-head .mono { font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.sec-head h2 { margin: 0; font-size: 18px; }
.note { margin-left: auto; font-size: 12px; color: var(--muted); }

.plates { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.plate { border: var(--line); background: var(--paper); padding: 10px 12px; text-align: left; cursor: pointer; display: grid; gap: 6px; }
.plate .sw { height: 10px; border: 1.5px solid var(--ink); }
.plate b { font-size: 14px; }
.plate small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.plate.on { background: var(--ink); color: #fff; }
.plate.on small { color: #cfcfca; }

.tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search { flex: 1; min-width: 220px; border: var(--line); background: #fff; padding: 9px 12px; outline: none; }
.chips { display: flex; gap: 0; border: var(--line); }
.chip { border: 0; border-right: var(--line); background: var(--paper); padding: 8px 12px; cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.chip:last-child { border-right: 0; }
.chip.on { background: var(--accent); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.card { border: var(--line); background: var(--paper); padding: 0; cursor: pointer; text-align: left; display: grid; grid-template-rows: auto 1fr; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); }
.card .pic { aspect-ratio: 4/3; background: var(--panel); border-bottom: var(--line); display: grid; place-items: center; }
.card .pic img { width: 74%; height: 90%; object-fit: contain; }
.card .txt { padding: 8px 10px 10px; display: grid; gap: 2px; }
.card .mk { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.card .nm { font-weight: 700; font-size: 14px; line-height: 1.3; }
.card .nk { font-size: 12px; color: var(--ink2); }
.card .sh { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.card .ty { position: absolute; top: 6px; left: 6px; font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 1px 5px; border: 1.5px solid var(--ink); background: var(--paper); }
.card.on { outline: 3px solid var(--accent); outline-offset: -1px; }
.card.on .ty { background: var(--accent); color: #fff; }
.empty { color: var(--muted); padding: 20px 0; }

.foot { max-width: 1080px; margin: 0 auto; padding: 8px 24px 40px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.foot a { color: var(--accent-ink); }

.off { position: fixed; inset: 0; background: rgba(226,225,220,.86); display: grid; place-items: center; z-index: 10; }
.off > div { border: var(--line); background: var(--paper); padding: 20px 24px; max-width: 360px; }
.off p { margin: 8px 0 0; line-height: 1.6; }

.get { border: var(--line); background: var(--paper); padding: 22px 24px; gap: 18px; box-shadow: 6px 6px 0 var(--ink); }
.get h1 { margin: 6px 0 8px; font-size: 28px; line-height: 1.3; letter-spacing: -.01em; }
.get p { margin: 0; color: var(--ink2); line-height: 1.65; max-width: 680px; }
.dls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dl { border: var(--line); background: var(--panel); padding: 14px 16px; display: grid; gap: 3px; text-decoration: none; color: var(--ink); position: relative; }
.dl:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); }
.dl .os { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .08em; }
.dl b { font-size: 18px; }
.dl small { color: var(--muted); }
.dl .sz { position: absolute; right: 14px; top: 14px; font-size: 11px; color: var(--muted); }
.dl.mine { background: var(--accent); color: #fff; }
.dl.mine .os, .dl.mine small, .dl.mine .sz { color: #ffe9df; }
.dl.mine::after { content: '내 컴퓨터'; position: absolute; right: 14px; bottom: 14px; font-family: var(--mono); font-size: 10px; font-weight: 600; border: 1.5px solid #fff; padding: 1px 5px; }
.howtos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.howto { border: 1.5px solid var(--ink); background: #fff; padding: 10px 14px; }
.howto summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.howto ol { margin: 8px 0 2px; padding-left: 20px; line-height: 1.65; font-size: 13.5px; color: var(--ink2); }
.link-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1.5px dashed var(--muted2); padding-top: 14px; font-size: 14px; }
.link-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); animation: blink 1.2s infinite; }
.link-row .hint { flex-basis: 100%; font-size: 12px; color: var(--muted); line-height: 1.6; }
.link-row .hint a { color: var(--accent-ink); }
.link-row .hint.warn { color: var(--accent-ink); background: var(--accent-soft); border: 1.5px solid var(--accent); padding: 6px 10px; font-size: 13px; }
@keyframes blink { 50% { opacity: .25; } }
body:not(.offline) .get { box-shadow: none; }
body:not(.offline) .get .link-row { display: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; border: var(--line); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); padding: 14px 16px; display: grid; gap: 6px; max-width: 440px; width: calc(100% - 32px); }
.toast span { font-size: 13.5px; color: var(--ink2); line-height: 1.55; }

@media (max-width: 720px) {
  .dls, .howtos { grid-template-columns: 1fr; }
  .now { grid-template-columns: 1fr; }
  .now-img { border-right: 0; border-bottom: var(--line); aspect-ratio: 2; }
  .plates { grid-template-columns: repeat(3, 1fr); }
}
