:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17212d;
  background: #f7f8fb;
  font-synthesis: none;
  --accent: #2463eb;
  --muted: #647082;
  --line: #e3e7ee;
  --radius: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
}
button,
input,
select {
  font: inherit;
}
button,
a,
label.upload-button {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  border-radius: 9px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
label:focus-within {
  outline: 3px solid #93b4ff;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 5vw;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.7px;
}
.topbar > .muted {
  font-size: 13px;
}
.topbar > button {
  margin-left: auto;
}
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.library {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 28px 80px;
  min-height: calc(100dvh - 150px);
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
}
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 1.8px;
  margin-bottom: 14px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  min-height: 44px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 3px #17212d0a;
}
.primary:hover {
  background: #174fce;
}
.quiet {
  border: 1px solid var(--line);
  background: #fff;
  color: #344153;
  padding: 10px 14px;
  min-height: 40px;
  font-size: 13px;
}
.quiet:hover {
  border-color: #abb8cb;
  background: #f8faff;
}
.danger {
  color: #b72d39;
}
.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  width: 340px;
}
.search span {
  font-size: 26px;
  color: var(--muted);
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 12px 0;
  background: transparent;
  font-size: 14px;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.video-card {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.thumbnail {
  position: relative;
  aspect-ratio: 16/10;
  background: #eaf0fa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbnail .play {
  position: absolute;
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  background: #fffdf9eb;
  box-shadow: 0 4px 20px #10264620;
  color: #17212d;
  font-size: 14px;
}
.duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: #152030d9;
  color: #fff;
  padding: 4px 7px;
  font-size: 11px;
  border-radius: 6px;
}
.card-body {
  padding: 18px;
}
.card-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 7px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.card-actions button {
  padding: 8px 10px;
  min-height: 36px;
  font-size: 12px;
}
.card-actions .more {
  margin-left: auto;
}
.status-label {
  color: #4c6185;
  font-size: 13px;
}
.connect-panel {
  max-width: 440px;
  margin: 45px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px;
}
.connect-panel h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
}
.connect-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: #ecf2ff;
  color: var(--accent);
  border-radius: 13px;
  font-size: 30px;
  margin-bottom: 28px;
}
form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 24px 0 9px;
}
form input {
  width: 100%;
  border: 1px solid #b8c2d1;
  padding: 12px;
}
form button {
  width: 100%;
  margin-top: 18px;
}
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty h2 {
  color: #26344a;
  margin-top: 24px;
}
.empty p {
  font-size: 14px;
}
.empty-icon {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: #e9effb;
  color: #4775ce;
  font-size: 22px;
  margin: auto;
  display: grid;
  place-items: center;
}
.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: #eef3ff;
  border: 1px solid #d4e1ff;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 13px;
}
.upload-progress strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}
#error {
  padding: 16px;
  background: #fff0f0;
  border: 1px solid #efc7c7;
  border-radius: 10px;
  color: #98252f;
  margin-top: 24px;
  font-size: 14px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 14px 22px;
  background: #19283c;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px #0002;
  z-index: 10;
  font-size: 14px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 22px 5vw;
  color: #687589;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
