:root {
  --ink: #17201c;
  --muted: #68746e;
  --line: #dfe7e2;
  --surface: #ffffff;
  --canvas: #f3f6f3;
  --sidebar: #11251d;
  --sidebar-soft: #1b352a;
  --green: #08a65c;
  --green-dark: #07834b;
  --green-soft: #e7f7ee;
  --red: #d84a4a;
  --red-soft: #fff0ef;
  --amber: #c47d12;
  --shadow: 0 14px 36px rgba(24, 49, 38, 0.08);
  --radius: 18px;
}

/* History import and portable persona studio */
.persona-boundary-note {
  margin-bottom: 18px;
}

.persona-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.persona-editor-card,
.persona-bindings-card,
.history-import-card {
  min-width: 0;
}

.button-group.compact .btn {
  padding: 9px 13px;
}

.persona-style-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #dce8e2;
  border-radius: 12px;
  background: #f6faf8;
  color: #466057;
  white-space: pre-wrap;
  line-height: 1.65;
}

.persona-editor-actions,
.history-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.persona-json-field {
  margin-top: 14px;
}

.card-copy {
  color: var(--muted);
  line-height: 1.7;
}

.persona-binding-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.persona-binding-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.persona-binding-row div {
  display: grid;
  gap: 3px;
}

.persona-binding-row small {
  color: var(--muted);
}

.history-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
}

.history-contact-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.history-contact-toolbar > div {
  display: flex;
  gap: 10px;
}

.history-search {
  display: flex;
  margin-bottom: 10px;
}

.history-contact-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.history-contact-option {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.history-contact-option:last-child {
  border-bottom: 0;
}

.history-contact-option:hover {
  background: #f7faf8;
}

.history-contact-option > span:last-child {
  display: grid;
  gap: 2px;
}

.history-contact-option small {
  color: var(--muted);
}

.history-import-options {
  display: grid;
  align-content: start;
  gap: 12px;
}

.history-learn-switch {
  margin-top: 2px;
}

.history-progress {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.history-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.history-progress > div span,
.history-progress p {
  color: var(--muted);
}

.history-progress > i {
  display: block;
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efeb;
}

.history-progress > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.25s ease;
}

.history-result-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.history-result-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f7f9f8;
}

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

.history-result-row.failed {
  background: #fff2f0;
}

@media (max-width: 980px) {
  .persona-layout,
  .history-import-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 8%, rgba(8, 166, 92, 0.07), transparent 26rem),
    var(--canvas);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(8, 166, 92, 0.28);
  outline-offset: 2px;
}

.segmented input:focus-visible + span,
.switch-row input:focus-visible + i {
  outline: 3px solid rgba(8, 166, 92, 0.28);
  outline-offset: 2px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%),
    var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: #092117;
  background: #43dc89;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(50, 218, 129, 0.2);
}

.brand strong,
.brand span {
  display: block;
}

.mobile-section-nav {
  display: none;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand span {
  margin-top: 3px;
  color: #8ba99a;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 12px;
  color: #91aa9e;
  background: transparent;
  text-align: left;
  transition: 160ms ease;
}

.nav-alert {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  margin-left: auto;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #e25a50;
  font-size: 9px;
  font-weight: 850;
}

.nav-item:hover {
  color: #dbe9e2;
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
  color: #fff;
  background: var(--sidebar-soft);
  box-shadow: inset 3px 0 #36dc83;
}

.nav-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  color: #b6cec1;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
}

.nav-item.active .nav-icon {
  color: #42df89;
  background: rgba(54, 220, 131, 0.11);
}

.local-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.lock-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #3ee48b;
  box-shadow: 0 0 0 4px rgba(62, 228, 139, 0.1);
}

.local-note strong,
.local-note span {
  display: block;
}

.local-note strong {
  font-size: 12px;
}

.local-note span {
  margin-top: 4px;
  color: #829d90;
  font-size: 11px;
  line-height: 1.45;
}

.main {
  min-height: 100vh;
  margin-left: 248px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 98px;
  padding: 0 42px;
  border-bottom: 1px solid rgba(199, 211, 204, 0.75);
  background: rgba(247, 249, 247, 0.78);
  backdrop-filter: blur(16px);
}

