:root {
  color-scheme: light;
  --sidebar: #fbfdff;
  --sidebar-background:
    radial-gradient(circle at 18% 0%, rgba(47, 128, 255, 0.06) 0%, rgba(47, 128, 255, 0) 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%),
    var(--sidebar);
  --sidebar-muted: #5f6f84;
  --sidebar-label: #7d8ba0;
  --sidebar-active: #172033;
  --sidebar-brand: #2f80ff;
  --sidebar-subtitle: #74a8f7;
  --sidebar-active-icon: #2f80ff;
  --sidebar-active-bg: rgba(47, 128, 255, 0.08);
  --sidebar-active-border: rgba(47, 128, 255, 0.3);
  --sidebar-hover: rgba(47, 128, 255, 0.06);
  --sidebar-border: #e4edf7;
  --sidebar-divider: #d7e5f4;
  --brand-mark-filter: brightness(0) saturate(100%) invert(50%) sepia(92%) saturate(2476%) hue-rotate(199deg) brightness(100%) contrast(98%) drop-shadow(0 8px 14px rgba(47, 128, 255, 0.14));
  --brand-name-shadow: 0 10px 22px rgba(47, 128, 255, 0.12);
  --background: #eef3f8;
  --surface: #ffffff;
  --surface-muted: #f4f8fc;
  --border: #e3e9f2;
  --text: #162033;
  --muted: #6b7a90;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-disabled: #9db7dc;
  --danger: #b91c1c;
  --success: #247457;
  --warning: #8a5a16;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.1);
}

body[data-sidebar-theme="dark"] {
  --sidebar: #111827;
  --sidebar-background:
    radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.13) 0%, rgba(15, 23, 42, 0.14) 36%, rgba(17, 24, 39, 0) 72%),
    radial-gradient(circle at 22% 18%, rgba(148, 163, 184, 0.09) 0%, rgba(148, 163, 184, 0) 32%),
    linear-gradient(145deg, #172033 0%, #111827 46%, #07101f 100%),
    var(--sidebar);
  --sidebar-muted: #cbd5e1;
  --sidebar-label: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-brand: #2f80ff;
  --sidebar-subtitle: #74a8f7;
  --sidebar-active-icon: #3b82f6;
  --sidebar-active-bg: rgba(37, 99, 235, 0.18);
  --sidebar-active-border: rgba(59, 130, 246, 0.35);
  --sidebar-hover: rgba(148, 163, 184, 0.08);
  --sidebar-border: #1e293b;
  --sidebar-divider: rgba(148, 163, 184, 0.34);
  --brand-mark-filter: brightness(0) saturate(100%) invert(50%) sepia(92%) saturate(2476%) hue-rotate(199deg) brightness(100%) contrast(98%) drop-shadow(0 8px 14px rgba(47, 128, 255, 0.14));
  --brand-name-shadow: 0 10px 22px rgba(47, 128, 255, 0.12);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --background: #0b1220;
  --surface: #121b2d;
  --surface-muted: #172033;
  --border: #263449;
  --text: #e8eef8;
  --muted: #9aa9bd;
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --accent-disabled: #475569;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.32);
  --sidebar: #111827;
  --sidebar-background:
    radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.13) 0%, rgba(15, 23, 42, 0.14) 36%, rgba(17, 24, 39, 0) 72%),
    radial-gradient(circle at 22% 18%, rgba(148, 163, 184, 0.09) 0%, rgba(148, 163, 184, 0) 32%),
    linear-gradient(145deg, #172033 0%, #111827 46%, #07101f 100%),
    var(--sidebar);
  --sidebar-muted: #cbd5e1;
  --sidebar-label: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(37, 99, 235, 0.18);
  --sidebar-active-border: rgba(59, 130, 246, 0.35);
  --sidebar-hover: rgba(148, 163, 184, 0.08);
  --sidebar-border: #1e293b;
  --sidebar-divider: rgba(148, 163, 184, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 36px 28px 28px;
  background: var(--sidebar-background);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-active);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  max-width: 100%;
  overflow: hidden;
  padding: 0 0 46px;
}

.brand-mark {
  flex: 0 0 auto;
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: var(--brand-mark-filter);
}

.brand-divider {
  flex: 0 0 auto;
  width: 2px;
  height: 54px;
  border-radius: 999px;
  background: var(--sidebar-divider);
}

.brand-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: visible;
}

.brand-name {
  display: block;
  min-width: 0;
  color: var(--sidebar-brand);
  font-family: "Avenir Next", "Avenir", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 100%;
  overflow: visible;
  font-size: 36px;
  font-weight: 560;
  line-height: 0.92;
  letter-spacing: 0.012em;
  text-shadow: var(--brand-name-shadow);
}

.brand-subtitle {
  display: block;
  color: var(--sidebar-subtitle);
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  font-weight: 450;
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.nav {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 34px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-group {
  display: grid;
  align-content: start;
  gap: 12px;
}

.nav-label {
  margin: 0;
  padding: 0 14px;
  color: var(--sidebar-label);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-link,
.nav-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent !important;
  color: var(--sidebar-muted);
  font-size: 15px;
  font-weight: 560;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  color: inherit;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.sidebar-footer .nav-link[href="#settings"] .nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-link.active,
.nav-link.active:hover {
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
  color: var(--sidebar-active);
}

.nav-link.active .nav-icon {
  color: var(--sidebar-active-icon);
}

.nav-link:hover,
.nav-button:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active);
}

.sidebar-footer {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.sidebar-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--sidebar-border);
}

.sidebar-footer .nav-link {
  min-height: 48px;
}

.theme-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 15px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active);
}

.theme-toggle-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
}

.theme-toggle-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.theme-toggle-icon-dark {
  display: none;
}

.theme-toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #dbe4ef;
  transition: background-color 140ms ease;
}

.theme-toggle-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
  transition: transform 140ms ease;
}

body[data-theme="dark"] .theme-toggle {
  color: var(--sidebar-active);
}

body[data-theme="dark"] .theme-toggle-icon-light {
  display: none;
}

body[data-theme="dark"] .theme-toggle-icon-dark {
  display: grid;
}

body[data-theme="dark"] .theme-toggle-switch {
  background: #2563eb;
}

body[data-theme="dark"] .theme-toggle-switch i {
  transform: translateX(18px);
}

.nav-chevron {
  display: grid;
  place-items: center;
  margin-left: auto;
  color: var(--sidebar-label);
}

.nav-chevron svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.workspace {
  min-width: 0;
  min-height: 0;
  padding: 28px clamp(22px, 3.4vw, 42px);
  background: var(--background);
}

body[data-view="dashboard"] .topbar,
body[data-view="documents"] .topbar,
body[data-view="finance"] .topbar,
body[data-view="classifications"] .topbar,
body[data-view="settings"] .topbar {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.primary-action,
.secondary-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
}

.primary-action {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

.primary-action:hover:not(:disabled) {
  background: var(--accent-strong);
}

.primary-action:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}

.secondary-action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.secondary-action:hover {
  border-color: #c5c0b6;
  background: var(--surface-muted);
}

.compact-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

@media (min-width: 901px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

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

  .workspace {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  #dashboard.view.active,
  #documents.view.active,
  #finance.view.active,
  #classifications.view.active,
  #settings.view.active {
    padding-top: 0;
  }
}

.section-heading {
  max-width: 760px;
  margin-bottom: 20px;
}

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

.auth-card,
.settings-card,
.upload-panel,
.document-row,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.settings-card {
  min-height: 148px;
  padding: 22px;
}

.settings-view.active {
  display: grid;
  gap: 22px;
}

.settings-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.settings-theme-toggle {
  grid-template-columns: 21px minmax(0, 1fr) 38px;
  width: auto;
  min-width: 168px;
  min-height: 50px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: #475569;
  box-shadow: none;
}

.settings-theme-toggle:hover {
  border-color: transparent;
  background: #f1f5f9;
  color: #2563eb;
}

.settings-theme-toggle .theme-toggle-switch {
  width: 38px;
  height: 22px;
}

.settings-theme-toggle .theme-toggle-switch i {
  width: 16px;
  height: 16px;
}

.settings-version-badge {
  display: grid;
  place-items: center;
  min-width: 76px;
  min-height: 50px;
  padding: 7px 0 7px 12px;
  border-left: 1px solid #dbe4ef;
  border-radius: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.settings-version-badge strong {
  display: block;
  color: #1d4ed8;
  font-size: 14px;
}

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

.settings-column {
  --settings-panel-padding: 16px;
  --settings-panel-radius: 12px;
  --settings-control-height: 46px;
  --settings-control-radius: 10px;
  --settings-control-padding: 0 14px;
  --settings-inner-gap: 12px;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  padding: 4px 32px 40px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-column:first-child {
  padding-left: 0;
}

.settings-column:last-child {
  padding-right: 0;
  border-right: 0;
}

.settings-column > h3 {
  margin: 8px 0 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
}

.settings-column > p {
  margin: -10px 0 4px;
  color: #64748b;
  font-size: 13px;
}

.settings-column-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.settings-column-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-column-icon.account {
  background: #dbeafe;
  color: #2563eb;
}

.settings-column-icon.notification {
  background: #f3e8ff;
  color: #9333ea;
}

.settings-column-icon.security {
  background: #d1fae5;
  color: #059669;
}

.settings-panel,
.settings-backup-card {
  box-sizing: border-box;
  display: grid;
  gap: var(--settings-inner-gap);
  width: 100%;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.settings-panel h4,
.settings-backup-card h4,
.settings-member-box h4 {
  margin: 0;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.settings-panel input,
.settings-panel select,
.settings-field input,
.settings-field select,
.settings-person-field input,
.settings-invite-block input,
.settings-password-fields input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--settings-control-height);
  padding: var(--settings-control-padding);
  border: 1px solid #dbe4ef;
  border-radius: var(--settings-control-radius);
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.settings-panel input::placeholder,
.settings-person-field input::placeholder,
.settings-invite-block input::placeholder,
.settings-password-fields input::placeholder {
  color: #94a3b8;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.settings-full-button,
.settings-dark-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--settings-control-height);
  padding: 0 16px;
  border-radius: var(--settings-control-radius);
  font-weight: 700;
}

.settings-dark-button {
  border: 0;
  background: #050a1a;
  color: #ffffff;
  cursor: pointer;
}

.settings-password-fields {
  display: grid;
  gap: var(--settings-inner-gap);
}

.settings-password-fields[hidden] {
  display: none;
}

.settings-plan-change {
  display: grid;
  gap: var(--settings-inner-gap);
}

.settings-plan-change[hidden] {
  display: none;
}

.settings-lock-flow {
  box-sizing: border-box;
  display: grid;
  gap: var(--settings-inner-gap);
  width: 100%;
  margin-top: var(--settings-inner-gap);
}

.settings-lock-button {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: #172033;
  box-shadow: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.settings-lock-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: none;
}

.settings-lock-icon {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-right: 16px;
  border-radius: 999px;
}

.settings-lock-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.settings-lock-label {
  display: none;
  font-size: 14px;
  font-weight: 800;
}

.settings-lock-note {
  box-sizing: border-box;
  display: none;
  align-items: center;
  gap: var(--settings-inner-gap);
  width: 100%;
  min-height: 68px;
  padding: 12px 0 12px 14px;
  border-radius: 0;
}

.settings-lock-note span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
}

.settings-lock-note p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.35;
}

.settings-lock-progress {
  display: none;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.settings-lock-progress i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #ef4444;
  transform-origin: left center;
  animation: settings-lock-countdown 5s linear forwards;
}

.settings-lock-flow[data-lock-state="idle"] .settings-lock-icon-idle,
.settings-lock-flow[data-lock-state="idle"] .settings-lock-label-idle,
.settings-lock-flow[data-lock-state="idle"] .settings-lock-note-idle {
  display: flex;
}

.settings-lock-flow[data-lock-state="idle"] .settings-lock-icon-idle {
  background: #f1f5f9;
  color: #172033;
}

.settings-lock-flow[data-lock-state="idle"] .settings-lock-note-idle {
  border: 0;
  border-left: 3px solid #bfdbfe;
  background: transparent;
}

.settings-lock-flow[data-lock-state="idle"] .settings-lock-note-idle span {
  border: 2px solid #2563eb;
  color: #2563eb;
}

.settings-lock-flow[data-lock-state="confirm"] .settings-lock-button {
  border-color: #dc2626;
  background: #ef242f;
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.26);
}

.settings-lock-flow[data-lock-state="confirm"] .settings-lock-icon-confirm,
.settings-lock-flow[data-lock-state="confirm"] .settings-lock-label-confirm,
.settings-lock-flow[data-lock-state="confirm"] .settings-lock-note-confirm,
.settings-lock-flow[data-lock-state="confirm"] .settings-lock-progress {
  display: flex;
}

.settings-lock-flow[data-lock-state="confirm"] .settings-lock-icon-confirm {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.settings-lock-flow[data-lock-state="confirm"] .settings-lock-note-confirm {
  border: 0;
  border-left: 3px solid #fecaca;
  background: transparent;
}

.settings-lock-flow[data-lock-state="confirm"] .settings-lock-note-confirm span {
  border: 2px solid #dc2626;
  color: #dc2626;
}

.settings-lock-flow[data-lock-state="locked"] .settings-lock-button {
  justify-content: center;
  min-height: 160px;
  border-color: #e2e8f0;
  background: #ffffff;
  color: #172033;
  box-shadow: none;
  cursor: default;
}

.settings-lock-flow[data-lock-state="locked"] .settings-lock-icon-locked,
.settings-lock-flow[data-lock-state="locked"] .settings-lock-label-locked {
  display: flex;
}

.settings-lock-flow[data-lock-state="locked"] .settings-lock-icon-locked {
  margin-right: 0;
  margin-bottom: 12px;
  background: #fee2e2;
  color: #dc2626;
}

.settings-lock-flow[data-lock-state="locked"] .settings-lock-button {
  flex-direction: column;
}

@keyframes settings-lock-countdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.settings-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--settings-inner-gap);
  width: 100%;
}

