:root {
  --ink: #182522;
  --ink-soft: #364641;
  --muted: #718079;
  --muted-light: #9ca8a1;
  --canvas: #e9eee8;
  --paper: #fffdf8;
  --paper-deep: #f5f5ef;
  --line: #dce3dc;
  --line-strong: #cbd6ce;
  --accent: #176b5e;
  --accent-deep: #0d554a;
  --accent-soft: #e1f0ea;
  --accent-pale: #f0f7f3;
  --coral: #d8755b;
  --coral-soft: #fae9e2;
  --amber: #a56c25;
  --amber-soft: #fbf0dc;
  --blue: #3e6e94;
  --blue-soft: #e9f1f8;
  --nav: #20302b;
  --nav-soft: #2c4039;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-soft: 0 18px 40px rgba(26, 45, 38, 0.12);
  --shadow-modal: 0 26px 90px rgba(20, 42, 34, 0.28);
  color: var(--ink);
  font-family: "Avenir Next", "Noto Sans CJK SC", "PingFang SC", "Source Sans 3", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.78), transparent 27rem),
    linear-gradient(145deg, #e8ede7, #e3e9e3 60%, #eff2eb);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(38, 135, 115, 0.32);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

[hidden] {
  display: none !important;
}

.live-login-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 7vw, 72px) 18px;
  background:
    radial-gradient(circle at 84% 13%, rgba(255, 255, 255, 0.8), transparent 25rem),
    linear-gradient(145deg, #e8ede7, #e3e9e3 60%, #eff2eb);
}

.live-login-panel {
  width: min(100%, 440px);
  padding: clamp(28px, 6vw, 46px);
  border: 1px solid rgba(203, 214, 206, 0.88);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 26px 72px rgba(26, 45, 38, 0.16);
}

.live-login-kicker {
  margin: 0 0 12px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.12em;
}

.live-login-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(27px, 5vw, 34px);
  letter-spacing: -0.04em;
}

.live-login-muted,
.live-login-boundary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.live-login-muted {
  margin: 10px 0 24px;
}

.live-login-form {
  display: grid;
  gap: 9px;
}

.live-login-form label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.live-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffefa;
}

.live-login-form input + label {
  margin-top: 7px;
}

.live-login-status {
  min-height: 20px;
  margin: 7px 0 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.live-login-status.is-error {
  color: #a84f3d;
}

.live-login-submit {
  min-height: 44px;
  margin-top: 2px;
  border-radius: 8px;
  background: var(--accent);
  color: #f5fbf6;
  font-size: 13px;
  font-weight: 780;
  transition: background 180ms ease, transform 180ms ease;
}

.live-login-submit:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.live-login-boundary {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.app-shell {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  height: 100vh;
  padding: 12px;
  gap: 12px;
}

.sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 14px;
  background: var(--nav);
  box-shadow: 0 16px 36px rgba(26, 48, 39, 0.16);
  color: #edf3ed;
  overflow: hidden;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 8px 20px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(241, 249, 243, 0.22);
  border-radius: 12px 12px 12px 3px;
  background: linear-gradient(145deg, #376d5c, #193a32);
  color: #f7fbf7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-name {
  max-width: 5em;
  color: #ccdad2;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: center;
  writing-mode: vertical-rl;
}

.primary-nav {
  display: grid;
  gap: 8px;
  padding: 0 8px;
}

.nav-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 4px 8px;
  border-radius: 9px;
  background: transparent;
  color: #9fb1a8;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item:hover {
  background: rgba(239, 249, 241, 0.08);
  color: #f4faf4;
  transform: translateY(-1px);
}

.nav-item.is-active {
  background: var(--nav-soft);
  color: #f3faf3;
}

.nav-item.is-active::before {
  position: absolute;
  top: 17px;
  left: -8px;
  width: 3px;
  height: 30px;
  border-radius: 0 3px 3px 0;
  background: #88cfb4;
  content: "";
}

.nav-icon {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
}

.nav-icon svg,
[data-icon] svg {
  display: block;
  width: 100%;
  height: 100%;
}

.nav-label {
  font-size: 11px;
  font-weight: 620;
}

.nav-count {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border-radius: 10px;
  background: #e88b6d;
  color: #fffaf6;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.nav-count.is-muted {
  background: rgba(153, 198, 179, 0.25);
  color: #c9e5d7;
}

.sidebar-foot {
  display: grid;
  gap: 14px;
  padding: 12px 8px 10px;
}

.sidebar-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #92a69c;
  font-size: 10px;
  white-space: nowrap;
}

.help-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #83c9ab;
  box-shadow: 0 0 0 4px rgba(131, 201, 171, 0.11);
}

.account-chip {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 7px 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf5ef;
}

.account-chip:hover {
  background: rgba(255, 255, 255, 0.11);
}

.account-copy {
  display: grid;
  gap: 2px;
  text-align: center;
}

.account-copy strong {
  font-size: 11px;
  font-weight: 650;
}

.account-copy small {
  color: #98ada2;
  font-size: 9px;
}

.account-chevron {
  color: #8aa79b;
  font-size: 10px;
}

.main-area {
  display: grid;
  min-width: 0;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(207, 219, 211, 0.88);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 16px 36px rgba(44, 65, 54, 0.1);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
}

.topbar-leading,
.topbar-actions,
.topbar-profile,
.shop-selector-button,
.availability-button {
  display: flex;
  align-items: center;
}

