:root {
  --bg: #ffffff;
  --bg-soft: #f6f6fb;
  --surface: #ffffff;
  --ink: #303033;
  --ink-strong: #242428;
  --muted: #74747b;
  --line: #e7e7ee;
  --line-soft: #f0f0f5;
  --accent: #5a4ce0;
  --accent-soft: #f0efff;
  --accent-border: #786bf2;
  --success: #2c9b80;
  --danger: #c53d4f;
  --warning: #b67927;
  --shadow: 0 18px 50px rgba(35, 35, 50, 0.08);
}

@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 100 700;
  src: url("/static/material-symbols-rounded.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.material-symbols-rounded {
  direction: ltr;
  display: inline-block;
  font-family: "Material Symbols Rounded";
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 21px;
  font-style: normal;
  font-weight: 500;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
}

button,
.button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

button.secondary,
.secondary,
button.ghost,
.ghost,
.detail-button,
.filter-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

button.danger {
  background: #fff;
  border-color: #efc3ca;
  color: var(--danger);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  outline: 0;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(90, 76, 224, 0.11);
}

textarea {
  resize: vertical;
}

.shell {
  min-height: 100vh;
}

.content {
  padding: 28px 38px 42px;
}

.command-bar {
  background: #fff;
  border-top: 18px solid #171342;
  box-shadow: 0 1px 0 var(--line);
  padding: 10px 28px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.ask-box {
  align-items: center;
  border: 1.5px solid var(--accent-border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  height: 64px;
  padding: 6px;
}

.ask-box input {
  border: 0;
  box-shadow: none;
  color: #6d6d74;
  font-size: 18px;
  min-height: 48px;
  padding: 0;
}

.icon-selector,
.send-chip,
.icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--accent);
  display: inline-flex;
  height: 52px;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

.icon-selector {
  gap: 8px;
  width: 84px;
}

.send-chip,
.icon-button {
  width: 52px;
}

.send-chip {
  background: #efeff2;
  border: 0;
  color: #93939a;
}

.app-tabs {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 96px;
}

.app-tab {
  align-items: center;
  border-bottom: 3px solid transparent;
  color: #6f6f75;
  display: inline-flex;
  font-size: 18px;
  height: 66px;
  padding: 0 22px;
}

.app-tab.active {
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
  border-radius: 8px 8px 0 0;
  color: var(--accent);
}

.last-sync {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 7px;
  margin-left: auto;
}

.upload-button {
  border-radius: 8px;
  font-size: 18px;
  min-height: 56px;
}

.page-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-head h1 {
  color: var(--ink-strong);
  font-size: 32px;
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.metric,
.panel,
.reports-table-shell,
.recording-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  font-size: 34px;
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
}

.panel h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.panel-head,
.actions,
.test-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.report-filters {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 16px 38px 20px;
  max-width: none;
}

.filter-input,
.filter-select {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  min-height: 58px;
  padding: 0 14px;
}

.filter-input {
  min-width: 310px;
  width: 330px;
}

.filter-select {
  min-width: 190px;
}

.compact-filter {
  min-width: 130px;
}

.filter-input input,
.filter-select select {
  border: 0;
  box-shadow: none;
  color: #4d4d52;
  font-size: 16px;
  min-height: 0;
  padding: 0;
}

.filter-button {
  min-height: 58px;
}

.reports-table-shell {
  margin: 0 38px;
  max-width: none;
  overflow: hidden;
}

.reports-head,
.report-row {
  display: grid;
  grid-template-columns: 130px minmax(360px, 1.5fr) minmax(260px, 0.8fr) minmax(260px, 0.8fr) 170px;
}

.reports-head {
  align-items: center;
  color: #38383d;
  font-size: 18px;
  font-weight: 800;
  min-height: 58px;
  padding: 0 20px;
}

.small-icon {
  color: var(--accent);
  font-size: 19px;
  vertical-align: -3px;
}

.week-row {
  background: #f4f4fa;
  border-top: 1px solid var(--line);
  color: #394194;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 20px;
  text-transform: uppercase;
}

.report-row {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--ink);
  min-height: 94px;
  padding: 0 20px;
}

.report-row:hover {
  background: #fbfbff;
}

.source-tile {
  align-items: center;
  border: 1px dashed var(--line);
  display: inline-flex;
  height: 62px;
  justify-content: center;
  position: relative;
  width: 88px;
}

