/* Kurumsal renkler buradan değiştirilir */
:root {
  --brand: #402373;
  --accent: #a67c00;
  --bg: #f4f2ee;
  --surface: #ffffff;
  --text: #16202e;
  --muted: #617085;
  --border: #dedad2;
  --live: #d12f2f;
  --ok: #2e7d5b;
  --seg: 1.6rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #bba6f2;
    --accent: #f8d300;
    --bg: #0e141d;
    --surface: #17202c;
    --text: #edf1f6;
    --muted: #93a1b4;
    --border: #283444;
    --live: #ff5d5d;
    --ok: #63c79b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
  line-height: 1.45; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Dil seçimi ---------- */
.picker { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.picker-box { width: min(420px, 100%); text-align: center; }
.picker-box img { width: 64px; height: 64px; }
.picker-box h1 { font-size: 1.25rem; margin: 14px 0 22px; text-wrap: balance; }
.picker-grid { display: grid; gap: 12px; }
.picker-grid button {
  padding: 18px; font-size: 1.25rem; font-weight: 600; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
}
.picker-grid button:hover, .picker-grid button:focus-visible { border-color: var(--accent); outline: none; }

/* ---------- İskelet ---------- */
.app { height: 100dvh; overflow: hidden; grid-template-columns: minmax(0, 1fr); display: grid; grid-template-rows: auto auto 1fr; }
.top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.top img { width: 34px; height: 34px; flex: none; }
.top .name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.icon-btn {
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; font-weight: 700;
}
.top select {
  height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; padding: 0 8px;
}
#menuBtn { display: none; }
.notice {
  background: var(--accent); color: #1b1305; font-weight: 600; text-align: center; padding: 10px 16px;
}
.offline { background: var(--live); color: #fff; text-align: center; font-size: .85rem; padding: 4px; }
.main { display: grid; grid-template-columns: 330px 1fr; min-height: 0; overflow: hidden; }

/* ---------- Program ---------- */
.agenda { overflow-y: auto; border-inline-end: 1px solid var(--border); background: var(--surface); padding: 8px 0 24px; }
.day { padding: 16px 16px 6px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.item {
  display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; width: 100%; text-align: start;
  padding: 11px 16px; border: 0; background: transparent; border-inline-start: 4px solid transparent;
}
.item:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.item.sel { background: color-mix(in srgb, var(--brand) 11%, transparent); border-inline-start-color: var(--brand); }
.item .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; padding-top: 1px; }
.item .ttl { font-weight: 600; }
.item .who { grid-column: 2; font-size: .88rem; color: var(--muted); }
.item.break { cursor: default; opacity: .7; }
.item.break:hover { background: transparent; }
.badge { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; margin-inline-start: 6px; vertical-align: middle; }
.badge.live { background: var(--live); color: #fff; animation: pulse 1.6s infinite; }
.badge.done { color: var(--ok); border: 1px solid currentColor; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Sahne ---------- */
.stage { display: grid; grid-template-rows: auto auto 1fr; min-height: 0; min-width: 0; }
.speaker { display: flex; gap: 16px; align-items: flex-start; padding: 18px 24px 12px; }
.avatar {
  width: 84px; height: 84px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--brand); color: var(--bg); display: grid; place-items: center; font-size: 1.7rem; font-weight: 700;
}
.speaker .info { min-width: 0; flex: 1; }
.speaker h2 { margin: 0; font-size: 1.3rem; }
.speaker .role { color: var(--muted); }
.speaker .talk { margin-top: 4px; font-weight: 600; color: var(--brand); }
.speaker details { margin-top: 6px; font-size: .93rem; }
.speaker summary { cursor: pointer; color: var(--muted); }
.speaker details p { margin: 6px 0 0; max-width: 70ch; }

.bar { display: flex; align-items: center; gap: 8px; padding: 8px 24px 12px; border-bottom: 1px solid var(--border); }
.bar .ctl { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; flex: none; }
.bar .ctl.primary { background: var(--brand); border-color: var(--brand); color: var(--bg); width: 48px; height: 48px; }
.bar .ctl:disabled { opacity: .35; cursor: default; }
.bar svg { width: 20px; height: 20px; fill: currentColor; }
[dir="rtl"] .bar .flip svg { transform: scaleX(-1); }
.bar input[type=range] { flex: 1; min-width: 60px; accent-color: var(--brand); height: 28px; }
.bar .count { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.live-btn {
  border: 1px solid var(--live); color: var(--live); background: transparent; border-radius: 99px;
  padding: 8px 14px; font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.live-btn.on { background: var(--live); color: #fff; }
.live-btn::before { content: "●"; margin-inline-end: 6px; }

.script { overflow-y: auto; padding: 28px 24px 45vh; scroll-behavior: smooth; }
.script p {
  font-size: var(--seg); line-height: 1.5; margin: 0 0 .9em; max-width: 34em; cursor: pointer;
  opacity: .38; transition: opacity .25s; text-wrap: pretty;
}
.script p.cur { opacity: 1; font-weight: 600; }
.script .empty { opacity: 1; color: var(--muted); font-size: 1.15rem; cursor: default; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  :root { --seg: 1.35rem; }
  #menuBtn { display: block; }
  .main { grid-template-columns: minmax(0, 1fr); position: relative; }
  .agenda {
    position: absolute; inset: 0; z-index: 10; transform: translateX(-102%); transition: transform .2s; border: 0;
  }
  [dir="rtl"] .agenda { transform: translateX(102%); }
  .agenda.open { transform: none; }
  .speaker { padding: 14px 16px 8px; gap: 12px; }
  .avatar { width: 60px; height: 60px; font-size: 1.3rem; }
  .speaker h2 { font-size: 1.1rem; }
  .bar { padding: 6px 16px 10px; gap: 6px; flex-wrap: wrap; }
  .bar .ctl { width: 38px; height: 38px; }
  .bar .ctl.primary { width: 44px; height: 44px; }
  .bar input[type=range] { min-width: 40px; }
  .live-btn { padding: 7px 10px; font-size: .78rem; }
  .bar .count { display: none; }
  .script { padding: 20px 16px 45vh; }
  .top .name { font-size: .95rem; }
}

/* ---------- Gün sekmeleri ve oturum başlıkları ---------- */
.agenda { display: grid; grid-template-rows: auto 1fr; overflow: hidden; padding: 0; }
.agenda-list { overflow-y: auto; padding: 4px 0 24px; }
.day-tabs { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.day-tabs button {
  flex: 1; padding: 9px 4px; border-radius: 10px; border: 1px solid var(--border); background: transparent;
  font-weight: 700; font-size: .92rem; white-space: nowrap; position: relative;
}
.day-tabs button.on { background: var(--brand); border-color: var(--brand); color: var(--bg); }
.day-tabs button.has-live::after {
  content: ""; position: absolute; top: 5px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); animation: pulse 1.6s infinite;
}
.sec { padding: 16px 16px 8px; margin-top: 6px; border-top: 1px solid var(--border); }
.sec:first-child { border-top: 0; margin-top: 0; }
.sec .when { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--accent); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sec .ttl { font-weight: 800; color: var(--brand); line-height: 1.3; margin-top: 2px; }
.sec .chair { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.item .time { font-size: .85rem; }
.item .ttl { font-weight: 600; font-size: .95rem; line-height: 1.35; }
.speaker .co { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.speaker .talk { line-height: 1.35; }

/* ---------- Beğeni ve yorum ---------- */
.stage { grid-template-rows: auto auto auto 1fr; }
.fbwrap { border-bottom: 1px solid var(--border); padding: 8px 24px 10px; }
.fb { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .9rem;
}
.fb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fb-btn b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.fb-btn b:empty { display: none; }
#likeBtn[aria-pressed="true"] { border-color: var(--live); color: var(--live); }
#likeBtn[aria-pressed="true"] svg { fill: currentColor; }
#likeBtn[aria-pressed="true"] b { color: inherit; }
#cmtBtn[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.cmt { display: grid; gap: 8px; margin-top: 10px; max-width: 640px; }
.cmt textarea, .cmt input {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; resize: vertical;
}
.cmt-row { display: flex; gap: 8px; }
.cmt .send { padding: 0 20px; border-radius: 10px; border: 0; background: var(--brand); color: var(--bg); font-weight: 700; white-space: nowrap; }
.cmt .send:disabled { opacity: .5; }
.cmt-note { font-size: .84rem; color: var(--muted); }
.cmt-note.ok { color: var(--ok); font-weight: 600; }
.cmt-note.err { color: var(--live); }
@media (max-width: 860px) {
  .fbwrap { padding: 6px 16px 8px; }
  .fb-btn { padding: 6px 12px; font-size: .85rem; }
}
