/* LabSim — arayüz stili */
@layer reset, tokens, base, layout, components, world;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, h4, h5, p, ol, ul, figure { margin: 0; }
  button, input, select { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  img { max-width: 100%; display: block; }
}

@layer tokens {
  :root {
    color-scheme: dark;
    --bg: #0d1117;
    --bg-2: #121820;
    --surface: #161d27;
    --surface-2: #1c2531;
    --surface-3: #243042;
    --line: #2a3546;
    --line-2: #34425a;
    --text: #e6edf5;
    --text-2: #a9b6c7;
    --text-3: #75859a;
    --accent: #ffb547;
    --accent-2: #ff8f3d;
    --cyan: #4fd1ff;
    --green: #3ddc84;
    --red: #ff5d55;
    --amber: #ffc94a;
    --hi: #3ddc84;
    --lo: #6c7a8c;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Cascadia Mono', 'Courier New', monospace;
    --left: 268px;
    --right: 392px;
  }
}

@layer base {
  html, body { height: 100%; }
  body {
    font-family: var(--font);
    font-size: .875rem;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    display: grid;
    grid-template-columns: var(--left) 1fr var(--right);
    grid-template-rows: 58px 1fr 30px;
    grid-template-areas: "top top top" "pal stage panel" "st st st";
    accent-color: var(--accent);
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: rgba(255, 181, 71, .35); }
  * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  kbd { font-family: var(--mono); font-size: .75em; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--text); }
  code { font-family: var(--mono); font-size: .85em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
  .dim { color: var(--text-3); }
  .mono { font-family: var(--mono); }
  .ovl { text-decoration: overline; }
  svg { overflow: visible; }
}

@layer layout {
  #topbar {
    grid-area: top;
    display: flex; align-items: center; gap: 14px;
    padding: 0 14px;
    background: linear-gradient(180deg, #151c26, #111720);
    border-bottom: 1px solid var(--line);
    z-index: 5;
  }
  #palette { grid-area: pal; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
  #stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #1b2a2b; }
  #panel { grid-area: panel; background: var(--bg-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
  #status { grid-area: st; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 14px; background: #0b0f15; border-top: 1px solid var(--line); font-size: .78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; }
  #statusText { overflow: hidden; text-overflow: ellipsis; }
  #world { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; cursor: default; }
  #world.panning { cursor: grabbing; }
  #world.grab { cursor: grab; }
  #world.placing { cursor: crosshair; }

  @media (max-width: 1180px) {
    :root { --left: 220px; --right: 340px; }
    .brand-t span, #kindSeg small, .tb-label { display: none; }
  }
  @media (max-width: 900px) {
    body { grid-template-columns: 1fr; grid-template-rows: 54px 1fr 40vh 28px; grid-template-areas: "top" "stage" "panel" "st"; }
    #palette { display: none; }
    #wireTool { display: none; }
  }
}

