:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-subtle: #f2f3f5;
  --border: #e7e9ec;
  --text-primary: #14181f;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --primary: #5d7fae;
  --primary-hover: #41658f;
  --primary-soft: #eaf0f8;
  --primary-focus-rgb: 93, 127, 174;
  --primary-gradient: linear-gradient(94deg, #6f91c0 0%, #41658f 100%);
  --ai-gradient: linear-gradient(94deg, #8b5cf6 0%, #d946ef 50%, #3b82f6 100%);
  --green-bg: #dcfce7;
  --green-fg: #15803d;
  --red-bg: #fee2e2;
  --red-fg: #b91c1c;
  --amber-bg: #fef3c7;
  --amber-fg: #b45309;
  --blue-bg: #dbeafe;
  --blue-fg: #1d4ed8;
  --sky-bg: #e0f2fe;
  --sky-fg: #0369a1;
  --teal-bg: #ccfbf1;
  --teal-fg: #0f766e;
  --purple-bg: #f3e8ff;
  --purple-fg: #7e22ce;
  --pink-bg: #fce7f3;
  --pink-fg: #be185d;
  --orange-bg: #ffedd5;
  --orange-fg: #c2410c;
  --gray-bg: #f3f4f6;
  --gray-fg: #4b5563;
  --radius-card: 16px;
  --radius-inner: 12px;
  --radius-btn: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-modal: 0 12px 32px rgba(16, 24, 40, 0.14);
  --radius-sm: 6px;
  --font-size-h3: 16px;
  --tenant-brand-primary: #5d7fae;
  --tenant-brand-primary-strong: #41658f;
  --tenant-brand-focus-rgb: 93, 127, 174;
  --theme-bg: #f4f6fa;
  --theme-panel: #ffffff;
  --theme-text: #17202a;
  --theme-muted: #667085;
  --theme-border: #d8dee8;
  --theme-danger: #b42318;
  --theme-warning: #b54708;
  --theme-surface-subtle: #f1f5f9;
  --theme-kanban-column: #f8fafc;
  --theme-stage-ink: #0f172a;
  --theme-stage-card: #7b8b97;
  --theme-stage-warehouse: #7d9b70;
  --theme-stage-supplier: #aa8b52;
  --theme-stage-logistics: #63938d;
  --theme-stage-economics: #8e7396;
  --theme-stage-documents: #7483a7;
  --theme-stage-counter: rgba(255, 255, 255, 0.64);
  --theme-stage-counter-border: rgba(15, 23, 42, 0.08);
  --landing-bg: #0b1120;
  --landing-bg-bottom: #0e1526;
  --landing-accent: #2f7df6;
  --landing-accent-hover: #4a90f7;
  --landing-text: #f5f7fa;
  --landing-text-soft: #9aa5b5;
  --landing-panel: rgba(15, 23, 42, 0.78);
  --landing-panel-border: rgba(154, 165, 181, 0.22);
  --landing-glow-start: rgba(36, 86, 214, 0.45);
  --landing-glow-end: rgba(36, 86, 214, 0);
  --landing-screen-top: rgba(47, 125, 246, 0.14);
  --landing-screen-bottom: rgba(11, 17, 32, 0.98);
  --landing-device-frame: #121a2b;
  --landing-device-edge: #243149;
  --landing-device-base: #1b2638;
  --landing-device-shadow: rgba(0, 0, 0, 0.38);
  --landing-preview-bg: #f8fafc;
  --landing-preview-panel: #ffffff;
  --landing-preview-text: #17202a;
  --landing-preview-muted: #64748b;
  --landing-preview-border: #d8dee8;
  --landing-preview-line: #cbd5e1;
  --landing-grid-line: rgba(148, 163, 184, 0.07);
  --landing-proof-bg: rgba(15, 23, 42, 0.9);
  --landing-proof-border: rgba(148, 163, 184, 0.18);
  --landing-proof-icon: #dbeafe;
  --landing-proof-icon-bg: rgba(47, 125, 246, 0.2);
  --landing-success: #22c55e;
  --landing-success-soft: #dcfce7;
  --landing-preview-sidebar: #f1f5f9;
  --landing-preview-chip: #e2e8f0;
  --landing-preview-blue-soft: #eff6ff;
  --landing-preview-blue-border: #bfdbfe;
  --landing-preview-green-soft: #f0fdf4;
  --landing-preview-green-border: #bbf7d0;
  --color-bg: var(--theme-bg);
  --color-panel: var(--theme-panel);
  --color-text: var(--theme-text);
  --color-muted: var(--theme-muted);
  --color-border: var(--theme-border);
  --color-accent: var(--tenant-brand-primary);
  --color-accent-strong: var(--tenant-brand-primary-strong);
  --color-danger: var(--theme-danger);
  --color-warning: var(--theme-warning);
  --color-surface-subtle: var(--theme-surface-subtle);
  --color-kanban-column: var(--theme-kanban-column);
  --color-stage-ink: var(--theme-stage-ink);
  --color-stage-card: var(--theme-stage-card);
  --color-stage-warehouse: var(--theme-stage-warehouse);
  --color-stage-supplier: var(--theme-stage-supplier);
  --color-stage-logistics: var(--theme-stage-logistics);
  --color-stage-economics: var(--theme-stage-economics);
  --color-stage-documents: var(--theme-stage-documents);
  --color-stage-counter: var(--theme-stage-counter);
  --color-stage-counter-border: var(--theme-stage-counter-border);
  --border-width: 1px;
  --radius-panel: 8px;
  --radius-control: 6px;
  --radius-pill: 999px;
  --space-0: 0;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --layout-max-width: 1180px;
  --layout-sidebar-width: 216px;
  --layout-topbar-height: 64px;
  --kanban-column-min-width: 0;
  --layout-landing-max-width: 1240px;
  --control-inline-min: 160px;
  --control-theme-width: 128px;
  --control-landing-theme-width: 180px;
  --layout-mobile-breakpoint: 760px;
  --profile-avatar-size: 36px;
  --profile-menu-avatar-size: 52px;
  --profile-menu-width: 304px;
  --profile-crop-size: 420px;
  --grid-single-column: 1fr;
  --grid-three-columns: repeat(3, minmax(0, 1fr));
  --font-size-title: 34px;
  --font-size-hero: 64px;
  --font-size-section: 18px;
  --font-size-subsection: 16px;
  --font-size-code: 12px;
  --line-height-card-title: 19px;
  --landing-min-height: 100vh;
  --landing-shell-offset: 112px;
  --landing-board-min-height: 360px;
  --landing-side-min-width: 320px;
  --landing-copy-max-width: 520px;
  --landing-eyebrow-spacing: 0.12em;
  --landing-device-border: 12px;
  --landing-device-width: min(720px, 58vw);
  --landing-laptop-offset-x: 0;
  --landing-device-base-width: 112%;
  --landing-device-base-offset: -6%;
  --landing-composition-width: min(720px, 58vw);
  --landing-phone-width: 150px;
  --landing-phone-border: 10px;
  --landing-phone-radius: 28px;
  --landing-phone-overlap-y: 43%;
  --landing-phone-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  --landing-phone-island-width: 54px;
  --landing-phone-island-height: 14px;
  --landing-phone-island-top: 12px;
  --landing-phone-mobile-width: 104px;
  --landing-phone-mobile-top: 39%;
  --auth-panel-max-width: 520px;
  --kanban-min-height: 280px;
  --inventory-table-min-width: 1320px;
  --inventory-preview-min-width: 880px;
  --inventory-mobile-label-width: 128px;
  --inventory-preview-columns: 64px 120px minmax(220px, 1fr) 100px 100px minmax(180px, 1fr);
  --inventory-table-columns: 72px 100px 135px minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(140px, 0.8fr) 110px 130px 110px 100px;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --pre-min-height: 220px;
  --pre-max-height: 360px;
  --full-width: 100%;
  --font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
  --shadow-focus: 0 0 0 3px rgba(var(--tenant-brand-focus-rgb), 0.18);
  --landing-shadow-accent: 0 12px 38px rgba(47, 125, 246, 0.32);
  --landing-device-shadow-elevated: 0 36px 90px var(--landing-device-shadow);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tenant-brand-primary: #2dd4bf;
    --tenant-brand-primary-strong: #5eead4;
    --tenant-brand-focus-rgb: 45, 212, 191;
    --theme-bg: #101418;
    --theme-panel: #171d23;
    --theme-text: #eef2f6;
    --theme-muted: #9aa4b2;
    --theme-border: #2d3743;
    --theme-surface-subtle: #202832;
    --shadow-focus: 0 0 0 3px rgba(var(--tenant-brand-focus-rgb), 0.2);
  }
}

:root[data-theme="light"] {
  --tenant-brand-primary: #0f766e;
  --tenant-brand-primary-strong: #115e59;
  --tenant-brand-focus-rgb: 15, 118, 110;
  --theme-bg: #f7f8fb;
  --theme-panel: #ffffff;
  --theme-text: #17202a;
  --theme-muted: #667085;
  --theme-border: #d8dee8;
  --theme-surface-subtle: #f1f5f9;
}

:root[data-theme="dark"] {
  --tenant-brand-primary: #2dd4bf;
  --tenant-brand-primary-strong: #5eead4;
  --tenant-brand-focus-rgb: 45, 212, 191;
  --theme-bg: #101418;
  --theme-panel: #171d23;
  --theme-text: #eef2f6;
  --theme-muted: #9aa4b2;
  --theme-border: #2d3743;
  --theme-surface-subtle: #202832;
  --shadow-focus: 0 0 0 3px rgba(var(--tenant-brand-focus-rgb), 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: var(--space-0);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: var(--space-0);
}

button {
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: var(--color-accent);
  color: var(--color-panel);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}

button:hover {
  background: var(--color-accent-strong);
}

input,
select,
textarea {
  width: var(--full-width);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
}

textarea {
  resize: vertical;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: var(--space-0);
  box-shadow: var(--shadow-focus);
}

.landing-page {
  min-height: var(--landing-min-height);
  overflow: hidden;
  background:
    linear-gradient(var(--landing-grid-line) var(--border-width), transparent var(--border-width)),
    linear-gradient(90deg, var(--landing-grid-line) var(--border-width), transparent var(--border-width)),
    radial-gradient(circle at 76% 44%, var(--landing-glow-start), var(--landing-glow-end) 34%),
    linear-gradient(180deg, var(--landing-bg), var(--landing-bg-bottom));
  background-size: var(--space-6) var(--space-6), var(--space-6) var(--space-6), auto, auto;
  color: var(--landing-text);
}

.landing-nav {
  width: min(var(--layout-landing-max-width), calc(100vw - (var(--space-3) * 2)));
  margin: 0 auto;
  padding: var(--space-4) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--landing-text);
}

.landing-logo span {
  width: var(--space-3);
  height: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--landing-accent);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.landing-shell {
  position: relative;
  width: min(var(--layout-landing-max-width), calc(100vw - (var(--space-3) * 2)));
  margin: 0 auto;
  min-height: calc(var(--landing-min-height) - var(--landing-shell-offset));
  display: grid;
  align-items: center;
  padding: var(--space-5) 0 var(--space-6);
}

.landing-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(560px, 1.14fr);
  align-items: center;
  gap: var(--space-6);
  width: var(--full-width);
}

.landing-copy {
  max-width: var(--landing-copy-max-width);
}

.landing-hero h1 {
  margin: var(--space-3) 0 var(--space-4);
  font-size: var(--font-size-hero);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.landing-eyebrow {
  margin: var(--space-0);
  color: var(--landing-text-soft);
  font-weight: 700;
  letter-spacing: var(--landing-eyebrow-spacing);
  font-size: var(--font-size-code);
}

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

.landing-promise {
  margin: var(--space-0) 0 var(--space-3);
  color: var(--landing-text);
  font-size: var(--font-size-title);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.landing-description {
  max-width: 490px;
  margin: var(--space-0);
  color: var(--landing-text-soft);
  font-size: var(--font-size-section);
  line-height: 1.55;
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.landing-actions > span {
  color: var(--landing-text-soft);
  font-size: var(--font-size-code);
}

.landing-cta {
  padding: var(--space-3) var(--space-5);
  font-weight: 700;
}

.landing-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-0);
  margin: var(--space-4) 0 var(--space-0);
  list-style: none;
}

.landing-capabilities li {
  border: var(--border-width) solid var(--landing-panel-border);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-2);
  color: var(--landing-text-soft);
  font-size: var(--font-size-code);
}

.landing-primary,
.landing-secondary {
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
}

.landing-primary {
  background: var(--landing-accent);
  color: var(--landing-text);
  box-shadow: var(--landing-shadow-accent);
}

.landing-primary:hover {
  background: var(--landing-accent-hover);
}

.landing-secondary {
  border: var(--border-width) solid var(--landing-panel-border);
  background: transparent;
  color: var(--landing-text);
}

.landing-secondary:hover {
  background: var(--landing-panel);
}

.device-composition {
  position: relative;
  width: var(--landing-composition-width);
  justify-self: end;
}

.landing-visual-glow {
  position: absolute;
  inset: 12% 8% 10%;
  border-radius: 50%;
  background: var(--landing-glow-start);
  filter: blur(80px);
  opacity: 0.52;
}

.laptop-device {
  position: relative;
  width: var(--landing-device-width);
  transform: translateX(var(--landing-laptop-offset-x));
  filter: drop-shadow(var(--landing-device-shadow-elevated));
}

.device-frame {
  position: relative;
  z-index: 2;
  display: block;
  width: var(--full-width);
  height: auto;
  pointer-events: none;
  user-select: none;
}

.device-screen {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  background: var(--landing-preview-bg);
  color: var(--landing-preview-text);
}

.laptop-preview {
  left: 15.35%;
  top: 4.75%;
  width: 69.25%;
  height: 62.55%;
  border-radius: var(--radius-sm);
  padding: var(--space-0);
}

.preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 9%;
  border-bottom: var(--border-width) solid var(--color-border);
  padding: var(--space-0) var(--space-2);
  font-size: var(--font-size-code);
}

.preview-topbar strong {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.preview-topbar i {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--landing-accent);
}

.preview-topbar > span {
  color: var(--landing-preview-muted);
}

.preview-layout {
  display: grid;
  grid-template-columns: 21% 1fr;
  height: 91%;
}

.preview-sidebar {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--landing-preview-sidebar);
  border-right: var(--border-width) solid var(--landing-preview-border);
  font-size: 8px;
}

.preview-sidebar strong,
.preview-sidebar span {
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}

.preview-sidebar strong {
  background: var(--landing-preview-panel);
  color: var(--landing-accent);
}

.preview-sidebar span {
  color: var(--landing-preview-muted);
}

.preview-workspace {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-2);
}

.preview-workspace-head,
.preview-approval,
.preview-ai-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.preview-workspace-head div,
.preview-approval div,
.preview-ai-card div:not(.preview-ai-icon),
.phone-preview article div,
.phone-ai-note {
  display: grid;
  gap: 2px;
}

.preview-workspace-head span,
.preview-ai-card span,
.preview-metrics span,
.preview-approval span,
.preview-control-note,
.phone-preview span {
  color: var(--landing-preview-muted);
  font-size: 7px;
}

.preview-workspace-head strong,
.preview-ai-card strong,
.preview-approval strong {
  font-size: 9px;
}

.preview-status {
  border-radius: var(--radius-pill);
  background: var(--landing-preview-blue-soft);
  padding: var(--space-1) var(--space-2);
  color: var(--landing-accent) !important;
}

.preview-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
}

.preview-stages span {
  border-radius: var(--radius-sm);
  background: var(--landing-preview-chip);
  padding: 4px 2px;
  color: var(--landing-preview-muted);
  font-size: 6px;
  text-align: center;
}

.preview-stages .is-done {
  background: var(--landing-success-soft);
  color: var(--green-fg);
}

.preview-stages .is-active {
  background: var(--landing-preview-blue-soft);
  color: var(--landing-accent);
}

.preview-ai-card {
  border: var(--border-width) solid var(--landing-preview-blue-border);
  border-radius: var(--radius-control);
  background: var(--landing-preview-blue-soft);
  padding: var(--space-2);
}

