:root {
  --bg: #d7e4f0;
  --bg-strong: #c7d7e7;
  --panel: rgba(240, 245, 250, 0.98);
  --text: #132c46;
  --muted: #5d7691;
  --line: rgba(30, 79, 132, 0.16);
  --accent: #1c67c1;
  --accent-strong: #144f97;
  --warn: #c58b22;
  --warn-soft: rgba(197, 139, 34, 0.14);
  --danger: #c95454;
  --danger-soft: rgba(201, 84, 84, 0.14);
  --success: #1e8c6d;
  --success-soft: rgba(30, 140, 109, 0.14);
  --shadow: 0 8px 20px rgba(15, 48, 87, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --sidebar-width: 320px;
  --app-padding: 18px;
  --topbar-height: 92px;
  --bottom-nav-height: 84px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Segoe UI", sans-serif;
  overflow: hidden;
  background: linear-gradient(180deg, #e4edf6 0%, var(--bg) 44%, var(--bg-strong) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(22, 67, 113, 0.035) 1px, transparent 1px);
  background-size: 100% 36px;
  opacity: 0.38;
}

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

button {
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(30, 79, 132, 0.16);
  border-radius: 14px;
  background: rgba(248, 251, 254, 0.96);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  height: 100dvh;
  padding: var(--app-padding);
}

.sidebar,
.section-card,
.auth-panel,
.auth-copy,
.loading-card,
.stat-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: var(--app-padding);
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: calc(100dvh - (var(--app-padding) * 2));
  padding: 22px 18px;
  border-radius: 32px;
  background: #e8f0f8;
}

.brand-block,
.account-card,
.topbar,
.topbar-actions,
.section-head,
.form-actions,
.inline-card-row,
.auth-tags,
.auth-tabs,
.upload-box,
.hero-grid,
.profile-meta-list {
  display: flex;
}

.brand-block,
.account-card,
.upload-box {
  gap: 14px;
}

.brand-block {
  align-items: center;
}

.brand-mark,
.account-badge {
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
}

.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--accent);
  letter-spacing: 0.12em;
}

.brand-block h1,
.topbar h2,
.section-head h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-list,
.main-shell,
.view-grid,
.stack-list,
.stack-panels,
.auth-form,
.chat-list {
  display: flex;
  flex-direction: column;
}

.nav-list,
.main-shell,
.view-grid,
.stack-list,
.stack-panels,
.auth-form {
  gap: 18px;
}

.nav-list {
  flex: 1;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: transform 160ms ease, background-color 160ms ease;
}

.nav-link span {
  font-weight: 800;
}

.nav-link small,
.account-card p,
.section-head p,
.field-label small,
.stat-card small,
.empty-state p,
.hero-grid p,
.list-item p,
.list-item small,
.chat-bubble p {
  margin: 0;
  color: var(--muted);
}

.nav-link:hover,
.nav-link:focus-visible,
.list-button:hover,
.list-button:focus-visible {
  background: rgba(31, 116, 216, 0.08);
  outline: none;
}

.nav-link.active,
.list-button.active {
  background: rgba(31, 116, 216, 0.12);
  transform: translateX(2px);
}

.sidebar-footer {
  display: grid;
  gap: 14px;
}

.account-card {
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: rgba(245, 249, 253, 0.96);
}

.account-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #2d6cbf;
}

.main-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: calc(100dvh - (var(--app-padding) * 2));
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.app-topbar {
  flex: 0 0 auto;
  min-height: var(--topbar-height);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #edf4fa;
  box-shadow: var(--shadow);
}

.topbar-copy {
  min-width: 0;
}

.topbar-actions {
  gap: 12px;
  align-items: flex-end;
}

.profile-switch {
  min-width: 220px;
}

.profile-switch span,
.field-label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-weight: 700;
}