.eyebrow,
.section-label,
.hero-kicker {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.console-user {
  display: grid;
  justify-items: end;
  line-height: 1.2;
}

.console-user span {
  color: #31443a;
  font-size: 12px;
  font-weight: 760;
}

.console-user b {
  margin-top: 3px;
  color: var(--green-dark);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.logout-button {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #64736b;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.logout-button:hover {
  border-color: #b9c9c0;
  color: #33443b;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a7b0ab;
}

.status-pill.online {
  border-color: #bde8d0;
  color: #087d48;
  background: #effbf4;
}

.status-pill.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(8, 166, 92, 0.12);
}

.content {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.save-dock {
  position: fixed;
  right: max(24px, calc((100vw - 248px - 1180px) / 2 + 24px));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  width: min(520px, calc(100vw - 296px));
  min-width: 0;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px 12px 12px 17px;
  border: 1px solid rgba(29, 75, 53, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(14, 44, 29, 0.18);
  backdrop-filter: blur(18px);
}

.save-dock-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.save-dock-copy strong,
.save-dock-copy small {
  display: block;
}

.save-dock-copy strong {
  color: #173a29;
  font-size: 13px;
}

.save-dock-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.save-dock-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f2a53a;
  box-shadow: 0 0 0 5px rgba(242, 165, 58, 0.14);
}

.page-section {
  display: none;
  animation: section-in 180ms ease-out;
}

.page-section.active {
  display: block;
}

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

.hero-card {
  position: relative;
  display: flex;
  min-height: 238px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 38px 42px;
  border-radius: 24px;
  color: #f5fff9;
  background:
    radial-gradient(circle at 85% 50%, rgba(52, 225, 134, 0.16), transparent 24rem),
    linear-gradient(120deg, #11261d 0%, #193e2e 100%);
  box-shadow: 0 22px 48px rgba(14, 47, 33, 0.18);
}

.hero-card::after {
  position: absolute;
  right: -60px;
  bottom: -120px;
  width: 360px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-kicker {
  color: #48df8d;
}

.hero-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(27px, 4vw, 40px);
  letter-spacing: -0.045em;
}

.hero-copy p {
  max-width: 560px;
  margin: 0;
  color: #adc2b6;
  font-size: 14px;
  line-height: 1.7;
}

.hero-actions,
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 750;
  transition: 150ms ease;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.58;
}

.btn-primary {
  color: #062315;
  background: #42df89;
  box-shadow: 0 8px 24px rgba(54, 220, 131, 0.18);
}

.btn-primary:hover {
  background: #5be898;
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: var(--line);
  color: #34423b;
  background: #fff;
}

.hero-card .btn-secondary {
  border-color: rgba(255, 255, 255, 0.16);
  color: #dce9e2;
  background: rgba(255, 255, 255, 0.07);
}

.btn-secondary:hover {
  border-color: #bdcac2;
}

.btn-danger {
  color: #fff;
  background: #d74a4a;
}

.button-icon {
  font-size: 10px;
}

.hidden {
  display: none !important;
}

.pulse-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  width: 158px;
  height: 158px;
  flex: 0 0 158px;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(86, 231, 151, 0.2);
  border-radius: 50%;
}

.orbit-one {
  inset: 8px;
}

.orbit-two {
  inset: 28px;
  border-color: rgba(86, 231, 151, 0.34);
}

.pulse-core {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 23px;
  color: #07301c;
  background: #49e492;
  font-size: 26px;
  font-weight: 850;
  box-shadow:
    0 0 0 12px rgba(71, 227, 145, 0.08),
    0 16px 34px rgba(29, 221, 119, 0.19);
}

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

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

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

.hero-card + .grid,
.compact-card,
.section-intro + .grid,
.model-card + .grid {
  margin-top: 18px;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-guide {
  margin-top: 18px;
  background:
    linear-gradient(135deg, rgba(8, 166, 92, 0.055), transparent 54%),
    var(--surface);
}

.setup-guide + .grid {
  margin-top: 18px;
}

.setup-guide-heading,
.setup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.setup-guide-heading h3 {
  margin: 3px 0 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.setup-guide-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.setup-guide-heading > strong {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  color: #087d48;
  background: var(--green-soft);
  font-size: 12px;
}

.setup-progress {
  height: 7px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeea;
}

.setup-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-dark), #3bd781);
  transition: width 180ms ease;
}

.setup-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.setup-checklist li {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.setup-checklist span,
.setup-checklist b {
  display: block;
}

.setup-checklist span {
  overflow: hidden;
  color: #4d5c54;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-checklist b {
  margin-top: 5px;
  color: #9b7a3e;
  font-size: 9px;
}

.setup-checklist b.complete {
  color: #087d48;
}

.setup-actions {
  justify-content: flex-end;
}

.contact-sync-notice {
  margin: 14px 18px 0;
  padding: 10px 12px;
  border: 1px solid #efdaa9;
  border-radius: 10px;
  color: #815c1c;
  background: #fffaf0;
  font-size: 10px;
  line-height: 1.55;
}

.compact-card {
  margin-top: 18px;
}

.card-heading,
.section-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card-heading {
  margin-bottom: 20px;
}

.card-heading h3,
.section-intro h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.card-heading h3 {
  font-size: 18px;
}

.section-intro {
  align-items: center;
  margin-bottom: 22px;
}

.section-intro h2 {
  font-size: 28px;
}

.section-intro p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #7a5c17;
  background: #fff4d9;
  font-size: 10px;
  font-weight: 800;
}

.badge.success {
  color: #087e48;
  background: var(--green-soft);
}

.field {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.field:first-child {
  margin-top: 0;
}

.field > span,
.field legend {
  color: #3b4942;
  font-size: 12px;
  font-weight: 720;
}

.field small {
  color: #8a9690;
  font-size: 11px;
}

fieldset.field {
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9e2dc;
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fbfcfb;
  transition: 150ms ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 11px 12px;
  line-height: 1.6;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #48bf7f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(8, 166, 92, 0.09);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f3f6f4;
}

.assistant-mode-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-mode-line b.ai {
  color: #3158a5;
  background: #edf3ff;
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #718078;
  font-size: 12px;
  font-weight: 700;
}

.segmented input:checked + span {
  color: #087a46;
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 46, 35, 0.08);
}

.switch-row {
  position: relative;
  display: flex;
  min-height: 59px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #edf1ee;
}

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

.switch-row strong,
.switch-row span {
  display: block;
}

.switch-row strong {
  color: #344139;
  font-size: 13px;
}

.switch-row span {
  margin-top: 4px;
  color: #8a9690;
  font-size: 11px;
}

.switch-row input {
  position: absolute;
  right: 0;
  width: 42px;
  height: 24px;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: #ced7d2;
  transition: 160ms ease;
}

.switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(20, 38, 29, 0.2);
  content: "";
  transition: 160ms ease;
}

.switch-row input:checked + i {
  background: var(--green);
}

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

.input-unit,
.password-field {
  position: relative;
}

.input-unit input {
  padding-right: 48px;
}

.input-unit em {
  position: absolute;
  top: 50%;
  right: 13px;
  color: #8a9690;
  font-size: 11px;
  font-style: normal;
  transform: translateY(-50%);
}

.form-grid {
  gap: 12px;
}

.accent-card {
  border-color: #cfe8da;
  background:
    linear-gradient(180deg, rgba(231, 247, 238, 0.42), transparent 42%),
    #fff;
}

.text-button {
  padding: 5px 0;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #cfe4d8;
  border-radius: 14px;
  color: #345444;
  background: #edf8f2;
}

.notice > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  color: #087d48;
  background: #d5f0e1;
  font-size: 10px;
  font-weight: 850;
}

.notice strong {
  font-size: 13px;
}

.notice p {
  margin: 4px 0 0;
  color: #65796e;
  font-size: 12px;
  line-height: 1.55;
}

.duty-mode-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  border-color: #bfe1ce;
  background:
    radial-gradient(circle at 94% 0%, rgba(66, 223, 137, 0.16), transparent 18rem),
    linear-gradient(145deg, #f9fffb, #f0f9f4);
}

