/* Presenter interface: progress, control bar, speaker notes, overview. */

body { padding: 12px 12px 76px; }
.deck { width: min(calc(100vw - 24px), calc((100svh - 100px) * 16 / 9)); box-shadow: 0 30px 80px -30px rgb(0 0 0 / 55%); }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 5px;
  font: 600 10.5px/1.5 var(--body);
  text-align: center;
  color: rgb(247 246 244 / 70%);
  border: 1px solid rgb(247 246 244 / 22%);
  border-radius: 5px;
}

/* Progress */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 30; background: rgb(247 246 244 / 8%); }
.progress span { display: block; height: 100%; width: 0; background: var(--sage); transition: width .45s cubic-bezier(.2, .7, .2, 1); }

/* Control bar */
.controls {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  translate: -50% 0;
  width: min(calc(100vw - 24px), 980px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 16px;
  font-size: 13px;
  background: rgb(23 35 30 / 82%);
  border: 1px solid rgb(247 246 244 / 12%);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity .35s, translate .35s;
}
.controls button { padding: 7px 12px; border-color: rgb(247 246 244 / 20%); white-space: nowrap; }
.controls button kbd { margin-left: 4px; border: 0; padding: 0; min-width: 0; color: rgb(247 246 244 / 45%); }
.controls button[aria-pressed="true"] { background: var(--sage); color: var(--ink); border-color: var(--sage); }
.controls button[aria-pressed="true"] kbd { color: rgb(41 59 51 / 60%); }
.bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar-logo { height: 18px; width: auto; flex: none; }
#slide-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(247 246 244 / 72%); }
#slide-name::before { content: ""; display: inline-block; width: 1px; height: 14px; margin-right: 12px; vertical-align: -2px; background: rgb(247 246 244 / 22%); }
.bar-mid { display: flex; align-items: center; gap: 6px; }
.bar-mid button { width: 36px; height: 36px; padding: 0; font-size: 16px; line-height: 1; }
.controls output { min-width: 4.6em; font-weight: 600; letter-spacing: .02em; }
.bar-right { display: flex; justify-content: flex-end; gap: 6px; }

/* Idle in fullscreen: bar and cursor step aside */
body.idle .controls { opacity: 0; translate: -50% 12px; pointer-events: none; }
body.idle { cursor: none; }

/* Fullscreen: the slide takes the whole screen */
body.is-full { padding: 0; }
body.is-full .deck { width: min(100vw, calc(100svh * 16 / 9)); box-shadow: none; }

/* Speaker notes: presenter view beside the slide */
.notes-panel {
  position: fixed;
  inset: 12px 12px 76px auto;
  width: 340px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  overflow: auto;
  color: var(--paper);
  background: rgb(247 246 244 / 5%);
  border: 1px solid rgb(247 246 244 / 12%);
  border-radius: 14px;
}
body.with-notes { padding-right: 364px; }
body.with-notes .deck { width: min(calc(100vw - 388px), calc((100svh - 100px) * 16 / 9)); }
body.is-full.with-notes { padding-right: 352px; }
body.is-full.with-notes .notes-panel { inset: 0 0 0 auto; border-radius: 0; border-width: 0 0 0 1px; }
body.is-full.with-notes .deck { width: min(calc(100vw - 352px), calc(100svh * 16 / 9)); }
.notes-panel p, .notes-panel h3 { margin: 0; }
.np-head { display: flex; justify-content: space-between; align-items: center; }
.np-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.np-timer { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; color: inherit; background: rgb(247 246 244 / 8%); border: 0; }
.np-timer b { font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.np-timer small { font-size: 11px; color: rgb(247 246 244 / 55%); }
.np-timer.over b { color: var(--rose); }
.notes-panel h3 { font: 750 26px/1.05 var(--display); letter-spacing: -.03em; }
.np-budget { font-size: 12.5px; color: rgb(247 246 244 / 60%); font-variant-numeric: tabular-nums; }
.np-budget.over #np-slide { color: var(--rose); font-weight: 700; }
.np-text { font-size: 16px; line-height: 1.55; color: #e9efe9; text-wrap: pretty; }
.np-next { margin-top: auto !important; padding-top: 12px; border-top: 1px solid rgb(247 246 244 / 12%); font-size: 13px; color: rgb(247 246 244 / 60%); }
.np-next b { color: var(--paper); font-weight: 600; }
.np-keys { font-size: 11.5px; line-height: 2; color: rgb(247 246 244 / 50%); }

/* Overview */
.overview {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: 26px clamp(16px, 4vw, 56px) 48px;
  background: rgb(20 31 27 / 96%);
  backdrop-filter: blur(10px);
}
.ov-head { display: flex; align-items: center; gap: 16px; margin: 0 auto 24px; max-width: 1500px; color: rgb(247 246 244 / 60%); font-size: 13px; }
.ov-head img { height: 22px; }
.ov-head button { margin-left: auto; padding: 8px 14px; color: var(--paper); background: transparent; border: 1px solid rgb(247 246 244 / 22%); }
.ov-head button kbd { margin-left: 6px; border: 0; padding: 0; }
.ov-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1500px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px 20px;
}
.ov-grid button {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
}
.ov-thumb {
  container-type: inline-size;
  border-radius: 8px;
  overflow: hidden;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color .2s, translate .2s;
  pointer-events: none;
}
.ov-thumb .slide { margin: 0 !important; }
.ov-grid button:hover .ov-thumb { translate: 0 -3px; outline-color: rgb(247 246 244 / 30%); }
.ov-grid button[aria-current="true"] .ov-thumb { outline-color: var(--sage); }
.ov-label { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: rgb(247 246 244 / 75%); }
.ov-label b { font-variant-numeric: tabular-nums; color: var(--sage); }
.ov-label small { margin-left: auto; color: rgb(247 246 244 / 40%); font-variant-numeric: tabular-nums; }
body.ov-open { overflow: hidden; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  z-index: 50;
  translate: -50% 0;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 30%);
}

@media (max-width: 860px) {
  #slide-name, .bar-logo, .controls button kbd, #notes-toggle { display: none; }
  .controls { grid-template-columns: auto 1fr auto; }
  .bar-mid { justify-content: center; }
  body.with-notes { padding-right: 12px; }
  body.with-notes .deck { width: min(calc(100vw - 24px), calc((100svh - 100px) * 16 / 9)); }
  body.with-notes .notes-panel { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .progress span, .controls, .ov-thumb { transition: none; }
}

@media print {
  .progress, .notes-panel, .overview, .toast { display: none !important; }
  body.with-notes, body { padding: 0 !important; }
  .deck { width: 16in !important; box-shadow: none; }
}
