/* ============================================================
   Bilgisayar Okulu — app.css
   ============================================================ */
:root {
  --bg: #FBF9F4;
  --surface: #FFFFFF;
  --surface-2: #F3F0E8;
  --ink: #1C1B18;
  --muted: #6B675E;
  --line: #E6E1D6;
  --accent: #1D6F6A;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6F2F0;
  --orange: #E9772E;
  --orange-soft: #FFF1E6;
  --amber-soft: #FFF6DF;
  --amber-ink: #8A5A00;
  --green: #2E8B57;
  --green-soft: #E7F5EC;
  --red: #C8433B;
  --red-soft: #FBE9E7;
  --blue: #2F6FD6;
  --blue-soft: #E8F0FC;
  --purple: #7C4DCC;
  --purple-soft: #F0EAFB;
  --shadow: 0 1px 2px rgba(20,18,12,.05), 0 8px 24px rgba(20,18,12,.06);
  --radius: 16px;
  --sidebar-w: 292px;
  --topbar-h: 60px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Consolas", "SF Mono", Menlo, monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #14161A;
  --surface: #1C1F25;
  --surface-2: #232730;
  --ink: #ECE9E2;
  --muted: #A19C92;
  --line: #2C313B;
  --accent: #4FB8AF;
  --accent-ink: #0F1A19;
  --accent-soft: #1C2B2A;
  --orange: #F08B48;
  --orange-soft: #2E211A;
  --amber-soft: #2E2716;
  --amber-ink: #F2C46B;
  --green: #5CC58A;
  --green-soft: #182A20;
  --red: #E5675F;
  --red-soft: #33201F;
  --blue: #6E9CF0;
  --blue-soft: #1C2536;
  --purple: #A98BEA;
  --purple-soft: #262034;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; margin-top: 1.6em; }
h3 { font-size: 1.12rem; font-weight: 700; margin-top: 1.2em; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
code, kbd {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .4em;
}
kbd { box-shadow: 0 2px 0 var(--line); font-weight: 600; padding: .15em .5em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
img, svg { max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--orange)); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--accent); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .15s, background .2s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.menu-btn { display: none; }
html[data-theme="dark"] .ic-moon { display: none; }
html:not([data-theme="dark"]) .ic-sun { display: none; }
.progress-wrap { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.progress-bar { width: clamp(80px, 22vw, 220px); height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--orange)); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress-text { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line);
  transform: translateX(0); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-module { margin-top: 14px; }
.nav-module:first-child { margin-top: 4px; }
.nav-module-title { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-module-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mod-color, var(--accent)); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink);
  font-size: .93rem; line-height: 1.3; transition: background .15s, transform .15s;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; transform: translateX(2px); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.done .nav-num { background: var(--green); border-color: var(--green); color: #fff; }
.done .nav-num::before { content: "✓"; }
.done .nav-num span { display: none; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.foot-link { flex: 1; text-align: center; padding: 9px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: .88rem; font-weight: 600; }
.foot-link:hover, .foot-link.active { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .3s; }

.main { padding: calc(var(--topbar-h) + 28px) 24px 80px; margin-left: var(--sidebar-w); }
.container { max-width: 780px; margin: 0 auto; }
.wide { max-width: 980px; }

@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; padding: calc(var(--topbar-h) + 18px) 16px 60px; }
  .brand-text { display: none; }
}

