:root {
  --navy: #0d3b66; --navy-d: #082a4a; --accent: #ee9b00; --gold: #f0c419;
  --bg: #f4f5f7; --card: #fff; --ink: #1d2733; --muted: #6b7686; --line: #e4e7ec;
  --tabh: 58px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background: var(--bg); color: var(--ink);
  padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom));
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }

/* App bar */
.appbar { position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top); }
.appbar-inner { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  min-height: 52px; padding: 9px 16px; }
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand-main { font-weight: 800; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 11.5px; font-weight: 600; color: #cfe0f0; margin-top: 2px;
  letter-spacing: .3px; }
.brand-unofficial { color: #ff4d4d; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; }
.brand-ver { color: #9db8d6; font-size: 11px; font-weight: 600; }

.content { max-width: 720px; margin: 0 auto; padding: 12px 12px 24px; }
.page-h { font-size: 20px; margin: 8px 4px 12px; }
.empty, .hint { color: var(--muted); padding: 16px 4px; }
.hint { padding: 0 4px 10px; font-size: 13px; }

/* Day selector */
.daybar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; }
.daychip { flex: 0 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 11px; text-align: center; font-size: 12px;
  color: var(--muted); display: flex; align-items: baseline; gap: 5px;
  justify-content: center; }
.daychip b { color: var(--ink); font-size: 13px; }
.daychip.on { background: var(--navy); border-color: var(--navy); color: #cfe0f0; }
.daychip.on b { color: #fff; }

/* Room tabs (concurrent sessions) */
.roomtabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch; }
.roomtab { flex: 0 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; }
.roomtab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.panel { display: none; }
.panel.on { display: block; }

/* Room section */
.room { margin-bottom: 18px; }
.room-h { font-size: 13px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin: 2px 4px 8px; }

/* Talk card */
.talk { display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; }
.talk-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 700;
  font-size: 12px; color: var(--navy); width: 44px; line-height: 1.25; padding-top: 2px; }
.talk-body { flex: 1 1 auto; min-width: 0; }
.talk-title { font-size: 14.5px; font-weight: 600; }
.talk-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.author { color: var(--muted); font-size: 12.5px; }
.talk-place { color: var(--muted); font-size: 12px; margin-top: 3px; }
.talk.has-note:not(.has-photo) .talk-title::after { content: " 📝"; font-size: 12px; }
.talk.has-photo:not(.has-note) .talk-title::after { content: " 📷"; font-size: 12px; }
.talk.has-note.has-photo .talk-title::after { content: " 📝📷"; font-size: 12px; }
.talk-note { margin-top: 5px; font-size: 12.5px; color: #5a4a00; white-space: pre-wrap;
  background: #fff7e0; border: 1px solid #f0d98a; border-radius: 8px; padding: 4px 8px; }
.talk-photos { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.talk-photo { width: 46px; height: 46px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); }

/* Settings */
.appbar-gear { margin-left: auto; font-size: 20px; text-decoration: none; line-height: 1;
  align-self: center; padding: 4px; }
.settings { margin: 6px 0 16px; }
.setting { display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--line); }
.setting-t { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.setting-t small { color: var(--muted); font-size: 12px; }
.setting input[type=checkbox] { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--accent); }
.settings-info { margin: 4px 0 16px; font-size: 13px; color: var(--muted); }
.settings-info b { color: var(--ink); }
.adm-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 6px 0 10px;
  background: var(--card); color: var(--ink); }
.adm-num { flex: 0 0 auto; width: 90px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 15px; text-align: right; background: var(--card); color: var(--ink); }

/* Hide breaks/lunch when disabled in settings */
.hide-breaks .brk, .hide-breaks .gap { display: none; }