.preview-ai-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: var(--radius-control);
  background: var(--landing-accent);
  color: var(--landing-text);
  font-size: 8px;
  font-weight: 800;
}

.preview-ai-card > div:nth-child(2) {
  flex: 1;
}

.preview-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--landing-success);
  color: var(--landing-text) !important;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.preview-metrics div {
  display: grid;
  gap: 2px;
  border: var(--border-width) solid var(--landing-preview-border);
  border-radius: var(--radius-control);
  padding: var(--space-1) var(--space-2);
}

.preview-metrics strong {
  font-size: 9px;
}

.preview-approval {
  border: var(--border-width) solid var(--landing-preview-green-border);
  border-radius: var(--radius-control);
  background: var(--landing-preview-green-soft);
  padding: var(--space-2);
}

.preview-approval button {
  border-radius: var(--radius-control);
  padding: var(--space-1) var(--space-2);
  background: var(--landing-accent);
  color: var(--landing-text);
  font-size: 7px;
}

.preview-control-note {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-1);
}

.preview-control-note span {
  color: var(--landing-success);
  font-weight: 800;
}

.phone-device {
  position: absolute;
  right: -1%;
  top: 29%;
  width: var(--landing-phone-width);
  box-shadow: var(--landing-phone-shadow);
  z-index: 2;
}

.phone-preview {
  left: 13.2%;
  top: 5.2%;
  width: 73.6%;
  height: 88.2%;
  border-radius: 28px;
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-2) var(--space-2);
  font-size: var(--font-size-code);
}

.phone-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-1);
  border-bottom: var(--border-width) solid var(--landing-preview-border);
}

.phone-preview-head strong {
  font-size: 8px;
}

.phone-preview article {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  padding: var(--space-1) 0;
}

.phone-preview article strong,
.phone-ai-note strong {
  font-size: 7px;
}

.phone-unread {
  width: var(--space-1);
  height: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--landing-accent);
}

.phone-ai-note {
  border-radius: var(--radius-control);
  background: var(--landing-preview-blue-soft);
  padding: var(--space-1);
}

.phone-linked {
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--landing-success-soft);
  color: var(--green-fg) !important;
  text-align: center;
}

.landing-proof-card {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 174px;
  border: var(--border-width) solid var(--landing-proof-border);
  border-radius: var(--radius-inner);
  background: var(--landing-proof-bg);
  box-shadow: var(--shadow-modal);
  padding: var(--space-2);
  backdrop-filter: blur(14px);
}

.landing-proof-card > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  background: var(--landing-proof-icon-bg);
  color: var(--landing-proof-icon);
  font-size: var(--font-size-code);
  font-weight: 800;
}

.landing-proof-card div {
  display: grid;
  gap: 2px;
}

.landing-proof-card strong {
  color: var(--landing-text);
  font-size: 11px;
}

.landing-proof-card small {
  color: var(--landing-text-soft);
  font-size: 9px;
}

.landing-proof-card-top {
  top: 5%;
  right: 7%;
}

.landing-proof-card-bottom {
  bottom: 13%;
  left: -2%;
}

.landing-auth-panel,
.registration-hint {
  position: absolute;
  z-index: 2;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--auth-panel-max-width), calc(100vw - (var(--space-3) * 2)));
  border: var(--border-width) solid var(--landing-panel-border);
  border-radius: var(--radius-panel);
  background: var(--landing-panel);
  color: var(--landing-text);
  padding: var(--space-4);
}

.landing-auth-panel input {
  background: var(--landing-bg);
  color: var(--landing-text);
  border-color: var(--landing-panel-border);
}

.landing-auth-panel label,
.registration-hint,
.landing-auth-panel p {
  color: var(--landing-text-soft);
}

.auth-panel {
  margin: var(--space-0);
  max-width: var(--auth-panel-max-width);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
  background: var(--color-bg);
}

.app-sidebar {
  position: sticky;
  top: var(--space-0);
  height: 100vh;
  border-right: var(--border-width) solid var(--color-border);
  background: var(--color-panel);
  padding: var(--space-4) var(--space-3);
}

.sidebar-brand {
  font-weight: 800;
  margin-bottom: var(--space-4);
}

.sidebar-nav {
  display: grid;
  gap: var(--space-1);
}

.sidebar-link {
  display: block;
  border-radius: var(--radius-control);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link-active {
  background: var(--color-surface-subtle);
  color: var(--color-accent-strong);
}

.app-workspace {
  min-width: var(--space-0);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-0) var(--space-3) var(--space-3);
}

.admin-shell {
  min-height: var(--landing-min-height);
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-panel);
  padding: var(--space-3);
}

.admin-panel {
  width: min(var(--layout-landing-max-width), var(--full-width));
}

.admin-table {
  display: grid;
  gap: var(--space-2);
}

.admin-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.5fr) minmax(0, 0.9fr) minmax(0, 0.4fr);
  gap: var(--space-3);
  align-items: center;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-subtle);
  padding: var(--space-3);
}

.admin-account-row span {
  display: block;
  color: var(--color-muted);
  margin-top: var(--space-1);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--layout-topbar-height);
  margin-inline: calc(var(--space-3) * -1);
  border-bottom: var(--border-width) solid var(--color-border);
  background: var(--color-panel);
  padding: var(--space-3);
}

.topbar-spacer {
  min-width: var(--space-0);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-actions select {
  width: var(--control-theme-width);
}

.clock {
  min-width: 72px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-text);
  font-weight: 800;
  padding: var(--space-1) var(--space-3);
  text-align: center;
}

.llm-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.split-button {
  display: inline-flex;
  align-items: stretch;
}

.split-button button {
  border-radius: var(--space-0);
  border: var(--border-width) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
}

.split-button button:first-child {
  border-radius: var(--radius-pill) var(--space-0) var(--space-0) var(--radius-pill);
}

.split-button button:last-child {
  border-left: var(--space-0);
  border-radius: var(--space-0) var(--radius-pill) var(--radius-pill) var(--space-0);
  padding-inline: var(--space-2);
}

.split-button button.llm-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-panel);
}

.llm-lab-panel {
  order: 0;
}

[data-page] {
  display: none;
}

[data-page].page-active {
  display: block;
}

.mail-page.page-active {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.mail-folders {
  position: sticky;
  top: calc(var(--layout-topbar-height) + var(--space-3));
  display: grid;
  gap: var(--space-1);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-panel);
  padding: var(--space-3);
}

.mail-compose-button {
  margin-bottom: var(--space-2);
}

.mail-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: var(--border-width) solid transparent;
  background: transparent;
  color: var(--color-text);
  text-align: left;
}

.mail-folder:hover,
.mail-folder-active {
  border-color: var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-accent-strong);
}

.mail-main {
  display: grid;
  gap: 0;
  min-width: var(--space-0);
}

.mail-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-panel);
  padding: var(--space-3);
}

.mail-view {
  display: none;
}

.mail-view-active {
  display: block;
}

.mail-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.mail-settings-status {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}

.mail-editor-field {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  color: var(--color-muted);
}

.mail-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border: var(--border-width) solid var(--color-border);
  border-bottom: var(--space-0);
  border-radius: var(--radius-control) var(--radius-control) var(--space-0) var(--space-0);
  background: var(--color-surface-subtle);
  padding: var(--space-1);
}

.mail-editor-toolbar button {
  width: 36px;
  min-height: 32px;
  border: var(--border-width) solid transparent;
  background: transparent;
  color: var(--color-text);
  padding: var(--space-1);
}

.mail-editor-toolbar button:hover {
  border-color: var(--color-border);
  background: var(--color-panel);
}

.mail-editor {
  min-height: 220px;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--space-0) var(--space-0) var(--radius-control) var(--radius-control);
  background: var(--color-panel);
  color: var(--color-text);
  padding: var(--space-3);
  overflow-wrap: anywhere;
}

.mail-editor:focus {
  outline: var(--space-0);
  box-shadow: var(--shadow-focus);
}

.mail-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.mail-compose-attachments {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: 12px;
}

.mail-attachment-picker {
  border: var(--border-width) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
}

.mail-compose-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.mail-compose-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto 24px;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  min-height: 34px;
  padding: 4px 6px 4px 10px;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-subtle);
}

.mail-compose-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-compose-attachment small {
  color: var(--color-muted);
  white-space: nowrap;
}

.mail-compose-attachment button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 18px;
}

.mail-compose-actions button:first-child {
  border: var(--border-width) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
}

.check-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 42px;
}

.check-line input {
  width: auto;
}

.mail-dev-panel {
  margin-top: var(--space-3);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: var(--font-size-title);
  letter-spacing: 0;
}

h2 {
  font-size: var(--font-size-section);
  margin-bottom: var(--space-3);
}

p {
  color: var(--color-muted);
  margin-top: var(--space-1);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(var(--kanban-column-min-width), 1fr));
  gap: var(--space-2);
  min-height: 62vh;
}

.kanban-column {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-kanban-column);
  padding: var(--space-2);
  min-width: var(--space-0);
}

.kanban-card-stage {
  --kanban-stage: var(--color-stage-card);
}

.kanban-warehouse {
  --kanban-stage: var(--color-stage-warehouse);
}

.kanban-supplier {
  --kanban-stage: var(--color-stage-supplier);
}

.kanban-logistics {
  --kanban-stage: var(--color-stage-logistics);
}

.kanban-economics {
  --kanban-stage: var(--color-stage-economics);
}

.kanban-documents {
  --kanban-stage: var(--color-stage-documents);
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 36px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-control);
  background: var(--kanban-stage);
  color: var(--color-stage-ink);
  padding: var(--space-2);
}

.kanban-head .badge {
  background: var(--color-stage-counter);
  color: var(--color-stage-ink);
  border: var(--border-width) solid var(--color-stage-counter-border);
}

.kanban-list {
  display: grid;
  gap: var(--space-2);
}

.kanban-card {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  padding: var(--space-2);
  cursor: pointer;
}

.kanban-card:hover {
  border-color: var(--color-accent);
}

.panel {
  background: var(--color-panel);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-panel);
  padding: var(--space-3);
}

.kanban-panel {
  order: 1;
}

.kanban-panel.page-active {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}

.kanban-panel.page-active .kanban {
  flex: 1 1 auto;
  min-height: calc(100vh - 190px);
}

.controls-grid {
  order: 5;
}

.onboarding-panel {
  order: 2;
}

.requests-panel {
  order: 3;
  display: none !important;
}

.detail-panel {
  order: 4;
}

.detail-panel.page-active {
  min-height: calc(100vh - 96px);
}

.data-grid {
  order: 6;
}

.inventory-catalog-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.inventory-entry-shell {
  grid-column: 1 / -1;
  min-width: 0;
}

.inventory-entry-shell.page-active {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.inventory-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.inventory-import-panel,
.inventory-manual-panel {
  align-self: start;
}

.inventory-selection-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--color-surface-subtle);
  padding: var(--space-2);
}

.inventory-modal {
  width: min(480px, calc(100vw - 32px));
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-panel);
  color: var(--color-text);
  padding: var(--space-3);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.inventory-modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.inventory-modal input {
  border-color: var(--color-accent);
  background: var(--color-panel);
  color: var(--color-text);
}

.inventory-modal-actions {
  justify-content: flex-end;
}

.inventory-edit-panel {
  margin-block: var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-subtle);
  padding: var(--space-3);
}

.inventory-select-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0;
}

.inventory-select-cell input {
  width: auto;
  margin: 0;
}

.inventory-row-selected {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}

.inventory-row-actions button {
  width: auto;
  padding: var(--space-1) var(--space-2);
}

.danger-button {
  border-color: var(--red-fg);
  background: var(--red-bg);
  color: var(--red-fg);
}

.supplier-universal-toggle {
  width: 100%;
  margin-bottom: var(--space-2);
}

.supplier-entry-shell.page-active {
  display: grid;
  gap: var(--space-3);
}

.supplier-entry-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.supplier-entry-actions .panel-note {
  margin: var(--space-0);
}

.supplier-create-panel {
  align-self: start;
}

.supplier-modal {
  max-height: calc(100vh - (var(--space-4) * 2));
  overflow-y: auto;
}

.customers-panel {
  grid-column: 1 / -1;
}

.app-shell .customer-item-button {
  display: block;
  width: 100%;
  border: var(--space-0);
  border-radius: var(--space-0);
  background: transparent;
  color: var(--color-text);
  text-align: left;
  padding-inline: var(--space-0);
}

.app-shell .customer-item-button:hover {
  background: var(--color-surface-subtle);
  filter: none;
}

.customer-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.customer-requisites-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 10px 0;
}

.customer-requisites-grid span {
  display: grid;
  gap: 2px;
}

.customer-requisites-grid small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.customer-open-deals {
  margin-top: 10px;
}

.customer-empty-state {
  gap: var(--space-3);
}

.app-shell .supplier-item-button {
  display: block;
  width: 100%;
  border: var(--space-0);
  border-radius: var(--space-0);
  background: transparent;
  color: var(--color-text);
  text-align: left;
  padding-inline: var(--space-0);
}

.app-shell .supplier-item-button:hover {
  background: var(--color-surface-subtle);
  filter: none;
}

.app-shell .supplier-universal-toggle[aria-pressed="false"] {
  border: var(--border-width) solid var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  box-shadow: none;
}

.app-shell .supplier-universal-toggle[aria-pressed="true"] {
  border: var(--border-width) solid var(--green-fg);
  background: var(--green-bg);
  color: var(--green-fg);
  box-shadow: none;
}

.supplier-form-status:not(:empty) {
  margin-bottom: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  padding: var(--space-2);
}

.supplier-item-head,
.supplier-manufacturers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.supplier-item-head {
  justify-content: space-between;
}

.supplier-manufacturers {
  margin-top: var(--space-2);
}

.supplier-manufacturer-tag {
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-hover);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-code);
  font-weight: var(--font-weight-semibold);
}

.supplier-detail-page {
  grid-column: 1 / -1;
  gap: var(--space-3);
}

.supplier-detail-page.page-active {
  display: grid;
}

.supplier-detail-overview {
  display: grid;
  gap: var(--space-3);
}

.supplier-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.supplier-detail-heading h2 {
  margin: var(--space-1) 0 0;
  font-size: 20px;
  line-height: 28px;
}

.supplier-detail-badges,
.supplier-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.supplier-detail-meta span {
  border-right: var(--border-width) solid var(--color-border);
  color: var(--color-muted);
  padding-right: var(--space-2);
}

.supplier-detail-meta span:last-child {
  border-right: 0;
  padding-right: 0;
}

.supplier-detail-form {
  display: grid;
}

.supplier-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-3);
}

.supplier-detail-manufacturers-field {
  grid-column: 1 / -1;
}

.supplier-detail-actions {
  justify-content: flex-end;
}

.supplier-history-panel {
  min-height: 320px;
}

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

.supplier-timeline {
  display: grid;
  gap: var(--space-2);
}

.panel-note,
.inventory-import-status {
  color: var(--color-muted);
}

.panel-note {
  margin-block: var(--space-2) var(--space-3);
}

.inventory-import-status:not(:empty) {
  margin-top: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--color-surface-subtle);
  padding: var(--space-2);
}

.inventory-import-source-grid,
.inventory-manual-grid,
.inventory-mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.inventory-import-source-grid {
  margin-top: var(--space-3);
}

.inventory-import-actions {
  margin-block: var(--space-2) var(--space-3);
}

.inventory-preview,
#catalog {
  min-width: 0;
  overflow-x: auto;
}

.inventory-preview-table,
.inventory-table {
  min-width: var(--inventory-table-min-width);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  overflow: hidden;
}

.inventory-preview-table {
  min-width: var(--inventory-preview-min-width);
}

.inventory-preview-row,
.inventory-row {
  display: grid;
  align-items: center;
  gap: var(--space-2);
  border-bottom: var(--border-width) solid var(--color-border);
  padding: var(--space-2);
}

.inventory-preview-row {
  grid-template-columns: var(--inventory-preview-columns);
}

.inventory-row {
  grid-template-columns: var(--inventory-table-columns);
}

.inventory-preview-row:last-child,
.inventory-row:last-child {
  border-bottom: 0;
}

