:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08131f;
  color: #e7f1f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --panel: #101e2b;
  --line: #243746;
  --muted: #9aafbf;
  --cyan: #43e0df;
  --red: #ff8484;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 50% -30%, #163447 0, #08131f 55%);
}

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

.shell {
  display: flex;
  flex-direction: column;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 18px env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand span { display: grid; gap: 1px; letter-spacing: .13em; }
.brand strong { color: var(--cyan); font-size: .92rem; }
.brand small { color: #9ac7cf; font-size: .66rem; }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .83rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #6e7e89; }
.dot.online { background: #59dda1; box-shadow: 0 0 12px #59dda177; }
.icon-button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; }

.settings, .workspace-settings {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 34px;
  align-items: start;
  margin: 42px auto 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #101e2beF;
}

.settings[hidden], .workspace-settings[hidden] { display: none; }
.workspace-settings { grid-template-columns: 1fr; gap: 12px; margin: 24px 0; }
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.settings-heading h1 { margin-top: .2em; }
.settings-card { display: grid; gap: 10px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #101e2b; }
.settings-card h2 { margin: 0; font-size: 1rem; }
.settings-card > label:not(.check-row) { color: #c5d4dd; font-size: .82rem; }
.settings-card textarea, .settings-card select { width: 100%; border: 1px solid #31495b; border-radius: 10px; background: #091520; color: #eff8fc; outline: none; }
.settings-card textarea { min-height: 95px; padding: 10px 12px; resize: vertical; }
.settings-card select { min-height: 42px; padding: 8px 10px; }
.settings-card .muted { margin: 0; font-size: .8rem; line-height: 1.45; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.secondary-button, .danger-button, .file-import-button { min-height: 38px; padding: 8px 12px; border: 1px solid #405766; border-radius: 8px; background: #15232d; color: inherit; font-size: .8rem; cursor: pointer; }
.danger-button { border-color: #804d56; color: #ffaaaa; }
.file-import-button { display: inline-flex; align-items: center; }
.settings-list { display: grid; gap: 8px; }
.settings-list:empty { display: none; }
.settings-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.settings-item > div:first-child { min-width: 0; }
.settings-item strong { display: block; font-size: .83rem; }
.settings-item small { color: var(--muted); font-size: .72rem; }
.settings-item button { min-height: 34px; padding: 5px 9px; border: 1px solid #405766; border-radius: 7px; background: #15232d; cursor: pointer; }
.privacy-list { display: grid; gap: 10px; margin: 0; }
.privacy-list div { display: grid; gap: 3px; }
.privacy-list dt { color: #c5d4dd; font-size: .82rem; font-weight: 650; }
.privacy-list dd { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.eyebrow { color: var(--cyan); font-size: .72rem; letter-spacing: .15em; }
h1 { margin: .35em 0; font-size: clamp(1.35rem, 4vw, 2rem); }
.muted { color: var(--muted); line-height: 1.55; }
.settings form { display: grid; gap: 10px; }
.settings form > label:not(.check-row) { margin-top: 5px; font-size: .82rem; color: #c5d4dd; }
input[type="url"], input[type="password"], textarea {
  width: 100%;
  border: 1px solid #31495b;
  border-radius: 10px;
  background: #091520;
  color: #eff8fc;
  outline: none;
}
input[type="url"], input[type="password"] { min-height: 44px; padding: 10px 12px; }
input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #43e0df22; }
input[readonly] { color: #a9c2d1; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .83rem; }
.check-row input { accent-color: var(--cyan); }
.primary-button, .send-button {
  border: 0;
  border-radius: 10px;
  background: var(--cyan);
  color: #06202a;
  font-weight: 700;
  cursor: pointer;
}
.primary-button { min-height: 44px; margin-top: 5px; }
button:disabled { cursor: not-allowed; opacity: .48; }
.error { min-height: 1.2em; margin: 0; color: var(--red); font-size: .84rem; }

.conversation { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; margin: 18px 0 12px; border: 1px solid #d8dedf; border-radius: 14px; background: #efeae2; box-shadow: 0 12px 34px #20366e12; }
.chat-header { display: flex; min-height: 68px; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid #d9dfe2; background: #f0f2f5; color: #111b21; }
.chat-header > img { width: 42px; height: 42px; padding: 3px; border-radius: 50%; background: #dfe8e9; }
.chat-contact { display: grid; gap: 3px; }
.chat-contact strong { font-size: .94rem; font-weight: 650; }
.chat-contact span { color: #667781; font-size: .75rem; }
.chat-contact span.online { color: #008f73; }
.messages { flex: 1; overflow-y: auto; padding: 24px clamp(14px, 5vw, 72px); background-color: #efeae2; background-image: radial-gradient(#d8d0c31a .8px, transparent .8px), radial-gradient(#d8d0c31a .8px, transparent .8px); background-position: 0 0, 8px 8px; background-size: 16px 16px; }
.empty-state { display: grid; justify-items: center; padding: 12vh 10px 20px; text-align: center; }
.empty-state h1 { font-size: 1.5rem; color: #41525a; }
.empty-state p { max-width: 340px; padding: 8px 14px; border-radius: 8px; background: #fff8c6; color: #54656d; font-size: .82rem; line-height: 1.45; }
.message { display: grid; grid-template-columns: minmax(0, auto) auto; align-items: end; gap: 5px 12px; width: fit-content; max-width: min(78%, 680px); margin: 5px 0; padding: 8px 10px 6px 12px; border: 0; border-radius: 8px; background: #fff; color: #111b21; box-shadow: 0 1px 1px #0b141a1a; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { margin-left: auto; border: 0; border-radius: 8px 0 8px 8px; background: #d9fdd3; }
.message.assistant { margin-right: auto; border-radius: 0 8px 8px 8px; background: #fff; }
.message-content { grid-column: 1 / -1; min-width: 0; }
.message-time { grid-column: 2; justify-self: end; color: #667781; font-size: .65rem; line-height: 1; white-space: nowrap; }
.message.pending { color: #667781; }
.integration-login-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.integration-login-button { min-height: 35px; padding: 0 11px; border: 1px solid #3e8591; border-radius: 8px; background: #102e36; color: #d9ffff; cursor: pointer; font-size: .78rem; font-weight: 650; }
.integration-login-button:hover { border-color: var(--cyan); }

.approvals { display: grid; gap: 10px; }
.approval-card { padding: 14px; border: 1px solid #ad8950; border-radius: 12px; background: #241f16; }
.approval-card p { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.approval-actions { display: flex; justify-content: flex-end; gap: 8px; }
.approval-actions button { min-height: 38px; padding: 0 14px; border: 1px solid #596b76; border-radius: 8px; background: #15232d; cursor: pointer; }
.approval-actions .approve { border-color: #52c99b; color: #78e1b5; }

.composer { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 10px 14px 12px; background: #f0f2f5; }
.composer-tools { position: relative; z-index: 3; grid-column: 1 / -1; }
.menu-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font-size: .82rem; }
.composer-menu { position: absolute; z-index: 4; bottom: calc(100% + 6px); left: 0; display: grid; width: min(360px, 92vw); max-height: min(55vh, 420px); overflow-y: auto; border: 1px solid #31495b; border-radius: 12px; background: #101e2b; box-shadow: 0 12px 30px #0008; }
.composer-menu[hidden] { display: none; }
.composer-menu button { min-height: 42px; padding: 9px 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.composer-menu button:hover { background: #19313f; }
.message-entry { position: relative; min-width: 0; }
.attachment-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-list[hidden] { display: none; }
.attachment-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: #c5d4dd; font-size: .75rem; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; }
.composer textarea { display: block; min-height: 48px; max-height: 180px; resize: vertical; padding: 13px 15px; border: 0; border-radius: 10px; background: #fff; color: #111b21; }
.suggestions {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: calc(100% + 6px);
  left: 0;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  border: 1px solid #31495b;
  border-radius: 12px;
  background: #101e2b;
  box-shadow: 0 12px 30px #0008;
}
.suggestions[hidden] { display: none; }
.suggestion { display: grid; width: 100%; gap: 3px; padding: 10px 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion[aria-selected="true"] { background: #19313f; }
.suggestion-label { color: var(--cyan); font-size: .9rem; font-weight: 650; }
.suggestion-description { color: var(--muted); font-size: .74rem; line-height: 1.4; overflow-wrap: anywhere; }
.send-button { grid-column: 2; grid-row: 2; align-self: stretch; min-width: 76px; padding: 0 15px; border-radius: 10px; background: #00a884; color: #fff; }
.composer-hint { position: absolute; right: 104px; bottom: 1px; margin: 0; color: #667781; font-size: .62rem; }
.status { min-height: 1.4em; margin: 0 0 5px; color: var(--muted); text-align: center; font-size: .8rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .shell { padding-right: 12px; padding-left: 12px; }
  .settings { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; padding: 18px; }
  .workspace-settings { padding: 0; }
  .settings-card { padding: 13px; }
  .conversation { min-height: calc(100vh - 150px); margin-top: 10px; }
  .messages { padding: 18px 10px; }
  .message { max-width: 90%; }
  .composer { gap: 7px; padding: 9px; }
  .composer-hint { display: none; }
}

:root { color-scheme: light; background: #edf4fc; color: #142b68; --panel: #fff; --line: #dbe6f2; --muted: #65758f; --cyan: #268fe2; --red: #b62f41; }
body { background: radial-gradient(ellipse at 76% -24%, #d7edff 0, #edf4fc 50%); }
.shell { width: min(100%, 1440px); padding-right: 26px; padding-left: 26px; }
.topbar { border-color: #dbe6f2; }
.brand strong { color: #182d76; }
.brand small { color: #268fe2; }
.connection { color: #63758e; }
.dot { background: #9aa8ba; }
.dot.online { background: #1caa78; box-shadow: 0 0 12px #59dda177; }
.icon-button { color: #65758f; }
.settings, .workspace-settings { background: #fff; box-shadow: 0 14px 40px #27436b12; }
.settings-card { background: #fff; }
.settings-card textarea, .settings-card select, input[type="url"], input[type="password"], textarea { border-color: #c9d8e9; background: #fbfdff; color: #142b68; }
.settings form > label:not(.check-row), .settings-card > label:not(.check-row), .privacy-list dt { color: #20366e; }
.settings-item { background: #fbfdff; }
.settings-item button, .secondary-button, .danger-button, .file-import-button { border-color: #c8d8e9; background: #f7faff; }
.danger-button { border-color: #edc0c6; color: #a92c3c; }
.primary-button, .send-button { color: #fff; }
.message.user { border-color: #beddf7; background: #dceeff; }
.integration-login-button { border-color: #b8d5ef; background: #eaf5ff; color: #1b5c94; }
.integration-login-button:hover { border-color: #268fe2; }
.approval-card { border-color: #d5b36e; background: #fff9e9; }
.approval-actions button { border-color: #c8d8e9; background: #fff; }
.approval-actions .approve { color: #08774d; }
.composer-menu, .suggestions { border-color: #c9d8e9; background: #fff; box-shadow: 0 12px 30px #20366e22; }
.composer-menu button:hover, .suggestion:hover, .suggestion[aria-selected="true"] { background: #eef6ff; }
.topbar-button { min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #566a89; cursor: pointer; font-size: .82rem; font-weight: 600; }
.topbar-button:hover, .topbar-button.active { border-color: #c8def2; background: #e8f3ff; color: #146fba; }
.conversation { border-color: #d8dedf; background: #efeae2; }
.chat-header { border-color: #d9dfe2; background: #f0f2f5; color: #111b21; }
.chat-header > img { background: #dfe8e9; }
.chat-contact span { color: #667781; }
.chat-contact span.online { color: #008f73; }
.messages { background-color: #efeae2; }
.message.user { border-color: transparent; background: #d9fdd3; color: #111b21; }
.message.assistant { border-color: transparent; background: #fff; color: #111b21; }
.message-time { color: #667781; }
.empty-state h1 { color: #41525a; }
.empty-state p { background: #fff8c6; color: #54656d; }
.composer { background: #f0f2f5; }
.composer textarea { border-color: transparent; background: #fff; color: #111b21; }
.send-button { background: #00a884; color: #fff; }
.composer-hint { color: #667781; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #268fe288; outline-offset: 2px; }
#settings[hidden], #hub[hidden], #conversation[hidden], #workspace-settings[hidden] { display: none; }

.hub { padding: 18px 0 12px; }
.hub-layout { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: min(820px, calc(100vh - 130px)); overflow: hidden; border: 1px solid #dce8f4; border-radius: 24px; background: #f7faff; box-shadow: 0 20px 60px #24426c12; }
.hub-sidebar { display: flex; flex-direction: column; padding: 25px 16px 18px; border-right: 1px solid #e1eaf4; background: #fff; }
.hub-sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 25px; color: #142b68; }
.hub-sidebar-brand > span:last-child { display: grid; }
.hub-sidebar-brand strong { font-size: .99rem; }
.hub-sidebar-brand small { color: #278fe1; font-size: .77rem; font-weight: 650; }
.orbit-mark { position: relative; display: block; width: 37px; height: 37px; border: 4px solid transparent; border-top-color: #49c8e4; border-right-color: #348de5; border-bottom-color: #2768d2; border-left-color: #3cb5ee; border-radius: 50%; transform: rotate(-34deg); }
.orbit-mark::after { position: absolute; top: -7px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #32a5ec; content: ""; }
.sidebar-label { margin: 0 10px 10px; color: #8493a8; font-size: .64rem; font-weight: 700; letter-spacing: .12em; }
.hub-navigation { display: grid; gap: 4px; }
.hub-nav-item { width: 100%; min-height: 42px; padding: 8px 11px; border: 0; border-radius: 10px; background: transparent; color: #536985; text-align: left; cursor: pointer; font-size: .84rem; font-weight: 550; transition: background .16s ease, color .16s ease, transform .16s ease; }
.hub-nav-item:hover { background: #f0f7ff; color: #1c70b7; transform: translateX(2px); }
.hub-nav-item.active { background: #e8f3ff; color: #176bb4; font-weight: 700; }
.sidebar-footnote { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid #eaf0f7; color: #6a7b91; font-size: .73rem; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: #31b78a; }
.hub-main { min-width: 0; padding: 23px 27px 20px; }
.hub-toolbar { position: relative; display: flex; min-height: 190px; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; margin: 0 0 27px; padding: 28px 32px; border: 1px solid #dcecff; border-radius: 20px; background: linear-gradient(115deg, #f2f8ff 0%, #e9f4ff 52%, #dceeff 100%); }
.hub-toolbar > div { position: relative; z-index: 1; max-width: 520px; }
.hub-toolbar::after { position: absolute; z-index: 0; top: 50%; right: 198px; width: 166px; height: 166px; border: 15px solid transparent; border-top-color: #5dc7e8; border-right-color: #45a4ed; border-bottom-color: #286dda; border-left-color: #33b7e8; border-radius: 50%; box-shadow: 0 0 0 8px #59b6ea13, 0 0 40px #45b1ea2d; content: ""; transform: translateY(-50%) rotate(-28deg); }
.hub-toolbar::before { position: absolute; z-index: 1; top: 34px; right: 236px; width: 14px; height: 14px; border: 4px solid #eaf6ff; border-radius: 50%; background: #2c95e2; content: ""; }
.hub-toolbar h1 { max-width: 520px; margin: 7px 0 8px; color: #162d77; font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1.08; }
.hub-toolbar .muted { max-width: 520px; margin: 0; color: #627897; font-size: .95rem; }
.eyebrow { margin: 0; color: #2c8bd3; font-size: .66rem; font-weight: 750; letter-spacing: .16em; }
.hub-primary-button { position: relative; z-index: 2; display: inline-flex; min-height: 43px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 0; border-radius: 11px; background: linear-gradient(120deg, #278fe2, #2581d5); box-shadow: 0 8px 20px #268fe22e; color: #fff; cursor: pointer; font-size: .82rem; font-weight: 700; transition: transform .16s ease, box-shadow .16s ease; }
.hub-primary-button:hover { box-shadow: 0 10px 25px #268fe244; transform: translateY(-1px); }
.hub-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.hub-section-heading h2, .hub-secondary-heading h2 { margin: 5px 0 4px; color: #182d70; font-size: 1.35rem; }
.hub-section-heading .muted, .hub-secondary-heading .muted { margin: 0; font-size: .8rem; }
.hub-search { display: flex; width: min(320px, 100%); min-height: 42px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #d6e2ef; border-radius: 11px; background: #fff; color: #8192a8; }
.hub-search span { font-size: 1.4rem; }
.hub-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #19316e; font-size: .8rem; }
.hub-search input:focus { box-shadow: none; }
.hub-category-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 17px; }
.hub-filter { min-height: 31px; padding: 0 11px; border: 1px solid #d9e5f1; border-radius: 999px; background: #fff; color: #637792; cursor: pointer; font-size: .72rem; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.hub-filter:hover, .hub-filter.active { border-color: #b9d8f3; background: #eaf5ff; color: #176eb6; }
.hub-app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.service-card { display: grid; min-height: 150px; align-content: start; justify-items: start; gap: 7px; padding: 15px; border: 1px solid #dce6f0; border-radius: 15px; background: #fff; box-shadow: 0 4px 14px #24426c07; color: #20356c; text-align: left; cursor: pointer; transition: border-color .17s ease, box-shadow .17s ease, transform .17s ease; }
.service-card:hover { border-color: #aad1f3; box-shadow: 0 10px 25px #24426c12; transform: translateY(-2px); }
.service-card-icon { display: grid; width: 31px; height: 31px; place-items: center; margin-bottom: 2px; border-radius: 10px; background: linear-gradient(145deg, #e5f5ff, #edf0ff); color: #2788d5; font-size: .72rem; font-weight: 800; }
.service-card > strong { font-size: .83rem; }
.service-card-description { min-height: 32px; color: #72829a; font-size: .72rem; line-height: 1.45; }
.service-card-meta { color: #8191a6; font-size: .64rem; }
.not-connected { display: inline-flex; align-items: center; gap: 5px; color: #7a8799; font-size: .64rem; }
.not-connected::before { width: 6px; height: 6px; border-radius: 50%; background: #a8b3c2; content: ""; }
.service-status { display: inline-flex; align-items: center; gap: 5px; font-size: .64rem; font-weight: 700; }
.service-status::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; content: ""; }
.service-status.is-connected { color: #167348; }
.service-status.is-pending { color: #98600c; }
.service-status.is-disconnected, .service-status.is-unconfigured { color: #7a8799; }
.service-status.is-available { color: #2b65b1; }
.hub-empty-state { grid-column: 1 / -1; margin: 0; padding: 28px; border: 1px dashed #c9d9ea; border-radius: 14px; color: #6a7b91; text-align: center; }
.hub-secondary { display: grid; gap: 16px; }
.hub-secondary-heading { display: flex; align-items: start; justify-content: space-between; }
.hub-secondary-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hub-info-card, .hub-security-note { padding: 17px; border: 1px solid #dce7f1; border-radius: 15px; background: #fff; }
.hub-info-card h3, .hub-item-card h3 { margin: 0 0 6px; color: #20356f; font-size: .9rem; }
.hub-info-card p, .hub-security-note p, .hub-item-card p { margin: 0; color: #6b7c94; font-size: .78rem; line-height: 1.55; }
.hub-info-card .hub-secondary-button { margin-top: 12px; }
.hub-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-secondary-button { min-height: 39px; padding: 0 12px; border: 1px solid #cddded; border-radius: 9px; background: #fff; color: #24588e; cursor: pointer; font-size: .76rem; font-weight: 650; }
.hub-secondary-button:hover { border-color: #a9cdee; background: #f1f8ff; }
.hub-items-list { display: grid; gap: 9px; }
.hub-whatsapp[hidden] { display: none; }
.whatsapp-message-list { display: grid; gap: 10px; }
.whatsapp-message-card { padding: 15px; border: 1px solid #dce7f1; border-radius: 13px; background: #fff; }
.whatsapp-message-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.whatsapp-message-heading strong { color: #20356f; font-size: .82rem; }
.whatsapp-message-heading time { color: #75859a; font-size: .7rem; }
.whatsapp-message-card p { margin: 10px 0 0; color: #405675; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.whatsapp-message-direction { display: block; margin-top: 8px; color: #27835d; font-size: .7rem; }
.whatsapp-reply-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 12px; }
.whatsapp-reply-form textarea { min-width: 0; resize: vertical; padding: 9px 10px; border: 1px solid #cddded; border-radius: 9px; color: #20356f; font: inherit; font-size: .8rem; }
.whatsapp-reply-form button:disabled { cursor: wait; opacity: .6; }
.whatsapp-retention-note { margin: 0; font-size: .72rem; }
.hub-items-list[hidden], .hub-preferences[hidden], .hub-secondary-copy[hidden], #hub-secondary-actions[hidden] { display: none; }
.hub-item-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid #dce7f1; border-radius: 13px; background: #fff; }
.hub-item-card > div { min-width: 0; }
.hub-item-card small { display: block; margin-top: 7px; color: #8998a9; font-size: .67rem; }
.hub-remove-button { min-height: 34px; flex: 0 0 auto; padding: 0 10px; border: 1px solid #edc3c8; border-radius: 8px; background: #fffafa; color: #a53643; cursor: pointer; font-size: .72rem; }
.hub-preferences { display: grid; gap: 10px; }
.hub-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border: 1px solid #dce7f1; border-radius: 13px; background: #fff; cursor: pointer; }
.hub-setting-row span { display: grid; gap: 4px; }
.hub-setting-row strong { color: #20356f; font-size: .82rem; }
.hub-setting-row small { color: #70819a; font-size: .72rem; line-height: 1.4; }
.hub-setting-row input { width: 18px; height: 18px; accent-color: #278fe2; }
.hub-security-note { background: #f0f7ff; }
.hub-security-note strong { display: block; margin-bottom: 5px; color: #24578c; font-size: .8rem; }
.hub-status { min-height: 1.4em; margin: 14px 0 0; color: #74859b; font-size: .72rem; }
.hub-dialog { width: min(540px, calc(100vw - 28px)); max-height: min(88vh, 780px); padding: 0; overflow: auto; border: 1px solid #d3e1ef; border-radius: 19px; background: #fff; color: #1a316f; box-shadow: 0 24px 90px #102c5540; }
.hub-dialog::backdrop { background: #10284e70; backdrop-filter: blur(3px); }
.hub-dialog-content { position: relative; display: grid; gap: 10px; padding: 26px; }
.hub-dialog-content h2 { margin: 0; color: #182d70; font-size: 1.35rem; }
.hub-dialog-content > .muted { margin: 0; font-size: .82rem; }
.hub-dialog-content label:not(.file-import-button) { color: #405675; font-size: .77rem; font-weight: 650; }
.hub-dialog-content input[type="text"], .hub-dialog-content textarea { width: 100%; padding: 10px 11px; border: 1px solid #ceddec; border-radius: 9px; background: #fbfdff; color: #19316e; font-size: .82rem; }
.hub-dialog-content textarea { resize: vertical; }
.hub-dialog-content .dialog-note { margin: 0; padding: 10px 11px; border-radius: 9px; background: #f1f7fe; color: #647992; font-size: .72rem; line-height: 1.5; }
.hub-dialog-content .dialog-close { position: absolute; top: 13px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f0f5fa; color: #61728a; cursor: pointer; font-size: 1.3rem; }
.service-detail-list { display: grid; gap: 10px; margin: 7px 0; }
.service-detail-list div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #e2eaf3; border-radius: 10px; background: #fbfdff; }
.service-detail-list dt { color: #6f8098; font-size: .74rem; }
.service-detail-list dd { margin: 0; color: #21386f; font-size: .76rem; font-weight: 650; }

@media (max-width: 1020px) {
  .hub-layout { grid-template-columns: 205px minmax(0, 1fr); }
  .hub-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-toolbar::after { right: 180px; opacity: .58; }
  .hub-toolbar::before { right: 218px; }
}
@media (max-width: 640px) {
  .shell { padding-right: 12px; padding-left: 12px; }
  .topbar { min-height: 64px; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .connection { flex: 1 1 190px; flex-wrap: wrap; justify-content: flex-end; gap: 5px; font-size: .7rem; }
  #connection-label { display: none; }
  .topbar-button { min-height: 33px; padding: 0 7px; font-size: .68rem; }
  #clear-session-button { display: none; }
  .hub { padding-top: 10px; }
  .hub-layout { display: block; min-height: calc(100vh - 92px); border-radius: 18px; }
  .hub-sidebar { padding: 12px; border-right: 0; border-bottom: 1px solid #e1eaf4; }
  .hub-sidebar-brand, .sidebar-label, .sidebar-footnote { display: none; }
  .hub-navigation { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .hub-nav-item { min-height: 37px; padding: 5px 6px; text-align: center; font-size: .65rem; }
  .hub-main { padding: 15px 12px 12px; }
  .hub-toolbar { min-height: 190px; align-items: flex-start; flex-direction: column; gap: 11px; margin-bottom: 20px; padding: 21px 17px; }
  .hub-toolbar h1 { max-width: 85%; font-size: 1.8rem; }
  .hub-toolbar .muted { max-width: 86%; font-size: .78rem; }
  .hub-toolbar::after { top: auto; right: -28px; bottom: -37px; width: 145px; height: 145px; border-width: 12px; transform: rotate(-28deg); }
  .hub-toolbar::before { top: auto; right: 74px; bottom: 37px; }
  .hub-primary-button { min-height: 38px; padding: 0 12px; font-size: .75rem; }
  .hub-section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .hub-section-heading h2, .hub-secondary-heading h2 { font-size: 1.16rem; }
  .hub-search { width: 100%; }
  .hub-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .service-card { min-height: 154px; padding: 11px; }
  .service-card-description { font-size: .68rem; }
  .hub-secondary-copy { grid-template-columns: 1fr; }
  .hub-action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-secondary-button { padding: 0 8px; font-size: .69rem; }
  .hub-item-card { align-items: flex-start; flex-direction: column; }
  .hub-dialog-content { padding: 23px 18px; }
}

.whatsapp-message-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 210px;
  max-height: min(70vh, 760px);
  overflow-y: auto;
  padding: 18px clamp(12px, 4vw, 42px);
  border: 1px solid #d8dedf;
  border-radius: 12px;
  background-color: #efeae2;
  background-image: radial-gradient(#d8d0c31a .8px, transparent .8px), radial-gradient(#d8d0c31a .8px, transparent .8px);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}
.whatsapp-access-token-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 9px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #c8d8e9;
  border-radius: 12px;
  background: #f3f8fe;
}
.whatsapp-access-token-copy strong { display: block; margin-bottom: 4px; color: #24578c; font-size: .76rem; }
.whatsapp-access-token-copy p { margin: 0; font-size: .68rem; }
.whatsapp-access-token-field { display: grid; min-width: 0; gap: 5px; }
.whatsapp-access-token-field label { color: #405675; font-size: .72rem; font-weight: 650; }
.whatsapp-access-token-field input { width: 100%; min-width: 0; min-height: 40px; padding: 9px 11px; border: 1px solid #cddded; border-radius: 9px; background: #fff; color: #111b21; font: inherit; font-size: .8rem; }
.whatsapp-access-token-form .settings-actions { justify-content: flex-start; }
#whatsapp-access-token-status { grid-column: 1 / -1; min-height: 1.1em; margin: -3px 0 0; font-size: .68rem; }
.whatsapp-web-pairing { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border: 1px solid #e3e8ea; border-radius: 12px; background: #f8fafb; }
.whatsapp-web-pairing h3 { margin: 0; color: #24578c; font-size: .86rem; }
.whatsapp-web-pairing p { margin: 0; }
.whatsapp-web-pairing-code-form { display: grid; gap: 6px; }
.whatsapp-web-pairing-code-form label { color: #405675; font-size: .72rem; font-weight: 650; }
.whatsapp-web-pairing-code-form input { width: min(260px, 100%); min-height: 40px; padding: 9px 11px; border: 1px solid #cddded; border-radius: 9px; background: #fff; color: #111b21; font: inherit; font-size: .8rem; }
.whatsapp-web-pairing-code { padding: 10px 12px; border-radius: 8px; background: #e7f1ff; color: #173b64; font-size: 1rem; font-weight: 700; letter-spacing: .08em; }
.whatsapp-web-pairing img { width: min(260px, 100%); aspect-ratio: 1; padding: 8px; border: 1px solid #d8dedf; border-radius: 10px; background: #fff; object-fit: contain; }
.whatsapp-ai-instructions-form { display: grid; gap: 8px; margin: 0 0 12px; padding: 14px; border: 1px solid #dce7f1; border-radius: 12px; background: #fff; }
.whatsapp-ai-instructions-form label { color: #20356f; font-size: .8rem; font-weight: 700; }
.whatsapp-ai-instructions-form .muted { margin: 4px 0 0; font-size: .72rem; }
.whatsapp-ai-instructions-form textarea { width: 100%; min-height: 90px; padding: 10px 11px; border: 1px solid #cddded; border-radius: 9px; background: #fff; color: #20356f; font: inherit; font-size: .8rem; resize: vertical; }
.whatsapp-ai-instructions-form textarea:disabled { background: #f3f5f7; }
.whatsapp-ai-instructions-form [role="status"] { font-size: .72rem; }
.whatsapp-new-message-form {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(240px, 2fr) auto;
  align-items: end;
  gap: 9px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e3e8ea;
  border-radius: 12px;
  background: #f8fafb;
}
.whatsapp-new-message-field { display: grid; min-width: 0; gap: 5px; }
.whatsapp-new-message-field label { color: #405675; font-size: .72rem; font-weight: 650; }
.whatsapp-new-message-field input, .whatsapp-new-message-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #cddded;
  border-radius: 9px;
  background: #fff;
  color: #111b21;
  font: inherit;
  font-size: .8rem;
}
.whatsapp-new-message-field textarea { max-height: 120px; resize: vertical; }
.whatsapp-new-message-form button { min-height: 40px; border-color: #008f73; background: #00a884; color: #fff; }
.whatsapp-new-message-form button:disabled { cursor: wait; opacity: .6; }
.whatsapp-new-message-note { grid-column: 1 / -1; margin: -2px 0 0; font-size: .68rem; }
.whatsapp-inbox-layout {
  display: grid;
  min-height: 440px;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d8dedf;
  border-radius: 12px;
  background: #fff;
}
.whatsapp-contacts { min-width: 0; overflow-y: auto; border-right: 1px solid #e3e8ea; background: #fff; }
.whatsapp-contacts h3 { margin: 0; padding: 17px 16px 12px; color: #111b21; font-size: .92rem; }
.whatsapp-contact-list { display: grid; }
.whatsapp-contact {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px 14px;
  border: 0;
  border-top: 1px solid #f0f2f4;
  background: #fff;
  color: #111b21;
  text-align: left;
  cursor: pointer;
}
.whatsapp-contact:hover, .whatsapp-contact[aria-selected="true"] { background: #f0f2f5; }
.whatsapp-contact strong { overflow: hidden; color: #111b21; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.whatsapp-contact span { overflow: hidden; color: #667781; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.whatsapp-contact time { color: #667781; font-size: .63rem; }
.whatsapp-thread { display: flex; min-width: 0; flex-direction: column; background: #efeae2; }
.whatsapp-thread-header { display: grid; min-height: 58px; align-content: center; gap: 3px; padding: 9px 15px; border-bottom: 1px solid #d9dfe2; background: #f0f2f5; }
.whatsapp-thread-header strong { overflow: hidden; color: #111b21; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.whatsapp-thread-header span { color: #667781; font-size: .68rem; }
.whatsapp-reply-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; padding: 10px; background: #f0f2f5; }
.whatsapp-reply-composer[hidden] { display: none; }
.whatsapp-reply-composer textarea { min-width: 0; min-height: 40px; max-height: 130px; resize: vertical; padding: 10px 14px; border: 0; border-radius: 18px; background: #fff; color: #111b21; font: inherit; font-size: .8rem; }
.whatsapp-reply-composer button { min-height: 40px; border-color: #008f73; border-radius: 18px; background: #00a884; color: #fff; }
.whatsapp-message-card {
  display: grid;
  width: fit-content;
  max-width: min(82%, 620px);
  gap: 5px;
  padding: 8px 10px 9px 12px;
  border: 0;
  border-radius: 0 9px 9px 9px;
  background: #fff;
  color: #111b21;
  box-shadow: 0 1px 1px #0b141a1a;
}
.whatsapp-message-card.outbound {
  justify-self: end;
  border-radius: 9px 0 9px 9px;
  background: #d9fdd3;
}
.whatsapp-message-card.inbound { justify-self: start; }
.whatsapp-message-heading { align-items: baseline; gap: 4px 14px; }
.whatsapp-message-heading strong { color: #008f73; font-size: .73rem; font-weight: 650; }
.whatsapp-message-card.outbound .whatsapp-message-heading strong { color: #54656d; }
.whatsapp-message-heading time { color: #667781; font-size: .64rem; }
.whatsapp-message-card p.whatsapp-message-body {
  margin: 0;
  color: #111b21;
  font-size: .86rem;
  line-height: 1.45;
}
.whatsapp-message-direction { justify-self: end; margin-top: 0; color: #667781; font-size: .64rem; }
.whatsapp-reply-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid #e9efeb;
}
.whatsapp-reply-form textarea {
  min-height: 38px;
  padding: 9px 10px;
  border-color: #d7e2df;
  border-radius: 18px;
  background: #fff;
  color: #111b21;
  font-size: .75rem;
}
.whatsapp-reply-form button {
  min-height: 38px;
  border-color: #008f73;
  border-radius: 18px;
  background: #00a884;
  color: #fff;
}
.whatsapp-retention-note { margin-top: 8px; }

@media (max-width: 640px) {
  .whatsapp-access-token-form { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 9px; }
  .whatsapp-new-message-form { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 9px; }
  .whatsapp-new-message-note { grid-column: auto; }
  .whatsapp-inbox-layout { min-height: 460px; grid-template-columns: minmax(112px, 38%) minmax(0, 1fr); }
  .whatsapp-contacts h3 { padding: 12px 8px 9px; font-size: .8rem; }
  .whatsapp-contact { gap: 4px; padding: 11px 8px; }
  .whatsapp-contact strong { font-size: .67rem; white-space: normal; overflow-wrap: anywhere; }
  .whatsapp-contact span { font-size: .64rem; }
  .whatsapp-contact time { font-size: .58rem; }
  .whatsapp-message-list { max-height: min(68vh, 680px); padding: 13px 9px; }
  .whatsapp-message-card { max-width: 95%; }
  .whatsapp-message-heading { flex-wrap: wrap; }
  .whatsapp-reply-composer { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; padding: 7px; }
  .whatsapp-reply-composer button { padding: 0 8px; font-size: .68rem; }
}

.terminal { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; }
.terminal[hidden] { display: none; }
.terminal-actions { display: flex; gap: 8px; margin-left: auto; }
.terminal-output {
  min-height: 320px;
  max-height: min(60vh, 560px);
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid #1d2f3d;
  border-radius: 12px;
  background: #050b11;
  color: #cfe8d8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal-output .term-error { color: #ff8484; }
.terminal-output .term-status { color: #8fa6b5; }
.terminal-composer { display: flex; align-items: center; gap: 8px; }
.terminal-prompt { color: #43e0df; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.terminal-composer input {
  flex: 1;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #31495b;
  border-radius: 10px;
  background: #091520;
  color: #eff8fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}
.terminal-hint { margin: 0; font-size: .78rem; }