.settings-plan-summary,
.settings-plan-card,
.settings-member-box,
.settings-summary-box,
.settings-info-card {
  display: grid;
  gap: var(--settings-inner-gap);
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.settings-plan-summary,
.settings-plan-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-plan-title {
  margin: 0;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.settings-plan-card-body {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.settings-plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-plan-card-head > strong,
.settings-info-card strong,
.settings-summary-box strong {
  color: #172033;
  font-size: 20px;
  font-weight: 750;
}

.settings-plan-card p,
.settings-info-card span,
.settings-summary-box span {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.settings-plan-card p {
  grid-column: 1 / -1;
  font-size: 13px;
  line-height: 1.45;
}

.settings-plan-features {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-plan-features li {
  position: relative;
  padding-left: 22px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.settings-plan-features li::before {
  content: "✓";
  position: absolute;
  top: -1px;
  left: 0;
  color: #22c55e;
  font-size: 15px;
  font-weight: 900;
}

.settings-plan-price-block {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 116px;
  color: #2563eb;
  text-align: right;
}

.settings-plan-price-block strong {
  color: #2563eb;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.05;
}

.settings-plan-price-block span {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.settings-plan-price-block small {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.settings-plan-upgrade {
  width: 100%;
  min-height: var(--settings-control-height);
  border-radius: var(--settings-control-radius);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

@media (max-width: 700px) {
  .settings-column-head {
    align-items: flex-start;
  }

  .settings-head-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
  }

  .settings-theme-toggle {
    min-width: 152px;
  }

  .settings-plan-summary,
  .settings-plan-card {
    grid-template-columns: 1fr;
  }

  .settings-plan-price-block {
    justify-items: start;
    text-align: left;
  }
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb !important;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.settings-pill.recommended {
  background: #dcfce7;
  color: #15803d !important;
}

.is-plan-locked {
  opacity: 0.48;
}

.is-plan-locked,
.is-plan-locked * {
  cursor: not-allowed;
}

.settings-member-box > div {
  display: grid;
  gap: var(--settings-inner-gap);
}

.settings-member-box {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.settings-summary-box {
  padding: 11px 0 11px 14px;
  border-left: 3px solid #bfdbfe;
}

.settings-person-field {
  display: grid;
  gap: 7px;
}

.settings-pet-profile {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe4ef;
  border-radius: var(--settings-control-radius);
  background: #f8fafc;
}

.settings-pet-profile > strong {
  color: #0f172a;
  font-size: 14px;
}

.settings-pet-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-pet-profile select {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--settings-control-height);
  padding: 0 14px;
  border: 1px solid #dbe4ef;
  border-radius: var(--settings-control-radius);
  background: #ffffff;
  color: #0f172a;
  font: inherit;
}

.settings-person-field span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.settings-person-display {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--settings-control-height);
  padding: 10px 14px;
  border: 1px solid #dbe4ef;
  border-radius: var(--settings-control-radius);
  background: #ffffff;
  display: grid;
  gap: 5px;
}

.settings-person-display span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.settings-person-display strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.settings-person-field.is-disabled {
  opacity: 0.62;
}

.settings-invite-block {
  display: grid;
  gap: var(--settings-inner-gap);
  padding-top: 4px;
}

.settings-member-empty {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--settings-control-height);
  margin: 0;
  padding: 13px 14px;
  border-radius: var(--settings-control-radius);
  background: #ffffff;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.settings-toggle-list {
  display: grid;
  gap: 0;
  margin-top: 6px;
}

.settings-offer-section {
  box-sizing: border-box;
  display: grid;
  gap: var(--settings-inner-gap);
  width: 100%;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
}

.settings-section-heading {
  display: grid;
  gap: 4px;
}

.settings-section-heading strong {
  color: #172033;
  font-size: 18px;
  font-weight: 800;
}

.settings-section-heading span,
.settings-consent-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.settings-consent-note {
  margin: 0;
  padding: 10px 0 10px 14px;
  border: 0;
  border-left: 3px solid #bfdbfe;
  border-radius: 0;
  background: transparent;
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--settings-inner-gap);
  align-items: center;
  min-height: 64px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.settings-toggle-row strong,
.settings-toggle-row small {
  display: block;
}

.settings-toggle-row strong {
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.settings-toggle-row small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.settings-toggle-row--switch-only .settings-switch {
  grid-column: 3;
}

.settings-small-input {
  width: 74px;
  min-height: 38px;
  border: 1px solid #dbe4ef;
  border-radius: var(--settings-control-radius);
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.settings-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
}

.settings-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.settings-switch i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
  transition: transform 140ms ease;
}

.settings-switch input:checked + i {
  background: #2563eb;
}

.settings-switch input:checked + i::after {
  transform: translateX(22px);
}

.settings-message {
  min-height: 22px;
  margin: 0;
}

@media (max-width: 1500px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-column,
  .settings-column:first-child,
  .settings-column:last-child {
    padding: 30px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .settings-column:first-child {
    padding-top: 4px;
  }

  .settings-column:last-child {
    padding-bottom: 20px;
    border-bottom: 0;
  }
}

.auth-panel {
  max-width: 520px;
}

.dashboard-card,
.dashboard-kpi {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

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

.dashboard-kpi {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 106px;
  min-height: 106px;
  overflow: hidden;
  padding: 22px;
  border-radius: 8px;
  color: #0f172a;
}

.dashboard-kpi > div {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-kpi[data-dashboard-link] {
  cursor: pointer;
}

.dashboard-kpi[data-dashboard-link]:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.dashboard-kpi-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.dashboard-kpi-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-kpi-icon.document-icon {
  background: #dbeafe;
  color: #2563eb;
}

.dashboard-kpi-icon.finance-icon {
  background: #dcfce7;
  color: #16a34a;
}

.dashboard-kpi-icon.storage-icon {
  background: #dbeafe;
  color: #2563eb;
}

.dashboard-kpi-icon.tax-icon {
  background: #f3e8ff;
  color: #9333ea;
}

.dashboard-kpi p {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-kpi strong {
  display: block;
  color: #0f172a;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.08;
}

.dashboard-kpi small {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.dashboard-kpi-arrow {
  color: #64748b;
  font-size: 28px;
  line-height: 1;
}

.dashboard-progress {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf3;
}

.dashboard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}

.dashboard-lower-charts {
  align-items: stretch;
}

.dashboard-card {
  padding: 22px;
  border-radius: 16px;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card h3,
.dashboard-card-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
}

.dashboard-card-header span,
.dashboard-card-header select,
.dashboard-card-foot select {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 32px;
  padding: 0 12px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.dashboard-card-header select,
.dashboard-card-foot select {
  width: auto;
  flex: 0 0 auto;
  cursor: pointer;
}

.dashboard-card-header select {
  min-width: 104px;
}

.dashboard-card-foot select {
  min-width: 132px;
}

.distribution-period-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.distribution-period-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.distribution-period-controls span {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: nowrap;
  box-shadow: none;
}

.distribution-period-controls select {
  min-width: 118px;
}

.distribution-content {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 316px;
}

.distribution-pane {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(150px, 0.85fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.distribution-pane-month {
  margin-left: 16px;
  padding-top: 0;
  padding-left: 16px;
  border-top: 0;
  border-left: 1px solid #e2e8f0;
}

.distribution-pane-visual {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
}

.distribution-pane-title {
  display: grid;
  gap: 2px;
  justify-items: center;
  color: #0f172a;
  line-height: 1.15;
}

.distribution-pane-title strong {
  font-size: 14px;
  font-weight: 800;
}

.distribution-pane-title span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.distribution-pane-side {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.distribution-pane-side select {
  justify-self: start;
  width: 170px;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

#dashboard-distribution-year-select {
  width: 118px;
}

.distribution-card,
.monthly-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.donut-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
}

.donut-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.donut-percent {
  fill: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
}

.donut-center strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
}

.donut-center span {
  color: #64748b;
  font-size: 13px;
}

.distribution-legend {
  display: grid;
  gap: 7px;
}

.distribution-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.distribution-item > span {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border-radius: 3px;
}

.distribution-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}

.distribution-item strong b {
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.distribution-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  vertical-align: middle;
}

.distribution-arrow.up {
  border-bottom: 7px solid var(--arrow-color);
}

.distribution-arrow.down {
  border-top: 7px solid var(--arrow-color);
}

.distribution-item p {
  display: flex;
  gap: 6px;
  margin: 2px 0 0;
  color: #64748b;
  font-size: 10px;
}

.distribution-item p em {
  font-style: normal;
}

.dashboard-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.dashboard-card-foot span {
  flex: 1 1 auto;
  color: #64748b;
  font-size: 12px;
}

.monthly-chart {
  flex: 1 1 auto;
  min-height: 292px;
}

.monthly-chart svg {
  width: 100%;
  height: 100%;
  min-height: 292px;
  overflow: visible;
}

.monthly-grid line {
  stroke: #e5eaf2;
  stroke-width: 1;
}

.monthly-grid text {
  fill: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.monthly-labels text {
  fill: #64748b;
  font-size: 12px;
}

.monthly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.monthly-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 12px;
}

.monthly-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.dashboard-investment-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
  border-radius: 16px;
}

.dashboard-investment-card .dashboard-card-header {
  margin-bottom: 0;
}

.dashboard-investment-card .dashboard-card-header > div {
  display: grid;
  gap: 5px;
}

.dashboard-investment-card .dashboard-card-header p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.investment-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.36fr);
  gap: 14px;
}

.investment-total,
.investment-market-note {
  display: grid;
  gap: 5px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #f8fafc;
}

.investment-total {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.investment-total span,
.investment-market-note span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.investment-total strong,
.investment-market-note strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.investment-market-note strong {
  color: #64748b;
  font-size: 15px;
}

.investment-chart {
  flex: 1 1 auto;
  min-height: 198px;
}

.investment-chart svg {
  width: 100%;
  height: 100%;
  min-height: 198px;
  overflow: visible;
}

.investment-grid line {
  stroke: #e5eaf2;
  stroke-width: 1;
}

.investment-grid text,
.investment-labels text {
  fill: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.investment-line {
  stroke: #059669;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.investment-dots circle {
  fill: #059669;
}

.investment-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.investment-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 12px;
}

.investment-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #059669;
}

.investment-legend .pending i {
  border: 1px dashed #94a3b8;
  background: transparent;
}

.investment-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 198px;
  padding: 30px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  text-align: center;
}

.investment-empty strong {
  color: #0f172a;
  font-size: 15px;
}

.investment-empty span {
  max-width: 460px;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.investment-foot {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.investment-foot span {
  color: #64748b;
  font-size: 12px;
}

.recent-documents-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
  border-radius: 16px;
}

.dashboard-recent-list {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #eef2f7;
}

.dashboard-recent-row:last-child {
  border-bottom: 0;
}

.dashboard-recent-row strong {
  display: block;
  color: #263348;
  font-size: 14px;
  font-weight: 600;
}

.dashboard-recent-row p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.dashboard-recent-row > div:last-child {
  text-align: right;
}

.dashboard-recent-row b {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-recent-analysis {
  display: block;
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
}

.dashboard-empty-note {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.mobile-app-header,
.mobile-bottom-nav,
.mobile-notification-center,
.mobile-show-all-link,
.dashboard-recent-icon,
.dashboard-recent-status,
.dashboard-recent-row em {
  display: none;
}

.auth-card {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

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

.form-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 180px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

select {
  width: 100%;
  min-height: 46px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.form-message {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--muted);
}

.upload-panel .form-message:empty {
  display: none;
}

.documents-view {
  display: none;
  gap: 28px;
}

.documents-view.active {
  display: grid;
}

.mobile-documents-header {
  display: none;
}

.upload-panel,
.document-pool,
.filing-cabinet,
.documents-panel {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.documents-upload-workspace {
  display: grid;
  grid-template-columns: minmax(0, 956px) minmax(480px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.documents-upload-workspace .document-pool {
  order: 1;
}

.documents-upload-workspace .upload-panel {
  order: 2;
}

.upload-heading p {
  margin-bottom: 4px;
  color: #6b7a90;
}

.upload-panel {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}

.document-pool {
  display: grid;
  grid-template-rows: auto 105px auto auto auto;
  gap: 10px;
  padding: 18px 20px;
}

.document-pool .form-message:empty {
  display: none;
}

.document-pool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.document-pool-header h2 {
  margin: 0 0 5px;
  color: #111827;
  font-size: 20px;
  line-height: 1.1;
}

.document-pool-header p,
.document-pool-list p,
.document-pool-filename span {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.document-pool-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.document-pool-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.document-pool-clear {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #ffffff;
  color: #dc2626;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.document-pool-clear:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.document-pool-list {
  display: grid;
  align-content: center;
  gap: 8px;
  height: 105px;
  min-height: 105px;
  max-height: 105px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 14px;
  border: 2px dashed #bfdbfe;
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.document-pool-list.has-items {
  align-content: start;
}

.document-pool-list.drag-active {
  border-color: var(--accent);
  background: #eaf3ff;
}

.document-pool-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.document-pool-item span {
  overflow: hidden;
  color: #263348;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-pool-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #ffffff;
  color: #dc2626;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.document-pool-filename {
  display: grid;
  gap: 7px;
}

.document-pool-filename input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.document-pool-filename input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.document-pool-actions {
  display: grid;
  grid-template-columns: repeat(3, 292px);
  gap: 10px;
}

.document-pool-create,
.document-pool-folder-create,
.document-pool-ai-letter {
  display: inline-flex;
  width: 292px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #020617;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.document-pool-folder-create {
  background: #2563eb;
}

.document-pool-ai-letter {
  background: #6d28d9;
}

.document-pool-create:disabled,
.document-pool-folder-create:disabled,
.document-pool-ai-letter:disabled {
  cursor: not-allowed;
  background: #9ca3af;
}

.document-pool-create svg,
.document-pool-folder-create svg,
.document-pool-ai-letter svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (max-width: 1500px) and (min-width: 1001px) {
  .documents-upload-workspace {
    grid-template-columns: minmax(600px, 1.45fr) minmax(360px, 1fr);
  }

  .document-pool-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .document-pool-create,
  .document-pool-folder-create,
  .document-pool-ai-letter {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .document-pool-actions {
    grid-template-columns: 1fr;
  }

  .document-pool-create,
  .document-pool-folder-create,
  .document-pool-ai-letter {
    width: 100%;
  }
}

.upload-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.upload-heading h2,
.documents-panel-header h3 {
  margin-bottom: 7px;
  color: #111827;
  font-size: 20px;
  line-height: 1.1;
}

.manual-booking-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #020617;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.14);
}

.manual-booking-button:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.manual-booking-button span {
  font-size: 22px;
  font-weight: 440;
  line-height: 1;
}

.dropzone {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 190px;
  padding: 28px 22px;
  border: 2px dashed #bfdbfe;
  border-radius: 8px;
  background: #f4f9fe;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.dropzone.drag-active {
  border-color: var(--accent);
  background: #eaf3ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.dropzone.uploading {
  cursor: wait;
  opacity: 0.72;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-mark {
  display: grid;
  place-items: center;
  width: 86px;
  height: 62px;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  box-shadow: none;
}

.dropzone-mark svg {
  width: 86px;
  height: 62px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  filter: drop-shadow(0 12px 18px rgba(37, 99, 235, 0.22));
}

.dropzone-cloud-fill {
  fill: #0b66ff;
  stroke: none;
}

.dropzone-mark svg path:not(.dropzone-cloud-fill) {
  stroke: #ffffff;
}

.dropzone strong {
  color: #162033;
  font-size: 18px;
  line-height: 1.2;
}

.dropzone span:last-child {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.document-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.document-sidebar-stack {
  display: grid;
  gap: 18px;
}

.pet-cabinet {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pet-cabinet[hidden] {
  display: none;
}

.pet-cabinet-heading,
.pet-cabinet-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pet-cabinet-heading h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 19px;
}

.pet-cabinet-heading p,
.pet-cabinet-card p,
.pet-cabinet-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.pet-cabinet-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f8fafc;
}

.pet-cabinet-card-head > div {
  display: grid;
  gap: 3px;
}

.pet-cabinet-card-head strong {
  color: #0f172a;
  font-size: 15px;
}

.pet-cabinet-card-head span:not(.folder-count) {
  color: var(--muted);
  font-size: 12px;
}

.pet-cabinet-card button {
  justify-self: stretch;
  min-height: 38px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
}

.pet-cabinet-empty[hidden] {
  display: none;
}

body[data-theme="dark"] .pet-cabinet,
body[data-theme="dark"] .pet-cabinet-card,
body[data-theme="dark"] .settings-pet-profile {
  border-color: #334155;
  background: #111827;
}

body[data-theme="dark"] .pet-cabinet-heading h3,
body[data-theme="dark"] .pet-cabinet-card-head strong,
body[data-theme="dark"] .settings-pet-profile > strong {
  color: #f8fafc;
}

@media (max-width: 760px) {
  .settings-pet-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.filing-cabinet {
  display: grid;
  gap: 18px;
  padding: 24px;
}

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

.cabinet-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.cabinet-header h3 {
  margin-bottom: 8px;
  color: #111827;
  font-size: 19px;
  line-height: 1.1;
}

.cabinet-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.cabinet-view-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #53627a;
  box-shadow: var(--shadow-soft);
}

.cabinet-view-button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--blue);
}

.cabinet-view-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cabinet-filters {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fbff;
}

.cabinet-filters label {
  display: grid;
  gap: 5px;
}

.cabinet-filters span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cabinet-filters input,
.cabinet-filters select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.cabinet-filters input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

.cabinet-filters input:focus,
.cabinet-filters select:focus {
  border-color: #93c5fd;
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.folder-tree {
  display: grid;
  gap: 10px;
}

.case-cabinet {
  align-content: start;
}

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

.case-cabinet-empty {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fbff;
}

.case-cabinet-empty strong {
  color: #334155;
  font-size: 13px;
}

.case-cabinet-empty span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.case-cabinet-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.case-cabinet-item:hover {
  border-color: #93b8ff;
  background: #f8fbff;
}

.case-cabinet-item:has(.case-cabinet-open:focus-visible) {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.case-cabinet-item.active {
  border-color: #78a6ff;
  background: #f3f7ff;
}

.case-cabinet-open {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.case-cabinet-actions {
  display: flex;
  gap: 6px;
}

.case-cabinet-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #ffffff;
  color: #52637c;
  cursor: pointer;
}

.case-cabinet-actions button:hover,
.case-cabinet-actions button:focus-visible {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  outline: none;
}

.case-cabinet-actions button.danger {
  color: #ef4444;
}

.case-cabinet-actions button.danger:hover,
.case-cabinet-actions button.danger:focus-visible {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.case-cabinet-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.case-cabinet-item-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue);
}

.case-cabinet-item-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.case-cabinet-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.case-cabinet-item-copy strong {
  overflow: hidden;
  color: #263348;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-cabinet-item-copy small {
  color: #64748b;
  font-size: 12px;
}

.folder-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #263348;
  cursor: pointer;
  text-align: left;
}

.folder-button.active,
.folder-button:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.folder-button.child {
  min-height: 46px;
  border-color: transparent;
  background: #f8fbff;
  box-shadow: none;
}

.folder-button.child.active {
  background: #eef5ff;
}

.folder-label {
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef2f7;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.folder-chevron {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  align-self: center;
  justify-self: center;
  color: #64748b;
}

.folder-chevron svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  transform-origin: center;
  transition: transform 160ms ease;
}

.folder-button[data-expanded="true"] .folder-chevron svg {
  transform: rotate(90deg);
}

.folder-children {
  display: grid;
  gap: 5px;
  margin-left: 24px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.document-tax-export {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.tax-export-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
}

.tax-export-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eaf2ff;
  color: #2563eb;
}

.tax-export-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tax-export-heading h3 {
  margin-bottom: 8px;
  color: #111827;
  font-size: 19px;
  line-height: 1.1;
}

.document-tax-export p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.tax-export-primary,
.tax-export-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.tax-export-primary {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.tax-export-secondary {
  border: 1px solid #dbe4ef;
  background: #ffffff;
  color: #334155;
}

.document-shredder {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.shredder-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: start;
  gap: 16px;
}

.shredder-icon {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  place-items: center;
  justify-self: end;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
}

.shredder-heading > div {
  grid-column: 1;
  grid-row: 1;
}

.shredder-icon img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.shredder-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shredder-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shredder-title-row h3 {
  margin-bottom: 0;
  color: #111827;
  font-size: 19px;
  line-height: 1.1;
}

.shredder-title-row .folder-count {
  padding: 3px 8px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
}

.document-shredder p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.shredder-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #ef4444;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.2);
}

.shredder-button:disabled {
  cursor: not-allowed;
  background: #fca5a5;
  color: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  opacity: 0.5;
}

.shredder-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.shredder-list[hidden] {
  display: none;
}

.shredder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.shredder-item span {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shredder-item button {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.shredder-more {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.shredder-empty {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.documents-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.documents-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.document-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: #53627a;
  font-size: 14px;
  font-weight: 700;
}

.document-breadcrumb span:first-child {
  color: var(--accent);
}

.document-breadcrumb strong {
  margin-left: 8px;
  color: #64748b;
  font-size: 13px;
}

.breadcrumb-separator {
  color: #94a3b8;
}

.documents-panel-header p {
  margin-bottom: 0;
  color: #64748b;
  font-size: 13px;
}

.ai-query-bar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 2px 0 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.26);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.04);
}

.ai-query-bar[hidden] {
  display: none;
}

.document-pool-ai-letter[hidden] {
  display: none;
}

.ai-query-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #dbeafe;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.ai-query-field {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ai-query-field span {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.ai-query-field input {
  width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.ai-query-field input::placeholder {
  color: #8a9ab0;
}

.ai-query-submit {
  min-width: 78px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.ai-query-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ai-query-response {
  display: grid;
  gap: 12px;
  margin: -4px 0 0;
  padding: 16px 18px;
  border: 1px solid #dbe7f8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.ai-query-response[hidden] {
  display: none;
}

.ai-query-response[data-status="loading"] {
  background: #f8fbff;
}

.ai-query-response[data-status="error"] {
  border-color: #fecaca;
  background: #fff7f7;
}

.ai-query-response-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ai-query-response-header strong,
.ai-query-source-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.ai-query-response-header small {
  color: #7b8ba3;
  font-size: 10px;
  font-weight: 700;
}

.ai-query-response-status,
.ai-query-response-answer {
  margin: 0;
  color: #42526a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.65;
  white-space: pre-wrap;
}

.ai-query-response[data-status="error"] .ai-query-response-status {
  color: #b91c1c;
}

.ai-query-source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ai-source;
}

.ai-query-source-list li {
  min-width: 0;
  counter-increment: ai-source;
}

.ai-query-source-list li > button,
.ai-query-source-list li > span {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  text-align: left;
}

.ai-query-source-list li > button {
  cursor: pointer;
}

.ai-query-source-list li > button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.ai-query-source-list li > button::before,
.ai-query-source-list li > span::before {
  grid-row: 1 / span 2;
  content: counter(ai-source);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.ai-query-source-list strong,
.ai-query-source-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-query-source-list strong {
  font-size: 11px;
  font-weight: 800;
}

.ai-query-source-list small {
  color: #7b8ba3;
  font-size: 10px;
  font-weight: 650;
}

.document-list {
  overflow-x: auto;
  margin-bottom: 2px;
}

.document-table {
  min-width: 1320px;
}

.document-table-head,
.document-row {
  display: grid;
  grid-template-columns:
    38px
    minmax(300px, 2.1fr)
    minmax(190px, 1.1fr)
    minmax(150px, 0.9fr)
    minmax(110px, 0.7fr)
    minmax(72px, 0.45fr)
    minmax(120px, 0.7fr)
    minmax(130px, 0.8fr)
    minmax(302px, 1.05fr);
  gap: 18px;
  align-items: center;
}

.document-pool-select {
  display: grid;
  place-items: center;
}

.document-pool-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.document-pool-select input:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.document-pool-select-all {
  align-self: center;
}

.document-table-head {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--border);
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.document-amount-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.amount-privacy-toggle {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
  color: #5f7088;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.amount-privacy-toggle:hover,
.amount-privacy-toggle[aria-pressed="true"] {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.amount-privacy-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.document-row {
  min-height: 58px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.document-row:hover {
  background: #f8fbff;
}

.document-main {
  min-width: 0;
}

.document-row h3,
.document-row p {
  margin-bottom: 0;
}

.document-row h3 {
  overflow: hidden;
  color: #263348;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-row p,
.document-cell {
  color: #53627a;
  font-size: 14px;
}

.document-amount {
  display: inline-block;
  color: #162033;
  font-size: 14px;
  font-weight: 800;
  transition:
    filter 160ms ease,
    opacity 160ms ease;
}

body.amounts-blurred .document-amount {
  filter: blur(6px);
  opacity: 0.42;
  user-select: none;
}

.status-pill {
  justify-self: start;
  min-width: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f1f5f9;
  color: #607089;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.document-processing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 7px;
  align-items: center;
  min-width: 0;
}

.document-processing .status-pill {
  grid-column: 1 / -1;
}

.document-processing-progress {
  position: relative;
  width: 100%;
  min-width: 72px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.document-processing-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 240ms ease;
}

.document-processing small {
  color: #607089;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.document-processing:has(.status-clean) .document-processing-progress > span {
  background: #16a34a;
}

.status-clean {
  background: #d9f8e6;
  color: #247457;
}

.status-info {
  background: #dbeafe;
  color: #2563eb;
}

.status-warning {
  background: #fef3c7;
  color: #8a5a16;
}

.status-muted {
  background: #f1f5f9;
  color: #607089;
}

.document-actions {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  align-items: center;
  gap: 10px;
}

.document-actions [data-document-action="view"] {
  grid-column: 1;
}

.document-actions [data-document-action="edit"] {
  grid-column: 2;
}

.document-actions [data-document-action="download"] {
  grid-column: 3;
}

.document-actions [data-document-action="open-converter"] {
  grid-column: 4;
}

.document-actions [data-document-action="delete"] {
  grid-column: 5;
}

.document-actions [data-document-action="remove-from-folder"] {
  grid-column: 6;
}

.folder-unlink-action {
  color: #d97706;
}

.icon-action {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #52637c;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.icon-action:hover {
  border-color: #cbd5e1;
  background: #f8fbff;
  color: var(--accent);
}

.icon-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.document-convert-action {
  color: #2563eb;
}

.document-convert-action svg {
  stroke-width: 2.6;
}

.document-converter-modal {
  width: min(620px, calc(100vw - 40px));
}

.document-converter-modal .modal-header > div {
  min-width: 0;
}

.document-converter-modal .modal-header p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-converter-body {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.document-converter-body > p,
.document-converter-body > small {
  margin: 0;
}

.document-converter-body > p:first-child {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.document-converter-body > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.document-converter-formats button {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.document-converter-formats button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #f8fbff;
}

.document-converter-formats button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.document-converter-formats strong {
  color: var(--accent);
  font-size: 18px;
}

.document-converter-formats span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 620px) {
  .document-converter-formats {
    grid-template-columns: 1fr;
  }

  .document-converter-formats button {
    min-height: 72px;
  }
}

.icon-action.danger {
  color: #ef4444;
}

.icon-action.danger:hover {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.icon-action.flat {
  width: 38px;
  height: 38px;
  border-color: transparent;
  box-shadow: none;
}

.icon-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 3px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  line-height: 1.45;
}

.detail-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.ocr-text {
  min-height: 180px;
  max-height: 380px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-muted);
  color: var(--text);
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.ocr-text.compact {
  min-height: 110px;
  max-height: 180px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.edit-ocr-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
}

.modal-card {
  display: grid;
  gap: 0;
  width: min(1080px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-card.compact-modal {
  width: min(680px, calc(100vw - 56px));
}

#edit-document-form {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: calc(100vh - 56px);
}

.document-preview-modal-card {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  width: min(1400px, calc(100vw - 48px));
  height: calc(100vh - 48px);
}

.document-preview-modal-card > .modal-header {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 0;
  border: 0;
}

.document-preview-modal-card > .modal-header h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.document-preview-body {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  background: #eef2f7;
}

.document-preview-body > p {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.document-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.document-preview-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.document-preview-text {
  width: 100%;
  height: 100%;
  overflow: auto;
  margin: 0;
  padding: 24px;
  background: #fff;
  color: var(--text);
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

.document-preview-error {
  color: var(--danger) !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin-bottom: 0;
  color: #111827;
  font-size: 23px;
  line-height: 1.05;
}

.edit-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px 24px;
}

.edit-modal-body.single-panel {
  grid-template-columns: 1fr;
}

.edit-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
  background: #f8fafc;
}

.edit-panel h3,
.edit-panel h4 {
  margin-bottom: 0;
  color: #111827;
  line-height: 1.1;
}

.edit-panel h3 {
  font-size: 18px;
}

.edit-panel h4 {
  font-size: 14px;
}

.edit-grid {
  display: grid;
  gap: 14px;
}

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

.qr-scan-modal {
  width: min(620px, calc(100vw - 32px));
}

.qr-scan-body {
  display: grid;
  gap: 14px;
  padding: 20px 24px 4px;
}

.qr-camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #0f172a;
}

.qr-camera-frame video,
.qr-camera-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#document-scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#document-scan-preview {
  position: absolute;
  inset: 0;
  background: #111827;
}

.scan-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f4f7fb;
}

.scan-mode-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.scan-mode-button.active {
  background: #2563eb;
  color: #ffffff;
}

.scan-modal-actions {
  flex-wrap: wrap;
}

.scan-modal-actions > button {
  flex: 1 1 150px;
}

.qr-scan-corners {
  position: absolute;
  inset: 20%;
  border: 2px solid rgba(37, 99, 235, 0.9);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.24);
}

@media (max-width: 560px) {
  .qr-scan-modal {
    width: calc(100vw - 20px);
  }

  .qr-scan-body {
    padding-inline: 14px;
  }

  .scan-modal-actions {
    padding-inline: 14px;
  }
}

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

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

.edit-grid.one-column {
  grid-template-columns: 1fr;
}

.edit-panel label {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.edit-panel input,
.edit-panel select {
  min-height: 44px;
  padding: 0 12px;
  border-color: #dbe4ef;
  border-radius: 8px;
  background-color: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 560;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 600;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.reminder-card,
.debit-card,
.finance-preview {
  border-radius: 8px;
  background: #ffffff;
}

.reminder-card,
.debit-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.edit-collapsible.reminder-card,
.edit-collapsible.debit-card,
.edit-collapsible.edit-ocr-card {
  display: block;
  gap: 0;
  padding: 0;
}

.edit-collapsible summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  color: #111827;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.1;
  cursor: pointer;
  list-style: none;
}

.edit-collapsible summary::-webkit-details-marker {
  display: none;
}

.edit-collapsible summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: 16px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.edit-collapsible[open] summary::after {
  transform: rotate(225deg);
}

.edit-collapsible-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.finance-panel-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.finance-panel-title .manual-pill {
  grid-column: 2;
  justify-self: start;
}

.finance-assignment-icon,
.finance-preview-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fee2e2;
  color: #ff1028;
}

.finance-assignment-icon svg,
.finance-preview-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.manual-pill {
  border-radius: 999px;
  padding: 6px 11px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.text-action {
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}

.text-action:hover {
  color: #0f172a;
}

.booking-choice-modal {
  width: min(980px, calc(100vw - 32px));
}

.finance-conflict-modal .modal-header {
  align-items: flex-start;
}

.finance-conflict-modal .modal-header p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 17px;
  line-height: 1.45;
}

.booking-choice-body {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.booking-choice-body p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.booking-choice-actions {
  display: grid;
  gap: 10px;
}

.booking-conflict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.booking-conflict-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  min-height: 150px;
  margin: 0;
  padding: 24px;
  border-radius: 8px;
  background: #f8fafc;
}

.booking-conflict-card h3 {
  margin: 5px 0 22px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 720;
}

.booking-conflict-card p {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 16px;
}

.booking-conflict-card strong {
  color: #0f172a;
  font-weight: 720;
}

.booking-conflict-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

.booking-conflict-icon.warning {
  background: #ffe4e6;
  color: #dc2626;
}

.booking-conflict-icon.document {
  background: #dbeafe;
  color: #2563eb;
}

.booking-conflict-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.booking-conflict-note {
  margin: 0;
  padding: 16px 18px;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 16px;
  line-height: 1.45;
}

.conflict-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.booking-choice-button {
  display: grid;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-height: 112px;
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.booking-choice-button.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.booking-choice-button.primary span {
  color: #dbeafe;
}

.booking-choice-button.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.booking-choice-button.danger span {
  color: #ef4444;
}

.booking-choice-button:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.booking-choice-button strong {
  font-size: 19px;
  font-weight: 720;
}

.booking-choice-button span {
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .finance-conflict-modal .modal-header {
    gap: 14px;
  }

  .booking-conflict-grid,
  .conflict-actions {
    grid-template-columns: 1fr;
  }

  .booking-choice-body {
    padding: 18px;
  }

  .booking-conflict-card {
    min-height: 0;
    padding: 18px;
  }
}

.edit-panel input::placeholder {
  color: #94a3b8;
}

.edit-panel select,
.edit-panel input {
  min-width: 0;
}

.finance-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #dbe4ef;
}

.finance-preview strong,
.debit-card p,
.debit-card small {
  color: #64748b;
}

.finance-preview b {
  display: block;
  margin-top: 6px;
  color: #dc2626;
  font-size: 16px;
}

.finance-assignment-icon[data-finance-section="income"],
.finance-preview[data-finance-section="income"] .finance-preview-icon {
  background: #dcfce7;
  color: #00a83f;
}

.finance-assignment-icon[data-finance-section="expense"],
.finance-preview[data-finance-section="expense"] .finance-preview-icon {
  background: #fee2e2;
  color: #ff1028;
}

.finance-assignment-icon[data-finance-section="donation"],
.finance-preview[data-finance-section="donation"] .finance-preview-icon {
  background: #ede9fe;
  color: #5b21b6;
}

.finance-assignment-icon[data-finance-section="fun"],
.finance-preview[data-finance-section="fun"] .finance-preview-icon {
  background: #ffedd5;
  color: #ea580c;
}

.finance-assignment-icon[data-finance-section="education"],
.finance-preview[data-finance-section="education"] .finance-preview-icon,
.finance-assignment-icon[data-finance-section="savings"],
.finance-preview[data-finance-section="savings"] .finance-preview-icon {
  background: #dbeafe;
  color: #2567ff;
}

.finance-assignment-icon[data-finance-section="investment"],
.finance-preview[data-finance-section="investment"] .finance-preview-icon {
  background: #d1fae5;
  color: #00a86b;
}

.finance-assignment-icon[data-finance-section="none"],
.finance-preview[data-finance-section="none"] .finance-preview-icon {
  background: #f1f5f9;
  color: #64748b;
}

.finance-preview[data-finance-section="income"] b {
  color: #16a34a;
}

.finance-preview[data-finance-section="expense"] b {
  color: #dc2626;
}

.finance-preview[data-finance-section="donation"] b {
  color: #5b21b6;
}

.finance-preview[data-finance-section="fun"] b {
  color: #ea580c;
}

.finance-preview[data-finance-section="education"] b,
.finance-preview[data-finance-section="savings"] b {
  color: #2563eb;
}

.finance-preview[data-finance-section="investment"] b {
  color: #059669;
}

.finance-preview[data-finance-section="none"] b {
  color: #475569;
}

.finance-preview p,
.debit-card p {
  margin-bottom: 0;
  font-size: 14px;
}

.debit-card small {
  font-size: 13px;
  line-height: 1.45;
}

.modal-card > .form-message {
  padding: 0 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}

.finance-card {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.finance-view.active {
  display: grid;
  gap: 22px;
}

.finance-matrix-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.finance-matrix-card .documents-panel-header p {
  color: #64748b;
  font-size: 14px;
}

.finance-matrix-card .documents-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
}

.finance-matrix-card .documents-panel-header > div:first-child {
  min-width: 0;
}

.finance-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.finance-controls span,
.finance-controls select {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 0;
  background: #f1f5f9;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.finance-controls select {
  width: 210px;
  min-width: 210px;
  appearance: auto;
}

.finance-controls span {
  white-space: nowrap;
}

.finance-matrix-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 330px;
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.finance-summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 106px;
  min-height: 106px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.finance-summary-icon {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: #00a83f;
}

.finance-summary-icon svg,
.finance-row-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.finance-summary-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.finance-summary-icon[data-finance-icon="wallet"] svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.finance-summary-card.income .finance-summary-icon,
.finance-row-icon,
.finance-section-row.income {
  background: #dcfce7;
}

.finance-summary-card.expense .finance-summary-icon,
.finance-section-row.expense {
  background: #fee2e2;
}

.finance-summary-card.expense .finance-summary-icon {
  color: #ff1028;
}

.finance-summary-card.savings .finance-summary-icon,
.finance-section-row.savings {
  background: #eff6ff;
}

.finance-section-row.donation {
  background: #f5f3ff;
}

.finance-section-row.fun {
  background: #fff7ed;
}

.finance-section-row.education {
  background: #eff6ff;
}

.finance-summary-card.savings .finance-summary-icon {
  color: #2567ff;
}

.finance-summary-card.investment .finance-summary-icon,
.finance-section-row.investment {
  background: #d1fae5;
}

.finance-summary-card.investment .finance-summary-icon {
  color: #00a86b;
}

.finance-summary-card p {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 13px;
}

.finance-summary-card strong {
  display: block;
  color: #0f172a;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.08;
}

.finance-summary-card small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
}

.finance-summary-card.income small,
.finance-value-row.income b,
.finance-value-row.income > span {
  color: #16a34a;
}

.finance-summary-card.expense small,
.finance-value-row.expense b,
.finance-value-row.expense > span {
  color: #dc2626;
}

.finance-summary-card.savings small,
.finance-value-row.savings b,
.finance-value-row.savings > span {
  color: #2563eb;
}

.finance-summary-card.investment small,
.finance-value-row.investment b,
.finance-value-row.investment > span {
  color: #059669;
}

.finance-matrix-card {
  display: grid;
  gap: 18px;
  padding: 24px 28px;
  overflow-x: auto;
}

.finance-matrix {
  min-width: 1260px;
  display: grid;
}

.finance-matrix-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) repeat(12, minmax(82px, 1fr)) minmax(100px, 1fr);
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid #eef2f7;
}

.finance-matrix-head {
  min-height: 42px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.finance-matrix-head span:not(:first-child),
.finance-value-row > span,
.finance-value-row > b {
  text-align: right;
}

.finance-section-row {
  min-height: 42px;
  border-bottom: 0;
}

.finance-section-row strong {
  padding-left: 14px;
  color: #0f766e;
  font-size: 14px;
  font-weight: 650;
}

.finance-section-row.expense strong {
  color: #b91c1c;
}

.finance-section-row.savings strong {
  color: #1d4ed8;
}

.finance-section-row.donation strong {
  color: #5b21b6;
}

.finance-section-row.fun strong {
  color: #c2410c;
}

.finance-section-row.education strong {
  color: #1d4ed8;
}

.finance-value-row {
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}

.finance-row-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.finance-row-label-plain {
  padding-left: 50px;
}

.finance-row-label strong {
  display: block;
  color: #1e293b;
  font-size: 14px;
  font-weight: 650;
}

.finance-row-label small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.finance-row-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #00a83f;
}

.finance-row-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 2;
}

.finance-value-row.expense .finance-row-icon {
  background: #fee2e2;
  color: #ff1028;
}

.finance-value-row.investment .finance-row-icon {
  background: #d1fae5;
  color: #00a86b;
}

.finance-value-row.savings .finance-row-icon {
  background: #dbeafe;
  color: #2567ff;
}

.finance-value-row.donation .finance-row-icon {
  background: #ede9fe;
  color: #5b21b6;
}

.finance-value-row.fun .finance-row-icon {
  background: #ffedd5;
  color: #ea580c;
}

.finance-value-row.education .finance-row-icon {
  background: #dbeafe;
  color: #2563eb;
}

.finance-value-row > b {
  color: #0f172a;
  font-weight: 650;
}

.finance-source-trigger {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.finance-source-trigger:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.finance-sources-modal {
  display: flex;
  width: min(860px, calc(100vw - 56px));
  max-width: calc(100vw - 56px);
  max-height: calc(100dvh - 56px);
  flex-direction: column;
  overflow: hidden;
}

.finance-sources-modal > .modal-header {
  flex: 0 0 auto;
}

.finance-sources-modal > .modal-header > div {
  min-width: 0;
}

.finance-sources-modal > .modal-header .icon-action {
  flex: 0 0 auto;
}

.finance-sources-modal .modal-header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.finance-source-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 18px 22px 0;
}

.finance-source-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #eef6ff;
  color: #475569;
  font-size: 13px;
}

.finance-source-summary div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.finance-source-summary strong {
  color: #2563eb;
  font-weight: 650;
  white-space: nowrap;
}

.finance-source-summary b {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.finance-source-rows {
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.finance-source-row {
  display: grid;
  grid-template-columns: 48px minmax(210px, 1fr) minmax(110px, 0.7fr) auto auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.finance-source-file-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eef6ff;
  color: #2563eb;
}

.finance-source-file-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.finance-source-row strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 650;
}

.finance-source-name {
  min-width: 0;
}

.finance-source-name strong,
.finance-source-name p {
  overflow-wrap: anywhere;
}

.finance-source-name p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.finance-source-company {
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-source-amount {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 112px;
}

.finance-source-amount strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.finance-source-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

.finance-source-actions .icon-action {
  width: 36px;
  height: 36px;
}

.finance-source-actions .icon-action svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1000px) {
  .finance-sources-modal {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
  }

  .finance-source-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .finance-source-company {
    grid-column: 2;
  }

  .finance-source-amount {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .finance-source-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
}

@media (max-height: 720px) {
  .finance-sources-modal > .modal-header {
    padding-block: 14px;
  }

  .finance-source-list {
    gap: 10px;
    padding-top: 12px;
  }

  .finance-source-summary,
  .finance-source-row {
    padding-block: 10px;
  }

  .finance-source-footer {
    padding-block: 12px;
  }
}

.finance-source-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 2px -22px 0;
  padding: 16px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.finance-source-footer span {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 12px;
}

.finance-source-footer strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
}

.finance-source-footer .primary-action {
  min-width: 112px;
}

.secondary-action.compact {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.finance-source-empty {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.finance-total-row {
  background: #f8fafc;
  font-weight: 650;
}

.finance-total-row.income,
.finance-total-row.investment {
  background: #ecfdf5;
}

.finance-total-row.expense {
  background: #fff1f2;
}

.finance-total-row.donation {
  background: #f5f3ff;
}

.finance-total-row.fun {
  background: #fff7ed;
}

.finance-total-row.education {
  background: #eff6ff;
}

.finance-total-row.savings {
  background: #eff6ff;
}

.finance-total-row.savings > span,
.finance-total-row.savings > b {
  color: #0f172a;
}

.finance-savings-row {
  min-height: 52px;
  background: #2563eb;
  color: #ffffff;
}

.finance-value-row.finance-savings-row .finance-savings-label,
.finance-value-row.finance-savings-row .finance-savings-label strong,
.finance-value-row.finance-savings-row > span,
.finance-value-row.finance-savings-row > b {
  color: #ffffff;
}

.finance-savings-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-left: 14px;
  font-weight: 650;
}

.finance-savings-label svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-entry-list {
  display: grid;
  gap: 0;
}

.finance-entry-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px 140px 110px;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.finance-entry-row strong {
  display: block;
  color: #263348;
  font-size: 15px;
  font-weight: 650;
}

.finance-entry-row span {
  color: #64748b;
  font-size: 13px;
}

.finance-entry-row b {
  color: #162033;
  font-size: 14px;
  font-weight: 650;
}

.finance-entry-row em {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f1f5f9;
  color: #607089;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.empty-state {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  max-width: none;
  min-height: 320px;
  padding: 44px 28px;
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 0;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--accent);
  font-size: 24px;
}

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

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 28px 22px;
  }

  .brand {
    gap: 10px;
    min-height: 58px;
    padding-left: 0;
    padding-bottom: 34px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
  }

  .brand-divider {
    height: 48px;
  }

  .brand-name {
    font-size: 28px;
  }

  .brand-subtitle {
    display: inline;
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .nav {
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 28px;
    padding-right: 0;
  }

  .nav-group {
    gap: 10px;
  }

  .nav-label {
    display: block;
  }

  .nav-link,
  .nav-button {
    gap: 12px;
    justify-content: flex-start;
    min-height: 50px;
    padding: 0 16px;
    font-size: 15px;
    border-radius: 8px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .sidebar-footer .nav-link[href="#settings"] .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .sidebar-footer {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .workspace {
    padding: 22px;
  }

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

  .dashboard-kpis,
  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .settings-column {
    min-height: auto;
    gap: 16px;
    padding: 26px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .settings-column:first-child {
    padding-top: 0;
  }

  .settings-column:last-child {
    padding-bottom: 12px;
    border-bottom: 0;
  }

  .settings-two-columns {
    grid-template-columns: 1fr;
  }

  .settings-plan-summary,
  .settings-plan-card {
    grid-template-columns: 1fr;
  }

  .settings-plan-price-block {
    justify-items: start;
    text-align: left;
  }

  .settings-toggle-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .settings-toggle-row--switch-only .settings-switch {
    grid-column: 2;
  }

  .settings-toggle-row .settings-small-input {
    grid-column: 1 / -1;
    width: 100%;
    text-align: left;
  }

  .investment-overview {
    grid-template-columns: 1fr;
  }

  .distribution-content {
    grid-template-columns: 1fr;
  }

  .distribution-content,
  .distribution-pane,
  .distribution-legend {
    grid-template-columns: 1fr;
  }

  .distribution-pane-month {
    margin-left: 0;
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid #cbd5e1;
    border-left: 0;
  }

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

  .document-row {
    align-items: center;
  }

  .document-meta {
    flex-wrap: wrap;
    white-space: normal;
  }

  .documents-view {
    gap: 18px;
  }

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

  .documents-upload-workspace .upload-panel {
    order: 1;
  }

  .documents-upload-workspace .document-pool {
    order: 2;
  }

  .upload-panel,
  .document-pool,
  .filing-cabinet,
  .documents-panel {
    padding: 20px;
  }

  .document-workbench {
    grid-template-columns: 1fr;
  }

  .upload-fields {
    grid-template-columns: 1fr;
  }

  .upload-actions,
  .documents-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-query-bar {
    grid-template-columns: 36px minmax(0, 1fr) 64px;
    gap: 10px;
    padding: 10px;
  }

  .ai-query-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 12px;
  }

  .ai-query-submit {
    min-width: 64px;
    height: 34px;
    font-size: 12px;
  }

  .document-table {
    min-width: 760px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    background: #ffffff;
    overflow-x: hidden;
  }

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

  .sidebar {
    display: none;
  }

  .workspace {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 24px 12px 116px;
    background: #ffffff;
  }

  body[data-view="dashboard"] .workspace {
    padding-top: 12px;
  }

  .topbar {
    display: none;
  }

  .view.active {
    width: 100%;
  }

  #dashboard.view.active {
    display: flex;
    flex-direction: column;
    gap: 13px;
    max-width: 100%;
    overflow-x: hidden;
  }

  #documents.view.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .mobile-documents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
  }

  .mobile-documents-header h1 {
    margin: 0;
    color: #071126;
    font-size: 28px;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1;
  }

  .mobile-upload-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #020617;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.18);
    font-size: 14px;
    font-weight: 760;
    white-space: nowrap;
  }

  .mobile-upload-trigger span {
    font-size: 23px;
    font-weight: 420;
    line-height: 1;
  }

  #documents .upload-panel {
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #documents .document-pool {
    padding: 20px;
  }

  #documents .upload-heading {
    display: none;
  }

  #documents .dropzone {
    gap: 10px;
    min-height: 206px;
    padding: 30px 18px;
    border-width: 2px;
    border-radius: 16px;
    background: #f8fbff;
  }

  #documents .dropzone-mark {
    width: 86px;
    height: 62px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #documents .dropzone-mark svg {
    width: 86px;
    height: 62px;
    stroke-width: 2;
    filter: drop-shadow(0 12px 18px rgba(37, 99, 235, 0.22));
  }

  #documents .dropzone-cloud-fill {
    fill: #0b66ff;
    stroke: none;
  }

  #documents .dropzone-mark svg path:not(.dropzone-cloud-fill) {
    stroke: #ffffff;
  }

  #documents .dropzone strong {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 760;
  }

  #documents .dropzone span:last-child {
    max-width: 250px;
    font-size: 16px;
    line-height: 1.34;
  }

  #documents .upload-panel .form-message {
    min-height: 0;
    margin-top: 10px;
    font-size: 13px;
  }

  #documents .document-workbench {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  #documents .document-sidebar-stack {
    display: contents;
    gap: 14px;
  }

  #documents .filing-cabinet {
    order: 1;
    gap: 16px;
    padding: 20px 16px 18px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  #documents .document-tax-export,
  #documents .document-shredder {
    gap: 16px;
    padding: 20px 16px 18px;
    border-color: var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  #documents .cabinet-header {
    align-items: flex-start;
    gap: 12px;
  }

  #documents .cabinet-header h3 {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 760;
  }

  #documents .cabinet-header p {
    max-width: 230px;
    font-size: 13px;
    line-height: 1.4;
  }

  #documents .cabinet-actions {
    gap: 8px;
  }

  #documents .cabinet-view-button {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  #documents .folder-tree {
    gap: 9px;
  }

  #documents .folder-button {
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 12px;
    min-height: 58px;
    padding: 0 12px;
    border-radius: 10px;
  }

  #documents .folder-button.child {
    grid-template-columns: minmax(0, 1fr) auto 0;
    min-height: 48px;
    margin-left: 12px;
    padding: 0 10px;
    border-radius: 10px;
  }

  #documents .folder-label {
    font-size: 15px;
    font-weight: 760;
  }

  #documents .folder-count {
    padding: 4px 9px;
    font-size: 12px;
  }

  #documents .folder-children {
    gap: 7px;
    margin-left: 22px;
    padding-left: 13px;
  }

  #documents .case-cabinet-empty {
    gap: 4px;
    padding: 14px;
    border-radius: 10px;
  }

  #documents .case-cabinet-empty strong {
    font-size: 14px;
  }

  #documents .case-cabinet-empty span {
    font-size: 13px;
    line-height: 1.4;
  }

  #documents .shredder-heading {
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 12px;
  }

  #documents .tax-export-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  #documents .tax-export-icon,
  #documents .shredder-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  #documents .shredder-icon img {
    width: 40px;
    height: 40px;
  }

  #documents .tax-export-heading h3,
  #documents .shredder-title-row h3 {
    color: #111827;
    font-size: 20px;
    font-weight: 760;
    line-height: 1.1;
  }

  #documents .tax-export-heading h3 {
    margin-bottom: 8px;
  }

  #documents .document-tax-export p,
  #documents .document-shredder p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
  }

  #documents .document-tax-export p {
    margin: 0;
  }

  #documents .document-shredder p {
    margin: 8px 0 0;
  }

  #documents .tax-export-primary,
  #documents .tax-export-secondary,
  #documents .shredder-button {
    min-height: 46px;
    border-radius: 10px;
    font-size: 14px;
  }

  #documents .shredder-empty {
    margin: 0;
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
  }

  #documents .document-tax-export,
  #documents .document-shredder,
  #documents .documents-panel {
    margin-top: 0;
  }

  #documents .documents-panel {
    order: 2;
  }

  #documents .document-tax-export {
    order: 3;
  }

  #documents .document-shredder {
    order: 4;
  }

  .mobile-app-header {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    margin-bottom: 0;
  }

  .mobile-app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-app-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: var(--brand-mark-filter);
  }

  .mobile-app-brand i {
    display: block;
    flex: 0 0 auto;
    width: 1px;
    height: 42px;
    border-radius: 999px;
    background: var(--sidebar-divider);
  }

  .mobile-app-brand span {
    display: grid;
    gap: 5px;
    min-width: 0;
  }

  .mobile-app-brand strong {
    color: var(--sidebar-brand);
    font-family: "Avenir Next", "Avenir", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 32px;
    font-weight: 560;
    letter-spacing: 0.012em;
    line-height: 0.9;
    text-shadow: var(--brand-name-shadow);
  }

  .mobile-app-brand small {
    color: var(--sidebar-subtitle);
    font-size: 7px;
    font-weight: 500;
    letter-spacing: 0.2em;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
  }

  .mobile-notification-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #081126;
    cursor: pointer;
  }

  .mobile-notification-button svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.1;
  }

  .mobile-notification-button span {
    position: absolute;
    top: 1px;
    right: 0;
    display: grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 3px #ffffff;
  }

  .mobile-notification-button span[hidden] {
    display: none;
  }

  .mobile-notification-center {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    padding: 72px 0 0;
    background: rgba(8, 17, 38, 0.4);
    backdrop-filter: blur(4px);
  }

  .mobile-notification-center[hidden] {
    display: none;
  }

  .mobile-notification-sheet {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    max-height: min(78dvh, 720px);
    padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-radius: 26px 26px 0 0;
    background: #ffffff;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.2);
  }

  .mobile-notification-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
  }

  .mobile-notification-sheet-header span {
    display: block;
    margin-bottom: 4px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .mobile-notification-sheet-header h2 {
    margin: 0;
    color: #081126;
    font-size: 25px;
    line-height: 1.1;
  }

  .mobile-notification-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid #dbe5f1;
    border-radius: 50%;
    background: #f8fafc;
    color: #0f172a;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
  }

  .mobile-notification-list {
    display: grid;
    gap: 10px;
    padding: 14px 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-notification-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
  }

  .mobile-notification-item.is-active {
    border-color: #bfd4ff;
    background: #f5f8ff;
  }

  .mobile-notification-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #eaf1ff;
    color: #2563eb;
  }

  .mobile-notification-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .mobile-notification-copy {
    min-width: 0;
  }

  .mobile-notification-copy strong,
  .mobile-notification-copy span,
  .mobile-notification-copy time {
    display: block;
  }

  .mobile-notification-copy strong {
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 800;
  }

  .mobile-notification-copy span {
    color: #475569;
    font-size: 13px;
    line-height: 1.35;
  }

  .mobile-notification-copy time {
    margin-top: 5px;
    color: #8290a6;
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-notification-arrow {
    color: #94a3b8;
    font-size: 25px;
    line-height: 1;
  }

  .mobile-notification-empty {
    margin: 18px 0 0;
    padding: 24px 18px;
    border-radius: 15px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
  }

  .dashboard-kpis {
    order: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    max-width: 100%;
  }

  .dashboard-card,
  .dashboard-kpi {
    border-color: #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  .dashboard-kpi {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 98px;
    height: 98px;
    overflow: hidden;
    padding: 12px 26px 12px 11px;
  }

  .dashboard-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .dashboard-kpi-icon svg {
    width: 21px;
    height: 21px;
    stroke-width: 2;
  }

  .dashboard-kpi > div {
    min-width: 0;
    overflow: hidden;
  }

  .dashboard-kpi p {
    max-width: 100%;
    margin-bottom: 4px;
    overflow: hidden;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.14;
    text-overflow: clip;
    white-space: nowrap;
  }

  .dashboard-kpi strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
    text-overflow: clip;
    white-space: nowrap;
  }

  .dashboard-kpi:nth-child(2) strong,
  .dashboard-kpi:nth-child(3) strong {
    font-size: 14px;
  }

  .dashboard-kpi small {
    max-width: 100%;
    margin-top: 5px;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.22;
  }

  .dashboard-kpi:nth-child(2) small {
    color: #16a34a;
    font-size: 12px;
    font-weight: 650;
  }

  .dashboard-kpi-arrow {
    position: absolute;
    right: 9px;
    top: 50%;
    color: #64748b;
    font-size: 26px;
    transform: translateY(-50%);
  }

  .dashboard-progress {
    width: 100%;
    height: 6px;
    margin-top: 7px;
  }

  .dashboard-kpi:nth-child(4) p {
    font-size: 11px;
  }

  .finance-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    max-width: 100%;
  }

  .finance-summary-card {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 98px;
    height: 98px;
    overflow: hidden;
    padding: 12px 11px;
    border-color: #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  .finance-summary-card > div {
    min-width: 0;
    overflow: hidden;
  }

  .finance-summary-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }

  .finance-summary-icon svg,
  .finance-summary-icon[data-finance-icon="wallet"] svg {
    width: 21px;
    height: 21px;
    stroke-width: 2;
  }

  .finance-summary-card p {
    max-width: 100%;
    margin-bottom: 4px;
    overflow: hidden;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.14;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .finance-summary-card strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.12;
    text-overflow: clip;
    white-space: nowrap;
  }

  .finance-summary-card small {
    max-width: 100%;
    margin-top: 5px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .finance-matrix-card {
    gap: 10px;
    padding: 14px 0 0;
    overflow-x: hidden;
    border-radius: 14px;
    border-color: #e2e8f0;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  .finance-matrix-card .documents-panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    column-gap: 8px;
    row-gap: 6px;
    padding: 0 14px;
  }

  .finance-matrix-card .documents-panel-header > div:first-child {
    min-width: 0;
  }

  .finance-matrix-card .documents-panel-header h3 {
    font-size: 20px;
    line-height: 1.12;
  }

  .finance-matrix-card .documents-panel-header p {
    max-width: 260px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.32;
    text-overflow: clip;
    white-space: normal;
  }

  .finance-matrix-actions {
    display: grid;
    gap: 3px;
    justify-items: end;
    margin-top: 0;
    min-width: 0;
  }

  .finance-controls {
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .finance-controls select,
  .finance-controls span {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 11px;
  }

  .finance-controls select {
    width: 128px;
    min-width: 0;
    max-width: 34vw;
  }

  .finance-controls span {
    white-space: nowrap;
  }

  #finance-entry-count {
    font-size: 10px;
    text-align: right;
  }

  .finance-matrix {
    min-width: 0;
    width: 100%;
  }

  .finance-matrix-row {
    grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
    min-height: 43px;
    padding: 0 14px;
  }

  .finance-matrix-head {
    min-height: 34px;
    font-size: 11px;
  }

  .finance-mobile-month-cell {
    display: flex;
    justify-content: flex-end;
  }

  .finance-mobile-month-select {
    min-height: 28px;
    max-width: 96px;
    border: 0;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-weight: 700;
    text-align: right;
  }

  .finance-section-row {
    min-height: 38px;
  }

  .finance-section-row strong {
    padding-left: 0;
    font-size: 13px;
  }

  .finance-value-row {
    font-size: 12px;
  }

  .finance-row-label {
    gap: 8px;
  }

  .finance-row-label-plain {
    padding-left: 38px;
  }

  .finance-row-label strong {
    font-size: 12px;
    line-height: 1.15;
  }

  .finance-row-label small {
    margin-top: 1px;
    font-size: 10px;
  }

  .finance-row-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .finance-row-icon svg {
    width: 18px;
    height: 18px;
  }

  .finance-value-row > span,
  .finance-value-row > b,
  .finance-matrix-head span:last-child {
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
  }

  .finance-value-row > b {
    font-weight: 650;
  }

  .finance-total-row .finance-row-label-plain {
    padding-left: 0;
  }

  .dashboard-charts {
    order: 3;
    display: block;
    margin: 0;
  }

  .distribution-card {
    display: none;
  }

  .monthly-card {
    display: block;
    min-height: 0;
    padding: 16px;
  }

  .dashboard-card-header {
    margin-bottom: 12px;
  }

  .dashboard-card h3,
  .dashboard-card-header h3 {
    font-size: 19px;
    font-weight: 760;
  }

  .dashboard-card-header select {
    min-width: 118px;
    min-height: 38px;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
  }

  .monthly-chart {
    min-height: 190px;
  }

  .monthly-chart svg {
    min-height: 190px;
  }

  .monthly-grid text,
  .monthly-labels text {
    font-size: 13px;
  }

  .monthly-legend {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: center;
    column-gap: 24px;
    row-gap: 12px;
    margin-top: 10px;
    padding-top: 4px;
  }

  .monthly-legend span {
    font-size: 14px;
  }

  .dashboard-lower-charts {
    order: 5;
    display: block;
    margin: 0;
  }

  .dashboard-investment-card {
    display: none;
  }

  .recent-documents-card {
    min-height: 0;
    padding: 22px 16px 10px;
  }

  .mobile-show-all-link {
    display: inline-flex;
    color: #0b66ff;
    font-size: 16px;
    font-weight: 650;
    text-decoration: none;
  }

  .dashboard-recent-list {
    overflow: visible;
    padding-right: 0;
  }

  .dashboard-recent-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    min-height: 92px;
    padding: 14px 0;
  }

  .dashboard-recent-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .dashboard-recent-icon svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .dashboard-recent-icon.document,
  .dashboard-recent-icon.finance {
    background: #dcfce7;
    color: #16a34a;
  }

  .dashboard-recent-icon.insurance {
    background: #dbeafe;
    color: #2563eb;
  }

  .dashboard-recent-icon.contract {
    background: #f3e8ff;
    color: #7c3aed;
  }

  .dashboard-recent-row strong {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
  }

  .dashboard-recent-row p {
    color: #64748b;
    font-size: 14px;
  }

  .dashboard-recent-status {
    display: inline-flex;
    width: fit-content;
    max-width: 150px;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 8px;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 650;
  }

  .dashboard-recent-row > div:last-child {
    align-self: center;
  }

  .dashboard-recent-row b {
    font-size: 16px;
    font-weight: 760;
  }

  .dashboard-recent-analysis {
    display: none !important;
  }

  .dashboard-recent-row em {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    font-style: normal;
    text-align: right;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    min-height: 88px;
    padding: 12px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 0;
    background: #ffffff;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-bottom-nav::before {
    content: "";
    position: absolute;
    top: 15px;
    right: 0;
    left: 0;
    z-index: 0;
    height: 1px;
    background: #e2e8f0;
    pointer-events: none;
  }

  .mobile-bottom-link {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 5px;
    color: #1f2937;
    font-size: 12px;
    font-weight: 520;
    text-decoration: none;
  }

  .mobile-bottom-link svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
  }

  .mobile-bottom-link.active {
    color: #0b66ff;
  }

  .mobile-bottom-scan {
    transform: none;
    color: #0b66ff;
  }

  .mobile-bottom-scan svg {
    width: 62px;
    height: 62px;
    padding: 13px;
    border-radius: 999px;
    background: #0b66ff;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.32);
  }
}