.inventory-preview-head,
.inventory-head {
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  font-weight: var(--font-weight-semibold);
}

.inventory-preview-error {
  background: var(--red-bg);
  color: var(--red-fg);
}

.panel-head,
.actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

label {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  color: var(--color-muted);
}

.session-state {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  padding: var(--space-1) var(--space-3);
}

.list {
  display: grid;
  gap: var(--space-2);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(var(--control-inline-min), auto);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.checklist {
  display: grid;
  gap: var(--space-2);
}

.item {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: var(--space-3);
}

.status-card {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--color-surface-subtle);
}

.status-ok {
  border-color: var(--color-accent);
}

.status-warning {
  border-color: var(--color-warning);
}

.check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: var(--space-3);
}

.check-item-done {
  border-color: var(--color-accent);
  background: var(--color-surface-subtle);
}

.item-active {
  border-color: var(--color-accent);
  background: var(--color-surface-subtle);
}

.item-row,
.detail-head,
.line-card,
.inline-form {
  display: grid;
  gap: var(--space-3);
  align-items: center;
}

.item-row,
.detail-head,
.line-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) minmax(var(--control-inline-min), auto) auto;
  margin-top: var(--space-3);
}

.line {
  margin-top: var(--space-2);
  color: var(--color-muted);
}

.line-select {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
  color: var(--color-muted);
}

.detail-empty {
  color: var(--color-muted);
  border: var(--border-width) dashed var(--color-border);
  border-radius: var(--radius-control);
  padding: var(--space-4);
}

.detail {
  display: grid;
  gap: var(--space-3);
}

.lines-table {
  display: grid;
  gap: 0;
}

.request-requirements {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.request-requirements-head,
.requirement-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(100px, 160px) minmax(70px, 110px) minmax(70px, 90px);
  align-items: center;
}

.request-sidecard .request-requirements-head,
.request-sidecard .requirement-row {
  grid-template-columns: minmax(0, 1.5fr) minmax(76px, .9fr) 58px 40px;
}

.request-sidecard .request-requirements-head > *,
.request-sidecard .requirement-row > * {
  padding: 7px 6px;
  font-size: 11px;
}

.request-requirements-head {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-brand-link {
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
}

.sidebar-brand-link:hover {
  color: inherit;
}

.sidebar-brand-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--primary-focus-rgb), 0.2);
}

.request-requirements-head > *,
.requirement-row > * {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.request-requirements-head > *:last-child,
.requirement-row > *:last-child {
  border-right: 0;
}

.requirement-row {
  min-height: 38px;
  background: var(--panel);
}

.requirement-row + .requirement-row {
  border-top: 1px solid var(--border);
}

.requirement-row > * {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 400;
}

.requirement-row span {
  color: var(--muted);
}

.requirement-row .requirement-name {
  color: var(--text);
}

.line-card {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: var(--space-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-panel);
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
}

.badge-muted {
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  border: var(--border-width) solid var(--color-border);
}

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

.badge-soon {
  background: var(--color-warning);
}

.badge-none,
.badge-ok {
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  border: var(--border-width) solid var(--color-border);
}

h3 {
  margin: var(--space-2) var(--space-0) var(--space-0);
  font-size: var(--font-size-subsection);
  letter-spacing: var(--space-0);
}

pre {
  min-height: var(--pre-min-height);
  max-height: var(--pre-max-height);
  overflow: auto;
  margin: var(--space-0);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-code);
  white-space: pre-wrap;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .landing-nav,
  .landing-shell {
    width: calc(100vw - (var(--space-4) * 2));
  }

  .landing-nav {
    padding: var(--space-3) 0;
  }

  .landing-shell {
    min-height: calc(var(--landing-min-height) - 82px);
    padding: var(--space-3) 0 var(--space-4);
  }

  .landing-hero {
    grid-template-columns: minmax(300px, 0.78fr) minmax(460px, 1.22fr);
    gap: var(--space-4);
  }

  .landing-hero h1 {
    margin-bottom: var(--space-3);
    font-size: 48px;
  }

  .landing-promise {
    margin-bottom: var(--space-2);
    font-size: 26px;
  }

  .landing-description {
    font-size: var(--font-size-subsection);
  }

  .landing-actions,
  .landing-capabilities {
    margin-top: var(--space-3);
  }

  .device-composition,
  .laptop-device {
    width: min(560px, 58vw);
  }

  .phone-device {
    width: 118px;
  }

  .landing-proof-card {
    min-width: 152px;
    padding: var(--space-1) var(--space-2);
  }

  .landing-proof-card-top {
    right: 3%;
  }

  .landing-proof-card-bottom {
    left: -1%;
  }
}

@media (max-width: 760px) {
.request-requirements {
    overflow-x: auto;
  }

  .request-requirements-head,
  .requirement-row {
    min-width: 700px;
  }

  .app-shell {
    grid-template-columns: var(--grid-single-column);
  }

  .app-sidebar {
    position: static;
    height: auto;
    border-right: var(--space-0);
    border-bottom: var(--border-width) solid var(--color-border);
  }

  .sidebar-nav,
  .topbar-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .grid,
  .landing-hero,
  .landing-strip,
  .kanban,
  .mail-page.page-active,
  .mail-settings-form,
  .toolbar,
  .topbar,
  .admin-topbar,
  .admin-account-row,
  .landing-nav,
    .item-row,
    .detail-head,
    .line-card,
    .check-item,
    .inline-form {
    grid-template-columns: var(--grid-single-column);
    display: grid;
  }

  .landing-nav-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: var(--full-width);
  }

  .landing-nav-actions select {
    width: var(--full-width);
  }

  .landing-nav {
    display: flex;
    padding: var(--space-3) 0;
  }

  .landing-nav-actions {
    display: flex;
    width: auto;
  }

  .landing-nav-actions .landing-secondary {
    display: none;
  }

  .landing-shell {
    min-height: auto;
    padding-top: var(--space-4);
  }

  .landing-hero {
    gap: var(--space-5);
  }

  .landing-copy {
    max-width: var(--full-width);
    text-align: center;
  }

  .landing-hero h1 {
    font-size: 46px;
  }

  .landing-promise {
    font-size: 26px;
  }

  .landing-description {
    margin: var(--space-0) auto;
  }

  .landing-actions,
  .landing-capabilities {
    justify-content: center;
  }

  .device-composition {
    width: min(var(--full-width), 620px);
    justify-self: center;
  }

  .laptop-device {
    width: var(--full-width);
    transform: none;
  }

  .phone-device {
    width: var(--landing-phone-mobile-width);
    top: var(--landing-phone-mobile-top);
  }

  .landing-proof-card {
    display: none;
  }

  .laptop-preview {
    padding: var(--space-2);
  }

  .preview-layout {
    grid-template-columns: var(--grid-single-column);
  }

  .preview-sidebar {
    display: none;
  }

  .preview-layout {
    grid-template-columns: var(--grid-single-column);
  }
}

/* Office One app redesign. Landing selectors above stay isolated. */
.app-shell {
  --color-bg: var(--bg);
  --color-panel: var(--surface);
  --color-text: var(--text-primary);
  --color-muted: var(--text-secondary);
  --color-border: var(--border);
  --color-accent: var(--primary);
  --color-accent-strong: var(--primary-hover);
  --color-surface-subtle: var(--surface-subtle);
  --app-sidebar-width: 184px;
  --sidebar-motion-duration: 220ms;
  --sidebar-motion-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --mail-folders-width: 232px;
  --mail-sender-width: 240px;
  --mail-subject-width: 170px;
  --mail-snippet-width: 360px;
  --mail-meta-width: 108px;
  --mail-date-width: 110px;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns var(--sidebar-motion-duration) var(--sidebar-motion-easing);
  background: var(--bg);
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.app-shell.app-sidebar-collapsed {
  --app-sidebar-width: 72px;
}

.app-shell button,
.app-shell input,
.app-shell select,
.app-shell textarea {
  min-height: 36px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  line-height: 20px;
}

.app-shell button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--primary-gradient);
  color: var(--surface);
  font-weight: 600;
  padding: 0 16px;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease, filter 150ms ease;
}

.app-shell button:hover {
  filter: brightness(0.95);
  background: var(--primary-gradient);
}

.app-shell input,
.app-shell select,
.app-shell textarea,
.mail-editor {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  padding: 0 12px;
}

.app-shell textarea,
.mail-editor {
  padding-block: 10px;
}

.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: var(--text-tertiary);
}

.app-shell button:focus-visible,
.app-shell input:focus-visible,
.app-shell select:focus-visible,
.app-shell textarea:focus-visible,
.mail-editor:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-focus-rgb), 0.12);
}

.app-sidebar {
  width: var(--app-sidebar-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 8px;
  overflow: hidden;
  transition: width var(--sidebar-motion-duration) var(--sidebar-motion-easing);
}

.sidebar-brand {
  position: relative;
  height: 36px;
  min-height: 36px;
  margin: 0 4px 16px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}

.sidebar-brand-link {
  position: absolute;
  top: 6px;
  left: 0;
  white-space: nowrap;
  transition:
    opacity var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    transform var(--sidebar-motion-duration) var(--sidebar-motion-easing);
}

.sidebar-toggle,
.mail-folders-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0 !important;
  border-radius: var(--radius-btn);
  background: transparent !important;
  color: var(--text-secondary) !important;
  padding: 0 !important;
}

.app-shell .sidebar-toggle {
  position: absolute;
  top: 0;
  right: 0;
  transition:
    right var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    background 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease;
}

.sidebar-toggle:hover,
.mail-folders-toggle:hover {
  background: var(--surface-subtle) !important;
  color: var(--text-primary) !important;
}

.sidebar-nav {
  gap: 2px;
  width: 100%;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 0 6px;
  overflow: hidden;
  white-space: nowrap;
  transition:
    padding-left var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    gap var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    background 150ms ease,
    color 150ms ease;
}

.sidebar-label {
  display: block;
  max-width: 132px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  transition:
    max-width var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    opacity 160ms ease,
    transform var(--sidebar-motion-duration) var(--sidebar-motion-easing);
}

.app-sidebar-collapsed .sidebar-brand-link,
.app-sidebar-collapsed .sidebar-link {
  overflow: hidden;
}

.request-requirements-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.app-shell .request-lines-edit-button {
  width: auto;
  min-height: 30px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-secondary);
  padding: 0 10px;
  box-shadow: none;
  font-size: 12px;
}

.request-line-editor-head,
.request-line-editor-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(110px, 160px) minmax(80px, 110px) minmax(70px, 90px) 90px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.request-line-editor-head {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.request-line-editor-row + .request-line-editor-row {
  border-top: 1px solid var(--border);
}

.request-line-editor-row input {
  min-width: 0;
  min-height: 34px;
}

.app-shell .request-line-delete {
  min-height: 34px;
  border: 1px solid #e8c7c7;
  background: #fff6f6;
  color: #9a3f3f;
  box-shadow: none;
  padding: 0 8px;
}

.request-line-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 10px;
}

.request-line-editor-spacer {
  flex: 1;
}

.request-lines-page {
  min-height: calc(100vh - 112px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

[data-page].request-lines-page.page-active {
  display: grid;
}

.request-lines-page-head,
.request-lines-page-toolbar,
.request-lines-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.request-lines-page-head {
  border-bottom: 1px solid var(--border);
}

.request-lines-page-head h2,
.request-lines-page-head p {
  margin: 0;
}

.request-lines-page-head p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.request-lines-page-kicker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.request-lines-page-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.request-lines-page-toolbar {
  justify-content: flex-start;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.request-lines-page-toolbar input {
  width: min(560px, 60vw);
}

.request-lines-page-toolbar .badge {
  margin-left: auto;
}

.request-lines-table-wrap {
  min-height: 0;
  overflow: auto;
}

.request-line-editor-page-head,
.request-line-editor-page-row {
  min-width: 1050px;
  grid-template-columns: 54px minmax(360px, 1fr) minmax(190px, 240px) 130px 90px 96px;
}

.request-line-editor-page-head {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.request-line-editor-page-row {
  padding-block: 7px;
}

.request-line-editor-page-row:hover {
  background: color-mix(in srgb, var(--surface-subtle) 70%, transparent);
}

.request-line-number {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.request-lines-page-footer {
  min-height: 62px;
  border-top: 1px solid var(--border);
}

.request-lines-page-footer .form-hint {
  margin: 0;
}

.request-requirements-editing > .form-hint {
  padding: 0 10px 10px;
}

@media (max-width: 900px) {
  .request-line-editor-head:not(.request-line-editor-page-head) {
    display: none;
  }

  .request-line-editor-row:not(.request-line-editor-page-row) {
    grid-template-columns: minmax(0, 1fr) minmax(90px, 0.5fr);
  }

  .request-lines-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-lines-page-actions {
    width: 100%;
  }

  .request-lines-page-actions button {
    flex: 1;
  }

  .request-lines-page-toolbar {
    flex-wrap: wrap;
  }

  .request-lines-page-toolbar input {
    width: 100%;
  }
}

.requirement-row.is-collapsed {
  display: none;
}

.app-shell .request-lines-toggle {
  width: auto;
  min-height: 32px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #cbd8ea;
  border-radius: 8px;
  background: #eaf0f8;
  color: #41658f;
  box-shadow: none;
  font-weight: 600;
}

.app-shell .request-lines-toggle:hover {
  background: #dfe9f6;
  filter: none;
}

.app-sidebar-collapsed .sidebar-brand-link {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.app-sidebar-collapsed .sidebar-link {
  height: 36px;
  min-height: 36px;
  width: 100%;
  min-width: 0;
  gap: 0;
  padding: 0 0 0 18px;
}

.app-sidebar-collapsed .sidebar-label {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

.app-shell.app-sidebar-collapsed .sidebar-toggle {
  right: 6px;
}

.app-sidebar-collapsed .sidebar-nav-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0 3px;
  font-size: 9px;
  line-height: 14px;
}

.app-shell .sidebar-toggle:focus {
  box-shadow: none;
}

.app-shell .sidebar-toggle:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--primary-focus-rgb), 0.34);
}

@media (prefers-reduced-motion: reduce) {
  .app-shell,
  .app-sidebar,
  .sidebar-brand-link,
  .app-shell .sidebar-toggle,
  .sidebar-link,
  .sidebar-label {
    transition: none;
  }
}

.app-sidebar-collapsed .sidebar-account {
  grid-template-columns: 32px;
  justify-content: center;
  padding-inline: 0;
}

.app-sidebar-collapsed .sidebar-account > div {
  display: none;
}

.sidebar-link:hover,
.sidebar-link-active {
  background: var(--surface-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--primary-focus-rgb), 0.12);
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor;
}

[data-icon] svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sidebar-account {
  display: none;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 12px 6px 0;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-account strong,
.sidebar-account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account strong {
  font-size: 13px;
  font-weight: 600;
}

.sidebar-account span {
  color: var(--text-secondary);
  font-size: 13px;
}

.app-workspace {
  gap: 16px;
  padding: 0 24px 24px;
}

.topbar {
  min-height: 56px;
  margin-inline: -24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 24px;
}

/* Reference-led grainy shell: keep operational panels and cards unchanged. */
.app-shell {
  --app-chrome-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='.22'/%3E%3C/svg%3E");
  --app-sidebar-gradient:
    radial-gradient(ellipse 145% 30% at 30% 100%, rgba(231, 237, 240, 0.94) 0%, rgba(151, 172, 186, 0.72) 42%, transparent 74%),
    radial-gradient(ellipse 120% 27% at 105% 72%, rgba(5, 39, 65, 0.94) 0%, transparent 72%),
    radial-gradient(ellipse 150% 34% at -15% 56%, rgba(5, 54, 88, 0.96) 0%, transparent 68%),
    linear-gradient(180deg, #020406 0%, #02070c 23%, #05131f 40%, #073858 63%, #68859a 84%, #d5dde2 100%);
  --app-topbar-gradient:
    radial-gradient(ellipse 42% 240% at 94% 145%, rgba(137, 163, 180, 0.78) 0%, transparent 68%),
    radial-gradient(ellipse 56% 220% at 69% 135%, rgba(5, 58, 91, 0.92) 0%, transparent 70%),
    linear-gradient(100deg, #020406 0%, #03090f 34%, #061a2a 61%, #0b3e60 82%, #49677b 100%);
  --app-compact-sidebar-gradient:
    radial-gradient(ellipse 64% 180% at 96% 130%, rgba(8, 61, 94, 0.86) 0%, transparent 72%),
    linear-gradient(105deg, #020406 0%, #03090f 40%, #061a2a 68%, #0a3553 100%);
  --app-workspace-gradient:
    radial-gradient(circle at 82% 4%, rgba(113, 166, 221, 0.3), transparent 34%),
    linear-gradient(145deg, #526d8b 0%, #315b87 52%, #173f69 100%);
  background: #173f69;
}

.app-sidebar {
  border-right-color: rgba(193, 211, 222, 0.18);
  background-color: #03080d;
  background-image: var(--app-chrome-grain), var(--app-sidebar-gradient);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 180px 180px, cover, cover, cover, cover;
  background-blend-mode: soft-light, screen, screen, normal, normal;
  box-shadow: 8px 0 26px rgba(2, 8, 13, 0.2);
}

.app-workspace {
  background: var(--app-workspace-gradient);
}

.topbar {
  border-bottom-color: rgba(193, 211, 222, 0.18);
  background-color: #03080d;
  background-image: var(--app-chrome-grain), var(--app-topbar-gradient);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-size: 180px 180px, cover, cover, cover;
  background-blend-mode: soft-light, screen, screen, normal;
  box-shadow: 0 8px 24px rgba(2, 8, 13, 0.18);
}

.sidebar-brand,
.topbar h1 {
  color: #f6f8fb;
}

.app-shell .sidebar-brand,
.app-shell .topbar h1 {
  font-weight: 500;
}

.topbar p,
.clock {
  color: #d4dfe6;
}

.sidebar-link {
  color: #ffffff;
  font-weight: 400;
}

.sidebar-link:hover,
.sidebar-link-active {
  background: rgba(226, 236, 242, 0.14);
  color: #ffffff;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(232, 240, 245, 0.06);
}

.sidebar-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(188, 211, 236, 0.2);
}

.sidebar-toggle,
.app-shell .sidebar-toggle {
  color: #ffffff !important;
}

.sidebar-toggle:hover,
.app-shell .sidebar-toggle:hover {
  background: rgba(226, 236, 242, 0.14) !important;
  color: #ffffff !important;
}

.sidebar-account strong {
  color: #f6f8fb;
  font-weight: 500;
}

.sidebar-account span {
  color: #d6e2ee;
}

.sidebar-account .account-avatar {
  background: rgba(232, 239, 247, 0.12);
  color: #ffffff;
}

.app-shell .profile-avatar-button {
  border-color: rgba(232, 239, 247, 0.26);
  background: rgba(232, 239, 247, 0.12);
  color: #ffffff;
}

.app-shell .profile-avatar-button:hover {
  border-color: rgba(232, 239, 247, 0.42);
  background: rgba(232, 239, 247, 0.2);
}

.topbar h1 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
}

.topbar p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  margin-top: 0;
}

.topbar-actions {
  gap: 8px;
}

.icon-button,
.app-shell .icon-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.icon-button:hover,
.app-shell .icon-button:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
  filter: none;
}

.app-shell .mail-settings-form button,
.app-shell .inline-form button,
.app-shell .item-row button,
.app-shell .line-card button,
.app-shell .actions button,
.app-shell .mail-compose-actions button:first-child,
.app-shell .mail-folder {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-weight: 500;
}

.app-shell .mail-settings-form button:hover,
.app-shell .inline-form button:hover,
.app-shell .item-row button:hover,
.app-shell .line-card button:hover,
.app-shell .actions button:hover,
.app-shell .mail-compose-actions button:first-child:hover,
.app-shell .mail-folder:hover {
  background: var(--surface-subtle);
  filter: none;
}

.app-shell #quickCreateBtn,
.app-shell .mail-compose-button {
  background: var(--primary-gradient);
  color: var(--surface);
  border: 0;
}

.app-shell #proposalBtn {
  background: var(--ai-gradient);
  color: var(--surface);
  border: 0;
}

.app-shell #matchBtn {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.clock {
  min-width: auto;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0;
}

.profile-menu-wrap {
  position: relative;
}

.profile-avatar-button,
.profile-menu-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: var(--space-0) !important;
  line-height: 1;
}

