/* ExposiaVR doktor portali -- sicak krem / acik kahve tema, ortalanmis duzen.
   Komut renklerinin ANLAMI masaustu "MRI Simulasyon Kontrol Paneli" (mri_control_app.py) ile ayni
   (yesil = kalibre/otur, mavi = kaydir/yat, turuncu = ses/kalk, kirmizi = havla); tonlar sicak
   paletle uyumlu hale getirildi. Bilincli olarak tek (acik) tema: krem gorunum her yerde ayni kalsin. */
:root {
  --bg: #f4ede1;
  --bg-deep: #ebe1d0;
  --paper: #fffaf1;
  --paper-2: #f8f0e3;
  --line: #e4d6c1;
  --line-strong: #d3bf9f;
  --text: #2f241b;
  --muted: #7b6754;
  --dim: #a9947c;

  --primary: #8b5a34;
  --primary-hover: #744827;
  --primary-soft: #f0e0cc;
  --on-primary: #fffaf1;

  --green: #5b7d4f;
  --green-soft: #e5ecda;
  --blue: #4a6c8a;
  --blue-soft: #e1e8ee;
  --orange: #c0672f;
  --orange-soft: #f6e1cf;
  --red: #ab4236;
  --red-soft: #f4dad4;

  --t: var(--primary);
  --ts: var(--primary-soft);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --shadow: 0 1px 2px rgba(74, 48, 24, .05), 0 6px 18px rgba(74, 48, 24, .06);
  --shadow-lift: 0 2px 4px rgba(74, 48, 24, .07), 0 14px 32px rgba(74, 48, 24, .12);
  color-scheme: light;
}

/* ---------- Temel ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--sans); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; cursor: pointer; border: none; border-radius: 12px; color: inherit; background: none; transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
input {
  font: inherit; background: var(--paper); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px;
  transition: border-color .18s, box-shadow .18s;
}
input::placeholder { color: var(--dim); }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 40px; line-height: 1.15; }
h2 { font-size: 22px; }
.muted { color: var(--muted); font-size: 13.5px; }
.error { color: var(--red); min-height: 1.2em; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.primary { background: var(--primary); color: var(--on-primary); font-weight: 600; padding: 11px 20px; }
.primary:not(:disabled):hover { background: var(--primary-hover); }
.ghost {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--paper); color: var(--text); border: 1px solid var(--line-strong);
  padding: 9px 16px; font-size: 13.5px; font-weight: 500; border-radius: 999px;
}
.ghost:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }

.green { --t: var(--green); --ts: var(--green-soft); }
.blue { --t: var(--blue); --ts: var(--blue-soft); }
.orange { --t: var(--orange); --ts: var(--orange-soft); }
.red { --t: var(--red); --ts: var(--red-soft); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.logo {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle at 34% 50%, var(--paper) 0 4px, transparent 4.5px),
    radial-gradient(circle at 66% 50%, var(--paper) 0 4px, transparent 4.5px),
    var(--primary);
}

/* ---------- Ust menu ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.nav { display: flex; gap: 4px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.nav-item { padding: 7px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav-item:hover { color: var(--text); }
.nav-item.active { background: var(--paper); color: var(--text); box-shadow: 0 1px 3px rgba(74, 48, 24, .12); }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; font-size: 13.5px; min-width: 0; }
#customerName { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout { padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; }
.logout:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Sayfa ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 40px 24px 80px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px 28px; margin: 0 auto 24px; box-shadow: var(--shadow);
}
.account { max-width: 880px; }
.account > .muted { margin: 4px 0 16px; }
.account .row input { flex: 1 1 180px; }

.banner {
  max-width: 880px; margin: 0 auto 24px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--orange-soft); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent);
  border-radius: 16px; padding: 13px 18px; font-size: 13.5px;
}
.banner::before { content: "!"; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: var(--paper); font-weight: 700; font-size: 13px; }

/* ---------- Cihaz secimi ---------- */
.devices-bar { text-align: center; margin-bottom: 40px; }
.devices-bar .eyebrow { margin-bottom: 14px; }
.devices-bar .hint, .hint { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.device-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.device-chip {
  display: flex; align-items: center; gap: 11px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 20px 9px 16px; box-shadow: var(--shadow);
}
.device-chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.device-chip.selected { background: var(--text); border-color: var(--text); color: var(--paper); }
.device-chip.selected .sub { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.device-chip.selected .dot:not(.on) { background: color-mix(in srgb, var(--paper) 45%, transparent); }
.chip-text { display: flex; flex-direction: column; line-height: 1.3; }
.device-chip .name { font-weight: 600; font-size: 13.5px; }
.device-chip .sub { font-size: 11.5px; color: var(--muted); }

.empty { text-align: center; padding: 70px 24px; border: 1.5px dashed var(--line-strong); border-radius: 28px; max-width: 760px; margin: 0 auto; }
.empty h2 { margin-bottom: 8px; }
.empty p { margin: 0; line-height: 1.75; }

/* ---------- Cihaz basligi ---------- */
.device-hero { text-align: center; margin-bottom: 36px; }
.device-hero .eyebrow { margin-bottom: 8px; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 13.5px; }
.hero-meta > span:not(.status)::before { content: "·"; margin-right: 18px; color: var(--dim); }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status.on { color: var(--green); }
.status.off { color: var(--red); }

/* Meta Casting baglantisi */
.cast-link {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; text-align: left; text-decoration: none;
  color: var(--text); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 20px 9px 10px; box-shadow: var(--shadow); transition: border-color .18s, transform .18s, box-shadow .18s;
}
.cast-link svg { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--primary); color: var(--paper); }
.cast-link span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; line-height: 1.3; }
.cast-link small { font-weight: 400; font-size: 12px; color: var(--muted); }
.cast-link:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-lift); }

