@font-face { font-family: "Host Grotesk"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("fonts/host-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Host Grotesk"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("fonts/host-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bedstead"; src: url("../assets/fonts/bedstead.otf") format("opentype"); font-display: swap; }

:root {
  --bg: #07080a; --s1: #111318; --s2: #181b22; --s3: #20242d;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --fg: #f3f5f7; --mute: #8d93a0; --dim: #5c6270;
  --cy: #22e0ff; --cy-ink: #04141a; --ye: #ffd400; --gr: #3ddc84; --rd: #ff4d4d;
  --r: 20px; --r-s: 14px;
  --shadow: 0 18px 40px -20px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.4);
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 16px/1.45 "Host Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.005em; min-height: 100dvh; scrollbar-color: var(--s3) var(--bg); }
::selection { background: var(--cy); color: var(--cy-ink); }
:focus-visible { outline: 2px solid var(--cy); outline-offset: 2px; border-radius: 6px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(30px, 7vw, 40px); line-height: 1.05; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
p { margin: 0; }
.mute { color: var(--mute); }
.code { font-family: "Bedstead", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px; padding-top: env(safe-area-inset-top); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; }
.brand b { color: #fff; font-weight: 800; } .brand em { font-style: normal; color: var(--cy); }
.mark { display: grid; grid-template-columns: repeat(8, 4px); grid-auto-rows: 4px; }
.mark i { display: block; background: var(--cy); }
.mark i.o { background: transparent; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.mode { font-size: 12px; color: var(--ye); border: 1px solid rgba(255,212,0,.35); border-radius: 999px; padding: 3px 9px; }
.icon-btn { background: var(--s1); border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--s2); }

.view { flex: 1; display: flex; flex-direction: column; padding: 8px 0 max(24px, env(safe-area-inset-bottom)); animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { padding: 22px 0 18px; }
.hero p { margin-top: 10px; font-size: 17px; color: var(--mute); max-width: 36ch; }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn { appearance: none; border: 0; border-radius: var(--r-s); padding: 0 20px; height: 56px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; transition: transform .15s var(--ease), background .2s; }
.btn:active { transform: scale(.985); }
.btn.pri { background: var(--cy); color: var(--cy-ink); }
.btn.pri:hover { background: #5ae8ff; }
.btn.sec { background: var(--s1); border: 1px solid var(--line-2); }
.btn.sec:hover { background: var(--s2); }
.btn.ghost { background: none; color: var(--mute); height: 44px; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 22px; }

/* cihaz kartı */
.dev { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); transition: background .2s, border-color .2s; }
.dev:hover { background: var(--s2); border-color: var(--line-2); }
.dev .tile { width: 52px; height: 52px; border-radius: 14px; background: var(--s3); display: grid; place-items: center; font-family: "Bedstead", monospace; font-size: 20px; color: var(--cy); flex: none; }
.dev .t { flex: 1; min-width: 0; }
.dev .t b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev .t span { color: var(--mute); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--s3); color: var(--mute); white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pill.on { color: var(--gr); } .pill.on i { background: var(--gr); box-shadow: 0 0 0 4px rgba(61,220,132,.15); }
.pill.off i { background: var(--rd); }
.pill.wait { color: var(--ye); } .pill.wait i { background: var(--ye); }

/* boş durum */
.empty { text-align: center; padding: 36px 12px; }
.empty .art { margin: 0 auto 22px; width: 160px; }

/* sihirbaz */
.dots { display: flex; gap: 6px; margin: 4px 0 18px; }
.dots i { height: 4px; flex: 1; border-radius: 2px; background: var(--s3); }
.dots i.on { background: var(--cy); }
.art-card { background: linear-gradient(160deg, var(--s2), var(--s1)); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; place-items: center; min-height: 230px; margin: 6px 0 18px; }
.step-n { color: var(--cy); font-weight: 700; font-size: 14px; letter-spacing: .04em; margin-bottom: 8px; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--mute); font-size: 15px; }
.tip b { color: var(--fg); }

.field { display: flex; align-items: center; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 8px 0 16px; }
.field:focus-within { border-color: var(--cy); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg); font: inherit; font-size: 18px; padding: 16px 0; }
.field input.code { font-size: 26px; letter-spacing: .18em; text-transform: uppercase; }
.err { color: var(--rd); font-size: 14px; min-height: 1.4em; margin-top: 8px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.chips-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; } .chips-row .chips { margin-top: 10px; flex: 1; }
.chip { flex: 1; min-width: 52px; height: 38px; border: 0; border-radius: 11px; background: var(--s3); color: var(--fg); font: 600 14px "Host Grotesk", system-ui; cursor: pointer; transition: background .2s, color .2s, transform .15s var(--ease); }
.chip:active { transform: scale(.97); } .chip:disabled { color: var(--dim); cursor: default; }
.chip.on { background: var(--cy); color: var(--cy-ink); } .chip.on.warm { background: var(--ye); }

/* uygulama içi QR tarayıcı */
.scan { position: relative; margin-top: 16px; border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 1; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 2px solid var(--cy); border-radius: 14px; box-shadow: 0 0 0 999px rgba(7,8,10,.45); }

/* cihaz sayfası */
.dev-hero { display: flex; align-items: center; gap: 16px; padding: 18px 0 8px; }
.dev-hero .big { width: 68px; height: 68px; border-radius: 20px; background: var(--s1); border: 1px solid var(--line); display: grid; place-items: center; font-family: "Bedstead", monospace; font-size: 26px; color: var(--cy); }
.dev-hero h1 { font-size: 28px; }
.signal { position: relative; height: 150px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line); overflow: hidden; }
.signal canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.signal .lbl { position: absolute; left: 16px; top: 14px; font-size: 13px; color: var(--mute); }
.signal .val { position: absolute; right: 16px; top: 10px; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.signal .val small { font-size: 14px; color: var(--mute); font-weight: 500; margin-left: 4px; }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv span { color: var(--mute); font-size: 13px; }
.kv b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list button { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--s1); border: 0; border-bottom: 1px solid var(--line); padding: 16px; text-align: left; cursor: pointer; }
.list button:last-child { border-bottom: 0; }
.list button:hover { background: var(--s2); }
.list button span { flex: 1; }
.list button small { color: var(--mute); }
.tag-soon { color: var(--ye); font-size: 12px; font-weight: 700; letter-spacing: .04em; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--s3); border: 1px solid var(--line-2); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 15px; animation: rise .3s var(--ease) both; z-index: 9; max-width: calc(100% - 32px); }

@media (prefers-reduced-motion: reduce) { .view, .toast { animation: none; } }
@media (min-width: 720px) { .app { padding-top: 12px; } .hero { padding-top: 34px; } }

/* grafik lejantı ve bağlantı şeridi */
.signal { height: 200px; }
.leg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--mute); }
.leg span { display: inline-flex; align-items: center; gap: 6px; }
.leg i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; }
.leg i.gap { width: 16px; height: 10px; background: repeating-linear-gradient(45deg, rgba(255,77,77,.7) 0 2px, rgba(255,77,77,.2) 2px 4px); }
.cn .cn-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.cn .cn-h .mute { font-size: 12px; text-align: right; }
.strip svg { width: 100%; height: 56px; display: block; }

