:root {
  color-scheme: light;
  --page: #f4f3ef;
  --paper: #fff;
  --ink: #212937;
  --muted: #626b78;
  --quiet: #747b86;
  --line: #e3e4e6;
  --line-strong: #cfd2d7;
  --accent: #f2b945;
  --accent-edge: #e8a824;
  --accent-ink: #694201;
  --accent-wash: #fff7e4;
  --navy: #192534;
  --blue-wash: #edf3fa;
  --blue-ink: #244969;
  --shadow: 0 1px 2px rgb(24 32 42 / 4%), 0 5px 20px rgb(24 32 42 / 3%);
  --radius: 14px;
  --font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
p, h1, h2, h3, h4 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input[type="checkbox"], input[type="range"] { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; }
button, a, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 2px solid #2c6191; }
::selection { background: #f8d782; color: #212937; }

.icon-library { position: absolute; height: 0; width: 0; overflow: hidden; }
.icon {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.2em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  text-align: center;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.3;
  touch-action: manipulation;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}
.button-primary { background: var(--accent); border-color: var(--accent); color: #252015; }
.button-primary:hover:not(:disabled) { background: #f6c65e; border-color: var(--accent-edge); }
.button-primary:disabled { background: #f2e8d2; border-color: #f2e8d2; color: #74674d; }
.button-secondary { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.button-secondary:hover:not(:disabled) { border-color: #9a9ea7; background: #f7f7f7; }
.button-secondary:disabled { background: #fafafa; color: #6f747d; border-color: var(--line); }
.button-quiet { color: var(--muted); }
.button-quiet:hover { background: var(--page); color: var(--ink); }
.button-icon { min-width: 38px; padding: 7px; color: var(--muted); }
.button-icon:hover { background: var(--page); color: var(--ink); }
.button-inline { min-height: 30px; padding: 4px 6px; color: var(--blue-ink); }
.button-inline:hover { background: var(--blue-wash); }
.button .icon { font-size: 1rem; }

input:not([type="checkbox"]):not([type="range"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--paper);
}
input:not([type="checkbox"]):not([type="range"]):focus, select:focus, textarea:focus { border-color: #2c6191; }
input::placeholder, textarea::placeholder { color: var(--quiet); opacity: 1; }
select { padding-right: 28px; }
textarea { display: block; resize: vertical; }
label { font-size: .84rem; font-weight: 650; }
.field-with-icon { position: relative; min-width: 0; }
.field-with-icon > .icon { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); pointer-events: none; color: var(--quiet); }
.field-with-icon > input:not([type="checkbox"]):not([type="range"]) { padding-left: 37px; }
.form-error { color: #a01e25; font-size: .88rem; }
.form-error:empty, .app-status:empty, .video-message:empty { display: none; }
.noscript { margin: 2rem; }

.brand, .account { display: flex; align-items: center; }
.brand { gap: 10px; font-size: 1.02rem; font-weight: 740; white-space: nowrap; letter-spacing: -.02em; }
.brand-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--navy);
}
.brand-mark .icon { width: 21px; height: 21px; }
.top-bar { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-bar-inner, .workspace { width: min(100% - 64px, 1500px); margin-inline: auto; }
.top-bar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 61px; gap: 18px; }
.account { gap: 9px; min-width: 0; }
.account-name { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 620; }
.user-initials {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #e8edf1;
  color: #354c61;
  font-size: .72rem;
  font-weight: 720;
}
.user-initials:empty { display: none; }
.access-button { flex: none; min-height: 34px; padding: 6px 8px; }
.logout-button { margin-left: 6px; min-height: 34px; padding: 6px 8px; }
.workspace { padding: 25px 0 48px; }
.session-header { display: flex; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 20px; }
.session-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: .83rem; font-weight: 600; }
.session-date .icon { color: #776341; }
.session-timezone { padding-left: 8px; border-left: 1px solid var(--line-strong); }
.session-header h1 { margin-top: 4px; font-size: clamp(1.6rem, 2.8vw, 2.35rem); font-weight: 740; letter-spacing: -.045em; line-height: 1.18; overflow-wrap: anywhere; }
.session-counters { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-bottom: 4px; font-size: .8rem; color: var(--muted); }
.session-counter { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.session-counter strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.counter-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.counter-dot-required { background: #bc7808; }
.counter-dot-request { background: #497699; }
.app-status { padding: 8px 12px; margin: 0 0 13px; border: 1px solid #d8e5f0; border-radius: 8px; background: #f1f6fc; font-size: .88rem; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.86fr) minmax(320px, 1fr);
  grid-template-rows: max-content 1fr;
  grid-template-areas: "video events" "detail events";
  gap: 16px;
  align-items: start;
}
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.video-panel { grid-area: video; }
.events-panel { grid-area: events; }
.detail-panel { grid-area: detail; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 58px;
  gap: 8px 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 1.04rem; font-weight: 720; letter-spacing: -.015em; }
.panel-heading h2 .icon { color: #647080; }
.video-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid #e8e9eb;
  border-radius: 9px;
  background: #f5f5f5;
}
.video-tabs:empty { display: none; }
.video-tab {
  min-height: 29px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #4e5865;
  background: transparent;
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.2;
}
.video-tab:hover { background: #eceef0; }
.video-tab.is-selected, .video-tab[aria-selected="true"], .video-tab[aria-pressed="true"] {
  color: var(--ink);
  background: var(--paper);
  border-color: #e5e6e7;
  box-shadow: 0 1px 2px rgb(16 26 37 / 8%);
}
.video-body { padding: 13px 15px 15px; }
.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #202c3c;
  border-radius: 9px;
  background: #121b27;
}
.video-stage:has(.video-placeholder:not([hidden])) {
  aspect-ratio: auto;
  min-height: clamp(180px, 27vw, 305px);
}
.video-stage video { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 15px;
  background: radial-gradient(ellipse at 50% 13%, #223247, #121b27 74%);
  color: #f0f3f7;
  text-align: center;
}
.video-placeholder-icon {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  margin-bottom: 6px;
  border: 1px solid #4a5b71;
  border-radius: 13px;
  color: #f2c36a;
  background: rgb(255 255 255 / 5%);
}
.video-placeholder-icon .icon { width: 26px; height: 26px; }
.video-placeholder p { font-size: clamp(1rem, 2.15vw, 1.3rem); font-weight: 700; letter-spacing: -.015em; }
.video-placeholder span { color: #b8c5d5; font-size: .85rem; }
.timeline-block { padding: 11px 1px 0; }
.timeline-header, .timeline-scale { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.timeline-label { color: var(--ink); font-size: .84rem; }
.timeline-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.timeline-time output, .timeline-scale { font: .76rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.timeline-track { padding: 0 6px; }
.timeline-markers { position: relative; height: 17px; margin-top: 4px; }
.timeline-marker {
  display: block;
  position: absolute;
  top: 0;
  inline-size: 5px;
  block-size: 17px;
  padding: 0;
  margin: 0;
  transform: translateX(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
}
.timeline-marker::before {
  content: "";
  position: absolute;
  inset: 3px 1px 0;
  border-radius: 4px;
  background: var(--event-color, #718092);
  opacity: .75;
}
.timeline-marker:hover, .timeline-marker:focus-visible, .timeline-marker.is-selected { z-index: 1; }
.timeline-marker:hover::before, .timeline-marker:focus-visible::before, .timeline-marker.is-selected::before {
  inset: 0 0 0;
  background: var(--event-color, #523932);
  opacity: 1;
}
.timeline-marker.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.timeline-marker.needs-note::before { background: #a66608; }
.timeline-seek {
  display: block;
  position: relative;
  width: calc(100% + 12px);
  height: 18px;
  margin: 0 -6px;
  padding: 0;
  accent-color: #ae700c;
}
.timeline-seek:disabled { opacity: .55; }
.timeline-scale { margin-top: 0; color: var(--muted); }
.video-footer { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.video-message { color: var(--muted); font-size: .84rem; }
.video-actions, .capture-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.fragment-capture { margin-top: 12px; padding: 10px; border: 1px solid #ead4a4; border-radius: 8px; background: var(--accent-wash); }
.fragment-capture p { padding-bottom: 8px; color: var(--accent-ink); font-size: .84rem; }

.events-panel { position: sticky; top: 14px; display: flex; flex-direction: column; max-height: min(825px, calc(100dvh - 28px)); }
.event-counter { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.event-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(115px, 43%); gap: 7px; padding: 11px 13px; }
.event-controls input, .event-controls select { font-size: .83rem; }
.event-list-labels {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 4px;
  padding: 6px 15px 5px;
  border-block: 1px solid var(--line);
  background: #f6f7f8;
  color: #56616f;
  font-size: .72rem;
  font-weight: 670;
}
.event-list-labels span:first-child { padding-left: 10px; }
.events-list { min-height: 155px; overflow: auto; border-radius: 0 0 var(--radius) var(--radius); scrollbar-color: #c9cbd1 transparent; }
.event-row {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  width: 100%;
  gap: 4px;
  align-items: start;
  padding: 11px 14px 10px 15px;
  border: 0;
  border-bottom: 1px solid #eceef0;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}
.event-row:last-child { border-bottom: 0; }
.event-row:hover { background: #f7f8fa; }
.event-row:focus-visible { z-index: 1; outline-offset: -3px; }
.event-row.is-selected { background: var(--accent-wash); }
.event-row.is-selected::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #cc891c; }
.event-time { color: #4c596a; font: .77rem/1.55 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-time::before { display: inline-block; width: 6px; height: 6px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--event-color, #718092); content: ""; }
.event-main, .event-title, .event-meta { display: block; min-width: 0; overflow-wrap: anywhere; }
.event-title { font-size: .86rem; line-height: 1.42; font-weight: 660; }
.event-meta { margin-top: 2px; color: #626b78; font-size: .75rem; line-height: 1.4; }
.event-badges, .detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.event-badges { justify-content: end; margin-left: 4px; }
.event-badges:empty, .detail-badges:empty { display: none; }
.badge {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
}
.badge--required { border-color: #e6bc6a; background: #fbe5b4; color: #644100; }
.badge--notes { border-color: #b8cfeb; background: #e4effa; color: #204b70; }
.badge--request { display: inline-flex; gap: 4px; border-color: #cfcee0; background: #eeedf6; color: #4a4371; }
.badge--request::before { width: 8px; height: 8px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 70%, 40% 70%, 10% 100%, 10% 70%, 0 70%); content: ""; }
.empty-state { padding: 12px 0; color: var(--muted); font-size: .84rem; }
.events-list .empty-state { padding: 18px 15px; }

.detail-empty { padding: 16px; color: var(--muted); font-size: .9rem; }
.detail-content { padding: 15px 16px 18px; }
.detail-identity { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 10px 14px; }
.detail-tagline { display: flex; align-items: center; gap: 10px; }
.detail-clock { color: #575a66; font: .84rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.detail-identity h3 { margin-top: 3px; font-size: 1.17rem; font-weight: 710; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.detail-meta { padding-top: 5px; color: var(--muted); font-size: .83rem; }
.detail-description { margin-top: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-source-comment { margin-top: 8px; padding: 7px 9px; border-left: 2px solid #d1b56b; background: #faf7f0; color: #574a35; font-size: .87rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-description:empty, .detail-source-comment:empty, .detail-meta:empty { display: none; }
.check-label { display: flex; gap: 7px; align-items: center; width: fit-content; margin-top: 11px; }
.check-label input { margin: 0; width: 16px; height: 16px; accent-color: #91600b; }
.discussion-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.discussion-column h4 { font-size: .97rem; line-height: 1.35; font-weight: 720; }
.discussion-entries { display: grid; gap: 6px; margin-top: 7px; margin-bottom: 10px; }
.discussion-entries .empty-state { padding: 0; }
.entry { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #f8f9fa; font-size: .83rem; }
.entry-heading { display: flex; flex-wrap: wrap; gap: 2px 7px; align-items: center; font-weight: 670; }
.entry-heading strong { overflow-wrap: anywhere; }
.entry-heading time { color: var(--muted); font-weight: 450; font-size: .77rem; }
.entry-text { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-state { color: var(--blue-ink); font-weight: 650; font-size: .75rem; }
.respond-button { margin-top: 6px; min-height: 28px; padding: 4px 8px; border: 1px solid #c8daeb; border-radius: 6px; color: var(--blue-ink); background: var(--blue-wash); font-size: .76rem; font-weight: 680; }
.respond-button:hover { border-color: #9ab6cc; }
.request-state + .respond-button { margin-left: 6px; }
.discussion-form { display: grid; gap: 6px; align-items: start; }
.discussion-form .button { justify-self: start; }
.discussion-form input, .discussion-form select, .discussion-form textarea { font-size: .86rem; }
.note-reply { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 8px; border-radius: 6px; background: var(--blue-wash); color: var(--blue-ink); font-size: .8rem; }
.note-reply .respond-button { margin-top: 0; }

.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 44% 24%, #fffbef 0, var(--page) 56%);
}
.login-card { width: min(100%, 421px); padding: clamp(23px, 6vw, 34px); border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 15px 46px rgb(28 33 41 / 8%); }
.login-card .brand { margin-bottom: 24px; }
.login-card h1 { font-size: clamp(1.65rem, 5vw, 2rem); line-height: 1.16; letter-spacing: -.04em; }
.login-intro { margin-top: 8px; color: var(--muted); font-size: .92rem; }
.login-card form { display: grid; gap: 7px; margin-top: 20px; }
.login-card input { min-height: 43px !important; }
.login-submit { margin-top: 5px; justify-content: space-between; }

.fragment-dialog {
  width: min(100% - 32px, 520px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 55px rgb(16 26 37 / 24%);
}
.fragment-dialog::backdrop { background: rgb(19 27 38 / 58%); }
.fragment-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.fragment-heading h2 { font-size: 1.25rem; letter-spacing: -.03em; line-height: 1.25; }
.fragment-video { color: var(--muted); font-size: .82rem; }
.fragment-video:not(:empty) { margin-bottom: 3px; }
.fragment-body, .fragment-request-fields { display: grid; gap: 6px; }
.fragment-body { padding: 12px 16px 15px; }
.fragment-body > label:not(.check-label), .fragment-request-fields > label { margin-top: 4px; }
.fragment-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fragment-times > div { display: grid; grid-template-rows: minmax(1.55rem, auto) auto auto; gap: 3px; align-items: start; }
.fragment-times input { font-family: var(--mono); }
.fragment-times .button, .fragment-pick-time { justify-self: start; }
.fragment-pick-time { margin: 1px 0 3px; }
.optional { color: var(--muted); font-weight: 420; }
.fragment-footer { display: flex; justify-content: end; gap: 6px; padding: 11px 16px; border-top: 1px solid var(--line); background: #f9f9f9; }
.access-dialog .fragment-heading { align-items: center; }
.access-result-name { font-size: .92rem; font-weight: 650; overflow-wrap: anywhere; }
.access-dialog #issued-token { font-family: var(--mono); font-size: .88rem; }
.access-token-hint, .access-copy-status { color: var(--muted); font-size: .84rem; }
.access-copy-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; }

@media (max-width: 1120px) {
  .top-bar-inner, .workspace { width: calc(100% - 42px); }
  .workbench { grid-template-columns: minmax(0, 1.48fr) minmax(315px, 1fr); }
  .session-counters { margin-top: 2px; }
}

@media (max-width: 940px) {
  .session-header { align-items: start; flex-direction: column; }
}

@media (max-width: 760px) {
  .workbench { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "video" "events" "detail"; }
  .top-bar-inner, .workspace { width: calc(100% - 28px); }
  .workspace { padding-top: 18px; }
  .session-header { margin-bottom: 14px; }
  .events-panel { position: static; max-height: min(475px, 80dvh); }
  .video-actions { justify-content: start; }
}

@media (max-width: 470px) {
  .top-bar-inner { gap: 8px; min-height: 55px; }
  .brand { gap: 6px; font-size: .95rem; }
  .brand-mark { width: 29px; height: 29px; }
  .account { gap: 5px; }
  .account-name { max-width: 33vw; font-size: .77rem; }
  .user-initials { display: none; }
  .access-button { gap: 4px; padding-inline: 5px; }
  .logout-button { margin-left: 0; min-width: 36px; padding-inline: 6px; }
  .logout-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .panel-heading { min-height: 51px; padding-inline: 11px; }
  .video-body { padding: 9px; }
  .video-actions > .button { flex: 1 1 auto; }
  .discussion-layout { grid-template-columns: minmax(0, 1fr); }
  .discussion-column + .discussion-column { padding-top: 12px; border-top: 1px solid var(--line); }
  .event-controls { padding-inline: 8px; }
  .event-controls input, .event-controls select { padding-right: 3px; }
  .event-list-labels { padding-inline: 10px; grid-template-columns: 67px 1fr; }
  .event-row { padding-inline: 10px; grid-template-columns: 67px minmax(0, 1fr) auto; }
  .fragment-times label { min-height: 2.6em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