/* ---------- Oyun kartlari ---------- */
.games { text-align: center; margin-bottom: 30px; }
.games-title { font-family: var(--serif); font-size: 15px; color: var(--muted); font-style: italic; margin-bottom: 16px; }
.game-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.game {
  position: relative; width: 230px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 28px 18px 22px;
  box-shadow: var(--shadow); text-align: center;
}
.game:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.game-art {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--ts); color: var(--t); font-size: 36px; transition: background-color .18s, color .18s;
}
.game-name { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.25; }
.game-status { font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; }
.game-status.on { color: var(--green); background: var(--green-soft); }
.game-status.off { color: var(--muted); background: var(--paper-2); }
.game.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-lift); transform: translateY(-3px); }
.game.active .game-art { background: var(--t); color: var(--paper); }
.game.active::after {
  content: ""; position: absolute; left: 50%; bottom: -12px; width: 18px; height: 18px; transform: translateX(-50%) rotate(45deg);
  background: var(--paper); border-right: 1px solid var(--primary); border-bottom: 1px solid var(--primary);
}

.panel-placeholder {
  max-width: 880px; margin: 0 auto 24px; text-align: center; padding: 28px; color: var(--muted);
  font-family: var(--serif); font-style: italic; font-size: 16px;
  border: 1.5px dashed var(--line-strong); border-radius: 22px;
}

/* ---------- Secili oyunun kontrol paneli ---------- */
.app-card {
  max-width: 880px; margin: 0 auto 24px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 26px; padding: 26px 28px 28px; box-shadow: var(--shadow-lift);
  animation: panel-in .28s ease-out;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
.app-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.app-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--ts); color: var(--t); font-size: 24px; flex: none; }
.app-title { flex: 1; min-width: 160px; }
.app-title h3 { font-size: 22px; }
.app-meta { font-size: 13px; color: var(--muted); }
.conn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.conn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conn.on { color: var(--green); background: var(--green-soft); }
.conn.off { color: var(--red); background: var(--red-soft); }
.close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); font-size: 18px; border: 1px solid var(--line); }
.close:hover { color: var(--text); border-color: var(--line-strong); background: var(--paper-2); }