.section-card,
.auth-panel,
.auth-copy,
.loading-card,
.stat-card {
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.section-card,
.loading-card {
  padding: 18px;
}

.hero-card {
  background: #eaf1f8;
}

.hero-grid {
  justify-content: space-between;
  gap: 16px;
}

.hero-title {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.profile-meta-list {
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  color: var(--muted);
}

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

.stats-grid,
.columns-two,
.hero-grid,
.grid-two,
.form-grid {
  display: grid;
  gap: 18px;
}

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

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

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

.stat-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.9rem;
}

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

.field-span {
  grid-column: 1 / -1;
}

.form-actions,
.auth-tabs,
.inline-card-row,
.auth-tags {
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.text-button,
.auth-tabs button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  transition: transform 140ms ease, opacity 140ms ease, background-color 140ms ease;
}

.primary-button,
.auth-tabs button.active {
  background: var(--accent);
  color: white;
}

.secondary-button,
.ghost-button {
  background: rgba(28, 103, 193, 0.12);
  color: var(--text);
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
}

.danger-text {
  color: var(--danger);
}

.list-item,
.empty-state,
.summary-panel,
.chat-bubble,
.banner,
.upload-box {
  border-radius: 18px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(30, 79, 132, 0.12);
  background: rgba(245, 249, 253, 0.98);
}

.list-main,
.list-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge.info {
  background: rgba(31, 116, 216, 0.12);
  color: var(--accent-strong);
}

.status-badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.muted {
  background: rgba(105, 121, 115, 0.12);
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(30, 79, 132, 0.2);
  background: rgba(234, 241, 248, 0.94);
}

.banner {
  padding: 14px 16px;
}

.banner.success {
  background: var(--success-soft);
  color: var(--success);
}

.banner.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.banner.info {
  background: rgba(31, 116, 216, 0.1);
  color: var(--accent-strong);
}

.auth-shell,
.loading-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
}

.auth-copy,
.auth-panel {
  width: 100%;
  max-width: 640px;
  padding: 28px;
}

.auth-copy {
  background: #e9f0f7;
}

.auth-copy h1,
.loading-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.auth-copy p,
.loading-card p {
  color: var(--muted);
  line-height: 1.7;
}

.auth-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-tabs button {
  flex: 1;
  background: rgba(31, 116, 216, 0.08);
}

.loading-card {
  max-width: 560px;
  text-align: center;
}

.inline-search {
  min-width: 220px;
}

.upload-box {
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px dashed rgba(30, 79, 132, 0.18);
  background: rgba(237, 243, 249, 0.96);
}

.upload-box p {
  margin: 0;
  color: var(--muted);
}

.summary-panel,
.chat-bubble,
.code-block {
  padding: 16px;
  background: rgba(243, 247, 251, 0.98);
  border: 1px solid rgba(30, 79, 132, 0.1);
}

.simple-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
}

.chat-list {
  gap: 12px;
}

.chat-bubble strong {
  display: block;
  margin-bottom: 8px;
}

.chat-bubble.user {
  background: rgba(31, 116, 216, 0.08);
}

.code-block {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 18px;
}

.hidden-input {
  display: none;
}

.camera-hero-card {
  overflow: hidden;
  background: #e8f0f8;
}

.camera-hero,
.camera-hero-copy,
.camera-action-row,
.chip-row,
.structured-intake,
.structured-grid,
.intake-stat-grid {
  display: flex;
}

.camera-hero {
  gap: 20px;
  align-items: center;
}

.camera-hero-compact {
  align-items: flex-start;
}

.camera-hero-copy,
.structured-intake {
  flex-direction: column;
}

.camera-hero-copy,
.structured-intake {
  gap: 16px;
}

.camera-hero-copy strong {
  font-size: 1.4rem;
}

.records-view-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  min-height: 0;
}

.records-camera-card,
.records-workspace-card {
  min-height: 0;
}

.camera-surface,
.camera-status-row,
.capture-preview-summary,
.capture-preview-copy,
.intake-history-list,
.intake-history-card,
.intake-history-copy,
.workspace-content-scroll {
  display: flex;
}

.camera-surface {
  position: relative;
  min-height: 248px;
  width: min(360px, 100%);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(30, 79, 132, 0.16);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 45, 75, 0.94) 0%, rgba(13, 30, 50, 0.98) 100%);
}

