@import url('/fonts/inter/index.css');

/* =========================================================================
   Tasarım tokenları — açık tema varsayılan, koyu tema sistem tercihine göre.
   Ders ekranı her zaman koyu (html[data-theme="dark"]).
   ========================================================================= */
:root {
  --font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f2f1ed;
  --surface-3: #e9e7e1;
  --border: #e5e3dc;
  --border-strong: #d3d0c6;
  --text: #1a1a1d;
  --text-2: #55555c;
  --text-3: #76767e;

  --accent: #f2a93b;          /* pirinç/amber — müzik aleti tonu */
  --accent-hover: #f5b858;
  --on-accent: #241604;
  --accent-text: #9a5b06;     /* açık zeminde okunur amber metin */
  --accent-soft: #f2a93b24;

  --danger: #d93b3b;
  --danger-hover: #e65151;
  --danger-soft: #d93b3b1f;
  --success: #1f9d55;
  --success-soft: #1f9d5520;

  --stage: #0a0a0c;
  --tile: #17171b;
  --glass: rgb(18 18 22 / 72%);
  --chart-1: #e0952a;
  --chart-2: #3e7bfa;
  --chart-grid: #00000010;
  --warn: #c27c0e;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 6%);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 18%), 0 2px 8px rgb(0 0 0 / 8%);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e; --surface: #151518; --surface-2: #1d1d21; --surface-3: #27272c;
    --border: #2a2a30; --border-strong: #3b3b43;
    --text: #f3f3f4; --text-2: #a8a8b0; --text-3: #7c7c85;
    --accent-text: #f7bd62; --accent-soft: #f2a93b1f;
    --danger: #e5484d; --danger-hover: #ef5f63; --danger-soft: #e5484d24;
    --success: #30c46e; --success-soft: #30c46e22;
    --chart-1: #f2a93b; --chart-2: #6f9bff; --chart-grid: #ffffff10; --warn: #f2a93b;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
    --shadow-lg: 0 16px 48px rgb(0 0 0 / 55%), 0 2px 8px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0e; --surface: #151518; --surface-2: #1d1d21; --surface-3: #27272c;
  --border: #2a2a30; --border-strong: #3b3b43;
  --text: #f3f3f4; --text-2: #a8a8b0; --text-3: #7c7c85;
  --accent-text: #f7bd62; --accent-soft: #f2a93b1f;
  --danger: #e5484d; --danger-hover: #ef5f63; --danger-soft: #e5484d24;
  --success: #30c46e; --success-soft: #30c46e22;
  --chart-1: #f2a93b; --chart-2: #6f9bff; --chart-grid: #ffffff10; --warn: #f2a93b;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
  --shadow-lg: 0 16px 48px rgb(0 0 0 / 55%), 0 2px 8px rgb(0 0 0 / 40%);
  color-scheme: dark;
}

/* ============================== Temel ============================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent-text); }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }

.i { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.brand-mark .i { width: 16px; height: 16px; stroke-width: 2.4; }

/* ============================== Butonlar ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 550; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
a.btn { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* ============================== Formlar ============================== */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.input, .select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: var(--text-3); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2376767e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; text-overflow: ellipsis; }
.field-error { color: var(--danger); font-size: 13px; min-height: 0; }
.field-error:empty { display: none; }

/* Simge önekli cihaz seçici (ön ekran) */
.device { position: relative; display: flex; align-items: center; min-width: 0; }
.device .i { position: absolute; left: 12px; color: var(--text-2); pointer-events: none; width: 16px; height: 16px; }
.device .select { height: 38px; padding-left: 36px; font-size: 13px; border-radius: 999px; background-color: var(--surface); }

/* Anahtar (switch) */
.switch { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; flex: 0 0 auto; transition: background .2s, border-color .2s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 30%); transition: transform .2s var(--ease); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch-row .txt { flex: 1; min-width: 0; }
.switch-row .txt b { display: block; font-weight: 550; font-size: 14px; }
.switch-row .txt small { display: block; color: var(--text-3); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }

/* Bölümlü seçici */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 550; cursor: pointer; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ============================== Ortak parçalar ============================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.chip.live { color: var(--success); background: var(--success-soft); border-color: transparent; }
.chip.live .dot { background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2s infinite; }
.chip.accent { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.avatar { --h: 30; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: 13px; font-weight: 650; color: hsl(var(--h) 70% 22%); background: hsl(var(--h) 75% 80%); letter-spacing: .02em; }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 80% 86%); background: hsl(var(--h) 35% 28%); }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Menüler (popover) */
.menu {
  position: absolute; z-index: 60; min-width: 240px; max-width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg);
  animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.menu-label { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-size: 14px; cursor: pointer; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); box-shadow: none; }