@layer components {
  /* ---------- marka ---------- */
  .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #2a3443, #121820); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 18px rgba(255, 181, 71, .15); }
  .logo svg { width: 20px; height: 20px; fill: var(--accent); filter: drop-shadow(0 0 6px rgba(255, 181, 71, .6)); }
  .brand-t { display: flex; flex-direction: column; line-height: 1.1; }
  .brand-t b { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
  .brand-t span { font-size: .7rem; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }

  /* ---------- segmentli seçim ---------- */
  .seg { display: flex; padding: 3px; gap: 3px; background: #0b1016; border: 1px solid var(--line); border-radius: 11px; }
  .seg button { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .82rem; color: var(--text-2); transition: background .15s, color .15s; }
  .seg button small { font-weight: 600; font-size: .7rem; color: var(--text-3); }
  .seg button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .seg button:hover { color: var(--text); background: var(--surface-2); }
  .seg button.on { background: linear-gradient(180deg, #2b3647, #222c3b); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 2px 8px rgba(0,0,0,.35); }
  .seg button.on svg { stroke: var(--accent); }
  .seg button.on small { color: var(--accent); }

  .tb-group { display: flex; align-items: center; gap: 6px; }
  .tb-spacer { flex: 1; }
  .tb-label { font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
  .swatches { display: flex; gap: 4px; flex-wrap: wrap; }
  .sw { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid rgba(0,0,0,.35); box-shadow: inset 0 2px 3px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.3); transition: transform .12s; }
  .sw:hover { transform: scale(1.15); }
  .sw.on { outline: 2px solid var(--accent); outline-offset: 2px; }
  .swatches.big .sw { width: 26px; height: 26px; }
  #topbar select, .insp select, .insp input[type=text], .insp input[type=number], .pal-search input {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 9px; min-height: 32px; color: var(--text);
  }
  #topbar select { font-size: .8rem; font-weight: 600; }
  .icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); border: 1px solid transparent; transition: background .15s, color .15s; }
  .icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
  .icon-btn.on { background: rgba(255, 181, 71, .14); color: var(--accent); border-color: rgba(255, 181, 71, .35); }
  .menu-wrap { position: relative; }
  .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); display: none; z-index: 30; }
  .menu.open { display: block; animation: pop .14s ease-out; }
  .menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: start; font-weight: 600; color: var(--text-2); }
  .menu button:hover { background: var(--surface-2); color: var(--text); }
  .menu button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
  .menu-h { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 6px 10px 4px; }
  @keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

  /* ---------- güç düğmesi ---------- */
  .power { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 11px; border-radius: 11px; font-weight: 800; font-size: .78rem; letter-spacing: .05em; color: var(--text-2); background: linear-gradient(180deg, #1e2733, #161d27); border: 1px solid var(--line-2); transition: all .2s; }
  .power svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
  .pw-led { width: 9px; height: 9px; border-radius: 50%; background: #3a2222; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
  .power:hover { color: var(--text); border-color: #4a5a72; }
  .power.on { color: #eafff2; background: linear-gradient(180deg, #1c4a33, #12301f); border-color: #2f8a57; box-shadow: 0 0 22px rgba(61, 220, 132, .25); }
  .power.on .pw-led { background: var(--green); box-shadow: 0 0 10px var(--green); }

  /* ---------- palet ---------- */
  .pal-search { position: relative; padding: 12px 12px 8px; }
  .pal-search svg { position: absolute; left: 22px; top: 21px; width: 16px; height: 16px; fill: none; stroke: var(--text-3); stroke-width: 2; }
  .pal-search input { width: 100%; padding-left: 32px; }
  #palList { overflow-y: auto; padding: 0 8px 12px; flex: 1; }
  .pal-g { margin-bottom: 4px; }
  .pal-g summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 6px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); cursor: pointer; border-radius: 6px; }
  .pal-g summary::-webkit-details-marker { display: none; }
  .pal-g summary::before { content: '▸'; margin-right: 6px; transition: transform .15s; display: inline-block; }
  .pal-g[open] summary::before { transform: rotate(90deg); }
  .pal-g summary span { font-weight: 700; color: var(--text-3); background: var(--surface); border-radius: 10px; padding: 0 7px; letter-spacing: 0; }
  .pal-g summary:hover { color: var(--text-2); }
  .pal-items { display: grid; gap: 3px; }
  .pal-it { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; text-align: start; border: 1px solid transparent; transition: background .12s, border-color .12s, transform .12s; }
  .pal-it svg { width: 34px; height: 34px; flex: none; padding: 3px; border-radius: 8px; background: linear-gradient(180deg, #e8e5dc, #d6d2c7); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.4); }
  .pal-it .pi-t { display: flex; flex-direction: column; min-width: 0; }
  .pal-it b { font-size: .86rem; font-weight: 700; }
  .pal-it small { font-size: .72rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pal-it:hover { background: var(--surface); border-color: var(--line); }
  .pal-it:active { transform: scale(.98); }
  .pal-tip { margin: 10px 4px 0; padding: 10px; border-radius: 10px; background: rgba(79, 209, 255, .06); border: 1px dashed rgba(79, 209, 255, .25); font-size: .76rem; color: var(--text-2); }
  .empty { color: var(--text-3); padding: 20px; text-align: center; }

  /* ---------- sahne üstü kontroller ---------- */
  .zoom-ctl { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(13, 17, 23, .78); border: 1px solid var(--line); backdrop-filter: blur(8px); }
  .zoom-ctl button { width: 32px; height: 32px; border-radius: 8px; font-size: 1.1rem; font-weight: 700; color: var(--text-2); }
  .zoom-ctl button:hover { background: var(--surface-2); color: var(--text); }

  /* ---------- sağ panel ---------- */
  #tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
  #tabs button { padding: 8px 10px 9px; font-size: .78rem; font-weight: 700; color: var(--text-3); border-radius: 8px 8px 0 0; white-space: nowrap; position: relative; display: flex; align-items: center; gap: 6px; }
  #tabs button:hover { color: var(--text); background: var(--surface); }
  #tabs button.on { color: var(--text); background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
  .badge:empty { display: none; }
  .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: .68rem; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
  .badge.err { background: var(--red); color: #fff; }
  .badge.warn { background: var(--amber); color: #2a1c00; }
  #tabBody { overflow-y: auto; flex: 1; min-height: 0; }
  .insp { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
  .card h4 { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
  .card.live { background: linear-gradient(180deg, #17202b, #141b24); }
  .card p { color: var(--text-2); font-size: .82rem; }
  .card p.dim { color: var(--text-3); font-size: .78rem; }
  .i-hdr { display: flex; gap: 12px; align-items: center; }
  .i-ic svg { width: 44px; height: 44px; padding: 5px; border-radius: 11px; background: linear-gradient(180deg, #ebe8df, #d3cfc4); box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0,0,0,.4); }
  .i-tt { flex: 1; min-width: 0; }
  .i-tt h3 { font-size: .98rem; font-weight: 800; line-height: 1.25; }
  .i-tt p { font-size: .74rem; color: var(--text-3); margin-top: 2px; overflow-wrap: anywhere; }
  .i-btns { display: flex; gap: 4px; }
  .ib { width: 32px; height: 32px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 1rem; color: var(--text-2); }
  .ib:hover { border-color: var(--line-2); color: var(--text); }
  .ib.danger:hover { background: rgba(255, 93, 85, .15); border-color: rgba(255, 93, 85, .5); }
  .fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .fld > span { font-size: .74rem; font-weight: 700; color: var(--text-2); }
  .fld small { color: var(--text-3); font-size: .72rem; }
  .fld-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .fld-row > .fld { flex: 1 1 120px; }
  .fld.grow { flex: 2 1 160px; }
  .insp input[type=range] { width: 100%; }
  .num-sl { display: flex; gap: 8px; align-items: center; }
  .num-sl input[type=number] { width: 84px; flex: none; font-family: var(--mono); }
  .seg-sm { display: flex; flex-wrap: wrap; gap: 4px; }
  .seg-sm button { padding: 5px 9px; border-radius: 7px; font-size: .76rem; font-weight: 700; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 5px; }
  .seg-sm button:hover { color: var(--text); border-color: var(--line-2); }
  .seg-sm button.on { color: #1b1300; background: var(--accent); border-color: var(--accent); }
  .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px currentColor; }
  .chk { display: flex; gap: 9px; align-items: flex-start; font-size: .82rem; color: var(--text-2); cursor: pointer; padding: 3px 0; }
  .chk input { margin-top: 3px; }
  .chk small { display: block; color: var(--text-3); font-size: .74rem; }
  .menu .chk { padding: 7px 10px; border-radius: 8px; }
  .menu .chk:hover { background: var(--surface-2); }
  .kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .82rem; }
  .kv span { color: var(--text-3); }
  .kv b { font-family: var(--mono); font-weight: 500; text-align: end; overflow-wrap: anywhere; }
  .row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
  .btn { padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); transition: all .12s; }
  .btn:hover { background: var(--surface-3); }
  .btn.primary { background: linear-gradient(180deg, #ffbf5e, #ff9f30); color: #2a1700; border-color: #ffb547; box-shadow: 0 4px 14px rgba(255, 159, 48, .25); }
  .btn.primary:hover { filter: brightness(1.06); }
  .btn.danger { color: #ffb4b0; border-color: rgba(255, 93, 85, .4); background: rgba(255, 93, 85, .08); }
  .btn.on { background: rgba(255, 93, 85, .18); }
  .btn.small { padding: 4px 9px; font-size: .74rem; }
  .alert { padding: 9px 11px; border-radius: 9px; font-size: .8rem; border: 1px solid; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .alert.err { background: rgba(255, 93, 85, .1); border-color: rgba(255, 93, 85, .4); color: #ffcbc8; }
  .alert.warn { background: rgba(255, 201, 74, .08); border-color: rgba(255, 201, 74, .35); color: #ffe6a8; }
  .alert.ok { background: rgba(61, 220, 132, .1); border-color: rgba(61, 220, 132, .4); color: #b9f5d2; }
  .alert.info { background: rgba(79, 209, 255, .07); border-color: rgba(79, 209, 255, .3); color: #c6efff; }
  .hint-box { padding: 8px 10px; border-radius: 8px; background: rgba(255, 201, 74, .08); border: 1px solid rgba(255, 201, 74, .3); color: #ffe6a8; font-size: .8rem; }
  .pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-3); }
  .pill.ok { background: rgba(61, 220, 132, .15); color: #8ff0bb; }
  .pill.warn { background: rgba(255, 201, 74, .15); color: #ffe08a; }
  .pill.err { background: rgba(255, 93, 85, .2); color: #ffb0ab; animation: blink 1s infinite; }
  @keyframes blink { 50% { opacity: .55; } }
  .steps { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; color: var(--text-2); font-size: .82rem; }
  .steps.check { list-style: none; padding: 0; }
  .steps.check li label { display: flex; gap: 9px; cursor: pointer; }
  .steps.check li label input { margin-top: 3px; flex: none; }
  .steps.check li.done span { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
  .spec { padding-left: 18px; color: var(--text-2); font-size: .8rem; display: flex; flex-direction: column; gap: 5px; }

  /* direnç bantları */
  .bands { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; border-radius: 10px; background: #0f141b; border: 1px solid var(--line); }
  .band-svg { width: 220px; height: 46px; }
  .band-names { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: .74rem; color: var(--text-2); }
  .band-names i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid rgba(255,255,255,.2); }

  /* ayak kartı */
  .pincard { width: 100%; height: auto; }
  .pc-body { fill: #1b1c1f; stroke: #3a3d42; }
  .pc-notch { fill: #0d0d0e; }
  .pc-label { fill: #cfd3d8; font: 700 13px var(--mono); }
  .pc-pin rect { fill: #2a313b; stroke: #445063; }
  .pc-pin.vcc rect { fill: #5a1d1d; stroke: #ff5d55; }
  .pc-pin.gnd rect { fill: #1b2a4a; stroke: #4f8cff; }
  .pc-pin.out rect { stroke: var(--accent); }
  .pc-pin.in rect { stroke: #6fb7d6; }
  .pc-pin.nc { opacity: .45; }
  .pc-num { fill: var(--text); font: 700 10px var(--mono); }
  .pc-name { fill: var(--text-2); font: 600 9px var(--font); }
  .pc-pin.vcc .pc-name { fill: #ff8a84; } .pc-pin.gnd .pc-name { fill: #8fb5ff; } .pc-pin.out .pc-name { fill: #ffd08a; }
  .pc-name.ovl { text-decoration: overline; }
  .pc-lvl { font: 800 10px var(--mono); }
  .pc-lvl.h { fill: var(--green); } .pc-lvl.l { fill: #7f8ea3; } .pc-lvl.u { fill: var(--amber); } .pc-lvl.z { fill: #b48cff; }
  .pc-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .7rem; color: var(--text-3); }
  .pc-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; border: 1.5px solid; }
  .pc-legend .vcc::before { border-color: #ff5d55; background: #5a1d1d; } .pc-legend .gnd::before { border-color: #4f8cff; background: #1b2a4a; }
  .pc-legend .in::before { border-color: #6fb7d6; } .pc-legend .out::before { border-color: var(--accent); } .pc-legend .lv::before { display: none; }
  .chip-status:empty { display: none; }
  .gate-tt { display: grid; grid-template-columns: 74px auto 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; background: #0f141b; border: 1px solid var(--line); }
  .gt-svg { width: 74px; height: 52px; }
  .gt-sym { fill: rgba(255, 181, 71, .12); stroke: var(--accent); stroke-width: 2; }
  .gt-line { stroke: var(--accent); stroke-width: 2; fill: none; }
  .gate-tt table { border-collapse: collapse; font-family: var(--mono); font-size: .78rem; }
  .gate-tt th, .gate-tt td { padding: 2px 8px; text-align: center; border-bottom: 1px solid var(--line); }
  .gate-tt td.y { color: var(--accent); font-weight: 700; }
  .gate-tt p { font-size: .74rem; color: var(--text-3); }

  /* cihaz panelleri */
  .big-toggle { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; cursor: pointer; background: linear-gradient(180deg, #1c2430, #151b24); border: 1px solid var(--line-2); transition: all .18s; }
  .big-toggle .led { width: 12px; height: 12px; border-radius: 50%; background: #3b2626; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
  .big-toggle b { font-weight: 800; letter-spacing: .04em; }
  .big-toggle small { font-family: var(--mono); color: var(--text-3); font-size: .7rem; }
  .big-toggle:hover { border-color: #4a5a72; }
  .big-toggle.on { background: linear-gradient(180deg, #17402c, #10291d); border-color: #2f8a57; }
  .big-toggle.on .led { background: var(--green); box-shadow: 0 0 12px var(--green); }
  .dipsw { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
  .dipsw button { padding: 9px 6px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line-2); font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--mono); }
  .dipsw button small { font-size: .66rem; font-weight: 600; color: var(--text-3); }
  .dipsw button.on { background: rgba(61, 220, 132, .12); border-color: rgba(61, 220, 132, .5); color: #9cf5c6; }
  .dipsw button.on small { color: #6fd9a2; }
  .psu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .psu-ch { padding: 10px; border-radius: 10px; background: #0f141b; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .psu-ch h5 { display: flex; justify-content: space-between; font-size: .8rem; }
  .psu-ch .num-sl { flex-direction: column; align-items: stretch; }
  .psu-ch .num-sl input[type=number] { width: 100%; }
  .psu-disp { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 6px; padding: 8px 10px; border-radius: 8px; background: #070a0d; border: 1px solid #1f262f; }
  .psu-disp b { font: 700 1.35rem var(--mono); color: #ff5d4d; text-align: end; text-shadow: 0 0 8px rgba(255, 70, 50, .6); }
  .psu-disp b.g { color: #4cff8a; text-shadow: 0 0 8px rgba(70, 255, 130, .5); font-size: 1.05rem; }
  .psu-disp small { color: var(--text-3); font-family: var(--mono); }
  .cvcc { font: 800 .68rem var(--mono); padding: 1px 6px; border-radius: 5px; background: rgba(61, 220, 132, .15); color: #8ff0bb; }
  .cvcc.cc { background: rgba(255, 93, 85, .25); color: #ffb0ab; }
  .dmm-big { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .lcd-big { width: 100%; display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; padding: 12px 16px; border-radius: 12px; background: linear-gradient(180deg, #c8d4b6, #aebc98); box-shadow: inset 0 2px 6px rgba(0,0,0,.35); color: #1d2416; }
  .lcd-big b { font: 700 2.2rem var(--mono); letter-spacing: .02em; }
  .lcd-big small { font: 700 1rem var(--mono); }
  .dmm-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .dmm-modes button { padding: 8px 4px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); font-weight: 700; font-size: .74rem; }
  .dmm-modes button.on { background: var(--accent); color: #241500; border-color: var(--accent); }

  /* osiloskop */
  .scope-big { width: 100%; height: auto; border-radius: 10px; background: #050a0e; border: 1px solid #000; box-shadow: inset 0 0 30px rgba(0, 120, 160, .12); }
  .osc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .osc-ch { padding: 9px; border-radius: 10px; background: #0f141b; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .osc-ch h5 { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .78rem; }
  .osc-ch h5 .dim { font-size: .68rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .osc-ch.c1 { border-left: 3px solid #f5d327; } .osc-ch.c2 { border-left: 3px solid #3cc7f5; }
  .osc-ch select { width: 100%; }
  table.meas { width: 100%; border-collapse: collapse; font: .72rem var(--mono); }
  table.meas th { color: var(--text-3); font-weight: 600; text-align: end; padding: 3px; }
  table.meas td { text-align: end; padding: 4px 3px; border-top: 1px solid var(--line); }
  table.meas tr.c1 td:first-child { color: #f5d327; font-weight: 700; } table.meas tr.c2 td:first-child { color: #3cc7f5; font-weight: 700; }

  /* doğruluk tablosu */
  .tt-src { display: grid; grid-template-columns: 74px 64px 1fr; gap: 6px; align-items: center; padding: 3px 0; opacity: .6; }
  .tt-src.on { opacity: 1; }
  .tt-src .tt-name { width: 100%; font-family: var(--mono); font-weight: 700; text-align: center; padding: 4px; min-height: 28px; }
  .tt-src .tt-expr { width: 100%; font-family: var(--mono); padding: 4px 8px; min-height: 28px; }
  .tt-mv { display: flex; gap: 3px; }
  .tt-mv button { width: 26px; height: 26px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); }
  table.tt { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--mono); font-size: .84rem; margin-top: 4px; }
  table.tt th { position: sticky; top: 0; background: var(--surface-2); padding: 6px 4px; font-weight: 800; border-bottom: 1px solid var(--line-2); }
  table.tt th small { display: block; font-size: .6rem; color: var(--text-3); font-weight: 600; }
  table.tt th.out { color: var(--accent); }
  table.tt td { text-align: center; padding: 4px; border-bottom: 1px solid var(--line); }
  table.tt td.in { color: var(--text-2); }
  table.tt td.out { font-weight: 800; }
  table.tt td.b1.out { color: var(--green); }
  table.tt td.ok { background: rgba(61, 220, 132, .06); }
  table.tt td.bad { background: rgba(255, 93, 85, .22); color: #fff !important; }
  table.tt td small { font-size: .62rem; color: var(--text-3); margin-left: 4px; }
  table.tt tr.cur td { background: rgba(255, 181, 71, .14); }
  table.tt tr.anim td { background: rgba(79, 209, 255, .22); }
  .tt-sum { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
  .tt-sum h5 { font: 700 .95rem var(--mono); color: var(--accent); }
  table.kmap { border-collapse: collapse; font-family: var(--mono); font-size: .8rem; align-self: flex-start; }
  table.kmap th { color: var(--text-3); font-weight: 600; padding: 4px 8px; }
  table.kmap th.corner { font-size: .7rem; }
  table.kmap td { width: 40px; height: 34px; text-align: center; border: 1px solid var(--line-2); font-weight: 800; position: relative; }
  table.kmap td.b1 { background: rgba(255, 181, 71, .18); color: var(--accent); }
  table.kmap td small { position: absolute; right: 3px; bottom: 1px; font-size: .55rem; color: var(--text-3); font-weight: 500; }

  /* zamanlama */
  .timing { width: 100%; height: auto; background: #0a0f15; border-radius: 10px; border: 1px solid var(--line); }
  .tm-grid { stroke: #1d2735; stroke-width: 1; }
  .tm-t { fill: var(--text-3); font: 9px var(--mono); }
  .tm-l { fill: var(--text-2); font: 700 10px var(--mono); }
  .tm-w { fill: none; stroke-width: 1.8; }
  .tm-w.clk { stroke: #ffcf3a; } .tm-w.sw { stroke: var(--cyan); } .tm-w.led { stroke: #ff6b5e; }

  /* deneyler */
  .exp-list { display: flex; flex-direction: column; gap: 8px; }
  .exp-card { text-align: start; display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: border-color .12s, transform .12s; position: relative; }
  .exp-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
  .exp-card .no, .exp-head .no { font: 800 .68rem var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
  .exp-card b { font-size: .92rem; }
  .exp-card small { color: var(--text-3); font-size: .76rem; }
  .exp-card .tag { position: absolute; top: 11px; right: 12px; font-size: .66rem; font-weight: 700; color: #8ff0bb; background: rgba(61, 220, 132, .12); padding: 2px 7px; border-radius: 999px; }
  .back { align-self: flex-start; font-weight: 700; color: var(--text-2); padding: 4px 6px; border-radius: 6px; }
  .back:hover { color: var(--text); background: var(--surface); }
  .exp-head h3 { font-size: 1.1rem; font-weight: 800; }
  .chips { display: flex; flex-wrap: wrap; gap: 5px; }
  .chips span { font-size: .72rem; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
  .exp-imgs { display: grid; gap: 10px; }
  .exp-imgs figure { background: #fff; border-radius: 10px; padding: 8px; cursor: zoom-in; }
  .exp-imgs figcaption { color: #444; font-size: .72rem; text-align: center; margin-top: 4px; }
  .theory { font-family: var(--mono); font-size: .78rem !important; line-height: 1.7; color: #d5dde8 !important; }
  details.qa { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--bg-2); }
  details.qa summary { cursor: pointer; font-weight: 700; font-size: .82rem; }
  details.qa p { margin-top: 6px; }
  .tbl-wrap { overflow-x: auto; }
  table.exp-tbl { width: 100%; border-collapse: collapse; font-size: .76rem; }
  table.exp-tbl th { padding: 4px; color: var(--text-2); font-weight: 700; text-align: center; white-space: nowrap; }
  table.exp-tbl th.sub { font-size: .66rem; color: var(--text-3); font-weight: 600; }
  table.exp-tbl tbody th { text-align: start; white-space: nowrap; }
  table.exp-tbl td { padding: 3px; border-top: 1px solid var(--line); text-align: center; }
  td.calc { font-family: var(--mono); color: #c6efff; }
  td.meas-c { display: flex; gap: 3px; align-items: center; }
  td.meas-c input { width: 64px; padding: 3px 5px !important; min-height: 26px !important; font-family: var(--mono); text-align: end; }
  .grab { font: 800 .6rem var(--mono); padding: 4px 5px; border-radius: 5px; background: rgba(255, 181, 71, .14); color: var(--accent); border: 1px solid rgba(255, 181, 71, .35); }
  .grab:hover { background: rgba(255, 181, 71, .28); }
  td.err { font-family: var(--mono); font-weight: 700; }
  td.err.good { color: var(--green); } td.err.mid { color: var(--amber); } td.err.bad { color: var(--red); }
  .warn-t { color: var(--red); font-size: .66rem; }

  /* uyarılar */
  .diag { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 10px; border-radius: 9px; font-size: .8rem; border: 1px solid var(--line); background: var(--bg-2); }
  .diag[data-selpart] { cursor: pointer; }
  .diag[data-selpart]:hover { border-color: var(--line-2); }
  .diag.err { border-color: rgba(255, 93, 85, .4); background: rgba(255, 93, 85, .07); }
  .diag.warn { border-color: rgba(255, 201, 74, .3); background: rgba(255, 201, 74, .05); }
  .empty-state { text-align: center; padding: 18px 8px; }
  .empty-state .big { font-size: 2.2rem; color: var(--green); }

  /* durum çubuğu */
  #status b { color: var(--text); }
  #status .volt { font-family: var(--mono); color: var(--cyan); font-weight: 700; }
  #status .hi { color: var(--green); font-weight: 800; } #status .lo { color: #8d9bb0; font-weight: 800; } #status .und { color: var(--amber); font-weight: 800; }
  #status .err { color: var(--red); font-weight: 700; }
  #simInfo { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: .72rem; color: var(--text-3); }
  .pulse { width: 8px; height: 8px; border-radius: 50%; background: #3a4352; }
  .pulse.on { background: var(--green); box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: ring 1.6s infinite; }
  @keyframes ring { 70% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

  /* bildirim */
  #toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; align-items: center; }
  .toast { pointer-events: none; max-width: min(560px, 90vw); padding: 10px 16px; border-radius: 11px; background: rgba(22, 29, 39, .96); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: .84rem; backdrop-filter: blur(8px); animation: tin .22s ease-out; }
  .toast.warn { border-color: rgba(255, 201, 74, .5); color: #ffe6a8; }
  .toast.err { border-color: rgba(255, 93, 85, .6); color: #ffd0cd; background: rgba(48, 18, 18, .96); }
  .toast.ok { border-color: rgba(61, 220, 132, .5); color: #c4f7da; }
  .toast.out { opacity: 0; transform: translateY(-6px); transition: all .35s; }
  @keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

  /* modal */
  #modal { position: fixed; inset: 0; background: rgba(4, 7, 11, .7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 60; padding: 20px; }
  #modal[hidden] { display: none; }
  .modal-card { position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .18s ease-out; }
  .modal-card.wide { width: min(820px, 100%); }
  .modal-x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 8px; font-size: 1.3rem; color: var(--text-3); }
  .modal-x:hover { background: var(--surface-2); color: var(--text); }
  .modal-body { display: flex; flex-direction: column; gap: 14px; }
  .modal-body h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
  .modal-body .lead { color: var(--text-2); font-size: .95rem; }
  .help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
  .help-grid > div { padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
  .help-grid h4 { font-size: .86rem; margin-bottom: 4px; color: var(--accent); }
  .help-grid p { font-size: .8rem; color: var(--text-2); }
  .keys { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .8rem; color: var(--text-2); }
  .modal-body .btn.primary { align-self: flex-end; padding: 10px 20px; font-size: .9rem; }
  .zoom-img { background: #fff; border-radius: 10px; padding: 10px; margin: 0 auto; }
  .modal-body pre { font-family: var(--mono); font-size: .8rem; }
}

/* ---------------------------------------------------------------- SVG dünya */
@layer world {
  #world text { font-family: var(--font); }
  .bb-holes { fill: #2b2b2b; }
  .bb-num { font: 600 8px var(--mono); fill: #9a9488; }
  .bb-let { font: 700 9px var(--mono); fill: #9a9488; }
  .bb-sign { font: 900 14px var(--font); }
  .bb-sign.n { fill: #2f6fd6; } .bb-sign.p { fill: #d63b3b; }
  .tr-brand { font: 800 15px var(--font); fill: #e9eef4; letter-spacing: .02em; }
  .tr-model { fill: #ffb547; }
  .tr-sub { font-weight: 600; fill: #9fb3c8; font-size: 12px; letter-spacing: .12em; }
  .tr-sub2 { font: 700 10px var(--mono); fill: #7f93aa; letter-spacing: .08em; }
  .tr-box { fill: rgba(9, 15, 22, .35); stroke: rgba(159, 179, 200, .35); stroke-width: 1.2; }
  .tr-title { font: 800 9.5px var(--font); fill: #9fb3c8; letter-spacing: .12em; }
  .tr-sockbase { fill: #ece9e1; stroke: #b9b4a8; stroke-width: .8; }
  .silk { font: 600 9px var(--font); fill: #d7e1ec; }
  .silk.small { font-size: 7.5px; fill: #9fb3c8; }
  .silk.bold { font-weight: 800; font-size: 10px; }
  .gate-sym { fill: rgba(255, 255, 255, .05); stroke: #e6edf5; stroke-width: 1.4; }
  .gate-line { stroke: #9fb3c8; stroke-width: 1.2; }
  .tr-plate rect { fill: rgba(0,0,0,.25); stroke: rgba(255, 181, 71, .35); }
  .tr-plate-t { font: 800 22px var(--font); fill: #ffb547; letter-spacing: .06em; }
  .tr-plate-s { font: 700 8.5px var(--mono); fill: #9fb3c8; }
  .ind-led { fill: #3a3a3a; }
  .tr-led { transition: fill .05s; }
  .sbtn rect { fill: #3a4452; stroke: #0b0f14; stroke-width: 1; transition: fill .12s; }
  .sbtn text { font: 800 9px var(--font); fill: #e6edf5; pointer-events: none; }
  .sbtn:hover rect { fill: #4a5666; }
  .sbtn rect.on { fill: #ffb547; }
  .sbtn rect.on + text { fill: #2a1700; }
  .psu-out rect.on { fill: #3ddc84; }
  [data-act] { cursor: pointer; }
  .knob, .knob-drag { cursor: ns-resize; }
  .lswitch:hover rect:first-child { stroke: #ffb547; }
  .rocker { cursor: pointer; }
  .inst-brand { font: 800 10px var(--font); fill: #e6edf5; letter-spacing: .04em; }
  .inst-brand.dark { fill: #2a2f36; }
  .inst-l { font: 700 8.5px var(--font); fill: #c9d2dc; letter-spacing: .06em; }
  .inst-l.dark { fill: #3a414a; }
  .inst-l.small { font-size: 7.5px; }
  .inst-l.warn { fill: #ff5d55; font-weight: 900; }
  .segd { font: 700 26px var(--mono); }
  text.segd.red { fill: #ff4f3f; filter: drop-shadow(0 0 4px rgba(255, 70, 50, .7)); }
  text.segd.green { fill: #49ff86; font-size: 22px; filter: drop-shadow(0 0 4px rgba(70, 255, 130, .6)); }
  .seg-u { font: 700 11px var(--mono); fill: #888; }
  .cvcc { font: 800 9px var(--mono); fill: #2f8a57; }
  text.cvcc.cc { fill: #ff3b2f; }
  .lcd { font: 700 34px var(--mono); fill: #1d2416; }
  .lcd-u { font: 700 11px var(--mono); fill: #1d2416; }
  .lcd-f { font: 700 8px var(--mono); fill: #2e3a22; }
  .dmm-ml { font: 800 9px var(--font); fill: #f2c230; }
  .dmm-ml.off { fill: #9aa3ad; }
  .dmm-pos:hover .dmm-ml { fill: #fff; }
  .blcd { font: 700 11px var(--mono); fill: #9fe0ff; }
  .blcd.big { font-size: 17px; fill: #d6f3ff; }
  .blcd.small { font-size: 9px; fill: #7fc4e6; }
  .osc-ch1 rect { fill: #5a4d10; } .osc-ch2 rect { fill: #10495a; }
  .sc-grid { stroke: rgba(120, 160, 190, .16); stroke-width: 1; }
  .sc-grid.c { stroke: rgba(120, 160, 190, .32); }
  .sc-tick { stroke: rgba(120, 160, 190, .35); stroke-width: 1; }
  .sc-txt { font: 600 9.5px var(--mono); fill: #bfe9ff; }
  .scope-big .sc-txt { font-size: 11px; }
  .jack { cursor: default; }

  /* parçalar */
  .lead { stroke: #c3c9d0; stroke-linecap: round; }
  .lead-end { fill: #d7dce2; stroke: #8a929b; stroke-width: .8; }
  .part { cursor: grab; }
  .part.sel, .wire.sel { filter: drop-shadow(0 0 3px #ffb547) drop-shadow(0 0 6px rgba(255, 181, 71, .6)); }
  .part.bad { opacity: .55; }
  .part-tag { font: 700 9px var(--mono); fill: #2b2b2b; paint-order: stroke; stroke: rgba(255,255,255,.75); stroke-width: 2.5px; }
  .part-tag.light { fill: #e6edf5; stroke: rgba(0,0,0,.6); }
  .part-code { font: 700 7.5px var(--mono); fill: #3b1d05; }
  .part-code.light { fill: #e6edf5; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: 2px; }
  .ic-body { fill: #1c1d20; }
  .ic-pin { fill: #c9ced4; stroke: #7e868f; stroke-width: .6; }
  .ic-label { font: 700 10.5px var(--mono); fill: #d4d7db; letter-spacing: .02em; }
  .ic-sub { font: 600 7px var(--mono); fill: #85898f; }
  .ic-pinlab { font: 700 7px var(--mono); fill: #ffd08a; }
  .ic-pinlab.vcc { fill: #ff8a84; } .ic-pinlab.gnd { fill: #8fb5ff; }
  .ic-pinlab.ovl { text-decoration: overline; }
  .led-pol { font: 900 8px var(--font); fill: #fff; opacity: .7; }
  .seg7-lab { font: 700 7px var(--mono); fill: #777; }
  .dip-on { font: 800 7px var(--font); fill: #fff; }
  .dip-num { font: 700 6.5px var(--mono); fill: #fff; }
  .burnt .body, .part.burnt .ic-body { fill: #2a1a12; }
  .part.burnt { filter: saturate(.2) brightness(.6); }
  .burnt-tag { font: 900 9px var(--font); fill: #ff5d55; letter-spacing: .1em; paint-order: stroke; stroke: #000; stroke-width: 3px; }
  .smoke .puff { fill: rgba(200, 200, 200, .5); animation: smoke 2.4s infinite ease-out; transform-box: fill-box; transform-origin: center; }
  .smoke .p2 { animation-delay: .8s; } .smoke .p3 { animation-delay: 1.6s; }
  @keyframes smoke { from { opacity: .7; transform: translate(0, 0) scale(.5); } to { opacity: 0; transform: translate(6px, -40px) scale(2.2); } }
  .ghost { opacity: .72; pointer-events: none; }
  .ghost.bad { opacity: .5; filter: drop-shadow(0 0 4px #ff3b2f) saturate(.4); }
  .pressable { cursor: pointer; }

  /* kablolar */
  .wire { cursor: pointer; }
  .w-hit { fill: none; stroke: transparent; stroke-linecap: round; }
  .lead-g { pointer-events: none; }
  .lead-g .lead-tip { pointer-events: all; cursor: grab; }

  /* kaplama */
  #L-over * { pointer-events: none; }
  #L-over .w-handle { pointer-events: all; cursor: move; fill: #ffb547; stroke: #2a1700; stroke-width: 2; }
  .w-bend { fill: #fff; stroke: #ffb547; stroke-width: 2; }
  .hl-group { fill: rgba(79, 209, 255, .14); stroke: #4fd1ff; stroke-width: 1.5; }
  .hl-hole { fill: #4fd1ff; }
  .hl-point { fill: none; stroke: #ffb547; stroke-width: 2.5; }
  #L-fx { pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  .smoke .puff, .pulse.on, .pill.err { animation: none; }
  .menu.open, .modal-card, .toast { animation: none; }
}
@layer world {
  .psu .silk { fill: #3a414a; }
  .psu .silk.small { fill: #5a626c; }
}
@layer world {
  .fg-wbtn text { font-size: 14px; }
}
@layer components {
  details.more summary { cursor: pointer; font-size: .76rem; color: var(--text-3); font-weight: 700; padding: 4px 0; }
  details.more[open] summary { margin-bottom: 4px; }
}
@layer world {
  .silk { font-family: var(--mono); font-weight: 700; letter-spacing: .02em; }
}
@layer components {
  .pc-name { font: 700 8.5px var(--mono); }
}
@layer layout {
  .seg button, .power, .brand-t, .tb-label { white-space: nowrap; }
  #wireColors { flex-wrap: nowrap; }
  @media (max-width: 1520px) {
    .brand-t span, #kindSeg small { display: none; }
    #topbar { gap: 10px; }
    #wireColors .sw { width: 16px; height: 16px; }
  }
  @media (max-width: 1320px) {
    :root { --left: 228px; --right: 352px; }
    .tb-label { display: none; }
    #awg { max-width: 92px; }
    .power .pw-t { display: none; }
    .power { padding: 7px 10px; }
  }
  @media (max-width: 1100px) {
    .brand-t { display: none; }
    #wireColors .sw:nth-child(n+7) { display: none; }
  }
}
@layer layout {
  @media (max-width: 1520px) { :root { --left: 244px; --right: 368px; } }
}
@layer components {
  #tabs { flex-wrap: wrap; row-gap: 0; }
  #tabs button { padding: 7px 9px 8px; }
}

/* ---------------------------------------------------------------- K&H eğitim seti */
@layer world {
  .kh .tr-sockbase { fill: #f4f2ec; stroke: #7f9cbc; }
  .kh-box { fill: rgba(255, 255, 255, .12); stroke: #1d4f86; stroke-width: 1.1; }
  .kh-title { font: 800 9px var(--font); fill: #0c2d5a; letter-spacing: .1em; }
  .kh-l { font: 700 8.5px var(--mono); fill: #0c2d5a; }
  .kh-l.b { font-weight: 800; }
  .kh-s { font: 700 7px var(--mono); fill: #2a5687; }
  .kh-xs { font: 700 6.2px var(--mono); fill: #2a5687; }
  .kh-brand { font: 900 15px var(--font); fill: #0c2d5a; letter-spacing: .08em; }
  .kh-brand.sm { font-size: 11px; }
  .kh-line { stroke: #1d4f86; stroke-width: 1.2; fill: none; }
  .kh-gate { fill: rgba(255, 255, 255, .55); stroke: #0c2d5a; stroke-width: 1.4; }
  .kh-seg { font: 700 26px var(--mono); fill: #ff3b2f; filter: drop-shadow(0 0 4px rgba(255, 60, 40, .75)); }
  .kh-logo-t { font: 900 10px var(--font); fill: #fff; }
  .kh-model { font: 900 17px var(--font); fill: #0c2d5a; letter-spacing: .02em; }
  .kh-model-s { font-weight: 800; font-size: 11px; letter-spacing: .12em; }
  .kh-spk { font-size: 11px; }
  .kh .sbtn rect { fill: #1d4f86; stroke: #0b2747; }
  .kh .sbtn:hover rect { fill: #2a64a3; }
  .kh .sbtn rect.on { fill: #ffb547; }
  .kh .sbtn.wave text { font-size: 13px; }
  .kh .lswitch:hover rect:first-child { stroke: #ffb547; }
  .kh .ind-led { stroke: #0b2747; stroke-width: 1; }
}

/* ---------------------------------------------------------------- datasheet */
@layer components {
  .ds { display: flex; flex-direction: column; gap: 9px; }
  .ds-head { display: flex; flex-direction: column; gap: 6px; }
  .ds-part { font: 800 1.15rem var(--mono); color: var(--accent); margin-right: 8px; }
  .ds-desc { font-weight: 700; color: var(--text); }
  .ds-tags { display: flex; flex-wrap: wrap; gap: 5px; }
  .ds-tags span { font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
  .ds h5 { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-top: 4px; }
  .ds h5 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
  table.ds-ft, table.ds-kv { width: 100%; border-collapse: collapse; font: .76rem var(--mono); }
  table.ds-ft th { background: var(--surface-2); padding: 5px 6px; color: var(--text-2); font-weight: 700; border-bottom: 1px solid var(--line-2); }
  table.ds-ft td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--line); }
  table.ds-ft td.h { color: var(--green); font-weight: 800; } table.ds-ft td.l { color: #8d9bb0; font-weight: 800; }
  table.ds-kv td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
  table.ds-kv td:first-child { color: var(--text-2); font-family: var(--font); }
  table.ds-kv td:last-child { text-align: end; color: var(--text); }
  .ds-notes { padding-left: 18px; color: var(--text-2); font-size: .8rem; display: flex; flex-direction: column; gap: 4px; }
  .modal-card .ds .pincard { max-width: 560px; align-self: center; }
  .pc-wire { fill: none; stroke: #b9c4d2; stroke-width: 1.4; }
  .pc-gate { fill: rgba(255, 181, 71, .1); stroke: var(--accent); stroke-width: 1.6; }
  .cat-list { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; }
  .cat-it { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; text-align: start; padding: 6px 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-size: .78rem; }
  .cat-it:hover { border-color: var(--line-2); background: var(--surface-2); }
  .cat-it b { font-family: var(--mono); color: var(--accent); }
  .cat-it span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cat-it i { font-style: normal; font-size: .66rem; color: var(--text-3); font-family: var(--mono); }
  .insp input[type=search] { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 9px; min-height: 32px; color: var(--text); width: 100%; }
}
@layer components {
  .exp-sec { gap: 8px; }
  .exp-sec p { color: var(--text-2); font-size: .82rem; line-height: 1.55; }
  .exp-sec h5 { font-size: .84rem; color: var(--text); margin-top: 6px; }
  .exp-sec ul, .exp-sec ol { padding-left: 18px; color: var(--text-2); font-size: .82rem; display: flex; flex-direction: column; gap: 4px; }
  .exp-sec .eq { font-family: var(--mono); font-size: .8rem; color: #c6efff; padding: 6px 10px; border-radius: 8px; background: #0f141b; border: 1px solid var(--line); display: block; overflow-x: auto; }
  table.tt-s { width: 100%; border-collapse: collapse; font: .78rem var(--mono); }
  table.tt-s th { background: var(--surface-2); padding: 4px 6px; border-bottom: 1px solid var(--line-2); color: var(--text-2); }
  table.tt-s th.out { color: var(--accent); }
  table.tt-s td { padding: 3px 6px; text-align: center; border-bottom: 1px solid var(--line); }
  table.tt-s td.b1 { color: var(--green); font-weight: 800; }
  table.tt-s td.b0 { color: #8d9bb0; }
  table.tt-s td.note { text-align: start; color: var(--text-3); font-family: var(--font); }
  .exp-sec .row-btns .btn { padding: 5px 9px; font-size: .74rem; }
  .pins-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
  .pins-mini div { padding: 7px 9px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-size: .76rem; color: var(--text-2); }
  .pins-mini b { color: var(--accent); font-family: var(--mono); }
  .warn-box { padding: 9px 11px; border-radius: 9px; background: rgba(255, 201, 74, .08); border: 1px solid rgba(255, 201, 74, .35); color: #ffe6a8; font-size: .8rem; }
}
@layer components {
  .exp-sec table.tt-s { display: block; overflow-x: auto; max-width: 100%; }
  .exp-sec table.tt-s th, .exp-sec table.tt-s td { white-space: nowrap; font-size: .74rem; padding: 3px 5px; }
  .exp-sec .warn-box, .exp-sec .eq { overflow-wrap: anywhere; }
}
@layer world { .to92-lab { font: 700 6.5px var(--mono); fill: #d4d7db; } }

/* ---------------------------------------------------------------- şematik */
@layer world {
  body[data-kind="schem"] #world { background: #f7f8f6; }
  .sy { cursor: grab; color: #14213d; }
  .sy.act { cursor: pointer; }
  .sy-l, .sy-o { stroke: #14213d; stroke-width: 1.5; fill: none; stroke-linecap: round; }
  .sy-l.thick { stroke-width: 2.8; }
  .sy-l.sw { stroke-width: 2; }
  .sy-b { fill: #fff; stroke: #14213d; stroke-width: 1.5; }
  .sy-b.inst { fill: #eaf1f8; }
  .sy-b.dark { fill: #1c1c1e; }
  .sy-b.hi { fill: #3ddc84; } .sy-b.lo { fill: #cfd6de; } .sy-b.und { fill: #ffc94a; }
  .sy-f, .sy-d { fill: #14213d; }
  .sy-t { font: 700 9px var(--mono); fill: #14213d; }
  .sy-t.big { font-size: 12px; }
  .sy-s { font: 700 7.5px var(--mono); fill: #334; }
  .sy-xs { font: 700 6.5px var(--mono); fill: #334; }
  .sy-xs.dim { fill: #8a94a6; font-weight: 500; }
  .sy-ref { font: 700 9px var(--mono); fill: #1a5fb4; pointer-events: none; }
  .sy-gsym { fill: #fff; stroke: #14213d; stroke-width: 1.5; }
  .sy-pin { fill: transparent; stroke: none; cursor: crosshair; }
  .sy-pin:hover { fill: rgba(255, 181, 71, .6); }
  .sy.sel > g > * { filter: drop-shadow(0 0 2px #ffb547) drop-shadow(0 0 5px rgba(255, 181, 71, .7)); }
  .sy.burnt > g { opacity: .45; }
  .sy-lcd { fill: #dfe9d2; stroke: #334; }
  .sy-lcd-t { font: 700 8px var(--mono); fill: #111; }
  .sy-screen { fill: #0a141c; }
  .sy-trace { fill: none; stroke-width: 1.2; pointer-events: none; }
  .sy-probe { stroke: #14213d; stroke-width: 1; }
  .sw { cursor: pointer; }
  .sw-hit { fill: none; stroke: transparent; stroke-width: 12; }
  .sw-l { fill: none; stroke: #1a3f8f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sw:hover .sw-l { stroke: #2f6fd6; stroke-width: 2.4; }
  .sw.sel .sw-l { stroke: #ff8f3d; stroke-width: 2.6; }
  .sw-j { fill: #1a3f8f; }
  .sw-prev { fill: none; stroke: #ff8f3d; stroke-width: 2; stroke-dasharray: 6 4; }
  .sel-box { fill: rgba(79, 209, 255, .12); stroke: #4fd1ff; stroke-dasharray: 4 3; }
  body[data-kind="schem"] .hl-point { stroke: #ff8f3d; }
}
@layer components {
  .sym-ic { width: 40px; height: 40px; flex: none; padding: 3px; border-radius: 8px; background: #f7f8f6; box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.4); }
  .sym-ic .sy { color: #14213d; }
  .graph { background: #0a0f15; }
  .g-bg { fill: #0d141c; }
  .g-line { fill: none; stroke-width: 1.6; }
  .graph-leg { display: flex; flex-wrap: wrap; gap: 10px; font: .74rem var(--mono); color: var(--text-2); }
  .graph-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
  tr.clk { cursor: pointer; } tr.clk:hover td { background: var(--surface-2); }
}
@layer components {
  .ce-grid { display: flex; gap: 10px; }
  .ce-grid .fld.grow { flex: 1; }
  .modal-body textarea { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 9px; color: var(--text); font: .82rem var(--mono); resize: vertical; }
  .modal-body input[type=text] { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 9px; min-height: 32px; color: var(--text); }
  .setups { display: flex; flex-direction: column; gap: 6px; }
  .setup-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; }
  .row-btns.end { justify-content: flex-end; }
}
@layer components {
  .ad-slot { flex: none; min-height: 100px; margin: 8px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; }
  .ad-slot[hidden] { display: none; }
  .foot-links { display: flex; gap: 12px; margin-left: 14px; }
  .foot-links a { color: var(--text-3); text-decoration: none; font-size: .72rem; }
  .foot-links a:hover { color: var(--text); }
  .auth { display: flex; flex-direction: column; gap: 14px; }
  .auth-brand { display: flex; gap: 14px; align-items: center; }
  .auth-brand .logo { width: 52px; height: 52px; flex: none; }
  .auth-brand .logo svg { width: 30px; height: 30px; }
  .auth-brand h2 { font-size: 1.5rem; }
  .auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 10px; }
  .auth-tabs button { flex: 1; padding: 8px; border-radius: 8px; font-weight: 700; color: var(--text-3); }
  .auth-tabs button.on { background: var(--surface-3); color: var(--text); }
  #authForm { display: flex; flex-direction: column; gap: 10px; }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  .auth-err { padding: 8px 10px; border-radius: 8px; background: rgba(255, 93, 85, .12); border: 1px solid rgba(255, 93, 85, .4); color: #ffcbc8; font-size: .82rem; }
  .dim.small { font-size: .74rem; }
  #modal.auth-mode .modal-x { display: none; }
  #btnUser.on { color: var(--green); border-color: rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .1); }
}
@layer layout {
  .mob-bar { display: none; }
  @media (max-width: 900px) {
    body { grid-template-columns: 1fr; grid-template-rows: 54px 1fr 28px; grid-template-areas: "top" "stage" "st"; }
    #palette, #panel { display: flex; position: fixed; top: 54px; bottom: 28px; width: min(86vw, 360px); z-index: 20; box-shadow: 0 0 40px rgba(0,0,0,.6); transition: transform .2s; }
    #palette { left: 0; transform: translateX(-100%); }
    #panel { right: 0; transform: translateX(100%); }
    body.drawer-left #palette { transform: none; }
    body.drawer-right #panel { transform: none; }
    .mob-bar { display: flex; position: absolute; left: 10px; bottom: 10px; gap: 6px; z-index: 5; }
    .mob-bar button { padding: 8px 12px; border-radius: 10px; background: rgba(13, 17, 23, .85); border: 1px solid var(--line-2); color: var(--text); font-weight: 700; font-size: .8rem; backdrop-filter: blur(8px); }
    .zoom-ctl { bottom: 56px; }
    #topbar { gap: 6px; padding: 0 8px; overflow-x: auto; }
    #wireTool { display: flex; }
    .seg button { padding: 6px 8px; font-size: .76rem; }
    .brand-t { display: none; }
    #world { touch-action: none; }
  }
}

/* ---------------------------------------------------------------- giriş / üyelik ekranı */
@layer components {
  #authScreen { position: fixed; inset: 0; z-index: 100; background: radial-gradient(1200px 700px at 15% 20%, #1a2436 0%, #0d1117 55%, #0a0d12 100%); color: var(--text); overflow: auto; animation: auIn .35s ease-out; }
  #authScreen.out { animation: auOut .35s ease-in forwards; }
  @keyframes auIn { from { opacity: 0; } }
  @keyframes auOut { to { opacity: 0; transform: scale(1.02); } }
  body.auth-open { overflow: hidden; }
  .au-wrap { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
  .au-left { position: relative; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
  .au-left::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 181, 71, .08), transparent 40%), linear-gradient(315deg, rgba(79, 209, 255, .07), transparent 45%); pointer-events: none; }
  .au-brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
  .au-brand .logo { width: 40px; height: 40px; }
  .au-left h1 { font-size: clamp(2.2rem, 4.2vw, 3.6rem); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; margin-top: 12px; }
  .au-left h1 span { background: linear-gradient(90deg, #ffb547, #ff6a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .au-left > p { color: var(--text-2); font-size: 1.05rem; max-width: 46ch; }
  .au-art { width: min(100%, 520px); height: auto; margin: 6px 0; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .45)); }
  .au-dots circle { fill: #2a3546; }
  .au-trace { fill: none; stroke: #2f3d52; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 6 540; animation: auFlow 4s linear infinite; }
  @keyframes auFlow { 0% { stroke: #2f3d52; stroke-dasharray: 0 540; stroke-dashoffset: 0; } 20% { stroke: #ffb547; } 100% { stroke: #2f3d52; stroke-dasharray: 540 0; stroke-dashoffset: -540; } }
  .au-chip rect:first-child { fill: #1c1d20; stroke: #3a3d42; }
  .au-chip rect { fill: #c9ced4; }
  .au-chip text { font: 700 11px var(--mono); fill: #d4d7db; }
  .au-led { fill: #4a1010; animation: auLed 2s infinite; }
  .au-led-glow { fill: url(#auGlow); opacity: 0; animation: auLedGlow 2s infinite; }
  @keyframes auLed { 0%, 100% { fill: #4a1010; } 40%, 60% { fill: #ff3b2f; } }
  @keyframes auLedGlow { 0%, 100% { opacity: 0; } 40%, 60% { opacity: .9; } }
  .au-wave { fill: none; stroke: #4fd1ff; stroke-width: 2; stroke-dasharray: 800; animation: auWave 3s linear infinite; opacity: .8; }
  @keyframes auWave { from { stroke-dashoffset: 800; } to { stroke-dashoffset: 0; } }
  .au-res rect:first-child { fill: #e3cc9c; }
  .au-feats { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-2); font-size: .9rem; margin-top: auto; }
  .au-feats li { display: flex; align-items: center; gap: 8px; }
  .au-feats i { font-style: normal; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
  .au-right { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: clamp(20px, 4vw, 48px); }
  .au-card { width: min(100%, 440px); padding: 28px; border-radius: 22px; background: rgba(22, 29, 39, .72); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06); backdrop-filter: blur(18px); animation: auCard .45s ease-out; }
  @keyframes auCard { from { opacity: 0; transform: translateY(14px); } }
  .au-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: rgba(13, 17, 23, .8); margin-bottom: 18px; }
  .au-tabs button { position: relative; z-index: 1; padding: 9px; font-weight: 700; color: var(--text-3); border-radius: 9px; transition: color .2s; }
  .au-tabs button.on { color: var(--text); }
  .au-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--surface-3); transition: transform .25s cubic-bezier(.4, 0, .2, 1); }
  .au-ind.login { transform: translateX(100%); }
  .au-card h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
  .au-sub { color: var(--text-3); margin: 2px 0 16px; font-size: .9rem; }
  #authForm { display: flex; flex-direction: column; gap: 12px; }
  .au-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .au-f { position: relative; display: block; }
  .au-f input, .au-f select { width: 100%; padding: 20px 14px 8px; min-height: 52px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; appearance: none; }
  .au-f input:focus, .au-f select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
  .au-f > span { position: absolute; left: 14px; top: 16px; color: var(--text-3); font-size: .9rem; pointer-events: none; transition: all .15s; }
  .au-f input:focus + span, .au-f input:not(:placeholder-shown) + span { top: 7px; font-size: .68rem; color: var(--accent); font-weight: 700; letter-spacing: .03em; }
  .au-f input:user-invalid { border-color: var(--red); }
  .au-sel select { padding: 14px 14px; }
  .au-pw input { padding-right: 46px; }
  .au-eye { position: absolute; right: 10px; top: 14px; width: 26px; height: 26px; color: var(--text-3); }
  .au-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .au-eye:hover { color: var(--text); }
  .au-strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin-top: -4px; }
  .au-strength i { height: 4px; border-radius: 2px; background: var(--line-2); transition: background .2s; }
  .au-strength small { color: var(--text-3); font-size: .7rem; margin-left: 6px; }
  .au-strength[data-score="1"] i:nth-child(-n+1) { background: var(--red); }
  .au-strength[data-score="2"] i:nth-child(-n+2) { background: var(--amber); }
  .au-strength[data-score="3"] i:nth-child(-n+3) { background: #7bd3ff; }
  .au-strength[data-score="4"] i:nth-child(-n+4) { background: var(--green); }
  .au-chk { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--text-2); cursor: pointer; line-height: 1.45; }
  .au-chk input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
  .au-chk a { color: var(--cyan); }
  .au-err { padding: 9px 12px; border-radius: 10px; background: rgba(255, 93, 85, .12); border: 1px solid rgba(255, 93, 85, .4); color: #ffcbc8; font-size: .82rem; }
  .au-err.shake { animation: auShake .4s; }
  @keyframes auShake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
  .au-btn { margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 12px; font-weight: 800; font-size: .95rem; color: #2a1700; background: linear-gradient(135deg, #ffc462, #ff8a3d); box-shadow: 0 10px 28px rgba(255, 150, 60, .3); transition: transform .12s, box-shadow .12s, filter .12s; }
  .au-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
  .au-btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 32px rgba(255, 150, 60, .38); }
  .au-btn:hover svg { transform: translateX(4px); }
  .au-btn:disabled { opacity: .7; cursor: progress; }
  .au-btn.busy span::after { content: '…'; }
  .au-switch { text-align: center; color: var(--text-3); font-size: .85rem; margin-top: 16px; }
  .au-switch a { color: var(--accent); font-weight: 700; }
  .au-note { margin-top: 10px; font-size: .72rem; color: var(--text-3); text-align: center; }
  .au-foot { color: var(--text-3); font-size: .75rem; }
  .au-foot a { color: var(--text-3); }
  @media (max-width: 900px) {
    .au-wrap { grid-template-columns: 1fr; }
    .au-left { padding: 24px 20px 8px; min-height: 0; }
    .au-left h1 { font-size: 2rem; }
    .au-art { display: none; }
    .au-feats { display: none; }
    .au-right { padding: 12px 16px 28px; }
    .au-card { padding: 20px; }
    .au-row { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: reduce) { .au-trace, .au-led, .au-led-glow, .au-wave { animation: none; } }
}
@layer components {
  .au-wrap { min-height: 100%; align-items: stretch; }
  .au-left { justify-content: center; }
  .au-art { width: min(100%, 440px); max-height: 38vh; }
  .au-feats { margin-top: 10px; }
  .au-right { justify-content: center; }
  .au-card { max-height: calc(100vh - 60px); overflow: auto; scrollbar-width: thin; }
  .au-card h2 { margin-top: 2px; }
  #authForm { gap: 10px; }
  .au-f input, .au-f select { min-height: 48px; padding-top: 18px; }
  .au-f > span { top: 14px; }
  .au-f input:focus + span, .au-f input:not(:placeholder-shown) + span { top: 6px; }
  .au-eye { top: 12px; }
  @media (max-height: 760px) { .au-left > p, .au-feats { display: none; } .au-art { max-height: 30vh; } }
}
@layer components {
  .au-art { width: min(100%, 480px); max-height: 46vh; align-self: flex-start; margin: 4px 0 0 -10px; }
  @media (max-height: 760px) { .au-art { max-height: 34vh; } }
}

/* ---------------------------------------------------------------- açılış kapısı, form cilası, hesap menüsü */
@layer components {
  /* boot.js: üye yoksa uygulama kabuğu ilk kareden itibaren gizli, giriş perdesi opak */
  html.auth-open #authScreen[hidden] { display: block; }
  html.auth-open :is(#topbar, #palette, #stage, #panel, #status, #toasts, .mob-bar) { visibility: hidden; }
  html.auth-open, html.auth-open body { overflow: hidden; }
  #authScreen { animation: none; }
  #authScreen .au-wrap { animation: auIn .4s ease-out; }
  #authScreen.out { animation: auOut .3s ease-in forwards; }

  /* kayan etiket: yazılmış, otomatik doldurulmuş ya da seçilmiş alanlarda yukarı çıkar */
  .au-f > span { top: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 28px); }
  .au-f input:focus + span, .au-f input:not(:placeholder-shown) + span, .au-f input:-webkit-autofill + span, .au-f input:autofill + span,
  .au-f.has-val > span, .au-f select:focus + span { top: 6px; font-size: .68rem; color: var(--accent); font-weight: 700; letter-spacing: .03em; }
  .au-f input:-webkit-autofill, .au-f input:-webkit-autofill:hover, .au-f input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; box-shadow: 0 0 0 1000px var(--surface) inset; caret-color: var(--text);
    transition: background-color 0s 600000s;
  }
  .au-f input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 3px rgba(255, 181, 71, .18); }
  .au-f input::placeholder { color: transparent; }
  .au-f input[type=tel], .au-f input[type=email] { font-family: var(--mono); font-size: .92rem; }
  .au-sel select { padding: 18px 36px 6px 14px; color: var(--text); cursor: pointer; }
  .au-sel::after { content: ''; position: absolute; right: 14px; top: 20px; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); pointer-events: none; }
  .au-sel select option { background: #161d27; color: var(--text); }
  .au-f input:user-invalid, .au-f.bad input { border-color: var(--red); }
  .au-f .au-hint { position: absolute; right: 12px; top: 15px; font-size: .68rem; color: var(--text-3); pointer-events: none; }
  .au-card h2 { line-height: 1.15; }
  .au-chk span { overflow-wrap: anywhere; }
  .au-chk input { accent-color: var(--accent); }
  .au-forgot { display: block; text-align: end; margin-top: -4px; font-size: .78rem; color: var(--text-3); }
  .au-forgot:hover { color: var(--accent); }
  .au-caps { font-size: .72rem; color: var(--amber); margin-top: -6px; }

  /* üst çubuk hesap düğmesi + menüsü */
  .user-btn { position: relative; }
  .user-btn .avatar { display: none; width: 24px; height: 24px; border-radius: 50%; place-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .02em; color: #2a1700; background: linear-gradient(135deg, #ffc462, #ff8a3d); }
  .user-btn.on .avatar { display: grid; }
  .user-btn.on > svg { display: none; }
  .user-btn.on { border-color: transparent; background: transparent; }
  .user-btn.on:hover .avatar { box-shadow: 0 0 0 3px rgba(255, 181, 71, .25); }
  .user-menu { min-width: 280px; padding: 0; overflow: hidden; }
  .um-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; background: linear-gradient(180deg, rgba(255, 181, 71, .08), transparent); border-bottom: 1px solid var(--line); }
  .um-head .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #2a1700; background: linear-gradient(135deg, #ffc462, #ff8a3d); flex: none; }
  .um-head b { display: block; font-size: .92rem; line-height: 1.2; }
  .um-head small { display: block; color: var(--text-3); font-family: var(--mono); font-size: .72rem; overflow-wrap: anywhere; }
  .um-head .um-tag { display: inline-block; margin-top: 4px; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
  .um-head .um-tag.ok { color: var(--green); border-color: rgba(89, 227, 143, .35); }
  .um-body { padding: 6px; }
  .um-body button.danger { color: #ffb4b0; }
  .um-body button.danger:hover { background: rgba(255, 93, 85, .1); }
  .um-foot { padding: 8px 14px 10px; font-size: .7rem; color: var(--text-3); border-top: 1px solid var(--line); }
  .profile-card .avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #2a1700; background: linear-gradient(135deg, #ffc462, #ff8a3d); flex: none; }
  .profile-card .pc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
  .profile-card .pc-top b { display: block; }
  .profile-card .pc-top small { color: var(--text-3); font-family: var(--mono); font-size: .72rem; overflow-wrap: anywhere; }

  /* profil düzenleme modalı */
  .pf-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .pf-form .full { grid-column: 1 / -1; }
  .pf-form .fld { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--text-3); }
  .pf-form .fld input, .pf-form .fld select { padding: 9px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; }
  .pf-form .fld input:focus, .pf-form .fld select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
  @media (max-width: 520px) { .pf-form { grid-template-columns: 1fr; } }

  /* sürükle-bırak içe aktarma */
  body.dropping #stage::after { content: 'JSON dosyasını bırak: devre ya da deney içe aktarılır'; position: absolute; inset: 10px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 14px; background: rgba(13, 17, 23, .7); color: var(--accent); font-weight: 800; z-index: 20; pointer-events: none; }
}

/* ---------------------------------------------------------------- özel açılır liste (tüm <select>'ler) */
@layer components {
  select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 26px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b96a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
  select.dd-open { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
  select:focus-visible { outline: none; border-color: var(--accent); }
  .au-sel select { background-image: none; }
  .dd-pop { position: fixed; z-index: 200; display: flex; flex-direction: column; background: #161d27; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05); overflow: hidden; opacity: 0; transform: translateY(-4px) scale(.98); transition: opacity .12s, transform .12s; font-size: .82rem; }
  .dd-pop.up { transform: translateY(4px) scale(.98); }
  .dd-pop.in { opacity: 1; transform: none; }
  .dd-search { padding: 6px; border-bottom: 1px solid var(--line); flex: none; }
  .dd-search input { width: 100%; padding: 7px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: .8rem; }
  .dd-search input:focus { outline: none; border-color: var(--accent); }
  .dd-list { overflow: auto; padding: 5px; scrollbar-width: thin; }
  .dd-g { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 8px 10px 3px; }
  .dd-it { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; text-align: start; color: var(--text-2); font-weight: 500; line-height: 1.3; }
  .dd-it i { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
  .dd-it.on i { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #161d27; }
  .dd-it.on { color: var(--text); font-weight: 700; }
  .dd-it.hi { background: var(--surface-2); color: var(--text); }
  .dd-it.dis { opacity: .4; cursor: not-allowed; }
  .dd-it span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dd-empty { padding: 12px; text-align: center; color: var(--text-3); }
  @media (max-width: 640px) { .dd-pop { font-size: .9rem; } .dd-it { padding: 10px 12px; } }
}

/* ---------------------------------------------------------------- reklam alanları */
@layer components {
  .ad-slot { position: relative; flex: none; margin: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; min-height: 0; }
  .ad-slot[hidden] { display: none; }
  .ad-tag { position: absolute; top: 4px; left: 8px; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); opacity: .7; pointer-events: none; z-index: 1; }
  .ad-ph { display: grid; gap: 3px; text-align: center; padding: 14px 12px; color: var(--text-3); font-size: .74rem; line-height: 1.35; }
  .ad-ph b { color: var(--text-2); font-weight: 700; }
  .ad-ph.ad-block b { color: var(--accent); }
  .ad-left, .ad-right { min-height: 250px; width: calc(100% - 16px); }
  .ad-left .adsbygoogle, .ad-right .adsbygoogle { width: 100%; min-height: 250px; }
  .ad-feed { margin: 6px 0; min-height: 96px; border-style: dashed; }
  .ad-auth { width: min(100%, 440px); min-height: 250px; margin: 0; }
  .ad-auth .adsbygoogle { width: 100%; min-height: 250px; }
  .ad-feed .adsbygoogle { width: 100%; }
  #adBottom { grid-area: adb; margin: 0 8px 6px; min-height: 90px; border-radius: 10px; }
  #adBottom .adsbygoogle { width: 100%; min-height: 90px; }
  #adBottom[hidden] { display: none; }
  /* alt şerit yalnızca yeterince yüksek masaüstü ekranlarda tuvalin altında; mobilde sabit alt şerit */
  @media (max-height: 820px) and (min-width: 901px) { #adBottom { display: none !important; } }
  @media (max-width: 900px) {
    #adBottom { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; min-height: 50px; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; z-index: 40; background: rgba(13, 17, 23, .96); }
    #adBottom .adsbygoogle { min-height: 50px; }
    body.ads-bottom #stage { padding-bottom: 50px; }
    body.ads-bottom .mob-bar { bottom: 60px; }
  }
}
@layer components {
  @media (min-width: 901px) { body.ads-bottom { grid-template-rows: 58px 1fr auto 30px; grid-template-areas: "top top top" "pal stage panel" "pal adb panel" "st st st"; } }
  /* e-posta doğrulama / parola sıfırlama kartı */
  .au-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 4px auto 14px; background: linear-gradient(135deg, rgba(255, 181, 71, .18), rgba(255, 106, 61, .12)); border: 1px solid rgba(255, 181, 71, .3); }
  .au-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .au-center { text-align: center; }
  .au-center h2 { margin-bottom: 4px; }
  .au-center .au-sub b { color: var(--text); font-family: var(--mono); font-weight: 500; }
  .au-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0 2px; }
  .au-code input { width: 100%; height: 56px; text-align: center; font: 700 1.5rem var(--mono); border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); caret-color: var(--accent); transition: border-color .15s, box-shadow .15s, transform .1s; }
  .au-code input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); transform: translateY(-1px); }
  .au-code input.ok { border-color: var(--green); }
  .au-code.bad input { border-color: var(--red); animation: auShake .4s; }
  .au-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: .82rem; color: var(--text-3); }
  .au-links a, .au-links button { color: var(--accent); font-weight: 700; }
  .au-links button:disabled { color: var(--text-3); font-weight: 500; cursor: default; }
  .au-demo { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(79, 209, 255, .08); border: 1px dashed rgba(79, 209, 255, .4); font-size: .78rem; color: var(--text-2); }
  .au-demo b { font-family: var(--mono); font-size: 1rem; color: var(--cyan); letter-spacing: .2em; }
  .au-spam { font-size: .74rem; color: var(--text-3); margin-top: 10px; text-align: center; }
}
@layer components {
  @media (max-width: 900px) {
    /* üst çubuk telefona sığsın: renk paleti ve metin etiketleri gizli, düğmeler sabit genişlik */
    #topbar > * { flex: none; }
    #wireColors, .tb-label, .tb-spacer, .seg small, .pw-t, .brand-t { display: none; }
    #awg { max-width: 92px; }
    #btnPower { padding: 0 10px; }
    #topbar { scrollbar-width: none; }
    #topbar::-webkit-scrollbar { display: none; }
  }
  @media (max-width: 560px) { #btnPins, #btnFit { display: none; } }
}
@layer components {
  .tb-right { display: flex; align-items: center; gap: 8px; flex: none; }
  @media (max-width: 900px) {
    .tb-right { position: sticky; right: -8px; margin-left: auto; padding: 0 8px 0 10px; background: linear-gradient(90deg, transparent, #131a23 14px); z-index: 2; }
  }
  @media (max-width: 560px) {
    #wireTool { display: none; }
    .seg button { padding: 6px 10px; font-size: 0; gap: 0; }
    .seg button > svg { width: 18px; height: 18px; }
  }
}

/* ---------------------------------------------------------------- destek penceresi, yönetici bağlantısı, okunmamış rozeti */
@layer components {
  .user-btn.unread::after { content: ''; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid #131a23; }
  .um-badge { margin-left: auto; font-size: .66rem; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; }
  .um-link { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-weight: 600; color: var(--text-2); text-decoration: none; }
  .um-link:hover { background: var(--surface-2); color: var(--text); }
  .um-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-3); vertical-align: middle; }
  .tag.ok { color: var(--green); border-color: rgba(89, 227, 143, .4); } .tag.warn { color: var(--amber); border-color: rgba(255, 181, 71, .4); }
  .sp-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .sp-form .fld { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--text-3); }
  .sp-form input, .sp-form textarea { padding: 9px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; }
  .sp-form textarea { min-height: 110px; resize: vertical; }
  .sp-form input:focus, .sp-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
  .sp-h { margin-top: 18px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
  .sp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
  .sp-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; text-align: start; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
  .sp-item:hover { border-color: var(--accent); }
  .sp-item.new { border-color: rgba(255, 93, 85, .5); }
  .sp-item b { font-size: .86rem; } .sp-item small { grid-column: 2; color: var(--text-3); font-size: .74rem; }
  .sp-thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 50vh; overflow: auto; }
  .sp-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }
  .sp-msg.admin { align-self: flex-end; background: rgba(255, 181, 71, .1); border-color: rgba(255, 181, 71, .3); }
  .sp-msg small { display: block; color: var(--text-3); font-size: .68rem; margin-top: 4px; }
}

/* ---------------------------------------------------------------- özel parça sihirbazı */
@layer components {
  .up-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
  .up-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
  .up-item b { display: block; } .up-item small { color: var(--text-3); font-size: .74rem; }
  .up-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font: 800 .72rem var(--mono); background: #1c1d20; border: 1px solid #3a3d42; color: #d4d7db; }
  .up-recog { display: flex; gap: 8px; margin: 10px 0 6px; }
  .up-recog input { flex: 1; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; }
  .up-recog input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
  #upRecogOut { min-height: 1.2em; margin-bottom: 8px; } #upRecogOut a { color: var(--accent); font-weight: 700; }
  .up-form { display: flex; flex-direction: column; gap: 10px; }
  .up-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .up-grid .full { grid-column: 1 / -1; }
  .up-form .fld { display: flex; flex-direction: column; gap: 4px; font-size: .76rem; color: var(--text-3); }
  .up-form .fld input, .up-form .fld select, .up-form textarea { padding: 8px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; }
  .up-form textarea { font-family: var(--mono); font-size: .84rem; min-height: 120px; resize: vertical; }
  .up-form .fld input:focus, .up-form .fld select:focus, .up-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
  .up-h { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
  .up-h small { text-transform: none; letter-spacing: 0; font-weight: 500; }
  .up-pins { display: grid; grid-template-columns: 1fr 26px 1fr; gap: 6px 10px; align-items: start; }
  .up-pins .col { display: flex; flex-direction: column; gap: 4px; }
  .chip-mid { align-self: stretch; display: grid; place-items: center; }
  .chip-mid i { display: block; width: 18px; height: 100%; min-height: 60px; border-radius: 6px; background: #1c1d20; border: 1px solid #3a3d42; position: relative; }
  .chip-mid i::before { content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: #0b0f14; }
  .up-pin { display: grid; grid-template-columns: 26px 1fr 88px; gap: 6px; align-items: center; }
  .up-pin .n { font: 700 .72rem var(--mono); color: var(--text-3); text-align: center; }
  .up-pin input { padding: 5px 8px !important; font-family: var(--mono); font-size: .8rem; }
  .up-pin select { padding: 5px 24px 5px 8px !important; font-size: .74rem; }
  .up-pin.in input { border-color: rgba(79, 209, 255, .45); } .up-pin.out input { border-color: rgba(89, 227, 143, .5); }
  .up-pin.vcc input { border-color: rgba(255, 93, 85, .5); } .up-pin.gnd input { border-color: rgba(179, 189, 204, .5); }
  .up-pin.nc input { opacity: .5; }
  .up-preview { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line-2); }
  .up-preview svg { max-width: 100%; height: auto; }
  .ds-eq code { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--bg); margin: 2px 0; }
  .alert.ok { padding: 9px 12px; border-radius: 10px; background: rgba(89, 227, 143, .1); border: 1px solid rgba(89, 227, 143, .4); color: #bff5d2; font-size: .84rem; }
  .alert.err { padding: 9px 12px; border-radius: 10px; background: rgba(255, 93, 85, .12); border: 1px solid rgba(255, 93, 85, .4); color: #ffcbc8; font-size: .84rem; }
  @media (max-width: 700px) { .up-grid { grid-template-columns: 1fr; } .up-pins { grid-template-columns: 1fr; } .chip-mid { display: none; } }
}
