/* KNH Ev Otomasyon Bulut – arayüz stilleri. Mobil öncelikli, açık/koyu tema (sistem ya da kullanıcı seçimi).
   Satır içi stil yoktur (CSP style-src 'self'). */

:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #17212b;
  --muted: #64707d;
  --border: #e2e7ec;
  --primary: #0f766e;
  --primary-2: #0d9488;
  --primary-soft: #e6f4f2;
  --on-primary: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --err: #c62828;
  --err-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --gray-soft: #eef1f4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 14px;
  --radius-sm: 9px;
  --chart-temp: #e0592a;
  --chart-hum: #2b7bd6;
  --strip: #f59e0b;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419; --surface: #182029; --surface-2: #1d2631; --text: #e6edf3; --muted: #95a3b2; --border: #2a3542;
    --primary: #2dd4bf; --primary-2: #5eead4; --primary-soft: #133a37; --on-primary: #06201d;
    --ok: #4ade80; --ok-soft: #14301f; --warn: #fbbf24; --warn-soft: #3a2c10; --err: #f87171; --err-soft: #3b1717;
    --info: #93b4ff; --info-soft: #1a2747; --gray-soft: #232d38; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --chart-temp: #ff8a5c; --chart-hum: #6aa8ff; --strip: #fbbf24; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419; --surface: #182029; --surface-2: #1d2631; --text: #e6edf3; --muted: #95a3b2; --border: #2a3542;
  --primary: #2dd4bf; --primary-2: #5eead4; --primary-soft: #133a37; --on-primary: #06201d;
  --ok: #4ade80; --ok-soft: #14301f; --warn: #fbbf24; --warn-soft: #3a2c10; --err: #f87171; --err-soft: #3b1717;
  --info: #93b4ff; --info-soft: #1a2747; --gray-soft: #232d38; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --chart-temp: #ff8a5c; --chart-hum: #6aa8ff; --strip: #fbbf24; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