.profile-avatar-button {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  min-width: var(--profile-avatar-size);
  min-height: var(--profile-avatar-size);
  flex-basis: var(--profile-avatar-size);
}

.profile-avatar-button:hover,
.app-shell .profile-avatar-button:hover {
  border-color: var(--primary);
  background: var(--surface-subtle);
  filter: none;
}

.app-shell .topbar p,
.app-shell .topbar .clock {
  color: #d4dfe6;
}

.app-shell .topbar .profile-avatar-button {
  border-color: rgba(232, 239, 247, 0.26);
  background: rgba(232, 239, 247, 0.12);
  color: #ffffff;
}

.app-shell .topbar .profile-avatar-button:hover {
  border-color: rgba(232, 239, 247, 0.42);
  background: rgba(232, 239, 247, 0.2);
}

.profile-avatar-button img,
.profile-menu-avatar img {
  position: absolute;
  inset: var(--space-0);
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.profile-avatar-fallback {
  font-size: var(--font-size-code);
  font-weight: 700;
}

.profile-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + var(--space-2));
  right: var(--space-0);
  width: min(var(--profile-menu-width), calc(100vw - var(--space-4)));
  border: var(--border-width) solid var(--border);
  border-radius: calc(var(--radius-card) + var(--space-1));
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: var(--space-2);
}

.profile-menu-identity {
  display: grid;
  grid-template-columns: var(--profile-menu-avatar-size) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  border-bottom: var(--border-width) solid var(--border);
  padding: var(--space-1) var(--space-1) var(--space-3);
  margin-bottom: var(--space-1);
}

.profile-menu-identity strong,
.profile-menu-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-identity strong {
  font-size: 14px;
}

.profile-menu-identity > div > span {
  margin-top: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--font-size-code);
}

.profile-menu-avatar {
  width: var(--profile-menu-avatar-size);
  height: var(--profile-menu-avatar-size);
  min-width: var(--profile-menu-avatar-size);
  min-height: var(--profile-menu-avatar-size);
  flex-basis: var(--profile-menu-avatar-size);
}

.profile-menu-item,
.app-shell .profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
  border: var(--space-0);
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  text-align: left;
}

.profile-menu-item:hover,
.app-shell .profile-menu-item:hover {
  background: var(--surface-subtle);
  filter: none;
}

.profile-menu-logout,
.app-shell .profile-menu-logout {
  color: var(--red-fg);
}

.avatar-dialog {
  width: min(620px, calc(100vw - var(--space-4)));
  max-height: calc(100dvh - var(--space-4));
  overflow-y: auto;
  border: var(--border-width) solid var(--border);
  border-radius: calc(var(--radius-card) + var(--space-1));
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
}

.avatar-dialog::backdrop {
  background: color-mix(in srgb, var(--text-primary) 38%, transparent);
}

.avatar-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.avatar-dialog-head h2 {
  margin-bottom: var(--space-1);
}

.avatar-dialog-head p {
  color: var(--text-secondary);
  font-size: 13px;
}

.avatar-crop-area {
  position: relative;
  width: min(var(--profile-crop-size), calc(100vw - var(--space-6)));
  aspect-ratio: 1;
  overflow: hidden;
  margin: var(--space-3) auto;
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-area:active {
  cursor: grabbing;
}

.avatar-crop-area img {
  position: absolute;
  max-width: none;
  transform-origin: top left;
  pointer-events: none;
}

.avatar-crop-ring {
  position: absolute;
  inset: var(--space-0);
  border: calc(var(--border-width) * 3) solid color-mix(in srgb, var(--surface) 82%, transparent);
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 var(--border-width) color-mix(in srgb, var(--text-primary) 18%, transparent);
  pointer-events: none;
}

.avatar-zoom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.avatar-zoom input {
  width: 100%;
}

.avatar-dialog-actions {
  justify-content: flex-end;
  margin-top: var(--space-3);
}

.avatar-delete,
.app-shell .avatar-delete {
  margin-right: auto;
  color: var(--red-fg);
}

.panel,
.mail-head,
.mail-folders,
.kanban-column,
.admin-topbar,
.admin-panel {
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.panel-head,
.actions {
  gap: 8px;
}

.kanban-panel .panel-head {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr);
  align-items: center;
  column-gap: 14px;
  row-gap: 10px;
  margin-bottom: 16px;
}

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

.kanban-search {
  display: block;
  width: 100%;
  margin: 0;
}

.kanban-search input {
  width: 100%;
}

.kanban-panel .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.kanban-panel .actions button {
  margin: 0;
}

.app-shell #quickCreateBtn {
  min-width: 132px;
}

.app-shell #manualCreateBtn {
  min-width: 220px;
}

h2 {
  color: var(--text-primary);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

h3 {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  margin: 16px 0 8px;
}

label {
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.grid {
  gap: 16px;
}

.kanban {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 60vh;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 8px;
  scrollbar-gutter: stable;
}

.kanban-column {
  flex: 0 0 280px;
  min-width: 280px;
  background: var(--stage-column-bg, var(--surface-subtle));
  border-color: color-mix(in srgb, var(--stage-fg, var(--border)) 32%, var(--border));
  box-shadow: none;
  padding: 8px;
}

.app-shell .kanban-head,
.kanban-head {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--stage-fg, var(--border)) 24%, var(--border));
  min-height: 32px;
  margin-bottom: 8px;
  background: var(--stage-bg, var(--surface-subtle));
  color: var(--stage-fg, var(--text-primary));
  padding: 8px;
  cursor: pointer;
  justify-content: space-between;
  filter: none;
}

.kanban-head-toggle {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  flex: 1 1 auto;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  text-align: left;
}

.kanban-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.app-shell .kanban-head:hover,
.kanban-head:hover {
  background: var(--stage-bg, var(--surface-subtle));
  filter: none;
}

.kanban-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.kanban-stage-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--stage-fg, var(--blue-fg));
}

.kanban-stage-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kanban-stage-icon.menu-icon-emoji {
  font-size: 15px;
}

.kanban-card-stage {
  --stage-bg: #dbeafe;
  --stage-column-bg: #f2f7fd;
  --stage-fg: #24569b;
}

.kanban-warehouse {
  --stage-bg: #dcfce7;
  --stage-column-bg: #f2faf5;
  --stage-fg: #2f7048;
}

.kanban-supplier {
  --stage-bg: #fef3c7;
  --stage-column-bg: #fcf8eb;
  --stage-fg: #93610a;
}

.kanban-logistics {
  --stage-bg: #ccfbf1;
  --stage-column-bg: #effaf8;
  --stage-fg: #176d66;
}

.kanban-economics {
  --stage-bg: #f3e8ff;
  --stage-column-bg: #f8f3fc;
  --stage-fg: #704887;
}

.kanban-documents {
  --stage-bg: #eef0f3;
  --stage-column-bg: #f7f8fa;
  --stage-fg: #52616f;
}

.kanban-head .badge {
  min-width: 24px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.68);
  color: var(--stage-fg, var(--text-secondary));
}

.mail-folder > span[id$="Count"] {
  min-width: 0;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
}

.kanban-card {
  border: 0;
  border-radius: var(--radius-inner);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  padding: 12px;
  transition: box-shadow 150ms ease, transform 150ms ease;
  min-width: 0;
  overflow: hidden;
}

