:root {
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #17191c;
  --body: #4d5a68;
  --muted: #737e8c;
  --line: #dce3ea;
  --line-strong: #bdc8d5;
  --blue: #0066cc;
  --blue-strong: #0053a6;
  --blue-soft: #eaf3ff;
  --green: #13795b;
  --green-soft: #edf8f4;
  --danger: #b42318;
  --danger-soft: #fff2f0;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.workspace-shell {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.workspace-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 58px;
  border-bottom: 1px solid rgba(220, 227, 234, 0.88);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
}

.topbar-inner,
.topbar-actions,
.workspace-brand {
  display: flex;
  align-items: center;
}

.topbar-inner {
  min-height: 58px;
  justify-content: space-between;
  gap: 20px;
}

.workspace-brand {
  min-height: 44px;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.workspace-brand img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.workspace-brand span {
  display: grid;
  gap: 1px;
}

.workspace-brand strong {
  font-size: 15px;
  line-height: 1.15;
}

.workspace-brand small {
  color: var(--muted);
  font-size: 10px;
}

.topbar-actions {
  min-width: 0;
  gap: 14px;
}

.connection-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.connection-pill.is-online,
.status-on {
  border-color: #b9dfd0;
  background: var(--green-soft);
  color: var(--green);
}

.connection-pill.is-offline,
.status-off {
  border-color: #cbd6e3;
  background: var(--surface-soft);
  color: var(--muted);
}

.user-label {
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
}

.text-link:hover,
.text-link:focus-visible,
.workspace-brand:hover,
.workspace-brand:focus-visible {
  color: var(--blue);
  outline: none;
}

.workspace-main {
  flex: 1;
  padding-block: 54px 72px;
}

.workspace-heading {
  max-width: 720px;
  margin-bottom: 36px;
}

.eyebrow,
.state-kicker,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.3;
  text-transform: uppercase;
}

.workspace-heading h1,
.state-panel h2,
.binding-section h2,
.workspace-summary h2,
.panel-heading h2,
.detail-placeholder h2,
.detail-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.workspace-heading h1 {
  font-size: 38px;
  line-height: 1.18;
}

.workspace-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--body);
  font-size: 16px;
  line-height: 1.75;
}

.state-panel,
.binding-section,
.active-workspace {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.state-panel {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 42px 0;
}

.loading-state {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}

.state-panel h2 {
  font-size: 24px;
  line-height: 1.3;
}

.state-panel p:not(.state-kicker) {
  max-width: 620px;
  margin: 12px 0 22px;
  color: var(--body);
  line-height: 1.7;
}

.spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 3px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: workspace-spin 800ms linear infinite;
}

.small-spinner {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border-width: 2px;
}

@keyframes workspace-spin {
  to { transform: rotate(360deg); }
}

.primary-button,
.secondary-button,
.mobile-back-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  border-color: var(--blue-strong);
  background: var(--blue-strong);
  outline: none;
}

.secondary-button,
.mobile-back-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.mobile-back-button:hover,
.mobile-back-button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.binding-section {
  padding: 34px 0 42px;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.binding-section h2,
.workspace-summary h2 {
  font-size: 25px;
  line-height: 1.3;
}

.binding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 64px;
}

.binding-copy > p {
  max-width: 610px;
  margin: 0;
  color: var(--body);
  line-height: 1.75;
}

.binding-copy ol {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding-left: 24px;
  color: var(--ink);
  line-height: 1.6;
}

.binding-copy .privacy-note {
  color: var(--muted);
  font-size: 13px;
}

.binding-form {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.binding-form label,
.search-field span,
.tag-field span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.binding-form input,
.customer-toolbar input,
.customer-toolbar select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}

.binding-form input {
  letter-spacing: 0;
  text-transform: uppercase;
}

.binding-form input:focus,
.customer-toolbar input:focus,
.customer-toolbar select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(0, 102, 204, 0.13);
}

