:root {
  color-scheme: light;
  --ink: #13223a;
  --muted: #53627a;
  --navy: #102039;
  --teal: #086f66;
  --teal-dark: #005c54;
  --line: #d7e0ea;
  --surface: #fff;
  --ground: #f1f5f9;
  --radius: 16px;
  --shadow: 0 8px 30px #17324b0d;
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang TC","Microsoft JhengHei",sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  line-height: 1.55;
}

button,input,select,textarea {
  font: inherit;
}

a {
  color: var(--teal-dark);
}

:focus-visible {
  outline: 3px solid #147d91;
  outline-offset: 3px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px max(20px,calc((100vw - 1160px)/2));
  background: var(--navy);
  color: #d8e7f1;
}

.brand {
  color: white;
  font-weight: 800;
  text-decoration: none;
  font-size: 1.17rem;
  letter-spacing: -.03em;
}

.topbar-label {
  font-size: .8rem;
  color: #aebfd1;
}

.topbar #logout {
  margin-left: auto;
  color: #e8f4ff;
  border-color: #465a73;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 20px 60px;
  min-height: 80vh;
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(26px,7vw,110px);
  align-items: center;
  padding: clamp(22px,6vw,84px) 0;
}

.hero h1 {
  font-size: clamp(2.3rem,6vw,4.25rem);
  line-height: 1.17;
  letter-spacing: -.035em;
  margin: 10px 0 18px;
}

.intro {
  max-width: 34rem;
  font-size: 1.07rem;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: .79rem;
  font-weight: 750;
  letter-spacing: .105em;
}

.journey {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 7px;
  padding: 0;
  margin: 25px 0 0;
}

.journey li {
  background: #dfefed;
  border: 1px solid #c8e5df;
  border-radius: 99px;
  padding: 4px 9px;
  color: #0a4c46;
  font-size: .78rem;
  font-weight: 700;
}

.workspace-heading,.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-heading,.between {
  justify-content: space-between;
}

.workspace-heading {
  margin-bottom: 22px;
}

.workspace-heading h1 {
  font-size: clamp(1.7rem,4vw,2.35rem);
  line-height: 1.2;
  margin: 4px 0;
}

.capabilities,.status {
  font-size: .82rem;
  color: #254461;
  background: #e9f0f8;
  border-radius: 10px;
  padding: 6px 10px;
  margin: 0;
  width: max-content;
  max-width: 100%;
  font-weight: 650;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 16px;
}

.sidebar h2 {
  margin: 0;
  font-size: 1rem;
}

.sidebar .quiet {
  white-space: nowrap;
}

.work-column,#project-view {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(16px,3.2vw,27px);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.34rem;
  line-height: 1.3;
  margin: 0 0 9px;
}

.card h3 {
  font-size: 1.03rem;
  margin: 0;
}

.login,.form-stack {
  display: grid;
  gap: 10px;
}

.login h2,.login p {
  margin: 0;
}

.login .primary {
  width: 100%;
  margin-top: 5px;
}

.form-stack {
  align-items: start;
}

.form-stack>.button {
  justify-self: start;
}

.project-heading {
  display: grid;
  gap: 12px;
}

.project-heading .muted {
  margin: 0;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 6px;
}

.project-list button {
  text-align: left;
  width: 100%;
  overflow-wrap: anywhere;
}

.project-list button[aria-current="true"] {
  border-color: var(--teal);
  background: #e3f2ee;
  color: var(--teal-dark);
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
  color: var(--ink);
  padding: 7px 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button:hover:not(:disabled) {
  background: #e9eff6;
}

.button.primary {
  border-color: var(--teal-dark);
  background: var(--teal);
  color: white;
}

.button.primary:hover:not(:disabled) {
  background: var(--teal-dark);
}

.button.quiet {
  background: transparent;
}

.button.quiet:hover:not(:disabled) {
  background: #147d9115;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.wrap {
  flex-wrap: wrap;
}

.wizard-buttons {
  margin-top: 4px;
}

label,.label,legend {
  font-size: .9rem;
  font-weight: 680;
}

.label {
  margin: 0 0 5px;
}

legend {
  padding: 0 0 5px;
}

fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

input:not([type=checkbox]):not([type=radio]),select,textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 4px 0 0;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
  border: 1px solid #acbacb;
  border-radius: 8px;
}