.kanban-card:hover,
.kanban-card:focus-visible {
  outline: 0;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.kanban-card strong,
.item strong,
.line-card strong {
  color: var(--text-primary);
  font-weight: 600;
}

.kanban-card.item-active {
  background: var(--surface);
}

.kanban-card-topline {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.kanban-card-topline > strong {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: var(--line-height-card-title);
  overflow-wrap: anywhere;
}

.kanban-card-id {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: var(--font-size-code);
  font-weight: 600;
  line-height: var(--line-height-card-title);
  font-variant-numeric: tabular-nums;
}

.kanban-card-deadline {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.kanban-column-collapsed {
  flex-basis: 52px;
  min-width: 52px;
  padding: 6px;
}

.kanban-column-collapsed .kanban-head {
  min-height: 78px;
  margin-bottom: 0;
  flex-direction: column;
  justify-content: center;
  padding: 8px 4px;
}

.kanban-column-collapsed .kanban-head-toggle {
  flex: 0 0 auto;
}

.kanban-column-collapsed .kanban-head-actions {
  flex-direction: column;
  gap: 4px;
}

.kanban-column-collapsed .kanban-head strong {
  justify-content: center;
}

.kanban-column-collapsed .kanban-stage-label,
.kanban-column-collapsed .kanban-list {
  display: none;
}

.kanban-column-collapsed .kanban-head .badge {
  min-width: 24px;
}

.kanban-list {
  gap: 8px;
}

.kanban-list p,
.list p,
.detail-empty {
  color: var(--text-tertiary);
  font-size: 13px;
}

@media (min-width: 761px) {
  /* Every operational screen owns the full white workspace; panels inside it may
     still use cards, but there is no blue gutter or framed outer canvas. */
  .app-workspace {
    background: var(--surface);
  }

  .controls-grid > .panel.page-active,
  .data-grid > .panel.page-active,
  .app-workspace > .panel.page-active {
    border-radius: 0;
    box-shadow: none;
  }

  .app-workspace[data-active-page="requestDetail"] {
    gap: 0;
    background: var(--surface);
    padding: 0;
  }

  .app-workspace[data-active-page="requestDetail"] .topbar {
    margin-inline: 0;
  }

  .app-workspace[data-active-page="requestDetail"] .detail-panel.page-active {
    min-height: calc(100vh - var(--layout-topbar-height));
    border-radius: 0;
    box-shadow: none;
  }

  .app-workspace[data-active-page="crm"] {
    gap: 0;
    background: var(--surface);
    padding: 0;
  }

  .app-workspace[data-active-page="crm"] .topbar {
    margin-inline: 0;
    padding-inline: 8px;
  }

  .app-workspace[data-active-page="crm"] .kanban-panel.page-active {
    min-height: calc(100vh - var(--layout-topbar-height));
    height: calc(100vh - var(--layout-topbar-height));
    max-height: calc(100vh - var(--layout-topbar-height));
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    padding: 8px 8px 8px;
  }

  .app-workspace[data-active-page="crm"] .kanban-panel .panel-head {
    grid-template-columns: auto auto minmax(180px, 1fr);
    column-gap: 6px;
    margin-bottom: 6px;
  }

  .app-workspace[data-active-page="crm"] .kanban-panel .panel-head h2 {
    font-weight: 500;
  }

  .app-workspace[data-active-page="crm"] .kanban-panel .actions {
    gap: 6px;
  }

  .app-workspace[data-active-page="crm"] .kanban-panel .actions button,
  .app-workspace[data-active-page="crm"] .kanban-search input {
    min-height: 34px;
    height: 34px;
  }

  .app-workspace[data-active-page="crm"] #quickCreateBtn {
    min-width: 112px;
  }

  .app-workspace[data-active-page="crm"] #manualCreateBtn {
    min-width: 196px;
  }

  .app-workspace[data-active-page="crm"] .kanban-panel.page-active .kanban,
  .app-workspace[data-active-page="crm"] .kanban {
    flex: 1 1 auto;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    overflow-y: hidden;
    padding-bottom: 6px;
  }

  .app-workspace[data-active-page="crm"] .kanban-column {
    position: relative;
    flex: 1 0 174px;
    min-width: 174px;
    align-self: stretch;
    border: 0;
    border-right: 1px dashed #bdc7d2;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 5px 6px;
  }

  .app-workspace[data-active-page="crm"] .kanban-column:first-child {
    padding-left: 0;
  }

  .app-workspace[data-active-page="crm"] .kanban-column:last-child {
    border-right: 0;
    padding-right: 0;
  }

  .app-workspace[data-active-page="crm"] .kanban-head {
    min-height: 32px;
    margin-bottom: 4px;
    border-radius: 8px;
    padding: 4px 5px;
  }

  .app-workspace[data-active-page="crm"] .kanban-head-toggle {
    min-height: 24px;
  }

  .app-workspace[data-active-page="crm"] .kanban-head strong {
    gap: 6px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
  }

  .app-workspace[data-active-page="crm"] .kanban-head-actions {
    gap: 3px;
  }

  .app-workspace[data-active-page="crm"] .kanban-head .badge {
    min-width: 21px;
    min-height: 21px;
    padding-inline: 5px;
  }

  .app-workspace[data-active-page="crm"] .kanban-list {
    gap: 4px;
  }

  .app-workspace[data-active-page="crm"] .kanban-card {
    border: 1px solid #e0e4e9;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(21, 38, 57, 0.08);
    padding: 7px;
  }

  .app-workspace[data-active-page="crm"] .kanban-card-topline > strong {
    font-size: 13px;
    line-height: 17px;
    font-weight: 500;
  }

  .app-workspace[data-active-page="crm"] .kanban-card-deadline {
    margin-top: 4px;
    font-size: 11px;
    line-height: 15px;
  }

  .app-workspace[data-active-page="crm"] .kanban-column-collapsed {
    flex: 0 0 42px;
    min-width: 42px;
    padding-inline: 4px;
  }

  .app-workspace[data-active-page="crm"] .kanban-column-collapsed .kanban-head {
    min-height: 68px;
    padding: 6px 2px;
  }
}

.tender-admin-panel {
  display: none;
}

.tender-monitor-panel {
  display: none !important;
}

[data-page].tender-admin-panel.page-active {
  display: none;
}

.tender-chat-panel {
  grid-column: 1 / -1;
  width: min(1180px, 100%);
  min-height: calc(100vh - 154px);
  height: calc(100vh - 154px);
  display: none;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 12px;
}

[data-page].tender-chat-panel.page-active {
  display: grid;
}

.tender-chat-messages {
  min-height: 260px;
  display: grid;
  align-content: end;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.tender-chat-message {
  display: flex;
}

.tender-chat-message.operator {
  justify-content: flex-end;
}

.tender-chat-bubble {
  max-width: min(1080px, 94%);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  color: var(--text-primary);
  padding: 12px;
}

.tender-chat-bubble time {
  display: block;
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
  text-align: right;
}

.tender-chat-message.operator .tender-chat-bubble time {
  color: rgba(255, 255, 255, 0.72);
}

.tender-chat-message.operator .tender-chat-bubble {
  background: var(--primary-gradient);
  color: var(--surface);
}

.tender-chat-tenders {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.tender-chat-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius-inner);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.tender-chat-card button,
.tender-chat-composer button {
  min-height: 40px;
}

.tender-chat-detail {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border-radius: var(--radius-inner);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.tender-chat-tenderplan {
  border-radius: var(--radius-inner);
  background: var(--surface-subtle);
  padding: 10px;
}

.tender-chat-tenderplan summary {
  cursor: pointer;
  font-weight: 700;
}

.tender-chat-tenderplan dl {
  margin-top: 10px;
}

.tender-chat-detail dl {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.tender-chat-detail dt {
  color: var(--text-tertiary);
}

.tender-chat-detail dd {
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.tender-chat-links,
.tender-chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tender-chat-positions,
.tender-chat-documents {
  min-width: 0;
}

.tender-chat-positions summary,
.tender-chat-documents summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 8px;
}

.tender-chat-positions summary span,
.tender-chat-documents summary span {
  margin-left: 4px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.tender-chat-position-table {
  min-width: 560px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-inner);
  overflow: hidden;
}

.tender-chat-positions[open] {
  overflow-x: auto;
}

.tender-chat-position-head,
.tender-chat-position-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 110px 72px 60px;
}

.tender-chat-position-head {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-weight: 700;
}

.tender-chat-position-head span,
.tender-chat-position-row span {
  min-width: 0;
  padding: 7px 8px;
  border-right: 1px solid var(--border-subtle);
  overflow-wrap: anywhere;
}

.tender-chat-position-head span:last-child,
.tender-chat-position-row span:last-child {
  border-right: 0;
}

.tender-chat-position-row + .tender-chat-position-row {
  border-top: 1px solid var(--border-subtle);
}

.tender-chat-links a,
.tender-chat-attachments a,
.tender-chat-attachments span {
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-primary);
  padding: 6px 10px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tender-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: var(--color-panel);
}

.item,
.line-card,
.check-item {
  border: 0;
  border-radius: var(--radius-inner);
  background: transparent;
  padding: 12px;
}

.list > .item,
.list > .line-card,
.list > .check-item {
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding-inline: 0;
}

.list > .item:last-child,
.list > .line-card:last-child,
.list > .check-item:last-child {
  border-bottom: 0;
}

.item:hover,
.line-card:hover,
.check-item:hover {
  background: var(--surface-subtle);
}

.item-active,
.check-item-done {
  background: var(--primary-soft);
}

.detail-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 0;
  border-radius: var(--radius-inner);
  background: var(--surface-subtle);
  padding: 18px;
}

.line {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.badge {
  min-height: 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--blue-bg);
  color: var(--blue-fg);
  padding: 2px 10px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.badge-muted,
.badge-none,
.badge-ok {
  background: var(--gray-bg);
  color: var(--gray-fg);
}

.badge-overdue {
  background: var(--red-bg);
  color: var(--red-fg);
}

.badge-soon {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.badge-success,
.check-item-done .badge {
  background: var(--green-bg);
  color: var(--green-fg);
}

.mail-page.page-active {
  grid-template-columns: var(--mail-folders-width) minmax(0, 1fr);
  gap: 16px;
}

.mail-page.mail-folders-collapsed {
  --mail-folders-width: 72px;
}

.mail-folders {
  top: 72px;
  gap: 4px;
  transition: width 160ms ease;
}

.mail-compose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.mail-compose-button {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  padding-inline: 12px;
}

.mail-folder {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  justify-content: start;
  gap: 10px;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  padding: 0 10px;
  text-align: left;
}

.mail-folders-toggle {
  justify-self: end;
}

.mail-folders-collapsed .mail-folders {
  align-items: center;
}

.mail-folders-collapsed .mail-compose-row {
  grid-template-columns: 44px;
  justify-content: center;
  justify-items: center;
}

.mail-folders-collapsed .mail-folders-toggle {
  justify-self: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.mail-folders-collapsed .mail-compose-button,
.mail-folders-collapsed .mail-folder {
  width: 44px;
  min-width: 44px;
  justify-content: center;
  justify-items: center;
  padding: 0;
  overflow: hidden;
  font-size: 0;
}

.mail-folders-collapsed .mail-compose-button::before {
  content: "+";
  font-size: 22px;
  line-height: 1;
}

.mail-folders-collapsed .mail-folder {
  grid-template-columns: 18px;
}

.mail-folders-collapsed .mail-folder span:not([data-icon]) {
  display: none;
}

.app-shell .mail-folder {
  border: 0;
}

.app-shell .mail-folder-active {
  background: var(--surface-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.mail-head {
  align-items: center;
  padding: 16px 18px;
}

.mail-head h2 {
  margin-bottom: 0;
}

.mail-head p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.mail-view.panel {
  overflow: auto;
  padding: 0;
}

.mail-view .list > .mail-empty {
  margin: 0;
  padding: 14px 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.mail-compose-form.mail-view.panel {
  padding: 16px;
}

.mail-compose-form.mail-view-active {
  display: grid;
  gap: 14px;
}

.mail-compose-form label,
.mail-editor-field {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.mail-compose-form input {
  font-weight: 500;
}

.mail-compose-actions {
  margin-top: 0;
}

#mailSettingsPanel.mail-view.panel {
  padding: 16px;
}

.mail-settings-status {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.mail-settings-form {
  gap: 18px 14px;
}

.mail-settings-form label,
.mail-settings-form .check-line {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.mail-settings-form .check-line {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--text-primary);
}

.mail-settings-form .check-line input {
  flex: 0 0 auto;
}

.mail-settings-form button[type="submit"] {
  justify-self: start;
  align-self: end;
}

.mail-view.panel > h2 {
  display: none;
}

.mail-reading-active .mail-view-active {
  display: none;
}

.mail-view .list {
  gap: 0;
}

.app-shell .mail-folder {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  justify-content: stretch;
  justify-items: start;
  text-align: left;
}

.mail-folder [data-icon] {
  align-self: center;
}

.mail-folder span:not([data-icon]) {
  justify-self: end;
}

.app-shell .mail-folder > span[id^="mail"][id$="Count"] {
  min-width: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.mail-row {
  display: grid;
  grid-template-columns:
    28px
    40px
    minmax(120px, var(--mail-sender-width))
    6px
    minmax(80px, var(--mail-subject-width))
    6px
    minmax(120px, var(--mail-snippet-width))
    6px
    minmax(72px, var(--mail-meta-width))
    6px
    minmax(86px, var(--mail-date-width))
    6px;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 14px;
  transition: background 150ms ease;
  cursor: pointer;
}

.mail-toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 24px;
  max-width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, 12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: #27313f;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  color: #fff;
  opacity: 0;
  padding: 10px 18px;
  font-size: 14px;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mail-toast[data-tone="error"] {
  background: #8f3f45;
}

.mail-toast[data-tone="info"] {
  background: #42556e;
}

.mail-toast-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

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

.mail-row:hover {
  background: var(--surface-subtle);
}

.mail-row:focus-visible {
  outline: 3px solid rgba(var(--tenant-brand-focus-rgb), 0.24);
  outline-offset: -3px;
}

.mail-row-selected {
  background: var(--primary-soft);
}

.mail-row-check {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.mail-row-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  border-radius: 6px;
  padding: 0;
}

.mail-avatar {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--gray-bg);
  color: var(--gray-fg);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

.mail-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.mail-avatar-loaded img {
  opacity: 1;
}

.mail-avatar-loaded .mail-avatar-initials {
  opacity: 0;
}

.mail-sender,
.mail-subject,
.mail-snippet,
.mail-meta,
.mail-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-request-badge {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 1px 6px;
  border: 1px solid var(--green-fg);
  border-radius: var(--radius-pill);
  background: var(--green-bg);
  color: var(--green-fg);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
}

.mail-sender {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
}

.mail-state-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: transparent;
}

.mail-state-unread {
  background: var(--primary);
}

.mail-subject-cell {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: baseline;
}

.mail-subject {
  min-width: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
}

.mail-spam-badge,
.mail-spam-assessment {
  border: 1px solid color-mix(in srgb, var(--red-fg) 24%, transparent);
  border-radius: var(--radius-pill);
  background: var(--red-bg);
  color: var(--red-fg);
  white-space: nowrap;
}

.mail-spam-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 16px;
}

.sidebar-nav-count {
  margin-left: auto;
  min-width: 20px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--surface);
  padding: 1px 5px;
  text-align: center;
  font-size: var(--font-size-code);
  font-weight: 700;
}

.mail-request-page.page-active {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  min-height: calc(100vh - var(--layout-topbar-height) - var(--space-6));
}

.mail-request-list-panel {
  padding: var(--space-3);
}

.mail-request-list-panel .panel-head {
  align-items: center;
  margin-bottom: var(--space-2);
}

.mail-request-list-panel h2,
.mail-request-detail h2 {
  margin-bottom: var(--space-1);
}

.mail-request-table-head,
.mail-request-list-item,
.app-shell .mail-request-list-item {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 1fr) minmax(280px, 1.5fr) 150px;
  align-items: center;
  gap: var(--space-3);
}

.mail-request-table-head {
  border-bottom: var(--border-width) solid var(--border);
  color: var(--text-secondary);
  padding: 0 var(--space-3) var(--space-2);
  font-size: var(--font-size-code);
  font-weight: 700;
}

.mail-request-list {
  display: grid;
  gap: 0;
}

.mail-request-list-item,
.app-shell .mail-request-list-item {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: var(--border-width) solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.mail-request-list-item:hover,
.app-shell .mail-request-list-item:hover,
.mail-request-list-item-active,
.app-shell .mail-request-list-item-active {
  background: var(--surface-subtle);
  filter: none;
}

.mail-request-list-subject {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.mail-request-list-subject strong,
.mail-request-list-sender,
.mail-request-list-decision,
.mail-request-list-item time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-request-list-subject strong {
  font-size: 13px;
}

.mail-request-new-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: mail-request-new-pulse 1.8s ease-out infinite;
}

@keyframes mail-request-new-pulse {
  70%, 100% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mail-request-new-dot {
    animation: none;
  }
}

.mail-request-list-sender,
.mail-request-list-item time {
  color: var(--text-secondary);
  font-size: var(--font-size-code);
}

.mail-request-list-decision {
  font-size: 12px;
  font-weight: 700;
}

.mail-request-list-decision.is-ready {
  color: var(--green-fg);
}

.mail-request-list-decision.is-attention {
  color: var(--amber-fg);
}

.mail-request-list-decision.is-progress {
  color: var(--blue-fg);
}

.mail-request-list-item-linked {
  box-shadow: inset 3px 0 var(--primary);
}

.mail-request-list-empty {
  display: grid;
  place-content: center;
  gap: var(--space-2);
  min-height: 240px;
  color: var(--text-secondary);
  text-align: center;
}

.mail-request-detail {
  min-width: 0;
  background: var(--surface);
}

.mail-request-back,
.app-shell .mail-request-back {
  margin-bottom: var(--space-2);
}

.mail-request-workbench {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.mail-request-overview {
  padding: var(--space-3) var(--space-4);
}

.mail-request-overview .request-overview-meta time {
  color: var(--text-secondary);
}

.mail-request-chat {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.mail-request-message {
  max-width: 88%;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: var(--space-4);
}

.mail-request-message-customer {
  justify-self: start;
}

.mail-request-message-ai {
  justify-self: end;
  background: var(--surface-subtle);
}

.mail-request-message-author {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--font-size-code);
}

.mail-request-body {
  line-height: 1.6;
}

.mail-request-verdict {
  display: grid;
  gap: var(--space-1);
  border-left: calc(var(--border-width) * 3) solid var(--amber-fg);
  background: var(--amber-bg);
  padding: var(--space-3);
}

.mail-request-verdict-positive {
  border-left-color: var(--green-fg);
  background: var(--green-bg);
}

.mail-request-verdict-negative {
  border-left-color: var(--red-fg);
  background: var(--red-bg);
}

.mail-request-customer-card {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--green-fg) 28%, transparent);
  border-radius: var(--radius-inner);
  background: var(--green-bg);
  padding: 12px;
}

.mail-request-customer-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mail-request-customer-card > div:first-child span,
.mail-request-customer-card dt {
  color: var(--text-tertiary);
  font-size: 12px;
}

.mail-request-customer-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 12px 0 0;
}

.mail-request-customer-card dl div {
  min-width: 0;
}

.mail-request-customer-card dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.mail-request-lines {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.mail-request-lines > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  border-top: var(--border-width) solid var(--border);
  padding-top: var(--space-2);
}

.mail-request-actions {
  margin-top: var(--space-3);
}

.app-shell #mailRequestStart {
  border: 0;
  background: var(--primary-gradient);
  color: var(--surface);
}

.mail-request-fit {
  background: var(--green-bg);
  color: var(--green-fg);
}

.mail-request-preparation {
  width: min(100%, 760px);
}

.mail-request-preparation-ready {
  border-color: var(--green-fg);
}

.mail-request-stock-summary,
.mail-request-proposal-draft {
  display: grid;
  gap: var(--space-2);
}

.mail-request-stock-summary span {
  color: var(--text-secondary);
}

.mail-request-proposal-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  border-top: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  padding: var(--space-3) 0;
}

.mail-request-proposal-draft label {
  display: grid;
  gap: var(--space-1);
  color: var(--text-secondary);
}

.mail-request-proposal-draft textarea {
  resize: vertical;
}

.mail-request-prepared-files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.mail-request-prepared-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--surface);
}

.mail-request-prepared-file.is-attachment {
  border-color: var(--green-fg);
}

.mail-request-prepared-file.is-internal {
  border-color: var(--amber-fg);
}

.mail-request-prepared-file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--blue-bg);
  color: var(--blue-fg);
  font-weight: 800;
}