/* Device sync (My Plan) */
.sync { margin: 22px 2px 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.sync-status { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: #1f7a3d;
  background: #e9f7ee; border: 1px solid #b6e2c5; border-radius: 10px; padding: 8px 12px; }
.sync-status[hidden] { display: none; }
.sync-row { display: flex; gap: 8px; }
.sync-btn { flex: 0 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--navy); cursor: pointer; }
.sync-out { margin-top: 10px; font-size: 13px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sync-out[hidden] { display: none; }
.sync-code { font-size: 30px; font-weight: 800; letter-spacing: 6px; color: var(--navy);
  text-align: center; margin: 8px 0 2px; }
.sync-sub { text-align: center; font-size: 11.5px; color: var(--muted); }
.sync-devices { margin-top: 12px; }
.sync-devices[hidden] { display: none; }
.sync-devices summary { font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; }
.device-list { margin: 8px 0; }
.device-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.device-name { flex: 1 1 auto; }
.device-seen { color: var(--muted); font-size: 11.5px; }
.device-x { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
  background: #f0e0e0; color: #b03030; font-size: 15px; cursor: pointer; }
.device-unlink { flex: 0 0 auto; border: 1px solid #e3b6b6; background: var(--card); color: #b03030;
  border-radius: 8px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.sync-btn.danger { color: #b03030; border-color: #e3b6b6; }

/* Per-talk note editor (talk detail) */
.note { margin: 14px 0 4px; }
.note-h { display: block; font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.note-status { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent); }
#note { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; resize: none; overflow: hidden;
  background: var(--card); color: var(--ink); }
#note:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(13,59,102,.12); }

/* Per-talk photos (talk detail) */
.photos { margin: 12px 0 4px; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.photo-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 14px; line-height: 20px; cursor: pointer; }
.photo-add { display: inline-block; margin-top: 8px; background: var(--card);
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; }
.photo-add.busy { opacity: .5; pointer-events: none; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96%; max-height: 96%; object-fit: contain; }

/* "No schedule at current time" banner */
.nowbanner { margin: 0 2px 12px; padding: 9px 12px; border-radius: 10px;
  background: #fff4e5; border: 1px solid #f0c98a; color: #8a5a00;
  font-size: 13px; font-weight: 600; text-align: center; }
.nowbanner[hidden] { display: none; }

/* Overlapping bookmarks: proportional column grid (My Plan) */
.cluster { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; margin-bottom: 8px;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.gcol { position: relative; scroll-snap-align: start; }
.gtalk { position: absolute; left: 0; right: 0; margin: 0; overflow: hidden; }

/* Compressed empty time / break label between blocks (My Plan) */
.gap { display: flex; align-items: center; gap: 8px; margin: 4px 2px;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .3px;
  justify-content: center; }
.gap::before, .gap::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.gap-brk { color: #8a5a00; }
.gap-sm { height: 6px; }

/* Now indicator (current time, red line) */
.nowline { position: absolute; left: 0; right: 0; height: 0;
  border-top: 2px solid #e23b3b; pointer-events: none; z-index: 5; }
.nowdot { position: absolute; left: -3px; top: -5px; width: 8px; height: 8px;
  border-radius: 50%; background: #e23b3b; }
.nowlbl { position: absolute; left: 10px; top: -9px; background: #e23b3b; color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px;
  white-space: nowrap; }

/* Floating date/room context (shown when the day/room buttons scroll away) */
.ctxbar { position: fixed; left: 0; right: 0; z-index: 19; display: flex;
  align-items: baseline; gap: 4px; justify-content: center; background: var(--navy);
  color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.ctxbar[hidden] { display: none; }
.ctxbar .ctxsep { opacity: .55; font-weight: 400; }
.ctxbar #ctxroom { font-weight: 600; color: #cfe0f0; }
.nowbtn { position: fixed; right: 14px; bottom: 70px; z-index: 30;
  background: #e23b3b; color: #fff; border: none; border-radius: 18px;
  padding: 8px 14px; font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; }
.nowbtn[hidden] { display: none; }

/* Break / lunch (display only) */
.brk { display: flex; gap: 10px; align-items: center; padding: 6px 12px; margin-bottom: 8px;
  border: 1px dashed var(--line); border-radius: 12px; background: #fafbfc; }
.brk .talk-time { color: var(--muted); }
.brk-label { font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; }
.badge { background: var(--navy); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 6px; padding: 1px 6px; }
.bm { flex: 0 0 auto; background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 2px; }
.bm.on { color: var(--accent); }
.bm.big { font-size: 26px; margin-left: auto; }

/* Detail */
.detail-when { display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.detail-title { font-size: 20px; line-height: 1.3; margin: 4px 0 10px; }
.detail-session { display: flex; gap: 8px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin: 0 0 12px;
  font-size: 13.5px; color: var(--navy); }
.cal-btn { display: inline-block; background: var(--navy); color: #fff; font-weight: 600;
  font-size: 13.5px; border-radius: 12px; padding: 10px 16px; margin: 0 0 14px; }
.detail-authors { font-weight: 600; margin: 0 0 4px; }
.detail-corr { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.detail-abstract { background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-size: 14.5px; text-align: justify; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.kwchip { background: #eef2f7; color: var(--navy); border-radius: 14px;
  padding: 4px 10px; font-size: 12.5px; }
.affil { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.affil ol { padding-left: 18px; }

/* Sessions */
.slist { list-style: none; margin: 0; padding: 0; }
.slist li a { display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.stitle { flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.scount { color: var(--muted); font-size: 12px; white-space: nowrap; }
.session-title { font-size: 16px; font-weight: 600; margin: 0 4px 12px; }

/* Search */
.searchbar { display: flex; gap: 8px; margin: 4px 2px 14px; }
.searchbar input { flex: 1 1 auto; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 12px; font-size: 15px; background: var(--card); }
.searchbar button { padding: 0 16px; border: none; border-radius: 12px;
  background: var(--navy); color: #fff; font-weight: 700; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 4px 10px; }

/* Bottom tab bar */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  height: var(--tabh); padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); }
.tab .ic { font-size: 20px; }
.tab.on { color: var(--navy); font-weight: 700; background: rgba(13, 59, 102, .07); }
.tab.on::before { content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--navy); }