body[data-theme="dark"] {
  background: var(--background);
}

body[data-theme="dark"] .workspace {
  background: var(--background);
}

body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .dashboard-kpi,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .settings-column,
body[data-theme="dark"] .upload-panel,
body[data-theme="dark"] .document-pool,
body[data-theme="dark"] .document-row,
body[data-theme="dark"] .document-pool-item,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .finance-card,
body[data-theme="dark"] .finance-matrix-card,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .mobile-bottom-nav {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

body[data-theme="dark"] .settings-column {
  border-color: var(--border);
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .settings-panel,
body[data-theme="dark"] .settings-backup-card,
body[data-theme="dark"] .settings-plan-summary,
body[data-theme="dark"] .settings-plan-card,
body[data-theme="dark"] .settings-member-box,
body[data-theme="dark"] .settings-summary-box,
body[data-theme="dark"] .settings-info-card,
body[data-theme="dark"] .settings-toggle-row,
body[data-theme="dark"] .settings-lock-button,
body[data-theme="dark"] .dashboard-card-foot,
body[data-theme="dark"] .dashboard-chart-legend,
body[data-theme="dark"] .cabinet-filters,
body[data-theme="dark"] .document-cabinet,
body[data-theme="dark"] .document-tax-export,
body[data-theme="dark"] .document-shredder,
body[data-theme="dark"] .ai-query-bar,
body[data-theme="dark"] .edit-collapsible,
body[data-theme="dark"] .edit-ocr-card,
body[data-theme="dark"] .finance-matrix-actions {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

body[data-theme="dark"] .settings-panel,
body[data-theme="dark"] .settings-backup-card,
body[data-theme="dark"] .settings-plan-summary,
body[data-theme="dark"] .settings-plan-card,
body[data-theme="dark"] .settings-member-box,
body[data-theme="dark"] .settings-summary-box,
body[data-theme="dark"] .settings-info-card,
body[data-theme="dark"] .settings-toggle-row,
body[data-theme="dark"] .settings-lock-button,
body[data-theme="dark"] .settings-consent-note,
body[data-theme="dark"] .settings-lock-flow[data-lock-state="idle"] .settings-lock-note-idle {
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .edit-collapsible summary {
  color: var(--text);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .dashboard-card-header select,
body[data-theme="dark"] .dashboard-card-foot select,
body[data-theme="dark"] .finance-mobile-month-select {
  border-color: var(--border);
  background: #0f172a;
  color: var(--text);
}

body[data-theme="dark"] .document-pool-list,
body[data-theme="dark"] .document-pool-filename input,
body[data-theme="dark"] .document-pool-remove,
body[data-theme="dark"] .document-pool-clear {
  border-color: var(--border);
  background: #0f172a;
  color: var(--text);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] .dashboard-kpi p,
body[data-theme="dark"] .dashboard-kpi strong,
body[data-theme="dark"] .dashboard-card h3,
body[data-theme="dark"] .dashboard-card-header h3,
body[data-theme="dark"] .settings-column > h3,
body[data-theme="dark"] .settings-panel h4,
body[data-theme="dark"] .settings-backup-card h4,
body[data-theme="dark"] .settings-member-box h4,
body[data-theme="dark"] .settings-plan-title,
body[data-theme="dark"] .settings-plan-card-head > strong,
body[data-theme="dark"] .settings-summary-box strong,
body[data-theme="dark"] .settings-toggle-row strong,
body[data-theme="dark"] .document-row h3,
body[data-theme="dark"] .modal-header h2,
body[data-theme="dark"] .finance-matrix-card .documents-panel-header h3 {
  color: var(--text);
}

body[data-theme="dark"] .tax-export-heading h3 {
  color: var(--text);
}

body[data-theme="dark"] .tax-export-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

body[data-theme="dark"] p,
body[data-theme="dark"] small,
body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] .dashboard-kpi small,
body[data-theme="dark"] .dashboard-card-header span,
body[data-theme="dark"] .dashboard-recent-row em,
body[data-theme="dark"] .settings-column > p,
body[data-theme="dark"] .settings-field > span,
body[data-theme="dark"] .settings-toggle-row small,
body[data-theme="dark"] .settings-section-heading span,
body[data-theme="dark"] .settings-consent-note,
body[data-theme="dark"] .settings-plan-card p,
body[data-theme="dark"] .settings-summary-box span,
body[data-theme="dark"] .document-row p,
body[data-theme="dark"] .modal-header p,
body[data-theme="dark"] .finance-matrix-card .documents-panel-header p {
  color: var(--muted);
}

body[data-theme="dark"] .ai-query-mark {
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
}

body[data-theme="dark"] .ai-query-response {
  border-color: var(--border);
  background: var(--surface);
}

body[data-theme="dark"] .ai-query-response[data-status="loading"] {
  background: #111b2e;
}

body[data-theme="dark"] .ai-query-response[data-status="error"] {
  border-color: #7f1d1d;
  background: #291517;
}

body[data-theme="dark"] .ai-query-response-status,
body[data-theme="dark"] .ai-query-response-answer,
body[data-theme="dark"] .ai-query-source-list li > button,
body[data-theme="dark"] .ai-query-source-list li > span {
  color: var(--muted);
}

body[data-theme="dark"] .ai-query-source-list li > button,
body[data-theme="dark"] .ai-query-source-list li > span {
  border-color: var(--border);
  background: #111827;
}

body[data-theme="dark"] .ai-query-field input {
  border: 0;
  background: transparent;
  color: var(--text);
}

body[data-theme="dark"] .settings-version-badge,
body[data-theme="dark"] .settings-pill,
body[data-theme="dark"] .settings-consent-note,
body[data-theme="dark"] .settings-lock-flow[data-lock-state="idle"] .settings-lock-note-idle {
  border-color: #1d4ed8;
  background: rgba(37, 99, 235, 0.14);
  color: #93c5fd !important;
}

body[data-theme="dark"] .settings-version-badge {
  border-color: var(--border);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
}

body[data-theme="dark"] .settings-consent-note,
body[data-theme="dark"] .settings-lock-flow[data-lock-state="idle"] .settings-lock-note-idle {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left-color: #1d4ed8;
}

body[data-theme="dark"] .settings-theme-toggle {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

body[data-theme="dark"] .settings-theme-toggle:hover {
  border-color: transparent;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

body[data-theme="dark"] .settings-theme-toggle .theme-toggle-switch i {
  transform: translateX(16px);
}

body[data-theme="dark"] .settings-switch i,
body[data-theme="dark"] .theme-toggle-switch {
  background: #334155;
}

body[data-theme="dark"] .settings-switch input:checked + i,
body[data-theme="dark"] .theme-toggle-switch {
  background: #2563eb;
}

body[data-theme="dark"] .document-table,
body[data-theme="dark"] .finance-matrix {
  color: var(--text);
}

body[data-theme="dark"] .finance-matrix-row,
body[data-theme="dark"] .document-row {
  border-color: var(--border);
}

body[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(18, 27, 45, 0.96);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .mobile-bottom-nav::before {
  background: var(--border);
}

body[data-theme="dark"] .mobile-bottom-link {
  color: #cbd5e1;
}

body[data-theme="dark"] .mobile-bottom-link.active,
body[data-theme="dark"] .mobile-bottom-scan {
  color: #60a5fa;
}

.score-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.score-page-header,
.score-kpi,
.score-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.score-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.score-page-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

.score-page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.score-page-header .section-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-export-button {
  min-width: 132px;
}

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

.score-kpi {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 106px;
  min-height: 106px;
  overflow: hidden;
  padding: 22px;
}

.score-kpi > div {
  flex: 1 1 auto;
  min-width: 0;
}

.score-kpi-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.score-kpi-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.score-kpi-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.score-kpi-icon.green {
  background: #dcfce7;
  color: #15803d;
}

.score-kpi-icon.orange {
  background: #fef3c7;
  color: #d97706;
}

.score-kpi-icon.mint {
  background: #d1fae5;
  color: #047857;
}

.score-kpi-icon.red {
  background: #fee2e2;
  color: #dc2626;
}

.score-kpi span,
.score-muted-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.08;
}

.score-kpi small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.score-processing-panel {
  width: 100%;
  padding: 24px;
}

.score-processing-panel.is-collapsed > :not(.score-processing-header) {
  display: none;
}

.score-processing-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.score-processing-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.score-processing-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.score-processing-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.score-processing-header label {
  display: grid;
  min-width: 190px;
  gap: 6px;
}

.score-processing-header label span,
.score-processing-summary span,
.score-processing-stage span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-processing-header select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 36px 0 12px;
  font: inherit;
  font-weight: 650;
}

.score-processing-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.score-processing-toggle:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--accent);
}

.score-processing-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.score-processing-panel:not(.is-collapsed) .score-processing-toggle svg {
  transform: rotate(180deg);
}

.score-processing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.score-processing-summary > div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.score-processing-summary strong,
.score-processing-stage strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.score-processing-summary small,
.score-processing-stage small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.score-processing-workers {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.score-processing-workers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.score-processing-workers-header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.score-processing-workers-header strong {
  color: var(--text);
  font-size: 14px;
}

.score-processing-workers-header span {
  color: var(--muted);
  font-size: 12px;
}

.score-processing-workers-header b {
  color: #15803d;
  font-size: 13px;
}

.score-processing-worker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.score-processing-worker {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 7px;
  row-gap: 1px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 11px;
}

.score-processing-worker-dot {
  width: 8px;
  height: 8px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: #22c55e;
}

.score-processing-worker.is-processing .score-processing-worker-dot {
  background: var(--accent);
}

.score-processing-worker strong {
  color: var(--text);
  font-size: 12px;
}

.score-processing-worker small {
  color: var(--muted);
  font-size: 11px;
}

.score-processing-worker-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.score-processing-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.score-processing-stage {
  min-width: 0;
  border-top: 4px solid var(--accent);
  padding: 14px 4px 4px;
}

.score-processing-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-processing-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.score-processing-table th,
.score-processing-table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

.score-processing-table thead th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.score-processing-table tbody th {
  font-weight: 700;
}

.score-processing-table tbody tr:last-child th,
.score-processing-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-processing-privacy,
.score-processing-empty {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.score-processing-empty {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.score-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
  grid-template-areas:
    "review company"
    "combined combined";
  gap: 18px;
  align-items: start;
}

.score-review-panel,
.score-new-company-panel {
  display: flex;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.score-review-panel {
  height: 500px;
}

.score-review-panel {
  grid-area: review;
}

.score-new-company-panel {
  grid-area: company;
  height: min(700px, calc(100vh - 56px));
  min-height: 520px;
}

.score-review-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-word-pool-button,
.score-company-pool-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.score-word-pool-button:hover,
.score-company-pool-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.score-review-panel .score-candidate-table-wrap,
.score-review-panel .score-empty-state,
.score-new-company-panel .score-empty-state {
  flex: 1 1 auto;
  min-height: 0;
}

.score-generate-word-button {
  order: 2;
  width: 100%;
  min-height: 42px;
  flex: 0 0 auto;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  opacity: 1;
}

.score-combined-panel {
  grid-area: combined;
  min-width: 0;
}

.score-panel {
  padding: 20px;
}

.score-panel h3,
.score-panel h4 {
  margin: 0;
  color: var(--text);
}

.score-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.score-count {
  display: inline-flex;
  min-width: 30px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-empty-state {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.score-empty-state.compact {
  min-height: 160px;
}

.score-empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.score-empty-state p {
  max-width: 34ch;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.score-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.score-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.score-assignment-field {
  display: grid;
  gap: 7px;
}

.score-assignment-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-assignment-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.score-assignment-field select:disabled {
  background: var(--surface-muted);
  color: var(--muted);
}

.score-weight-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.score-weight-card .score-panel-header {
  margin-bottom: 12px;
}

.score-weight-card .score-panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-weight-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-weight-row i {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.score-weight-row strong {
  color: var(--text);
  text-align: right;
}

.score-review-list,
.score-candidate-table-wrap {
  min-height: 0;
  overflow-y: auto;
}

.score-candidate-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-candidate-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 13px;
}

.score-candidate-table th,
.score-candidate-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.score-candidate-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score-candidate-table tbody tr {
  cursor: pointer;
}

.score-candidate-table tbody tr:hover,
.score-candidate-table tbody tr.is-selected {
  background: rgba(37, 99, 235, 0.06);
}

.score-candidate-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-candidate-table td:first-child small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.score-candidate-table .score-candidate-action-cell {
  width: 74px;
  padding-right: 8px;
  padding-left: 8px;
  white-space: nowrap;
  text-align: right;
}

.score-candidate-action {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.score-candidate-action + .score-candidate-action {
  margin-left: 4px;
}

.score-candidate-action.reject {
  color: #dc2626;
}

.score-candidate-action.approve {
  color: var(--accent);
}

.score-candidate-action:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.score-candidate-action:not(:disabled):hover {
  border-color: currentColor;
}

.score-candidate-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.score-unimportant-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-company-table-wrap {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-company-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-company-cabinet-header {
  margin-bottom: 12px;
}

.score-company-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.score-company-filters {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.score-company-create-toggle,
.score-company-create-form button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.score-company-create-toggle {
  order: 2;
  width: 100%;
  min-height: 42px;
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 0 12px;
  font-size: inherit;
}

.score-company-pool-panel .score-empty-state {
  flex: 1 1 auto;
  min-height: 0;
}

.score-new-company-list,
.score-company-pool-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-company-create-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.score-company-create-form input,
.score-company-create-form select,
.score-company-category-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-company-create-form input,
.score-company-create-form select {
  min-height: 36px;
  padding: 7px 9px;
}

.score-company-create-form button {
  padding: 7px 12px;
}

.score-company-create-error,
.score-company-inline-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.score-company-inline-error {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.score-company-inline-error strong {
  display: block;
}

.score-company-inline-error p {
  margin: 3px 0 0;
}

.score-company-category-select {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
}

.score-company-groups {
  display: grid;
  min-height: 0;
  align-content: start;
  flex: 1 1 auto;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.score-company-category {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.score-company-category.is-unclassified {
  border-color: #f5d38a;
  background: #fffdf6;
}

.score-company-category-toggle {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.score-company-category-toggle:hover {
  background: var(--surface-muted);
}

.score-company-category-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue);
}

.score-company-category.is-unclassified .score-company-category-icon {
  background: #fff0c9;
  color: #a96500;
}

.score-company-category-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.score-company-category-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.score-company-category-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-company-category-copy small,
.score-company-row-copy span,
.score-company-row-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.score-company-row-copy small {
  color: #2563eb;
}

.score-company-category-chevron {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.score-company-category-content {
  border-top: 1px solid var(--border);
}

.score-company-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.score-company-row:last-child {
  border-bottom: 0;
}

.score-company-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.score-company-row-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-company-row-controls {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  align-items: center;
  justify-content: end;
  min-width: 0;
  gap: 8px;
}

.score-company-row-actions,
.score-company-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.score-company-row-actions button,
.score-company-edit-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.score-company-row-actions button.danger {
  border-color: #fecaca;
  color: #dc2626;
}

.score-company-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 42%);
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.score-company-edit-row input,
.score-company-edit-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-company-edit-row .score-company-create-error,
.score-company-edit-row .score-company-edit-actions,
.score-company-edit-row .score-company-alias-input {
  grid-column: 1 / -1;
}

.score-company-edit-actions .score-company-save-button {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.score-company-row.is-unclassified .score-company-category-select {
  border-color: #e7b95c;
  background: #ffffff;
}

.score-company-category-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.score-company-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 13px;
}

.score-company-table th,
.score-company-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.score-company-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score-company-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-company-table td:nth-child(3) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-rule-company-category-field,
.score-rule-company-pool-note,
.score-rule-semantic-threshold-field,
.score-rule-semantic-note {
  display: none;
}

.score-rule-editor-group[data-group-source="company_pool"] .score-rule-company-category-field {
  display: grid;
}

.score-rule-editor-group[data-group-source="company_pool"] .score-rule-company-pool-note {
  display: block;
}

.score-rule-editor-group[data-group-source="semantic"] .score-rule-semantic-threshold-field {
  display: grid;
}

.score-rule-editor-group[data-group-source="semantic"] .score-rule-semantic-note {
  display: block;
}

.score-rule-semantic-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.score-unimportant-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 13px;
}

.score-unimportant-table th,
.score-unimportant-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.score-unimportant-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score-unimportant-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-unimportant-table td:nth-child(2) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-unimportant-table tr.is-important td:nth-child(2) {
  color: #15803d;
}

.score-unimportant-table .score-unimportant-action-cell {
  width: 42px;
  padding-right: 8px;
  padding-left: 8px;
  text-align: right;
}

.score-restore-word-button {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.score-restore-word-button:hover {
  border-color: rgba(37, 99, 235, 0.55);
  color: var(--accent);
}

.score-restore-word-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.score-rejected-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}

.score-rejected-label.filtered {
  background: var(--surface-muted);
  color: var(--muted);
}

.score-candidate-keyword {
  display: block;
  font-weight: 900;
}

.score-candidate-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-confidence {
  display: inline-flex;
  min-width: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
}

.score-confidence.neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.score-confidence.medium {
  background: #fef3c7;
  color: #b45309;
}

.score-confidence.low {
  background: #fee2e2;
  color: #dc2626;
}

.score-selected-keyword {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.score-selected-keyword h3 {
  margin: 0;
  font-size: 22px;
}

.score-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-source-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.score-source-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.score-proposal-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.score-proposal-card + .score-proposal-card {
  margin-top: 10px;
}

.score-proposal-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-proposal-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
}

.score-rule-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.score-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.score-actions.two-actions {
  grid-template-columns: 1fr 1fr;
}

.score-actions .secondary-action.danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: #dc2626;
}

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

.score-rule {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.score-live-rule {
  align-items: flex-start;
}

.score-active-rules {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.score-panel-header.compact {
  margin-bottom: 10px;
}

.score-detail-modal-card {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, calc(100vw - 56px));
  height: calc(100vh - 56px);
}

.score-word-pool-modal-card,
.score-company-pool-modal-card,
.score-shadow-v2-modal-card {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(900px, calc(100vw - 56px));
  height: min(760px, calc(100vh - 56px));
}

.score-word-pool-modal-card {
  width: min(1220px, calc(100vw - 56px));
  height: calc(100vh - 56px);
}

.score-word-analysis-panel {
  display: grid;
  grid-area: review;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(700px, calc(100vh - 56px));
  min-height: 520px;
  min-width: 0;
  overflow: hidden;
}

.score-word-analysis-panel > .score-panel-header {
  align-items: flex-start;
  margin-bottom: 14px;
}

.score-word-analysis-panel > .score-panel-header > div {
  display: grid;
  gap: 3px;
}

.score-word-analysis-panel > .score-panel-header h2,
.score-word-analysis-panel > .score-panel-header p {
  margin: 0;
}

.score-word-analysis-panel > .score-panel-header h2 {
  font-size: 18px;
}

.score-word-analysis-panel > .score-panel-header p {
  color: var(--muted);
  font-size: 12px;
}

.score-word-pool-modal-card .modal-header,
.score-company-pool-modal-card .modal-header,
.score-shadow-v2-modal-card .modal-header {
  padding: 16px 20px;
}

.score-word-pool-modal-card .modal-header h2,
.score-company-pool-modal-card .modal-header h2,
.score-shadow-v2-modal-card .modal-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-word-pool-modal-body,
.score-company-pool-modal-body,
.score-shadow-v2-modal-body {
  min-height: 0;
  overflow: hidden;
  padding: 16px 20px 18px;
}

.score-shadow-v2-modal-card {
  width: min(1180px, calc(100vw - 56px));
}

.score-shadow-v2-panel {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.score-shadow-v2-note {
  margin: 0;
  color: var(--muted);
}

.score-shadow-v2-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.score-shadow-v2-summary div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
}

.score-shadow-v2-summary span,
.score-shadow-v2-table small {
  color: var(--muted);
  font-size: 12px;
}

.score-shadow-v2-summary strong {
  font-size: 20px;
}

.score-shadow-v2-table-wrap {
  min-height: 0;
  overflow: auto;
}

.score-shadow-v2-table {
  width: 100%;
  border-collapse: collapse;
}

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

.score-shadow-v2-table td strong,
.score-shadow-v2-table td small {
  display: block;
}

.score-shadow-status {
  font-weight: 800;
}

.score-shadow-status.is-matched {
  color: #15803d;
}

.score-shadow-status.is-insufficient_margin,
.score-shadow-status.is-below_threshold {
  color: #b45309;
}

.score-shadow-status.is-not_matched,
.score-shadow-status.is-shadow_error {
  color: var(--danger);
}

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

@media (max-width: 760px) {
  .score-shadow-v2-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-rules-toolbar-actions {
    width: 100%;
    flex-direction: column;
  }
}

.score-word-pool-panel {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
}

.score-word-analysis-header {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.score-word-analysis-header > div {
  display: grid;
  gap: 3px;
}

.score-word-analysis-header strong {
  color: var(--text);
  font-size: 14px;
}

.score-word-analysis-header p,
.score-word-analysis-rule-test-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.score-word-analysis-engine-status {
  color: #52657e;
  font-size: 11px;
  font-weight: 700;
}

.score-word-analysis-engine-status.is-error {
  color: #c82929;
}

.score-word-analysis-header-actions {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px !important;
}

.score-word-analysis-header .score-generate-word-button,
.score-analysis-refresh-button {
  order: initial;
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

.score-analysis-refresh-button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.score-analysis-refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.score-word-analysis-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
}

.score-word-analysis-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.score-word-analysis-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
}

.score-word-analysis-tabs button span {
  display: inline-grid;
  min-width: 21px;
  min-height: 21px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: #e8eef7;
  font-size: 11px;
}

.score-word-analysis-table-wrap {
  flex: 0 0 auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-word-analysis-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.score-word-analysis-table th,
.score-word-analysis-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.score-word-analysis-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.score-word-analysis-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-word-analysis-table td strong,
.score-word-analysis-table td small {
  display: block;
}

.score-word-analysis-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.score-word-analysis-action-cell {
  width: 1%;
  white-space: nowrap;
}

.score-word-analysis-action-cell button,
.score-word-analysis-selector > button,
.score-word-analysis-rule-test-header > button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.score-word-analysis-action-cell button:hover,
.score-word-analysis-selector > button:hover,
.score-word-analysis-rule-test-header > button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.score-word-analysis-action-cell button.primary {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.score-word-analysis-action-cell button.danger {
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

.score-word-analysis-ml-row {
  background: #f5f9ff;
}

.score-word-analysis-empty {
  flex: 1 0 190px;
  min-height: 190px;
}

.score-word-inventory {
  flex: 0 0 auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.score-word-inventory summary {
  display: flex;
  align-items: center;
  min-height: 46px;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.score-word-inventory .score-unimportant-table-wrap {
  max-height: 360px;
  border-top: 1px solid var(--border);
}

.score-word-analysis-comparison {
  display: grid;
  gap: 12px;
}

.score-word-analysis-selector {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.score-word-analysis-selector label {
  display: grid;
  min-width: min(420px, 100%);
  gap: 5px;
}

.score-word-analysis-selector label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-word-analysis-selector select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-word-analysis-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.score-word-analysis-comparison-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.score-word-analysis-comparison-grid article > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-word-analysis-comparison-grid h3 {
  margin: 10px 0 4px;
}

.score-word-analysis-comparison-grid p {
  margin: 0 0 12px;
  color: var(--muted);
}

.score-word-analysis-comparison-grid ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.score-word-analysis-comparison-grid li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.score-word-analysis-comparison-grid li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.score-word-analysis-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #bfd3ff;
  border-radius: 7px;
  background: #eff5ff;
  color: var(--muted);
  font-size: 12px;
}

.score-word-analysis-rule-test {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
}

.score-word-analysis-rule-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.score-word-analysis-rule-test-header > div {
  display: grid;
  gap: 3px;
}

.score-word-pool-toolbar {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.score-word-pool-toolbar .score-generate-word-button {
  order: initial;
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
}

.score-word-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 0 0 auto;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.score-word-create-form input {
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-word-create-form button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: #111111;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.score-word-create-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.score-word-create-form p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.score-company-pool-panel {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

#score-company-pool-modal {
  z-index: 30;
}

.score-company-pool-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.score-company-pool-hint {
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 7px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.score-company-pool-hint strong {
  color: var(--text);
}

.score-company-pool-filter {
  display: grid;
  min-width: min(320px, 100%);
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-company-pool-filter select {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-company-pool-toolbar .score-company-create-toggle {
  order: initial;
  width: auto;
  min-height: 38px;
  margin: 0;
  white-space: nowrap;
}

.score-company-pool-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-company-detection-terms-toggle {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.score-company-detection-terms-toggle[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.score-company-detection-terms {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  max-height: min(440px, 55vh);
  margin: 0 0 12px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.score-company-detection-term-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(190px, auto) auto;
  gap: 8px;
}

.score-company-detection-term-form input,
.score-company-detection-term-form select {
  min-width: 0;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-company-detection-term-form button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: #111111;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.score-company-detection-terms > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.score-company-detection-term-group {
  display: grid;
  gap: 6px;
}

.score-company-detection-term-group > strong {
  color: var(--text);
  font-size: 12px;
}

.score-company-detection-term-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.score-company-detection-term-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.score-company-detection-term-row span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.score-company-detection-term-row button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: var(--surface);
  color: #dc2626;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.score-word-pool-panel .score-unimportant-table-wrap {
  flex: 1 1 auto;
}

.score-detail-modal-card .modal-header {
  padding: 16px 20px;
}

.score-detail-modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 18px;
}

.score-detail-modal-body .score-detail-panel:not([hidden]) {
  margin: 0;
  padding: 0;
  border: 0;
}

.score-detail-modal-body .score-panel-header {
  margin-bottom: 0;
}

.score-detail-modal-body .score-detail-grid {
  gap: 12px;
}

.score-detail-modal-body .score-text-examples {
  margin-top: 18px;
}

.score-detail-modal-body .score-assignment-grid {
  gap: 9px;
  margin-top: 8px;
}

.score-detail-modal-body .score-assignment-field {
  gap: 5px;
}

.score-detail-modal-body .score-assignment-field select {
  min-height: 38px;
}

.score-detail-modal-body .score-source-list {
  margin-top: 7px;
}

.score-detail-modal-body .score-source-card {
  padding: 8px 10px;
}

.score-detail-modal-body .score-weight-card {
  margin-top: 10px;
  padding: 12px;
}

.score-detail-modal-body .score-weight-card .score-panel-header {
  margin-bottom: 8px;
}

.score-detail-modal-body .score-actions {
  margin-top: 12px;
}

.score-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-rules-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.score-rules-toolbar input {
  width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 13px;
  font: inherit;
}

.score-rules-toolbar input:focus {
  border-color: rgba(37, 99, 235, 0.65);
  outline: 3px solid rgba(37, 99, 235, 0.1);
}

.score-rules-toolbar button,
.score-rule-add-group,
.score-rule-add-word {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #111;
  color: #fff;
  padding: 0 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.score-rules-table {
  width: 100%;
  min-width: 1760px;
  border-collapse: collapse;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.score-rules-table th,
.score-rules-table td {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.score-rules-table th:last-child,
.score-rules-table td:last-child {
  border-right: 0;
}

.score-rules-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-rules-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.score-rules-table tbody tr:hover {
  background: var(--surface-muted);
}

.score-rule-row {
  cursor: default;
}

.score-rule-row:hover {
  background: rgba(37, 99, 235, 0.08) !important;
}

.score-rules-table td strong {
  color: var(--text);
  font-weight: 850;
}

.score-rule-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 220px;
}

.score-rule-word-chip {
  min-height: 30px;
  border: 1px solid #d5deeb;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: default;
}

.score-rule-row {
  cursor: pointer;
}

.score-rule-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: -3px;
}

.score-rule-origin {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.score-rule-category-cell {
  min-width: 190px;
}

.score-rule-vector-heading,
.score-rule-vector-cell {
  min-width: 235px;
}

.score-rule-vector-summary {
  display: grid;
  align-content: start;
  gap: 6px;
}

.score-rule-vector-summary > span {
  width: max-content;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.09);
  color: #4338ca;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 900;
}

.score-rule-vector-summary small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.score-rule-vector-empty {
  color: var(--muted);
  text-align: center;
}

.score-rule-vector-heading.score-rule-vector-1,
.score-rule-vector-cell.score-rule-vector-1 {
  background: rgba(219, 234, 254, 0.34);
}

.score-rule-vector-heading.score-rule-vector-2,
.score-rule-vector-cell.score-rule-vector-2 {
  background: rgba(224, 242, 254, 0.34);
}

.score-rule-vector-heading.score-rule-vector-3,
.score-rule-vector-cell.score-rule-vector-3 {
  background: rgba(220, 252, 231, 0.34);
}

.score-rule-vector-heading.score-rule-vector-4,
.score-rule-vector-cell.score-rule-vector-4 {
  background: rgba(254, 243, 199, 0.34);
}

.score-rule-vector-heading.score-rule-vector-5,
.score-rule-vector-cell.score-rule-vector-5 {
  background: rgba(243, 232, 255, 0.34);
}

.score-rule-table-group + .score-rule-table-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.score-rule-table-group-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.score-rule-table-group-label > span {
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 900;
}

.score-rule-table-group-label small {
  color: var(--muted);
  font-size: 10px;
}

.score-attachment-target {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.score-attachment-target span,
.score-attachment-target p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.score-rule-editor {
  display: grid;
  gap: 16px;
}

.score-rule-editor-error {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.score-rule-editor-meta {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.score-rule-editor input,
.score-rule-editor select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 11px;
  font: inherit;
}

.score-rule-target-grid {
  margin-top: 0;
}

.score-rule-finance-subcategory-field {
  grid-column: 2;
}

.score-rule-editor-groups {
  display: grid;
  gap: 12px;
}

.score-rule-editor-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.score-rule-empty-vector {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.72);
  padding: 12px;
  color: var(--muted);
}

.score-rule-empty-vector > span {
  font-size: 12px;
  font-weight: 900;
}

.score-rule-empty-vector > strong {
  color: var(--text);
  font-size: 13px;
}

.score-rule-empty-vector > small {
  font-size: 11px;
}

.score-rule-empty-vector > button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.score-rule-editor-group-head {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(130px, 1fr) repeat(3, minmax(100px, 0.75fr)) 40px 40px;
  align-items: end;
  gap: 9px;
}

.score-rule-editor-group[data-group-collapsed="true"] .score-rule-vector-source,
.score-rule-editor-group[data-group-collapsed="true"] .score-rule-editor-words,
.score-rule-editor-group[data-group-collapsed="true"] .score-rule-add-word {
  display: none;
}

.score-rule-vector-source {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-top: 11px;
}

.score-rule-company-pool-note {
  display: none;
  min-height: 36px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.score-rule-editor-group[data-group-source="company_pool"] .score-rule-company-pool-note {
  display: flex;
}

.score-rule-company-category-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.score-rule-company-view-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.score-rule-company-view-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.score-rule-group-toggle {
  display: inline-flex;
  width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.score-rule-group-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.score-rule-editor-group[data-group-collapsed="false"] .score-rule-group-toggle svg {
  transform: rotate(180deg);
}

.score-rule-editor-words {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.score-rule-editor-word {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
}

.score-rule-candidate-lock {
  display: inline-flex;
  width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #dcfce7;
  color: #15803d;
  font-size: 16px;
  font-weight: 800;
}

.score-rule-remove-control {
  width: 36px;
  min-height: 36px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 20px;
  cursor: pointer;
}

.score-rule-add-word {
  min-height: 34px;
  margin-top: 10px;
  background: #334155;
  font-size: 12px;
}

.score-rule-add-group {
  justify-self: start;
}

.score-rule-extractions {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.score-rule-extractions > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.score-rule-extractions > summary::-webkit-details-marker {
  display: none;
}

.score-rule-extractions > summary span:first-child {
  display: grid;
  gap: 3px;
}

.score-rule-extractions > summary small {
  color: var(--muted);
  font-size: 12px;
}

.score-rule-extraction-count {
  display: inline-flex;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.score-rule-extraction-mode {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(240px, 1fr);
  align-items: end;
  gap: 14px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.score-rule-extraction-mode p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

[data-rule-extraction-settings][hidden] {
  display: none;
}

.score-rule-extraction-list {
  display: grid;
  gap: 10px;
  padding: 0 12px;
}

.score-rule-extraction {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.score-rule-extraction-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 36px;
  align-items: end;
  gap: 10px;
}

.score-rule-checkbox {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.score-rule-editor .score-rule-checkbox input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

.score-rule-extraction-grid,
.score-rule-extraction-date-settings,
.score-rule-extraction-finance {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.score-rule-extraction-date-settings {
  grid-column: span 1;
}

.score-rule-extraction-finance {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.score-rule-add-extraction {
  min-height: 36px;
  margin: 12px;
  background: #334155;
  font-size: 12px;
}

@media (max-width: 900px) {
  .score-word-analysis-comparison-grid {
    grid-template-columns: 1fr;
  }

  .score-rule-editor-meta,
  .score-rule-editor-group-head,
  .score-rule-vector-source,
  .score-rule-editor-words,
  .score-rule-extraction-mode,
  .score-rule-extraction-head,
  .score-rule-extraction-grid,
  .score-rule-extraction-date-settings,
  .score-rule-extraction-finance {
    grid-template-columns: 1fr;
  }

  .score-rule-finance-subcategory-field {
    grid-column: 1;
  }

  .score-rules-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .score-company-pool-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .score-company-pool-toolbar .score-company-create-toggle {
    width: 100%;
  }

  .score-company-pool-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .score-company-detection-terms-toggle {
    width: 100%;
  }

  .score-company-detection-term-form {
    grid-template-columns: 1fr;
  }

  .score-company-detection-term-list {
    grid-template-columns: 1fr;
  }

  .score-rule-company-category-control {
    grid-template-columns: 1fr;
  }

  .score-company-row,
  .score-company-edit-row {
    grid-template-columns: 1fr;
  }

  .score-company-row-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }
}

.score-rule-word-chip:hover,
.score-rule-word-chip:focus-visible {
  border-color: rgba(37, 99, 235, 0.65);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  outline: none;
}

.score-rule-condition {
  display: inline-flex;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.score-table-empty {
  color: var(--muted);
  text-align: center;
}

.score-rule p,
.score-audit-note p,
.score-pipeline-flow p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.score-rule-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
}

.score-rule-icon.success {
  background: #dcfce7;
  color: #15803d;
}

.score-rule-icon.info {
  background: #dbeafe;
  color: #2563eb;
}

.score-rule-icon.danger {
  background: #fee2e2;
  color: #dc2626;
}

.score-rule-icon.purple {
  background: #ede9fe;
  color: #6d28d9;
}

.score-audit-note {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.score-pipeline-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.score-pipeline-flow article {
  min-height: 134px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.score-pipeline-flow span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.score-pipeline-flow strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
}

body[data-theme="dark"] .score-kpi-icon.blue,
body[data-theme="dark"] .score-rule-icon.info {
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
}

body[data-theme="dark"] .score-kpi-icon.green,
body[data-theme="dark"] .score-kpi-icon.mint,
body[data-theme="dark"] .score-rule-icon.success {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

body[data-theme="dark"] .score-kpi-icon.orange {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

body[data-theme="dark"] .score-confidence {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

body[data-theme="dark"] .score-confidence.medium {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

body[data-theme="dark"] .score-confidence.low {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

body[data-theme="dark"] .score-rule-icon.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

body[data-theme="dark"] .score-rule-icon.purple {
  background: rgba(124, 58, 237, 0.18);
  color: #c4b5fd;
}

@media (max-width: 1280px) {
  .score-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "review"
      "company"
      "combined";
  }

  .score-new-company-panel {
    height: 500px;
    min-height: 0;
  }

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

  .score-processing-pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .score-word-analysis-panel {
    height: min(760px, calc(100vh - 32px));
    min-height: 580px;
  }

  .score-word-analysis-header,
  .score-word-analysis-selector,
  .score-word-analysis-rule-test-header {
    align-items: stretch;
    flex-direction: column;
  }

  .score-word-analysis-header .score-generate-word-button,
  .score-analysis-refresh-button,
  .score-word-analysis-selector > button,
  .score-word-analysis-rule-test-header > button {
    width: 100%;
  }

  .score-word-analysis-header-actions {
    width: 100%;
    grid-auto-flow: row;
    flex-direction: column;
  }

  .score-word-analysis-tabs {
    grid-template-columns: 1fr;
  }

  .score-word-analysis-selector label {
    min-width: 0;
  }

  .score-page-header,
  .score-kpi,
  .score-panel {
    padding: 16px;
  }

  .score-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-processing-header {
    align-items: stretch;
    flex-direction: column;
  }

  .score-processing-header label {
    min-width: 0;
  }

  .score-processing-actions {
    align-items: flex-end;
  }

  .score-processing-actions label {
    flex: 1;
  }

  .score-kpi-grid,
  .score-detail-grid,
  .score-actions,
  .score-pipeline-flow,
  .score-processing-summary,
  .score-processing-pipeline {
    grid-template-columns: 1fr;
  }

  .score-word-pool-toolbar .score-generate-word-button {
    width: 100%;
  }

  .score-word-create-form {
    grid-template-columns: 1fr;
  }

  .score-word-create-form p {
    grid-column: auto;
  }
}
.score-keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.score-keyword-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #17233a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* A selected pool entry stays visible across the full table row while scrolling. */
body[data-auth="signed-in"] #documents .document-row.is-pool-selected {
  background: #eef5ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

@media (max-width: 1024px) {
  body[data-auth="signed-in"] #documents .document-table,
  body[data-auth="signed-in"] #documents .document-table-head,
  body[data-auth="signed-in"] #documents .document-row {
    width: 1556px;
    min-width: 1556px;
  }
}

/* Oeffentliche Startseite: bleibt vollstaendig vom angemeldeten Arbeitsbereich getrennt. */
body[data-auth="signed-out"] {
  overflow: hidden;
  background: #f3f6fa;
}

body[data-auth="signed-out"] .app-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

body[data-auth="signed-out"] .topbar {
  display: none;
}

body[data-auth="signed-out"] .sidebar {
  display: flex;
}

body[data-auth="signed-out"] .nav-link[aria-disabled="true"] {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.62;
}

body[data-auth="signed-out"] .nav-link.active[aria-disabled="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--sidebar-muted);
}

body[data-auth="signed-out"] .workspace {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #f3f6fa;
}

body[data-auth="signed-out"] .auth-panel {
  width: 100%;
  max-width: none;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.landing-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 400px);
  min-height: 100%;
  color: #142038;
  background: #ffffff;
}

.landing-page[data-auth-column="closed"] {
  grid-template-columns: minmax(0, 1fr);
}

.landing-page[data-auth-column="closed"] .landing-auth-column {
  display: none;
}

.landing-content {
  min-width: 0;
  background:
    radial-gradient(circle at 82% 12%, rgba(37, 99, 235, 0.11), transparent 25%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 45%, #ffffff 100%);
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 76px;
  padding: 16px 28px;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

.landing-nav {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 32px);
  transform: translateX(-50%);
}

.landing-nav a,
.landing-nav-item {
  color: #3d4c63;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.landing-nav a:hover,
.landing-nav a:focus-visible {
  color: #1d5fe9;
}

.landing-login-link {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  min-width: 154px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d7e1ee;
  border-radius: 9px;
  background: #ffffff;
  color: #243249;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(29, 52, 83, 0.07);
  margin-left: auto;
  cursor: pointer;
}

.landing-login-link:hover,
.landing-login-link:focus-visible {
  border-color: #b8c8dd;
  color: #1d5fe9;
}

.landing-login-link svg {
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.landing-main {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: max(760px, calc(100vh - 80px));
  padding: 108px 0 174px;
  overflow: visible;
  scroll-margin-top: 76px;
}

.landing-hero::after {
  display: none;
}

.landing-hero-copy {
  position: relative;
  z-index: 1;
  width: min(58%, 490px);
  margin-left: clamp(22px, 2.4vw, 38px);
}

.landing-kicker {
  margin: 0 0 14px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 760px;
  margin: 0;
  color: #101b31;
  font-size: clamp(44px, 3.5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.landing-hero-copy > p:not(.landing-kicker) {
  max-width: 670px;
  margin: 26px 0 0;
  color: #607087;
  font-size: clamp(17px, 1.55vw, 20px);
  line-height: 1.65;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.landing-primary-button,
.landing-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.landing-primary-button {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
  cursor: pointer;
}

.landing-primary-button:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.landing-secondary-link {
  border: 1px solid #d6e0ed;
  background: rgba(255, 255, 255, 0.78);
  color: #23324a;
}

.landing-trust-list {
  position: absolute;
  z-index: 1;
  right: clamp(22px, 2.4vw, 38px);
  bottom: 28px;
  left: clamp(22px, 2.4vw, 38px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  color: #586a82;
  list-style: none;
}

.landing-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(217, 227, 240, 0.84);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}

.landing-trust-list svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #2563eb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.landing-trust-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.landing-trust-list strong {
  color: #26364d;
  font-size: 12px;
  line-height: 1.25;
}

.landing-trust-list small {
  color: #687990;
  font-size: 10px;
  line-height: 1.4;
}

.landing-trust-list li::before {
  display: none;
  color: #2563eb;
}

.landing-hero-visual {
  position: absolute;
  z-index: -2;
  inset: -80px 0 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7faff;
  box-shadow: none;
}

.landing-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% center;
}

.landing-hero-visual picture {
  display: block;
  width: 100%;
  height: 100%;
}

.landing-hero-visual figcaption {
  display: none;
}

.landing-flow-card {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid #dce6f2;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(32, 55, 90, 0.13);
}

.landing-flow-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e7edf5;
}

.landing-flow-head img {
  width: 42px;
  height: 42px;
}

.landing-flow-head div {
  display: grid;
  gap: 4px;
}

.landing-flow-head strong {
  font-size: 17px;
}

.landing-flow-head span,
.landing-flow-steps small {
  color: #718097;
}

.landing-flow-steps {
  display: grid;
  gap: 2px;
  padding-top: 16px;
}

.landing-flow-steps article {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 10px 8px;
}

.landing-flow-steps article:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 26px;
  width: 1px;
  height: 14px;
  background: #bfd2f4;
}

.landing-flow-steps article > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e9f1ff;
  color: #2563eb;
  font-weight: 800;
}

.landing-flow-steps article div {
  display: grid;
  gap: 3px;
}

.landing-section {
  margin: 0;
  padding: 94px clamp(22px, 2.4vw, 38px);
  border-top: 0;
  scroll-margin-top: 76px;
}

.landing-section-heading {
  max-width: 680px;
  margin-bottom: 42px;
}

.landing-section-heading h2 {
  margin: 0;
  color: #101b31;
  font-size: clamp(32px, 3.7vw, 48px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.landing-section-heading > p:last-child {
  margin: 18px 0 0;
  color: #687990;
  font-size: 17px;
  line-height: 1.65;
}

.landing-features-editorial {
  padding: 0;
  border-top: 0;
  scroll-margin-top: 0;
}

.landing-feature-manifesto {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  min-height: 690px;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 70% 12%, rgba(255, 255, 255, 0.96), transparent 34%),
    radial-gradient(circle at 16% 24%, rgba(219, 234, 254, 0.88), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 48%, #ffffff 100%);
  box-shadow: none;
}

.landing-feature-manifesto::before {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(73, 112, 166, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 112, 166, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
  content: "";
}

.landing-feature-manifesto-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: clamp(44px, 5vw, 82px) 0 clamp(44px, 5vw, 82px) clamp(36px, 5vw, 88px);
}

.landing-feature-manifesto h2 {
  max-width: 620px;
  margin: 14px 0 24px;
  color: #101b31;
  font-size: clamp(48px, 5vw, 76px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.landing-feature-manifesto-copy > p:last-of-type {
  max-width: 590px;
  margin: 0;
  color: #5d6f88;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.65;
}

.landing-feature-ecosystem {
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-width: 0;
  height: 690px;
  margin: 0;
  overflow: hidden;
}

.landing-feature-ecosystem img {
  position: absolute;
  right: 3%;
  bottom: 4%;
  display: block;
  width: 94%;
  height: auto;
  max-width: none;
  filter: drop-shadow(0 30px 30px rgba(28, 47, 78, 0.15));
}

.landing-feature-chapter {
  display: block;
  min-height: 0;
  padding: 44px clamp(28px, 4vw, 72px);
}

.landing-feature-chapter-finance {
  border-top: 0;
}

.landing-feature-photo {
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.98), transparent 48%),
    linear-gradient(145deg, #f7faff 0%, #eaf2fd 100%);
  box-shadow: 0 28px 80px rgba(30, 55, 90, 0.14);
}

.landing-feature-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-feature-photo-scan img {
  object-position: center;
}

.landing-feature-photo-family img {
  object-position: center;
}

.landing-feature-chapter-copy {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(42px, 6vw, 96px);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.landing-feature-overline {
  grid-column: 1;
  grid-row: 1;
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-feature-chapter h3 {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: #101b31;
  font-size: clamp(36px, 3.2vw, 50px);
  letter-spacing: -0.052em;
  line-height: 1.02;
}

.landing-feature-lead {
  grid-column: 1;
  grid-row: 3;
  max-width: 650px;
  margin: 18px 0 0;
  color: #60728b;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.65;
}

.landing-feature-lines {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: start;
  margin: 0;
  padding: 0;
  color: #101b31;
  list-style: none;
}

.landing-feature-lines li {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
  gap: 26px;
  padding: 16px 0;
  border-top: 1px solid #dce5f0;
}

.landing-feature-lines strong {
  font-size: 16px;
  letter-spacing: -0.015em;
}

.landing-feature-lines span {
  color: #687990;
  font-size: 14px;
  line-height: 1.6;
}

@media (min-width: 901px) {
  .landing-feature-chapter {
    padding-right: clamp(36px, 5vw, 88px);
    padding-left: clamp(36px, 5vw, 88px);
  }

  .landing-feature-chapter-copy {
    max-width: none;
    margin: 0;
  }

  .landing-feature-chapter-document .landing-feature-chapter-copy {
    grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  }

  .landing-feature-chapter-document .landing-feature-overline,
  .landing-feature-chapter-document h3,
  .landing-feature-chapter-document .landing-feature-lead {
    grid-column: 2;
  }

  .landing-feature-chapter-document .landing-feature-lines {
    grid-column: 1;
  }
}

.landing-pricing {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 94px clamp(24px, 3vw, 52px);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 88% 17%, rgba(191, 219, 254, 0.48), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f7faff 62%, #eef5ff 100%);
  box-shadow: none;
}

.landing-pricing::before,
.landing-pricing::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.06);
  content: "";
  pointer-events: none;
}

.landing-pricing::before {
  top: 90px;
  right: -90px;
  width: 310px;
  height: 310px;
}

.landing-pricing::after {
  right: 180px;
  bottom: 160px;
  width: 120px;
  height: 120px;
}

.landing-pricing-heading {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto 54px;
  text-align: center;
}

.landing-pricing-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: stretch;
}

.landing-price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 520px;
  padding: 30px;
  border: 1px solid #dfe7f1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 44px rgba(30, 55, 90, 0.08);
}

.landing-price-card.is-featured {
  border-color: #2563eb;
  box-shadow: 0 22px 54px rgba(37, 99, 235, 0.16);
  transform: translateY(-12px);
}

.landing-price-badge {
  position: absolute;
  top: -15px;
  right: 22px;
  padding: 7px 13px;
  border-radius: 8px 8px 4px 4px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.landing-price-card-heading {
  min-height: 96px;
}

.landing-price-card h3 {
  margin: 0 0 10px;
  color: #101b31;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.landing-price-card-heading p {
  margin: 0;
  color: #687990;
  line-height: 1.5;
}

.landing-price-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 24px 0 26px;
}

.landing-price-amount strong {
  color: #101b31;
  font-size: clamp(30px, 2.35vw, 40px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.landing-price-card.is-featured .landing-price-amount strong {
  color: #2563eb;
}

.landing-price-amount span {
  color: #687990;
  font-size: 13px;
  font-weight: 700;
}

.landing-price-card ul {
  display: grid;
  gap: 13px;
  margin: 0 0 28px;
  padding: 0;
  color: #44546a;
  list-style: none;
}

.landing-price-card li {
  position: relative;
  padding-left: 25px;
  font-size: 14px;
  line-height: 1.45;
}

.landing-price-card li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #2563eb;
  font-size: 16px;
  font-weight: 900;
  content: "✓";
}

.landing-price-card > button {
  width: 100%;
  margin-top: auto;
  cursor: pointer;
}

.landing-auth-column {
  position: sticky;
  top: 0;
  display: grid;
  align-items: start;
  height: 100vh;
  padding: 38px 34px 32px;
  overflow-y: auto;
  border-left: 1px solid #dfe6ef;
  background: #ffffff;
}

.landing-auth-column .auth-card {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.landing-auth-column .auth-card h2 {
  margin: 0;
  color: #101b31;
  font-size: 27px;
  letter-spacing: -0.025em;
}

.landing-auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.landing-auth-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #63738a;
  cursor: pointer;
}

.landing-auth-close:hover,
.landing-auth-close:focus-visible {
  background: #f1f5fa;
  color: #1f2d42;
}

.landing-auth-close svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.landing-auth-intro {
  margin-top: 24px;
}

.landing-auth-intro p {
  margin: 0;
  color: #6b7a90;
  font-size: 15px;
  line-height: 1.55;
}

.landing-auth-intro p + p {
  margin-top: 2px;
}

.landing-auth-column .auth-tabs {
  gap: 0;
  margin-top: 38px;
  padding: 0;
  overflow: hidden;
  border-color: #e2e8f1;
  border-radius: 10px;
  background: #f4f6fa;
}

.landing-auth-column .tab {
  min-height: 50px;
  border-radius: 0;
  font-size: 15px;
  font-weight: 650;
}

.landing-auth-column .tab.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: inset 0 -2px #2563eb;
}

.landing-auth-column .form-stack {
  gap: 24px;
  margin-top: 38px;
}

.landing-auth-column label {
  gap: 10px;
  font-size: 14px;
}

.landing-auth-column input,
.landing-auth-column select {
  min-height: 54px;
  padding: 11px 14px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
  color: #101b31;
  font-size: 15px;
}

.landing-auth-column input::placeholder {
  color: #a6b1c1;
}

.landing-auth-column .primary-action {
  min-height: 52px;
  margin-top: 14px;
  border-radius: 9px;
  font-size: 16px;
}

.landing-auth-column .form-message {
  margin-top: -10px;
}

.landing-auth-security {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 28px;
  border-top: 1px solid #e7ecf3;
  color: #6b7a90;
}

.landing-auth-security > svg {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.landing-auth-security div {
  display: grid;
  gap: 3px;
}

.landing-auth-security strong {
  color: #27364c;
  font-size: 13px;
}

.landing-auth-security span {
  font-size: 11px;
  line-height: 1.4;
}

@media (min-width: 1600px) {
  .landing-header {
    min-height: 88px;
    padding: 18px clamp(36px, 2.5vw, 64px);
  }

  .landing-nav {
    gap: clamp(34px, 3.2vw, 72px);
  }

  .landing-nav a,
  .landing-nav-item {
    font-size: 16px;
  }

  .landing-login-link {
    min-width: 176px;
    min-height: 54px;
    font-size: 16px;
  }

  .landing-hero {
    min-height: max(840px, calc(100vh - 88px));
    padding: clamp(130px, 12vh, 190px) 0 clamp(190px, 21vh, 300px);
  }

  .landing-hero-visual {
    inset: -90px 0 0;
  }

  .landing-hero-copy {
    width: min(45%, 660px);
    margin-left: clamp(46px, 3.2vw, 82px);
  }

  .landing-hero h1 {
    font-size: clamp(60px, 3.1vw, 76px);
  }

  .landing-hero-copy > p:not(.landing-kicker) {
    max-width: 640px;
    font-size: clamp(20px, 1.2vw, 25px);
  }

  .landing-primary-button,
  .landing-secondary-link {
    min-height: 58px;
    padding: 0 28px;
    font-size: 17px;
  }

  .landing-trust-list {
    right: auto;
    bottom: 42px;
    left: clamp(46px, 3.2vw, 82px);
    width: min(43%, 800px);
    gap: 0;
    padding: 12px 8px;
    border: 1px solid rgba(217, 227, 240, 0.88);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(32, 55, 90, 0.1);
    backdrop-filter: blur(12px);
  }

  .landing-trust-list li {
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .landing-trust-list li + li {
    border-left: 1px solid #dde6f1;
  }

  .landing-feature-chapter {
    padding: 68px clamp(54px, 4.5vw, 96px);
  }

  .landing-feature-chapter-copy {
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    column-gap: clamp(76px, 6vw, 132px);
    max-width: none;
  }

  .landing-feature-chapter-document .landing-feature-chapter-copy {
    grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  }

  .landing-feature-overline {
    margin-bottom: 16px;
    font-size: 15px;
  }

  .landing-feature-chapter h3 {
    font-size: clamp(60px, 3.65vw, 78px);
    line-height: 0.98;
  }

  .landing-feature-lead {
    max-width: 760px;
    margin-top: 26px;
    font-size: clamp(22px, 1.3vw, 27px);
    line-height: 1.58;
  }

  .landing-feature-lines li {
    grid-template-columns: minmax(235px, 0.42fr) minmax(0, 1fr);
    gap: 34px;
    padding: 24px 0;
  }

  .landing-feature-lines strong {
    font-size: 20px;
  }

  .landing-feature-lines span {
    font-size: 18px;
    line-height: 1.55;
  }
}

@media (max-width: 1320px) {
  .landing-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .landing-nav {
    position: static;
    justify-self: center;
    transform: none;
  }

  .landing-page {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .landing-hero {
    padding-top: 82px;
  }

  .landing-hero-visual {
    max-width: none;
  }

}

@media (max-width: 900px) {
  body[data-auth="signed-out"] {
    overflow: auto;
  }

  body[data-auth="signed-out"] .app-shell,
  body[data-auth="signed-out"] .workspace,
  body[data-auth="signed-out"] .auth-panel {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-auth="signed-out"] .app-shell {
    display: block;
  }

  body[data-auth="signed-out"] .sidebar {
    display: none;
  }

  .landing-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
  }

  .landing-features-editorial {
    scroll-margin-top: 76px;
  }

  .landing-hero {
    display: grid;
    gap: 42px;
    min-height: 0;
    padding: 72px 0;
    overflow: visible;
  }

  .landing-hero::after {
    display: none;
  }

  .landing-hero-copy {
    width: 100%;
    max-width: 680px;
    margin-left: clamp(22px, 4vw, 38px);
  }

  .landing-trust-list {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-right: clamp(22px, 4vw, 38px);
    margin-left: clamp(22px, 4vw, 38px);
  }

  .landing-hero-visual {
    position: relative;
    z-index: auto;
    inset: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid #dce6f2;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(32, 55, 90, 0.13);
  }

  .landing-auth-column {
    position: relative;
    height: auto;
    min-height: 680px;
    padding: 72px clamp(24px, 8vw, 72px);
    border-top: 1px solid #dfe6ef;
    border-left: 0;
  }

  .landing-auth-column .auth-card {
    max-width: 520px;
  }

  .landing-pricing-grid {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .landing-feature-manifesto {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .landing-feature-manifesto-copy {
    padding: 64px clamp(28px, 8vw, 72px) 12px;
  }

  .landing-feature-ecosystem {
    width: min(900px, 100%);
    height: 480px;
    margin: 0 auto;
  }

  .landing-feature-ecosystem img {
    right: 5%;
    width: 90%;
  }

  .landing-feature-chapter,
  .landing-feature-chapter-finance {
    grid-template-columns: 1fr;
    gap: 54px;
    min-height: 0;
    padding: 78px clamp(28px, 8vw, 72px);
  }

  .landing-feature-chapter-finance .landing-feature-chapter-copy {
    order: 2;
  }

  .landing-feature-chapter-finance .landing-feature-photo {
    order: 1;
  }

  .landing-feature-chapter-copy {
    display: block;
    max-width: 760px;
    margin: 0;
  }

  .landing-price-card {
    min-height: 0;
  }

  .landing-price-card.is-featured {
    transform: none;
  }

}

@media (orientation: landscape) and (min-width: 761px) and (max-width: 1024px) and (max-height: 680px) {
  body[data-auth="signed-in"] #documents.view.active {
    gap: 14px;
  }

  body[data-auth="signed-in"] #documents .documents-upload-workspace {
    grid-template-columns: minmax(310px, 0.85fr) minmax(0, 1.45fr);
    gap: 14px;
    width: 100%;
    max-width: 100%;
    align-items: stretch;
  }

  body[data-auth="signed-in"] #documents .documents-upload-workspace .upload-panel {
    order: 2;
    min-width: 0;
    padding: 16px 18px;
  }

  body[data-auth="signed-in"] #documents .documents-upload-workspace .document-pool {
    order: 1;
    grid-template-rows: auto 82px auto auto auto;
    min-width: 0;
    gap: 8px;
    padding: 16px;
  }

  body[data-auth="signed-in"] #documents .upload-heading {
    align-items: center;
  }

  body[data-auth="signed-in"] #documents .upload-heading h2 {
    margin: 0;
    font-size: 20px;
  }

  body[data-auth="signed-in"] #documents .manual-booking-button {
    min-height: 42px;
    padding: 0 16px;
    font-size: 13px;
  }

  body[data-auth="signed-in"] #documents .dropzone {
    min-height: 190px;
    padding: 20px 16px;
  }

  body[data-auth="signed-in"] #documents .document-pool-header {
    gap: 8px;
  }

  body[data-auth="signed-in"] #documents .document-pool-header h2 {
    font-size: 18px;
  }

  body[data-auth="signed-in"] #documents .document-pool-header p,
  body[data-auth="signed-in"] #documents .document-pool-list p,
  body[data-auth="signed-in"] #documents .document-pool-filename span {
    font-size: 12px;
  }

  body[data-auth="signed-in"] #documents .document-pool-count {
    padding: 6px 8px;
    font-size: 11px;
  }

  body[data-auth="signed-in"] #documents .document-pool-clear {
    width: 30px;
    height: 30px;
  }

  body[data-auth="signed-in"] #documents .document-pool-list {
    height: 82px;
    min-height: 82px;
    max-height: 82px;
    padding: 10px;
  }

  body[data-auth="signed-in"] #documents .document-pool-filename {
    gap: 5px;
  }

  body[data-auth="signed-in"] #documents .document-pool-filename input {
    min-height: 36px;
    font-size: 12px;
  }

  body[data-auth="signed-in"] #documents .document-pool-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body[data-auth="signed-in"] #documents .document-pool-create,
  body[data-auth="signed-in"] #documents .document-pool-folder-create,
  body[data-auth="signed-in"] #documents .document-pool-ai-letter {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    font-size: 11px;
  }

  body[data-auth="signed-in"] #documents .document-pool-ai-letter {
    grid-column: 1 / -1;
  }
}

@media (orientation: landscape) and (max-width: 1024px) and (max-height: 680px) {
  body[data-auth="signed-in"] .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  body[data-auth="signed-in"] .sidebar {
    display: none;
  }

  body[data-auth="signed-in"] .workspace {
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px calc(18px + env(safe-area-inset-right)) 18px calc(18px + env(safe-area-inset-left));
    scrollbar-gutter: auto;
  }

  body[data-auth="signed-out"] {
    overflow: auto;
  }

  body[data-auth="signed-out"] .app-shell,
  body[data-auth="signed-out"] .workspace,
  body[data-auth="signed-out"] .auth-panel {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-auth="signed-out"] .app-shell {
    display: block;
  }

  body[data-auth="signed-out"] .sidebar {
    display: none;
  }

  body[data-auth="signed-out"] .landing-nav {
    display: none;
  }

  body[data-auth="signed-out"] .landing-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 10;
    min-height: 0;
    height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
  }

  body[data-auth="signed-out"] .landing-login-link {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top));
    right: calc(18px + env(safe-area-inset-right));
    display: inline-grid;
    grid-template-columns: 1fr;
    place-items: center;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    pointer-events: auto;
  }

  body[data-auth="signed-out"] .landing-login-link > span,
  body[data-auth="signed-out"] .landing-login-chevron {
    display: none;
  }

  body[data-auth="signed-out"] .landing-login-user-icon {
    width: 21px;
    height: 21px;
  }

  body[data-auth="signed-out"] .landing-hero {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: max(430px, calc(100svh + env(safe-area-inset-top)));
    margin-top: calc(-1 * env(safe-area-inset-top));
    padding: calc(44px + env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) 20px calc(22px + env(safe-area-inset-left));
    overflow: hidden;
  }

  body[data-auth="signed-out"] .landing-hero-copy {
    display: flex;
    flex-direction: column;
    width: min(56%, 520px);
    max-width: 520px;
    margin-left: 0;
  }

  body[data-auth="signed-out"] .landing-hero h1 {
    font-size: clamp(36px, 5.2vw, 48px);
  }

  body[data-auth="signed-out"] .landing-hero-copy > p:not(.landing-kicker) {
    max-width: 500px;
    margin-top: 16px;
    font-size: clamp(13px, 1.7vw, 16px);
    line-height: 1.45;
  }

  body[data-auth="signed-out"] .landing-hero-actions {
    flex-wrap: nowrap;
    margin-top: auto;
    padding-top: 16px;
  }

  body[data-auth="signed-out"] .landing-primary-button,
  body[data-auth="signed-out"] .landing-secondary-link {
    flex: 1 1 0;
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
    white-space: nowrap;
  }

  body[data-auth="signed-out"] .landing-trust-list {
    display: none;
  }

  body[data-auth="signed-out"] .landing-hero-visual {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: #edf3ff;
    box-shadow: none;
  }

  body[data-auth="signed-out"] .landing-hero-visual img {
    transform: scale(1.04);
    transform-origin: center;
    object-position: 52% center;
  }

  body[data-auth="signed-out"] .landing-features-editorial {
    min-height: max(430px, 100svh);
    padding: 0;
    scroll-margin-top: 0;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    min-height: max(430px, 100svh);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto-copy {
    align-self: center;
    padding: 34px 0 24px 22px;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto h2 {
    margin: 8px 0 14px;
    font-size: clamp(32px, 4.4vw, 42px);
  }

  body[data-auth="signed-out"] .landing-feature-manifesto-copy > p:last-of-type {
    font-size: 14px;
    line-height: 1.45;
  }

  body[data-auth="signed-out"] .landing-feature-ecosystem {
    height: max(430px, 100svh);
  }

  body[data-auth="signed-out"] .landing-feature-ecosystem img {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }

  body[data-auth="signed-out"] .landing-feature-chapter-document {
    grid-template-columns: 1fr;
  }

  body[data-auth="signed-out"] .landing-feature-chapter-finance {
    grid-template-columns: 1fr;
  }

  body[data-auth="signed-out"] .landing-feature-chapter-document .landing-feature-photo,
  body[data-auth="signed-out"] .landing-feature-chapter-finance .landing-feature-photo {
    display: none;
  }

  body[data-auth="signed-out"] .landing-feature-chapter-document,
  body[data-auth="signed-out"] .landing-feature-chapter-finance {
    display: block;
    min-height: 0;
    padding: 24px;
  }

  body[data-auth="signed-out"] .landing-feature-chapter-copy {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 18px;
    width: 100%;
    max-width: none;
    min-height: 0;
  }

  body[data-auth="signed-out"] .landing-feature-overline {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 10px;
    font-size: 11px;
  }

  body[data-auth="signed-out"] .landing-feature-chapter h3 {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(33px, 4vw, 38px);
    line-height: 0.98;
  }

  body[data-auth="signed-out"] .landing-feature-lead {
    grid-column: 1;
    grid-row: 3;
    margin: 18px 0 0;
    font-size: 14px;
    line-height: 1.45;
  }

  body[data-auth="signed-out"] .landing-feature-lines {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: start;
  }

  body[data-auth="signed-out"] .landing-feature-lines li {
    grid-template-columns: minmax(155px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    padding: 13px 0;
  }

  body[data-auth="signed-out"] .landing-feature-lines strong {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.25;
  }

  body[data-auth="signed-out"] .landing-feature-lines span {
    font-size: 12px;
    line-height: 1.4;
  }

  body[data-auth="signed-out"] .landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    max-width: none;
    min-height: 0;
    padding: 12px 0 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  body[data-auth="signed-out"] .landing-pricing {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: max(430px, 100svh);
    min-height: max(430px, 100svh);
    padding: 14px 20px 12px;
    overflow: hidden;
  }

  body[data-auth="signed-out"] .landing-pricing-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.75fr);
    grid-template-rows: auto auto;
    column-gap: 22px;
    max-width: none;
    margin: 0;
    padding-right: 58px;
    text-align: left;
  }

  body[data-auth="signed-out"] .landing-pricing-heading .landing-kicker {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 2px;
    font-size: 9px;
  }

  body[data-auth="signed-out"] .landing-pricing-heading h2 {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(25px, 3.2vw, 30px);
    line-height: 1;
  }

  body[data-auth="signed-out"] .landing-pricing-heading > p:last-child {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
  }

  body[data-auth="signed-out"] .landing-price-card {
    align-self: stretch;
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 13px 15px 11px;
    border-radius: 13px;
  }

  body[data-auth="signed-out"] .landing-price-card.is-featured {
    transform: none;
  }

  body[data-auth="signed-out"] .landing-price-card-heading {
    min-height: 42px;
  }

  body[data-auth="signed-out"] .landing-price-card h3 {
    margin-bottom: 3px;
    font-size: 18px;
  }

  body[data-auth="signed-out"] .landing-price-card-heading p {
    font-size: 10px;
    line-height: 1.25;
  }

  body[data-auth="signed-out"] .landing-price-amount {
    gap: 5px;
    margin: 7px 0 9px;
  }

  body[data-auth="signed-out"] .landing-price-amount strong {
    font-size: 24px;
  }

  body[data-auth="signed-out"] .landing-price-amount span {
    font-size: 10px;
  }

  body[data-auth="signed-out"] .landing-price-card ul {
    gap: 3px;
    margin-bottom: 7px;
  }

  body[data-auth="signed-out"] .landing-price-card li {
    padding-left: 16px;
    font-size: 10.5px;
    line-height: 1.22;
  }

  body[data-auth="signed-out"] .landing-price-card li::before {
    font-size: 11px;
  }

  body[data-auth="signed-out"] .landing-price-card > button {
    flex: 0 0 34px;
    height: 34px;
    max-height: 34px;
    min-height: 34px;
    margin-top: auto;
    padding: 0 10px;
    font-size: 11px;
  }

  body[data-auth="signed-out"] .landing-price-badge {
    top: -9px;
    right: 12px;
    padding: 4px 9px;
    font-size: 9px;
  }
}

@media (max-width: 680px) {
  .landing-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px;
  }

  .landing-nav {
    position: static;
    width: 100%;
    gap: 22px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    transform: none;
  }

  .landing-nav::-webkit-scrollbar {
    display: none;
  }

  .landing-login-link {
    width: 100%;
    max-width: 220px;
  }

  body[data-auth="signed-out"] .landing-nav {
    display: none;
  }

  body[data-auth="signed-out"] .landing-header {
    position: absolute;
    inset: 0 0 auto;
    min-height: 0;
    height: 0;
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
  }

  body[data-auth="signed-out"] .landing-login-link {
    position: absolute;
    top: 18px;
    right: 20px;
    display: inline-grid;
    grid-template-columns: 1fr;
    place-items: center;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 50%;
    pointer-events: auto;
  }

  body[data-auth="signed-out"] .landing-login-link > span,
  body[data-auth="signed-out"] .landing-login-chevron {
    display: none;
  }

  body[data-auth="signed-out"] .landing-login-user-icon {
    width: 23px;
    height: 23px;
  }

  body[data-auth="signed-out"] .landing-hero-visual img {
    transform: scale(1.14);
    transform-origin: 51.5% top;
  }

  body[data-auth="signed-out"] .landing-hero {
    position: relative;
    align-items: stretch;
    min-height: max(740px, calc(100svh + 24px + env(safe-area-inset-top)));
    margin-top: calc(-1 * env(safe-area-inset-top));
    margin-right: -20px;
    margin-left: -20px;
    padding-top: calc(44px + env(safe-area-inset-top));
    padding-right: 20px;
    padding-bottom: 34px;
    padding-left: 20px;
    overflow: hidden;
  }

  /* Capacitor already exposes a viewport below the iOS status area. Keep the
     hero height identical to the mobile web version instead of adding the
     safe-area height a second time. */
  body[data-runtime="native"][data-auth="signed-out"] .landing-hero {
    min-height: max(740px, calc(100svh + 24px));
    margin-top: 0;
  }

  body[data-runtime="native"][data-auth="signed-out"] .landing-login-link {
    top: calc(18px + env(safe-area-inset-top));
    z-index: 20;
    pointer-events: auto;
  }

  body[data-auth="signed-out"] .landing-hero-copy {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
  }

  body[data-auth="signed-out"] .landing-hero-actions {
    margin-top: auto;
    padding-top: 34px;
  }

  body[data-auth="signed-out"] .landing-trust-list {
    display: none;
  }

  body[data-auth="signed-out"] .landing-hero-visual {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: #edf3ff;
    box-shadow: none;
  }

  body[data-auth="signed-out"] .landing-hero-visual img {
    object-position: 51.5% center;
  }

  .landing-main {
    padding: 0 20px;
  }

  .landing-hero {
    min-height: 0;
    padding: 68px 0 72px;
    scroll-margin-top: 0;
  }

  .landing-hero-copy {
    margin-left: 0;
  }

  .landing-hero h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .landing-hero-actions,
  .landing-primary-button,
  .landing-secondary-link {
    width: 100%;
  }

  .landing-trust-list {
    grid-template-columns: 1fr;
    margin-right: 0;
    margin-left: 0;
  }

  .landing-hero-visual {
    border-radius: 15px;
  }

  .landing-section {
    padding: 72px 0;
    scroll-margin-top: 0;
  }

  .landing-features-editorial {
    padding-top: 72px;
    scroll-margin-top: 0;
  }

  .landing-feature-manifesto {
    border-radius: 0;
  }

  .landing-feature-manifesto-copy {
    padding: 46px 24px 12px;
  }

  .landing-feature-manifesto h2 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .landing-feature-manifesto-copy > p:last-of-type {
    font-size: 16px;
  }

  .landing-feature-ecosystem img {
    right: 4%;
    width: 92%;
  }

  .landing-feature-ecosystem {
    height: 280px;
  }

  body[data-auth="signed-out"] .landing-features-editorial {
    min-height: max(740px, 100svh);
    margin-right: -20px;
    margin-left: -20px;
    padding: 0;
    scroll-margin-top: 0;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: max(740px, 100svh);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto-copy {
    flex: 0 0 auto;
    padding: 30px 20px 8px;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto-copy .landing-kicker {
    margin-bottom: 8px;
    font-size: 11px;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto h2 {
    margin: 8px 0 14px;
    font-size: clamp(36px, 10.5vw, 46px);
    line-height: 0.98;
  }

  body[data-auth="signed-out"] .landing-feature-manifesto-copy > p:last-of-type {
    font-size: 15px;
    line-height: 1.48;
  }

  body[data-auth="signed-out"] .landing-feature-ecosystem {
    flex: 1 1 auto;
    min-height: 240px;
    height: auto;
  }

  body[data-auth="signed-out"] .landing-feature-ecosystem img {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
  }

  body[data-auth="signed-out"] .landing-feature-chapter-document .landing-feature-photo,
  body[data-auth="signed-out"] .landing-feature-chapter-finance .landing-feature-photo {
    display: none;
  }

  .landing-feature-chapter,
  .landing-feature-chapter-finance {
    gap: 40px;
    padding: 64px 20px;
  }

  .landing-feature-photo {
    border-radius: 22px;
  }

  .landing-feature-chapter h3 {
    font-size: clamp(38px, 11vw, 54px);
  }

  .landing-feature-lines li {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .landing-pricing {
    margin-right: -20px;
    margin-left: -20px;
    padding: 42px 18px 18px;
    border-radius: 0;
  }

  body[data-auth="signed-out"] .landing-pricing-heading {
    margin-bottom: 24px;
  }

  body[data-auth="signed-out"] .landing-pricing-heading .landing-kicker {
    margin-bottom: 9px;
    font-size: 11px;
  }

  body[data-auth="signed-out"] .landing-pricing-heading h2 {
    font-size: 34px;
    line-height: 1.02;
  }

  body[data-auth="signed-out"] .landing-pricing-heading > p:last-child {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.45;
  }

  body[data-auth="signed-out"] .landing-pricing-grid {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: calc(100% + 36px);
    max-width: none;
    margin-right: -18px;
    margin-left: -18px;
    padding: 30px 18px 22px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body[data-auth="signed-out"] .landing-pricing-grid::-webkit-scrollbar {
    display: none;
  }

  .landing-price-card {
    padding: 20px;
  }

  body[data-auth="signed-out"] .landing-price-card {
    flex: 0 0 calc(100vw - 72px);
    align-self: flex-start;
    max-width: 390px;
    min-height: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .landing-price-card-heading {
    min-height: 0;
  }

  body[data-auth="signed-out"] .landing-price-card h3 {
    margin-bottom: 7px;
    font-size: 23px;
  }

  body[data-auth="signed-out"] .landing-price-card-heading p {
    font-size: 14px;
    line-height: 1.4;
  }

  body[data-auth="signed-out"] .landing-price-amount {
    margin: 18px 0;
  }

  body[data-auth="signed-out"] .landing-price-amount strong {
    font-size: 32px;
  }

  body[data-auth="signed-out"] .landing-price-card ul {
    gap: 9px;
    margin-bottom: 16px;
  }

  body[data-auth="signed-out"] .landing-price-card li {
    padding-left: 22px;
    font-size: 13px;
    line-height: 1.35;
  }

  body[data-auth="signed-out"] .landing-price-card li::before {
    font-size: 15px;
  }

  body[data-auth="signed-out"] .landing-price-card > button {
    min-height: 46px;
    margin-top: 8px;
  }

  .landing-auth-column {
    min-height: 100vh;
    padding: 60px 20px 100px;
  }
}

@media (max-width: 480px) {
  .landing-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    overflow: visible;
  }

  .landing-nav a {
    font-size: 13px;
  }
}

body[data-theme="dark"][data-auth="signed-out"] .landing-page,
body[data-theme="dark"][data-auth="signed-out"] .landing-auth-column {
  color: var(--text);
  background: var(--surface);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-content {
  background:
    radial-gradient(circle at 82% 12%, rgba(59, 130, 246, 0.15), transparent 25%),
    linear-gradient(180deg, #111a2b 0%, #0b1220 50%, #111a2b 100%);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-hero::after {
  background: linear-gradient(90deg, rgba(11, 18, 32, 0.98) 0%, rgba(11, 18, 32, 0.9) 38%, rgba(11, 18, 32, 0.25) 68%, rgba(11, 18, 32, 0) 100%);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-header,
body[data-theme="dark"][data-auth="signed-out"] .landing-hero-visual,
body[data-theme="dark"][data-auth="signed-out"] .landing-price-card {
  border-color: var(--border);
  background: rgba(18, 27, 45, 0.94);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-pricing {
  border-color: var(--border);
  background:
    radial-gradient(circle at 88% 17%, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(145deg, #111a2b 0%, #0b1220 100%);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-feature-manifesto {
  background:
    radial-gradient(circle at 70% 12%, rgba(37, 99, 235, 0.14), transparent 34%),
    radial-gradient(circle at 16% 24%, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(135deg, #111a2b 0%, #0b1220 100%);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-feature-chapter,
body[data-theme="dark"][data-auth="signed-out"] .landing-feature-lines li {
  border-color: var(--border);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-hero h1,
body[data-theme="dark"][data-auth="signed-out"] .landing-section-heading h2,
body[data-theme="dark"][data-auth="signed-out"] .landing-feature-manifesto h2,
body[data-theme="dark"][data-auth="signed-out"] .landing-feature-chapter h3,
body[data-theme="dark"][data-auth="signed-out"] .landing-feature-lines,
body[data-theme="dark"][data-auth="signed-out"] .landing-price-card h3,
body[data-theme="dark"][data-auth="signed-out"] .landing-price-amount strong,
body[data-theme="dark"][data-auth="signed-out"] .landing-auth-column .auth-card h2,
body[data-theme="dark"][data-auth="signed-out"] .landing-nav a,
body[data-theme="dark"][data-auth="signed-out"] .landing-nav-item,
body[data-theme="dark"][data-auth="signed-out"] .landing-secondary-link {
  color: var(--text);
}

body[data-theme="dark"][data-auth="signed-out"] .landing-secondary-link,
body[data-theme="dark"][data-auth="signed-out"] .landing-login-link,
body[data-theme="dark"][data-auth="signed-out"] .landing-auth-column input,
body[data-theme="dark"][data-auth="signed-out"] .landing-auth-column select {
  border-color: var(--border);
  background: var(--surface-muted);
}
.score-keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.score-keyword-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #17233a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.score-keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.score-keyword-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #17233a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* Handy-Dokumente: Hochformat reduziert, Querformat mit Verwaltungsleiste links. */
@media (orientation: portrait) and (max-width: 760px) {
  body[data-auth="signed-in"] #documents .document-pool,
  body[data-auth="signed-in"] #documents .document-sidebar-stack {
    display: none;
  }
}

@media (orientation: landscape) and (max-width: 1024px) and (max-height: 680px) {
  body[data-auth="signed-in"] #documents .documents-upload-workspace,
  body[data-auth="signed-in"] #documents .document-workbench {
    display: grid;
    grid-template-columns: minmax(330px, 40%) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  body[data-auth="signed-in"] #documents .documents-upload-workspace .document-pool {
    display: grid;
    order: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  body[data-auth="signed-in"] #documents .documents-upload-workspace .upload-panel {
    order: 2;
    min-width: 0;
    max-width: 100%;
  }

  body[data-auth="signed-in"] #documents .document-sidebar-stack {
    display: grid;
    gap: 14px;
    min-width: 0;
  }

  body[data-auth="signed-in"] #documents .documents-panel {
    order: initial;
    min-width: 0;
  }

  body[data-auth="signed-in"] #documents .document-pool > *,
  body[data-auth="signed-in"] #documents .document-sidebar-stack > *,
  body[data-auth="signed-in"] #documents .document-pool-header > div:first-child {
    min-width: 0;
    max-width: 100%;
  }

  body[data-auth="signed-in"] #documents .document-pool-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  body[data-auth="signed-in"] #documents .document-pool-filename input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-auth="signed-in"] #documents .document-pool-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }

  body[data-auth="signed-in"] #documents .document-pool-create,
  body[data-auth="signed-in"] #documents .document-pool-folder-create,
  body[data-auth="signed-in"] #documents .document-pool-ai-letter {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-auth="signed-in"] #documents .document-pool-ai-letter {
    grid-column: 1 / -1;
  }
}

/* Finanzen am Handy: Hochformat zeigt einen Monat, Querformat die ganze Jahresmatrix. */
@media (orientation: portrait) and (max-width: 760px) {
  body[data-auth="signed-in"] #finance .finance-matrix-card {
    gap: 14px;
    padding-top: 18px;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-card .documents-panel-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 0 16px;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-card .documents-panel-header h3 {
    margin: 0 0 5px;
    font-size: 26px;
    line-height: 1.05;
    letter-spacing: -0.025em;
  }

  body[data-auth="signed-in"] #finance #finance-currency-note {
    display: grid;
    max-width: none;
    gap: 2px;
    overflow: visible;
    font-size: 12px;
    line-height: 1.35;
  }

  body[data-auth="signed-in"] #finance .finance-currency-order {
    display: none;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    gap: 8px 12px;
  }

  body[data-auth="signed-in"] #finance .finance-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  body[data-auth="signed-in"] #finance .finance-controls select {
    width: 100%;
    max-width: none;
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  body[data-auth="signed-in"] #finance #finance-entry-count {
    grid-column: 2;
    margin: 0;
    font-size: 11px;
  }
}

@media (orientation: landscape) and (max-width: 1024px) and (max-height: 680px) {
  body[data-auth="signed-in"] #finance.finance-view.active {
    gap: 10px;
    width: calc(100% + 24px);
    max-width: none;
    margin-inline: -12px;
  }

  body[data-auth="signed-in"] #finance .finance-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-auth="signed-in"] #finance .finance-summary-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 7px;
    height: 70px;
    min-height: 70px;
    padding: 8px 10px;
    border-radius: 12px;
  }

  body[data-auth="signed-in"] #finance .finance-summary-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 9px;
  }

  body[data-auth="signed-in"] #finance .finance-summary-icon svg,
  body[data-auth="signed-in"] #finance .finance-summary-icon[data-finance-icon="wallet"] svg {
    width: 18px;
    height: 18px;
  }

  body[data-auth="signed-in"] #finance .finance-summary-card p,
  body[data-auth="signed-in"] #finance .finance-summary-card small {
    margin: 0;
    font-size: 9px;
    line-height: 1.15;
  }

  body[data-auth="signed-in"] #finance .finance-summary-card strong {
    font-size: 13px;
    line-height: 1.1;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-card {
    gap: 8px;
    padding: 12px 0 0;
    overflow-x: hidden;
    border-radius: 12px;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-card .documents-panel-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    padding: 0 12px;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-card .documents-panel-header h3 {
    margin: 0 0 2px;
    font-size: 23px;
    line-height: 1;
    letter-spacing: -0.02em;
  }

  body[data-auth="signed-in"] #finance #finance-currency-note {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 5px;
    max-width: none;
    overflow: visible;
    font-size: 9px;
    line-height: 1.25;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-actions {
    min-width: 0;
    gap: 3px;
  }

  body[data-auth="signed-in"] #finance .finance-controls {
    gap: 6px;
  }

  body[data-auth="signed-in"] #finance .finance-controls select {
    width: 128px;
    min-width: 0;
    min-height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

  body[data-auth="signed-in"] #finance #finance-entry-count {
    margin: 0;
    font-size: 9px;
  }

  body[data-auth="signed-in"] #finance .finance-ai-query {
    margin: 0 12px;
  }

  body[data-auth="signed-in"] #finance .finance-matrix {
    width: 100%;
    min-width: 0;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-row {
    grid-template-columns: minmax(138px, 1.75fr) repeat(13, minmax(0, 1fr));
    min-height: 34px;
    padding: 0 10px;
  }

  body[data-auth="signed-in"] #finance .finance-matrix-head {
    min-height: 30px;
    font-size: 9px;
  }

  body[data-auth="signed-in"] #finance .finance-section-row {
    min-height: 30px;
  }

  body[data-auth="signed-in"] #finance .finance-section-row strong {
    padding-left: 4px;
    font-size: 10px;
  }

  body[data-auth="signed-in"] #finance .finance-value-row,
  body[data-auth="signed-in"] #finance .finance-value-row > span,
  body[data-auth="signed-in"] #finance .finance-value-row > b,
  body[data-auth="signed-in"] #finance .finance-matrix-head span:last-child {
    min-width: 0;
    font-size: 9px;
  }

  body[data-auth="signed-in"] #finance .finance-row-label {
    gap: 6px;
  }

  body[data-auth="signed-in"] #finance .finance-row-label-plain {
    padding-left: 29px;
  }

  body[data-auth="signed-in"] #finance .finance-row-label strong {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-auth="signed-in"] #finance .finance-row-label small {
    display: none;
  }

  body[data-auth="signed-in"] #finance .finance-row-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  body[data-auth="signed-in"] #finance .finance-row-icon svg {
    width: 14px;
    height: 14px;
  }

  body[data-auth="signed-in"] #finance .finance-source-trigger {
    font-size: inherit;
  }
}

/* Finanzquellen: mobiler Dialog bleibt vollständig über der App-Navigation sichtbar. */
@media (max-width: 760px) {
  body[data-auth="signed-in"] #finance-sources-modal.modal-backdrop {
    z-index: 60;
    padding: 12px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(3px);
  }

  body[data-auth="signed-in"] .finance-sources-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  }

  body[data-auth="signed-in"] .finance-sources-modal > .modal-header {
    align-items: flex-start;
    gap: 12px;
    padding: 20px 18px 17px;
  }

  body[data-auth="signed-in"] .finance-sources-modal > .modal-header h2 {
    max-width: 290px;
    font-size: 24px;
    line-height: 1.08;
    letter-spacing: -0.025em;
  }

  body[data-auth="signed-in"] .finance-sources-modal .modal-header p {
    max-width: 300px;
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.4;
  }

  body[data-auth="signed-in"] .finance-sources-modal > .modal-header .icon-action {
    width: 38px;
    height: 38px;
    margin: -5px -5px 0 0;
    border-radius: 999px;
    background: #f1f5f9;
  }

  body[data-auth="signed-in"] .finance-source-list {
    gap: 12px;
    padding: 14px 16px 0;
  }

  body[data-auth="signed-in"] .finance-source-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
  }

  body[data-auth="signed-in"] .finance-source-summary div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    justify-content: start;
    gap: 3px 12px;
  }

  body[data-auth="signed-in"] .finance-source-summary div strong {
    grid-column: 1 / -1;
    font-size: 14px;
  }

  body[data-auth="signed-in"] .finance-source-summary div span {
    font-size: 12px;
    line-height: 1.25;
  }

  body[data-auth="signed-in"] .finance-source-summary b {
    align-self: center;
    font-size: 16px;
  }

  body[data-auth="signed-in"] .finance-source-rows {
    gap: 10px;
    padding-right: 2px;
  }

  body[data-auth="signed-in"] .finance-source-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.045);
  }

  body[data-auth="signed-in"] .finance-source-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  body[data-auth="signed-in"] .finance-source-name strong {
    font-size: 14px;
    line-height: 1.2;
  }

  body[data-auth="signed-in"] .finance-source-name p,
  body[data-auth="signed-in"] .finance-source-company {
    font-size: 12px;
    line-height: 1.3;
  }

  body[data-auth="signed-in"] .finance-source-company {
    grid-column: 2;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body[data-auth="signed-in"] .finance-source-amount {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-width: 90px;
    justify-items: end;
    text-align: right;
  }

  body[data-auth="signed-in"] .finance-source-amount strong {
    font-size: 14px;
  }

  body[data-auth="signed-in"] .finance-source-amount .status-pill {
    padding-inline: 10px;
    font-size: 11px;
  }

  body[data-auth="signed-in"] .finance-source-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 3px;
    padding-top: 9px;
    border-top: 1px solid #eef2f7;
  }

  body[data-auth="signed-in"] .finance-source-actions .icon-action {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  body[data-auth="signed-in"] .finance-source-footer {
    position: sticky;
    bottom: 0;
    flex: 0 0 auto;
    margin: 0 -16px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: rgba(248, 250, 252, 0.98);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
  }

  body[data-auth="signed-in"] .finance-source-footer span {
    font-size: 11px;
    line-height: 1.25;
  }

  body[data-auth="signed-in"] .finance-source-footer strong {
    font-size: 17px;
  }

  body[data-auth="signed-in"] .finance-source-footer .primary-action {
    min-width: 104px;
    min-height: 42px;
    border-radius: 10px;
  }
}

/* Dokument bearbeiten: eigenständiges, vollständig bedienbares Handy-Layout. */
@media (max-width: 760px) {
  body[data-auth="signed-in"] #edit-document-modal.modal-backdrop {
    z-index: 60;
    padding: 12px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(3px);
  }

  body[data-auth="signed-in"] #edit-document-form {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    justify-self: center;
    width: min(430px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    margin-inline: auto;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  }

  body[data-auth="signed-in"] #edit-document-form > .modal-header {
    padding: 16px 15px;
  }

  body[data-auth="signed-in"] #edit-document-form > .modal-header h2 {
    font-size: 22px;
    line-height: 1.08;
    letter-spacing: -0.025em;
  }

  body[data-auth="signed-in"] #edit-document-form > .modal-header .icon-action {
    width: 38px;
    height: 38px;
    margin-right: -3px;
    border-radius: 999px;
    background: #f1f5f9;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-modal-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
    background: #f1f5f9;
    scroll-padding-block: 16px 100px;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-panel {
    width: 100%;
    min-width: 0;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
  }

  body[data-auth="signed-in"] #edit-document-form .edit-panel h3 {
    font-size: 18px;
    line-height: 1.12;
    letter-spacing: -0.015em;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-grid {
    width: 100%;
    min-width: 0;
    gap: 12px 10px;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-grid.two-columns,
  body[data-auth="signed-in"] #edit-document-form .edit-grid.compact-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-auth="signed-in"] #edit-document-form .edit-panel label {
    min-width: 0;
    gap: 5px;
    font-size: 10px;
    line-height: 1.25;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-panel input,
  body[data-auth="signed-in"] #edit-document-form .edit-panel select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 13px;
  }

  body[data-auth="signed-in"] #edit-document-form .checkbox-line {
    min-height: 42px;
    padding: 0 2px;
  }

  body[data-auth="signed-in"] #edit-document-form .checkbox-line input[type="checkbox"] {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
  }

  body[data-auth="signed-in"] #edit-document-form .finance-panel-title {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px 11px;
  }

  body[data-auth="signed-in"] #edit-document-form .finance-assignment-icon,
  body[data-auth="signed-in"] #edit-document-form .finance-preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  body[data-auth="signed-in"] #edit-document-form .finance-panel-title .manual-pill {
    grid-column: 2;
    max-width: 100%;
    padding: 5px 9px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  body[data-auth="signed-in"] #edit-document-form .finance-preview {
    gap: 12px;
    padding: 13px;
    border-radius: 12px;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-collapsible {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-collapsible summary {
    min-height: 48px;
    padding-inline: 14px;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-collapsible-body {
    padding: 0 14px 14px;
  }

  body[data-auth="signed-in"] #edit-document-message:empty {
    display: none;
  }

  body[data-auth="signed-in"] #edit-document-form > .form-message {
    margin: 0;
    padding: 8px 16px 0;
    background: #ffffff;
  }

  body[data-auth="signed-in"] #edit-document-form > .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
  }

  body[data-auth="signed-in"] #edit-document-form > .modal-actions button {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
  }
}