textarea {
  resize: vertical;
}

input[type=checkbox],input[type=radio] {
  accent-color: var(--teal);
  margin: 3px 0 0;
  min-width: 16px;
  height: 16px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.check-grid,.field-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px 16px;
}

.check-grid label {
  font-weight: 520;
}

.check-grid {
  grid-template-columns: repeat(auto-fit,minmax(105px,1fr));
}

.muted,small {
  color: var(--muted);
}

.muted {
  font-size: .88rem;
  margin: .45em 0 .8em;
}

small {
  font-size: .82rem;
}

.notice,.error,.warning {
  border: 1px solid #bddbd5;
  border-radius: 10px;
  padding: 10px 13px;
  margin: 0;
  background: #e6f3ee;
  color: #184e42;
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.error {
  color: #8c2532;
  background: #fff0f1;
  border-color: #edc4ca;
}

.warning {
  background: #fff6dd;
  color: #6b4a10;
  border-color: #efdca8;
}

.nested {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 16px;
}

.analysis-result {
  margin-top: 16px;
}

.summary {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.metrics div {
  border-radius: 8px;
  background: #eef3f8;
  padding: 7px 10px;
}

.metrics dt {
  color: var(--muted);
  font-size: .74rem;
}

.metrics dd {
  margin: 0;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.clip-list {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.clip-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) minmax(0,1fr) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 10px;
}

.clip-reason {
  grid-column: 2/-1;
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.clip-number {
  align-self: center;
  font-variant-numeric: tabular-nums;
  color: var(--teal-dark);
  font-weight: 750;
}

.clip-row .button {
  min-height: 36px;
}

.clip-row input {
  font-variant-numeric: tabular-nums;
}

video {
  display: block;
  width: 100%;
  max-height: 65vh;
  background: #101723;
  border-radius: 11px;
  margin: 10px 0;
}

progress {
  width: 100%;
  height: 14px;
  accent-color: var(--teal);
}

details summary {
  cursor: pointer;
  font-weight: 700;
}

.transcript-list {
  max-height: 17rem;
  overflow: auto;
  padding-left: 1.4rem;
}

.transcript-list li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.transcript-list time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  margin-right: .65em;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.downloads a {
  display: block;
  padding: 5px 9px;
  border-radius: 6px;
  background: #e6f2f0;
  font-weight: 700;
  font-size: .84rem;
  text-decoration: none;
}

.stills {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(105px,1fr));
  gap: 8px;
  margin: 10px 0;
}

.stills figure {
  margin: 0;
}

.stills img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.stills figcaption {
  color: var(--muted);
  font-size: .78rem;
}

.footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

@media(max-width:760px) {
  .shell {
    padding-top: 24px;
  }
  .hero,.workspace-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .project-list {
    grid-template-columns: repeat(auto-fit,minmax(135px,1fr));
  }
  .workspace-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .hero {
    padding-top: 12px;
  }
  .topbar-label {
    display: none;
  }
}

@media(max-width:430px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .clip-row {
    grid-template-columns: auto minmax(0,1fr) minmax(0,1fr);
  }
  .clip-row button {
    grid-column: 2/-1;
    justify-self: start;
  }
  .clip-reason {
    grid-column: 2/-1;
  }
}

.frame-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #e7eef5;
  cursor: pointer;
}

.frame-button:hover {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.contact-sheet {
  align-self: end;
  font-size: .82rem;
  font-weight: 700;
}

.time-button {
  border: 0;
  background: #eef3f8;
  color: var(--teal-dark);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 5px;
  margin-right: .6em;
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.clip-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.clip-controls .button {
  min-width: 34px;
  padding: 4px 8px;
}

.clip-controls .button:last-child {
  white-space: nowrap;
}

@media(max-width:650px) {
  .clip-row {
    grid-template-columns: auto minmax(0,1fr) minmax(0,1fr);
  }
  .clip-controls {
    grid-column: 2/-1;
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }
}