.topbar-leading {
  min-width: 0;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-separator {
  margin: 0 3px;
  color: var(--line-strong);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.topbar-actions {
  gap: 16px;
}

.shop-selector {
  position: relative;
}

.shop-selector-button {
  gap: 9px;
  min-width: 175px;
  padding: 6px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.shop-selector-button:hover,
.shop-selector-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--paper-deep);
}

.shop-swatch {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #e0eee8;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.shop-swatch.tone-teal {
  background: #d8ebe2;
  color: #17604f;
}

.shop-swatch.tone-blue {
  background: #e0edf2;
  color: #366a76;
}

.shop-swatch.tone-all {
  background: #e6eee8;
  color: #176b5e;
}

.shop-selector-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shop-selector-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.shop-selector-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.shop-selector-button .chevron {
  margin-left: auto;
}

.shop-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  width: 246px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.shop-menu-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.shop-menu-option:hover,
.shop-menu-option.is-selected {
  background: var(--accent-pale);
}

.shop-menu-option-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shop-menu-option-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.shop-menu-option-copy small {
  color: var(--muted);
  font-size: 10px;
}

.availability-button {
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcf8;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.availability-button:hover {
  border-color: var(--line-strong);
  background: var(--paper-deep);
}

.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55a579;
  box-shadow: 0 0 0 4px rgba(85, 165, 121, 0.11);
}

.availability-button.is-away .availability-dot {
  background: #c58c42;
  box-shadow: 0 0 0 4px rgba(197, 140, 66, 0.12);
}

.topbar-profile {
  gap: 8px;
  padding: 3px 0 3px 7px;
  background: transparent;
}

.profile-name {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #d7e8df;
  color: #17604f;
  font-size: 12px;
  font-weight: 800;
}

.avatar-small {
  width: 25px;
  height: 25px;
  font-size: 11px;
}

.workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(252px, 304px) minmax(410px, 1fr) minmax(275px, 328px);
  background:
    linear-gradient(90deg, rgba(233, 243, 237, 0.34), transparent 35%),
    var(--paper);
}

@media (min-width: 1181px) {
  .workspace.is-secondary-view {
    grid-template-columns: minmax(252px, 304px) minmax(410px, 1fr);
  }

  .workspace.is-secondary-view .conversation-panel.secondary-view {
    grid-column: 2;
  }
}

.queue-panel,
.conversation-panel,
.inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.queue-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: rgba(248, 249, 244, 0.75);
}

.queue-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 17px 14px;
}

.queue-heading h2,
.section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.queue-heading p,
.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.queue-total {
  display: grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 14px 12px;
}

.search-field > span {
  position: absolute;
  left: 11px;
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 36px;
  padding: 0 11px 0 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: var(--paper);
  font-size: 11px;
}

.search-field input::placeholder {
  color: var(--muted-light);
}

.search-field input:focus {
  border-color: #88bca7;
  box-shadow: 0 0 0 3px rgba(96, 165, 135, 0.12);
}

.queue-filters {
  display: flex;
  gap: 5px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.queue-filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.filter-button:hover {
  color: var(--accent-deep);
}

.filter-button.is-active {
  border-color: var(--line);
  background: var(--paper);
  color: var(--accent-deep);
  box-shadow: 0 1px 2px rgba(30, 56, 42, 0.04);
}

.conversation-list {
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.conversation-item {
  position: relative;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  gap: 9px;
  width: 100%;
  padding: 13px 14px 12px;
  border-bottom: 1px solid rgba(220, 227, 220, 0.85);
  background: transparent;
  text-align: left;
  transition: background 160ms ease;
}

.conversation-item:hover {
  background: #f5f8f3;
}

.conversation-item.is-active {
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--accent);
}

.conversation-item.is-active::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: var(--paper);
  content: "";
}

.customer-avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px 10px 10px 3px;
  background: #e3eee8;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.customer-avatar.tone-blue {
  background: #e5eef2;
  color: #366a76;
}

.customer-avatar.tone-sand {
  background: #f4e8d4;
  color: #875d2e;
}

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

.conversation-name-row,
.conversation-meta-row,
.thread-title-row,
.thread-subline,
.inspector-title-row,
.data-row,
.order-title-row,
.followup-row,
.product-row,
.modal-heading,
.modal-actions,
.setting-row,
.status-line {
  display: flex;
  align-items: center;
}

.conversation-name-row {
  gap: 5px;
}

.conversation-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-shop {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.conversation-meta-row {
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.conversation-time {
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

.unread-badge {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border-radius: 10px;
  background: var(--coral);
  color: #fffaf7;
  font-size: 10px;
  font-weight: 800;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.status-text::before,
.status-pill::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-light);
  content: "";
}

.status-text.is-waiting,
.status-pill.is-waiting {
  color: var(--coral);
}

.status-text.is-waiting::before,
.status-pill.is-waiting::before {
  background: var(--coral);
}

.status-text.is-unassigned,
.status-pill.is-unassigned {
  color: var(--amber);
}

.status-text.is-unassigned::before,
.status-pill.is-unassigned::before {
  background: var(--amber);
}

.status-text.is-done,
.status-pill.is-done {
  color: var(--accent);
}

.status-text.is-done::before,
.status-pill.is-done::before {
  background: #55a579;
}

.verified-mini {
  display: inline-grid;
  width: 13px;
  height: 13px;
  place-items: center;
  color: var(--accent);
}

.verified-mini svg {
  width: 12px;
  height: 12px;
}

.menu-check {
  display: grid;
  width: 14px;
  height: 14px;
  margin-left: auto;
  place-items: center;
  color: var(--accent);
}

.menu-check svg {
  width: 14px;
  height: 14px;
}

.secondary-queue-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.secondary-queue-note .help-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 54px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--accent);
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state p {
  max-width: 210px;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--paper);
}