.duty-mode-card::after {
  position: absolute;
  top: -80px;
  right: -70px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(8, 166, 92, 0.1);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.duty-mode-card.error {
  border-color: #efc2bf;
  background:
    linear-gradient(145deg, #fffdfd, #fff5f4);
}

.duty-mode-header,
.duty-mode-title,
.duty-mode-footer,
.duty-mode-footer > div {
  display: flex;
  align-items: center;
}

.duty-mode-header {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 18px;
}

.duty-mode-title {
  min-width: 0;
  gap: 14px;
}

.duty-mode-title h3 {
  margin: 2px 0 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.duty-mode-title p {
  margin: 5px 0 0;
  color: #65766c;
  font-size: 12px;
  line-height: 1.55;
}

.duty-mode-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 15px;
  color: #063520;
  background: #48df8d;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(8, 166, 92, 0.2);
}

.duty-mode-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  color: #647169;
  background: #e5ebe7;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.duty-mode-badge.active {
  color: #087a46;
  background: #d5f1e1;
}

.duty-mode-badge.inactive {
  color: #6f6250;
  background: #eee9e0;
}

.duty-mode-badge.warning,
.duty-mode-badge.error {
  color: #9b411e;
  background: #ffe5d8;
}

.duty-mode-badge.loading {
  color: #52645a;
  background: #e2ece6;
}

.duty-mode-switch {
  z-index: 1;
  min-height: 76px;
  margin-top: 18px;
  padding: 0 2px;
  border-top: 1px solid rgba(43, 106, 75, 0.11);
  border-bottom-color: rgba(43, 106, 75, 0.11);
}

.duty-mode-switch strong {
  color: #203c2d;
  font-size: 14px;
}

.duty-mode-switch span {
  max-width: 700px;
  color: #718078;
  font-size: 11px;
  line-height: 1.55;
}

.duty-mode-switch input:disabled + i {
  cursor: wait;
  opacity: 0.55;
}

.duty-mode-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.duty-mode-status-grid > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(76, 118, 96, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.duty-mode-status-grid span,
.duty-mode-status-grid strong {
  display: block;
}

.duty-mode-status-grid span {
  color: #859189;
  font-size: 10px;
  font-weight: 720;
}

.duty-mode-status-grid strong {
  overflow: hidden;
  margin-top: 6px;
  color: #425149;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duty-mode-status-grid strong[data-state="good"] {
  color: #087b47;
}

.duty-mode-status-grid strong[data-state="warning"] {
  color: #b25f15;
}

.duty-mode-status-grid strong[data-state="bad"] {
  color: #bc3f3f;
}

.duty-mode-footer {
  justify-content: space-between;
  gap: 18px;
  margin-top: 15px;
}

.duty-mode-footer p {
  margin: 0;
  color: #687a70;
  font-size: 11px;
  line-height: 1.5;
}

.duty-mode-footer p.error {
  color: #b13f3f;
}

.duty-mode-footer > div {
  flex: 0 0 auto;
  gap: 12px;
}

.duty-mode-footer small {
  color: #929d97;
  font-size: 9px;
  white-space: nowrap;
}

.duty-mode-footer .btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 10px;
}

.duty-mode-cautions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 17px;
}

.duty-mode-cautions > div {
  padding: 13px 15px;
  border: 1px solid #f0d9b3;
  border-radius: 11px;
  background: rgba(255, 248, 231, 0.8);
}

.duty-mode-cautions > div:last-child {
  border-color: #d8e1dc;
  background: rgba(247, 250, 248, 0.82);
}

.duty-mode-cautions strong,
.duty-mode-cautions span {
  display: block;
}

.duty-mode-cautions strong {
  color: #80571c;
  font-size: 11px;
}

.duty-mode-cautions > div:last-child strong {
  color: #405148;
}

.duty-mode-cautions span {
  margin-top: 4px;
  color: #82735d;
  font-size: 10px;
  line-height: 1.5;
}

.duty-mode-cautions > div:last-child span {
  color: #748078;
}

.model-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.provider-logo {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #2b6aff, #1943b8);
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 9px 22px rgba(39, 93, 224, 0.2);
}

.provider-copy {
  flex: 1;
}

.provider-copy h3 {
  margin: 0;
  font-size: 19px;
}

.provider-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.password-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 5px 7px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  transform: translateY(-50%);
}

.range-field {
  padding-top: 15px;
}

input[type="range"] {
  height: 22px;
  padding: 0;
  border: 0;
  accent-color: var(--green);
  background: transparent;
  box-shadow: none;
}

.range-field b {
  color: var(--green-dark);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: #9ba59f;
  font-size: 10px;
}

.recommendation {
  margin-top: 24px;
  padding: 17px;
  border-radius: 12px;
  background: #f0f7f3;
}

.recommendation span {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 6px;
  color: #087a46;
  background: #dcefe4;
  font-size: 9px;
  font-weight: 850;
}

.recommendation p {
  margin: 9px 0 0;
  color: #60736a;
  font-size: 12px;
  line-height: 1.6;
}

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

.contact-stats article {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 49, 38, 0.055);
}

.contact-stats article::after {
  position: absolute;
  top: -22px;
  right: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green-soft);
  content: "";
}

.contact-stats span,
.contact-stats small,
.contact-stats strong {
  display: block;
}

.contact-stats span {
  color: #65736c;
  font-size: 11px;
  font-weight: 700;
}

.contact-stats strong {
  margin: 8px 0 4px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.contact-stats small {
  color: #9aa49f;
  font-size: 10px;
}

.dashboard-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.dashboard-toolbar label {
  display: grid;
  gap: 5px;
  color: #65736c;
  font-size: 10px;
  font-weight: 750;
}

.dashboard-toolbar select {
  min-width: 116px;
}

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

.dashboard-summary article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(8, 166, 92, 0.055), transparent 58%),
    #fff;
  box-shadow: 0 10px 28px rgba(24, 49, 38, 0.05);
}

.dashboard-summary span,
.dashboard-summary strong,
.dashboard-summary small {
  display: block;
}