.camera-surface-launch {
  padding: 20px;
  cursor: pointer;
  text-align: center;
}

.camera-surface-live {
  background: #081523;
}

.camera-badge-prominent {
  width: 138px;
  height: 108px;
  border-color: rgba(65, 138, 226, 0.38);
  background: rgba(65, 138, 226, 0.14);
}

.camera-badge-prominent .camera-badge-top {
  top: -12px;
  width: 42px;
  height: 16px;
}

.camera-badge-prominent .camera-badge-lens {
  width: 54px;
  height: 54px;
  border-width: 9px;
  box-shadow: 0 0 0 10px rgba(241, 248, 255, 0.9);
}

.camera-launch-copy {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.camera-launch-copy strong,
.camera-launch-copy p {
  margin: 0;
}

.camera-launch-copy strong {
  color: #eef5fb;
  font-size: 1.18rem;
}

.camera-launch-copy p {
  color: rgba(214, 228, 243, 0.82);
  line-height: 1.6;
}

.camera-status-row {
  flex-direction: column;
  gap: 8px;
}

.camera-status-row p,
.capture-preview-copy p,
.intake-history-copy p,
.intake-history-copy small {
  margin: 0;
  color: var(--muted);
}

.capture-preview-summary {
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(30, 79, 132, 0.12);
  border-radius: 18px;
  background: rgba(235, 242, 248, 0.96);
}

.capture-preview-image {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  background: #d8e4ef;
}

.capture-preview-copy {
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.capture-preview-copy strong,
.intake-history-copy strong {
  display: block;
  margin: 0;
}

.workspace-content-scroll {
  flex-direction: column;
  gap: 14px;
}

.intake-history-list {
  flex-direction: column;
  gap: 12px;
}

.intake-history-card {
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(30, 79, 132, 0.12);
  border-radius: 18px;
  background: rgba(239, 245, 250, 0.98);
}

.intake-history-thumb {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border-radius: 16px;
  object-fit: cover;
  background: #d8e4ef;
}

.intake-history-copy {
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.camera-hero-copy p,
.camera-permission-note,
.intake-stat-card span,
.intake-stat-card small,
.structured-card p,
.structured-card small {
  margin: 0;
  color: var(--muted);
}

.camera-badge {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 88px;
  border-radius: 24px;
  border: 3px solid rgba(31, 116, 216, 0.24);
  background: rgba(28, 103, 193, 0.12);
}

.camera-badge-top {
  position: absolute;
  top: -10px;
  left: 18px;
  width: 32px;
  height: 14px;
  border-radius: 12px 12px 4px 4px;
  background: var(--accent-strong);
}

.camera-badge-lens {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 8px solid var(--accent);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.9);
}

.camera-action-row,
.chip-row {
  gap: 12px;
  flex-wrap: wrap;
}

.camera-preview-panel,
.camera-preview-actions {
  display: flex;
}

.camera-preview-panel {
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(30, 79, 132, 0.12);
  border-radius: 20px;
  background: rgba(230, 238, 246, 0.9);
}

.camera-preview-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #0f2238;
  aspect-ratio: 4 / 3;
}

.camera-preview-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-preview-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(6, 18, 31, 0.68);
  color: rgba(233, 243, 252, 0.92);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(6px);
}

.camera-preview-overlay.ready {
  background: rgba(17, 72, 53, 0.58);
}