/* çevrimdışı: hedef kuyrukta (kehribar) */
.pill.queued { color: var(--ye); } .pill.queued i { background: var(--ye); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.queue { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,212,0,.07); border: 1px dashed rgba(255,212,0,.35); font-size: 14px; color: var(--mute); }
.queue b { color: var(--fg); }
.q-anim { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; }
.q-anim i { width: 6px; height: 6px; border-radius: 50%; background: var(--ye); opacity: .25; animation: qdot 1.5s infinite; }
.q-anim i:nth-child(2) { animation-delay: .25s; } .q-anim i:nth-child(3) { animation-delay: .5s; }
@keyframes qdot { 0%, 60%, 100% { opacity: .25; transform: translateX(0); } 30% { opacity: 1; transform: translateX(3px); } }

/* Makine sayfası tek ekran: tek satır başlık, katlanır bölümler */
.dev-top { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; }
.dev-top .btn.ghost { width: auto; padding: 0; height: 36px; justify-content: flex-start; flex: none; }
.dev-top .dev-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-top .pill { flex: none; }
details.fold { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; font-weight: 700; font-size: 15px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "›"; margin-left: auto; color: var(--mute); font-size: 18px; transform: rotate(90deg); transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(-90deg); }
details.fold > summary small { color: var(--mute); font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.fold > :not(summary) { margin-left: 12px; margin-right: 12px; }
details.fold > :last-child { margin-bottom: 12px; }
details.fold .signal, details.fold .card, details.fold .list { border: 0; background: var(--s2); }
