:root {
  --bg: #0b0d0c;
  --panel: #111412;
  --panel-2: #171a18;
  --panel-3: #1d211e;
  --line: #292e2a;
  --line-strong: #3a413b;
  --text: #f0f3ed;
  --muted: #9ba39a;
  --dim: #697169;
  --lime: #c8ff3d;
  --lime-soft: #283514;
  --lime-ink: #111707;
  --red: #ff716a;
  --red-soft: #321a19;
  --amber: #e8c86b;
  --amber-soft: #302a17;
  --blue: #8fb6ff;
  --blue-soft: #17243a;
  --sidebar: 224px;
  --drawer: min(680px, 48vw);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0d0f0e;
}

.brand {
  display: flex;
  height: 66px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #46503f;
  border-radius: 6px;
  color: var(--lime);
  font-size: 13px;
  font-weight: 850;
}

.brand-copy { font-size: 13px; font-weight: 760; }
.brand-copy b { color: var(--lime); }
.primary-nav { display: grid; gap: 3px; padding: 14px 10px; }
.nav-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 120ms var(--ease-out);
}

.nav-button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-button.is-active { border-color: #37402d; background: var(--lime-soft); color: var(--text); }
.nav-button.is-active svg { color: var(--lime); }
.nav-count { margin-left: auto; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-button.is-active .nav-count { color: var(--lime); }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding: 12px 10px 16px; border-top: 1px solid var(--line); }
.locale-toggle {
  width: max-content;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.operator-card { display: flex; min-width: 0; align-items: center; gap: 9px; }
.avatar { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 6px; background: var(--panel-3); color: var(--lime); font-size: 11px; font-weight: 800; }
.operator-copy { min-width: 0; }
.operator-copy strong, .operator-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-copy strong { font-size: 12px; }
.operator-copy span { color: var(--dim); font-size: 10px; }

.workspace { min-width: 0; margin-left: var(--sidebar); }
.app-shell.has-case-open .workspace { margin-right: var(--drawer); }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 12, .95);
  backdrop-filter: blur(12px);
}

.topbar-title { display: flex; min-width: 0; align-items: center; gap: 10px; }
.kicker { margin: 0 0 2px; color: var(--dim); font-size: 10px; font-weight: 760; text-transform: uppercase; }
h1 { margin: 0; font-size: 20px; line-height: 1.15; font-weight: 760; }
h2, h3, p { margin-top: 0; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.environment-badge, .badge, .micro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}

.environment-badge { height: 28px; padding: 0 9px; color: var(--muted); font-size: 11px; font-weight: 650; }
.environment-badge::before { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); content: ""; }
.environment-badge.is-preview::before { background: var(--amber); }
.environment-badge.is-launch::before { background: var(--blue); }
.environment-badge.is-config::before { background: var(--amber); }
.environment-badge.is-forbidden::before, .environment-badge.is-offline::before { background: var(--red); }
.environment-badge.is-loading::before { background: var(--dim); }

.main { padding: 20px 24px 44px; }
.button, .icon-button, .filter-chip, .case-row, .segment-button, .action-card, .quick-attach {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms var(--ease-out), opacity 140ms ease;
}
.button:active:not(:disabled), .icon-button:active:not(:disabled), .filter-chip:active, .nav-button:active, .segment-button:active, .action-card:active:not(:disabled), .quick-attach:active:not(.is-disabled) { transform: scale(.97); }
.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
}
.button svg, .icon-button svg { width: 15px; height: 15px; stroke-width: 1.9; }
.button-primary { border-color: var(--lime); background: var(--lime); color: var(--lime-ink); }
.button-secondary { background: var(--panel-2); color: var(--text); }
.button-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button-danger { border-color: #57302d; background: var(--red-soft); color: var(--red); }
.button:disabled, .action-card:disabled { cursor: not-allowed; opacity: .43; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); cursor: pointer; }
.mobile-only { display: none; }