.camera-preview-actions {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.camera-live-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(20, 79, 151, 0.12);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.capture-button {
  min-width: 148px;
  padding: 14px 18px;
  border: 0;
  border-radius: 18px;
  font-weight: 800;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.capture-button.primary {
  color: white;
  background: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(31, 116, 216, 0.12);
}

.capture-button.secondary {
  color: var(--text);
  background: rgba(241, 246, 251, 0.98);
  border: 1px solid rgba(28, 103, 193, 0.16);
}

.capture-button.ghost {
  color: var(--accent-strong);
  background: rgba(28, 103, 193, 0.12);
}

.capture-button:hover,
.capture-button:focus-visible {
  transform: translateY(-1px);
}

.file-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(232, 240, 247, 0.98);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.upload-box-column {
  flex-direction: column;
  align-items: flex-start;
}

.intake-stat-grid,
.structured-grid {
  gap: 14px;
  flex-wrap: wrap;
}

.intake-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.intake-stat-card,
.structured-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(30, 79, 132, 0.12);
  background: rgba(242, 247, 251, 0.98);
}

.intake-stat-card strong,
.structured-card strong {
  display: block;
  margin-bottom: 8px;
}

.intake-stat-card strong {
  margin-bottom: 6px;
  font-size: 1.8rem;
}

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

.compact-list {
  gap: 12px;
}

.workspace-tabs,
.workspace-content,
.workspace-stat-strip,
.workspace-snapshot-grid,
.workspace-subsection-head {
  display: flex;
}

.workspace-tabs {
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-tab {
  padding: 10px 14px;
  border: 1px solid rgba(30, 79, 132, 0.14);
  border-radius: 14px;
  background: #edf3f8;
  color: var(--muted);
  font-weight: 700;
}

.workspace-tab.active {
  background: rgba(28, 103, 193, 0.14);
  color: var(--accent-strong);
}

.workspace-content {
  flex-direction: column;
  gap: 14px;
}

.workspace-stat-strip {
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-mini-stat,
.workspace-focus-card,
.workspace-snapshot-card,
.workspace-subsection {
  padding: 14px;
  border: 1px solid rgba(30, 79, 132, 0.12);
  border-radius: 18px;
  background: #eef4f9;
}

.workspace-mini-stat {
  min-width: 84px;
}

.workspace-mini-stat span,
.workspace-focus-card p,
.workspace-snapshot-card p {
  margin: 0;
  color: var(--muted);
}

.workspace-mini-stat strong,
.workspace-focus-card strong,
.workspace-snapshot-card strong,
.workspace-subsection strong {
  display: block;
  margin-bottom: 6px;
}

.workspace-mini-stat strong {
  font-size: 1.35rem;
}

.workspace-focus-card,
.workspace-subsection {
  display: grid;
  gap: 12px;
}

.workspace-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workspace-subsection-head {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.compact-search {
  min-width: 0;
  max-width: 180px;
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 4px 6px;
  scrollbar-width: thin;
}

.bottom-nav {
  display: none;
}

.more-panel,
.more-panel-head,
.more-panel-list {
  display: flex;
}

.more-panel-backdrop {
  display: none;
}

@media (max-width: 1280px) {
  .main-shell {
    height: calc(100dvh - (var(--app-padding) * 2));
  }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

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

@media (max-width: 980px) {
  .columns-two,
  .auth-shell,
  .grid-two,
  .form-grid,
  .structured-grid,
  .intake-stat-grid,
  .workspace-snapshot-grid,
  .records-view-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero-grid,
  .upload-box,
  .camera-hero {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
  }

  .profile-switch {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .auth-shell,
  .loading-screen {
    padding: 10px;
  }

  .sidebar,
  .section-card,
  .auth-copy,
  .auth-panel,
  .loading-card {
    border-radius: 22px;
  }

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

  .list-item {
    grid-template-columns: 1fr;
  }

  .item-side {
    align-items: flex-start;
  }

  .camera-badge {
    width: 96px;
    height: 74px;
  }

  .app-shell {
    gap: 0;
    height: 100dvh;
  }

  .main-shell {
    height: 100dvh;
    padding-bottom: calc(var(--bottom-nav-height) + 10px);
  }

  .app-topbar {
    min-height: auto;
    padding: 14px 14px 12px;
    border-radius: 22px;
  }

  .topbar h2 {
    font-size: 1.1rem;
    line-height: 1.35;
  }

  .topbar-actions {
    gap: 8px;
  }

  .profile-switch span,
  .field-label {
    font-size: 0.9rem;
  }

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

  .section-card,
  .loading-card {
    padding: 14px;
  }

  .view-grid,
  .stack-list,
  .stack-panels,
  .auth-form {
    gap: 12px;
  }

  .hero-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card strong {
    font-size: 1.45rem;
  }

  .camera-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .camera-preview-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .camera-surface {
    min-height: 224px;
    width: 100%;
  }

  .workspace-tabs {
    width: 100%;
  }

  .workspace-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
  }

  .workspace-stat-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-subsection-head {
    flex-direction: column;
    align-items: stretch;
  }

  .compact-search {
    max-width: none;
  }

  .capture-button {
    min-width: 0;
    padding: 12px 12px;
    border-radius: 16px;
  }

  .camera-action-row .capture-button.ghost {
    grid-column: 1 / -1;
  }

  .capture-preview-summary,
  .intake-history-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .capture-preview-image,
  .intake-history-thumb {
    width: 100%;
    height: 180px;
  }

  .intake-stat-card,
  .structured-card,
  .list-item {
    padding: 12px;
  }

  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 8px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    height: var(--bottom-nav-height);
    padding: 8px;
    border: 1px solid rgba(30, 79, 132, 0.14);
    border-radius: 24px;
    background: rgba(230, 239, 248, 0.98);
    box-shadow: 0 6px 18px rgba(20, 65, 120, 0.08);
  }

  .bottom-nav-item {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
  }

  .bottom-nav-item.active {
    background: rgba(28, 103, 193, 0.16);
    color: var(--accent-strong);
    transform: translateY(-1px);
  }

  .bottom-nav-label {
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .more-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 21;
    display: block;
    border: 0;
    background: rgba(11, 31, 56, 0.16);
  }

  .more-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--bottom-nav-height) + 18px);
    z-index: 22;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(30, 79, 132, 0.14);
    border-radius: 22px;
    background: #e9f0f7;
    box-shadow: 0 10px 26px rgba(20, 65, 120, 0.1);
  }

  .more-panel-head {
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .more-panel-head h3 {
    margin: 0;
    font-size: 1rem;
  }

  .more-panel-list {
    flex-direction: column;
    gap: 8px;
  }

  .more-panel-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(30, 79, 132, 0.12);
    border-radius: 16px;
    background: #f3f7fb;
    color: var(--text);
    text-align: left;
  }

  .more-panel-item.active {
    background: rgba(28, 103, 193, 0.12);
    border-color: rgba(28, 103, 193, 0.2);
  }

  .more-panel-item strong,
  .more-panel-item small {
    margin: 0;
  }

  .more-panel-item small {
    color: var(--muted);
  }
}

:root {
  --bg: #edeae1;
  --bg-strong: #d8e0e3;
  --panel: rgba(255, 255, 255, 0.78);
  --text: #122631;
  --muted: #607684;
  --line: rgba(18, 38, 49, 0.09);
  --accent: #124f5e;
  --accent-strong: #0e3e49;
  --warn: #b57f30;
  --warn-soft: rgba(181, 127, 48, 0.13);
  --danger: #b94c57;
  --danger-soft: rgba(185, 76, 87, 0.12);
  --success: #1f7b61;
  --success-soft: rgba(31, 123, 97, 0.14);
  --shadow: 0 24px 64px rgba(21, 42, 55, 0.1);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --app-padding: 22px;
  --sidebar-width: 308px;
  --topbar-height: 104px;
  --bottom-nav-height: 78px;
}

body {
  color: var(--text);
  font-family: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 216, 221, 0.92), transparent 32%),
    radial-gradient(circle at top right, rgba(221, 214, 198, 0.84), transparent 28%),
    linear-gradient(180deg, #f5f1e8 0%, #ebeee8 46%, #dde4e5 100%);
}