@media (max-width: 350px) {
  body[data-auth="signed-in"] #edit-document-form .edit-grid.two-columns,
  body[data-auth="signed-in"] #edit-document-form .edit-grid.compact-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  body[data-auth="signed-in"] #edit-document-modal.modal-backdrop {
    position: fixed;
    inset: 0 auto auto 0;
    width: 100svw;
    max-width: 100svw;
    height: 100dvh;
    overflow: hidden;
  }

  body[data-auth="signed-in"] #edit-document-form {
    position: fixed;
    top: 12px;
    right: auto;
    left: 50svw;
    width: min(430px, calc(100svw - 40px));
    max-width: calc(100svw - 40px);
    margin: 0;
    transform: translateX(-50%);
  }

  body[data-auth="signed-in"] #edit-document-form *,
  body[data-auth="signed-in"] #edit-document-form *::before,
  body[data-auth="signed-in"] #edit-document-form *::after {
    box-sizing: border-box;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-grid > label {
    overflow: hidden;
  }

  body[data-auth="signed-in"] #edit-document-form .edit-grid.two-columns,
  body[data-auth="signed-in"] #edit-document-form .edit-grid.compact-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-auth="signed-in"] #edit-document-form .edit-panel select {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-auth="signed-in"] #edit-document-form input:not([type="checkbox"]),
  body[data-auth="signed-in"] #edit-document-form textarea {
    font-size: 16px;
  }
}