.dashboard-summary span {
  overflow: hidden;
  color: #65736c;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary strong {
  margin: 8px 0 4px;
  color: #183126;
  font-size: 27px;
  letter-spacing: -0.045em;
}

.dashboard-summary small {
  overflow: hidden;
  color: #98a39d;
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-legend {
  display: flex;
  gap: 10px;
  color: #78857e;
  font-size: 9px;
}

.dashboard-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashboard-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dashboard-legend .inbound,
.dashboard-bars .inbound {
  background: #9ab8a8;
}

.dashboard-legend .sent,
.dashboard-bars .sent {
  background: var(--green);
}

.dashboard-legend .error,
.dashboard-bars .error {
  background: #e59a90;
}

.dashboard-trend {
  display: grid;
  gap: 9px;
  max-height: 420px;
  overflow-y: auto;
}

.dashboard-trend-row {
  display: grid;
  grid-template-columns: 44px minmax(80px, 1fr) 76px;
  align-items: center;
  gap: 10px;
  color: #6f7c75;
  font-size: 10px;
}

.dashboard-trend-row > small {
  color: #8e9993;
  text-align: right;
}

.dashboard-bars {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-bars i {
  display: block;
  min-width: 2px;
  height: 4px;
  border-radius: 999px;
}

.dashboard-health {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dashboard-health > div {
  padding: 13px;
  border-radius: 11px;
  background: #f5f8f6;
}

.dashboard-health span,
.dashboard-health strong {
  display: block;
}

.dashboard-health span {
  color: #748078;
  font-size: 10px;
}

.dashboard-health strong {
  margin-top: 6px;
  font-size: 20px;
}

.dashboard-health-note {
  margin: 14px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  color: #4d7562;
  background: #edf7f1;
  font-size: 10px;
  line-height: 1.55;
}

.dashboard-health-note.attention {
  color: #875d1f;
  background: #fff5df;
}

.dashboard-contact-card {
  padding: 0;
  overflow-x: auto;
}

.dashboard-contact-card .card-heading {
  min-width: 780px;
  margin: 0;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.dashboard-contact-card .card-heading > small {
  color: #8b9790;
  font-size: 10px;
}

.dashboard-contact-head,
.dashboard-contact-row {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.4fr) 70px 70px 70px minmax(110px, 0.8fr)
    minmax(110px, 0.7fr);
  align-items: center;
  gap: 12px;
  min-width: 780px;
}

.dashboard-contact-head {
  padding: 11px 20px;
  color: #89958f;
  background: #f7f9f8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.dashboard-contact-row {
  padding: 14px 20px;
  border-top: 1px solid #edf1ee;
  color: #55645c;
  font-size: 11px;
}

.dashboard-contact-row:first-child {
  border-top: 0;
}

.dashboard-contact-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-contact-person .contact-avatar {
  flex: 0 0 auto;
}

.dashboard-contact-person div,
.dashboard-contact-person strong,
.dashboard-contact-person small {
  min-width: 0;
}

.dashboard-contact-person strong,
.dashboard-contact-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-contact-person small {
  margin-top: 4px;
  color: #99a39e;
  font-size: 9px;
}

.dashboard-error-count {
  color: #b64c45;
}

.dashboard-contact-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #68766e;
  background: #f1f4f2;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-contact-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca7a1;
}

.dashboard-contact-state.online,
.dashboard-contact-state.testing {
  color: #087a46;
  background: var(--green-soft);
}

.dashboard-contact-state.online i,
.dashboard-contact-state.testing i {
  background: var(--green);
}

.dashboard-contact-state.attention {
  color: #8a621e;
  background: #fff3d7;
}

.dashboard-contact-state.attention i {
  background: #dda329;
}

.dashboard-contact-state.danger {
  color: #a33e39;
  background: #fff0ee;
}

.dashboard-contact-state.danger i {
  background: #d85d55;
}

.dashboard-contact-card .contact-empty {
  min-width: 780px;
}

.dashboard-privacy-note {
  margin-top: 18px;
}

.contact-panel {
  padding: 0;
  overflow: hidden;
}

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

.contact-search {
  position: relative;
  width: min(390px, 100%);
}

.contact-search span {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  color: #84918a;
  transform: translateY(-50%);
}

.contact-search input {
  padding-left: 36px;
}

.contact-filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f0f4f1;
}

.contact-filters button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  color: #718079;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.contact-filters button.active {
  color: #087d48;
  background: #fff;
  box-shadow: 0 2px 8px rgba(26, 50, 39, 0.08);
}

.contact-list-head,
.contact-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(220px, 1.35fr) 120px 150px;
  align-items: center;
  gap: 16px;
}

.contact-list-head {
  min-height: 41px;
  padding: 0 20px;
  color: #8c9892;
  background: #f8faf8;
  font-size: 10px;
  font-weight: 750;
}

.contact-row {
  position: relative;
  min-height: 82px;
  padding: 13px 20px;
  border-top: 1px solid #edf1ee;
  transition: 140ms ease;
}

.contact-row:hover {
  background: #fbfdfb;
}

.contact-row.running {
  background: linear-gradient(90deg, rgba(231, 247, 238, 0.72), transparent 44%);
}

.contact-row.pending-restart {
  background: linear-gradient(90deg, rgba(255, 244, 218, 0.82), transparent 48%);
}

.contact-row.pending-restart .contact-state {
  color: #a66b12;
}

.contact-row.pending-restart .contact-state i {
  background: #d99527;
  box-shadow: 0 0 0 4px rgba(217, 149, 39, 0.12);
}

.contact-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.contact-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 13px;
  color: #17402d;
  background: #dcefe4;
  font-size: 14px;
  font-weight: 850;
}

.contact-avatar.tone-1 {
  color: #26437f;
  background: #e1e9fb;
}

.contact-avatar.tone-2 {
  color: #7f5521;
  background: #f7ead7;
}

.contact-avatar.tone-3 {
  color: #783b67;
  background: #f3e2ee;
}

.contact-avatar.large {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border-radius: 17px;
  font-size: 19px;
}

