:root {
  --bg: #eef2f9;
  --bg-soft: #f5f7fb;
  --surface: #ffffff;
  --ink: #0f1729;
  --muted: #6b7280;
  --line: #e5e9f2;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff4ff;
  --warning-bg: #fff4e5;
  --warning-ink: #92400e;
  --shadow: 0 1px 2px rgba(15, 23, 41, 0.04);
  --radius: 16px;
  --details-tabs-sticky-top: 84px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
}

.workspace {
  min-height: 100vh;
}

.is-auth {
  background: var(--bg);
}

.is-auth .app-shell-auth {
  width: min(1440px, 96vw);
  margin: 14px auto;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 76px 1fr;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.is-auth .workspace {
  background: var(--surface);
}

.side-rail {
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rail-logo,
.rail-item {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.rail-logo {
  margin-bottom: 6px;
  background: var(--accent);
  border-color: var(--accent);
}

.rail-item span {
  line-height: 1;
  font-size: 15px;
}

.rail-item-active {
  background: var(--accent-soft);
  border-color: #c7d7fe;
  color: var(--accent);
}

.rail-item-logout {
  cursor: pointer;
}

.rail-spacer {
  flex: 1;
}

.container {
  width: min(90vw, 1680px);
  margin: 0 auto;
}

.is-auth .container {
  width: min(90vw, 1680px);
}

.main-content {
  padding: 30px 0 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
}

.record-logo {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.record-logo-ring {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  display: block;
}

.record-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
  position: absolute;
}

.wave-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.wave-bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.wave-bars i {
  display: inline-block;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  animation: wave-pulse 1.8s ease-in-out infinite;
}

.wave-bars i:nth-child(1) {
  height: 8px;
  animation-delay: -0.35s;
}

.wave-bars i:nth-child(2) {
  height: 14px;
  animation-delay: -0.2s;
}

.wave-bars i:nth-child(3) {
  height: 18px;
  animation-delay: 0s;
}

.wave-bars i:nth-child(4) {
  height: 12px;
  animation-delay: -0.15s;
}

.wave-bars i:nth-child(5) {
  height: 9px;
  animation-delay: -0.3s;
}

.wave-bars-compact {
  gap: 2px;
  height: 14px;
}

.wave-bars-compact i {
  width: 2px;
  background: #dbeafe;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

@keyframes wave-pulse {
  0%,
  100% {
    transform: scaleY(0.9);
    opacity: 0.85;
  }

  50% {
    transform: scaleY(1.18);
    opacity: 1;
  }
}

.brand-text strong {
  font-size: 17px;
}

.brand-text small {
  font-size: 12px;
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  list-style: none;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
}

.nav-dropdown[open] .nav-dropdown-menu {
  display: grid;
  gap: 6px;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-link:hover {
  background: var(--bg-soft);
}

.nav-user {
  font-size: 13px;
  color: var(--muted);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  cursor: pointer;
}

.nav-logout-form {
  margin-top: 2px;
}

.nav-logout-btn {
  width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
}

h2 {
  font-size: clamp(20px, 2.2vw, 26px);
}

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

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 70ch;
}

.meta {
  margin: 6px 0;
  color: var(--muted);
  font-size: 14px;
}

.record-link {
  color: #344054;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.record-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.record-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}

.hero-card,
.panel,
.auth-card,
.empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  margin-bottom: 18px;
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.billing-page {
  display: grid;
  gap: 16px;
}

.billing-page-calendar {
  width: 100%;
}

.billing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.auto-refresh-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.billing-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.billing-card-head {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-actions {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hero-action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

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

.panel-head {
  margin-bottom: 12px;
}

.kpi-grid {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

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

.kpi-card strong {
  margin-top: 4px;
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.limit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.uploads-filters-panel {
  margin-bottom: 14px;
}

.upload-ingest-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: end;
}

.upload-ingest-copy .lead {
  max-width: 56ch;
}

.upload-ingest-hints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.upload-ingest-hint {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f5f8ff;
  border: 1px solid #dbe7ff;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

.upload-ingest-form {
  display: grid;
  gap: 12px;
}

.upload-ingest-form label {
  font-size: 13px;
  font-weight: 700;
  color: #475467;
}

.upload-picker {
  position: relative;
}

.upload-picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-picker-label {
  display: grid;
  gap: 4px;
  padding: 16px 16px 15px;
  border: 1px dashed #c7d7fe;
  border-radius: 14px;
  background: var(--bg-soft);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.upload-picker:hover .upload-picker-label,
.upload-picker input[type="file"]:focus + .upload-picker-label,
.upload-picker:focus-within .upload-picker-label {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.upload-picker-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.upload-picker-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.upload-ingest-meta {
  display: grid;
  gap: 4px;
}

.upload-ingest-file-name {
  font-weight: 700;
  color: #344054;
}

.upload-ingest-footnote {
  font-size: 12px;
}

.upload-ingest-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-ingest-submit {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.upload-ingest-status {
  min-height: 20px;
}

.upload-status-error {
  color: #b42318;
}

.uploads-filters-form label {
  font-size: 13px;
  font-weight: 700;
  color: #475467;
}

.uploads-filters-form input[type="date"] {
  min-width: 170px;
}

input,
button {
  font: inherit;
}

input {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 11px;
  min-height: 40px;
}

.btn,
button {
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary,
button,
.btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover,
button:hover,
.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-ghost {
  background: #fff;
  color: #475467;
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--bg-soft);
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.icon-btn {
  min-width: 40px;
  width: 40px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.icon-btn:hover {
  background: var(--bg-soft) !important;
}

.icon-delete {
  color: #d92d20;
}

.icon-repeat {
  color: var(--accent-strong);
}

.icon-back {
  color: var(--accent);
}

.tabs {
  display: inline-flex;
  gap: 6px;
  margin: 8px 0 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}

.tab {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
}

.tab-active {
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

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

.table thead th {
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.table tr:last-child td {
  border-bottom: none;
}

.day-divider-row td {
  border-bottom: 1px solid var(--line);
}

.day-divider-cell {
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

.status-uploaded {
  background: var(--bg-soft);
  color: var(--muted);
}

.status-processing {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-processed {
  background: #e7f7ed;
  color: #15803d;
}

.status-created {
  background: var(--bg-soft);
  color: var(--muted);
}

.status-summary_queued {
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.status-failed {
  background: #fdeceb;
  color: #dc2626;
}

.table-segments {
  table-layout: fixed;
}

.table-segments td.segment-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 860px) {
  .upload-ingest-panel {
    grid-template-columns: 1fr;
  }

  .upload-ingest-actions {
    align-items: stretch;
  }
}

.table-segments td.segment-meta,
.table-segments th:first-child {
  width: 16%;
}

.table-segments th:last-child,
.table-segments td:last-child {
  width: 84%;
}

.table-segments tr.segment-row-user td {
  background: #f8fbff;
}

.table-uploads td {
  vertical-align: middle;
}

.table-uploads {
  border-collapse: separate;
  border-spacing: 0 8px;
  border: 0;
  background: transparent;
}

.table-uploads thead th {
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.table-uploads tbody td {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table-uploads tbody tr td:first-child {
  border-left: 1px solid var(--line);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  white-space: nowrap;
}

.table-uploads tbody tr.upload-row {
  --upload-category-color: transparent;
}

.table-uploads tbody tr.upload-row td:first-child {
  box-shadow: inset 5px 0 0 var(--upload-category-color);
}

.table-uploads tbody tr td:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.table-uploads tbody tr:hover td {
  background: var(--accent-soft);
}

.table-uploads tr td:last-child {
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.pager {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pager-current {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.infinite-scroll-panel {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.infinite-scroll-panel-hidden {
  display: none;
}

.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.markdown-body {
  line-height: 1.6;
  color: var(--ink);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 0 0 12px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body table {
  margin: 0 0 12px;
}

.markdown-body table,
.summary-editor table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d0d5dd;
  background: #fff;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 20px;
}

.markdown-body code {
  background: #f2f6f3;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95em;
}

.markdown-body pre {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
}

.markdown-body th,
.markdown-body td,
.summary-editor th,
.summary-editor td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.markdown-body blockquote {
  border-left: 4px solid #c7ddff;
  padding-left: 10px;
  color: var(--muted);
}

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

.summary-head h2 {
  margin: 0;
}

.resummary-action-card {
  min-width: 320px;
  max-width: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.resummary-action-card > .muted {
  margin: 0 0 8px;
}

.resummary-action-form {
  display: grid;
  gap: 8px;
}

.resummary-action-card .summary-template-select {
  width: 100%;
  margin: 0;
  min-height: 40px;
  padding: 8px 10px;
}

.resummary-action-card .btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
}

.summary-versions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-version-select {
  min-width: 220px;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
}

.details-page {
  display: grid;
  gap: 16px;
}

.details-page .hero-card {
  margin-bottom: 0;
  padding: 28px;
  gap: 28px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.32fr);
  align-items: start;
}

.hero-main-column {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.meta-field-row {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.hero-status-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}

.details-page .meta {
  margin: 4px 0;
}

.details-page .wave-title {
  align-items: center;
  gap: 10px;
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 500;
  line-height: 1.25;
}

.title-editor-input {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 2px 6px;
  min-height: 0;
  min-width: min(720px, 60vw);
  width: 100%;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.title-editor-input:focus {
  border-color: #c7ddff;
  background: #f8fbff;
  outline: none;
}

.title-readonly {
  display: inline-block;
  padding: 2px 6px;
}

.details-page .wave-bars {
  align-self: center;
  margin-top: 0;
  flex-shrink: 0;
}

.details-page .details-tabs {
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  background: color-mix(in srgb, #ffffff 86%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  position: sticky;
  top: var(--details-tabs-sticky-top);
  z-index: 15;
  gap: 10px;
}

.details-page .details-tabs .tab {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 15px;
}

.details-page .details-tabs .tab-active {
  border-color: #c0d2ec;
  box-shadow: 0 3px 10px rgba(34, 59, 97, 0.08);
}

.details-page .panel {
  margin-bottom: 0;
  padding: 24px;
  border-radius: 20px;
}

.details-page .panel-head {
  margin-bottom: 16px;
}

.details-page .panel-head h2 {
  margin-bottom: 6px;
}

.details-page .summary-head {
  margin-bottom: 14px;
}

.details-page .markdown-body {
  line-height: 1.72;
}

.details-page #summary-render-only,
.details-page .summary-editor,
.details-page .summary-source-editor {
  background: var(--surface);
  border-color: var(--line);
}

.details-page .markdown-body p,
.details-page .markdown-body ul,
.details-page .markdown-body ol,
.details-page .markdown-body blockquote,
.details-page .markdown-body table {
  margin: 0 0 14px;
}

.details-page .table-segments th,
.details-page .table-segments td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.details-page .segment-meta strong {
  display: inline-block;
  margin-bottom: 4px;
}

.details-page .split-panel {
  gap: 16px;
}

.details-page .pre {
  min-height: 180px;
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.small th {
  width: 170px;
}

.pre {
  white-space: pre-wrap;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 0;
  max-height: 52vh;
  overflow: auto;
}

.empty {
  padding: 16px;
  color: #34473b;
}

.empty p {
  margin: 8px 0 0;
}

.inline-form {
  margin: 0;
}

.danger-form {
  display: inline-flex;
}

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

.auth-layout {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 22px;
}

.auth-intro {
  padding: 8px 8px 8px 2px;
}

.feature-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: #5a5061;
  display: grid;
  gap: 8px;
}

.auth-card {
  padding: 22px;
}

.auth-card h2 {
  margin-bottom: 12px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-error {
  color: #9f2f1f;
  margin-top: 10px;
  margin-bottom: 0;
  font-weight: 700;
}

.auth-success {
  color: #1a6b2e;
  margin-top: 10px;
  margin-bottom: 0;
  font-weight: 700;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 0.875rem;
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: -4px;
}

.auth-hint-link {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
}

.auth-hint-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-signup-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-signup-hint a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-signup-hint a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .split-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --details-tabs-sticky-top: 78px;
  }

  .is-auth .app-shell-auth {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    grid-template-columns: 1fr;
  }

  .side-rail {
    display: none;
  }

  .topbar-inner {
    min-height: 70px;
  }

  .day-divider-cell {
    top: 70px;
  }

  .nav-user {
    display: none;
  }

  .hero-card {
    flex-direction: column;
  }

  .billing-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .details-page .hero-card {
    padding: 20px;
    gap: 16px;
    grid-template-columns: 1fr;
  }

  .hero-main-column,
  .hero-status-card,
  .hero-share-card {
    grid-column: auto;
    grid-row: auto;
  }


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

  .table {
    display: block;
    overflow-x: auto;
  }

  .tabs {
    display: flex;
  }

  .calendar-head {
    flex-direction: column;
  }

  .calendar-week {
    grid-template-columns: 1fr;
  }

  .share-actions-row {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(1120px, 94vw);
  }

  .main-content {
    padding: 20px 0 40px;
  }

  .brand-text small {
    display: none;
  }

  .wave-title {
    gap: 8px;
  }

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

  .topbar-nav {
    gap: 8px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.summary-template-select,
.profile-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
}

.summary-template-select {
  min-width: 220px;
  margin-right: 8px;
}

.profile-panel {
  max-width: 680px;
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-saved {
  color: #067647;
  margin: 0 0 12px;
}

.profile-error {
  color: #b42318;
  margin: 0 0 12px;
}

.profile-form-default {
  grid-template-columns: 1fr;
}

.template-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}

.template-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.templates-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-row-default td {
  background: #fff4e5;
}

.template-action-btn {
  min-width: 190px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.category-color-preview {
  --category-color: #2563eb;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--category-color);
  border: 1px solid color-mix(in srgb, var(--category-color) 75%, #000);
  vertical-align: middle;
}

.category-color-preview {
  margin-right: 8px;
}

.category-select {
  --category-select-color: transparent;
  padding-left: 28px;
  background:
    linear-gradient(90deg, var(--category-select-color) 0 14px, transparent 14px),
    #fff;
}

.category-select option {
  background-color: #fff;
  color: #111827;
}

.category-form-color {
  width: 72px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.summary-editor {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  outline: none;
}

.summary-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.15);
}

.summary-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.summary-editor-btn {
  min-height: 32px;
  padding: 5px 10px;
}

.summary-editor-status {
  margin-top: 8px;
  font-size: 13px;
}

.summary-editor-status-error {
  color: #b42318;
}

.share-panel {
  display: grid;
  gap: 10px;
}

.hero-share-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  min-width: 0;
  grid-column: 1;
  grid-row: 2;
}

.hero-share-card > .muted {
  margin: 0;
}

.share-panel .panel-head {
  gap: 4px;
}

.share-panel .panel-head h2 {
  margin-bottom: 0;
}

.share-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.share-login-input {
  flex: 1 1 280px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.share-feedback {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.share-feedback-success {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #abefc6;
}

.share-feedback-error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.share-code-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.share-code-card {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 92%, #fff);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}

.share-link-card {
  min-height: 62px;
}

.share-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-code-card strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.share-code-value {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.share-code-value code {
  display: block;
  padding: 5px 7px;
  border-radius: 8px;
  background: #f6f8fb;
}

.share-code-hint {
  font-size: 11px;
  margin-top: -2px;
  line-height: 1.35;
  opacity: 0.82;
}

.share-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
}

.share-copy-btn {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.share-btn-compact {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
  min-width: 116px;
}

.uploads-shared-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.uploads-view-switch {
  display: inline-flex;
  gap: 8px;
  margin-right: 10px;
}

.record-share-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #026aa2;
  background: #e0f2fe;
  vertical-align: middle;
}

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

.calendar-head h2 {
  margin: 0 0 4px;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.calendar-day {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.calendar-day-today {
  border-color: #bfd7ff;
  box-shadow: 0 8px 24px rgba(18, 68, 150, 0.08);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 13px;
}

.calendar-day-body {
  position: relative;
  height: 864px;
  background-image: linear-gradient(to bottom, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 100% 72px;
}

.calendar-day-range {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  font-size: 11px;
  color: #475467;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
}

.calendar-event {
  --calendar-event-accent: #2563eb;
  position: absolute;
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 10px;
  color: #0f172a;
  border-left: 4px solid var(--calendar-event-accent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--calendar-event-accent) 14%, #ffffff) 0%,
    color-mix(in srgb, var(--calendar-event-accent) 22%, #ffffff) 100%
  );
  box-shadow: 0 4px 10px color-mix(in srgb, var(--calendar-event-accent) 18%, transparent);
  overflow: hidden;
}

.calendar-event-time {
  font-size: 11px;
  font-weight: 700;
  color: color-mix(in srgb, var(--calendar-event-accent) 78%, #0f172a);
  line-height: 1.3;
}

.calendar-event-title {
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.calendar-event-badge {
  font-size: 10px;
  font-weight: 700;
  color: #0369a1;
}

.calendar-event-category {
  justify-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: color-mix(in srgb, var(--calendar-event-accent) 82%, #0f172a);
  background: color-mix(in srgb, var(--calendar-event-accent) 14%, #ffffff);
}

.meeting-category-editor {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.meeting-category-field {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  flex: 1 1 260px;
}

.meeting-category-color-field {
  display: grid;
  gap: 6px;
}

.meeting-category-color-input {
  width: 56px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

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

.share-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.summary-mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

.summary-mode-btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
  background: #f4f9ff;
  border-color: #dbeafe;
  color: #344054;
}

.summary-mode-btn:hover {
  background: #edf5ff;
  border-color: #c7ddff;
}

.summary-mode-btn-active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eaf3ff;
}

.summary-editor-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.summary-source-editor {
  display: none;
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  line-height: 1.5;
  resize: vertical;
}

.summary-source-editor:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}

.profile-form textarea,
.profile-form input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.profile-form textarea:focus,
.profile-form input[type="text"]:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}

textarea:focus,
textarea:focus-visible,
input[type="text"]:focus,
input[type="text"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: var(--line);
}

/* Плеер записи: волна рисуется по заранее посчитанным пикам */
.player {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 12px;
  background: #fbfcfd;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-play {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.player-play:hover { background: #1d4ed8; }
.player-play:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

.player-time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  color: #475467;
  font-variant-numeric: tabular-nums;
}

.player-wave { width: 100%; }

.player-hint { font-size: 12.5px; margin: 0; }

.player-absent { margin-bottom: 18px; }

.segment-row { cursor: pointer; }
.segment-row:hover { background: #f7f9fc; }

/* Реплика, которая звучит сейчас */
.segment-row-active {
  background: #eef4ff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.segment-row-active:hover { background: #e7efff; }

/* Список реплик прокручивается сам: у часовой записи их сотни */
.segments-scroll {
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 10px;
}

.segments-scroll .table-segments { margin: 0; }

/* Шапка остаётся видимой при прокрутке */
.segments-scroll .table-segments thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: inset 0 -1px 0 var(--line, #e4e7ec);
}