.menu-item .i { width: 18px; height: 18px; color: var(--text-2); }
.menu-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .check { color: var(--accent-text); visibility: hidden; }
.menu-item[aria-checked="true"] .check { visibility: visible; }
.menu-item.danger, .menu-item.danger .i { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu .switch-row { padding: 8px 10px; }

/* Diyaloglar */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog[open] { animation: pop .18s var(--ease); }
dialog::backdrop { background: rgb(0 0 0 / 55%); backdrop-filter: blur(4px); }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 4px; }
.dlg-head h3 { font-size: 18px; font-weight: 650; }
.dlg-head p { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.dlg-head .btn-icon { margin: -6px -6px 0 auto; }
.dlg-body { padding: 12px 20px; display: grid; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; }
.dlg-section { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-top: 4px; }

/* Bildirimler */
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #232328; color: #f3f3f4; border: 1px solid #ffffff14; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s var(--ease); pointer-events: auto; }
.toast .i { width: 18px; height: 18px; color: var(--accent); }
.toast.has-act { padding-right: 6px; }
.toast-act { margin-left: 6px; height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }

/* ============================== Ön ekran (katılım) ============================== */
.page { min-height: 100%; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; }
.page-main { flex: 1; display: grid; place-items: center; padding: 8px 24px 40px; }

.prejoin { width: min(1060px, 100%); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.preview-col { display: grid; gap: 14px; }
.preview { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-xl); overflow: hidden; background: #111114; box-shadow: var(--shadow-lg); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview .off-note { position: absolute; inset: 0; display: grid; place-items: center; color: #c9c9cf; font-size: 15px; }
.preview .self-name { position: absolute; left: 14px; top: 12px; padding: 4px 10px; border-radius: 999px; background: var(--glass); color: #fff; font-size: 13px; font-weight: 550; backdrop-filter: blur(8px); }
.preview .pv-ctl { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; }
.pv-btn { --lvl: 0; width: 52px; height: 52px; border-radius: 50%; border: 1px solid #ffffff2e; background: rgb(255 255 255 / 14%); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(10px); transition: background .15s; box-shadow: 0 0 0 calc(var(--lvl) * 7px) rgb(48 196 110 / 45%); }
.pv-btn:hover { background: rgb(255 255 255 / 24%); }
.pv-btn.off { background: var(--danger); border-color: transparent; box-shadow: none; }
.devices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.join-col { display: grid; gap: 22px; }
.join-col h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 680; }
.join-col .lead { color: var(--text-2); margin-top: 8px; }
.headphones { display: grid; gap: 8px; }
.headphones .note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.headphones .note .i { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-text); }

.waiting { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 28px 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.waiting .bell { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); position: relative; }
.waiting .bell::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: .5; animation: ring 2s var(--ease) infinite; }
@keyframes ring { from { transform: scale(1); opacity: .5; } to { transform: scale(1.6); opacity: 0; } }
.waiting .bell .i { width: 28px; height: 28px; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 85% { transform: rotate(-12deg); } 92% { transform: rotate(6deg); } }
.waiting h2 { font-size: 20px; font-weight: 650; }

@media (max-width: 860px) {
  .prejoin { grid-template-columns: 1fr; gap: 28px; }
  .page-main { place-items: start center; }
}
@media (max-width: 560px) {
  .devices { grid-template-columns: 1fr; }
  .page-head, .page-main { padding-left: 16px; padding-right: 16px; }
}

/* Bitiş ekranı */
.ended { width: min(420px, 100%); padding: 36px 28px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.ended .ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }

/* ============================== Ders ekranı ============================== */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: 1fr auto; background: var(--stage); color: var(--text); }
.main { position: relative; display: grid; grid-template-columns: 1fr auto; min-height: 0; }
.room { position: relative; display: grid; grid-template-columns: clamp(232px, 20%, 340px) minmax(0, 1fr); gap: 10px; margin: 12px 12px 0; min-height: 0; }
.stage { position: absolute; inset: 0; pointer-events: none; }
.stage > * { pointer-events: auto; }
.stage-area { min-height: 0; }

/* Sol sütun (%20): yüzler, düzen düğmeleri, cihazlar */
.left { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
#faceSlot { flex: none; }
.left-ctl { display: grid; gap: 10px; align-content: start; min-height: 0; overflow: auto; scrollbar-width: thin; }
.left-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; }
.left-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.left-count { text-transform: none; letter-spacing: 0; font-weight: 550; font-variant-numeric: tabular-nums; }
.left-note { font-size: 12px; color: var(--text-3); }
.mini-switch { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 550; cursor: pointer; }
.mini-switch .switch { width: 30px; height: 18px; }
.mini-switch .switch::after { width: 12px; height: 12px; }
.mini-switch .switch:checked::after { transform: translateX(12px); }
.preset-grid { gap: 6px; }
.preset-grid .layout-opt { padding: 5px 4px 5px; gap: 3px; font-size: 11.5px; border-radius: 10px; }
.preset-grid .layout-opt svg { height: 26px; }

.layout-opt svg path.ln { stroke: var(--surface); stroke-width: 1.6; fill: none; }
.layout-opt svg rect.ln2 { fill: none; stroke: var(--surface); stroke-width: 1.6; }
.layout-opt:disabled { opacity: .45; cursor: default; }
.layout-opt:disabled:hover { border-color: var(--border); color: var(--text-2); }