.ctl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ctl-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) { .ctl-grid, .ctl-grid.four { grid-template-columns: 1fr; } }
.ctl-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 150px; padding: 22px 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px;
  color: var(--text);
}
.ctl-grid.four .ctl-btn { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 96px; gap: 16px; }
.ctl-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--ts); color: var(--t); font-size: 25px; flex: none; transition: background-color .18s, color .18s, box-shadow .2s; }
.ctl-text { display: flex; flex-direction: column; gap: 2px; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.ctl-text small { font-family: var(--sans); font-size: 12.5px; font-weight: 400; color: var(--muted); }
.ctl-btn:not(:disabled):hover { background: var(--paper); border-color: var(--t); box-shadow: 0 0 0 3px var(--ts); transform: translateY(-2px); }
.ctl-btn:not(:disabled):hover .ctl-icon { background: var(--t); color: var(--paper); }
.ctl-btn:not(:disabled):active { transform: translateY(0); }
.ctl-btn.pending { border-color: var(--t); }
/* secenek grubu (asansor kapi davranisi): gecerli secim vurgulu kalir */
.ctl-btn.selected { background: var(--paper); border-color: var(--t); box-shadow: 0 0 0 3px var(--ts); }
.ctl-btn.selected .ctl-icon { background: var(--t); color: var(--paper); }
.ctl-title { margin-bottom: 14px; }
.ctl-title h4 { font-size: 17px; }
.ctl-title .hint { margin: 2px 0 0; font-size: 12.5px; }
.ctl-btn.pending .ctl-icon { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px var(--ts); } }

/* yatis kalibrasyonu */
.lie {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px;
  padding: 16px 18px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px;
}
.lie-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 20px; flex: none; }
.lie-text { flex: 1 1 220px; min-width: 0; }
.lie-text h4 { font-size: 17px; }
.lie-text .hint { margin: 0; font-size: 12.5px; }
.stepper { display: flex; align-items: center; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px; }
.stepper button { padding: 8px 14px; font-size: 13px; font-weight: 600; border-radius: 999px; color: var(--muted); }
.stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.mri-height { min-width: 100px; text-align: center; font-family: var(--serif); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mri-height span { font-size: 14px; color: var(--muted); }
.lie-apply { padding: 12px 26px; border-radius: 999px; }

.flash { margin-top: 16px; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 500; text-align: center; background: var(--blue-soft); color: var(--blue); }
.flash:empty { display: none; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); }

.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.facts > div { display: flex; gap: 6px; align-items: baseline; padding: 7px 14px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-size: 13px; }
.facts span { color: var(--muted); }
.facts span::after { content: ":"; }
.facts b { font-weight: 600; }

.generic-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Komut gecmisi ---------- */
.history { max-width: 880px; margin-top: 40px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { font-size: 20px; }
.table-wrap { overflow-x: auto; }
.history table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.history th { text-align: left; padding: 9px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.history td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.history tr:last-child td { border-bottom: none; }
.history td.time, .history td.by { color: var(--muted); }
.history td.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--muted); }
.pill.acked { color: var(--green); background: var(--green-soft); }
.pill.sent { color: var(--blue); background: var(--blue-soft); }
.pill.failed, .pill.timeout { color: var(--red); background: var(--red-soft); }

