:root {
  color-scheme: light;
  --ink: #17221a;
  --muted: #6c776f;
  --line: #dfe5df;
  --surface: #ffffff;
  --canvas: #f4f6f3;
  --forest: #315a43;
  --forest-deep: #203d2e;
  --forest-soft: #e9f0eb;
  --mint: #8fc5a5;
  --blue-soft: #e9eff7;
  --blue: #4f6f9b;
  --shadow: 0 24px 70px rgba(24, 48, 34, 0.12);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button,
input,
textarea { font: inherit; }

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

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(91, 142, 111, 0.28);
  outline-offset: 2px;
}

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

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-dark { color: var(--ink); }

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 11px;
  color: #fff;
  background: var(--forest);
  font-family: Georgia, serif;
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #789082;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Login */

.login-page { background: var(--forest-deep); }

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
}

.login-intro {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px clamp(44px, 7vw, 108px);
  color: #fff;
  background:
    radial-gradient(circle at 12% 82%, rgba(139, 195, 161, 0.2), transparent 30%),
    linear-gradient(145deg, #203d2e 0%, #274b37 58%, #315a43 100%);
}

.login-intro::after {
  position: absolute;
  right: -120px;
  bottom: -170px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgba(255, 255, 255, 0.025),
    0 0 0 110px rgba(255, 255, 255, 0.018);
  content: "";
}

.intro-copy { position: relative; z-index: 1; max-width: 520px; }

.intro-copy .eyebrow { color: #a9cbb5; }

.intro-copy h1 {
  margin: 0;
  font-family: Georgia, "Microsoft YaHei UI", serif;
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.13;
}

.intro-description {
  max-width: 440px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  line-height: 1.9;
}

.intro-note {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px 32px;
  background: #f7f8f6;
}

.login-card { width: min(100%, 410px); }

.mobile-brand { display: none; }

.login-card h2 {
  margin: 0;
  font-size: 29px;
  font-weight: 670;
  letter-spacing: -0.025em;
}

.form-intro {
  margin: 11px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 31px;
  padding: 4px;
  border-radius: 10px;
  background: #e9ede9;
}

.auth-tab {
  min-width: 72px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  color: #707b73;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.auth-tab.is-active {
  color: var(--forest);
  background: #fff;
  box-shadow: 0 1px 5px rgba(33, 58, 42, 0.08);
}

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

.confirm-password-field { display: grid; gap: 9px; margin-top: 10px; }

.login-form label,
.password-label span {
  color: #465149;
  font-size: 12px;
  font-weight: 650;
}

.password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.password-label span { color: #9aa29c; font-weight: 400; }

.login-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d4dbd5;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-form input:focus {
  border-color: #6f9c80;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(86, 137, 105, 0.1);
}

.primary-button {
  height: 46px;
  margin-top: 17px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--forest);
  cursor: pointer;
  font-weight: 670;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-button:hover { background: #284b38; }
.primary-button:active { transform: translateY(1px); }

.primary-button:disabled,
.logout-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.form-message {
  margin: 4px 0 0;
  padding: 11px 13px;
  border-radius: 8px;
  color: #45604f;
  background: var(--forest-soft);
  font-size: 12px;
  line-height: 1.55;
}

.form-message.is-error {
  color: #8f3e39;
  background: #faecea;
}

.preview-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: #919a94;
  font-size: 11px;
}

.preview-entry span:last-child { color: #69756d; font-weight: 620; }

/* User portal */

.portal-page { padding-top: 68px; }

.app-header {
  position: fixed;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.account-preview { display: flex; gap: 9px; align-items: center; }

.preview-badge {
  margin-right: 8px;
  padding: 5px 8px;
  border-radius: 99px;
  color: #68736b;
  background: #eef1ee;
  font-size: 10px;
}

.account-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 11px;
  font-weight: 700;
}

.account-name { font-size: 12px; font-weight: 620; }

.logout-button {
  margin-left: 5px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  color: #738078;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.logout-button:hover { color: var(--ink); background: #f0f3f0; }

.header-link {
  padding: 7px 10px;
  border-radius: 7px;
  color: #536159;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}
.header-link:hover { color: var(--forest); background: var(--forest-soft); }
.admin-badge {
  padding: 5px 8px;
  border-radius: 99px;
  color: #496952;
  background: var(--forest-soft);
  font-size: 9px;
  font-weight: 700;
}

.portal-shell {
  display: grid;
  width: min(100% - 40px, 1180px);
  min-height: calc(100vh - 108px);
  grid-template-columns: 310px minmax(0, 1fr);
  margin: 20px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 14px 45px rgba(31, 51, 38, 0.06);
}

.binding-sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: #fafbfa;
}

.sidebar-heading,
.detail-heading,
.section-heading,
.service-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-heading { padding: 0 6px 22px; }

.sidebar-heading h1,
.detail-heading h2,
.section-heading h3,
.connection-card h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.sidebar-heading h1 { font-size: 20px; }

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: var(--forest);
  cursor: pointer;
  font-size: 19px;
}

.icon-button:disabled { cursor: not-allowed; }

.binding-item {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.binding-item.is-selected {
  border-color: #d5e1d8;
  background: var(--forest-soft);
}

.wechat-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #54ad67;
  font-size: 13px;
  font-weight: 700;
}

.binding-copy { display: grid; gap: 5px; min-width: 0; }
.binding-copy strong { font-size: 13px; }
.binding-copy span { color: var(--muted); font-size: 10px; }

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #55a96a;
  box-shadow: 0 0 0 3px rgba(85, 169, 106, 0.1);
}

.sidebar-empty-note {
  display: grid;
  place-items: center;
  margin-top: 28px;
  padding: 22px 12px;
  border: 1px dashed #d8ded9;
  border-radius: 10px;
  color: #98a199;
  text-align: center;
}

.sidebar-empty-note span { font-size: 22px; font-weight: 300; }
.sidebar-empty-note p { max-width: 170px; margin: 8px 0 0; font-size: 10px; line-height: 1.6; }

.binding-detail { padding: 38px 42px 44px; }

.detail-heading { gap: 30px; padding-bottom: 29px; border-bottom: 1px solid var(--line); }
.detail-heading h2 { font-size: 25px; }
.detail-heading p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 12px; }

.portal-primary {
  width: fit-content;
  min-width: 150px;
  margin-top: 20px;
  padding: 0 18px;
}

.channel-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.secondary-action {
  margin-top: 20px;
  padding: 9px 13px;
  border: 1px solid #d9deda;
  border-radius: 8px;
  color: #697269;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.secondary-action:hover { border-color: #bac5bc; color: var(--ink); }

.connection-status {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 99px;
  color: #41704e;
  background: #edf6ef;
  font-size: 10px;
  font-weight: 650;
}

.connection-status.is-idle {
  color: #778179;
  background: #f0f2f0;
}

.service-section { padding-top: 31px; }
.section-heading { align-items: flex-end; }
.section-heading h3,
.connection-card h3 { font-size: 17px; }
.section-heading > p { margin: 0; color: #99a19b; font-size: 10px; }

.service-grid { display: grid; gap: 14px; margin-top: 17px; }

.service-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.service-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  font-family: Georgia, serif;
  font-weight: 700;
}

.agent-icon { color: var(--forest); background: var(--forest-soft); }
.hub-icon { color: var(--blue); background: var(--blue-soft); }

.service-title-row { align-items: center; }
.service-title-row h4 { margin: 1px 0 0; font-size: 14px; }
.service-copy > p { margin: 7px 0 11px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.service-state { color: #4c7757; font-size: 9px; font-weight: 650; }
.service-state.is-muted { color: #99a19b; }

.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #d8ddda;
  opacity: 0.8;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  content: "";
}

.switch input:checked + span { background: #6ca27c; }
.switch input:checked + span::after { transform: translateX(16px); }

.service-settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid #d9e3dc;
  border-radius: 9px;
  color: var(--forest);
  background: #f8fbf9;
  font-size: 10px;
  font-weight: 680;
  text-decoration: none;
}
.service-settings-link:hover { border-color: #bdd0c2; background: var(--forest-soft); }
.service-settings-link small { color: #839087; font-size: 9px; font-weight: 500; }

.connection-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  margin-top: 28px;
  padding: 22px;
  border-radius: 12px;
  background: #f7f9f7;
}

.connection-card dl { display: grid; gap: 11px; margin: 0; }
.connection-card dl div { display: flex; justify-content: space-between; gap: 20px; }
.connection-card dt,
.connection-card dd { margin: 0; font-size: 10px; }
.connection-card dt { color: #8b958e; }
.connection-card dd { color: #455048; font-weight: 620; }
.connection-card .healthy-text { color: #4b7c58; }

.qr-dialog {
  width: min(calc(100% - 32px), 470px);
  padding: 0;
  border: 1px solid #d9e0da;
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.qr-dialog::backdrop {
  background: rgba(20, 31, 24, 0.52);
  backdrop-filter: blur(3px);
}

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

.qr-dialog-heading h2 { margin: 0; font-size: 21px; }

.dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #7d8780;
  background: #f1f3f1;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.dialog-close:hover { color: var(--ink); background: #e8ece8; }

.qr-content { padding: 24px 26px 26px; text-align: center; }

.qr-frame {
  display: grid;
  width: 226px;
  height: 226px;
  place-items: center;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid #dce2dd;
  border-radius: 13px;
  background: #fff;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-loading {
  color: #849087;
  font-size: 12px;
  line-height: 1.6;
}

.qr-status {
  margin: 17px 0 0;
  color: #455249;
  font-size: 12px;
  font-weight: 620;
}

.qr-stage-note {
  margin: 12px auto 0;
  color: #929a94;
  font-size: 10px;
  line-height: 1.65;
}

[hidden] { display: none !important; }

.bindings-list { display: grid; gap: 6px; }

.verify-code-form {
  display: grid;
  gap: 8px;
  width: min(100%, 320px);
  margin: 14px auto 0;
  text-align: left;
}

.verify-code-form label { color: var(--muted); font-size: 11px; }
.verify-code-form div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.verify-code-form input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.verify-code-form button { width: auto; padding: 10px 15px; }

@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .login-panel { min-height: 100vh; }
  .mobile-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 48px; font-weight: 680; }
  .portal-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .binding-detail { padding: 32px 26px; }
}

@media (max-width: 650px) {
  .app-header { padding: 0 18px; }
  .account-name,
  .preview-badge { display: none; }
  .portal-shell { width: min(100% - 24px, 1180px); grid-template-columns: 1fr; }
  .binding-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-empty-note { display: none; }
  .binding-detail { padding: 28px 20px 34px; }
  .detail-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .service-card { grid-template-columns: 40px minmax(0, 1fr); padding: 17px; }
  .service-icon { width: 40px; height: 40px; }
  .connection-card { grid-template-columns: 1fr; gap: 18px; }
}

/* Administrator console */

.admin-page { padding-top: 68px; overflow: hidden; }

.admin-shell {
  display: grid;
  height: calc(100vh - 68px);
  grid-template-columns: 290px minmax(0, 1fr);
  background: #fff;
}

.admin-sidebar {
  min-width: 0;
  padding: 27px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f8faf8;
}

.admin-sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 7px 20px;
}
.admin-sidebar-heading h1 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }
.count-badge {
  min-width: 27px;
  padding: 5px 8px;
  border-radius: 99px;
  color: #58705f;
  background: var(--forest-soft);
  font-size: 10px;
  text-align: center;
}
.admin-user-list { display: grid; gap: 18px; }
.admin-user-group { display: grid; gap: 5px; }
.admin-user-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 5px;
}
.admin-user-heading strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.admin-user-heading span { color: #939d96; font-size: 9px; }
.admin-no-binding,
.admin-placeholder { margin: 6px 8px; color: #98a199; font-size: 10px; }
.admin-binding-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #354039;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.admin-binding-button:hover { background: #f0f4f1; }
.admin-binding-button.is-selected { border-color: #d5e1d8; background: var(--forest-soft); }
.admin-binding-button span { font-size: 12px; font-weight: 650; }
.admin-binding-button small { color: #859087; font-size: 9px; }

.admin-chat {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.admin-chat-header {
  display: flex;
  min-height: 96px;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 31px;
  border-bottom: 1px solid var(--line);
}
.admin-chat-header h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.admin-chat-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.takeover-button {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #5e6961;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}
.takeover-button:disabled { cursor: not-allowed; opacity: 0.55; }
.takeover-track { position: relative; width: 34px; height: 19px; border-radius: 99px; background: #d8ddda; }
.takeover-track span { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.17); transition: transform 150ms ease; }
.takeover-button.is-manual { color: #92524c; border-color: #edd5d2; background: #fff8f7; }
.takeover-button.is-manual .takeover-track { background: #bf7067; }
.takeover-button.is-manual .takeover-track span { transform: translateX(15px); }

.admin-chat-body { position: relative; min-height: 0; overflow: hidden; background: #f6f8f6; }
.admin-empty-state { display: grid; height: 100%; place-items: center; align-content: center; color: #8b958e; text-align: center; }
.admin-empty-state strong { margin-top: 17px; color: #56615a; font-size: 13px; }
.admin-empty-state p { max-width: 330px; margin: 8px 0 0; font-size: 10px; line-height: 1.7; }
.admin-empty-mark { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid #d8e1da; border-radius: 18px; color: var(--forest); background: var(--forest-soft); font-family: Georgia, serif; font-size: 25px; }
.admin-timeline { display: flex; height: 100%; flex-direction: column; gap: 15px; padding: 28px 34px; overflow-y: auto; }
.timeline-empty { margin: auto; color: #909a92; font-size: 11px; }
.admin-message { display: grid; max-width: min(72%, 620px); gap: 5px; }
.admin-message.is-outbound { align-self: flex-end; justify-items: end; }
.admin-message.is-inbound { align-self: flex-start; }
.admin-message-meta { color: #8d9790; font-size: 9px; }
.admin-message-bubble { padding: 11px 14px; border: 1px solid #dce3dd; border-radius: 12px 12px 12px 3px; color: #334039; background: #fff; box-shadow: 0 3px 12px rgba(35, 55, 41, 0.04); }
.admin-message.is-outbound .admin-message-bubble { border-color: #d0dfd5; border-radius: 12px 12px 3px 12px; background: #e8f1eb; }
.admin-message-bubble strong { display: block; margin-bottom: 5px; font-size: 11px; }
.admin-message-bubble p { margin: 0; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-message-state { color: #909a92; font-size: 8px; }
.admin-action-message { position: absolute; right: 24px; bottom: 18px; margin: 0; padding: 9px 12px; border-radius: 8px; color: #45604f; background: #e7f0e9; font-size: 10px; box-shadow: var(--shadow); }
.admin-action-message.is-error { color: #8f3e39; background: #faecea; }

.operator-form { padding: 15px 23px 20px; border-top: 1px solid var(--line); background: #fff; }
.operator-card { padding: 12px 14px 11px; border: 1px solid #d9e0da; border-radius: 11px; background: #fff; transition: opacity 150ms ease; }
.operator-card.is-disabled { opacity: 0.62; background: #f7f8f7; }
.operator-status-row,
.operator-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #8a948d; font-size: 9px; }
.operator-status-row span:first-child { color: #58645c; font-weight: 650; }
.operator-card textarea { width: 100%; min-height: 70px; margin: 8px 0; padding: 7px 2px; resize: vertical; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; line-height: 1.6; }
.operator-actions button { padding: 8px 16px; border: 0; border-radius: 8px; color: #fff; background: var(--forest); cursor: pointer; font-size: 10px; font-weight: 700; }
.operator-actions button:disabled { cursor: not-allowed; opacity: 0.45; }

@media (max-width: 720px) {
  .admin-page { overflow: auto; }
  .admin-shell { height: auto; min-height: calc(100vh - 68px); grid-template-columns: 1fr; grid-template-rows: auto minmax(620px, 1fr); }
  .admin-sidebar { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-chat-header { padding: 18px; }
  .admin-message { max-width: 88%; }
  .admin-timeline { padding: 22px 18px; }
  .operator-form { padding: 12px; }
}

/* Message Hub settings */

.hub-settings-page { padding-top: 68px; }
.hub-settings-shell {
  display: grid;
  width: min(calc(100% - 32px), 1480px);
  min-height: calc(100vh - 108px);
  grid-template-columns: 260px minmax(0, 1fr);
  margin: 20px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 45px rgba(31, 51, 38, 0.06);
}
.hub-settings-sidebar { padding: 30px 20px; border-right: 1px solid var(--line); background: #fafbfa; }
.hub-settings-identity { padding: 0 7px 24px; }
.hub-settings-identity h1 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }
.hub-settings-identity > p:last-child { margin: 8px 0 0; overflow: hidden; color: #89938c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hub-settings-nav { display: grid; gap: 6px; }
.hub-settings-tab {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #59645d;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.hub-settings-tab.is-active { border-color: #d5e1d8; color: var(--forest); background: var(--forest-soft); }
.hub-settings-tab span { font-size: 13px; font-weight: 680; }
.hub-settings-tab small { color: #8b958e; font-size: 11px; }
.hub-settings-note { margin: 28px 7px 0; padding: 14px; border-radius: 10px; color: #55705d; background: #eef4ef; }
.hub-settings-note strong { font-size: 12px; }
.hub-settings-note p { margin: 6px 0 0; font-size: 11px; line-height: 1.65; }
.hub-settings-content { min-width: 0; padding: 42px 48px 54px; }
.hub-settings-heading { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.hub-settings-heading h2 { margin: 0; font-size: 25px; letter-spacing: -0.03em; }
.hub-settings-heading p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.create-api-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 25px;
  padding: 18px;
  border: 1px solid #dfe6e0;
  border-radius: 11px;
  background: #f8faf8;
}
.create-api-form > div { display: grid; gap: 7px; }
.create-api-form label { color: #59655d; font-size: 10px; font-weight: 680; }
.create-api-form input { height: 41px; padding: 0 12px; border: 1px solid #d5ded7; border-radius: 8px; background: #fff; }
.create-api-form input:focus { border-color: #7ba088; outline: 3px solid rgba(91,142,111,.1); }
.create-api-form button { height: 41px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: var(--forest); cursor: pointer; font-size: 10px; font-weight: 700; }
.create-api-form button:disabled { cursor: wait; opacity: .6; }
.settings-action-message { margin: 13px 0 0; padding: 10px 12px; border-radius: 8px; color: #45604f; background: #e8f1ea; font-size: 10px; }
.settings-action-message.is-error { color: #8f3e39; background: #faecea; }
.settings-api-list { display: grid; gap: 13px; margin-top: 20px; }
.settings-list-placeholder { color: #8c9690; font-size: 10px; }
.settings-api-empty { padding: 42px 20px; border: 1px dashed #d7dfd9; border-radius: 11px; color: #839087; text-align: center; }
.settings-api-empty strong { color: #566159; font-size: 12px; }
.settings-api-empty p { margin: 7px 0 0; font-size: 10px; }
.settings-api-card { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.settings-api-heading,
.settings-api-footer,
.settings-api-credential { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-api-heading h3 { margin: 0; font-size: 13px; }
.settings-api-heading p { margin: 5px 0 0; color: #929b95; font-size: 9px; }
.settings-api-heading > span { padding: 5px 8px; border-radius: 99px; color: #637069; background: #eef1ef; font-size: 8px; }
.settings-api-credential { margin-top: 15px; padding: 10px 11px; border-radius: 8px; background: #f2f6f3; }
.settings-api-credential code { min-width: 0; overflow: hidden; color: #315a43; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.settings-api-credential button,
.settings-api-footer button,
.device-guide-heading button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #d7dfd9; border-radius: 7px; color: #59665e; background: #fff; cursor: pointer; font-size: 9px; font-weight: 650; }
.settings-api-credential button:disabled { cursor: not-allowed; opacity: .55; }
.settings-api-footer { margin-top: 12px; }
.settings-api-footer p { margin: 0; color: #8a948d; font-size: 9px; line-height: 1.55; }
.settings-api-footer button { color: #9a4944; }

.guide-overview-card { display: grid; grid-template-columns: 2fr .6fr 1fr; gap: 1px; margin-top: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.guide-overview-card > div { display: grid; gap: 7px; min-width: 0; padding: 15px; background: #f8faf8; }
.guide-overview-card span { color: #87918a; font-size: 11px; }
.guide-overview-card code { overflow: hidden; color: #3c5243; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.device-guide-list { display: grid; gap: 15px; margin-top: 21px; }
.device-guide-card { padding: 22px; border: 1px solid var(--line); border-radius: 11px; }
.device-guide-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.device-guide-heading > div { display: flex; gap: 10px; align-items: center; }
.device-guide-heading h3 { margin: 0; font-size: 15px; }
.device-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 8px; color: var(--forest); background: var(--forest-soft); font-family: ui-monospace, monospace; font-size: 9px; font-weight: 800; }
.device-guide-card > p { margin: 11px 0 14px; color: #7f8a82; font-size: 12px; }
.device-guide-card pre { margin: 0; padding: 17px; overflow-wrap: anywhere; border-radius: 8px; color: #dcebe0; background: #20352a; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.guide-tips { margin-top: 18px; padding: 17px 18px; border-left: 3px solid #7baa8a; border-radius: 0 9px 9px 0; color: #506057; background: #f0f5f1; }
.guide-tips strong { font-size: 13px; }
.guide-tips p { margin: 7px 0 0; font-size: 11px; line-height: 1.7; }

.agent-guide-card { margin-top: 21px; padding: 24px; border: 1px solid #cfe0d3; border-radius: 12px; background: #f5f9f6; }
.agent-guide-heading,
.agent-guide-heading > div,
.agent-guide-actions { display: flex; align-items: center; gap: 12px; }
.agent-guide-heading { justify-content: space-between; }
.agent-guide-heading h3 { margin: 2px 0 0; font-size: 17px; }
.agent-guide-heading .eyebrow { margin: 0; }
.guide-download,
.agent-guide-actions button { padding: 9px 12px; border: 1px solid #bfd2c4; border-radius: 8px; color: var(--forest); background: #fff; cursor: pointer; font-size: 11px; font-weight: 680; text-decoration: none; }
.agent-guide-card ol { display: grid; gap: 8px; margin: 18px 0; padding-left: 22px; color: #56655c; font-size: 12px; }
.agent-guide-card pre { margin: 0; padding: 17px; overflow-wrap: anywhere; border-radius: 8px; color: #dcebe0; background: #20352a; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.agent-guide-actions { margin-top: 12px; }
.agent-guide-card > p { margin: 13px 0 0; color: #718078; font-size: 11px; line-height: 1.65; }

@media (max-width: 720px) {
  .hub-settings-shell { width: min(100% - 20px, 1480px); grid-template-columns: 1fr; }
  .hub-settings-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .hub-settings-nav { grid-template-columns: 1fr 1fr; }
  .hub-settings-note { display: none; }
  .hub-settings-content { padding: 28px 20px 35px; }
  .create-api-form { grid-template-columns: 1fr; }
  .guide-overview-card { grid-template-columns: 1fr; }
  .settings-api-heading,
  .settings-api-footer { align-items: flex-start; flex-direction: column; }
  .agent-guide-heading { align-items: flex-start; flex-direction: column; }
}