/* Cihaz paneli */
.devs { display: grid; gap: 8px; }
.dev-group { display: grid; gap: 2px; }
.dev-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 2px 0 2px 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dev-name .dot, .q { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.t { background: var(--accent); } .dot.s { background: #6aa8ff; }
.dev-row { display: flex; align-items: center; gap: 4px; min-height: 30px; padding-left: 17px; font-size: 13px; color: var(--text-2); }
.dev-lbl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dev-lbl small { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dev-lbl small.low { color: var(--danger); font-weight: 600; }
.q { display: inline-block; width: 7px; height: 7px; }
.q-good { background: var(--success); } .q-poor { background: var(--accent); } .q-lost { background: var(--danger); }
.dev-row.absent .dev-lbl { color: var(--text-3); }
.dev-off { font-size: 12px; color: var(--text-3); }
.dev-ok { font-size: 12px; color: var(--success); }
.dev-btn { width: 28px; height: 28px; border-radius: 8px; border: 0; display: grid; place-items: center; background: #ffffff12; color: var(--text); cursor: pointer; }
.dev-btn:hover { background: #ffffff22; }
.dev-btn.off { background: var(--danger-soft); color: #ff8b8e; }
.dev-btn .i { width: 16px; height: 16px; }
.left-sec .btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* Boş alan: nota açık değil / ekran paylaşılmıyor */
.stage-empty { position: absolute; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; border-radius: 14px; border: 1.5px dashed var(--border-strong); color: var(--text-2); transition: left .3s var(--ease), top .3s var(--ease), width .3s var(--ease), height .3s var(--ease); }
.stage-empty .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.stage-empty b { color: var(--text); font-size: 16px; }
.stage-empty p { max-width: 360px; font-size: 14px; }

/* Öğrenciye soru: "Hocanız kameranızı açmak istiyor" */
.ask-card { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 46; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); max-width: calc(100% - 32px); }
.ask-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.ask-txt { font-weight: 550; font-size: 14px; }

.narrow-only { display: none; }
@media (max-width: 760px) {
  .room { grid-template-columns: 1fr; margin: 8px 8px 0; }
  .left, .stage-area { display: none; }
  .narrow-only { display: block; }
}

/* Kamera kutuları */
.tile {
  position: absolute; background: var(--tile); border-radius: 14px; overflow: hidden;
  transition: left .3s var(--ease), top .3s var(--ease), width .3s var(--ease), height .3s var(--ease), box-shadow .2s;
  box-shadow: inset 0 0 0 1px #ffffff0d;
}
.tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .2s; }
.tile.speaking::after { box-shadow: inset 0 0 0 3px var(--success); }
.tile.dragging { transition: none; box-shadow: 0 20px 60px rgb(0 0 0 / 60%); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile.contain video { object-fit: contain; }
.tile.mirror video { transform: scaleX(-1); }
.tile .avatar-big { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .avatar-big .avatar { width: clamp(44px, 22%, 112px); height: auto; aspect-ratio: 1; font-size: clamp(15px, 2.6vw, 38px); }
.tile .label {
  position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 16px);
  padding: 4px 10px 4px 8px; border-radius: 8px; background: var(--glass); backdrop-filter: blur(10px);
  color: #fff; font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
.tile .label .nm { overflow: hidden; text-overflow: ellipsis; }
.tile .label .i { width: 14px; height: 14px; }
.tile .label .mic-off { color: #ff6b6b; }
.tile .label .teacher { color: var(--accent); }
.tile .tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.tile:hover .tools, .tile:focus-within .tools { opacity: 1; transform: none; }
.tile .tools button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid #ffffff1f; background: var(--glass); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(10px); }
.tile .tools button:hover { background: rgb(40 40 46 / 90%); }
.tile .tools button.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.tile .tools button.is-on .i { fill: currentColor; }
.tile .tools .i { width: 16px; height: 16px; }
.tile.mini .label { left: 6px; bottom: 6px; padding: 2px 8px 2px 6px; font-size: 11.5px; }
.tile.mini .tools { top: 6px; right: 6px; }
.tile.mini .tools button { width: 28px; height: 28px; }
.tile.mini .avatar-big .avatar { width: clamp(32px, 26%, 64px); font-size: 14px; }
.tile .resize { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; cursor: nwse-resize; border-right: 3px solid var(--accent); border-bottom: 3px solid var(--accent); border-radius: 0 0 6px 0; opacity: .9; }
.stage.free-edit .tile { cursor: grab; }
.stage.free-edit .tile.dragging { cursor: grabbing; }
.stage.free-edit { border-radius: 14px; background-image: radial-gradient(#ffffff12 1px, transparent 1px); background-size: 24px 24px; }

/* Alt kontrol çubuğu */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 16px 14px; }
.bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text-2); font-size: 14px; }
.bar-left .title { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-left .sep { width: 1px; height: 16px; background: var(--border-strong); }
.bar-left .timer { font-variant-numeric: tabular-nums; }
.bar-center { display: flex; align-items: center; gap: 10px; }
.bar-right { display: flex; justify-content: flex-end; gap: 8px; }

.ctl {
  position: relative; height: 48px; min-width: 48px; padding: 0 14px; border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #ffffff14; color: var(--text); cursor: pointer; transition: background .15s, color .15s;
  font-size: 14px; font-weight: 550;
}
.ctl:hover { background: #ffffff24; }
.ctl.off { background: var(--danger); color: #fff; }
.ctl.off:hover { background: var(--danger-hover); }
.ctl.on { background: var(--accent); color: var(--on-accent); }
.ctl.on:hover { background: var(--accent-hover); }
.ctl.leave { background: var(--danger); color: #fff; padding: 0 20px; }
.ctl.leave:hover { background: var(--danger-hover); }
.ctl.round { width: 48px; padding: 0; }
.ctl.flat { background: transparent; }
.ctl.flat:hover { background: #ffffff14; }
.ctl.flat[aria-expanded="true"], .ctl.flat.active { background: #ffffff1f; color: var(--accent); }
.ctl .badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.ctl .badge.alert { background: var(--accent); color: var(--on-accent); }

/* Bölünmüş buton: ana eylem + cihaz menüsü */
.split { display: inline-flex; align-items: center; border-radius: 999px; background: #ffffff14; }
.split .ctl { background: transparent; }
.split .ctl.main { width: 48px; padding: 0; }
.split .ctl.more { width: 30px; min-width: 30px; padding: 0; margin-left: -4px; }
.split .ctl.more .i { width: 16px; height: 16px; }
.split.off { background: var(--danger); }
.split.off .ctl { color: #fff; }
.split:hover { background: #ffffff20; }
.split.off:hover { background: var(--danger-hover); }

/* İpuçları (tooltip) — yalnızca fareli cihazlarda; dokunmatikte takılı kalmasın */
[data-tip] { position: relative; }
@media (hover: hover) and (pointer: fine) {
[data-tip]:hover::before, [data-tip]:focus-visible::before {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  padding: 6px 10px; border-radius: 8px; background: #2b2b31; color: #f3f3f4; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; pointer-events: none; z-index: 70; box-shadow: var(--shadow-lg); animation: pop .12s var(--ease);
}
}
.no-tip [data-tip]::before { display: none !important; }

/* Yan panel */
.side { width: 340px; margin: 12px 12px 0 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 18px; }
.side-head h2 { font-size: 16px; font-weight: 650; flex: 1; }
.side-body { overflow: auto; padding: 0 12px 16px; display: grid; gap: 18px; align-content: start; }
.section-head { display: flex; align-items: center; gap: 8px; padding: 0 6px 6px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.section-head .grow { flex: 1; }
.host-box { padding: 4px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.host-box .btn { margin: 8px 0; }

.person { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.person:hover { background: var(--surface-2); }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who small { display: block; color: var(--text-3); font-size: 12.5px; }
.person .state { display: flex; gap: 2px; color: var(--text-3); }
.person .state .i { width: 18px; height: 18px; }
.person .state .off { color: var(--danger); }
.person .act { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.person .act:hover { background: var(--surface-3); color: var(--text); }
.person .act.ok { color: var(--success); }
.person .act.ok:hover { background: var(--success-soft); }
.person .act.no { color: var(--danger); }
.person .act.no:hover { background: var(--danger-soft); }
.person.waiting-person .avatar { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Bekleme odası bildirimi (hoca) */
.lobby-card { position: absolute; top: 24px; right: 24px; z-index: 45; width: min(360px, calc(100% - 48px)); padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); }
.lobby-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.lobby-title .i { color: var(--accent); }
.lobby-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.lobby-row + .lobby-row { border-top: 1px solid var(--border); }
.lobby-row .nm { flex: 1; min-width: 0; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-foot { display: flex; gap: 8px; margin-top: 8px; }
.lobby-foot .btn { flex: 1; }

/* Düzen seçici */
.layout-menu { width: 380px; padding: 12px; }
.layout-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layout-opt { display: grid; gap: 6px; justify-items: center; padding: 8px 6px 10px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 550; color: var(--text-2); transition: border-color .15s, background .15s; }
.layout-opt:hover { border-color: var(--border-strong); color: var(--text); }
.layout-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.layout-opt svg { width: 100%; height: auto; display: block; }
.layout-opt svg rect { fill: var(--surface-3); }
.layout-opt.active svg rect.hl, .layout-opt:hover svg rect.hl { fill: var(--accent); }
.layout-opt svg rect.hl { fill: var(--text-3); }
.layout-desc { font-size: 12.5px; color: var(--text-3); padding: 10px 4px 2px; min-height: 2.9em; }

/* Oda ekranında menü/diyalog: koyu temada biraz daha açık yüzey */
.app .menu { background: #1f1f24; }

@media (max-width: 1100px) { .bar-left .role { display: none; } }
@media (max-width: 900px) {
  .side { position: fixed; z-index: 55; inset: auto 0 0 0; width: auto; max-height: 78vh; margin: 0; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); animation: sheet .25s var(--ease); }
  @keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
  .bar-left { display: none; }
  .bar { grid-template-columns: 1fr auto; }
  .bar-center { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .bar { padding: 8px 8px 12px; gap: 6px; }
  .bar-center { gap: 6px; }
  .desk-only { display: none !important; }
  .ctl { height: 44px; min-width: 44px; }
  .ctl.round, .split .ctl.main { width: 44px; }
  .ctl.leave { padding: 0 14px; }
  .ctl.leave .lbl { display: none; }
  .split .ctl.more { display: none; }
  .stage { margin: 8px 8px 0; }
  .lobby-card { top: 12px; right: 12px; width: calc(100% - 24px); }
  .layout-menu { width: calc(100vw - 24px); }
}
@media (min-width: 641px) { .mob-only { display: none !important; } }

/* ============================== Nota ============================== */
.sheet-tile { background: #26262b; }
.sheet-tile .label { top: 8px; bottom: auto; }
.sheet-wrap { position: absolute; inset: 0; overflow: hidden; display: flex; }
.sheet-scroll { position: relative; flex: 1; min-width: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #ffffff30 transparent; }
.sheet-scroll.follow { overflow: hidden; }
.sheet-box { position: relative; }
.sheet-box canvas { position: absolute; left: 0; top: 0; }
.sheet-thumbs { flex: none; width: 112px; overflow-y: auto; padding: 12px 8px 64px 12px; display: grid; gap: 10px; align-content: start; scrollbar-width: thin; }
.sheet-thumb { position: relative; padding: 0; border: 0; border-radius: 4px; background: #fff; cursor: pointer; opacity: .6; transition: opacity .15s; overflow: hidden; }
.sheet-thumb:disabled { cursor: default; }
.sheet-thumb canvas { width: 100%; height: auto; display: block; }
.sheet-thumb span { position: absolute; right: 4px; bottom: 4px; font-size: 11px; font-weight: 650; background: #000a; color: #fff; padding: 0 5px; border-radius: 4px; }
.sheet-thumb:hover:not(:disabled) { opacity: .9; }
.sheet-thumb.cur { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet-zoom { font-size: 12.5px; font-weight: 600; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.sheet-pdf { background: #fff; border-radius: 4px; box-shadow: 0 6px 28px rgb(0 0 0 / 45%); }
.sheet-ink { pointer-events: none; }
.sheet-ink.active { pointer-events: auto; cursor: crosshair; touch-action: none; }
.sheet-status { position: absolute; inset: 0; display: grid; place-items: center; color: #b9b9c0; font-size: 14px; }
.sheet-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 2px; align-items: center; background: var(--glass); border: 1px solid #ffffff1a; border-radius: 14px; padding: 4px; z-index: 2; backdrop-filter: blur(12px); box-shadow: 0 8px 30px rgb(0 0 0 / 40%); color: #fff; }
.sheet-bar button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.sheet-bar button:hover:not(:disabled) { background: #ffffff1f; }
.sheet-bar button:disabled { opacity: .35; cursor: default; }
.sheet-bar button .i { width: 18px; height: 18px; }
.sheet-bar button.pen::after { content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--pen); box-shadow: inset 0 0 0 2px #00000030; transition: transform .15s; }
.sheet-bar button.pen.is-on { background: #ffffff24; }
.sheet-bar button.fit.is-on { color: var(--accent); }
.sheet-bar button.pen.is-on::after { transform: scale(1.15); box-shadow: 0 0 0 2px #fff; }
.sheet-bar .sep { width: 1px; height: 20px; background: #ffffff30; margin: 0 6px; }
.sheet-page { font-size: 13px; font-weight: 600; padding: 0 8px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }

.sheet-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.sheet-row + .sheet-row { margin-top: 8px; }
.sheet-row .file-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: 0 0 auto; }
.sheet-row .meta { flex: 1; min-width: 0; }
.sheet-row .meta b { display: block; font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-row .meta small { color: var(--text-3); font-size: 12.5px; }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 22px; border-radius: 14px; border: 1.5px dashed var(--border-strong); color: var(--text-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone .i { width: 24px; height: 24px; color: var(--accent-text); }
.dropzone b { font-weight: 600; }

/* ============================== Yönetim ============================== */
.admin-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.admin-main { width: min(1040px, 100%); margin: 0 auto; padding: 36px 24px 64px; }
.admin-title { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-title h1 { font-size: 28px; font-weight: 680; }
.create-bar { display: flex; gap: 10px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 28px; }
.create-bar .input { border: 0; box-shadow: none; background: transparent; height: 44px; }
.create-bar .input:focus { box-shadow: none; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.room-item { position: relative; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 14px; transition: border-color .2s, box-shadow .2s; }
.room-item:hover { border-color: var(--border-strong); }
.room-item.new { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.room-item .top { display: flex; gap: 12px; align-items: flex-start; }
.room-item .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: 0 0 auto; }
.room-item h3 { font-size: 16px; font-weight: 620; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.room-item .acts { display: flex; gap: 8px; }
.room-item .acts .btn-primary, .room-item .acts .btn-secondary { flex: 1; min-width: 0; padding: 0 12px; }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; border-radius: var(--r-lg); border: 1.5px dashed var(--border-strong); color: var(--text-2); }
.empty .ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.login-card { width: min(400px, 100%); padding: 32px 28px; display: grid; gap: 18px; }
@media (max-width: 560px) {
  .admin-main { padding: 24px 16px 48px; }
  .admin-head { padding: 14px 16px; }
  .create-bar { flex-direction: column; }
  .create-bar .btn { width: 100%; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: hsl(var(--h) 80% 86%); background: hsl(var(--h) 35% 28%); } }
/* Ekran kenarındaki düğmelerde ipucu taşmasın */
@media (hover: hover) and (pointer: fine) {
  .bar-right [data-tip]:hover::before, .bar-right [data-tip]:focus-visible::before { left: auto; right: 0; transform: none; }
}

/* ============================== Sunucu paneli ============================== */
.nav-tabs { display: flex; gap: 2px; margin-left: 12px; }
.nav-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 550; }
.nav-tabs a:hover { background: var(--surface-2); color: var(--text); }
.nav-tabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.chip.bad { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.chip.bad .dot { background: var(--danger); }

.dash-main { width: min(1200px, 100%); }
.dash-main .segmented { min-width: 240px; }
.dash-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 20px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger); font-size: 14px; }
.dash-alert b { font-weight: 650; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px; border-radius: var(--r-lg); display: grid; gap: 10px; align-content: start; min-width: 0; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.kpi .val { font-size: 28px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val small { font-size: 14px; font-weight: 550; color: var(--text-2); letter-spacing: 0; }
.kpi .val .dir { font-size: 16px; color: var(--text-3); margin-right: 2px; }
.kpi .sub { font-size: 12.5px; color: var(--text-3); }

.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--success); transition: width .6s var(--ease), background .3s; }
.meter > i[data-level="warn"] { background: var(--warn); }
.meter > i[data-level="bad"] { background: var(--danger); }
.meter-lg { height: 10px; }

.charts, .dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; margin-bottom: 16px; }
.chart-card, .dash-card { padding: 18px; border-radius: var(--r-lg); min-width: 0; }
.chart-card { padding-bottom: 10px; }
.chart-card h3, .dash-card h3 { font-size: 15px; font-weight: 620; }
.chart-card .subtle { margin: 2px 0 10px; }
.chart { min-width: 0; }
.uplot { font-family: var(--font); }
.u-legend { font-size: 12.5px; color: var(--text-2); text-align: left; margin-top: 4px; }
.u-legend th { font-weight: 550; }
.u-legend .u-marker { border-radius: 3px; width: 10px; height: 10px; }
.u-legend td { font-variant-numeric: tabular-nums; }
.u-select { background: var(--accent-soft); }

.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dash-table th { text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 6px; white-space: nowrap; }
.dash-table td { padding: 10px 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.dash-table td b { display: block; font-weight: 550; }
.dash-table td small { display: block; color: var(--text-3); font-size: 12px; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-table .muted-row td { color: var(--text-2); }
.dash-table .empty-row { color: var(--text-3); text-align: center; padding: 22px 6px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-st="ok"] { color: var(--success); }
.status[data-st="bad"] { color: var(--danger); }

.cores { display: grid; gap: 10px; }
.core { display: grid; grid-template-columns: 20px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.core span { color: var(--text-3); }
.core b { font-weight: 550; text-align: right; }
code { font-size: .92em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
@media (max-width: 560px) {
  .nav-tabs { margin-left: 0; }
  .admin-head .brand { font-size: 0; gap: 0; }
  #liveChip span:last-child { display: none; }
  .dash-main .segmented { min-width: 0; width: 100%; }
  .dash-table .hide-sm { display: none; }
}

/* ============================== API: anahtarlar + referans ============================== */
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.new-key { padding: 16px; margin-bottom: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--success) 45%, transparent); background: var(--success-soft); }
.new-key .nk-head { display: flex; align-items: center; gap: 8px; color: var(--success); margin-bottom: 4px; }
.new-key .nk-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.new-key .nk-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 10px 12px; font-size: 13.5px; background: var(--surface); }

.code-block { position: relative; background: #121215; border: 1px solid #ffffff14; border-radius: 12px; overflow: hidden; color: #e7e7ea; }
.code-block + .code-block { margin-top: 14px; }
.code-block pre { margin: 0; padding: 14px 16px; overflow: auto; font-size: 12.5px; line-height: 1.65; white-space: pre; }
.code-block .btn-ghost { color: #a8a8b0; }
.code-block .btn-ghost:hover { background: #ffffff14; color: #fff; }
.code-block > .copy { position: absolute; top: 8px; right: 8px; }
.cb-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 14px; border-bottom: 1px solid #ffffff12; font-size: 12px; font-weight: 550; color: #a8a8b0; }
.cb-head .btn { width: 30px; height: 30px; padding: 0; }
.t-key { color: #f7bd62; } .t-str { color: #a5d6a7; } .t-num { color: #8ab4ff; } .t-lit { color: #d8a4f5; }

body.docs-body { height: auto; }
.docs-head { position: sticky; top: 0; z-index: 10; }
.docs-title { font-weight: 600; color: var(--text-2); padding-left: 12px; border-left: 1px solid var(--border); }
.docs { display: grid; grid-template-columns: 264px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.docs-nav { position: sticky; top: 65px; height: calc(100vh - 65px); overflow: auto; padding: 24px 14px 40px; border-right: 1px solid var(--border); }
.nav-group + .nav-group { margin-top: 20px; }
.nav-label { padding: 0 10px 6px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.docs-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.docs-nav a:hover { background: var(--surface-2); color: var(--text); }
.docs-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); }
.m { display: inline-block; min-width: 40px; padding: 3px 0; border-radius: 5px; text-align: center; font: 650 10.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.m-get { color: var(--success); background: var(--success-soft); }
.m-post { color: #3e7bfa; background: #3e7bfa1f; }
.m-patch { color: var(--accent-text); background: var(--accent-soft); }
.m-delete { color: var(--danger); background: var(--danger-soft); }
.docs-main { padding: 40px 48px 160px; min-width: 0; }
.docs-main p { margin: 8px 0; color: var(--text-2); line-height: 1.65; }
.docs-main code:not(pre code) { font-size: .88em; }
.doc-intro { max-width: 760px; padding-bottom: 32px; }
.doc-intro h1 { font-size: 34px; font-weight: 700; margin-bottom: 12px; }
.base-url { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.base-url code { border: 0; background: none; padding: 0; font-size: 14px; overflow-wrap: anywhere; }
.tag-head { padding: 56px 0 4px; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.tag-head h2 { font-size: 26px; font-weight: 680; }
.op { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 36px 0; border-top: 1px solid var(--border); scroll-margin-top: 72px; }
.tag-head + .op { border-top: 0; }
.op h2 { font-size: 24px; font-weight: 680; }
.op h3 { font-size: 20px; font-weight: 650; }
.op h4 { margin: 24px 0 6px; font-size: 13px; font-weight: 650; color: var(--text); }
.op h4 .subtle { font-weight: 500; margin-left: 6px; }
.op-code { align-self: start; position: sticky; top: 88px; min-width: 0; }
.op-path { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.op-path code { border: 0; background: none; padding: 0; font-size: 14px; font-weight: 550; color: var(--text); overflow-wrap: anywhere; }
.ftable { width: 100%; border-collapse: collapse; }
.ftable td { padding: 10px 0; border-top: 1px solid var(--border); vertical-align: top; }
.ftable td:first-child { width: 38%; padding-right: 16px; }
.ftable p { margin: 0; font-size: 13.5px; }
.ftable .fname { display: block; border: 0; background: none; padding: 0; font-size: 13px; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.ftable .ftype { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.ftable .flim { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.resp { list-style: none; margin: 0; padding: 0; }
.resp li { padding: 7px 0; font-size: 13.5px; color: var(--text-2); border-top: 1px solid var(--border); }
.resp .code { display: inline-block; margin-right: 10px; padding: 2px 6px; border-radius: 5px; font: 650 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.resp .c2 { color: var(--success); background: var(--success-soft); }
.resp .c4 { color: var(--accent-text); background: var(--accent-soft); }
.resp .c5 { color: var(--danger); background: var(--danger-soft); }
@media (max-width: 1100px) {
  .op { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .op-code { position: static; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { display: none; }
  .docs-main { padding: 28px 16px 96px; }
  .docs-head .btn-ghost, .docs-head .chip { display: none; }
  .docs-title { padding-left: 10px; }
  .new-key .nk-row { flex-direction: column; align-items: stretch; }
}

/* ============================== Telefon: piyano kamerası (/k) ============================== */
body.cam-body { background: var(--stage); min-height: 100%; height: auto; }
.cam-body [hidden] { display: none !important; }
.cam-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.cam-page > .brand { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 20px; }
.cam-card { width: min(420px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; }
.cam-card h1 { font-size: 24px; }
.cam-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.cam-code { display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; margin-top: 6px; }
.cam-code .input { height: 52px; font-size: 24px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.cam-head { width: min(860px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cam-preview { position: relative; width: min(860px, 100%); aspect-ratio: 16 / 9; border-radius: var(--r-xl); overflow: hidden; background: #111114; box-shadow: var(--shadow-lg); }
.cam-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-preview .off-note { position: absolute; inset: 0; display: grid; place-items: center; color: #c9c9cf; }
.cam-guide { position: absolute; inset: 24% 5% 22%; border: 2px dashed rgb(255 255 255 / 55%); border-radius: 14px; pointer-events: none; }
.cam-guide span { position: absolute; top: -32px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; background: rgb(0 0 0 / 60%); padding: 3px 12px; border-radius: 999px; color: #fff; }
.cam-tips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--text-2); font-size: 14px; }
.cam-tips li { display: flex; align-items: center; gap: 6px; }
.cam-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cam-forget { color: var(--text-3); }

.cam-live { position: fixed; inset: 0; background: #000; color: #fff; }
.cam-live video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-top, .cam-bottom { position: absolute; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 10px; }
.cam-top { top: max(12px, env(safe-area-inset-top)); justify-content: space-between; }
.cam-bottom { bottom: max(12px, env(safe-area-inset-bottom)); }
.cam-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: rgb(0 0 0 / 62%); color: #fff; font-size: 14px; font-weight: 600; border: 0; backdrop-filter: blur(8px); }
.cam-pill.mono { font-variant-numeric: tabular-nums; font-weight: 500; color: #ddd; }
.cam-pill i { width: 10px; height: 10px; border-radius: 50%; background: #8a8a92; }
.cam-pill.live i { background: var(--danger); animation: pulse 2s infinite; }
.cam-pill.wait i { background: var(--accent); }
.btn-like { cursor: pointer; }
.btn-like.danger { background: var(--danger); }
.cam-zoom { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(0 0 0 / 62%); }
.cam-zoom button { height: 30px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: #fff; font-variant-numeric: tabular-nums; cursor: pointer; }
.cam-zoom button.on { background: #fff; color: #000; }
.cam-dim { position: fixed; inset: 0; background: #000; display: grid; place-items: end center; padding-bottom: 28px; z-index: 5; }
.cam-dim span { color: #3a3a40; font-size: 13px; }

.cam-rotate { display: none; }
@media (orientation: portrait) {
  body[data-view="readyView"] .cam-rotate, body[data-view="liveView"] .cam-rotate {
    display: grid; position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10;
    grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 14px 16px; border-radius: 16px;
    background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-lg);
  }
  .cam-rotate .i { grid-row: span 2; width: 28px; height: 28px; }
  .cam-rotate span { font-size: 13px; }
  body[data-view="liveView"] .cam-bottom { bottom: 110px; }
}

/* ============================== Telefon eşleştirme (ders ekranı) ============================== */
.phone-hint { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text); text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.phone-hint .ph-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: none; }
.phone-hint .txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
.phone-hint small { color: var(--text-2); font-size: 13px; }
.pair-dlg { width: min(640px, calc(100vw - 32px)); }
.pair-body { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
.pair-qr { aspect-ratio: 1; background: #fff; border-radius: 14px; padding: 10px; display: grid; place-items: center; color: #555; font-size: 13px; transition: opacity .2s; }
.pair-qr svg { width: 100%; height: 100%; display: block; }
.pair-qr.expired { opacity: .15; }
.pair-qr .spinner { color: #999; }
.pair-side { display: grid; gap: 16px; min-width: 0; }
.pair-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; }
.pair-manual { display: grid; gap: 4px; }
.pair-code { font-size: 30px; font-weight: 700; letter-spacing: .14em; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pair-ok { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 24px 0 8px; }
.pair-ok .ok-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
@media (max-width: 560px) { .pair-body { grid-template-columns: 1fr; } .pair-qr { width: min(240px, 100%); justify-self: center; } }
/* Yatay telefon (kısa ekran): önizleme solda, ipuçları ve düğmeler sağda; her şey tek ekrana sığar */
@media (orientation: landscape) and (max-height: 540px) {
  #readyView { display: grid; grid-template-columns: auto minmax(220px, 1fr); grid-template-rows: auto 1fr auto auto auto auto auto auto 1fr;
    grid-template-areas: "head head" "prev ." "prev net" "prev tips" "prev fit" "prev act" "prev err" "prev forget"; gap: 10px 20px; align-items: start; justify-content: center; }
  #readyView .cam-fit { grid-area: fit; }
  /* Kısa ekranda ipuçları yerine yalnızca kadraj önerisi; düğmeler normal boy */
  #readyView .cam-tips { display: none; }
  #readyView .cam-actions .btn { height: 42px; font-size: 14px; }
  #readyView .cam-fit { font-size: 12px; }
  #readyView .cam-head { grid-area: head; width: 100%; }
  #readyView .cam-preview { grid-area: prev; width: auto; height: calc(100dvh - 96px); max-width: 62vw; align-self: center; }
  #readyView .cam-tips { grid-area: tips; flex-direction: column; align-items: flex-start; justify-content: start; }
  #readyView .cam-actions { grid-area: act; flex-direction: column; align-items: stretch; }
  #readyView .cam-actions .btn { width: 100%; }
  #readyView #readyErr { grid-area: err; }
  #readyView .cam-forget { grid-area: forget; justify-self: start; }
  .cam-guide span { top: 6px; }
}
.sheet-wrap.with-thumbs ~ .label { left: 128px; }
.cam-center { position: absolute; top: max(60px, calc(env(safe-area-inset-top) + 56px)); left: 0; right: 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.cam-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: #000d; color: #ddd; font-size: 15px; }

/* Bağlantı testi */
.net-test { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.net-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); flex: none; }
.net-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.net-txt b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.net-txt small { font-size: 12.5px; color: var(--text-2); }
.net-test.good .net-ico { background: var(--success-soft); color: var(--success); }
.net-test.ok .net-ico { background: var(--accent-soft); color: var(--accent-text); }
.net-test.poor .net-ico { background: var(--danger-soft); color: var(--danger); }
.cam-net { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; margin: 0; }
.cam-net.good { color: var(--success); } .cam-net.ok { color: var(--accent-text); } .cam-net.poor { color: var(--danger); }
@media (orientation: landscape) and (max-height: 540px) { #readyView .cam-net { grid-area: net; } }

/* Gömülü (iframe) kullanım: marka başlığı üst sayfada zaten var */
.embed .page-head { display: none; }
.embed .page-main { padding-top: 24px; }

/* Ders bağlantısını paylaş */
.share-menu { width: min(340px, calc(100vw - 24px)); }
.share-hint { font-size: 12.5px; color: var(--text-2); padding: 0 10px 8px; }
.share-url { margin: 0 4px 6px; width: calc(100% - 8px); height: 38px; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Piyano kamerası kadrajı */
.cam-fit { max-width: 640px; font-size: 13px; color: var(--text-3); text-align: center; margin: 0; }
.cam-fit b { color: var(--text-2); font-weight: 600; }
@media (orientation: landscape) and (max-height: 540px) { .cam-fit { text-align: left; } }
.framing-menu { width: min(320px, calc(100vw - 24px)); }
.menu-hint { font-size: 12.5px; color: var(--text-3); padding: 6px 10px 4px; margin: 0; }
.zoom-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; }
.zoom-row .btn { flex: 1; gap: 6px; }
.zoom-val { min-width: 44px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile.zoomed { cursor: grab; }
.tile.zoomed.panning { cursor: grabbing; }
.tile.zoomed.panning video { transition: none; }
.tile video { transition: transform .2s var(--ease); }
.zoom-badge { position: absolute; right: 8px; bottom: 8px; height: 26px; padding: 0 9px; border-radius: 8px; border: 1px solid #ffffff2a; background: var(--glass); color: var(--accent); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; backdrop-filter: blur(10px); }