/* ---------- Giris ---------- */
.login-screen { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); min-height: 100vh; }
.login-art {
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px; color: #f6ead8;
  background:
    radial-gradient(520px 380px at 90% 8%, rgba(214, 160, 105, .32), transparent 70%),
    radial-gradient(480px 380px at 0% 100%, rgba(139, 90, 52, .45), transparent 70%),
    #3a2a1e;
}
.login-art .brand { color: #f6ead8; }
.login-art .logo { background: radial-gradient(circle at 34% 50%, #3a2a1e 0 4px, transparent 4.5px), radial-gradient(circle at 66% 50%, #3a2a1e 0 4px, transparent 4.5px), #e7c9a3; }
.login-pitch h2 { font-size: 46px; line-height: 1.12; font-weight: 600; margin-bottom: 18px; }
.login-pitch p { color: #d9c6ad; font-size: 16px; max-width: 420px; margin: 0; line-height: 1.65; }
.login-foot { color: #a68e74; font-size: 12.5px; }
.login-side { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 36px; margin-bottom: 6px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.login-card label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; }
.login-card input { padding: 13px 15px; }
.login-card .primary { padding: 14px 18px; margin-top: 4px; font-size: 15px; border-radius: 999px; }
.mobile-only { display: none !important; }

/* ---------- Dil secimi (i18n.js doldurur) ---------- */
.lang-select {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 10px;
}
.lang-select:hover { border-color: var(--primary); }
.lang-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.login-screen { position: relative; }
.lang-corner { position: absolute; top: 18px; right: 22px; z-index: 5; }

/* ---------- Dar ekranlar ---------- */
@media (max-width: 860px) {
  .top-inner { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  #customerName { display: none; }
  .page { padding: 28px 16px 60px; }
  h1 { font-size: 30px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-only { display: inline-flex !important; margin-bottom: 28px; }
}
@media (max-width: 600px) {
  .card, .app-card { padding: 20px 16px; border-radius: 20px; }
  .game { width: calc(50% - 9px); padding: 20px 10px 16px; }
  .game-art { width: 60px; height: 60px; font-size: 28px; }
  .game-name { font-size: 15.5px; }
  .ctl-btn { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; }
  .lie-apply { width: 100%; }
  .hero-meta > span:not(.status)::before { display: none; }
  .history th:nth-child(4), .history td:nth-child(4) { display: none; }
}

/* ---------- Sunum (OFFICE_PRESENTATION) ---------- */
.office-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; }
.office-label { min-width: 130px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px; }
.seg.seg-wrap { border-radius: 18px; }
.seg-btn { padding: 8px 16px; font-size: 13.5px; font-weight: 600; border-radius: 999px; color: var(--muted); }
.seg-btn:not(:disabled):hover { background: var(--primary-soft); color: var(--primary); }
.seg-btn.selected { background: var(--primary); color: var(--on-primary); }
.office-ask { display: flex; flex-direction: column; gap: 10px; }
.office-ask textarea {
  font: inherit; width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px;
  background: var(--paper); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px;
  transition: border-color .18s, box-shadow .18s;
}
.office-ask textarea::placeholder { color: var(--dim); }
.office-ask textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.office-ask-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.office-ask-bar #officeAskCount { margin-right: auto; }
.office-voice { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.office-voice select {
  font: inherit; color: var(--text); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px;
}
.office-voice select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.office-ask-send { border-radius: 999px; padding: 10px 26px; }
@media (max-width: 600px) {
  .office-label { min-width: 0; width: 100%; }
  .office-ask-send { width: 100%; }
}

/* =====================================================================
   Konsol duzeni (2026-11-17): cihaz paneli tek ekrana sigsin, sayfa kaymasin.
   Solda: cihazlar, secili cihazin durumu, oyunlar, yayin linki, son komutlar.
   Sagda: secili oyunun kontrolleri (bolumler sutunlara yayilir).
   Dar ekranlarda (< 1024 px) ayni parcalar alt alta akar, sayfa normal kayar.
   ===================================================================== */

/* ---------- Ortak (her genislik) ---------- */
.console-grid { display: flex; flex-direction: column; gap: 18px; }
.side { display: flex; flex-direction: column; gap: 14px; }
.stage { min-width: 0; }

.side-device { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.side-name { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.25; }
.side-name .muted { font-family: var(--sans); font-size: 12px; font-weight: 400; }
.side-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.side-seen { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

.games .eyebrow, .devices-bar .eyebrow { margin-bottom: 8px; }
.game-list { display: flex; flex-direction: column; gap: 8px; }
.game-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px 8px 8px; box-shadow: var(--shadow);
}
.game-row:hover { border-color: var(--line-strong); }
.game-row .game-art { width: 40px; height: 40px; margin: 0; font-size: 20px; flex: none; }
.game-row-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.game-row .game-name { font-size: 15px; line-height: 1.2; }
.game-row .game-status { font-size: 11px; padding: 1px 9px; }
.game-row.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.game-row.active .game-art { background: var(--t); color: var(--paper); }

.side .cast-link { margin-top: 0; padding: 7px 14px 7px 8px; align-self: flex-start; }
.side .cast-link svg { width: 30px; height: 30px; padding: 7px; }
.side .cast-link span { font-size: 13px; }
.side .cast-link small { font-size: 11px; }

.device-history:empty { display: none; }
.device-history .history { margin: 0; padding: 12px 14px; border-radius: 18px; max-width: none; }
.device-history .card-head { margin-bottom: 6px; }
.device-history .card-head h2 { font-size: 15px; }
.device-history .card-head .muted { font-size: 11.5px; }
.device-history table { font-size: 12px; }
.device-history th { display: none; }
.device-history td { padding: 6px 4px; vertical-align: top; }
.device-history td.by { display: none; }
.device-history .pill { font-size: 10.5px; padding: 1px 8px; }

.app-body { display: flex; flex-direction: column; gap: 18px; }
.app-body .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.app-body .sec { min-width: 0; }
.app-body .ctl-title[style] { margin-top: 0 !important; }
.app-body > .flash, .app-body .sec > .flash { margin-top: 10px; }
.app-foot .flash { margin-top: 16px; }

/* ---------- Genis ekran: tek ekranlik konsol ---------- */
@media (min-width: 1024px) {
  #appView:not([hidden]) { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
  .top { position: static; flex: none; }
  .top-inner { max-width: none; padding: 9px 22px; }
  .page.console { flex: 1; min-height: 0; max-width: none; width: 100%; padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
  .page.console > .banner, .page.console > .account { margin: 0; max-width: none; flex: none; }
  .page.console > .account { padding: 14px 18px; }

  .console-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 18px; }
  .side { min-height: 0; overflow-y: auto; padding: 2px 4px 2px 2px; gap: 12px; }
  .devices-bar { text-align: left; margin: 0; }
  .devices-bar .hint { margin: 0 0 8px; }
  .device-chips { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 6px; }
  .device-chip { border-radius: 14px; padding: 7px 12px; box-shadow: none; }
  .side { overflow: hidden; }
  .device-history { flex: 1 1 0; min-height: 90px; display: flex; flex-direction: column; }
  .device-history .history { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .device-history .table-wrap { flex: 1; min-height: 0; overflow-y: auto; }

  .stage { min-height: 0; display: flex; flex-direction: column; }
  .stage > .empty { margin: auto; }
  #deviceDetail:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .panel-placeholder { max-width: none; margin: auto 0; }

  .app-card {
    max-width: none; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column;
    padding: 14px 20px 14px; border-radius: 22px; animation: none;
  }
  .app-head { padding-bottom: 10px; margin-bottom: 14px; gap: 12px; }
  .app-icon { width: 38px; height: 38px; font-size: 19px; }
  .app-title h3 { font-size: 19px; }
  .app-meta { font-size: 12px; }
  .close { width: 32px; height: 32px; font-size: 15px; }

  /* kontroller: kalan yuksekligi doldurur; sigmazsa yalnizca burasi kayar */
  .app-body { flex: 1; min-height: 0; overflow-y: auto; gap: 14px; padding: 2px; }
  .app-body.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; align-content: start; }
  .app-body.cols-3 > .sec, .app-body.cols-3 > .col { min-width: 0; }
  .app-body .col { gap: 14px; }
  .app-foot { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
  .app-foot:not(:has(.facts)):has(.flash:empty) { display: none; }
  .app-foot .flash { margin: 0; padding: 7px 14px; text-align: left; flex: 0 1 auto; }
  .app-foot .facts { margin: 0; justify-content: flex-start; gap: 6px; }
  .app-foot .facts > div { padding: 4px 11px; font-size: 12px; }

  .ctl-title { margin-bottom: 8px; }
  .ctl-title h4 { font-size: 15px; }
  .ctl-title .hint { font-size: 11.5px; margin-top: 1px; }

  /* sikisik kontrol dugmeleri */
  .ctl-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .app-body.one .ctl-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .ctl-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctl-btn, .ctl-grid.four .ctl-btn {
    min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left;
    gap: 10px; padding: 9px 11px; border-radius: 14px;
  }
  .app-body.one .ctl-btn { padding: 14px 16px; gap: 14px; }
  .ctl-icon { width: 34px; height: 34px; font-size: 17px; }
  .app-body.one .ctl-icon { width: 44px; height: 44px; font-size: 21px; }
  .ctl-text { font-size: 14.5px; line-height: 1.25; }
  .app-body.one .ctl-text { font-size: 17px; }
  .ctl-text small { font-size: 11px; line-height: 1.3; }
  .ctl-btn:not(:disabled):hover { transform: none; }
  .ctl-btn.pending .ctl-icon { animation: pulse 1s ease-in-out infinite; }

  .lie { margin-top: 0; padding: 12px 16px; }

  /* sunum paneli */
  .office-row { margin-bottom: 6px; gap: 6px 10px; }
  .office-label { min-width: 0; width: 100%; font-size: 12px; }
  .seg { padding: 3px; gap: 4px; }
  .seg-btn { padding: 6px 12px; font-size: 13px; }
  .office .ctl-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .office .ctl-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-ask textarea { min-height: 120px; }
  .office-ask-bar { gap: 8px 12px; }
}

/* buyuk ekran: bos alani kullan, dugmeler buyusun */
@media (min-width: 1024px) {
  .app-body .ctl-btn { min-height: 58px; }
  /* az dugmeli oyunlar (MRI, kopek, asansor): genis, iri dugmeler */
  .app-body.one .ctl-grid, .app-body.one .ctl-grid.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .app-body.one .ctl-btn, .app-body.one .ctl-grid.four .ctl-btn { flex-direction: column; justify-content: center; text-align: center; min-height: 150px; gap: 10px; }
  .app-body.one .ctl-icon { width: 56px; height: 56px; font-size: 26px; }
  .app-body.one .ctl-text { font-size: 18px; }
  .app-body.one .ctl-text small { font-size: 12.5px; }
  /* sunum: olaylar alt alta, ana dugmeler daha yuksek, soru kutusu uzun */
  .office .ctl-grid:not(.four) { grid-template-columns: 1fr; }
  .office .ctl-btn { min-height: 64px; }
  .office .ctl-grid.four .ctl-btn { min-height: 76px; }
  .office .ctl-text { font-size: 15.5px; }
  .office-ask textarea { min-height: 190px; }
}

/* kisa ekranlar (laptop 768 px civari): biraz daha sikistir */
@media (min-width: 1024px) and (max-height: 820px) {
  .top-inner { padding: 6px 20px; }
  .page.console { padding: 10px 16px 12px; }
  .app-card { padding: 10px 16px 10px; }
  .app-head { padding-bottom: 8px; margin-bottom: 10px; }
  .app-body, .app-body .col { gap: 10px; }
  .ctl-btn, .ctl-grid.four .ctl-btn { padding: 7px 10px; }
  .app-body .ctl-btn, .office .ctl-btn, .office .ctl-grid.four .ctl-btn { min-height: 48px; }
  .app-body.one .ctl-btn, .app-body.one .ctl-grid.four .ctl-btn { min-height: 110px; }
  .office-ask textarea { min-height: 110px; }
  .ctl-icon { width: 30px; height: 30px; font-size: 15px; }
  .ctl-text small { display: none; }
  .ctl-title .hint { display: none; }
  .office-ask textarea { min-height: 80px; }
}

/* cok kisa ekranlar (kucuk laptop, ~650 px gorunur alan) */
@media (min-width: 1024px) and (max-height: 690px) {
  .app-head { padding-bottom: 6px; margin-bottom: 8px; }
  .app-icon { width: 30px; height: 30px; font-size: 15px; }
  .app-title h3 { font-size: 17px; }
  .ctl-title { margin-bottom: 4px; }
  .ctl-title h4 { font-size: 14px; }
  .app-body .ctl-btn, .office .ctl-btn, .office .ctl-grid.four .ctl-btn { min-height: 40px; padding: 5px 9px; }
  .ctl-icon { width: 26px; height: 26px; font-size: 13px; }
  .office-row { margin-bottom: 2px; }
  .seg-btn { padding: 4px 10px; font-size: 12.5px; }
  .office-ask textarea { min-height: 60px; }
  .app-foot { margin-top: 6px; padding-top: 6px; }
  .side-seen, .side .cast-link small { display: none; }
  .game-row { padding: 5px 10px 5px 6px; }
  .game-row .game-art { width: 32px; height: 32px; font-size: 16px; }
}

/* ---------- Konferans salonu / konusma (PUBLIC_SPEAKING) ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.topic-grid .seg-btn { border: 1px solid var(--line); background: var(--paper-2); color: var(--text); border-radius: 12px; text-align: left; padding: 8px 12px; font-weight: 500; }
.topic-grid .seg-btn.selected { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.question-list { display: flex; flex-direction: column; gap: 6px; }
.question-btn {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; line-height: 1.35;
}
.question-btn b { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 12px; }
.question-btn:not(:disabled):hover { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.question-btn.pending b { animation: pulse 1s ease-in-out infinite; }
.speech-last { justify-content: flex-start; margin-top: 0; }
@media (min-width: 1024px) {
  .speech .office-ask textarea { min-height: 90px; }
  .speech .ctl-grid.four .ctl-btn { min-height: 64px; }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .topic-grid .seg-btn { padding: 6px 10px; font-size: 12.5px; }
  .question-btn { padding: 6px 10px; font-size: 12.5px; }
  .speech .office-ask textarea { min-height: 60px; }
}
@media (min-width: 1024px) {
  .speech .office-row { flex-wrap: nowrap; margin-bottom: 6px; }
  .speech .office-label { width: 78px; min-width: 78px; flex: none; }
  .speech .seg-btn { padding: 6px 11px; }
  .speech-last > div { padding: 3px 10px; font-size: 12px; }
}

/* ---------- Ucus korkusu (FEAR_OF_FLYING) ---------- */
.flight .ctl-grid.flight-turb { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flight .ctl-grid.flight-turb .ctl-btn { flex-direction: column; justify-content: center; text-align: center; gap: 4px; }
.flight .ctl-grid.flight-turb .ctl-text small { display: none; }
.flight .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Meyhane (PUB_KNEIPE): the nine levels as full-width rows, the current one highlighted */
.pub .ctl-grid.pub-levels { grid-template-columns: 1fr; }
.pub .ctl-grid.pub-levels { gap: 6px; }
.pub .ctl-grid.pub-levels .ctl-btn { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 54px; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
@media (min-width: 1100px) {
  .app-body.cols-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px 22px; align-content: start; }
  .app-body.cols-2 > .col { min-width: 0; }
}