.queue-pulse { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.queue-pulse-head { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 11px; border-bottom: 1px solid var(--line); }
.queue-pulse-head > span { display: inline-flex; align-items: center; gap: 7px; }
.queue-pulse-head svg { width: 13px; height: 13px; color: var(--lime); }
.queue-pulse-head strong { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.queue-pulse-head small { color: var(--dim); font-size: 10px; font-variant-numeric: tabular-nums; }
.ops-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.ops-stat { display: flex; min-width: 0; min-height: 46px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 11px; border-right: 1px solid var(--line); }
.ops-stat:last-child { border-right: 0; }
.ops-stat-label { display: inline-flex; min-width: 0; align-items: center; gap: 8px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ops-stat-label svg { width: 15px; height: 15px; flex: none; color: var(--dim); }
.ops-stat strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.ops-stat.is-alert strong, .ops-stat.is-alert svg { color: var(--red); }
.ops-stat.is-accent strong, .ops-stat.is-accent svg { color: var(--lime); }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.search-wrap { position: relative; width: min(340px, 38vw); }
.search-wrap svg { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; color: var(--dim); transform: translateY(-50%); pointer-events: none; }
.field, .select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
.field { padding: 0 10px 0 32px; }
.select { width: auto; min-width: 138px; padding: 0 29px 0 10px; cursor: pointer; }
.field::placeholder, textarea::placeholder { color: var(--dim); }
.toolbar-spacer { flex: 1; }
.result-count { color: var(--dim); font-size: 11px; white-space: nowrap; }
.filter-strip { display: flex; gap: 5px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.filter-strip::-webkit-scrollbar { display: none; }
.filter-chip { min-height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; white-space: nowrap; }
.filter-chip.is-active { border-color: #4a5a32; background: var(--lime-soft); color: var(--lime); }

.cases-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.case-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.case-table th { height: 38px; padding: 0 11px; overflow: hidden; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 10px; font-weight: 720; text-align: left; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.case-table td { height: 64px; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.case-table td > .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-table tr:last-child td { border-bottom: 0; }
.case-table tbody tr { cursor: pointer; transition: background-color 120ms ease; }
.case-table tbody tr.is-selected { background: #191e16; box-shadow: inset 2px 0 var(--lime); }
.case-id-wrap { display: inline-flex; min-width: 0; align-items: center; gap: 6px; white-space: nowrap; }
.unread-badge { display: inline-grid; min-width: 18px; height: 18px; place-items: center; border-radius: 9px; padding: 0 5px; background: var(--lime); color: var(--lime-ink); font-size: 9px; font-weight: 850; font-variant-numeric: tabular-nums; }
.case-id { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cell-main, .cell-sub { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main { color: var(--text); font-size: 13px; font-weight: 650; }
.cell-sub { margin-top: 2px; color: var(--dim); font-size: 11px; }
.item-cell { display: flex; min-width: 0; align-items: center; gap: 8px; }
.item-cell > span:last-child { min-width: 0; overflow: hidden; }
.item-glyph { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); color: var(--muted); }
.item-glyph svg { width: 14px; height: 14px; }
.badge { min-height: 23px; padding: 0 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.badge.is-lime { border-color: #405126; background: var(--lime-soft); color: var(--lime); }
.badge.is-red { border-color: #56302d; background: var(--red-soft); color: var(--red); }
.badge.is-amber { border-color: #524723; background: var(--amber-soft); color: var(--amber); }
.badge.is-blue { border-color: #2a4269; background: var(--blue-soft); color: var(--blue); }
.assignee { display: flex; min-width: 0; align-items: center; gap: 7px; }
.assignee-dot { display: grid; width: 24px; height: 24px; flex: none; place-items: center; border-radius: 6px; background: var(--panel-3); color: var(--muted); font-size: 9px; font-weight: 800; }
.time-cell { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.time-cell.is-overdue { color: var(--red); font-weight: 700; }
.app-shell.has-case-open .case-table col:nth-child(n+5),
.app-shell.has-case-open .case-table th:nth-child(n+5),
.app-shell.has-case-open .case-table td:nth-child(n+5) { display: none; }
.app-shell.has-case-open .case-table col:nth-child(1) { width: 14% !important; }
.app-shell.has-case-open .case-table col:nth-child(2) { width: 21% !important; }
.app-shell.has-case-open .case-table col:nth-child(3) { width: 22% !important; }
.app-shell.has-case-open .case-table col:nth-child(4) { width: 43% !important; }
.app-shell.has-case-open .case-table th:nth-child(1),
.app-shell.has-case-open .case-table td:nth-child(1) { width: 14%; }
.app-shell.has-case-open .case-table th:nth-child(2),
.app-shell.has-case-open .case-table td:nth-child(2) { width: 21%; }
.app-shell.has-case-open .case-table th:nth-child(3),
.app-shell.has-case-open .case-table td:nth-child(3) { width: 22%; }
.app-shell.has-case-open .case-table th:nth-child(4),
.app-shell.has-case-open .case-table td:nth-child(4) { width: 43%; }
.empty-state { display: grid; min-height: 280px; place-items: center; padding: 28px; color: var(--muted); text-align: center; }
.empty-state svg { width: 24px; height: 24px; margin-bottom: 8px; color: var(--dim); }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text); }

.simple-page { display: grid; gap: 12px; }
.workspace-view { display: grid; gap: 12px; }
.view-intro { display: flex; min-height: 44px; align-items: flex-start; justify-content: space-between; gap: 16px; }
.view-intro h2 { margin: 0; font-size: 16px; }
.view-intro p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.pipeline-tabs { display: flex; min-width: 0; gap: 1px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--line); scrollbar-width: none; }
.pipeline-tabs::-webkit-scrollbar { display: none; }
.pipeline-tab { display: inline-flex; min-width: 150px; min-height: 46px; flex: 1 0 auto; align-items: center; gap: 8px; padding: 0 12px; border: 0; background: var(--panel); color: var(--muted); cursor: pointer; }
.pipeline-tab svg { width: 15px; height: 15px; flex: none; }
.pipeline-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-tab strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.pipeline-tab.is-active { box-shadow: inset 0 -2px var(--lime); background: var(--panel-2); color: var(--text); }
.pipeline-tab.is-active svg { color: var(--lime); }
.workspace-toolbar { margin-bottom: 0; }
.section { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.section-head { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; font-size: 13px; }
.section-body { padding: 14px; }
.summary-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.summary-card { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.summary-card span { color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; margin-top: 4px; font-size: 16px; }
.setting-row { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { display: block; font-size: 13px; }
.setting-row small { display: block; margin-top: 2px; color: var(--dim); font-size: 10px; }
.settings-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 24px; }
.settings-section { min-width: 0; border-top: 1px solid var(--line-strong); }
.settings-section > header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.settings-section h2 { margin: 0; font-size: 14px; }
.pricing-section { grid-column: 1 / -1; }
.pricing-section > header { min-height: 66px; }
.pricing-section > header h2 { display: flex; align-items: center; gap: 7px; }
.pricing-section > header h2 svg { width: 15px; height: 15px; color: var(--lime); }
.pricing-section > header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.pricing-form { padding: 14px 0 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pricing-field { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 10px; }
.pricing-input { position: relative; display: block; min-width: 0; }
.pricing-input .form-input { padding-right: 58px; font-variant-numeric: tabular-nums; }
.pricing-input small { position: absolute; top: 50%; right: 8px; color: var(--dim); font-size: 9px; pointer-events: none; transform: translateY(-50%); }
.pricing-actions { display: flex; min-height: 48px; align-items: center; gap: 10px; }
.pricing-actions > small { color: var(--dim); font-size: 10px; }
.pricing-feedback { color: var(--lime); font-size: 10px; }
.pricing-feedback.is-error { color: var(--red); }
.section-meta { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.setting-person { display: flex; min-width: 0; align-items: center; gap: 9px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.connection-dot.is-live { background: var(--lime); }
.connection-dot.is-preview, .connection-dot.is-config { background: var(--amber); }
.connection-dot.is-offline, .connection-dot.is-forbidden { background: var(--red); }
.connection-dot.is-launch { background: var(--blue); }
.connection-panel { display: grid; width: min(480px, 100%); min-height: calc(100vh - 150px); margin: 0 auto; align-content: center; justify-items: center; padding: 32px 20px; text-align: center; }
.connection-panel > svg { width: 28px; height: 28px; margin-bottom: 15px; color: var(--muted); }
.connection-panel h2 { margin: 0; font-size: 20px; }
.connection-panel p { max-width: 430px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.connection-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

.drawer-scrim { position: fixed; z-index: 39; inset: 0; background: rgba(0, 0, 0, .52); opacity: 0; transition: opacity 160ms ease; }
.drawer-scrim.is-visible { opacity: 1; }
.case-drawer {
  position: fixed;
  z-index: 40;
  inset: 0 0 0 auto;
  width: var(--drawer);
  overflow: auto;
  border-left: 1px solid var(--line-strong);
  background: var(--bg);
  transform: translateX(100%);
  visibility: hidden;
  transition: none;
}
.case-drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer-header { position: sticky; z-index: 3; top: 0; border-bottom: 1px solid var(--line-strong); background: rgba(11, 13, 12, .98); backdrop-filter: blur(12px); }
.drawer-header-main { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; }
.drawer-title { min-width: 0; }
.drawer-title h2 { margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-title p { margin: 2px 0 0; color: var(--dim); font-size: 10px; }
.case-header-facts { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(100px, .8fr) minmax(150px, 1.5fr); border-top: 1px solid var(--line); }
.case-header-facts > span { display: flex; min-width: 0; min-height: 48px; flex-direction: column; justify-content: center; gap: 4px; padding: 7px 11px; border-right: 1px solid var(--line); }
.case-header-facts > span:last-child { border-right: 0; }
.case-header-facts small { color: var(--dim); font-size: 8px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.case-header-facts strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-content { display: grid; grid-template-columns: minmax(0, 1fr) 236px; align-items: start; }
.drawer-main { min-width: 0; padding: 0 16px 18px; }
.drawer-side { position: sticky; top: 113px; min-height: calc(100vh - 113px); padding: 16px; border-left: 1px solid var(--line); background: #0e100f; }
.detail-block { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.detail-block-title { display: flex; min-height: 39px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 11px; border-bottom: 1px solid var(--line); }
.detail-block-title h3 { margin: 0; font-size: 11px; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-field { min-width: 0; padding: 10px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-field:nth-child(2n) { border-right: 0; }
.detail-field:nth-last-child(-n+2) { border-bottom: 0; }
.detail-field span { display: block; margin-bottom: 3px; color: var(--dim); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.detail-field strong, .detail-field a { display: block; overflow-wrap: anywhere; color: var(--text); font-size: 11px; text-decoration: none; }
.quote-lines { padding: 4px 11px; }
.quote-row { display: flex; min-height: 31px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.quote-row:last-child { border-bottom: 0; }
.quote-row.total { color: var(--text); font-weight: 760; }
.logistics-block .detail-block-title h3 { display: inline-flex; align-items: center; gap: 7px; }
.logistics-block .detail-block-title h3 svg { width: 14px; height: 14px; color: var(--lime); }
.logistics-progress-copy { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 11px 7px; }
.logistics-progress-copy span { color: var(--dim); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.logistics-progress-copy strong { grid-row: 2; font-size: 12px; }
.logistics-progress-copy small { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.logistics-progress { height: 3px; margin: 0 11px 7px; overflow: hidden; background: var(--line-strong); }
.logistics-progress span { display: block; height: 100%; background: var(--lime); }
.logistics-flow { border-top: 1px solid var(--line); }
.logistics-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; min-width: 0; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.logistics-row:last-child { border-bottom: 0; }
.logistics-row > svg { width: 15px; height: 15px; margin-top: 1px; color: var(--dim); }
.logistics-row:last-child > svg { color: var(--lime); }
.logistics-copy { min-width: 0; }
.logistics-copy span, .logistics-copy strong, .logistics-copy small { display: block; overflow-wrap: anywhere; }
.logistics-copy span { margin-bottom: 3px; color: var(--dim); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.logistics-copy strong { color: var(--text); font-size: 11px; }
.logistics-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.logistics-row .photo-group { grid-column: 2; padding: 7px 0 0; }
.logistics-row .photo-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.photo-group { padding: 10px; }
.photo-group + .photo-group { padding-top: 0; }
.photo-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.photo-count { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 0 9px; color: var(--text); font-size: 12px; font-weight: 650; }
.photo-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.photo-item { position: relative; display: grid; aspect-ratio: 4 / 3; min-width: 0; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); color: var(--dim); }
.photo-item img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.photo-item > svg { width: 17px; height: 17px; }
.photo-item:not(.is-error) img[src] + svg { display: none; }
.photo-link:hover { border-color: var(--accent); color: var(--accent); }
.timeline { padding: 4px 11px 8px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 8px; padding: 8px 0; }
.timeline-item:not(:last-child)::after { position: absolute; top: 21px; bottom: -4px; left: 5px; width: 1px; background: var(--line-strong); content: ""; }
.timeline-dot { width: 11px; height: 11px; margin-top: 2px; border: 2px solid var(--panel); border-radius: 50%; outline: 1px solid var(--line-strong); background: var(--dim); }
.timeline-item.is-current .timeline-dot { outline-color: var(--lime); background: var(--lime); }
.timeline-copy strong { display: block; font-size: 11px; }
.timeline-copy span { display: block; margin-top: 2px; color: var(--dim); font-size: 10px; }
.chat-block .detail-block-title h3 { display: inline-flex; align-items: center; gap: 7px; }
.chat-block .detail-block-title h3 svg { width: 14px; height: 14px; color: var(--lime); }
.delivery-queue-state { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.delivery-queue-state > svg { width: 15px; height: 15px; color: var(--amber); }
.delivery-queue-state span, .delivery-queue-state strong, .delivery-queue-state small { display: block; min-width: 0; }
.delivery-queue-state strong { font-size: 10px; }
.delivery-queue-state small { margin-top: 2px; color: var(--dim); font-size: 9px; line-height: 1.35; }
.delivery-queue-state > b { min-width: 24px; color: var(--amber); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.delivery-queue-state.is-problem { border-color: #693b37; background: rgba(105, 59, 55, .14); }
.delivery-queue-state.is-problem > svg, .delivery-queue-state.is-problem > b { color: #ffaaa4; }
.chat-thread { display: grid; max-height: 380px; gap: 9px; overflow: auto; padding: 12px 11px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chat-message { display: grid; width: min(84%, 390px); gap: 3px; opacity: 1; transform: translateY(0); animation: chat-message-enter 160ms var(--ease-out) both; }
.chat-message.is-outbound { justify-self: end; }
.chat-sender { padding: 0 3px; color: var(--dim); font-size: 9px; font-weight: 700; }
.chat-message.is-outbound .chat-sender { text-align: right; }
.chat-bubble { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px 7px 7px 2px; background: var(--panel-2); }
.chat-message.is-outbound .chat-bubble { border-color: #3b4a28; border-radius: 7px 7px 2px 7px; background: var(--lime-soft); }
.chat-bubble p { margin: 0; padding: 8px 9px 4px; overflow-wrap: anywhere; color: var(--text); font-size: 11px; line-height: 1.45; white-space: pre-wrap; }
.chat-bubble footer { display: flex; justify-content: flex-end; gap: 6px; padding: 4px 8px 6px; color: var(--dim); font-size: 8px; font-variant-numeric: tabular-nums; }
.chat-status { color: var(--muted); text-transform: lowercase; }
.chat-media { position: relative; display: grid; min-height: 110px; aspect-ratio: 4 / 3; overflow: hidden; place-items: center; background: var(--panel); color: var(--dim); }
.chat-media img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.chat-media > svg { width: 18px; height: 18px; }
.chat-media:not(.is-error) img[src] + svg { display: none; }
.chat-empty { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 74px; color: var(--dim); }
.chat-empty > svg { width: 20px; height: 20px; }
.chat-empty strong, .chat-empty small { display: block; }
.chat-empty strong { color: var(--muted); font-size: 11px; }
.chat-empty small { margin-top: 2px; font-size: 9px; line-height: 1.4; }
.quick-composer { display: grid; grid-template-columns: minmax(0, 1fr) 36px auto; align-items: end; gap: 6px; padding: 10px 11px; border-top: 1px solid var(--line); }
.quick-composer-input { width: 100%; min-height: 36px; max-height: 112px; field-sizing: content; resize: none; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 9px; background: var(--panel); color: var(--text); font-size: 11px; line-height: 1.45; }
.quick-composer-input::placeholder { color: var(--dim); }
.quick-attach { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); cursor: pointer; }
.quick-attach svg { width: 15px; height: 15px; }
.quick-attach.is-disabled { cursor: not-allowed; opacity: .43; }
.quick-send { min-height: 36px; padding: 0 10px; }
.quick-send svg { width: 14px; height: 14px; }
.quick-composer-status { grid-column: 1 / -1; min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-composer-status:empty { display: none; }
.client-media-retry { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 9px 11px; border-top: 1px solid #693b37; background: rgba(105, 59, 55, .14); color: #ffaaa4; font-size: 10px; }
.client-media-retry > svg { width: 15px; height: 15px; }
.client-media-retry .button { min-height: 30px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
@keyframes chat-message-enter { from { opacity: 0; transform: translateY(3px); } }
.actions-title { margin: 0 0 8px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.action-list { display: grid; gap: 6px; }
.action-control { min-width: 0; }
.action-card { display: flex; width: 100%; min-height: 41px; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; color: var(--text); text-align: left; }
.action-card svg { width: 15px; height: 15px; flex: none; color: var(--lime); }
.action-card span { font-size: 11px; font-weight: 650; }
.action-card.is-danger svg { color: var(--red); }
.action-control .action-form { margin: 6px 0 4px; padding: 10px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.action-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.action-form h4 { margin: 0 0 8px; font-size: 12px; }
.form-hint { margin: -2px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-stack { display: grid; gap: 7px; }
.calculation-breakdown { margin: 9px 0; border-top: 1px solid var(--line); }
.calculation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 46px; gap: 6px; min-height: 30px; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.calculation-row output { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.calculation-row small { color: var(--dim); font-size: 9px; text-align: right; }
.calculation-row.is-total { color: var(--text); }
.calculation-row.is-total output { color: var(--lime); }
.input-label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.form-input, .form-textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font-size: 11px; }
.form-input[readonly] { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); font-variant-numeric: tabular-nums; }
.form-input { height: 32px; padding: 0 8px; }
.form-file { height: auto; min-height: 36px; padding: 6px; }
.form-file::file-selector-button { margin-right: 8px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 8px; background: var(--panel-2); color: var(--text); cursor: pointer; }
.client-media-form .form-file { max-width: 100%; }
.upload-status { min-height: 14px; color: var(--muted); font-size: 10px; }
.form-textarea { min-height: 66px; padding: 7px 8px; resize: vertical; }
.input-help { display: block; margin: -3px 0 1px; color: var(--dim); font-size: 9px; line-height: 1.4; }
.form-actions { display: flex; gap: 6px; margin-top: 8px; }
.action-confirmation { margin: 10px 0 0; padding: 9px 0 0; border: 0; border-top: 1px solid var(--line); }
.action-confirmation legend { padding: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.action-confirmation label { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 7px; margin-top: 7px; color: var(--text); cursor: pointer; font-size: 10px; line-height: 1.4; }
.action-confirmation input { width: 14px; height: 14px; margin: 0; accent-color: var(--lime); }
.preview-lock { display: grid; grid-template-columns: 16px 1fr; gap: 7px; margin-top: 10px; padding: 8px; border: 1px solid #524723; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font-size: 10px; }
.preview-lock svg { width: 15px; height: 15px; }
.preview-lock strong, .preview-lock small { display: block; }
.preview-lock strong { margin-bottom: 2px; font-size: 10px; }
.preview-lock small { color: #d1bd76; font-size: 9px; line-height: 1.45; }

.toast-region { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: grid; width: min(360px, calc(100vw - 32px)); gap: 7px; }
.toast { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel-3); color: var(--text); font-size: 12px; opacity: 1; transform: translateY(0); transition: opacity 160ms ease, transform 180ms var(--ease-out); }
.toast.is-error { border-color: #693b37; color: #ffaaa4; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
.fatal-state { padding: 20px; color: var(--red); }
.loading-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.loading-grid span { height: 82px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); opacity: .65; }

@media (hover: hover) and (pointer: fine) {
  .nav-button:hover, .button-secondary:hover, .icon-button:hover, .action-card:hover:not(:disabled), .pipeline-tab:hover, .quick-attach:hover:not(.is-disabled) { border-color: var(--line-strong); background: var(--panel-3); color: var(--text); }
  .case-table tbody tr:hover { background: var(--panel-2); }
  .filter-chip:hover { border-color: var(--line-strong); color: var(--text); }
}

@media (max-width: 1280px) {
  :root { --sidebar: 72px; --drawer: min(560px, 52vw); }
  .brand { justify-content: center; padding: 0; }
  .brand-copy, .nav-button > span:not(.nav-count), .operator-copy { display: none; }
  .nav-button { justify-content: center; padding: 0; }
  .nav-count { position: absolute; margin: -25px 0 0 25px; padding: 0 4px; border-radius: 6px; background: var(--panel-3); font-size: 9px; }
  .operator-card { justify-content: center; }
  .summary-list { grid-template-columns: 1fr 1fr; }
  .settings-page { grid-template-columns: 1fr; gap: 20px; }
  .pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-table th:nth-child(6), .case-table td:nth-child(6) { display: none; }
}

@media (min-width: 901px) and (max-width: 1280px) {
  .drawer-content { grid-template-columns: 1fr; }
  .drawer-side { position: static; min-height: auto; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 900px) {
  :root { --drawer: min(680px, 100vw); }
  .app-shell.has-case-open .workspace { margin-right: 0; }
  .case-drawer {
    transition: transform 210ms var(--ease-drawer), visibility 0s linear 210ms;
  }
  .case-drawer.is-open { transition: transform 210ms var(--ease-drawer), visibility 0s; }
  .drawer-content { grid-template-columns: 1fr; }
  .drawer-side { position: static; min-height: auto; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 740px) {
  :root { --drawer: 100vw; }
  .sidebar { width: min(290px, 82vw); transform: translateX(-100%); transition: transform 190ms var(--ease-drawer); }
  .sidebar.is-open { transform: translateX(0); }
  .brand { justify-content: flex-start; padding: 0 18px; }
  .brand-copy, .nav-button > span:not(.nav-count), .operator-copy { display: block; }
  .nav-button { justify-content: flex-start; padding: 0 10px; }
  .nav-count { position: static; margin: 0 0 0 auto; padding: 0; background: transparent; }
  .operator-card { justify-content: flex-start; }
  .workspace { margin-left: 0; }
  .mobile-only { display: grid; }
  .mobile-scrim { position: fixed; z-index: 29; inset: 0; background: rgba(0,0,0,.55); }
  .topbar { height: 60px; padding: 0 12px; }
  .topbar-tools .button span { display: none; }
  .main { padding: 12px 10px 30px; }
  .queue-pulse-head { align-items: flex-start; flex-direction: column; gap: 1px; padding-top: 7px; padding-bottom: 7px; }
  .ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-stat { min-height: 54px; padding: 0 11px; }
  .ops-stat:nth-child(2) { border-right: 0; }
  .ops-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ops-stat strong { font-size: 19px; }
  .ops-stat-label { font-size: 11px; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { width: 100%; }
  .select { min-width: 0; flex: 1; }
  .toolbar-spacer { display: none; }
  .result-count { width: 100%; }
  .view-intro { align-items: flex-end; }
  .view-intro .result-count { width: auto; }
  .pipeline-tab { min-width: 132px; }
  .case-table, .case-table tbody { display: block; }
  .case-table thead { display: none; }
  .case-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 11px; border-bottom: 1px solid var(--line); }
  .case-table tr:last-child { border-bottom: 0; }
  .case-table td { display: block; height: auto; padding: 0; border: 0; }
  .case-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .case-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .case-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .case-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .case-table td:nth-child(5) { grid-column: 2; grid-row: 2; }
  .case-table td:nth-child(6) { display: block; grid-column: 1; grid-row: 4; }
  .case-table td:nth-child(7) { grid-column: 2; grid-row: 4; text-align: right; }
  .case-id::before { content: "#"; }
  .item-glyph { display: none; }
  .summary-list { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
  .environment-badge { max-width: 124px; overflow: hidden; text-overflow: ellipsis; }
  .topbar { gap: 8px; }
  h1 { font-size: 16px; }
  .drawer-main, .drawer-side { padding: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .logistics-row .photo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-field, .detail-field:nth-child(2n), .detail-field:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-field:last-child { border-bottom: 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-actions { align-items: flex-start; flex-direction: column; padding: 10px 0; }
  .chat-message { width: 90%; }
  .quick-composer { grid-template-columns: minmax(0, 1fr) 36px 40px; }
  .quick-send { justify-content: center; padding: 0; }
  .quick-send span { display: none; }
  .client-media-retry { grid-template-columns: 16px minmax(0, 1fr); }
  .client-media-retry .button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