.mail-request-prepared-file div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mail-request-prepared-file small {
  color: var(--text-secondary);
}

.mail-request-proposal-draft .calculation-summary {
  margin-bottom: var(--space-2);
}

.mail-request-sidecard-decision {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--panel);
  padding: 10px 12px;
}

.mail-request-sidecard-decision span {
  color: var(--text-secondary);
  font-size: var(--font-size-code);
}

.mail-request-sidecard-decision.is-ready {
  border-color: color-mix(in srgb, var(--green-fg) 34%, var(--border));
  background: var(--green-bg);
  color: var(--green-fg);
}

.mail-request-sidecard-decision.is-attention {
  border-color: color-mix(in srgb, var(--amber-fg) 34%, var(--border));
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.mail-request-sidecard-decision.is-progress {
  border-color: color-mix(in srgb, var(--blue-fg) 34%, var(--border));
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.request-detail-back,
.app-shell .request-detail-back {
  justify-self: start;
  width: auto;
  min-height: 30px;
  padding: 5px 10px;
}

@media (max-width: 1180px) {
  .mail-request-message {
    max-width: 100%;
  }

  .mail-request-prepared-files {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .mail-request-table-head {
    display: none;
  }

  .mail-request-list-item,
  .app-shell .mail-request-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    min-height: 72px;
  }

  .mail-request-list-subject,
  .mail-request-list-decision {
    grid-column: 1 / -1;
  }

  .mail-request-list-decision {
    white-space: normal;
  }
}

.mail-snippet {
  color: var(--text-secondary);
  font-size: 13px;
}

.mail-snippet:not(:empty)::before {
  content: "";
}

.mail-meta,
.mail-date {
  color: var(--text-secondary);
  font-size: 13px;
  justify-self: start;
}

.mail-date {
  font-weight: 400;
}

.mail-column-resize {
  align-self: stretch;
  width: 6px;
  border-radius: var(--radius-pill);
  cursor: col-resize;
  touch-action: none;
}

.mail-column-resize:hover,
.mail-column-resize:focus-visible {
  background: var(--border);
}

.mail-row.mail-unread {
  background: #eef1f4;
  box-shadow: none;
}

.mail-row.mail-unread:hover {
  background: #e5e9ee;
}

.mail-row.mail-unread .mail-avatar {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.mail-row.mail-unread .mail-sender,
.mail-row.mail-unread .mail-subject,
.mail-row.mail-unread .mail-date {
  font-weight: 700;
}

.mail-row:not(.mail-unread) .mail-sender,
.mail-row:not(.mail-unread) .mail-subject,
.mail-row:not(.mail-unread) .mail-date {
  font-weight: 400;
}

.mail-row.mail-unread .mail-snippet,
.mail-row.mail-unread .mail-meta {
  color: #475569;
}

.app-shell .mail-row-action {
  grid-column: 9 / 13;
  grid-row: 1;
  justify-self: end;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.mail-message-panel {
  padding: 0;
  overflow: hidden;
}

.mail-message-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.mail-message-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.mail-message-toolbar button {
  min-height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  padding: 0 12px;
}

.mail-message-opened {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.mail-message-opened-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.mail-message-opened-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 28px;
}

.mail-message-opened-date,
.mail-message-opened-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.mail-message-opened-date {
  justify-self: end;
  white-space: nowrap;
}

.mail-message-opened-meta {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.mail-message-opened-body {
  min-height: 260px;
  max-height: calc(100vh - 360px);
  max-width: 100%;
  overflow: auto;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mail-message-opened-body a {
  color: var(--primary);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.mail-message-opened-body-html {
  padding: 0;
  white-space: normal;
}

.mail-message-frame {
  display: block;
  width: 100%;
  height: min(680px, calc(100vh - 390px));
  min-height: 360px;
  border: 0;
  background: var(--surface);
}

.mail-message-content-notice {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  padding: 8px 10px;
}

.mail-message-attachments {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.mail-message-attachments h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 22px;
}

.mail-attachments-list {
  display: grid;
  gap: 8px;
}

.mail-attachment {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--surface-subtle);
  padding: 10px 12px;
}

.mail-attachment-thumbnail,
.mail-attachment-file-icon {
  width: 88px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.mail-attachment-thumbnail {
  position: relative;
  overflow: hidden;
  padding: 0;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: zoom-in;
}

.mail-attachment-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mail-attachment-file-icon {
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.mail-attachment-details {
  min-width: 0;
}

.mail-attachment-details strong {
  overflow-wrap: anywhere;
}

body.mail-preview-open {
  overflow: hidden;
}

.mail-attachment-lightbox[hidden] {
  display: none;
}

.mail-attachment-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mail-attachment-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 29, 0.86);
  backdrop-filter: blur(6px);
}

.mail-attachment-lightbox-panel {
  position: relative;
  width: min(1200px, 96vw);
  height: min(860px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: #111827;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.mail-attachment-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 8px 12px 8px 18px;
  color: #fff;
  background: rgba(17, 24, 39, 0.96);
}

.mail-attachment-lightbox-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-attachment-lightbox-head button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 26px;
  line-height: 1;
}

.mail-attachment-lightbox-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  background: #0b1020;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.mail-attachment-lightbox-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

@media (max-width: 640px) {
  .mail-attachment {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .mail-attachment > [data-mail-attachment-download] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .mail-attachment-thumbnail,
  .mail-attachment-file-icon {
    width: 72px;
    height: 56px;
  }

  .mail-attachment-lightbox {
    padding: 0;
  }

  .mail-attachment-lightbox-panel {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

/* Interface icon styles. */
[data-icon].menu-icon-emoji,
.menu-style-preview-emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-rendering: optimizeLegibility;
}

.sidebar-link [data-icon].menu-icon-emoji {
  font-size: 17px;
}

.home-app-icon [data-icon].menu-icon-emoji {
  width: 30px;
  height: 30px;
  font-size: 27px;
}

.menu-preferences-panel {
  align-content: start;
}

.menu-style-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.menu-style-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
  min-height: 132px;
  margin: 0;
  padding: var(--space-3);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.menu-style-option:hover {
  border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
  background: var(--surface-subtle);
}

.menu-style-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-focus-rgb), 0.14);
}

.menu-style-option input {
  grid-column: 2;
  grid-row: 1;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.menu-style-option strong {
  grid-column: 1;
  grid-row: 2;
  font-size: var(--font-size-body);
}

.menu-style-option small {
  grid-column: 1 / -1;
  grid-row: 3;
  color: var(--text-secondary);
  font-size: var(--font-size-code);
  line-height: 1.45;
}

.menu-style-preview {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
}

.menu-style-preview [data-icon] {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.menu-style-preview-emoji {
  font-size: 28px;
}

@media (max-width: 640px) {
  .menu-style-options {
    grid-template-columns: 1fr;
  }
}

.mail-attachment button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mail-editor-toolbar {
  border: 0;
  border-radius: var(--radius-inner) var(--radius-inner) 0 0;
  background: var(--surface-subtle);
  padding: 8px 10px;
}

.mail-editor-toolbar button {
  width: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
}

.mail-editor-toolbar button:hover {
  background: var(--surface);
  color: var(--text-primary);
  filter: none;
}

.mail-editor {
  min-height: 180px;
  border-radius: 0 0 var(--radius-inner) var(--radius-inner);
  font-weight: 500;
  line-height: 1.55;
}

.mail-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
}

.mail-delivery-status {
  margin-bottom: 18px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 10px 12px;
}

.mail-delivery-status strong {
  color: var(--text-primary);
}

.status-card {
  border: 0;
  border-radius: var(--radius-inner);
  background: var(--surface-subtle);
  padding: 12px;
}

.status-ok {
  background: var(--green-bg);
  color: var(--green-fg);
}

.status-warning {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

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

pre {
  border-radius: var(--radius-inner);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 12px;
}

.line-select {
  display: flex;
  margin-top: 8px;
  font-size: 13px;
}

.line-select input,
.check-line input {
  min-height: auto;
}

.request-workbench {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 410px);
  grid-template-rows: auto minmax(420px, 1fr);
  align-items: stretch;
  min-height: calc(100vh - 150px);
}

.request-chat {
  min-width: 0;
  padding: 18px 20px 0 0;
}

.request-sidecard {
  min-width: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-subtle);
  padding: 18px;
}

.request-sidecard-head {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
}

.request-destination-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--panel);
}

.request-destination-form label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.request-destination-form input { min-height: 34px; }
.request-destination-form button { align-self: end; min-height: 34px; }
.request-destination-form span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }

.logistics-delivery-choice {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd8ea;
  border-radius: var(--radius-inner);
  background: var(--panel);
}

.logistics-delivery-choice > strong {
  font-size: 13px;
}

.logistics-delivery-choice-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.app-shell .logistics-delivery-choice-buttons button {
  min-height: 34px;
  padding-inline: 12px;
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.app-shell .logistics-delivery-choice-buttons button.is-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.logistics-inline-destination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.logistics-inline-destination[hidden] {
  display: none;
}

.logistics-inline-destination label {
  margin: 0;
}

.logistics-inline-destination input,
.logistics-inline-destination button {
  min-height: 34px;
}

.logistics-delivery-choice [data-logistics-delivery-status] {
  color: var(--muted);
  font-size: 11px;
}

.request-ai-review-status {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--panel);
  padding: 11px 12px;
}

.request-ai-review-indicator {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #8b95a5;
}

.request-ai-review-status strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.request-ai-review-status p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.request-creation-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(242, 245, 249, .88);
  backdrop-filter: blur(5px);
}

.request-creation-overlay[hidden] {
  display: none;
}

.request-creation-card {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(35, 53, 78, .18);
}

.request-creation-card > strong {
  display: block;
  font-size: 18px;
}

.request-creation-card p {
  min-height: 20px;
  margin: 10px 0 16px;
  color: var(--muted);
}

.request-creation-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e7ee;
}

.request-creation-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-gradient);
  transition: width .2s ease;
}

.request-creation-card > b {
  display: block;
  margin-top: 10px;
  color: var(--primary);
  font-size: 18px;
  text-align: right;
}

.request-ai-review-status.is-processing .request-ai-review-indicator {
  background: #4f7fba;
  box-shadow: 0 0 0 4px rgba(79, 127, 186, 0.14);
  animation: ai-review-pulse 1.2s ease-in-out infinite;
}

.request-ai-review-status.is-pending .request-ai-review-indicator {
  background: #d3972f;
}

.request-ai-review-status.is-completed .request-ai-review-indicator {
  background: #3c9b68;
}

.request-ai-review-status.is-attention {
  border-color: #e3c675;
  background: #fff9e9;
}

.request-ai-review-status.is-attention .request-ai-review-indicator {
  background: #d3972f;
}

.request-ai-review-status.is-failed .request-ai-review-indicator {
  background: #c95c5c;
}

@keyframes ai-review-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

.request-overview {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--border);
}

.request-detail-loading {
  min-height: 160px;
  pointer-events: none;
}

.request-loading-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.request-loading-line {
  width: min(620px, 80%);
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--surface-subtle) 25%, var(--border) 50%, var(--surface-subtle) 75%);
  background-size: 200% 100%;
  animation: request-loading-pulse 1.2s infinite linear;
}

.request-loading-line-short {
  width: min(360px, 54%);
}

@keyframes request-loading-pulse {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.request-overview-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.request-overview-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-overview-badges,
.request-overview-meta,
.request-primary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
}

.request-overview-badges {
  flex: 0 0 auto;
}

.request-overview-badges button {
  width: auto;
  min-height: 30px;
  padding: 5px 10px;
}

.request-collapse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.request-collapse-row .request-collapse {
  min-width: 0;
  margin: 0;
  overflow-x: auto;
}

.request-close-dialog {
  width: min(520px, calc(100vw - 32px));
}

.request-close-dialog p {
  margin-bottom: 18px;
}

.trash-panel {
  grid-column: 1 / -1;
}

.trash-request-head,
.trash-request-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px 190px;
  gap: 12px;
  align-items: center;
}

.trash-request-head {
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 8px 12px;
}

.trash-request-list {
  display: grid;
}

.app-shell .trash-request-row {
  width: 100%;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  padding: 12px;
}

.app-shell .trash-request-row:hover {
  background: var(--surface-subtle);
  filter: none;
}

.trash-request-row span {
  color: var(--text-secondary);
  font-size: 13px;
}

.request-overview-meta {
  color: var(--muted);
  font-size: 13px;
}

.request-overview-meta span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--border);
}

.request-stage-caption {
  color: var(--muted);
  font-size: 12px;
}

.request-stage-caption strong {
  color: var(--text);
}

.request-stage-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding: 1px;
}

.request-stage-step {
  --request-stage-active-bg: var(--stage-bg, var(--surface-subtle));
  --request-stage-active-fg: var(--stage-fg, var(--text-secondary));
  position: relative;
  min-width: 90px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d9dde4;
  border-radius: 5px;
  background: #eef0f3;
  color: #697180;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.request-stage-step.is-past {
  opacity: 1;
}

.request-stage-step.is-current {
  border-color: var(--request-stage-active-fg);
  background: color-mix(in srgb, var(--request-stage-active-bg) 88%, white);
  color: var(--request-stage-active-fg);
  box-shadow: none;
  font-weight: 800;
}

.request-primary-actions {
  margin: 10px 0;
}

.request-collapse {
  display: block;
  max-width: 100%;
  margin: 8px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--panel);
  padding: 0;
  overflow: hidden;
}

.request-collapse > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.request-collapse > summary::-webkit-details-marker {
  display: none;
}

.request-collapse > summary::before {
  content: "›";
  color: var(--muted);
  transform: rotate(0deg);
  transition: transform 150ms ease;
}

.request-collapse[open] > summary::before {
  transform: rotate(90deg);
}

.request-collapse > summary > span:first-child {
  margin-right: auto;
}

.request-collapse-count {
  min-width: 24px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 2px 7px;
  text-align: center;
  font-size: 12px;
}