/* ---------- Page transitions & reveals ---------- */
.page { animation: pageIn .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Lesson ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mod-color, var(--accent)); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: currentColor; }
.lesson-hero { padding: 8px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.lede b { color: var(--ink); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 22px 0; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-label { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.card-label .emoji { font-size: 1.1rem; }

.analogy { background: var(--amber-soft); border-color: transparent; position: relative; overflow: hidden; }
.analogy .card-label { color: var(--amber-ink); }
.analogy::after { content: attr(data-icon); position: absolute; right: 14px; top: 6px; font-size: 4.2rem; opacity: .16; pointer-events: none; }
.demo { background: var(--surface); }
.demo .card-label { color: var(--accent); }
.demo-hint { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }
.examples { background: var(--blue-soft); border-color: transparent; }
.examples .card-label { color: var(--blue); }
.examples ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.examples li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.examples li .ex-ic { flex: none; font-size: 1.4rem; line-height: 1.3; }
.recap { background: var(--accent-soft); border-color: transparent; }
.recap .card-label { color: var(--accent); }
.recap ol { margin: 0; padding-left: 1.2em; }
.recap li { margin-bottom: .5em; }
.note { background: var(--surface-2); border-left: 4px solid var(--orange); border-radius: 10px; padding: 12px 16px; margin: 18px 0; font-size: .95rem; }
.note b { color: var(--orange); }
.wrong-right { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.wrong-right > div { border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.wrong-right .no { background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.wrong-right .yes { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.wrong-right b { display: block; margin-bottom: 4px; }
.wrong-right .no b { color: var(--red); } .wrong-right .yes b { color: var(--green); }
@media (max-width: 600px) { .wrong-right { grid-template-columns: 1fr; } }

.term { border-bottom: 2px dotted var(--accent); cursor: help; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.mini { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; font-size: .95rem; }
.mini h4 { margin: 0 0 6px; font-size: 1rem; }
.mini .big { font-size: 1.8rem; display: block; margin-bottom: 4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 12px 0; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.orange { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn.sm { padding: 7px 12px; font-size: .86rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* ---------- Quiz ---------- */
.quiz { background: var(--purple-soft); border-color: transparent; }
.quiz .card-label { color: var(--purple); }
.q { margin: 0 0 18px; padding: 16px 18px; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.q-text { font-weight: 600; margin-bottom: 10px; }
.q-opts { display: grid; gap: 8px; }
.q-opt {
  text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); cursor: pointer; font-size: .95rem; transition: background .15s, border-color .15s, transform .1s;
}
.q-opt:hover { border-color: var(--purple); transform: translateX(2px); }
.q-opt.correct { background: var(--green-soft); border-color: var(--green); font-weight: 600; }
.q-opt.wrong { background: var(--red-soft); border-color: var(--red); }
.q.answered .q-opt { cursor: default; transform: none; }
.q-why { margin-top: 10px; font-size: .92rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: none; }
.q.answered .q-why { display: block; animation: pageIn .3s both; }
.quiz-result { margin-top: 12px; font-weight: 600; display: none; }
.quiz-result.show { display: block; animation: pageIn .4s both; }

/* ---------- Notes ---------- */
.notes textarea { width: 100%; min-height: 90px; resize: vertical; border-radius: 12px; border: 1px solid var(--line); padding: 12px 14px; font: inherit; font-size: .95rem; background: var(--surface-2); color: var(--ink); }
.notes textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.notes .saved { font-size: .82rem; color: var(--muted); margin-top: 6px; min-height: 1.2em; }

/* ---------- Lesson nav ---------- */
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.lesson-nav a { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: transform .15s, box-shadow .2s; }
.lesson-nav a:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.lesson-nav a.next { text-align: right; align-items: flex-end; }
.lesson-nav small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.lesson-nav b { font-family: var(--font-head); }
.complete-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.complete-row .status { font-size: .92rem; color: var(--green); font-weight: 600; }

/* ---------- Home ---------- */
.hero { padding: 24px 0 10px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); max-width: 720px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 1.2rem; max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0; }
@media (max-width: 720px) { .how { grid-template-columns: 1fr; } }
.how .step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.how .step .n { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; margin-bottom: 8px; }
.how .step h3 { margin: 0 0 4px; }
.how .step p { margin: 0; color: var(--muted); font-size: .93rem; }
.modules { display: grid; gap: 18px; margin-top: 10px; }
.module-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border-top: 4px solid var(--mod-color, var(--accent)); }
.module-card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.module-card .desc { color: var(--muted); margin-bottom: 12px; }
.module-card .lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.module-card .lessons li { margin: 0; }
.module-card .lessons a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink); background: var(--surface-2); font-size: .92rem; transition: transform .15s; }
.module-card .lessons a:hover { transform: translateX(3px); text-decoration: none; background: var(--accent-soft); }

/* ---------- Glossary ---------- */
.glossary-search { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; margin-bottom: 18px; }
.glossary-search:focus { outline: 2px solid var(--accent); }
.gl-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.gl-item dt { font-weight: 700; font-family: var(--font-head); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.gl-item dt .en { font-size: .8rem; color: var(--muted); font-weight: 500; font-family: var(--font-body); }
.gl-item dd { margin: 4px 0 0; color: var(--muted); }
.gl-item dd a { font-size: .85rem; margin-left: 6px; white-space: nowrap; }
.gl-letter { font-family: var(--font-head); font-weight: 800; color: var(--accent); margin-top: 22px; font-size: 1.2rem; }

/* ---------- Questions page ---------- */
.qn-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.qn-item .qn-title { font-weight: 700; margin-bottom: 6px; }
.qn-item .qn-body { white-space: pre-wrap; color: var(--muted); }
.empty { color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 20px; text-align: center; }

/* ============================================================
   DEMOS
   ============================================================ */
.stage { position: relative; background: var(--surface-2); border-radius: 14px; padding: 18px; overflow: hidden; }
.stage svg { display: block; width: 100%; height: auto; }
.stage .caption { position: absolute; left: 12px; bottom: 10px; font-size: .82rem; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.readout { font-family: var(--font-mono); font-size: .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 10px; min-height: 2.4em; }
.readout.big { font-size: 1.3rem; text-align: center; }
.readout.text { font-family: var(--font-body); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.pill.on { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.pill.off { background: var(--red-soft); color: var(--red); border-color: var(--red); }

/* bits / bulbs */
.bulbs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.bulb { width: 54px; height: 72px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: all .2s; user-select: none; }
.bulb .lamp { width: 26px; height: 26px; border-radius: 50%; background: #cfcac0; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); transition: all .2s; }
.bulb .val { font-family: var(--font-mono); font-weight: 700; font-size: .95rem; color: var(--muted); }
.bulb .pw { font-size: .62rem; color: var(--muted); }
.bulb.on { border-color: var(--orange); background: var(--orange-soft); transform: translateY(-2px); }
.bulb.on .lamp { background: #FFC14D; box-shadow: 0 0 18px rgba(255,180,50,.8), inset 0 -3px 0 rgba(0,0,0,.05); }
.bulb.on .val { color: var(--orange); }

/* parts explorer */
.parts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 640px) { .parts { grid-template-columns: 1fr; } }
.parts .stage { padding: 10px; }
.part { cursor: pointer; }
.part rect, .part circle, .part path { transition: fill .2s, stroke .2s, stroke-width .2s; }
.part:hover rect, .part.active rect { stroke: var(--orange); stroke-width: 3; }
.part text { pointer-events: none; font-family: var(--font-body); font-weight: 600; font-size: 11px; fill: #1C1B18; }
.part-info { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-height: 180px; }
.part-info h4 { margin: 0 0 4px; font-size: 1.05rem; }
.part-info .an { color: var(--amber-ink); font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.part-info p { font-size: .93rem; margin: 0; }
.part-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.part-list button { font-size: .8rem; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.part-list button.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ram vs disk sim */
.ramdisk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .ramdisk { grid-template-columns: 1fr; } }
.box { background: var(--surface); border: 2px dashed var(--line); border-radius: 12px; padding: 12px; min-height: 120px; transition: all .3s; }
.box h4 { margin: 0 0 6px; font-size: .9rem; display: flex; justify-content: space-between; }
.box .content { font-family: var(--font-mono); font-size: .9rem; white-space: pre-wrap; word-break: break-word; color: var(--ink); min-height: 2em; }
.box.ram { border-color: var(--orange); } .box.disk { border-color: var(--blue); }
.box.flash { animation: flash .5s; }
@keyframes flash { 0% { background: var(--amber-soft); } 100% { background: var(--surface); } }
.box.off { opacity: .35; filter: grayscale(1); }

/* size compare */
.sizebar { display: flex; flex-wrap: wrap; gap: 3px; margin: 8px 0; min-height: 30px; }
.sizebar i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); animation: pop .3s both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
select.input { appearance: auto; }

/* file tree */
.ftree { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .ftree { grid-template-columns: 1fr; } }
.tree { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: .93rem; }
.tree ul { list-style: none; padding-left: 18px; margin: 0; }
.tree > ul { padding-left: 4px; }
.tree li { margin: 0; }
.tree .node { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.tree .node:hover { background: var(--surface-2); }
.tree .node.sel { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree li.closed > ul { display: none; }
.tree .tw { width: 12px; font-size: .7rem; color: var(--muted); transition: transform .2s; display: inline-block; }
.tree li:not(.closed) > .node .tw { transform: rotate(90deg); }
.path-out { font-family: var(--font-mono); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; word-break: break-all; }
.path-out .seg { padding: 1px 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.path-out .sep { color: var(--muted); margin: 0 2px; }

/* packets / network */
.node-lbl { font-family: var(--font-body); font-size: 11px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
.node-sub { font-family: var(--font-mono); font-size: 9px; fill: var(--muted); text-anchor: middle; }
.wire { stroke: #cfc9bd; stroke-width: 3; fill: none; }
html[data-theme="dark"] .wire { stroke: #3a404b; }
.svg-node { cursor: pointer; }
.svg-node rect { transition: stroke .2s, stroke-width .2s; }
.svg-node:hover rect, .svg-node.on rect { stroke: var(--orange); stroke-width: 3; }

/* dns steps */
.steps { display: grid; gap: 8px; margin-top: 12px; }
.step-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); opacity: .45; transition: all .3s; }
.step-row.on { opacity: 1; border-color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow); }
.step-row.past { opacity: .85; }
.step-row .sn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.step-row.on .sn { background: var(--accent); color: var(--accent-ink); }
.step-row.past .sn { background: var(--green); color: #fff; }
.step-row p { margin: 0; font-size: .93rem; }
.step-row b { display: block; font-size: .95rem; }
.input { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem; min-width: 160px; flex: 1; }
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* url anatomy */
.url-parts { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--font-mono); font-size: 1.05rem; margin: 12px 0; word-break: break-all; }
.url-parts span { padding: 4px 6px; border-radius: 6px; border-bottom: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); cursor: default; transition: transform .15s; }
.url-parts span:hover { transform: translateY(-2px); }
.url-legend { display: grid; gap: 6px; font-size: .92rem; }
.url-legend div { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--surface); }
.url-legend i { flex: none; width: 12px; height: 12px; border-radius: 3px; display: inline-block; position: relative; top: 1px; background: var(--c); }
.c1 { --c: #2F6FD6; } .c2 { --c: #7C4DCC; } .c3 { --c: #1D6F6A; } .c4 { --c: #E9772E; } .c5 { --c: #C8433B; } .c6 { --c: #B07A00; } .c7 { --c: #2E8B57; }

/* restaurant / http */
.http-log { font-family: var(--font-mono); font-size: .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 70px; white-space: pre-wrap; }
.http-log .req { color: var(--blue); } .http-log .res { color: var(--green); } .http-log .err { color: var(--red); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-weight: 700; font-size: .85rem; }
.status-chip.s2 { background: var(--green-soft); color: var(--green); } .status-chip.s3 { background: var(--blue-soft); color: var(--blue); } .status-chip.s4 { background: var(--amber-soft); color: var(--amber-ink); } .status-chip.s5 { background: var(--red-soft); color: var(--red); }
.waiter { transition: transform 1s cubic-bezier(.4,0,.2,1); }

/* html/css/js layers */
.layers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .layers { grid-template-columns: 1fr; } }
.layer-toggle { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.layer-toggle button { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink); }
.layer-toggle button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.preview { background: #fff; color: #111; border-radius: 12px; border: 1px solid var(--line); padding: 18px; min-height: 180px; font-family: "Times New Roman", serif; transition: all .3s; }
.preview h3 { margin-top: 0; font-family: inherit; font-weight: bold; }
.preview button { font: inherit; }
.preview .msg { margin-top: 10px; font-size: .9rem; color: #1D6F6A; font-weight: 600; min-height: 1.4em; }
.preview.styled { font-family: var(--font-body); background: linear-gradient(135deg, #FFF6DF, #E6F2F0); border-radius: 16px; }
.preview.styled h3 { color: #1D6F6A; font-family: var(--font-head); }
.preview.styled button { background: #E9772E; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.preview.styled ul { display: flex; gap: 8px; list-style: none; padding: 0; flex-wrap: wrap; }
.preview.styled li { background: #fff; padding: 4px 10px; border-radius: 99px; border: 1px solid #ddd; font-size: .9rem; }
.code-view { font-family: var(--font-mono); font-size: .8rem; background: #1e2128; color: #e6e6e6; border-radius: 12px; padding: 12px 14px; white-space: pre; overflow-x: auto; line-height: 1.5; }
.code-view .tag { color: #7fd1ff; } .code-view .css { color: #ffd27f; } .code-view .js { color: #c3e88d; } .code-view .dim { opacity: .3; }

/* live editor */
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .editor { grid-template-columns: 1fr; } }
.editor textarea { width: 100%; min-height: 220px; font-family: var(--font-mono); font-size: .85rem; border-radius: 10px; border: 1px solid var(--line); padding: 10px; background: #1e2128; color: #e6e6e6; resize: vertical; line-height: 1.5; }
.editor .tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.editor .tabs button { padding: 5px 10px; font-size: .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.editor .tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.editor iframe { width: 100%; height: 100%; min-height: 250px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* https */
.postcard { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
@media (max-width: 600px) { .postcard { grid-template-columns: 1fr; } }
.msgbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: var(--font-mono); font-size: .9rem; min-height: 80px; word-break: break-all; }
.msgbox h5 { margin: 0 0 6px; font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.msgbox.locked { background: var(--green-soft); border-color: var(--green); }
.eye { text-align: center; font-size: 1.6rem; align-self: center; }
.eye small { display: block; font-size: .75rem; color: var(--muted); }

/* keyboard */
.kbd-stage { background: var(--surface); border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; outline: none; cursor: pointer; transition: border-color .2s; }
.kbd-stage:focus { border-color: var(--accent); border-style: solid; }
.kbd-stage .combo { font-size: 1.6rem; font-weight: 800; font-family: var(--font-head); min-height: 2.2em; }
.kbd-stage .meaning { color: var(--muted); }
.kbd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.kbd-list div { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .9rem; transition: all .2s; }
.kbd-list div.hit { background: var(--green-soft); border-color: var(--green); }
.kbd-list kbd { white-space: nowrap; }

/* password */
.pw-meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 10px 0; border: 1px solid var(--line); }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }
.pw-tips { display: grid; gap: 4px; font-size: .9rem; }
.pw-tips div::before { content: "○ "; color: var(--muted); }
.pw-tips div.ok::before { content: "✓ "; color: var(--green); }

/* robot grid */
.robot-wrap { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
@media (max-width: 600px) { .robot-wrap { grid-template-columns: 1fr; } }
.grid { display: grid; grid-template-columns: repeat(5, 44px); gap: 4px; }
.cell { width: 44px; height: 44px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; transition: background .2s; }
.cell.goal { background: var(--green-soft); }
.cell.wall { background: var(--surface-2); }
.cell.bot { background: var(--amber-soft); }
.cmd-list { min-height: 60px; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.cmd-list span { padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600; }
.cmd-list span.run { background: var(--orange); color: #fff; }
.cmd-list .ph { color: var(--muted); font-size: .85rem; background: none; }

/* flow (email, os layers, install) */
.flow { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.flow .fnode { flex: 1; min-width: 96px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; font-size: .82rem; transition: all .3s; }
.flow .fnode .ic { font-size: 1.6rem; display: block; }
.flow .fnode.on { border-color: var(--orange); background: var(--orange-soft); transform: scale(1.05); }
.flow .fnode.ok { border-color: var(--green); }
.flow .arr { color: var(--muted); }
.flow.vertical { flex-direction: column; align-items: stretch; }
.flow.vertical .fnode { min-width: 0; }
.flow.vertical .arr { text-align: center; }

/* restaurant zones (frontend/backend) */
.rest { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 720px) { .rest { grid-template-columns: 1fr 1fr; } }
.rest .zone { border-radius: 12px; padding: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: all .2s; text-align: center; }
.rest .zone:hover, .rest .zone.on { border-color: var(--accent); background: var(--accent-soft); }
.rest .zone h4 { margin: 0 0 2px; font-size: .95rem; }
.rest .zone .ic { font-size: 2rem; display: block; }
.rest .zone p { margin: 0; font-size: .8rem; color: var(--muted); }

/* generic tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; cursor: pointer; transition: all .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile.on { border-color: var(--accent); background: var(--accent-soft); }
.tile.good { border-color: var(--green); background: var(--green-soft); }
.tile.bad { border-color: var(--red); background: var(--red-soft); }
.tile .ic { font-size: 1.8rem; display: block; }
.tile b { display: block; font-size: .9rem; }
.tile small { color: var(--muted); font-size: .78rem; }

/* git timeline */
.commits { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 50px; margin: 10px 0; }
.commit { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .75rem; cursor: pointer; max-width: 110px; text-align: center; }
.commit i { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); animation: pop .3s both; }
.commit.head i { background: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.commit-line { height: 3px; flex: 1; min-width: 14px; background: var(--line); }

/* fake terminal */
.term { background: #0f1115; color: #d7dae0; font-family: var(--font-mono); font-size: .88rem; border-radius: 12px; padding: 12px 14px; min-height: 220px; max-height: 320px; overflow-y: auto; line-height: 1.55; }
.term .p { color: #6cc2b8; } .term .cmd { color: #fff; } .term .dim { color: #8b909a; } .term .err { color: #f08b8b; }
.term input { background: transparent; border: none; color: #fff; font: inherit; outline: none; width: 70%; }

/* datacenter */
.racks { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.rack { background: #23262d; border-radius: 8px; padding: 6px; display: grid; gap: 3px; position: relative; transition: transform .3s, box-shadow .3s; }
.rack i { display: block; height: 7px; border-radius: 2px; background: #3a3f48; position: relative; }
.rack i::after { content: ""; position: absolute; right: 3px; top: 2px; width: 3px; height: 3px; border-radius: 50%; background: #4CAF50; animation: blink 1.4s infinite; animation-delay: calc(var(--d, 0) * .2s); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.rack.mine { transform: scale(1.12); box-shadow: 0 0 0 3px var(--orange), 0 0 24px rgba(233,119,46,.5); z-index: 1; }
.rack.mine::before { content: "senin siten"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .68rem; white-space: nowrap; color: var(--orange); font-weight: 700; }
.world { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.world span { padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .8rem; opacity: 0; transform: translateY(6px); transition: all .4s; }
.world span.in { opacity: 1; transform: none; border-color: var(--green); }

/* prompt compare */
.prompt-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .prompt-cmp { grid-template-columns: 1fr; } }
.prompt-cmp .pbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.prompt-cmp .pbox h5 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.prompt-cmp .pbox .ask { font-style: italic; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.prompt-cmp .pbox .out { display: none; }
.prompt-cmp .pbox.show .out { display: block; animation: pageIn .4s both; }

/* progress bar (install) */
.pbar { height: 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 10px 0; }
.pbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s; }
.log { font-size: .9rem; display: grid; gap: 4px; }
.log div { opacity: 0; transform: translateX(-6px); transition: all .3s; }
.log div.in { opacity: 1; transform: none; }
