:root {
  color-scheme: light;
  --ink: oklch(20% 0.012 245);
  --ink-soft: oklch(33% 0.014 245);
  --muted: oklch(51% 0.016 245);
  --faint: oklch(66% 0.014 245);
  --line: oklch(88% 0.01 245);
  --line-strong: oklch(80% 0.014 245);
  --paper: oklch(96% 0.006 245);
  --surface: oklch(99% 0.004 245);
  --surface-soft: oklch(94% 0.008 245);
  --sidebar: oklch(93% 0.012 245);
  --accent: oklch(59% 0.125 220);
  --accent-soft: oklch(95% 0.025 220);
  --danger: oklch(56% 0.17 28);
  --focus: 0 0 0 3px oklch(78% 0.075 220 / 0.32);
  --topbar-height: 58px;
  --font-sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

main {
  min-height: calc(100vh - var(--topbar-height));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand,
.sidebar-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 6px;
  background-image: url("assets/app-icon.png");
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.34);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-button,
.toolbar-actions button,
.apple-sign-in-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  padding: 7px 13px;
}

.ghost-button:hover:not(:disabled),
.toolbar-actions button:hover:not(:disabled),
.apple-sign-in-button:hover:not(:disabled) {
  border-color: oklch(68% 0.014 245);
  background: oklch(97% 0.004 245);
}

.ghost-button:active:not(:disabled),
.toolbar-actions button:active:not(:disabled),
.apple-sign-in-button:active:not(:disabled) {
  background: oklch(94% 0.006 245);
}

.ghost-button:disabled,
.toolbar-actions button:disabled,
.apple-sign-in-button:disabled {
  color: var(--faint);
  opacity: 0.74;
}

.status-panel {
  position: relative;
  z-index: 15;
  display: flex;
  width: min(1180px, calc(100% - 44px));
  flex-wrap: wrap;
  gap: 7px 14px;
  align-items: center;
  margin: 14px auto 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 14px;
}

.status-panel strong {
  color: var(--ink);
  font-weight: 650;
}

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

.auth-gate {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: minmax(380px, 47.5%) minmax(0, 1fr);
  background:
    linear-gradient(90deg, var(--surface) 0%, var(--surface) 47.5%, var(--paper) 47.5%, var(--paper) 100%);
}

.auth-panel {
  display: flex;
  width: min(520px, calc(100% - 60px));
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding: 56px 0;
}

.auth-panel h1 {
  max-width: 500px;
  margin: 0 0 18px;
  font-size: 39px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.12;
}

.auth-panel > p:not(.eyebrow) {
  max-width: 440px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.auth-actions {
  display: flex;
  min-height: 44px;
  align-items: center;
  margin-bottom: 28px;
}

.apple-sign-in-button {
  min-height: 40px;
  border-color: oklch(25% 0.012 245);
  font-size: 15px;
  padding: 8px 18px;
}

.privacy-strip {
  display: grid;
  gap: 6px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: oklch(98% 0.004 245);
  padding: 15px 18px;
  color: var(--muted);
  font-size: 14px;
}

.privacy-strip strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.product-stage {
  position: relative;
  display: grid;
  min-height: 620px;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  padding: 64px;
}

.product-stage::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, oklch(96% 0.004 245), oklch(93% 0.012 245));
  content: "";
}

.device-shadow {
  display: none;
}

.web-card-preview {
  position: relative;
  display: grid;
  width: min(720px, 88%);
  aspect-ratio: 16 / 10;
  grid-template-columns: 128px 1fr;
  overflow: hidden;
  border: 6px solid oklch(22% 0.014 245);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 22px 52px oklch(28% 0.025 245 / 0.16);
}

.web-card-preview::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 112px;
  height: 16px;
  border-radius: 0 0 5px 5px;
  background: oklch(22% 0.014 245);
  content: "";
  transform: translateX(-50%);
}

.preview-sidebar {
  background: var(--surface-soft);
}

.preview-document {
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 58px 70px;
}

.preview-document span,
.preview-document strong,
.preview-document p {
  display: block;
  margin: 0;
  border-radius: 3px;
}

.preview-document span {
  width: 160px;
  height: 12px;
  background: oklch(91% 0.035 220);
}

.preview-document strong {
  width: 78%;
  height: 28px;
  background: oklch(24% 0.014 245);
}

.preview-document p {
  width: 100%;
  height: 10px;
  background: oklch(86% 0.014 245);
}

.preview-document p:nth-child(4) {
  width: 86%;
}

.preview-document p:nth-child(5) {
  width: 64%;
}

.phone-preview {
  position: absolute;
  bottom: 78px;
  left: 12%;
  display: grid;
  width: 174px;
  gap: 11px;
  border: 5px solid oklch(22% 0.014 245);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px oklch(28% 0.025 245 / 0.15);
  padding: 40px 17px 20px;
}

.phone-preview span,
.phone-preview strong,
.phone-preview p {
  height: 9px;
  margin: 0;
  border-radius: 3px;
  background: oklch(86% 0.014 245);
}