.request-collapse .request-requirements {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

.request-sidecard-calculation {
  padding: 0 10px 10px;
}

.request-sidecard-calculation .calculation-summary-grid,
.request-sidecard-calculation .calculation-assumptions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.request-sidecard-calculation > p {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.email-quoted-history {
  margin-top: 8px;
}

.email-quoted-history > summary {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.deal-history-event.operator .email-quoted-history > summary {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.deal-history-event.operator .email-quoted-history > summary:hover,
.deal-history-event.operator .email-quoted-history > summary:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.email-quoted-history > pre {
  min-height: 0;
  margin-top: 8px;
  color: var(--text-secondary);
  opacity: 0.82;
}

.email-quoted-thread {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.email-quoted-thread article {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border-left: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  background: rgba(255, 255, 255, .46);
}

.email-quoted-thread header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 11px;
}

.email-quoted-thread article > span {
  font-size: 11px;
  font-weight: 700;
}

.email-quoted-thread article > pre {
  min-height: 0;
  max-height: 240px;
  margin: 0;
  padding: 0;
  background: transparent;
  opacity: .82;
}

.request-dialog {
  margin: 0;
  padding: 0;
  border: 0;
}

.request-created-lines {
  display: grid;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
}

.request-created-lines > div {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(90px, .8fr) minmax(82px, .55fr);
  align-items: center;
}

.request-created-lines > div + div {
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.request-created-lines span,
.request-created-lines strong {
  min-width: 0;
  padding: 7px 9px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.request-created-lines-head {
  color: rgba(255, 255, 255, .72);
  font-weight: 700;
}

.request-created-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.request-created-attachment small {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
}

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

.request-dialog-head span {
  color: var(--muted);
  font-size: 12px;
}

.deal-history {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.deal-history-event {
  width: 80%;
  max-width: 80%;
  padding: 10px 12px;
  border-radius: var(--radius-inner);
  background: var(--color-surface-subtle);
  color: var(--text);
}

.deal-history-event.operator {
  justify-self: end;
  background: var(--primary-gradient);
  color: var(--color-panel);
}

.deal-history-event.participant {
  background: var(--green-bg);
}

.deal-history-event.warehouse-response {
  width: 80%;
  max-width: 80%;
  border: 1px solid #b8cee9;
  background: linear-gradient(145deg, #f4f8fe 0%, #eaf2fc 100%);
  box-shadow: 0 8px 24px rgba(47, 91, 145, 0.1);
}

.deal-history-event.warehouse-response .deal-history-meta {
  color: #58718f;
}

.deal-history-event-title {
  font-weight: 600;
}

.manual-request-source {
  min-height: 0;
  max-height: none;
  margin: 8px 0 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.deal-history-document {
  margin-top: 8px;
}

.request-source-quote {
  margin: 8px 0 10px;
  padding: 9px 10px;
  border: 1px solid #d6dde7;
  border-left: 3px solid #8998aa;
  border-radius: 8px;
  background: #eef1f5;
  color: var(--text-primary);
}

.request-source-quote small {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.request-source-quote pre {
  margin: 0;
  color: inherit;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.request-created-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.35;
}

.request-created-summary span {
  display: grid;
  gap: 1px;
}

.request-created-summary small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
}

.request-created-source {
  font-size: 12px;
}

.deal-history-event.operator .manual-request-source {
  background: rgba(255, 255, 255, 0.14);
}

.deal-history-event.warehouse-response .deal-history-event-title {
  color: #244f82;
  font-size: 14px;
  font-weight: 800;
}

.ai-review-findings {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dfc98a;
}

.ai-review-findings p {
  margin: 0;
  color: #6e5417;
  font-size: 12px;
  font-weight: 700;
}

.ai-review-finding {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #ead9a9;
  border-radius: 8px;
  background: #fff9e9;
}

.ai-review-finding span {
  color: #4e3b10;
  font-weight: 700;
  white-space: pre-wrap;
}

.ai-review-finding small {
  color: #766438;
  line-height: 1.4;
}

.ai-review-fix {
  justify-self: start;
  margin-top: 4px;
}

.ai-review-fix.is-applied {
  border-color: #b9d8c1;
  background: #eaf7ed;
  color: #2f7440;
  opacity: 1;
}

.ai-review-fix-state {
  justify-self: start;
  margin-top: 4px;
  color: #2f7440;
  font-size: 12px;
  font-weight: 800;
}

.ai-review-fix-state.is-pending {
  color: #8a6818;
}

.deal-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.deal-history-event.operator .deal-history-meta,
.deal-history-event.operator .line {
  color: rgba(255, 255, 255, .78);
}

.deal-history-changes {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.deal-history-event.operator .deal-history-changes {
  border-top-color: rgba(255, 255, 255, .24);
}

.request-chat-action {
  width: 80%;
  max-width: 80%;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid #cbd9ec;
  border-radius: var(--radius-inner);
  background: #f2f6fc;
  padding: 12px;
  color: var(--text);
}

.request-logistics-action label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.request-logistics-action select {
  width: 100%;
}

.request-chat-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.request-chat-action-head span {
  color: var(--muted);
  font-size: 12px;
}

.request-chat-action p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.request-tender-summary {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 6px 14px;
  max-width: 820px;
  margin: 14px 0 0;
  padding: 14px;
  border-radius: var(--radius-inner);
  background: var(--color-surface-subtle);
}

.request-tender-summary dt {
  color: var(--muted);
  font-weight: 600;
}

.request-tender-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.request-tender-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.request-tender-links a {
  color: var(--color-accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.request-tender-links a:hover {
  text-decoration: underline;
}

.request-tenderplan-data {
  max-width: 100%;
}

.request-tenderplan-data summary {
  cursor: pointer;
  font-weight: 700;
}

.request-tenderplan-data dl {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 12px;
  font-size: 13px;
}

.request-tenderplan-data dt {
  color: var(--muted);
  font-weight: 600;
}

.request-tenderplan-data dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.request-documents {
  max-width: 100%;
}

.request-documents-head,
.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.request-documents-head strong {
  font-size: 14px;
}

.request-documents-head span {
  color: var(--muted);
  font-size: 13px;
}

.request-document-list {
  display: grid;
  gap: 4px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 12px;
  border-radius: var(--radius-inner);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

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

.app-shell .request-document-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #245c95;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.app-shell .request-document-link:hover,
.app-shell .request-document-link:focus-visible {
  background: transparent;
  color: #174976;
  filter: none;
  text-decoration: underline;
}

.request-document-name {
  min-width: 0;
}

.document-type {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.document-type-doc {
  background: #e8f1ff;
  color: #2463ad;
}

.document-type-xls {
  background: #e8f5e9;
  color: #347a3b;
}

.document-type-ppt {
  background: #fff0e8;
  color: #bd5d29;
}

.document-type-pdf {
  background: #feeceb;
  color: #b23d35;
}

.document-type-zip {
  background: #f0eaff;
  color: #6d50a2;
}

.document-type-file {
  background: #eef1f5;
  color: #5b6471;
}

.request-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px;
}

@media (max-width: 760px) {
  .deal-history-event,
  .deal-history-event.warehouse-response,
  .request-chat-action {
    width: 100%;
    max-width: 100%;
  }

  .request-overview-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-overview-title {
    white-space: normal;
  }

  .request-overview-meta span + span::before {
    content: none;
  }

  .warehouse-check-table {
    min-width: 480px;
  }
}

.app-shell .request-participate-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #b9dec7;
  background: #dff1e6;
  color: #2c6d4e;
  box-shadow: none;
}

.app-shell .request-participate-button:hover {
  background: #d2ebdb;
  filter: none;
}

.app-shell .request-participate-button:disabled {
  cursor: default;
  opacity: 0.8;
}

.app-shell .request-next-stage-button {
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #b9cbe5;
  background: #e8f0fb;
  color: #315f99;
  box-shadow: none;
}

.app-shell .request-next-stage-button:hover {
  background: #dce9f8;
  filter: none;
}

.warehouse-check-result {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #c7d8ec;
}

.warehouse-check-summary {
  color: #526b87;
  font-size: 11px;
  font-weight: 700;
}

.warehouse-check-narrative {
  margin: 0;
  color: #172f4d;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.warehouse-check-details {
  overflow: hidden;
  border: 1px solid rgba(94, 109, 130, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.warehouse-check-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  color: #35597f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.warehouse-check-details summary::-webkit-details-marker {
  display: none;
}

.warehouse-check-details summary::before {
  content: "›";
  color: #6083ab;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.warehouse-check-details[open] summary::before {
  transform: rotate(90deg);
}

.warehouse-check-details summary span {
  min-width: 24px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dce9f8;
  color: #315f93;
  font-size: 10px;
  text-align: center;
}

.warehouse-check-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid rgba(94, 109, 130, 0.16);
  background: rgba(255, 255, 255, 0.58);
}

.warehouse-check-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 11px;
}

.warehouse-check-table th,
.warehouse-check-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(94, 109, 130, 0.13);
  text-align: left;
  vertical-align: top;
}

.warehouse-check-table th {
  background: rgba(238, 240, 243, 0.92);
  color: #556070;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.warehouse-check-table tbody tr:last-child td {
  border-bottom: 0;
}

.warehouse-check-position td:first-child {
  min-width: 150px;
}

.warehouse-check-position td span {
  display: block;
  margin-top: 2px;
  color: #6c7583;
  font-size: 10px;
}

.warehouse-check-position td:nth-child(2) {
  min-width: 120px;
}

.warehouse-check-position td:nth-child(3) {
  min-width: 76px;
  text-align: right;
  white-space: nowrap;
}

.warehouse-check-position td:nth-child(3) strong {
  display: block;
  margin-top: 2px;
}

.warehouse-check-available {
  box-shadow: inset 3px 0 #3f9a68;
}

.warehouse-check-partial,
.warehouse-check-unknown {
  box-shadow: inset 3px 0 #d69a2d;
}

.warehouse-check-unavailable,
.warehouse-check-not_found {
  box-shadow: inset 3px 0 #c95a5a;
}

.warehouse-check-status {
  font-weight: 700;
  white-space: nowrap;
}

.app-shell .warehouse-check-download {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #bad8c0;
  background: #eaf6ed;
  color: #2f6f3d;
  box-shadow: none;
}

.warehouse-supplier-action {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(70, 101, 145, 0.2);
  border-radius: 8px;
  background: rgba(235, 242, 252, 0.76);
}

.warehouse-supplier-action p,
.warehouse-supplier-status {
  margin: 0;
  color: #5f6d7d;
  font-size: 11px;
}

.warehouse-supplier-scopes,
.warehouse-supplier-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.warehouse-supplier-picker[hidden] {
  display: none;
}

.warehouse-supplier-picker select {
  min-width: 220px;
  flex: 1;
}

.app-shell .warehouse-supplier-action button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #c8d3e1;
  background: #fff;
  color: #40556e;
  box-shadow: none;
}

.app-shell .warehouse-supplier-action button.is-selected,
.app-shell .warehouse-supplier-picker button {
  border-color: #6d94c7;
  background: #5c82b5;
  color: #fff;
}

.supplier-email-draft {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.supplier-email-draft-attachment {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
}

.supplier-email-draft-meta,
.supplier-email-draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.supplier-email-draft label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.supplier-email-draft input,
.supplier-email-draft textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-primary);
  font: inherit;
  font-weight: 400;
}

.supplier-email-draft input {
  min-height: 34px;
  padding: 7px 9px;
}

.supplier-email-draft textarea {
  min-height: 210px;
  padding: 9px;
  resize: vertical;
  line-height: 1.45;
}

.supplier-email-draft-actions button {
  flex: 0 0 auto;
}

.logistics-email-draft input[readonly],
.logistics-email-draft textarea[readonly] {
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.logistics-email-draft-buttons {
  display: flex;
  gap: 7px;
}

.supplier-email-message {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.supplier-email-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.supplier-email-message-subject {
  font-size: 13px;
}

.supplier-email-delivery-error {
  padding: 9px 10px;
  border: 1px solid #efb3b3;
  border-radius: 8px;
  background: #fff0f0;
  color: #9d2525;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.supplier-email-message pre {
  min-height: 0;
  max-height: 360px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.supplier-response-analysis {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #9cc4a7;
  border-radius: 10px;
  background: #f3fbf5;
  color: #243b2b;
}

.supplier-response-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.supplier-response-attachments button {
  width: auto;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.supplier-response-analysis-head,
.supplier-response-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calculation-summary {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.calculation-summary.is-ready {
  border-color: var(--green-fg);
  background: var(--green-bg);
}

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

.calculation-summary-grid span,
.calculation-assumptions span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calculation-summary small,
.calculation-summary em {
  color: var(--text-secondary);
  font-size: 11px;
}

.calculation-summary em {
  font-style: normal;
}

.request-economics-action {
  width: 100%;
  max-width: none;
  border-color: var(--color-stage-economics);
  padding: 14px;
}

.calculation-editor,
.calculation-editor-head,
.calculation-editor-actions {
  display: grid;
  gap: 10px;
}

.calculation-editor-head,
.calculation-editor-actions {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.calculation-editor-head span,
.calculation-editor-actions > span,
.calculation-parameters-head span,
.calculation-line-row small {
  color: var(--text-secondary);
  font-size: 11px;
}

.calculation-editor-head > div {
  display: grid;
  gap: 2px;
}

.calculation-editor-head small {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 400;
}

.calculation-lines {
  display: grid;
  gap: 8px;
}

.calculation-line-row {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--surface);
}

.calculation-line-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
}

.calculation-line-info > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.calculation-line-info > small {
  grid-column: 1 / -1;
  line-height: 1.35;
}

.calculation-line-metrics {
  display: grid;
  grid-template-columns: minmax(80px, .7fr) minmax(150px, 1fr) minmax(130px, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.calculation-line-metrics > span,
.calculation-line-metrics > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calculation-line-metrics strong {
  font-variant-numeric: tabular-nums;
}

.calculation-line-total {
  text-align: right;
}

.calculation-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.calculation-input input {
  width: 100%;
  min-width: 0;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}

.calculation-input input::-webkit-inner-spin-button,
.calculation-input input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.calculation-input span,
.calculation-input small {
  color: var(--text-secondary);
  font-size: 11px;
}

.calculation-parameters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.calculation-parameters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.calculation-parameters label {
  display: grid;
  gap: 4px;
}

.calculation-parameters label span {
  color: var(--text-secondary);
  font-size: 11px;
}

.calculation-editor-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-economics-action > .supplier-email-draft-actions {
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

@media (max-width: 760px) {
  .calculation-summary-grid,
  .calculation-assumptions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .calculation-line-total {
    text-align: left;
  }

  .calculation-editor-head,
  .calculation-editor-actions {
    grid-template-columns: 1fr;
  }
}

.supplier-response-analysis-head span {
  color: #39714a;
  font-size: 12px;
  font-weight: 700;
}

.supplier-response-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.supplier-response-facts > span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 7px;
  background: #fff;
}

.supplier-response-facts small {
  color: var(--text-muted);
}

.supplier-response-offers {
  display: grid;
  margin-top: 7px;
  border: 1px solid #d7e8db;
  border-radius: 8px;
  overflow: hidden;
}

.supplier-response-offers > div {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(80px, .7fr);
  gap: 8px;
  padding: 8px;
  background: #fff;
  font-size: 11px;
}

.supplier-response-offers > div + div {
  border-top: 1px solid #e4ece6;
}

.supplier-response-offers > .supplier-response-offers-head {
  background: #f2f7f3;
  color: #617067;
  font-size: 10px;
  font-weight: 700;
}

.supplier-response-warnings {
  display: grid;
  gap: 4px;
  color: #9a5b12;
  font-size: 11px;
}

.supplier-response-actions {
  justify-content: flex-start;
}

.supplier-response-actions .secondary {
  border: 1px solid #cbd5d0;
  background: #fff;
  color: #40554a;
}

.deal-history-event.operator .supplier-email-message {
  border-top-color: rgba(255, 255, 255, .24);
}

.deal-history-event.operator .supplier-email-message-meta {
  color: rgba(255, 255, 255, .78);
}

.app-shell .request-documents-zip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dddfea;
  background: var(--panel);
  color: var(--text-primary);
  box-shadow: none;
}

.app-shell .request-documents-zip:hover {
  background: #fafaff;
  filter: none;
}

.request-document-actions .inline-form {
  display: flex;
  gap: 8px;
  margin: 0;
}

.request-document-actions .inline-form input[type="file"] {
  max-width: 210px;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.timeline-event {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.timeline-event.operator,
.timeline-event.assistant,
.timeline-event.participant {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}

.timeline-meta,
.timeline-note {
  color: var(--muted);
  font-size: 13px;
}

.timeline-content {
  margin-top: 8px;
  white-space: pre-wrap;
}

.timeline-note {
  margin-top: 8px;
}

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

  .app-sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background-image: var(--app-chrome-grain), var(--app-compact-sidebar-gradient);
    background-repeat: repeat, no-repeat, no-repeat;
    background-size: 180px 180px, cover, cover;
    background-blend-mode: soft-light, screen, normal;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar-account {
    margin-top: 12px;
  }

  .topbar,
  .mail-page.page-active,
  .request-workbench,
  .controls-grid,
  .data-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    gap: 12px;
  }

  .request-workbench {
    grid-template-rows: auto auto auto;
  }

  .request-chat {
    padding: 18px 0;
  }

  .request-sidecard {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: start;
  }

  .inventory-import-source-grid,
  .inventory-manual-grid,
  .inventory-mapping-grid {
    grid-template-columns: 1fr;
  }

  .inventory-table {
    min-width: 0;
    border: 0;
    overflow: visible;
  }

  .inventory-head {
    display: none;
  }

  .inventory-row:not(.inventory-head) {
    grid-template-columns: 1fr;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-control);
    margin-bottom: var(--space-2);
  }

  .inventory-row:not(.inventory-head) > span,
  .inventory-row:not(.inventory-head) > strong,
  .inventory-row:not(.inventory-head) > label {
    display: grid;
    grid-template-columns: var(--inventory-mobile-label-width) minmax(0, 1fr);
    gap: var(--space-2);
  }

  .inventory-row:not(.inventory-head) > span::before,
  .inventory-row:not(.inventory-head) > strong::before,
  .inventory-row:not(.inventory-head) > label::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-weight: var(--font-weight-normal);
  }
}

@media (max-width: 760px) {
  .app-workspace {
    padding-inline: 16px;
  }

  .topbar {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .kanban {
    display: grid;
    grid-template-columns: 1fr;
    min-height: auto;
    overflow-x: visible;
    gap: 12px;
  }

  .kanban-panel.page-active,
  .kanban-panel.page-active .kanban {
    min-height: auto;
  }

  .supplier-detail-heading {
    display: grid;
  }

  .supplier-detail-fields {
    grid-template-columns: 1fr;
  }

  .supplier-detail-manufacturers-field {
    grid-column: auto;
  }

  .request-collapse-row {
    grid-template-columns: 1fr;
  }

  .trash-request-head {
    display: none;
  }

  .trash-request-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .kanban-column {
    min-width: 0;
    min-height: 0;
    padding: 6px;
    border-radius: 14px;
    background: var(--stage-column-bg, var(--surface-subtle));
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
  }

  .kanban-column::before {
    content: "";
    display: block;
    height: 4px;
    margin: -6px -6px 6px;
    background: var(--stage-fg, var(--primary));
  }

  .app-shell .kanban-head,
  .kanban-head {
    min-height: 58px;
    margin-bottom: 0;
    border: 1px solid color-mix(in srgb, var(--stage-fg, var(--border)) 30%, rgba(255, 255, 255, 0.65));
    border-radius: 10px;
    background: color-mix(in srgb, var(--stage-bg, var(--surface-subtle)) 86%, white);
    color: var(--stage-fg, var(--text-primary));
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    box-shadow: none;
  }

  .app-shell .kanban-head:hover,
  .kanban-head:hover {
    background: color-mix(in srgb, var(--stage-bg, var(--surface-subtle)) 86%, white);
  }

  .kanban-head strong {
    grid-column: 1;
    justify-content: flex-start;
    min-width: 0;
    text-align: left;
    font-size: 15px;
    line-height: 20px;
  }

  .kanban-stage-icon {
    width: 18px;
    height: 18px;
  }

  .kanban-stage-icon svg {
    width: 18px;
    height: 18px;
  }

  .kanban-stage-icon.menu-icon-emoji {
    font-size: 17px;
  }

  .kanban-head .badge {
    grid-column: 2;
    min-width: 34px;
    min-height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    justify-self: end;
  }

  .kanban-panel .panel-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kanban-search {
    width: 100%;
  }

  .kanban-panel .actions {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr);
    gap: 10px;
    width: 100%;
  }

  .app-shell #quickCreateBtn,
  .app-shell #manualCreateBtn {
    width: 100%;
    min-width: 0;
  }

  .kanban-list {
    display: none;
    margin-top: 8px;
  }

  .kanban-column.kanban-column-open .kanban-list {
    display: grid;
  }

  .kanban-column.kanban-column-collapsed {
    padding: 6px;
  }

  .kanban-column.kanban-column-collapsed .kanban-head {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    justify-content: space-between;
    padding: 10px 12px;
  }

  .kanban-column.kanban-column-collapsed .kanban-stage-label {
    display: inline;
  }

  .tender-chat-panel {
    min-height: calc(100vh - 230px);
    padding: 12px;
    overflow: hidden;
  }

  .tender-chat-bubble {
    max-width: 94%;
    overflow-wrap: anywhere;
  }

  .tender-chat-messages,
  .tender-chat-card,
  .tender-chat-detail {
    min-width: 0;
  }

  .tender-chat-card,
  .tender-chat-composer {
    grid-template-columns: 1fr;
  }

  .tender-chat-composer input,
  .tender-chat-composer button {
    font-size: 16px;
  }

  .tender-chat-detail dl {
    grid-template-columns: 1fr;
  }

  .mail-settings-form,
  .inline-form,
  .item-row,
  .detail-head,
  .line-card,
  .check-item {
    grid-template-columns: 1fr;
  }

  .request-documents-rail {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 12px;
  }

  .mail-row {
    grid-template-columns: 28px 36px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .mail-column-resize {
    display: none;
  }

  .mail-sender,
  .mail-subject-cell,
  .mail-snippet {
    grid-column: 3 / 5;
  }

  .mail-state-dot {
    display: none;
  }

  .mail-meta {
    grid-column: 3;
    justify-self: start;
  }

  .mail-date {
    grid-column: 4;
  }

  .app-shell .mail-row-action {
    grid-column: 3 / 5;
    grid-row: auto;
  }

  .mail-message-opened-head {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .mail-message-opened-date {
    grid-column: 2;
    justify-self: start;
  }

  .mail-message-toolbar,
  .mail-message-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }
}

@media (max-width: 1200px) {
  .mail-row {
    grid-template-columns: 28px 36px minmax(0, 1fr) auto;
    grid-template-areas:
      "check avatar sender date"
      "check avatar subject meta"
      "check avatar snippet meta";
    column-gap: 10px;
    row-gap: 2px;
    min-height: 66px;
  }

  .mail-row-check {
    grid-area: check;
  }

  .mail-avatar {
    grid-area: avatar;
  }

  .mail-sender {
    grid-area: sender;
  }

  .mail-subject-cell {
    grid-area: subject;
  }

  .mail-snippet {
    grid-area: snippet;
  }

  .mail-meta {
    grid-area: meta;
    max-width: 180px;
    align-self: center;
  }

  .mail-date {
    grid-area: date;
  }

  .mail-column-resize {
    display: none;
  }

  .app-shell .mail-row-action {
    grid-area: meta;
    align-self: center;
  }
}
.profile-tax-summary,
.calculation-tax-profile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.profile-tax-summary span,
.calculation-tax-profile span {
  color: var(--muted);
  font-size: 12px;
}

.calculation-tax-profile {
  margin: 8px 0 12px;
}

.calculation-tax-locked input[readonly] {
  cursor: not-allowed;
  opacity: 0.72;
  background: var(--bg);
}
.logistics-route-plan {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.logistics-route-plan span { color: var(--muted); }

.calculation-route-summary { margin-top: 14px; }

.calculation-route-costs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.calculation-route-costs span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calculation-route-costs small { color: var(--muted); }
.company-logo-control {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.company-logo-preview {
  width: min(240px, 100%);
  height: 92px;
  object-fit: contain;
  object-position: left center;
  background: var(--surface);
}

/* One conversation rhythm across mail intake, request history and tender chat. */
.mail-request-message,
.deal-history-event,
.deal-history-event.warehouse-response,
.request-chat-action,
.tender-chat-bubble {
  position: relative;
  width: 80%;
  max-width: 80%;
  overflow: visible;
  --chat-tail-background: var(--surface-subtle);
  --chat-tail-border: var(--border);
}

.mail-request-message::before,
.mail-request-message::after,
.deal-history-event::before,
.deal-history-event::after,
.request-chat-action::before,
.request-chat-action::after,
.tender-chat-bubble::before,
.tender-chat-bubble::after {
  content: "";
  position: absolute;
  bottom: -1px;
  width: 11px;
  height: 13px;
  pointer-events: none;
}

.mail-request-message::before,
.deal-history-event::before,
.request-chat-action::before,
.tender-chat-bubble::before {
  left: -9px;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: var(--chat-tail-border);
}

.mail-request-message::after,
.deal-history-event::after,
.request-chat-action::after,
.tender-chat-bubble::after {
  left: -7px;
  bottom: 0;
  width: 10px;
  height: 11px;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: var(--chat-tail-background);
}

.mail-request-message-customer {
  --chat-tail-background: var(--surface);
}

.mail-request-message-ai {
  --chat-tail-background: var(--surface-subtle);
}

.request-chat-action {
  --chat-tail-background: #f2f6fc;
  --chat-tail-border: #cbd9ec;
}

.tender-chat-bubble {
  --chat-tail-background: var(--surface-subtle);
  --chat-tail-border: var(--surface-subtle);
}

.deal-history-event {
  --chat-tail-background: var(--color-surface-subtle);
  --chat-tail-border: var(--color-surface-subtle);
}

.deal-history-event.participant {
  --chat-tail-background: var(--green-bg);
  --chat-tail-border: var(--green-bg);
}

.deal-history-event.warehouse-response {
  --chat-tail-background: #eaf2fc;
  --chat-tail-border: #b8cee9;
}

.mail-request-message-ai::before,
.mail-request-message-ai::after,
.deal-history-event.operator::before,
.deal-history-event.operator::after,
.tender-chat-message.operator .tender-chat-bubble::before,
.tender-chat-message.operator .tender-chat-bubble::after {
  left: auto;
  transform: scaleX(-1);
}

.mail-request-message-ai::before,
.deal-history-event.operator::before,
.tender-chat-message.operator .tender-chat-bubble::before {
  right: -9px;
}

.mail-request-message-ai::after,
.deal-history-event.operator::after,
.tender-chat-message.operator .tender-chat-bubble::after {
  right: -7px;
}

.deal-history-event.operator,
.tender-chat-message.operator .tender-chat-bubble {
  --chat-tail-background: var(--primary-gradient);
  --chat-tail-border: var(--primary);
}

/* Home workspace and invoice registry. */
.home-dashboard {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding: var(--space-3) var(--space-0) var(--space-4);
}

[data-page].home-dashboard.page-active,
[data-page].invoices-page.page-active {
  display: grid;
}

.home-dashboard-summary,
.invoices-register-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.invoices-create-card h2,
.invoices-register-head h2 {
  margin: var(--space-0);
  color: var(--text-primary);
}

.invoices-create-card p,
.invoices-register-head p,
.invoices-empty p {
  margin: var(--space-1) var(--space-0) var(--space-0);
  color: var(--text-secondary);
}

.home-dashboard-kicker {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--primary);
  font-size: var(--font-size-code);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-dashboard-summary {
  justify-content: flex-end;
  align-items: stretch;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.home-dashboard-summary span {
  display: grid;
  min-width: 118px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--surface);
  color: var(--text-secondary);
  padding: var(--space-2);
  box-shadow: var(--shadow-card);
  font-size: var(--font-size-code);
}

.home-dashboard-summary strong {
  color: var(--text-primary);
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}

.home-app-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  box-shadow: var(--shadow-hover);
}

.home-app-card:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--primary-focus-rgb), 0.16), var(--shadow-hover);
}

.home-app-icon,
.invoices-create-icon,
.invoices-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-inner);
}

.home-app-card small {
  color: var(--text-secondary);
  font-size: var(--font-size-code);
}

.home-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
}

.home-app-card {
  position: relative;
  display: grid;
  min-height: 146px;
  align-content: start;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-primary);
  padding: var(--space-2);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.home-app-icon {
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-2);
  background: var(--home-app-bg, var(--blue-bg));
  color: var(--home-app-fg, var(--blue-fg));
}

.home-app-icon [data-icon] {
  width: 23px;
  height: 23px;
}

.home-app-card > strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-app-count {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding-inline: var(--space-1);
  font-size: var(--font-size-code);
  font-weight: 700;
}

.home-app-count-attention {
  background: #bd5555;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(189, 85, 85, 0.12);
}

.home-app-create-proposal {
  --home-app-bg: var(--blue-bg);
  --home-app-fg: var(--blue-fg);
}

.home-app-create-request {
  --home-app-bg: var(--teal-bg);
  --home-app-fg: var(--teal-fg);
}

.home-app-mail-requests,
.home-app-mail {
  --home-app-bg: var(--blue-bg);
  --home-app-fg: var(--blue-fg);
}

.home-app-customers,
.home-app-inventory {
  --home-app-bg: var(--green-bg);
  --home-app-fg: var(--green-fg);
}

.home-app-suppliers,
.home-app-logistics {
  --home-app-bg: var(--amber-bg);
  --home-app-fg: var(--amber-fg);
}

.home-app-tenders,
.home-app-invoices {
  --home-app-bg: var(--purple-bg);
  --home-app-fg: var(--purple-fg);
}

.home-app-trash,
.home-app-settings {
  --home-app-bg: var(--gray-bg);
  --home-app-fg: var(--gray-fg);
}

.home-app-icon-style {
  --home-app-bg: linear-gradient(135deg, var(--teal-bg), var(--purple-bg));
  --home-app-fg: #526182;
}

.home-icon-style-symbol {
  font-size: 24px;
  font-weight: 800;
}

.home-icon-style-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  align-self: end;
  margin-top: auto;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-subtle);
}

.app-shell .home-icon-style-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 29px;
  padding: 4px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.app-shell .home-icon-style-switch button:hover {
  background: color-mix(in srgb, var(--surface) 78%, var(--primary-soft));
  color: var(--text-primary);
  filter: none;
}

.app-shell .home-icon-style-switch button.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(31, 45, 61, 0.13);
}

.invoices-page {
  width: min(1180px, 100%);
  margin-inline: auto;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-0) var(--space-5);
}

.invoices-create-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(280px, 360px);
  gap: var(--space-3);
  align-items: center;
  border: var(--border-width) solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 72%);
  padding: var(--space-4);
}