.contact-person strong,
.contact-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-person strong {
  font-size: 13px;
}

.contact-person small {
  margin-top: 4px;
  color: #929d97;
  font-size: 10px;
}

.contact-unread {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #e64c4c;
  font-size: 9px;
}

.profile-summary {
  min-width: 0;
}

.profile-summary strong,
.profile-summary span {
  display: block;
}

.profile-summary strong {
  overflow: hidden;
  color: #536159;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary span {
  margin-top: 6px;
  color: #9aa49f;
  font-size: 9px;
}

.profile-summary .contact-mode-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-mode-line b {
  padding: 2px 6px;
  border-radius: 999px;
  color: #216444;
  background: #e4f5eb;
  font-size: 8px;
  font-weight: 800;
}

.contact-mode-line b.service {
  color: #34578c;
  background: #e8eefb;
}

.profile-progress {
  display: inline-block;
  width: 64px;
  height: 4px;
  margin-right: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
  vertical-align: middle;
}

.profile-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.last-message {
  min-width: 0;
}

.last-message p,
.last-message small {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-message p {
  color: #56635c;
  font-size: 11px;
}

.last-message small {
  display: block;
  margin-top: 5px;
  color: #9ba59f;
  font-size: 9px;
}

.contact-state {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #707d76;
  background: #f0f3f1;
  font-size: 9px;
  font-weight: 800;
}

.contact-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a7b0ab;
}

.contact-state.online {
  color: #087d48;
  background: #e6f7ed;
}

.contact-state.online i {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 166, 92, 0.1);
}

.contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.contact-actions button {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #526159;
  background: #fff;
  font-size: 10px;
  font-weight: 750;
}

.contact-actions button.primary {
  border-color: #bfe5cf;
  color: #087d48;
  background: #effaf4;
}

.contact-actions button.stop {
  border-color: #f0c9c6;
  color: #b64343;
  background: #fff4f3;
}

.contact-loading,
.contact-empty {
  padding: 56px 20px;
  color: #829087;
  text-align: center;
  font-size: 12px;
}

.contact-empty div {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 15px;
  color: #628a75;
  background: #e9f4ee;
  font-weight: 850;
}

.contact-empty h3 {
  margin: 0;
  color: #34433b;
}

.contact-empty p {
  margin: 7px 0 0;
  font-size: 11px;
}

.queue-panel {
  padding: 0;
  overflow: hidden;
}

.service-grid {
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.35fr);
  align-items: start;
}

.service-editor .btn {
  width: 100%;
}

.service-list-card {
  padding-bottom: 12px;
}

.mini-search {
  display: flex;
  width: min(190px, 42%);
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #84918a;
  background: #fafcfa;
}

.mini-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.knowledge-list {
  display: grid;
  max-height: 520px;
  margin: 0 -24px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.knowledge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
}

.knowledge-row:hover {
  background: #fafcfb;
}

.knowledge-copy {
  min-width: 0;
}

.knowledge-copy > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.knowledge-copy > div span {
  padding: 3px 6px;
  border-radius: 6px;
  color: #087d48;
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 850;
}

.knowledge-copy > div small {
  color: #94a099;
  font-size: 8px;
}

.knowledge-copy strong,
.knowledge-copy p,
.knowledge-copy em {
  display: block;
}

.knowledge-copy strong {
  font-size: 13px;
}