.phone-preview strong {
  width: 80%;
  height: 15px;
  background: oklch(24% 0.014 245);
}

.phone-preview p:last-child {
  width: 68%;
}

.icloud-badge {
  position: absolute;
  right: 12%;
  bottom: 100px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  padding: 8px 12px;
}

.workspace {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: 220px 320px minmax(0, 1fr);
  background: var(--paper);
}

.workspace-sidebar {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 18px 16px;
}

.sidebar-logo {
  margin-bottom: 28px;
}

.workspace-nav {
  display: grid;
  gap: 3px;
}

.nav-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.nav-row.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}

.nav-row:hover:not(:disabled) {
  border-color: var(--line);
  background: oklch(96% 0.006 245);
}

.nav-row:disabled {
  color: var(--faint);
}

.nav-row strong {
  font-size: 13px;
}

.sidebar-group {
  display: grid;
  gap: 10px;
  margin-top: 32px;
  color: var(--ink-soft);
  font-size: 14px;
}

.sidebar-group p {
  margin: 0 0 3px;
  color: var(--faint);
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-list {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.list-header {
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.list-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

#recording-count {
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
}

#recording-list {
  display: grid;
  max-height: calc(100vh - var(--topbar-height) - 90px);
  overflow: auto;
}

.recording-row {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 100px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  padding: 13px 22px 14px;
  text-align: left;
}

.recording-row:hover {
  background: oklch(97% 0.006 245);
}

.recording-row[data-selected="true"] {
  background: oklch(98% 0.004 245);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.row-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.36;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.row-chip {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  padding: 4px 8px;
}

.detail {
  min-width: 0;
  overflow: auto;
  background: var(--surface);
}

.empty-detail {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  place-content: center;
  padding: 32px;
  text-align: center;
}

.empty-detail h2 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 500;
}

.empty-detail p {
  color: var(--muted);
}

.document-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 11px 26px;
}

.document-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button {
  padding: 6px 13px;
}

.document-reader {
  width: min(920px, calc(100% - 72px));
  margin: 0 auto;
  padding: 34px 0 96px;
}

.document-tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.document-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  padding: 0 0 9px;
}

.document-tabs button[aria-pressed="true"] {
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
}

.document-tabs button:hover {
  color: var(--ink-soft);
}

.document-reader h1 {
  max-width: 820px;
  margin: 0 auto 34px;
  color: var(--ink);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.26;
  text-align: center;
}

.audio-status {
  display: grid;
  grid-template-columns: 26px minmax(160px, max-content) minmax(0, 1fr);
  gap: 9px 12px;
  align-items: center;
  margin: 0 auto 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  color: var(--muted);
}

.audio-status span {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.audio-status span::before,
.audio-status span::after {
  position: absolute;
  background: var(--faint);
  content: "";
}

.audio-status span::before {
  top: 8px;
  left: 3px;
  width: 10px;
  height: 1px;
}

.audio-status span::after {
  top: 3px;
  left: 8px;
  width: 1px;
  height: 10px;
}

.audio-status strong {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}

.audio-status em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.document-body {
  margin: 0 auto;
}

.reader-block {
  max-width: 72ch;
  margin: 0 auto 26px;
  color: var(--ink-soft);
}

.reader-block h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.28;
}

.reader-block h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.32;
}

.reader-block p,
.reader-block li {
  font-size: 15px;
}

.reader-block p {
  margin-bottom: 10px;
}

.reader-block ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 23px;
}

.reader-block li::marker {
  color: var(--ink);
  font-size: 1em;
}

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

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

.action-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: oklch(98% 0.004 245);
  padding: 12px 14px;
}

.action-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.action-item span {
  color: var(--muted);
  font-size: 13px;
}

.transcript {
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 190px 300px minmax(0, 1fr);
  }

  .document-reader {
    width: min(860px, calc(100% - 48px));
  }
}

@media (max-width: 920px) {
  .auth-gate {
    grid-template-columns: 1fr;
    background: var(--surface);
  }

  .auth-panel {
    padding-top: 44px;
  }

  .auth-panel h1 {
    font-size: 36px;
  }

  .product-stage {
    min-height: 400px;
    padding: 24px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-logo,
  .sidebar-group,
  .sidebar-footer {
    display: none;
  }

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

  .recording-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #recording-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 72vw);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .recording-row {
    border-right: 1px solid var(--line);
  }

  .detail {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .status-panel {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .auth-panel {
    width: calc(100% - 32px);
  }

  .auth-panel h1 {
    font-size: 32px;
  }

  .auth-panel > p:not(.eyebrow) {
    font-size: 15px;
  }

  .product-stage {
    display: none;
  }

  .workspace-nav {
    gap: 4px;
  }

  .nav-row {
    padding: 9px 10px;
  }

  .document-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
  }

  .document-reader {
    width: calc(100% - 30px);
    padding-top: 24px;
  }

  .document-tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .document-tabs button {
    flex: 0 0 auto;
    font-size: 15px;
  }

  .document-reader h1 {
    font-size: 24px;
    text-align: left;
  }

  .audio-status {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .audio-status em {
    grid-column: 2;
  }
}