dialog {
  width: min(1000px, 94vw);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
}
dialog::backdrop {
  background: #152335b3;
  backdrop-filter: blur(6px);
}
dialog button {
  float: right;
}
dialog video {
  width: 100%;
  display: block;
  margin-top: 20px;
  border-radius: 10px;
  background: #111827;
}
.viewer {
  max-width: 1100px;
  margin: auto;
  padding: 48px 28px 90px;
  min-height: calc(100dvh - 140px);
}
.viewer-heading h1 {
  font-size: 30px;
  letter-spacing: -0.9px;
  overflow-wrap: anywhere;
}
.viewer-heading p {
  font-size: 13px;
}
.stage {
  background: #101722;
  border-radius: 18px;
  overflow: hidden;
  margin-top: 30px;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
}
.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.video-state {
  color: white;
  text-align: center;
  padding: 24px;
  max-width: 500px;
}
.video-state p {
  color: #bac7dc;
  font-size: 14px;
  line-height: 1.5;
}
.video-state h2 {
  margin: 22px 0 10px;
}
.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #8190a34a;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.player-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 16px;
}
.player-actions label {
  font-size: 12px;
  color: #5d697c;
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-actions select {
  padding: 8px;
  border: 1px solid var(--line);
  background: white;
  color: #17212d;
}
.viewer-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 36px;
  line-height: 1.6;
}
@media (max-width: 950px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 68px;
    padding: 0 20px;
  }
  .topbar > .muted {
    display: none;
  }
  .library,
  .viewer {
    padding: 34px 20px 60px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 26px;
    gap: 16px;
  }
  h1 {
    font-size: 31px;
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .search {
    width: 100%;
    min-width: 0;
  }
  .toolbar {
    gap: 9px;
  }
  .connect-panel {
    padding: 26px;
    margin-top: 20px;
  }
  .viewer-heading h1 {
    font-size: 25px;
  }
  .stage {
    border-radius: 12px;
    margin-left: -6px;
    margin-right: -6px;
  }
  .player-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .viewer-note {
    margin-top: 28px;
  }
  footer span {
    display: none;
  }
  .toast {
    bottom: 18px;
    width: max-content;
    max-width: 90vw;
    text-align: center;
  }
  dialog {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

button.thumbnail {
  border: 0;
  padding: 0;
  width: 100%;
  border-radius: 0;
}
/* Library tools use the existing form, spacing and color primitives. */
[hidden] {
  display: none !important;
}
.settings-form {
  display: grid;
  gap: 16px;
}
.settings-form label,
.inline-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
.settings-form input,
.settings-form textarea,
.inline-form input,
#transcript-search,
#folder-filter {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line, #dce0e6);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.settings-form textarea {
  resize: vertical;
}
.settings-form .check,
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  font-size: 13px;
}
.check input {
  width: auto;
  flex: none;
}
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.details-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: 90vh;
  padding: 28px;
  box-sizing: border-box;
  overflow: auto;
}
.tool-section {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #e4e7eb;
}
.inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stats div {
  padding: 14px;
  background: #f5f7fa;
  border-radius: 10px;
  display: grid;
  gap: 6px;
}
.stats strong {
  font-size: 24px;
}
.stats span {
  font-size: 12px;
  color: #626976;
}
.inbox {
  margin: 16px 0 24px;
  padding: 14px 18px;
  border: 1px solid #e4e7eb;
  border-radius: 12px;
}
.inbox summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.notification {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
}
.notification span {
  color: #626976;
}
.inbox button {
  margin-top: 12px;
}
.toolbar {
  flex-wrap: wrap;
}
.toolbar select {
  max-width: 200px;
}
.comment {
  padding: 16px 0;
  border-bottom: 1px solid #e4e7eb;
}
.comment strong {
  font-size: 13px;
}
.comment p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.comment button {
  margin-left: 8px;
}
.cta {
  display: inline-block;
  margin: 12px 0;
  text-decoration: none;
}
.transcript-panel,
.feedback {
  margin-top: 28px;
  border-top: 1px solid #e4e7eb;
  padding-top: 22px;
}
.transcript-panel summary {
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}
.transcript-panel input {
  margin: 8px 0;
}
.transcript-line {
  display: flex;
  gap: 12px;
  align-items: start;
  border-radius: 8px;
  padding: 6px;
}
.transcript-line p {
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.transcript-line.active {
  background: #edf3ff;
}
.transcript-line button {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.reactions {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.reactions [aria-pressed="true"] {
  background: #e4edff;
  color: #245ccb;
}
.chapters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
#description {
  white-space: pre-wrap;
  line-height: 1.7;
}
#analytics-note {
  margin-top: 24px;
}
#unlock {
  margin: 18px auto;
}
#unlock input {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  box-sizing: border-box;
}
#unlock-error {
  color: #bd303b;
}
#comment-status {
  font-size: 13px;
}
.player-actions {
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .field-pair {
    grid-template-columns: 1fr;
  }
  .details-dialog {
    padding: 20px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar select {
    max-width: 100%;
  }
  .toolbar > .search {
    flex-basis: 100%;
  }
  .transcript-line {
    gap: 4px;
  }
  .viewer {
    overflow-wrap: anywhere;
  }
}