.field-help,
.form-message {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.field-help {
  color: var(--muted);
}

.form-message {
  min-height: 19px;
  color: var(--danger);
}

.form-message.is-success {
  color: var(--green);
}

.full-button {
  width: 100%;
  margin-top: 2px;
}

.active-workspace {
  padding: 0 0 42px;
}

.workspace-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 22px 32px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.workspace-summary > .status-badge {
  align-self: start;
  justify-self: end;
}

.summary-title #linkSummary {
  margin: 10px 0 0;
  color: var(--body);
  line-height: 1.65;
}

.summary-title .unlink-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.summary-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.summary-facts div {
  min-width: 0;
  padding: 16px 18px;
  background: var(--surface-soft);
}

.summary-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.summary-facts dd {
  margin: 6px 0 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-notice {
  min-height: 20px;
  margin: 18px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-notice.is-info {
  color: var(--body);
}

.workspace-actionbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.workspace-actionbar > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-actionbar strong {
  font-size: 15px;
}

.workspace-actionbar span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.customer-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) auto auto;
  align-items: end;
  gap: 12px;
  padding: 22px 0;
}

.search-field,
.tag-field {
  display: grid;
  gap: 7px;
}

.toolbar-button {
  min-height: 48px;
}

.customer-workspace {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.customer-list-panel,
.customer-detail-panel {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
}

.customer-list-panel {
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

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

.panel-heading {
  min-height: 54px;
  padding-bottom: 14px;
}

.panel-heading h2,
.detail-placeholder h2,
.detail-heading h2 {
  font-size: 21px;
  line-height: 1.3;
}

.panel-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.panel-loading {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.panel-empty {
  margin: 0;
  padding: 28px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

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

.customer-load-more {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue);
  font-weight: 650;
  cursor: pointer;
}

.customer-load-more:hover,
.customer-load-more:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.customer-load-more:disabled {
  cursor: wait;
  opacity: 0.58;
}

.customer-item {
  width: 100%;
  min-height: 76px;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.customer-item:hover,
.customer-item:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.customer-item.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.customer-item strong,
.customer-item span,
.customer-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-item strong {
  font-size: 15px;
}

.customer-item span {
  color: var(--body);
  font-size: 13px;
}

.customer-item small {
  color: var(--muted);
  font-size: 11px;
}

.customer-detail-panel {
  min-height: 560px;
}

.detail-placeholder {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.detail-placeholder h2 {
  color: var(--ink);
}

.detail-placeholder > p:last-child {
  margin: 10px 0 0;
  line-height: 1.6;
}

.detail-loading {
  min-height: 320px;
}

.mobile-back-button {
  display: none;
  margin-bottom: 18px;
}

.detail-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.detail-heading > div:first-child {
  min-width: 0;
}

.detail-heading-side {
  min-width: min(300px, 48%);
  display: grid;
  justify-items: end;
  gap: 12px;
}

.detail-write-actions,
.content-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-heading-row {
  justify-content: space-between;
}

.inline-action-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
  cursor: pointer;
}

.inline-action-button:hover,
.inline-action-button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.detail-heading h2,
.detail-heading > div:first-child > p:last-child {
  overflow-wrap: anywhere;
}

.detail-heading > div:first-child > p:last-child {
  margin: 6px 0 0;
  color: var(--body);
  line-height: 1.55;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #c9dcf4;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
}

.customer-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
  padding: 10px 0 6px;
}

.customer-facts div {
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.customer-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.customer-facts dd {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.next-action {
  margin-top: 24px;
  padding: 18px 20px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.next-action h3,
.communication-section h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.next-action > p:last-child {
  margin: 9px 0 0;
  color: var(--body);
  line-height: 1.7;
  white-space: pre-wrap;
}

.communication-section {
  margin-top: 32px;
}

.compact-heading {
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.communication-list {
  display: grid;
}

.communication-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.communication-item time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.communication-item p {
  margin: 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.write-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: min(86vh, 820px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 72px rgba(23, 25, 28, 0.22);
}

.write-dialog::backdrop {
  background: rgba(20, 28, 38, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.write-dialog-shell {
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
}

.write-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
}

.write-dialog-header > div {
  min-width: 0;
}

.write-dialog-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.write-dialog-header > div > p:last-child {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 13px;
  line-height: 1.6;
}

.dialog-close-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -7px -9px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close-button:hover,
.dialog-close-button:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}

.write-form {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 26px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

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

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

.write-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.write-field em {
  color: var(--danger);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.write-field input,
.write-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}

.write-field textarea {
  min-height: 116px;
  resize: vertical;
}

.write-field input:focus,
.write-field textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(0, 102, 204, 0.13);
}

.tag-options-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.tag-options-fieldset legend {
  margin-bottom: 14px;
  color: var(--body);
  font-size: 13px;
}

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

.tag-option {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--body);
  cursor: pointer;
}

.tag-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.tag-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.tag-options-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.write-form-message {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.55;
}

.write-form-message.is-success {
  color: var(--green);
}

.write-form-actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 12px -26px 0;
  padding: 18px 26px 4px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.write-form-actions .primary-button,
.write-form-actions .secondary-button {
  min-width: 108px;
}

.workspace-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.footer-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.footer-inner div {
  display: flex;
  gap: 18px;
}

.footer-inner a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
  color: var(--blue);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .spinner {
    animation-duration: 1600ms;
  }
}

@media (max-width: 860px) {
  .workspace-shell {
    width: min(100% - 36px, var(--max));
  }

  .binding-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .binding-form {
    max-width: 560px;
  }

  .customer-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  }

  .toolbar-button {
    width: 100%;
  }

  .customer-workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .workspace-shell {
    width: min(100% - 28px, var(--max));
  }

  .workspace-main {
    padding-block: 34px 50px;
  }

  .workspace-heading {
    margin-bottom: 28px;
  }

  .workspace-heading h1 {
    font-size: 32px;
  }

  .workspace-heading > p:last-child {
    font-size: 15px;
  }

  .user-label {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .connection-pill {
    padding-inline: 8px;
    font-size: 11px;
  }

  .binding-layout {
    gap: 24px;
  }

  .binding-form {
    max-width: none;
    padding: 18px;
  }

  .workspace-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 12px;
  }

  .summary-facts {
    grid-template-columns: 1fr;
  }

  .summary-facts dd {
    white-space: normal;
  }

  .workspace-actionbar {
    align-items: flex-start;
  }

  .workspace-actionbar .primary-button {
    flex: 0 0 auto;
  }

  .customer-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .search-field,
  .tag-field {
    grid-column: 1 / -1;
  }

  .customer-workspace {
    min-height: 460px;
    display: block;
  }

  .customer-list-panel,
  .customer-detail-panel {
    padding: 18px;
  }

  .customer-list-panel {
    min-height: 460px;
    border-right: 0;
  }

  .customer-detail-panel {
    display: none;
    min-height: 460px;
  }

  .customer-workspace.show-mobile-detail .customer-list-panel {
    display: none;
  }

  .customer-workspace.show-mobile-detail .customer-detail-panel {
    display: block;
  }

  .mobile-back-button {
    display: inline-flex;
  }

  .detail-heading {
    display: grid;
  }

  .detail-heading-side {
    min-width: 0;
    justify-items: start;
  }

  .tag-list {
    justify-content: flex-start;
  }

  .customer-facts {
    grid-template-columns: 1fr;
  }

  .communication-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .write-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .write-dialog-shell {
    max-height: 92dvh;
  }

  .write-dialog-header {
    padding: 20px 18px 16px;
  }

  .write-form {
    padding: 20px 18px max(22px, env(safe-area-inset-bottom));
  }

  .form-grid.two-columns,
  .tag-options {
    grid-template-columns: 1fr;
  }

  .write-form-actions {
    position: sticky;
    bottom: 0;
    margin-inline: -18px;
    padding: 14px 18px max(14px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
  }

  .write-form-actions .primary-button,
  .write-form-actions .secondary-button {
    min-width: 0;
    flex: 1;
  }

  .footer-inner {
    min-height: 96px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .workspace-brand small {
    display: none;
  }

  .connection-pill {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .workspace-main {
    padding-top: 28px;
  }

  .workspace-heading h1 {
    font-size: 29px;
  }

  .section-heading-row {
    display: grid;
  }

  .section-heading-row .status-badge {
    justify-self: start;
  }
}