.knowledge-copy p {
  display: -webkit-box;
  margin: 6px 0;
  overflow: hidden;
  color: #66736c;
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.knowledge-copy em {
  overflow: hidden;
  color: #95a099;
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-actions {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.knowledge-actions button {
  padding: 5px 7px;
  border: 1px solid #dce5df;
  border-radius: 7px;
  color: #65736b;
  background: #fff;
  font-size: 8px;
}

.knowledge-actions button:last-child {
  color: #af4a47;
}

.ticket-panel {
  margin-top: 18px;
  overflow: hidden;
  padding: 0;
}

.ticket-panel-heading {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.ticket-panel-heading h3 {
  margin: 0;
}

.ticket-capability-note {
  margin: 0;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  color: #68766e;
  background: #f8fbf9;
  font-size: 10px;
  line-height: 1.55;
}

.ticket-list {
  display: grid;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(390px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid #aebbb4;
}

.ticket-row.priority-high {
  border-left-color: #d19432;
}

.ticket-row.priority-urgent {
  border-left-color: #df554d;
  background: #fffafa;
}

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

.ticket-identity {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ticket-identity strong {
  font-size: 13px;
}

.ticket-identity span,
.ticket-identity b {
  font-size: 8px;
}

.ticket-identity span {
  color: #8c9891;
}

.ticket-identity b {
  padding: 3px 6px;
  border-radius: 999px;
  color: #9b6410;
  background: #fff5df;
}

.priority-urgent .ticket-identity b {
  color: #b43e3a;
  background: #ffebe9;
}

.ticket-main h4 {
  margin: 8px 0 5px;
  font-size: 12px;
}

.ticket-main p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #647169;
  font-size: 9px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ticket-main small {
  display: block;
  margin-top: 6px;
  color: #a06e30;
  font-size: 8px;
}

.ticket-sla {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #4f6f5d;
  background: #edf7f1;
  font-size: 8px;
  font-style: normal;
}

.ticket-sla.overdue {
  color: #a43d39;
  background: #ffebe9;
}

.ticket-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr auto;
  align-items: end;
  gap: 7px;
}

.ticket-controls label span {
  display: block;
  margin-bottom: 4px;
  color: #8c9891;
  font-size: 8px;
}

.ticket-controls select,
.ticket-controls input {
  width: 100%;
  height: 34px;
  padding: 0 7px;
  border: 1px solid #dce5df;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  font-size: 9px;
}

.ticket-controls .ticket-history-button {
  grid-column: 1 / -1;
}

.ticket-detail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  padding-top: 15px;
  border-top: 1px solid #e5ece8;
}

.ticket-detail h5 {
  margin: 0 0 9px;
  font-size: 10px;
}

.ticket-timeline {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
}

.ticket-event {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
}

.ticket-event::before {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.ticket-event strong,
.ticket-event span,
.ticket-event small {
  display: block;
}

.ticket-event strong {
  color: #33423a;
  font-size: 9px;
}

.ticket-event span,
.ticket-event small {
  margin-top: 2px;
  color: #79867f;
  font-size: 8px;
  line-height: 1.45;
}

.ticket-reply {
  display: grid;
  align-content: start;
  gap: 8px;
}

.ticket-reply textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px;
  resize: vertical;
  border: 1px solid #dce5df;
  border-radius: 9px;
  outline: 0;
  font: inherit;
  font-size: 10px;
}

.ticket-reply small {
  color: #9a6517;
  font-size: 8px;
  line-height: 1.5;
}

.first-run-guidance {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #dce9e1;
  border-radius: 11px;
  color: #53675b;
  background: #f5faf7;
}

.first-run-guidance strong {
  font-size: 11px;
}

.first-run-guidance span {
  font-size: 9px;
  line-height: 1.55;
}

.first-run-guidance.complete {
  display: none;
}

.approval-mode-field {
  margin: 14px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cloud-consent-row,
.drawer-cloud-consent {
  border-radius: 10px;
  background: #fff9ee;
}

.drawer-cloud-consent {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #eadfca;
}

.approval-mode-field legend {
  padding: 0;
}

.style-learning-card {
  margin-top: 18px;
}

.style-learning-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.style-learning-stats > div {
  padding: 15px 16px;
  border: 1px solid #dfe9e3;
  border-radius: 13px;
  background: #f8fbf9;
}

.style-learning-stats span,
.style-learning-stats strong {
  display: block;
}

.style-learning-stats span {
  color: var(--muted);
  font-size: 11px;
}

.style-learning-stats strong {
  margin-top: 6px;
  color: var(--green-dark);
  font-size: 21px;
}

.privacy-copy {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.model-privacy-card {
  margin-top: 18px;
  border-color: #d8e7de;
  background: linear-gradient(135deg, #f6fbf8, #fff);
}

.model-privacy-card h3 {
  margin: 6px 0 9px;
}

.model-privacy-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.draft-panel {
  margin-bottom: 18px;
  overflow: hidden;
  padding: 0;
}

.draft-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f5fbf7, #fff);
}

.draft-panel-heading h3,
.draft-panel-heading p {
  margin: 0;
}

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

.draft-panel-heading h3 b {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  margin-left: 6px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
}

.draft-panel-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.draft-list {
  display: grid;
}

.draft-row {
  display: grid;
  gap: 13px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

.draft-row.status-uncertain {
  background: #fffbf2;
}

.draft-row.status-failed {
  background: #fffafa;
}

.draft-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.draft-meta > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.draft-meta strong {
  font-size: 14px;
}

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

.draft-editor {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid #d7e2db;
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fbfdfb;
  line-height: 1.7;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.draft-editor:focus {
  border-color: #78cda0;
  box-shadow: 0 0 0 3px rgba(8, 166, 92, 0.08);
}

.draft-editor[readonly] {
  resize: none;
  color: #66736d;
  background: #f3f6f4;
}

.draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.draft-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.draft-learn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.draft-learn input {
  accent-color: var(--green);
}

.queue-toolbar {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.queue-toolbar > span {
  color: #8a9690;
  font-size: 10px;
}

.queue-list-head,
.queue-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(260px, 1.7fr) 125px minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
}

.queue-list-head {
  min-height: 41px;
  padding: 0 20px;
  color: #8c9892;
  background: #f8faf8;
  font-size: 10px;
  font-weight: 750;
}

.queue-row {
  min-height: 88px;
  padding: 14px 20px;
  border-top: 1px solid #edf1ee;
}

.queue-row.status-uncertain {
  background: linear-gradient(90deg, #fff8e9, transparent 60%);
}

.queue-row.status-failed {
  background: linear-gradient(90deg, #fff3f1, transparent 60%);
}

.queue-target strong,
.queue-time span,
.queue-time small {
  display: block;
}

.queue-target strong {
  margin-bottom: 7px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-state {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  color: #68746e;
  background: #eef2ef;
  font-size: 9px;
  font-weight: 800;
}

.queue-state.sent {
  color: #087d48;
  background: #e6f7ed;
}

.queue-state.uncertain {
  color: #98600c;
  background: #fff0c9;
}

.queue-state.failed {
  color: #b64343;
  background: #ffe5e2;
}

.queue-state.pending,
.queue-state.leased {
  color: #356a8a;
  background: #e7f2f8;
}

.queue-message {
  min-width: 0;
}

.queue-message p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #44524b;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.queue-error {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #af5a50;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-time {
  color: #77847d;
  font-size: 10px;
}

.queue-time small {
  margin-top: 5px;
  color: #a0aaa4;
  font-size: 9px;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.queue-action {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #526159;
  background: #fff;
  font-size: 9px;
  font-weight: 750;
}

.queue-action.primary,
.queue-action.success {
  border-color: #bfe5cf;
  color: #087d48;
  background: #effaf4;
}

.queue-action.warning {
  border-color: #eed4a5;
  color: #925f12;
  background: #fff8e9;
}

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

.queue-no-action {
  color: #9aa49f;
  font-size: 9px;
}

.queue-notice {
  border-color: #efdaa9;
  background: #fffaf0;
}

.queue-notice > span {
  color: #946211;
  background: #f8e7ba;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  background: rgba(8, 22, 16, 0.36);
  opacity: 0;
  transition: 180ms ease;
}

.drawer-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.contact-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: min(540px, 100vw);
  height: 100%;
  flex-direction: column;
  background: #f8faf8;
  box-shadow: -20px 0 50px rgba(15, 35, 26, 0.16);
  transform: translateX(24px);
  transition: 220ms ease;
}

.drawer-backdrop.open .contact-drawer {
  transform: none;
}

.drawer-backdrop.loading .drawer-body,
.drawer-backdrop.loading .drawer-footer {
  opacity: 0.62;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawer-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.drawer-person h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.drawer-person p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.drawer-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #65736c;
  background: #fff;
  font-size: 21px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 32px;
}

.drawer-status {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 9px;
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.drawer-status .status-dot {
  grid-row: span 2;
}

.drawer-status strong {
  font-size: 12px;
}

.drawer-status small {
  color: #8c9892;
  font-size: 10px;
}

.drawer-status.online {
  border-color: #c5e8d4;
  background: #effaf4;
}

.drawer-status.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(8, 166, 92, 0.11);
}

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

.contact-mode-grid {
  margin-top: 2px;
}

.contact-mode-guidance {
  display: grid;
  gap: 5px;
  margin: -2px 0 17px;
  padding: 11px 13px;
  border: 1px solid #d6eadf;
  border-radius: 10px;
  color: #557166;
  background: #f2faf5;
  font-size: 9px;
  line-height: 1.55;
}

.contact-mode-guidance span::before {
  content: "✓";
  margin-right: 6px;
  color: var(--green);
  font-weight: 850;
}

.contact-mode-guidance.auto {
  border-color: #f0d6a7;
  color: #715e3d;
  background: #fff9ed;
}

.contact-mode-guidance.auto span:last-child::before {
  content: "!";
  color: #ca8313;
}

.profile-meter {
  margin-top: 20px;
  padding: 15px;
  border-radius: 12px;
  background: #fff;
}

.profile-meter > div {
  display: flex;
  justify-content: space-between;
  color: #516058;
  font-size: 11px;
}

.profile-meter i {
  display: block;
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece9;
}

.profile-meter b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #08a65c, #48dc8a);
  transition: width 200ms ease;
}

.ai-profile-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cfe2d6;
  border-radius: 12px;
  color: #335142;
  background: #edf7f1;
  text-align: left;
}

.ai-profile-button > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  color: #087d48;
  background: #d8efe2;
}

.ai-profile-button strong,
.ai-profile-button small {
  display: block;
}

.ai-profile-button strong {
  font-size: 11px;
}

.ai-profile-button small {
  margin-top: 4px;
  color: #789086;
  font-size: 9px;
  line-height: 1.45;
}

.memory-section {
  margin-top: 22px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.memory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-heading h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.memory-heading button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cfe2d6;
  border-radius: 8px;
  color: #087d48;
  background: #edf7f1;
  font-size: 9px;
  font-weight: 800;
}

.memory-summary {
  margin: 12px 0;
  color: #68766e;
  font-size: 10px;
  line-height: 1.55;
}

.memory-list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
}

.memory-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #e2e9e4;
  border-radius: 9px;
  background: #fff;
}

.memory-item p {
  margin: 0;
  color: #405047;
  font-size: 10px;
  line-height: 1.5;
}

.memory-item span {
  display: block;
  margin-top: 4px;
  color: #97a29c;
  font-size: 8px;
}

.memory-item button {
  align-self: start;
  padding: 3px 5px;
  border: 0;
  color: #a05a58;
  background: transparent;
  font-size: 9px;
}

.memory-empty {
  padding: 15px;
  border: 1px dashed #d7e1db;
  border-radius: 9px;
  color: #93a098;
  text-align: center;
  font-size: 9px;
}

.memory-add {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.memory-add input {
  height: 36px;
  font-size: 10px;
}

.memory-add button {
  flex: 0 0 54px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green-dark);
  font-size: 9px;
  font-weight: 800;
}

.memory-privacy {
  display: block;
  margin-top: 8px;
  color: #9ca69f;
  font-size: 8px;
  line-height: 1.45;
}

.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.log-card {
  overflow: hidden;
  border: 1px solid #253b31;
  border-radius: 17px;
  background: #10231b;
  box-shadow: 0 18px 40px rgba(15, 38, 28, 0.18);
}

.retention-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 130px auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.retention-card h3 {
  margin: 5px 0 6px;
}

.retention-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.retention-card code {
  padding: 2px 4px;
  border-radius: 4px;
  background: #f1f5f2;
}

.retention-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.account-admin-grid {
  align-items: start;
}

.account-submit {
  width: 100%;
  margin-top: 18px;
}

.account-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.account-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.account-row strong,
.account-row span {
  display: block;
}

.account-row strong {
  color: var(--ink);
  font-size: 14px;
}

.account-row span:not(.badge) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.account-delete {
  min-width: 64px;
}

.audit-card {
  margin-top: 20px;
}

.audit-card .card-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.audit-list {
  max-height: 520px;
  overflow: auto;
}

.audit-row {
  display: grid;
  grid-template-columns: 150px 110px minmax(120px, 1fr) minmax(150px, 1.4fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
  font-size: 11px;
}

.audit-row time,
.audit-row code {
  color: var(--muted);
}

.audit-row em {
  color: var(--green-dark);
  font-style: normal;
  font-weight: 800;
}

.audit-row.failed em {
  color: #b3261e;
}

.account-empty {
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .audit-row {
    grid-template-columns: 1fr auto;
  }

  .audit-row code {
    grid-column: 1 / -1;
  }
}

.retention-card #retentionResult {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.log-toolbar {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #8fac9e;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef6a62;
}

.terminal-dots i:nth-child(2) {
  background: #e7b34d;
}

.terminal-dots i:nth-child(3) {
  background: #43c878;
}

.log-toolbar button {
  margin-left: auto;
  border: 0;
  color: #8fac9e;
  background: transparent;
  font-size: 11px;
}

#logOutput {
  min-height: 430px;
  max-height: 62vh;
  overflow: auto;
  margin: 0;
  padding: 22px;
  color: #b8d4c6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 12px;
  color: #fff;
  background: #193c2d;
  box-shadow: 0 14px 40px rgba(17, 42, 31, 0.25);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  background: #a53b3b;
}

.auth-gate {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(83, 171, 112, 0.2), transparent 34%),
    rgba(241, 247, 243, 0.97);
}

.auth-gate.hidden {
  display: none;
}

.auth-card {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid #dce8e0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(32, 66, 45, 0.16);
}

.auth-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--green);
  font-size: 19px;
  font-weight: 800;
}

.auth-card h2 {
  margin: 7px 0 9px;
}

.auth-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-card .btn {
  width: 100%;
  margin-top: 4px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f3f6f4;
}

.auth-mode-switch button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #718078;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.auth-mode-switch button.active {
  color: #087a46;
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 46, 35, 0.08);
}