.invoices-create-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-gradient);
  color: var(--surface);
}

.invoices-create-icon [data-icon] {
  width: 28px;
  height: 28px;
}

.invoices-create-controls {
  display: grid;
  gap: var(--space-2);
}

.invoices-register {
  min-height: 360px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.invoices-register-head {
  border-bottom: var(--border-width) solid var(--border);
  padding: var(--space-3) var(--space-4);
}

.invoices-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 270px;
  color: var(--text-primary);
  padding: var(--space-4);
  text-align: center;
}

.invoices-empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-3);
  background: var(--purple-bg);
  color: var(--purple-fg);
}

.invoices-empty-icon [data-icon] {
  width: 25px;
  height: 25px;
}

@media (max-width: 980px) {
  .home-dashboard-summary {
    align-items: stretch;
    justify-content: flex-start;
  }

  .home-dashboard-summary span {
    flex: 1;
  }

  .invoices-create-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .invoices-create-controls {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .home-dashboard,
  .invoices-page {
    padding-top: var(--space-0);
  }

  .home-dashboard-summary {
    width: 100%;
  }

  .home-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .home-app-card {
    min-height: 132px;
    padding: var(--space-2);
  }

  .home-app-count {
    top: var(--space-2);
    right: var(--space-2);
  }

  .invoices-create-card {
    grid-template-columns: var(--grid-single-column);
    padding: var(--space-3);
  }

  .invoices-create-controls {
    grid-column: auto;
  }
}

/* Unified compact attachments. */
.app-shell .attachment-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: end;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.attachment-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.app-shell .attachment-chip {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: calc(31ch + 38px);
  min-width: 0;
  min-height: 28px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(109, 128, 151, 0.28);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.app-shell .attachment-chip:hover,
.app-shell .attachment-chip:focus-visible {
  border-color: rgba(64, 103, 151, 0.48);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-primary);
  filter: none;
  text-decoration: none;
}

.app-shell .attachment-chip:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.attachment-name {
  display: block;
  max-width: 31ch;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .attachment-download-button {
  align-self: end;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(109, 128, 151, 0.32);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  color: #41658f;
}

.app-shell .attachment-download-button:hover,
.app-shell .attachment-download-button:focus-visible {
  border-color: rgba(64, 103, 151, 0.54);
  background: #ffffff;
  color: #245c95;
  filter: none;
}

.attachment-download-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mail-request-prepared-files,
.supplier-response-attachments,
.warehouse-check-download {
  margin-top: 8px;
  margin-bottom: 0;
}

.request-document-list .attachment-group {
  margin-top: 0;
}

.calculation-editor-actions .attachment-group {
  width: min(100%, 280px);
  margin-top: 0;
}

.supplier-email-draft-attachment .attachment-chip {
  flex: 0 0 auto;
}

.deal-history-event.operator .attachment-chip,
.deal-history-event.operator .attachment-download-button {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.deal-history-event.operator .attachment-chip:hover,
.deal-history-event.operator .attachment-chip:focus-visible,
.deal-history-event.operator .attachment-download-button:hover,
.deal-history-event.operator .attachment-download-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

@media (max-width: 640px) {
  .app-shell .attachment-group {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .app-shell .attachment-chip {
    max-width: min(100%, calc(31ch + 38px));
  }
}