.thread-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 17px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.thread-title-row {
  min-width: 0;
  gap: 10px;
}

.thread-title-copy {
  min-width: 0;
}

.thread-title-row h2 {
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-subline {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.thread-divider {
  color: var(--line-strong);
}

.thread-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.icon-btn,
.text-icon-btn,
.outline-btn,
.solid-btn,
.quiet-btn,
.danger-quiet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--paper-deep);
  color: var(--ink);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.text-icon-btn,
.outline-btn {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.text-icon-btn:hover,
.outline-btn:hover {
  border-color: #9bc2b2;
  background: var(--accent-pale);
  color: var(--accent-deep);
  transform: translateY(-1px);
}

.solid-btn {
  min-height: 34px;
  padding: 0 13px;
  background: var(--accent);
  color: #f9fffb;
  font-size: 11px;
  font-weight: 750;
}

.solid-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.quiet-btn,
.danger-quiet-btn {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.quiet-btn:hover {
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.danger-quiet-btn:hover {
  background: var(--coral-soft);
  color: #a8503e;
}

.message-stream {
  min-height: 0;
  overflow: auto;
  padding: 22px 20px 18px;
  background:
    radial-gradient(circle at 80% 0%, rgba(224, 240, 232, 0.37), transparent 24rem),
    #fffefa;
  scroll-behavior: smooth;
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-divider::before,
.day-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.message-row {
  display: flex;
  margin: 0 0 15px;
  animation: message-in 280ms ease both;
}

.message-row.customer {
  justify-content: flex-start;
}

.message-row.agent {
  justify-content: flex-end;
}

.message-row.note {
  justify-content: center;
  margin: 20px 0;
}

.message-bubble {
  max-width: min(75%, 510px);
  padding: 11px 13px 9px;
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px 12px;
  background: #f3f6f1;
}

.message-row.agent .message-bubble {
  border-color: #bfded0;
  border-radius: 12px 4px 12px 12px;
  background: var(--accent-soft);
}

.message-row.note .message-bubble {
  max-width: min(88%, 570px);
  border-color: #ead9b6;
  border-style: dashed;
  border-radius: 8px;
  background: #fff9ea;
}

.message-author {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.message-row.agent .message-author {
  justify-content: flex-end;
}

.note-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber);
}

.note-label::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

.message-text {
  white-space: pre-wrap;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.58;
}

.message-row.agent .message-text {
  color: #234c40;
}

.message-meta {
  margin-top: 6px;
  color: var(--muted-light);
  font-size: 9px;
  text-align: right;
}

.inline-product-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 8px;
  border: 1px solid rgba(117, 169, 145, 0.35);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.56);
}

.product-art {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(145deg, #c3ddd2, #edf5ee);
  color: var(--accent-deep);
  font-size: 15px;
}

.product-art.tone-blue {
  background: linear-gradient(145deg, #c6d9df, #eef4f5);
  color: #396d79;
}

.product-art.tone-sand {
  background: linear-gradient(145deg, #ead7b9, #fbf2e5);
  color: #8b612d;
}

.product-art.tone-rose {
  background: linear-gradient(145deg, #efd2c9, #fff0e9);
  color: #9e5f51;
}

.product-message-copy {
  min-width: 0;
}

.product-message-copy strong,
.product-message-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-message-copy strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.product-message-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.product-message-link {
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.system-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0;
  color: var(--muted-light);
  font-size: 9px;
}

.system-event svg {
  width: 13px;
  height: 13px;
}

.composer {
  position: relative;
  margin: 0 17px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 5px 15px rgba(36, 62, 49, 0.05);
}

.composer.is-note {
  border-color: #e2c98d;
  background: #fffdf5;
}

.composer-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 35px;
  padding: 4px 6px 0;
  border-bottom: 1px solid var(--line);
}

.composer.is-note .composer-tabs {
  border-color: #eadcb9;
}

.composer-tab {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.composer-tab:hover {
  color: var(--ink-soft);
}

.composer-tab.is-active {
  background: var(--accent-pale);
  color: var(--accent-deep);
}

.composer.is-note .composer-tab.is-active {
  background: #fbf1d9;
  color: var(--amber);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  max-height: 150px;
  padding: 11px 12px 7px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: var(--muted-light);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 8px 10px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.composer-tool:hover {
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.composer-tool svg {
  width: 14px;
  height: 14px;
}

.ai-draft-panel {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #cbded3;
  border-radius: 8px;
  background: #f3f8f3;
}

.ai-draft-heading,
.ai-draft-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-draft-heading strong {
  display: block;
  color: var(--accent-deep);
  font-size: 11px;
}

.ai-draft-heading span,
.ai-draft-footer span {
  color: var(--muted);
  font-size: 9px;
}

.ai-draft-panel textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #d6e5dc;
  border-radius: 5px;
  outline: none;
  resize: vertical;
  background: #fff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
}

.message-translate-btn {
  display: block;
  margin-top: 7px;
  padding: 0;
  background: transparent;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 700;
}

.translation-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 7px 9px;
  border: 1px solid rgba(65, 113, 91, 0.2);
  border-radius: 7px;
  background: rgba(243, 248, 243, 0.72);
  color: var(--muted);
  font-size: 10px;
}

.composer-translation-controls {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
}

.translation-toggle,
.translation-target {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-weight: 700;
  white-space: nowrap;
}

.translation-toggle {
  min-height: 26px;
}

.translation-toggle input {
  accent-color: var(--accent-deep);
}

.translation-target select {
  min-height: 24px;
  padding: 0 22px 0 6px;
  border: 1px solid rgba(65, 113, 91, 0.28);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
}

.translation-target-compact select {
  min-height: 26px;
  padding-right: 18px;
  font-size: 10px;
}

.translation-control-note {
  color: var(--amber);
  font-size: 9px;
  font-weight: 700;
}

.inspector-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.inspector-toggle:hover {
  border-color: var(--line-strong);
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.inspector-toggle svg {
  width: 13px;
  height: 13px;
}

.inspector-placeholder-avatar {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px 10px 10px 3px;
  background: #e3eee8;
  color: var(--accent-deep);
}

.inspector-placeholder-avatar svg {
  width: 17px;
  height: 17px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1181px) {
  .workspace.is-inspector-collapsed {
    grid-template-columns: minmax(252px, 304px) minmax(410px, 1fr) 48px;
  }

  .inspector.is-collapsed {
    grid-template-rows: auto;
  }

  .inspector.is-collapsed .inspector-header {
    justify-content: center;
    padding: 12px 6px;
  }

  .inspector.is-collapsed .inspector-title-row,
  .inspector.is-collapsed .inspector-tabs,
  .inspector.is-collapsed .inspector-content,
  .inspector.is-collapsed .inspector-empty-state {
    display: none;
  }

  .inspector.is-collapsed .inspector-toggle-label {
    display: none;
  }

  .inspector.is-collapsed .inspector-toggle {
    padding: 0 6px;
  }
}

.message-translate-btn:disabled {
  color: var(--muted-light);
}

.message-translation-status {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.message-translation {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(65, 113, 91, 0.28);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.message-translation > span {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 700;
}

.composer-footer .solid-btn {
  min-width: 70px;
}

.send-hint {
  margin-left: 4px;
  color: var(--muted-light);
  font-size: 9px;
}

.inspector {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #fbfcf8;
}

.inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 17px 13px;
}

.inspector-title-row {
  gap: 9px;
  min-width: 0;
}

.inspector-title-row h2 {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-title-row p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verified-badge,
.status-pill,
.soft-badge,
.channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.verified-badge {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.verified-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #55a579;
  content: "";
}

.unverified-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.unverified-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c58c42;
  content: "";
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.inspector-tab {
  position: relative;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.inspector-tab:hover {
  color: var(--accent-deep);
}

.inspector-tab.is-active {
  color: var(--accent-deep);
}

.inspector-tab.is-active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  content: "";
}

.inspector-content {
  min-height: 0;
  overflow: auto;
  padding: 17px;
}

.inspector-empty-state {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  color: var(--muted);
  text-align: center;
}

.inspector-empty-state .empty-state-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--accent-deep);
}

.inspector-empty-state .empty-state-icon svg {
  width: 16px;
  height: 16px;
}

.inspector-empty-state strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.inspector-empty-state p {
  max-width: 220px;
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.inspector-section {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.inspector-section + .inspector-section {
  padding-top: 16px;
}

.section-kicker {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.data-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.data-row {
  justify-content: space-between;
  gap: 14px;
  min-height: 20px;
}

.data-row dt {
  color: var(--muted);
  font-size: 10px;
}

.data-row dd {
  max-width: 63%;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.inspector-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.subtle-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.customer-history {
  display: grid;
  gap: 9px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
}

.history-item strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.history-item span {
  color: var(--muted-light);
  white-space: nowrap;
}

.order-card,
.product-card {
  margin-bottom: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.order-card.is-selected,
.product-card.is-selected {
  border-color: #93c4b1;
  background: var(--accent-pale);
}

.order-title-row,
.product-row {
  justify-content: space-between;
  gap: 9px;
}

.order-title-row strong,
.product-row strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 780;
}

.order-title-row span,
.product-row span {
  color: var(--muted);
  font-size: 9px;
}

.order-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 9px 0;
}

.status-pill {
  background: var(--paper-deep);
  color: var(--muted);
}

.status-pill.is-paid {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.status-pill.is-partial {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.is-neutral::before {
  background: var(--muted-light);
}

.order-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.order-total span {
  color: var(--muted);
  font-size: 9px;
}

.order-total strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.verification-panel {
  padding: 13px;
  border: 1px dashed #e3c982;
  border-radius: 8px;
  background: #fff9e9;
}

.verification-panel strong {
  display: block;
  color: #775424;
  font-size: 11px;
}

.verification-panel p {
  margin: 6px 0 10px;
  color: #916e3f;
  font-size: 10px;
  line-height: 1.5;
}

.staff-login-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.product-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.product-hero .product-art {
  width: 58px;
  height: 58px;
  border-radius: 9px;
  font-size: 20px;
}

.product-hero h3 {
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 14px;
}

.product-price-row strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
}

.product-price-row span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.assignee-menu {
  position: absolute;
  z-index: 10;
  top: 52px;
  right: 76px;
  width: 140px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.assignee-option {
  display: flex;
  width: 100%;
  padding: 8px 9px;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: left;
}

.assignee-option:hover,
.assignee-option.is-selected {
  background: var(--accent-pale);
  color: var(--accent-deep);
}

.thread-more-menu {
  position: absolute;
  z-index: 12;
  top: 55px;
  right: 18px;
  width: 174px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.thread-more-menu p {
  margin: 3px 8px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-menu-option {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: left;
}

.status-menu-option:hover,
.status-menu-option.is-selected {
  background: var(--accent-pale);
  color: var(--accent-deep);
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-light);
}

.status-dot.is-waiting { background: var(--coral); }
.status-dot.is-unassigned { background: var(--amber); }
.status-dot.is-done { background: #55a579; }
.status-dot.is-internal { background: var(--blue); }
.status-dot.is-processing { background: var(--accent); }

.secondary-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: var(--paper);
}

.secondary-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 25px 18px;
  border-bottom: 1px solid var(--line);
}

.secondary-view-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.secondary-view-header p {
  max-width: 520px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.secondary-view-body {
  min-height: 0;
  overflow: auto;
  padding: 22px 25px;
}

.followup-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.followup-group-title {
  padding: 15px 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.followup-row {
  justify-content: space-between;
  gap: 15px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.followup-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.followup-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-side {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 5px;
}

.followup-side time {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.followup-side small {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
}

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

.directory-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 244, 0.55);
}

.directory-row strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.directory-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.directory-shop {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.settings-layout {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 25px;
  width: 100%;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 4px;
}

.settings-nav button {
  padding: 9px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.settings-nav button:hover,
.settings-nav button.is-active {
  background: var(--accent-pale);
  color: var(--accent-deep);
}

@media (min-width: 821px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-layout > .settings-nav {
    display: none;
  }
}

.inspector-close {
  display: none;
}

.parcel-row {
  display: grid;
  gap: 4px;
  padding: 7px 0;
  border-top: 1px solid rgba(220, 227, 220, 0.8);
}

.parcel-row:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.parcel-row strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.parcel-row span,
.parcel-row a {
  color: var(--muted);
  font-size: 9px;
}

.parcel-row a {
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
}

.parcel-row a:hover {
  text-decoration: underline;
}

.settings-content {
  max-width: 550px;
  margin-inline: auto;
}

.settings-content h3 {
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 780;
}

.settings-content > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.service-config-list {
  display: grid;
  gap: 14px;
}

.service-config-section {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.service-config-section:first-of-type {
  margin-top: 0;
}

.service-config-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.service-config-section-heading h4,
.service-config-shop-group h5 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.service-config-section-heading p {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.service-config-shop-group {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.service-config-shop-group + .service-config-shop-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.service-config-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.service-config-form.is-inherited {
  background: rgba(248, 249, 244, 0.6);
}

.service-config-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.service-config-heading,
.service-config-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-config-heading strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.service-config-heading small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

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

.service-config-grid label,
.service-config-secret {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.service-config-grid input,
.service-config-secret input {
  width: 100%;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
}

.service-config-grid input:disabled,
.service-config-secret input:disabled {
  opacity: 0.65;
}

.service-config-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
  padding-top: 2px;
}

.service-config-secret-hint {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.service-config-secret-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.service-config-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.service-config-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.service-config-check input {
  accent-color: var(--accent);
}

.service-config-actions .solid-btn {
  margin-left: auto;
}

.staff-management {
  max-width: 760px;
}

.staff-management-toolbar,
.staff-section-heading,
.staff-user-heading,
.staff-detail-heading,
.staff-row-actions,
.staff-session-row,
.staff-audit-row,
.staff-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.staff-management-toolbar {
  align-items: flex-start;
  margin-bottom: 15px;
}

.staff-management-toolbar h3 {
  margin-bottom: 5px;
}

.staff-management-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.staff-management-subnav {
  display: flex;
  gap: 5px;
  margin: 0 0 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.staff-management-subnav button {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.staff-management-subnav button:hover,
.staff-management-subnav button.is-active {
  border-color: var(--line-strong);
  background: var(--accent-pale);
  color: var(--accent-deep);
}

.staff-audit {
  max-width: 760px;
}

.staff-audit-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-deep);
}

.staff-audit-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.staff-audit-filters select {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
}

.staff-audit-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.staff-audit-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 9px;
}

.staff-management-boundary {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 11px 12px;
  border: 1px dashed #e3c982;
  border-radius: 7px;
  background: #fff9e9;
  color: #775424;
  font-size: 10px;
  line-height: 1.5;
}

.staff-management-boundary strong {
  font-size: 10px;
}

.staff-create-form,
.staff-password-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-deep);
}

.staff-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 11px;
}

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

.staff-form-grid label,
.staff-password-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.staff-form-grid input,
.staff-form-grid select,
.staff-password-form input {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
}

.staff-form-grid input:focus,
.staff-form-grid select:focus,
.staff-password-form input:focus {
  border-color: #88bca7;
  box-shadow: 0 0 0 3px rgba(96, 165, 135, 0.12);
}

.staff-shop-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.staff-shop-checks legend {
  width: 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.staff-shop-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.staff-shop-option input {
  accent-color: var(--accent);
}

.staff-management-section {
  margin-top: 22px;
}

.staff-section-heading {
  align-items: flex-end;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.staff-section-heading h4 {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 11px;
}

.staff-section-heading span {
  color: var(--muted);
  font-size: 9px;
}

.staff-list,
.staff-session-list,
.staff-audit-list {
  border-bottom: 1px solid var(--line);
}

.staff-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.staff-row:last-child,
.staff-session-row:last-child,
.staff-audit-row:last-child {
  border-bottom: 0;
}

.staff-row-main {
  display: grid;
  gap: 10px;
}

.staff-user-heading {
  align-items: flex-start;
}

.staff-detail-heading {
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.staff-detail-heading h4 {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.staff-detail-heading small {
  color: var(--muted);
  font-size: 9px;
}

.staff-user-heading strong,
.staff-session-row strong,
.staff-audit-row strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.staff-user-heading small,
.staff-session-row small,
.staff-audit-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.staff-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.staff-status.is-active { color: var(--accent-deep); }
.staff-status.is-disabled { color: var(--coral); }

.staff-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  color: var(--muted);
  font-size: 9px;
}

.staff-user-meta span + span::before {
  margin-right: 7px;
  color: var(--line-strong);
  content: "·";
}

.staff-row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.staff-readonly-note,
.staff-empty-note,
.staff-password-form small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.staff-password-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin: 0;
  padding: 10px;
}

.staff-password-form button,
.staff-password-form small {
  grid-column: 1 / -1;
}

.staff-session-row,
.staff-audit-row {
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.staff-session-row .danger-quiet-btn,
.staff-audit-row time {
  flex: 0 0 auto;
}

.staff-audit-row time {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.connection-result,
.read-only-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-align: right;
}

.connection-result.is-passed { color: var(--accent-deep); }
.connection-result.is-partial { color: var(--amber); }
.connection-result.is-pending { color: var(--muted); }

.live-shell {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.live-header,
.live-section-heading,
.live-product-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.live-header {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

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

.live-header h1,
.live-section h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.live-header h1 { font-size: clamp(28px, 5vw, 46px); }
.live-section h2 { font-size: 19px; }

.live-lede,
.live-note,
.live-boundary p {
  max-width: 690px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.live-section {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.live-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.live-status-item {
  display: grid;
  gap: 7px;
  min-height: 76px;
  padding: 15px;
  background: var(--paper);
}

.live-status-item span,
.live-product-row small {
  color: var(--muted);
  font-size: 11px;
}

.live-status-item strong { font-size: 13px; }

.live-catalog {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.live-product-row {
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.live-product-row > div:first-child {
  flex: 1 1 240px;
  display: grid;
  gap: 5px;
}

.live-product-variants {
  flex: 2 1 420px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.live-product-variants span { display: block; }
.live-product-variants b { color: var(--ink); }

.live-boundary {
  max-width: 700px;
}

.live-sales-header {
  align-items: flex-end;
}

.live-sales-header > div {
  max-width: 760px;
}

.live-shop-strip {
  padding-top: 24px;
}

.live-catalog-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.live-search-label,
.live-variant-label,
.live-message-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.live-search-input,
.live-variant-select,
.live-message-input {
  border: 1px solid var(--line-strong, #cbd6ce);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
}

.live-search-input {
  min-height: 38px;
  padding: 0 11px;
  outline: none;
}

.live-search-input:focus,
.live-variant-select:focus,
.live-message-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 153, 126, .14);
}

.live-catalog-count {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.live-product-card {
  display: grid;
  grid-template-columns: 64px minmax(220px, 1.5fr) minmax(150px, .8fr) auto;
  align-items: center;
  gap: 15px;
}

.live-product-image-wrap,
.live-product-placeholder {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, #d4e4db, #f4f7f1);
  color: var(--accent-deep);
  font-size: 20px;
  font-weight: 800;
}

.live-product-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-product-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.live-product-main > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-product-main > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-variant-label {
  margin-top: 4px;
}

.live-variant-select {
  width: 100%;
  min-height: 33px;
  padding: 0 8px;
  font-size: 11px;
}

.live-product-facts {
  display: grid;
  gap: 5px;
}

.live-product-facts strong {
  color: var(--ink);
  font-size: 14px;
}

.live-product-facts span {
  color: var(--muted);
  font-size: 10px;
}

.live-preview-section {
  max-width: 820px;
}

.live-preview-empty {
  margin-top: 18px;
  padding: 20px;
  border: 1px dashed var(--line-strong, #cbd6ce);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.live-preview {
  display: grid;
  gap: 13px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line-strong, #cbd6ce);
  background: var(--paper);
}

.live-preview-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-preview-product > div {
  display: grid;
  gap: 5px;
}

.live-preview-product strong {
  color: var(--ink);
  font-size: 14px;
}

.live-preview-product small {
  color: var(--muted);
  font-size: 10px;
}

.live-preview-thumb,
.live-preview-product .live-product-placeholder,
.live-preview-product .live-product-image-wrap {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.live-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.live-preview-meta strong {
  color: var(--ink-soft);
}

.live-preview-meta a {
  color: var(--accent-deep);
  font-weight: 750;
}

.live-message-input {
  width: 100%;
  min-height: 92px;
  padding: 10px;
  resize: vertical;
  outline: none;
  font-size: 12px;
  line-height: 1.6;
}

.live-preview-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.live-send-result {
  padding: 13px;
  border-left: 3px solid var(--accent);
  background: var(--accent-pale, #eef7f0);
  color: var(--accent-deep);
  font-size: 11px;
  line-height: 1.5;
}

.live-send-result.is-error {
  border-left-color: var(--amber);
  background: var(--amber-soft, #fff8e8);
  color: var(--amber);
}

.live-send-result.is-error strong {
  display: block;
}

.live-send-result p {
  margin: 5px 0 10px;
}

.live-send-result .solid-btn {
  display: inline-flex;
  text-decoration: none;
}

.live-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 10px;
}

.live-pagination .quiet-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .live-shell { width: min(100% - 28px, 560px); padding-top: 26px; }
  .live-header,
  .live-section-heading,
  .live-product-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .live-header-actions { justify-self: start; }
  .live-header .outline-btn,
  .live-section-heading .solid-btn { justify-self: start; }
  .live-status-grid { grid-template-columns: 1fr 1fr; }
  .live-product-row .quiet-btn { justify-self: start; }
  .live-catalog-toolbar { grid-template-columns: 1fr auto; }
  .live-search-label { grid-column: 1 / -1; }
  .live-catalog-count { justify-self: end; }
  .live-product-card { grid-template-columns: 52px minmax(0, 1fr); gap: 11px; }
  .live-product-card .live-product-thumb,
  .live-product-card .live-product-image-wrap,
  .live-product-card .live-product-placeholder { width: 52px; height: 52px; }
  .live-product-card .live-product-facts,
  .live-product-card .live-preview-button { grid-column: 2; }
  .live-product-card .live-preview-button { justify-self: start; }
}

@media (max-width: 420px) {
  .live-status-grid { grid-template-columns: 1fr; }
}

.followup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
}

.composer-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #eadcb9;
  background: #fff8e6;
  color: var(--amber);
  font-size: 10px;
}

.composer-error .quiet-btn {
  min-height: 24px;
  padding: 0 7px;
  color: var(--amber);
}

.compact-empty {
  padding: 18px 6px;
}

.empty-thread {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.empty-thread strong { color: var(--ink-soft); font-size: 12px; }

.service-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.service-badge.is-ready { border-color: #b8d7c6; background: var(--accent-soft); color: var(--accent-deep); }
.service-badge.is-offline { border-color: #e6d09b; background: var(--amber-soft); color: var(--amber); }

.setting-list {
  border-top: 1px solid var(--line);
}

.setting-row {
  justify-content: space-between;
  gap: 16px;
  min-height: 63px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.setting-error {
  color: var(--amber);
  font-size: 9px;
}

.setting-copy {
  display: grid;
  gap: 4px;
}

.setting-copy strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.setting-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.toggle {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 20px;
  background: var(--line-strong);
  cursor: pointer;
}

.toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 49, 39, 0.2);
  content: "";
  transition: transform 180ms ease;
}

.toggle.is-on {
  background: var(--accent);
}

.toggle.is-on::after {
  transform: translateX(14px);
}

.modal-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 34, 27, 0.42);
  backdrop-filter: blur(3px);
}

.modal {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid rgba(214, 225, 216, 0.9);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-modal);
  animation: modal-in 230ms ease both;
}

.modal-content {
  padding: 23px;
}

.modal-heading {
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.modal-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.modal-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-search {
  margin: 0 0 12px;
}

.product-result-list {
  display: grid;
  gap: 7px;
  max-height: 250px;
  overflow: auto;
}

.product-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  text-align: left;
}

.product-result:hover,
.product-result.is-selected {
  border-color: #95c5b1;
  background: var(--accent-pale);
}

.product-result-copy {
  min-width: 0;
}

.product-result-copy strong,
.product-result-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-result-copy strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.product-result-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.product-result-price {
  color: var(--ink);
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}

.variant-block,
.preview-block,
.form-field {
  margin-top: 15px;
}

.form-field label,
.variant-block label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.variant-block select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--paper);
  font-size: 11px;
}

.form-field textarea {
  min-height: 84px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.variant-block select:focus {
  border-color: #88bca7;
  box-shadow: 0 0 0 3px rgba(96, 165, 135, 0.12);
}

.preview-block {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-deep);
}

.preview-block .section-kicker {
  margin-bottom: 7px;
}

.preview-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.modal-actions {
  justify-content: flex-end;
  gap: 7px;
  margin-top: 20px;
}

.modal-actions .solid-btn {
  min-width: 100px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid #b8d7c6;
  border-radius: 8px;
  background: #f5fcf6;
  box-shadow: var(--shadow-soft);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  animation: toast-in 250ms ease both;
}

.toast.is-warning {
  border-color: #e6d09b;
  background: #fffaf0;
  color: #805d28;
}

.mobile-only {
  display: none;
}

.mobile-nav {
  display: none;
}

.mobile-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(17, 35, 27, 0.3);
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 8px;
    gap: 8px;
  }

  .workspace {
    grid-template-columns: minmax(240px, 286px) minmax(380px, 1fr);
  }

  .inspector {
    position: fixed;
    z-index: 45;
    top: 88px;
    right: 23px;
    bottom: 20px;
    width: min(340px, calc(100vw - 46px));
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    transform: translateX(calc(100% + 30px));
    transition: transform 220ms ease;
  }

  .inspector.is-open {
    transform: translateX(0);
  }

  .inspector-close {
    display: inline-flex;
  }

  .mobile-only {
    display: inline-flex;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    height: 100vh;
    padding: 0;
  }

  .sidebar {
    display: none;
  }

  .main-area {
    height: 100vh;
    grid-template-rows: 64px minmax(0, 1fr) 62px;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    min-height: 64px;
    padding: 0 14px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .shop-selector-button {
    min-width: 0;
    padding-right: 4px;
  }

  .shop-selector-copy small,
  .profile-name,
  .topbar-profile {
    display: none;
  }

  .shop-selector-copy strong {
    max-width: 100px;
    font-size: 10px;
  }

  .availability-button {
    padding: 7px;
    font-size: 0;
  }

  .availability-button .chevron {
    display: none;
  }

  .workspace {
    position: relative;
    display: block;
    height: calc(100vh - 126px);
  }

  .queue-panel {
    position: fixed;
    z-index: 45;
    top: 64px;
    bottom: 0;
    left: 0;
    width: min(88vw, 342px);
    border-right: 1px solid var(--line-strong);
    box-shadow: var(--shadow-soft);
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .queue-panel.is-open {
    transform: translateX(0);
  }

  .conversation-panel {
    height: 100%;
  }

  .thread-header {
    min-height: 70px;
    padding: 13px 14px;
  }

  .message-stream {
    padding: 17px 14px 12px;
  }

  .composer {
    margin: 0 10px 10px;
  }

  .inspector {
    top: 76px;
    right: 10px;
    bottom: 10px;
    width: min(94vw, 350px);
  }

  .thread-actions .text-icon-btn {
    display: none;
  }

  .mobile-info-btn {
    display: inline-flex !important;
  }

  .secondary-view-header,
  .secondary-view-body {
    padding-right: 17px;
    padding-left: 17px;
  }

  .directory-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
  }

  .queue-panel.is-open + .conversation-panel .settings-nav {
    display: none;
  }

  .settings-nav button {
    flex: 0 0 auto;
  }

  .service-config-grid {
    grid-template-columns: 1fr;
  }

  .service-config-secret-row {
    grid-template-columns: 1fr;
  }

  .service-config-heading,
  .service-config-actions,
  .service-config-section-heading,
  .service-config-heading-actions,
  .service-config-secret-row,
  .service-config-secret-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-config-actions .solid-btn {
    margin-left: 0;
  }

  .service-badge {
    display: none;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    min-height: 62px;
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.98);
  }

  .mobile-nav button {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-nav button > span:first-child {
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
  }

  .mobile-nav button > span:first-child svg { width: 100%; height: 100%; }
  .mobile-nav button.is-active { color: var(--accent-deep); }
  .mobile-nav button.is-active::before { position: absolute; top: 0; right: 25%; left: 25%; height: 2px; background: var(--accent); content: ""; }
  .mobile-nav button small { position: absolute; top: 7px; right: 24%; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--coral); color: #fff; font-size: 8px; line-height: 15px; }
}

@media (max-width: 500px) {
  .topbar h1 {
    font-size: 19px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .thread-title-row h2 {
    max-width: 165px;
    font-size: 14px;
  }

  .thread-subline {
    font-size: 9px;
  }

  .message-bubble {
    max-width: 87%;
  }

  .composer-tool span {
    display: none;
  }

  .send-hint {
    display: none;
  }

  .composer textarea {
    min-height: 65px;
  }

  .composer-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .composer-tools {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .composer-translation-controls {
    flex: 1 1 auto;
    margin-left: 2px;
  }

  .composer-translation-controls .translation-control-note {
    display: inline-flex;
  }

  .inspector-toggle-label {
    display: none;
  }

  .modal-layer {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
  }

  .modal-content {
    padding: 17px;
  }
}

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

.composer-scope-note {
  margin-left: auto;
  margin-right: 8px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 750;
}

.fixture-banner {
  margin: 10px 14px 0;
  padding: 8px 12px;
  border: 1px solid #e4b48e;
  border-radius: 6px;
  background: #fff3e8;
  color: #8a4f2d;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .01em;
}

.shop-menu-note {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.modal.modal-wide {
  width: min(100%, 900px);
}

.private-workbench-boundary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -3px 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.private-customer-search {
  margin-bottom: 14px;
}

.private-customer-search .search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.private-workbench-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.4fr);
  gap: 16px;
  min-height: 360px;
}

.private-customer-column,
.private-customer-detail {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.private-panel-heading,
.private-order-heading,
.private-detail-heading,
.private-order-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 9px;
}

.private-panel-heading span,
.private-order-heading span,
.private-detail-heading p,
.private-order-detail-heading p {
  color: var(--muted);
  font-size: 9px;
}

.private-customer-list,
.private-order-list {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}

.private-customer-item,
.private-order-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  text-align: left;
}

.private-customer-item:hover,
.private-customer-item.is-selected,
.private-order-item:hover,
.private-order-item.is-selected {
  border-color: #95c5b1;
  background: var(--accent-pale);
}

.private-customer-item strong,
.private-order-item strong,
.private-detail-heading h3,
.private-order-detail-heading h3 {
  color: var(--ink-soft);
  font-size: 11px;
}

.private-customer-item span,
.private-order-item span,
.private-detail-heading p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.private-detail-heading {
  padding-top: 13px;
}

.private-detail-heading h3,
.private-order-detail-heading h3 {
  margin: 2px 0 4px;
  font-size: 14px;
}

.private-order-heading {
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.private-order-detail {
  margin-top: 15px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.private-detail-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.private-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.private-pagination .quiet-btn {
  padding: 5px 8px;
  font-size: 9px;
}

.private-tracking-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.private-tracking-line a {
  color: var(--accent-deep);
  font-weight: 700;
}

.live-customer-boundary {
  max-width: 620px;
}

@media (max-width: 680px) {
  .staff-management-toolbar,
  .staff-section-heading,
  .staff-user-heading,
  .staff-detail-heading,
  .staff-session-row,
  .staff-audit-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-management-toolbar .solid-btn,
  .staff-session-row .danger-quiet-btn,
  .staff-audit-row time {
    align-self: flex-start;
  }

  .staff-form-grid,
  .staff-password-form,
  .staff-audit-filters {
    grid-template-columns: 1fr;
  }

  .staff-audit-filter-actions,
  .staff-audit-pagination {
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .staff-password-form button,
  .staff-password-form small {
    grid-column: auto;
  }

  .private-workbench-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .private-customer-list,
  .private-order-list {
    max-height: 220px;
  }

  .private-customer-detail {
    padding-top: 2px;
  }

  .fixture-banner {
    margin: 8px 10px 0;
  }

  .private-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}