.auth-card .field {
  margin-top: 13px;
}

.auth-card > small {
  display: block;
  margin-top: 14px;
  color: #7b8981;
  font-size: 10px;
  line-height: 1.55;
}

.auth-card code {
  padding: 2px 4px;
  border-radius: 4px;
  background: #f1f5f2;
}

.auth-error {
  min-height: 17px;
  margin: -3px 0 4px !important;
  color: #b1433f !important;
  font-size: 10px !important;
}

@media (max-width: 1080px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
  }

  .brand {
    padding: 0;
  }

  .brand span,
  .local-note {
    display: none;
  }

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

  .nav-item {
    width: auto;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .nav-item.active {
    box-shadow: inset 0 -2px #36dc83;
  }

  .nav-icon {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .save-dock {
    right: 20px;
    width: min(520px, calc(100vw - 40px));
  }

  .topbar {
    height: 82px;
    padding: 0 24px;
  }

  .content {
    width: min(100% - 36px, 760px);
    padding-top: 24px;
  }

  .two-col,
  .three-col,
  .service-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .retention-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .retention-actions {
    justify-content: flex-start;
  }

  .duty-mode-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .contact-list-head {
    display: none;
  }

  .queue-list-head {
    display: none;
  }

  .queue-row {
    grid-template-columns: minmax(150px, 0.75fr) minmax(240px, 1.4fr) minmax(190px, 1fr);
  }

  .queue-time {
    display: none;
  }

  .contact-row {
    grid-template-columns: minmax(180px, 1fr) 120px 140px;
  }

  .queue-panel {
    padding: 0;
  }

  .queue-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-row {
    display: block;
    padding: 16px;
  }

  .queue-message {
    margin: 12px 0;
  }

  .queue-error {
    white-space: normal;
  }

  .queue-actions {
    justify-content: flex-start;
  }

  .draft-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .draft-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .draft-buttons {
    margin-left: 0;
  }

  .profile-summary,
  .last-message {
    display: none;
  }

  .ticket-row {
    grid-template-columns: 1fr;
  }

  .ticket-detail {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 250px;
    padding: 30px;
  }

  .pulse-orbit {
    width: 118px;
    height: 118px;
    flex-basis: 118px;
  }
}

@media (max-width: 620px) {
  .sidebar {
    position: sticky;
    z-index: 100;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    white-space: nowrap;
  }

  .nav {
    display: none;
  }

  .mobile-section-nav {
    display: block;
    min-width: 0;
    margin-left: auto;
  }

  .mobile-section-nav > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .mobile-section-nav select {
    width: 128px;
    min-height: 44px;
    padding: 0 34px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #eef8f2;
    background: #18382a;
    font-size: 13px;
    font-weight: 720;
  }

  .topbar {
    position: sticky;
    top: 64px;
    z-index: 80;
    height: 64px;
    padding: 0 18px;
  }

  .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .console-user {
    display: none !important;
  }

  .logout-button {
    padding: 0 9px;
  }

  .content {
    width: calc(100% - 20px);
    padding: 10px 0 calc(110px + env(safe-area-inset-bottom));
  }

  .hero-card {
    min-height: auto;
    padding: 25px 22px;
  }

  .pulse-orbit {
    display: none;
  }

  .hero-copy h2 {
    font-size: 28px;
  }

  .hero-actions .btn,
  .section-intro .btn {
    flex: 1;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 46px;
  }

  .save-dock {
    inset: auto 10px max(10px, env(safe-area-inset-bottom));
    width: auto;
    min-width: 0;
    gap: 10px;
    padding: 10px;
    border-radius: 15px;
  }

  .save-dock-copy {
    gap: 9px;
  }

  .save-dock-copy small {
    display: none;
  }

  .save-dock .btn {
    min-height: 46px;
    padding: 0 14px;
    white-space: nowrap;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .section-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dashboard-summary article {
    padding: 15px;
  }

  .dashboard-health {
    grid-template-columns: 1fr 1fr;
  }

  .duty-mode-header,
  .duty-mode-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .duty-mode-header {
    gap: 12px;
  }

  .duty-mode-status-grid,
  .duty-mode-cautions {
    grid-template-columns: 1fr;
  }

  .duty-mode-footer > div {
    width: 100%;
    justify-content: space-between;
  }

  .card {
    padding: 20px;
    border-radius: 15px;
  }

  .queue-panel {
    padding: 0;
  }

  .draft-panel {
    padding: 0;
  }

  .draft-panel-heading,
  .draft-row {
    padding: 17px;
  }

  .draft-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .style-learning-stats {
    grid-template-columns: 1fr;
  }

  .model-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .model-card .badge {
    margin-left: 70px;
  }

  .contact-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-filters {
    overflow-x: auto;
  }

  .ticket-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-row {
    padding: 16px;
  }

  .ticket-controls {
    grid-template-columns: 1fr 1fr;
  }

  .auth-card {
    padding: 24px;
  }

  .knowledge-list {
    margin: 0 -20px;
  }

  .contact-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .contact-stats article {
    padding: 15px;
  }

  .contact-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px;
  }

  .contact-state {
    display: none;
  }

  .contact-actions button:first-child {
    display: inline-flex;
  }

  .contact-actions {
    flex-wrap: wrap;
  }

  .contact-actions button {
    min-height: 42px;
    flex: 1 1 92px;
  }

  .setup-guide-heading,
  .setup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-guide-heading > strong {
    align-self: flex-start;
  }

  .setup-checklist {
    grid-template-columns: 1fr;
  }

  .setup-actions .btn {
    width: 100%;
  }

  .drawer-grid {
    grid-template-columns: 1fr;
  }

  .drawer-footer {
    flex-wrap: wrap;
  }

  .drawer-footer .btn {
    flex: 1 1 42%;
  }

  .contact-drawer {
    width: 100vw;
  }

  .drawer-header {
    padding: max(18px, env(safe-area-inset-top)) 18px 16px;
  }

  .drawer-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

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