code, .mono { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.gap { gap: .5rem; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grow { flex: 1 1 auto; }

.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic-lg { width: 28px; height: 28px; }
.ic-sm { width: 16px; height: 16px; }

/* ---------- Üst bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem max(16px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); min-width: 0; flex: 1 1 auto; }
.brand:hover { text-decoration: none; }
.brand-ic { color: var(--primary); width: 26px; height: 26px; }
.brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .brand span { display: none; } }
.nav { display: flex; align-items: center; gap: .1rem; flex: none; }
.nav a, .nav .linklike {
  display: flex; align-items: center; gap: .35rem; padding: .45rem .5rem; border-radius: var(--radius-sm); color: var(--muted);
  font-size: .92rem; position: relative;
}
.nav a:hover, .nav .linklike:hover { background: var(--gray-soft); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.nav span { display: none; }
.nav .badge { display: inline-block; position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--err); color: #fff; font-size: .7rem; line-height: 17px; text-align: center; }
.nav .badge.hidden { display: none; }
.nav .lbl { display: none; }
@media (min-width: 820px) {
  .nav span { display: inline; }
  .nav .lbl { display: inline; }
  .nav .badge { position: static; }
}
form.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--primary); padding: 0; }

.viewas-bar { background: #7c2d12; color: #fff; padding: .55rem 16px; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.viewas-bar .btn { background: #fff; color: #7c2d12; border-color: #fff; }
.announce { padding: .55rem 16px; display: flex; gap: .5rem; align-items: center; font-size: .92rem; border-bottom: 1px solid var(--border); }
.announce-info { background: var(--info-soft); color: var(--info); }
.announce-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Yerleşim */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1rem 16px 2rem; flex: 1 0 auto; }
.container.narrow { max-width: 760px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.2rem 16px 1.6rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-cards { grid-template-columns: repeat(3, 1fr); } }
.auth-wrap { flex: 1 0 auto; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 2rem; }
.auth-wrap .card { width: 100%; max-width: 420px; }
.auth-logo { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; color: var(--text); }
.auth-logo .ic { color: var(--primary); width: 30px; height: 30px; }

/* ---------- Form ve düğmeler */
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 .3rem; }
.field { margin-bottom: .85rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
input:not([type]), input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text); font: inherit; min-height: 42px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); vertical-align: middle; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; font-size: .92rem; }
.check input { margin-top: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .5rem .95rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--gray-soft); text-decoration: none; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn-danger:hover { background: var(--err-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 32px; padding: .3rem .65rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .45rem; min-width: 40px; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 160px; }

/* ---------- Uyarı, rozet, bildirim */
.alert { padding: .7rem .9rem; border-radius: var(--radius-sm); margin-bottom: .75rem; border: 1px solid transparent; font-size: .93rem; }
.alert-ok, .alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-err, .alert-error { background: var(--err-soft); color: var(--err); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.flash { padding-bottom: 0; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-primary { background: var(--primary-soft); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 100;
  background: #1f2937; color: #fff; padding: .65rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); font-size: .92rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b91c1c; }
.toast.ok { background: #166534; }

/* ---------- Tablolar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.stat .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .82rem; }

/* ---------- Pano: cihaz kartları */
.dev-card { display: flex; flex-direction: column; gap: .65rem; }
.dev-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.dev-card h3 { margin: 0; font-size: 1.05rem; }
.dev-card h3 a { color: var(--text); }
.dev-card .meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--muted); font-size: .85rem; }
.dev-card .meta span { display: inline-flex; align-items: center; gap: .25rem; }
.dev-card .readings { display: flex; gap: 1.2rem; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dev-card .readings small { font-size: .8rem; color: var(--muted); font-weight: 500; display: block; }
.dev-card .foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--border); padding-top: .65rem; }
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.signal i { width: 4px; background: var(--border); border-radius: 1px; display: block; }
.signal i:nth-child(1) { height: 25%; } .signal i:nth-child(2) { height: 50%; } .signal i:nth-child(3) { height: 75%; } .signal i:nth-child(4) { height: 100%; }
.signal i.on { background: var(--ok); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty > .ic { width: 48px; height: 48px; color: var(--primary); margin-bottom: .5rem; }
.offer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ---------- Anahtar (switch) */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 30px; transition: background .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:disabled + .slider { cursor: not-allowed; opacity: .55; }
.switch.pending { opacity: .5; }
.switch.pending .slider { background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.25) 6px 12px); }

/* ---------- Sekmeler */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0 0 1rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .65rem .8rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: .35rem; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Cihaz paneli */
.dev-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: .75rem; }
.dev-head h1 { margin: 0 0 .2rem; }
.dev-head .meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: .86rem; }
.sensor-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .sensor-tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; }
.tile .l { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .3rem; }
.tile .v { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .s { font-size: .75rem; color: var(--muted); }
.relay-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .relay-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .relay-grid { grid-template-columns: repeat(3, 1fr); } }
.relay { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.relay.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.relay .head { display: flex; align-items: center; gap: .65rem; }
.relay .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--gray-soft); color: var(--muted); display: grid; place-items: center; flex: none; }
.relay.on .ico { background: var(--primary-soft); color: var(--primary); }
.relay .name { font-weight: 650; }
.relay .sub { font-size: .8rem; color: var(--muted); }
.relay .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.cmd-status { font-size: .8rem; display: flex; align-items: center; gap: .35rem; min-height: 1.2em; }
.cmd-steps { display: flex; gap: .25rem; align-items: center; }
.cmd-steps .st { color: var(--muted); }
.cmd-steps .st.done { color: var(--ok); font-weight: 600; }
.cmd-steps .st.cur { color: var(--info); font-weight: 600; }
.cmd-steps .st.bad { color: var(--err); font-weight: 600; }
.scene-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.thermo { display: flex; flex-direction: column; gap: .6rem; }
.thermo .target { display: flex; align-items: center; gap: .6rem; }
.thermo .target .val { font-size: 1.9rem; font-weight: 700; min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums; }
.warn-list > * + * { margin-top: .5rem; }
details.more { margin-top: 1rem; }
details.more > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: .4rem 0; }