body::before {
  background-image:
    linear-gradient(rgba(12, 44, 56, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 44, 56, 0.02) 1px, transparent 1px);
  background-size: 100% 44px, 44px 100%;
  opacity: 0.24;
}

body::after {
  content: "";
  position: fixed;
  inset: auto -8vw -18vh auto;
  width: 34vw;
  min-width: 240px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 79, 94, 0.12), rgba(18, 79, 94, 0));
  pointer-events: none;
  filter: blur(2px);
}

button,
input,
textarea,
select {
  letter-spacing: 0.01em;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

input,
textarea,
select {
  padding: 13px 15px;
  border: 1px solid rgba(18, 38, 49, 0.1);
  border-radius: 16px;
  background: rgba(252, 252, 250, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(18, 79, 94, 0.34);
  box-shadow: 0 0 0 4px rgba(18, 79, 94, 0.08);
  background: rgba(255, 255, 255, 0.97);
}

.app-shell {
  gap: 28px;
  padding: var(--app-padding);
}

.sidebar,
.section-card,
.auth-panel,
.auth-copy,
.loading-card,
.stat-card,
.app-topbar {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sidebar {
  padding: 26px 20px 20px;
  border-radius: 34px;
  border-color: rgba(18, 38, 49, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(242, 245, 243, 0.7) 100%);
}

.brand-mark {
  border-radius: 20px;
  background: linear-gradient(160deg, #123744 0%, #156276 100%);
  box-shadow: 0 18px 30px rgba(18, 55, 68, 0.24);
}

.eyebrow {
  color: rgba(14, 62, 73, 0.84);
  letter-spacing: 0.18em;
}

.nav-link {
  gap: 7px;
  padding: 16px 17px;
  border: 1px solid transparent;
  border-radius: 20px;
}

.nav-link:hover,
.nav-link:focus-visible,
.list-button:hover,
.list-button:focus-visible {
  background: rgba(18, 79, 94, 0.06);
}

.nav-link.active,
.list-button.active {
  transform: none;
  border-color: rgba(18, 79, 94, 0.12);
  background: rgba(18, 79, 94, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.account-card {
  padding: 16px;
  border: 1px solid rgba(18, 38, 49, 0.06);
  background: rgba(251, 251, 249, 0.86);
}

.account-badge {
  background: linear-gradient(180deg, #164755 0%, #1d6673 100%);
}

.main-shell {
  gap: 18px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: var(--topbar-height);
  padding: 20px 22px;
  border-color: rgba(18, 38, 49, 0.08);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(245, 247, 245, 0.72) 100%);
}

.topbar h2 {
  font-size: clamp(1.25rem, 1.4vw, 1.6rem);
  line-height: 1.25;
}

.section-card,
.auth-panel,
.auth-copy,
.loading-card,
.stat-card {
  border: 1px solid rgba(18, 38, 49, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(247, 248, 246, 0.68) 100%);
}

.section-card,
.loading-card {
  padding: 22px;
}

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(18, 79, 94, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(243, 247, 245, 0.78) 100%);
}

.hero-title {
  font-size: clamp(1.8rem, 2.4vw, 2.35rem);
  line-height: 1.08;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h3 {
  font-size: 1.12rem;
  line-height: 1.3;
}

.stat-card {
  min-height: 148px;
  padding: 20px;
}

.stat-card strong {
  font-size: clamp(1.8rem, 2.2vw, 2.3rem);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.auth-tabs button,
.capture-button,
.workspace-tab,
.bottom-nav-item,
.more-panel-item {
  font-weight: 700;
}

.primary-button,
.auth-tabs button.active,
.capture-button.primary {
  background: linear-gradient(180deg, #144d5c 0%, #0f3944 100%);
  color: #f6fbfb;
  box-shadow: 0 14px 28px rgba(15, 57, 68, 0.18);
}

.secondary-button,
.ghost-button,
.capture-button.secondary,
.capture-button.ghost,
.workspace-tab,
.auth-tabs button,
.bottom-nav-item.active,
.more-panel-item.active {
  background: rgba(18, 79, 94, 0.08);
  color: var(--text);
}

.secondary-button,
.ghost-button,
.danger-button,
.auth-tabs button,
.capture-button.secondary,
.capture-button.ghost,
.workspace-tab {
  border: 1px solid rgba(18, 79, 94, 0.1);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.capture-button:hover,
.workspace-tab:hover,
.bottom-nav-item:hover,
.more-panel-item:hover {
  transform: translateY(-1px);
}

.text-button {
  color: var(--accent-strong);
}

.banner,
.empty-state,
.summary-panel,
.chat-bubble,
.upload-box,
.camera-preview-panel,
.workspace-focus-card,
.workspace-snapshot-card,
.workspace-subsection,
.intake-history-card,
.capture-preview-summary,
.intake-stat-card,
.structured-card,
.workspace-mini-stat {
  border: 1px solid rgba(18, 38, 49, 0.08);
  background: rgba(250, 251, 249, 0.78);
}

.list-item {
  gap: 18px;
  border-color: rgba(18, 38, 49, 0.08);
  background: rgba(252, 252, 250, 0.8);
}

.status-badge {
  letter-spacing: 0.02em;
}

.file-chip {
  border: 1px solid rgba(18, 79, 94, 0.08);
  background: rgba(247, 249, 247, 0.88);
}

.app-content {
  padding: 6px 4px 12px;
}

.auth-shell {
  gap: 28px;
}

.auth-copy,
.auth-panel {
  padding: 34px;
}

.auth-copy {
  background:
    radial-gradient(circle at top left, rgba(18, 79, 94, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(244, 246, 243, 0.74) 100%);
}

.auth-copy h1,
.loading-card h1 {
  letter-spacing: -0.03em;
}

.auth-tags span {
  border: 1px solid rgba(18, 79, 94, 0.1);
  background: rgba(255, 255, 255, 0.68);
}

.upload-box {
  gap: 16px;
  border-style: solid;
  border-color: rgba(18, 79, 94, 0.1);
  background: rgba(248, 250, 248, 0.72);
}

.code-block {
  background: rgba(246, 248, 247, 0.92);
}

.camera-hero-card {
  background:
    radial-gradient(circle at top right, rgba(18, 79, 94, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(243, 246, 244, 0.74) 100%);
}

.camera-surface {
  width: min(400px, 100%);
  border-color: rgba(18, 79, 94, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.camera-surface-launch {
  background:
    radial-gradient(circle at top, rgba(35, 120, 146, 0.24), transparent 40%),
    linear-gradient(180deg, rgba(12, 28, 44, 0.96) 0%, rgba(9, 22, 36, 0.98) 100%);
}

.camera-preview-overlay {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.camera-permission-note {
  max-width: 34rem;
  line-height: 1.6;
}

.camera-action-row {
  align-items: stretch;
}

.capture-button {
  min-width: 136px;
  border-radius: 18px;
}

.workspace-tab.active {
  border-color: rgba(18, 79, 94, 0.12);
  background: rgba(18, 79, 94, 0.12);
  color: var(--accent-strong);
}

.workspace-subsection-head small,
.camera-permission-note {
  color: var(--muted);
}

.bottom-nav {
  border-color: rgba(18, 38, 49, 0.08);
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.more-panel {
  border-color: rgba(18, 38, 49, 0.08);
  background: rgba(247, 248, 245, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (max-width: 980px) {
  :root {
    --app-padding: 16px;
  }

  .app-shell {
    gap: 16px;
  }

  .app-topbar {
    padding: 18px;
  }

  .camera-surface {
    width: 100%;
  }
}

@media (max-width: 720px) {
  :root {
    --app-padding: 12px;
    --bottom-nav-height: 76px;
  }

  body::after {
    width: 68vw;
    right: -14vw;
    bottom: -10vh;
  }

  .app-shell,
  .auth-shell,
  .loading-screen {
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom));
  }

  .main-shell {
    gap: 12px;
    padding-bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom));
  }

  .app-topbar {
    top: 0;
    padding: 16px;
    border-radius: 24px;
  }

  .section-card,
  .auth-copy,
  .auth-panel,
  .loading-card {
    padding: 16px;
    border-radius: 24px;
  }

  .stats-grid,
  .workspace-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .camera-action-row {
    grid-template-columns: 1fr;
  }

  .capture-button,
  .workspace-tab,
  .secondary-button,
  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .bottom-nav {
    left: 12px;
    right: 12px;
    bottom: max(8px, env(safe-area-inset-bottom));
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  }

  .more-panel {
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom-nav-height) + 18px + env(safe-area-inset-bottom));
  }
}