.source-tile > .material-symbols-rounded {
  align-items: center;
  background: linear-gradient(180deg, #745fff, #4d6df6);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.platform-dot {
  align-items: center;
  background: #1160ff;
  border: 3px solid #fff;
  border-radius: 50%;
  bottom: 6px;
  color: #fff;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  position: absolute;
  right: -8px;
  width: 26px;
}

.platform-dot .material-symbols-rounded {
  font-size: 16px;
}

.report-title-cell,
.date-cell {
  display: grid;
  gap: 8px;
}

.report-title-cell strong,
.date-cell strong {
  color: #3d3d43;
  font-size: 17px;
}

.date-cell span {
  color: var(--muted);
}

.report-badges {
  display: flex;
  gap: 5px;
}

.mini-badge {
  align-items: center;
  background: #eeeeef;
  border-radius: 6px;
  color: #6f6f75;
  display: inline-flex;
  font-size: 13px;
  gap: 3px;
  height: 24px;
  padding: 0 7px;
  width: max-content;
}

.mini-badge .material-symbols-rounded {
  font-size: 15px;
}

.mini-badge.score {
  background: #e8fbf6;
  color: var(--success);
}

.folder-pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #66666c;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  max-width: 250px;
  overflow: hidden;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-pill .material-symbols-rounded {
  color: #6a9bea;
}

.owner-cell {
  align-items: center;
  display: flex;
  gap: 28px;
  justify-content: flex-start;
}

.avatar {
  align-items: center;
  background: #ffd8c8;
  border-radius: 12px;
  color: #d66232;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.more-icon {
  color: #68686d;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.table-title {
  color: var(--ink-strong);
  display: block;
  font-weight: 800;
}

.table-sub {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.pill {
  background: #e8f7f1;
  border-radius: 999px;
  color: #12624e;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 9px;
}

.form-grid,
.settings-grid,
.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-section {
  align-content: start;
  display: grid;
  gap: 14px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.two-col {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.check {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 10px;
}

.check input {
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.hint,
.empty {
  color: var(--muted);
  font-size: 14px;
}

.reports-empty {
  padding: 38px;
}

.facts {
  display: grid;
  gap: 10px;
  grid-template-columns: 130px 1fr;
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-weight: 700;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.summary,
.transcript,
.error-box {
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 640px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.error-box {
  border-color: #efc3ca;
  color: var(--danger);
  margin-top: 14px;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
}

.flash.success {
  background: #e8f7f1;
  color: #12624e;
}

.flash.error {
  background: #fae9ec;
  color: var(--danger);
}

.report-detail-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: -28px -38px 0;
  min-height: 128px;
  padding: 22px 26px;
}

.title-line,
.meta-line,
.detail-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.title-line h1 {
  color: var(--ink-strong);
  font-size: 30px;
  line-height: 1.15;
  margin: 0;
}

.back-link {
  align-items: center;
  color: #64646a;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.folder-count {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #66666c;
  display: inline-flex;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
}

.meta-line {
  color: #6b6b72;
  flex-wrap: wrap;
  font-size: 17px;
  margin-top: 16px;
}

.meta-line span {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.detail-actions {
  flex-shrink: 0;
}

.detail-button {
  border-radius: 8px;
  min-height: 56px;
  padding: 0 18px;
}

.share-button {
  border-radius: 8px;
  min-height: 56px;
}

.detail-more {
  color: #5f5f66;
}

.report-tabs {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  height: 100px;
  margin: 0 -38px;
  padding: 0 48px;
}

.report-tabs a {
  border-bottom: 3px solid transparent;
  color: #66666d;
  font-size: 19px;
  font-weight: 700;
  padding: 22px 22px;
}

.report-tabs a.active {
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
  border-radius: 8px 8px 0 0;
  color: var(--accent);
}

.report-reader {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 42%);
  padding-top: 16px;
}

.report-main {
  color: #58585e;
  font-size: 21px;
  line-height: 1.48;
  max-width: 1080px;
}

.reader-toolbar {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto;
  margin-bottom: 28px;
}

.summary-search {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  min-height: 52px;
  padding: 0 12px;
}

.summary-search input {
  border: 0;
  box-shadow: none;
  color: #8a8a91;
  font-size: 18px;
  min-height: 0;
  padding: 0;
}

.copy-button {
  background: #fff;
  border: 0;
  color: #66666c;
  min-height: 42px;
  padding: 0;
}

.report-main h2 {
  color: var(--ink-strong);
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 20px;
}

.summary-intro {
  margin: 0 0 8px;
}

.summary-list {
  margin: 8px 0 28px;
  padding-left: 26px;
}

.divider {
  border-top: 1px solid var(--line);
  margin: 30px 0 26px;
}

.action-list {
  display: grid;
  gap: 20px;
}

.action-item {
  align-items: baseline;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
}

.action-item.text-only {
  grid-template-columns: 1fr;
}

.action-item p {
  margin: 0;
}

.time-chip,
.chapter-item span {
  background: #eeeeef;
  border-radius: 8px;
  color: #77777d;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.recording-panel {
  align-self: start;
  box-shadow: 0 16px 38px rgba(35, 35, 50, 0.05);
  padding: 10px;
  position: sticky;
  top: 26px;
}

.video-card {
  align-items: center;
  background: #303030;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 414px;
  position: relative;
}

.expand-recording {
  align-items: center;
  background: #f2f1ff;
  border-radius: 6px;
  color: var(--accent);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 42px;
}

.locked-stack {
  display: grid;
  gap: 12px;
  width: min(280px, calc(100% - 48px));
}

.locked-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #fff;
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 56px;
  padding: 0 16px;
}

.side-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 30px 2px 24px;
}

.side-tabs span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #77777d;
  font-size: 16px;
  font-weight: 800;
  padding: 12px 16px;
}

.side-tabs .active {
  border-color: var(--accent-border);
  color: #424248;
}

.chapter-list {
  display: grid;
  gap: 24px;
  padding: 0 22px 64px;
}

.chapter-item {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
}

.chapter-item p {
  color: #44444a;
  font-size: 17px;
  margin: 0;
}

.ask-read {
  align-items: center;
  background: #6757f4;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 12px 30px rgba(90, 76, 224, 0.28);
  color: #fff;
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  gap: 8px;
  min-height: 56px;
  padding: 0 20px;
  position: absolute;
  right: 20px;
}

.recording-panel {
  position: sticky;
}

.transcript-lines {
  display: grid;
  gap: 12px;
  font-size: 18px;
  line-height: 1.55;
}

.transcript-lines p {
  border-bottom: 1px solid var(--line-soft);
  margin: 0;
  padding-bottom: 12px;
}

.report-facts {
  font-size: 17px;
  line-height: 1.35;
}

.login-page {
  align-items: center;
  background: var(--bg-soft);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  padding: 28px;
  width: min(420px, calc(100vw - 32px));
}

.brand,
.login-brand {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.login-brand {
  margin-bottom: 8px;
}

.stack {
  display: grid;
  gap: 12px;
}

@media (max-width: 1180px) {
  .last-sync {
    display: none;
  }

  .reports-head,
  .report-row {
    grid-template-columns: 96px minmax(250px, 1fr) minmax(210px, 0.7fr) minmax(190px, 0.7fr) 120px;
  }

  .report-reader {
    grid-template-columns: 1fr;
  }

  .recording-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .content {
    padding: 22px 18px 34px;
  }

  .command-bar {
    padding: 8px 14px 0;
  }

  .ask-box {
    height: 56px;
  }

  .app-tabs,
  .report-filters {
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
  }

  .upload-button,
  .last-sync {
    display: none;
  }

  .metric-grid,
  .form-grid,
  .settings-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .reports-table-shell {
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
  }

  .reports-head,
  .report-row {
    min-width: 960px;
  }

  .report-detail-head {
    align-items: stretch;
    flex-direction: column;
    margin: -22px -18px 0;
  }

  .detail-actions,
  .title-line {
    flex-wrap: wrap;
  }

  .report-tabs {
    margin: 0 -18px;
    overflow-x: auto;
    padding: 0 18px;
  }

  .video-card {
    min-height: 280px;
  }
}

@media (max-width: 620px) {
  .page-head,
  .panel-head,
  .actions,
  .test-row {
    align-items: stretch;
    flex-direction: column;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .report-main {
    font-size: 17px;
  }

  .report-main h2 {
    font-size: 24px;
  }

  .reader-toolbar,
  .action-item,
  .chapter-item {
    grid-template-columns: 1fr;
  }
}