/* Olay akışı */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: .8rem; min-width: 7.5rem; font-variant-numeric: tabular-nums; }
.feed .what { flex: 1; word-break: break-word; }
.feed li.sync { opacity: .55; font-size: .82rem; padding: .3rem 0; }
.lvl { font-weight: 700; font-size: .75rem; padding: 0 .35rem; border-radius: 4px; }
.lvl-E { background: var(--err-soft); color: var(--err); }
.lvl-W { background: var(--warn-soft); color: var(--warn); }
.lvl-I { background: var(--info-soft); color: var(--info); }
.lvl-D { background: var(--gray-soft); color: var(--muted); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.filters > * { flex: 1 1 130px; width: auto; }

/* Grafik */
.chart-wrap { position: relative; width: 100%; }
.chart { width: 100%; height: 280px; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .line-temp { stroke: var(--chart-temp); fill: none; stroke-width: 2; }
.chart .line-hum { stroke: var(--chart-hum); fill: none; stroke-width: 1.6; stroke-dasharray: 4 3; }
.chart .band-temp { fill: var(--chart-temp); opacity: .12; }
.chart .hover-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .55rem; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .3rem; }
.sw-temp { background: var(--chart-temp); }
.sw-hum { background: var(--chart-hum); }
.strips { margin-top: .75rem; }
.strip-row { display: grid; grid-template-columns: 7.5rem 1fr 4.5rem; gap: .5rem; align-items: center; font-size: .8rem; margin-bottom: .3rem; }
.strip-row .bar { position: relative; height: 12px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; }
.strip-row .seg { position: absolute; top: 0; bottom: 0; background: var(--strip); border-radius: 2px; }
.strip-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range-btns { display: flex; gap: .35rem; flex-wrap: wrap; }
.range-btns .btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* Kurulum kutusu */
.setup-box { border: 1px dashed var(--primary); border-radius: var(--radius); padding: 1rem; background: var(--primary-soft); }
.setup-row { display: grid; grid-template-columns: 1fr; gap: .25rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 640px) { .setup-row { grid-template-columns: 12rem 1fr auto; align-items: center; } }
.setup-row:last-child { border-bottom: 0; }
.setup-row .k { font-weight: 600; font-size: .88rem; }
.setup-row .v { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; word-break: break-all; }
.key-reveal { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; background: var(--surface); border: 2px solid var(--warn); padding: .7rem; border-radius: var(--radius-sm); word-break: break-all; }
.qr-canvas { background: #fff; padding: 8px; border-radius: 8px; max-width: 220px; width: 100%; height: auto; image-rendering: pixelated; }
.steps { display: flex; gap: .5rem; margin-bottom: 1rem; font-size: .85rem; flex-wrap: wrap; }
.steps .s { padding: .3rem .7rem; border-radius: 999px; background: var(--gray-soft); color: var(--muted); font-weight: 600; }
.steps .s.active { background: var(--primary); color: var(--on-primary); }
.steps .s.done { background: var(--ok-soft); color: var(--ok); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .toast, .switch .slider::before { transition: none; } }

/* Modal (dialog) */
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.modal::backdrop { background: rgba(10, 15, 20, .55); }
dialog.modal .m-body { padding: 1.1rem; }
dialog.modal .m-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* Bildirimler */
.notif { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.notif.unread .t { font-weight: 700; }
.notif.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: .45rem; flex: none; }
.notif .t { margin-bottom: .15rem; }
.notif .b { color: var(--muted); font-size: .88rem; white-space: pre-line; }
.notif .when { color: var(--muted); font-size: .78rem; }

.pre { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .5rem; font-size: .8rem; margin: .35rem 0 0; max-height: 12rem; overflow: auto; }
.pager { display: flex; justify-content: center; margin-top: .75rem; }
.bar-h { height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.bar-h > i { display: block; height: 100%; background: var(--primary); }
.privacy h2 { margin-top: 1.5rem; }
.hidden-copy { position: fixed; left: -9999px; top: 0; }
progress { width: 100%; height: 10px; accent-color: var(--primary); }
.tabs a.btn { border-radius: 0; border-bottom: 2px solid transparent; }
.tabs a.active-tab { color: var(--primary); border-bottom-color: var(--primary); }
.tabs.subnav { flex-wrap: wrap; overflow: visible; }
.card { scroll-margin-top: 72px; }

/* Mobil iyileştirmeler */
.flash + .auth-wrap { padding-top: 1rem; }
.setup-row .btn { justify-self: start; }
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .6rem; margin-bottom: .6rem; background: var(--surface); }
  table.stack td { border: 0; padding: .25rem 0; display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; flex: none; max-width: 40%; }
  table.stack td[data-label=""]::before, table.stack td:not([data-label])::before { content: none; }
  table.stack td:empty { display: none; }
  table.stack td > * { min-width: 0; }
  .table-wrap:has(table.stack) { overflow: visible; }
}
.date-filter { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 130px; }
.date-filter span { font-size: .75rem; color: var(--muted); }
