:root {
  --bg: #f9fafb;
  --bg-soft: #f2f4f7;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #eaecf0;
  --accent: #1570ef;
  --accent-strong: #175cd3;
  --accent-soft: #eff8ff;
  --warning-bg: #ffe9c9;
  --warning-ink: #6b4307;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --radius: 14px;
  --details-tabs-sticky-top: 84px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 92% -8%, #eff8ff 0%, rgba(239, 248, 255, 0) 60%),
    radial-gradient(900px 420px at 0% 0%, #f8f9fc 0%, rgba(248, 249, 252, 0) 62%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

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

.workspace {
  min-height: 100vh;
}

.is-auth {
  background:
    radial-gradient(1200px 680px at 92% -14%, #eef4ff 0%, #e9f0fb 38%, #e5ecf8 100%);
}

.is-auth .app-shell-auth {
  width: min(1440px, 96vw);
  margin: 14px auto;
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 76px 1fr;
  border: 1px solid #e4e7ec;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  background: #f8fafc;
}

.is-auth .workspace {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.side-rail {
  background: linear-gradient(180deg, #f3f8ff 0%, #eef5ff 100%);
  border-right: 1px solid #eaecf0;
  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 #e4e7ec;
  background: #fff;
  color: #667085;
}

.rail-logo {
  margin-bottom: 6px;
  background: linear-gradient(145deg, #1570ef, #175cd3);
  border-color: #3b82f6;
}

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

.rail-item-active {
  background: #eff8ff;
  border-color: #c7ddff;
  color: #175cd3;
}

.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;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, #ffffff 90%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 76px;
  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: 11px;
  background: linear-gradient(145deg, #1d4ed8, #1e40af);
  color: #fff;
  font-weight: 800;
  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: linear-gradient(180deg, #60a5fa, #1570ef);
  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: linear-gradient(180deg, #dbeafe, #ffffff);
}

.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: #f2f4f7;
}

.nav-user {
  font-size: 13px;
  color: var(--muted);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eff8ff;
  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.08em;
  font-weight: 800;
  color: #175cd3;
}

.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 rgba(255, 255, 255, 0.75);
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.58) 100%
  );
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.billing-card {
  padding: 20px;
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 18px rgba(16, 24, 40, 0.06);
}

.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: linear-gradient(180deg, #f9f9fb 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}

.kpi-card p {
  margin: 0;
  font-size: 13px;
  color: #667085;
}

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

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

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

.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: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 700;
  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: #f9fafb;
}

.btn-block {
  width: 100%;
}

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

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

.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: #f2f4f7 !important;
}

.icon-delete {
  color: #d92d20;
}

.icon-repeat {
  color: #175cd3;
}

.icon-back {
  color: #1570ef;
}

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

.tab {
  color: #667085;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 9px;
  font-weight: 700;
}

.tab-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(41, 68, 54, 0.08);
}

.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: #f9fafb;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
  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: linear-gradient(
    140deg,
    rgba(245, 243, 255, 0.95) 0%,
    rgba(239, 235, 252, 0.9) 100%
  );
  color: #175cd3;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: sticky;
  top: 76px;
  z-index: 3;
  border-top: 1px solid rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(214, 214, 254, 0.9);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-uploaded {
  background: #f2f4f7;
  color: #475467;
}

.status-processing {
  background: #eff8ff;
  color: #175cd3;
}

.status-processed {
  background: #e3f2e9;
  color: #27664d;
}

.status-created {
  background: #f2f4f7;
  color: #475467;
}

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

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

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

.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 6px;
  border: 0;
  background: transparent;
}

.table-uploads thead th {
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(234, 236, 240, 0.9);
}

.table-uploads tbody td {
  background: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(228, 231, 236, 0.9);
}

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

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

.table-uploads tbody tr:hover td {
  background: #f5f9ff;
}

.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: #667085;
}

.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 #d5e3f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f8ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.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;
}

.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: linear-gradient(180deg, #fcfdff 0%, #f8fbff 100%);
  border-color: #e8eef7;
}

.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;
}

.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 #d5e3f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f8ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  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 {
  position: absolute;
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 10px;
  color: #0f172a;
  background: linear-gradient(180deg, #eaf3ff 0%, #dbeafe 100%);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.calendar-event-time {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  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;
}

.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);
}