/* Native Handy-App: Inhalte beginnen unterhalb der iOS-Statusleiste. */
@media (max-width: 760px) {
  body[data-runtime="native"],
  body[data-app-mode="standalone"] {
    --native-mobile-top-offset: calc(env(safe-area-inset-top) + 8px);
  }

  body[data-auth="signed-out"] .landing-auth-column input,
  body[data-auth="signed-out"] .landing-auth-column select,
  body[data-auth="signed-out"] .landing-auth-column textarea {
    font-size: 16px;
  }

  body[data-runtime="native"][data-auth="signed-in"] .workspace,
  body[data-runtime="native"][data-auth="signed-in"][data-view="dashboard"] .workspace,
  body[data-app-mode="standalone"][data-auth="signed-in"] .workspace,
  body[data-app-mode="standalone"][data-auth="signed-in"][data-view="dashboard"] .workspace {
    padding-top: var(--native-mobile-top-offset);
  }

}

/* Dashboard in der Handy-Queransicht: kompakt, aber ohne Ueberlagerungen. */
@media (orientation: landscape) and (min-width: 761px) and (max-width: 1024px) and (max-height: 680px) and (hover: none) and (pointer: coarse) {
  body[data-auth="signed-in"][data-view="dashboard"] .workspace {
    padding: 14px calc(14px + env(safe-area-inset-right)) 24px calc(14px + env(safe-area-inset-left));
  }

  body[data-auth="signed-in"] #dashboard.view.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    width: 100%;
    min-width: 0;
    height: 88px;
    min-height: 88px;
    padding: 11px 12px;
    border-radius: 13px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi-icon svg {
    width: 24px;
    height: 24px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi > div {
    min-width: 0;
    overflow: hidden;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi p {
    margin-bottom: 3px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi strong {
    overflow: hidden;
    font-size: clamp(16px, 2.2vw, 20px);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi small {
    margin-top: 4px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-kpi-arrow {
    align-self: center;
    font-size: 22px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-progress {
    height: 4px;
    margin-top: 4px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-charts {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 12px;
    margin: 0;
  }

  body[data-auth="signed-in"] #dashboard .distribution-card,
  body[data-auth="signed-in"] #dashboard .monthly-card {
    min-width: 0;
    min-height: 380px;
    padding: 15px;
    overflow: hidden;
    border-radius: 14px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-card-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-card h3,
  body[data-auth="signed-in"] #dashboard .dashboard-card-header h3 {
    font-size: 16px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-card-header select,
  body[data-auth="signed-in"] #dashboard .dashboard-card-foot select,
  body[data-auth="signed-in"] #dashboard .distribution-pane-side select {
    min-height: 30px;
    padding-inline: 9px;
    font-size: 11px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 278px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-pane {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 8px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-pane-month {
    margin-left: 0;
    padding-left: 8px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-pane-title strong {
    font-size: 12px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-pane-title span {
    font-size: 10px;
  }

  body[data-auth="signed-in"] #dashboard .donut-chart {
    width: min(132px, 100%);
  }

  body[data-auth="signed-in"] #dashboard .donut-center strong {
    font-size: 14px;
  }

  body[data-auth="signed-in"] #dashboard .donut-center span {
    font-size: 10px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-pane-side {
    align-content: start;
    gap: 6px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-pane-side select {
    justify-self: stretch;
    width: 100%;
  }

  body[data-auth="signed-in"] #dashboard .distribution-legend {
    gap: 4px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-item strong {
    gap: 4px;
    font-size: 9px;
  }

  body[data-auth="signed-in"] #dashboard .distribution-item strong b,
  body[data-auth="signed-in"] #dashboard .distribution-item p {
    font-size: 8px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-card-foot {
    gap: 8px;
    min-height: 38px;
    margin-top: 8px;
    padding: 4px 8px;
  }

  body[data-auth="signed-in"] #dashboard .dashboard-card-foot span {
    font-size: 9px;
    line-height: 1.25;
  }

  body[data-auth="signed-in"] #dashboard .monthly-chart,
  body[data-auth="signed-in"] #dashboard .monthly-chart svg {
    min-height: 230px;
  }

  body[data-auth="signed-in"] #dashboard .monthly-grid text,
  body[data-auth="signed-in"] #dashboard .monthly-labels text,
  body[data-auth="signed-in"] #dashboard .monthly-legend span {
    font-size: 9px;
  }

  body[data-auth="signed-in"] #dashboard .monthly-legend {
    gap: 5px 10px;
    min-height: 38px;
    margin-top: 8px;
    padding: 6px 8px;
  }
}

/* Scanner am Handy als echte Vollbildansicht statt als schwebendes Fenster. */
@media (max-width: 760px), (orientation: landscape) and (max-width: 1024px) and (max-height: 680px) {
  body[data-auth="signed-in"] #qr-scan-modal.modal-backdrop {
    z-index: 80;
    place-items: stretch;
    padding: 0;
    background: #ffffff;
  }

  body[data-auth="signed-in"] #qr-scan-modal .qr-scan-modal {
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  body[data-auth="signed-in"] #qr-scan-modal .modal-header {
    min-height: calc(66px + env(safe-area-inset-top));
    padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 14px calc(18px + env(safe-area-inset-left));
  }

  body[data-auth="signed-in"] #qr-scan-modal .modal-header h2 {
    font-size: 26px;
  }

  body[data-auth="signed-in"] #qr-scan-modal .qr-scan-body {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
    padding: 14px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
  }

  body[data-auth="signed-in"] #qr-scan-modal .scan-mode-switch {
    flex: 0 0 auto;
  }

  body[data-auth="signed-in"] #qr-scan-modal .scan-mode-button {
    min-height: 48px;
  }

  body[data-auth="signed-in"] #qr-scan-modal .qr-camera-frame {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 12px;
  }

  body[data-auth="signed-in"] #qr-scan-modal #qr-scan-message {
    margin: 0;
    padding-block: 2px;
    font-size: 13px;
    line-height: 1.35;
  }

  body[data-auth="signed-in"] #qr-scan-modal .scan-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px calc(16px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    background: #ffffff;
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.06);
  }

  body[data-auth="signed-in"] #qr-scan-modal .scan-modal-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  body[data-auth="signed-in"] #qr-scan-modal #document-scan-capture,
  body[data-auth="signed-in"] #qr-scan-modal #document-scan-save {
    grid-column: 1 / -1;
  }
}
