:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --heloow-bg: #090b0d;
  --heloow-surface: #1e1e1e;
  --heloow-surface-raised: #25282b;
  --heloow-surface-soft: #2d2d2d;
  --heloow-text: #e0e0e0;
  --heloow-text-strong: #f7f8fa;
  --heloow-muted: #a0a0a0;
  --heloow-border: #3d3d3d;
  --heloow-accent: #3b9dd8;
  --heloow-accent-soft: #152d3c;
  color: var(--heloow-text);
  background: var(--heloow-bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; background: var(--heloow-bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--heloow-accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -56px; z-index: 100; padding: 10px 14px; background: var(--heloow-text-strong); color: var(--heloow-bg); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 88% 5%, rgba(59, 157, 216, .09), transparent 30rem),
    linear-gradient(135deg, transparent 0, transparent 30px, rgba(255, 255, 255, .014) 31px, transparent 32px) 0 0 / 64px 64px,
    var(--heloow-bg);
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 14px max(24px, calc((100vw - 1320px) / 2));
  background: rgba(9, 11, 13, .94);
  border-bottom: 1px solid #262c31;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #505b64;
  border-radius: 11px;
  background: #101316;
  color: var(--heloow-text-strong);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.08em;
  box-shadow: inset 0 0 0 1px #1b232a, 0 0 22px rgba(59, 157, 216, .08);
}
.brand strong, .brand small { display: block; }
.brand strong { color: var(--heloow-text-strong); font-size: 16px; letter-spacing: -.035em; }
.brand small { margin-top: 1px; color: var(--heloow-muted); font-size: 11px; }
.session-controls { display: flex; align-items: center; gap: 14px; }
.session-user { color: var(--heloow-muted); font-size: 13px; overflow-wrap: anywhere; }
.main-content { width: min(1320px, 100%); margin: 0 auto; padding: 34px 24px 70px; flex: 1; }
.app-footer { padding: 23px; text-align: center; border-top: 1px solid #262c31; background: #0d1012; color: #8b969e; font-size: 12px; }

.notice { margin-bottom: 20px; border: 1px solid #38617b; background: #102330; color: #cbe9f9; padding: 13px 16px; border-radius: 10px; font-size: 14px; }
.notice.is-error { border-color: #874449; background: #2b171a; color: #ffd6d8; }
.button {
  border: 1px solid transparent;
  border-radius: 9px;
  min-height: 40px;
  padding: 9px 15px;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: var(--heloow-accent); color: #07141d; }
.button-primary:hover:not(:disabled) { background: #70bce8; }
.button-secondary { background: #24292d; border-color: #4a535a; color: var(--heloow-text-strong); }
.button-secondary:hover:not(:disabled) { background: #333b41; }
.button-quiet { background: transparent; color: var(--heloow-text); border-color: transparent; }
.button-quiet:hover:not(:disabled) { background: #252c31; }
.button-danger { background: #27191b; border-color: #8d4b51; color: #ffc4ca; }
.button-danger:hover:not(:disabled) { background: #3a2024; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 12px; }

.login-view { min-height: min(650px, 75vh); display: grid; place-items: center; }
.login-card {
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid var(--heloow-border);
  border-top-color: #5b6d78;
  border-radius: 16px;
  background: linear-gradient(160deg, #23282b, var(--heloow-surface) 38%);
  box-shadow: 0 28px 80px #0008, inset 0 1px #ffffff0b;
}
.eyebrow { color: var(--heloow-accent); text-transform: uppercase; letter-spacing: .17em; font-size: 10px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--heloow-text-strong); }
.login-card h1 { font-size: 30px; letter-spacing: -.045em; margin: 9px 0 10px; }
.login-card > p, .page-heading p, .section-heading p { color: var(--heloow-muted); line-height: 1.55; }
.form-stack { display: grid; gap: 10px; }
.login-card .form-stack { margin-top: 26px; }
label { color: #cbd2d6; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #4a4f53;
  border-radius: 9px;
  background: #121619;
  color: var(--heloow-text-strong);
  padding: 9px 11px;
}
input:hover, select:hover, textarea:hover { border-color: #6a747b; }
input:focus, select:focus, textarea:focus { border-color: var(--heloow-accent); }
input::placeholder, textarea::placeholder { color: #8f9aa2; }
textarea { resize: vertical; min-height: 90px; }
.field-error { margin: 16px 0 0; color: #ffc4ca; font-size: 13px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading h1 { font-size: 32px; letter-spacing: -.045em; margin: 7px 0 8px; }
.page-heading p { margin: 0; }
.tabs { display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--heloow-border); overflow-x: auto; margin-bottom: 24px; }
.tab { white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #a8b4bc; padding: 14px 17px 12px; font-size: 14px; font-weight: 700; }
.tab:hover { color: var(--heloow-text-strong); background: #1b2227; }
.tab.is-active { border-bottom-color: var(--heloow-accent); color: var(--heloow-text-strong); }
.count { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 4px; border: 1px solid #485660; border-radius: 999px; padding: 0 5px; background: #26333b; color: #dceaf3; font-size: 11px; }
.view { min-height: 340px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { font-size: 22px; letter-spacing: -.025em; margin: 0 0 4px; }
.section-heading p { font-size: 13px; margin: 0; }
.filters { display: flex; gap: 9px; min-width: min(480px, 100%); }
.filters input { flex: 1; min-width: 170px; }
.filters select { width: 180px; }

.card-list { display: grid; gap: 13px; min-width: 0; }
.card, .surface, .empty-state { background: var(--heloow-surface); border: 1px solid var(--heloow-border); border-radius: 12px; box-shadow: 0 8px 28px #0003; }
.card { padding: 19px 21px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card h3 { font-size: 16px; margin: 0 0 7px; overflow-wrap: anywhere; }
.card-subtitle, .meta { color: var(--heloow-muted); font-size: 12px; line-height: 1.5; }
.card-subtitle { margin: 0; }
.card-description { white-space: pre-wrap; overflow-wrap: anywhere; color: #cbd2d7; font-size: 14px; line-height: 1.55; margin: 14px 0; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.card-actions select { width: auto; min-width: 150px; min-height: 35px; font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid #49545c; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 800; background: #2b3338; color: #dbe5e9; }
.status-open, .status-pending { border-color: #886529; background: #342915; color: #f4d18b; }
.status-in_progress, .status-approved, .status-executing { border-color: #426f8c; background: #173044; color: #a8dbf8; }
.status-closed, .status-executed { border-color: #407e61; background: #173428; color: #a9e6c2; }
.status-rejected, .status-failed { border-color: #894b4e; background: #391e22; color: #ffc5c9; }
.meta-grid { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.meta-grid span { overflow-wrap: anywhere; }
.meta-grid strong { color: #cbd5da; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 17px; }
.summary-chip { border: 1px solid var(--heloow-border); border-radius: 999px; background: #22282c; padding: 8px 12px; color: #c6d3d9; font-size: 12px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 15px; }
.rule-grid div { padding: 11px 12px; border: 1px solid #353e43; border-radius: 9px; background: #252b2f; min-width: 0; }
.rule-grid dt { color: #9eb2be; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.rule-grid dd { margin: 5px 0 0; color: #e4ecef; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.subtle-note, .helper { color: var(--heloow-muted); font-size: 12px; line-height: 1.5; }
.subtle-note { margin: 16px 0; }
.helper { margin: -3px 0 6px; }

.action-layout { display: grid; grid-template-columns: minmax(250px, 350px) minmax(0, 1fr); gap: 18px; align-items: start; }
.conversation-layout { display: grid; grid-template-columns: minmax(230px, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
.conversation-list { display: grid; gap: 8px; max-height: 670px; overflow: auto; }
.conversation-item { width: 100%; text-align: left; border: 1px solid var(--heloow-border); border-radius: 10px; background: var(--heloow-surface); padding: 13px 14px; color: var(--heloow-text); }
.conversation-item:hover, .conversation-item.is-selected { border-color: #5286a6; background: var(--heloow-accent-soft); }
.conversation-item strong, .conversation-item span { display: block; }
.conversation-item strong { font-size: 13px; margin-bottom: 5px; overflow-wrap: anywhere; }
.conversation-item span { font-size: 11px; color: var(--heloow-muted); overflow-wrap: anywhere; }
.conversation-preview { margin-top: 8px; line-height: 1.4; max-height: 2.8em; overflow: hidden; }
.conversation-detail { min-height: 440px; }
.conversation-heading { padding-bottom: 12px; border-bottom: 1px solid var(--heloow-border); }
.conversation-heading h3 { margin: 0 0 4px; font-size: 17px; }
.conversation-heading p { margin: 0; }
.conversation-messages { display: flex; flex-direction: column; gap: 11px; max-height: 390px; min-height: 220px; overflow: auto; padding: 16px 2px; }
.conversation-message { max-width: 85%; border: 1px solid #414d55; border-radius: 10px; padding: 10px 12px; background: #282e32; color: #e1e9ed; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.conversation-message[data-role="user"] { align-self: flex-end; background: #173247; border-color: #356582; }
.conversation-message[data-role="human"] { align-self: flex-start; background: #1b362e; border-color: #3d7460; }
.conversation-message small { display: block; color: #a9bbc5; font-size: 10px; margin-top: 7px; }
.reply-form { display: grid; gap: 9px; padding-top: 14px; border-top: 1px solid var(--heloow-border); }
.reply-form .button { justify-self: end; }
.support-reply-note { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--heloow-border); border-radius: 9px; background: #252b2f; color: var(--heloow-muted); font-size: 12px; }
.surface { padding: 20px; }
.surface h3 { font-size: 17px; margin: 0 0 7px; }
.surface .button { margin-top: 8px; }
.code-block { background: #101518; border: 1px solid #3a444b; border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; color: #dbeaf3; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.card h4.meta { margin: 16px 0 6px; }
.audit-list { margin: 14px 0 0; padding-left: 19px; color: #adbdc6; font-size: 12px; }
.audit-list li + li { margin-top: 4px; }
.empty-state { padding: 40px 24px; text-align: center; color: var(--heloow-muted); }
.empty-state strong { display: block; color: var(--heloow-text-strong); font-size: 15px; margin-bottom: 4px; }

.dialog { border: 1px solid #53626c; border-radius: 16px; padding: 26px; width: min(500px, calc(100vw - 32px)); box-shadow: 0 25px 80px #000a; background: var(--heloow-surface); color: var(--heloow-text); }
.dialog::backdrop { background: #000b; backdrop-filter: blur(4px); }
.dialog h2 { font-size: 23px; margin: 0; }
.dialog p { color: var(--heloow-muted); line-height: 1.5; margin: 0 0 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }

.credential-settings { max-width: 1020px; margin-bottom: 18px; padding: 24px; }
.credential-heading h3 { margin: 5px 0 0; }
.credential-heading .helper { margin: 5px 0 18px; }
.credential-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.credential-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; padding: 13px; border: 1px solid var(--heloow-border); border-radius: 10px; background: var(--heloow-surface-raised); }
.credential-info { display: grid; gap: 5px; min-width: 0; }
.credential-info strong { font-size: 13px; color: var(--heloow-text-strong); }
.credential-badge { width: fit-content; padding: 3px 8px; border: 1px solid #6c5454; border-radius: 999px; color: #f2c4c4; font-size: 11px; }
.credential-badge.is-ready { border-color: #416b58; color: #b7e3c7; }
.credential-url { overflow-wrap: anywhere; color: var(--heloow-muted); font-size: 11px; }
.credential-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.credential-row-actions .button { margin: 0; white-space: nowrap; }
.credential-form { display: grid; gap: 9px; margin-top: 18px; padding: 18px; border: 1px solid var(--heloow-accent); border-radius: 11px; background: #17252e; }
.credential-form[hidden] { display: none; }
.credential-form h4 { margin: 0 0 5px; font-size: 15px; }
.credential-form label { font-size: 13px; font-weight: 700; }
.credential-form input { width: 100%; }
.credential-form .helper { margin: 0; }
.credential-form #credential-endpoint-field { display: grid; gap: 8px; }
.credential-form #credential-endpoint-field[hidden] { display: none; }
.credential-form #credential-models-field { display: grid; gap: 8px; margin-top: 7px; }
.credential-form #credential-models-field[hidden] { display: none; }
.credential-form #credential-models-field h5 { margin: 0; font-size: 13px; }
.credential-models-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.credential-models-grid > div { min-width: 0; }
.credential-models-grid label { display: block; margin-bottom: 6px; }
.credential-actions, .ai-test-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.credential-actions { justify-content: flex-end; margin-top: 6px; }
.credential-actions .button, .ai-test-actions .button { margin: 0; }
.ai-test-actions { margin-top: 11px; }
.ai-test-actions span { color: var(--heloow-muted); font-size: 12px; }
.button-link { min-height: auto; margin: 0; padding: 0; border: 0; background: transparent; color: #80c7ef; text-decoration: underline; }

.site-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 16px; }
.site-list { display: grid; gap: 8px; }
.site-item { display: grid; gap: 5px; width: 100%; padding: 14px; border: 1px solid var(--heloow-border); border-radius: 10px; background: var(--heloow-surface-raised); color: var(--heloow-text); text-align: left; cursor: pointer; }
.site-item:hover, .site-item.is-selected { border-color: var(--heloow-accent); background: var(--heloow-accent-soft); }
.site-item strong { color: var(--heloow-text-strong); font-size: 13px; }
.site-item span { color: var(--heloow-muted); font-size: 12px; overflow-wrap: anywhere; }
.site-form { max-width: 880px; display: grid; gap: 11px; padding: 24px; }
.site-form[hidden] { display: none; }
.site-form-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--heloow-border); padding-bottom: 13px; }
.site-form-heading h3 { margin: 5px 0 0; }
.site-form-heading > span { color: var(--heloow-muted); font-size: 12px; }
.site-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.site-form label { font-size: 13px; font-weight: 700; }
.site-form input:not([type="checkbox"]), .site-form textarea { width: 100%; margin-top: 7px; }
.site-form textarea { min-height: 72px; }
.site-form .helper { margin: -4px 0 4px; }
.site-toggles { display: grid; gap: 9px; margin-top: 7px; }
.site-toggles label { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--heloow-border); border-radius: 9px; background: var(--heloow-surface-raised); cursor: pointer; }
.site-toggles input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--heloow-accent); }
.site-toggles span { display: grid; gap: 4px; }
.site-toggles small { color: var(--heloow-muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.site-form-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; border-top: 1px solid var(--heloow-border); padding-top: 15px; }
.site-form-actions .button { margin: 0; }
.site-form-actions #site-delete { margin-right: auto; }
.site-secret-value { display: block; margin: 13px 0; user-select: all; overflow-wrap: anywhere; }

.knowledge-site-picker { width: min(320px, 100%); }
.knowledge-site-picker label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.knowledge-site-picker select { width: 100%; }
.knowledge-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 16px; }
.knowledge-form { display: grid; gap: 10px; min-width: 0; padding: 24px; }
.knowledge-form h3 { margin: 0 0 8px; }
.knowledge-form label { font-size: 13px; font-weight: 700; }
.knowledge-form input, .knowledge-form textarea { width: 100%; }
.knowledge-form textarea { min-height: 180px; resize: vertical; }
.knowledge-form input[type="file"] { overflow: hidden; padding: 9px; font-size: 12px; }
.knowledge-form .helper { margin: -5px 0 4px; }
.knowledge-form .helper.is-error { color: #ffbfc4; }
.knowledge-preview { min-width: 0; padding: 13px; border: 1px solid var(--heloow-border); border-radius: 9px; background: #151a1d; }
.knowledge-preview strong { font-size: 12px; }
.knowledge-preview pre, .knowledge-detail pre { max-height: 260px; margin: 8px 0 0; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--heloow-text); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.knowledge-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--heloow-border); padding-top: 16px; }
.knowledge-form-actions span { margin-right: auto; color: var(--heloow-muted); font-size: 12px; }
.knowledge-form-actions .button { margin: 0; }
.knowledge-library { min-width: 0; }
.knowledge-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.knowledge-library-heading h3 { margin: 0; font-size: 17px; }
.knowledge-list { display: grid; gap: 10px; }
.knowledge-item { min-width: 0; padding: 16px; border: 1px solid var(--heloow-border); border-radius: 10px; background: var(--heloow-surface); }
.knowledge-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.knowledge-item-heading h4 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.knowledge-item .helper { margin: 7px 0 12px; overflow-wrap: anywhere; }
.knowledge-item-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.knowledge-item-actions .button { margin: 0; }
.knowledge-detail { margin-top: 13px; padding: 16px; }
.knowledge-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.knowledge-detail h4 { margin: 0; font-size: 14px; }
.knowledge-detail pre { max-height: 420px; }

.database-site-picker { width: min(320px, 100%); }
.database-site-picker label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.database-site-picker select { width: 100%; }
.database-form { display: grid; gap: 16px; max-width: 1020px; padding: 24px; }
.database-form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.database-form-heading h3 { margin: 5px 0 0; }
.database-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.database-fields > div { min-width: 0; }
.database-form label:not(.database-toggles label) { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.database-form input:not([type="checkbox"]), .database-form select, .database-form textarea { width: 100%; }
.database-form textarea { min-height: 230px; resize: vertical; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.database-form .helper { margin: 7px 0 0; }
.database-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.database-toggles label { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--heloow-border); border-radius: 9px; background: var(--heloow-surface-raised); cursor: pointer; }
.database-toggles input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--heloow-accent); }
.database-toggles span { display: grid; gap: 4px; }
.database-toggles small { color: var(--heloow-muted); font-size: 12px; font-weight: 400; }
.database-membership { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--heloow-border); border-radius: 9px; }
.database-membership legend { padding: 0 6px; font-size: 13px; font-weight: 700; }
.database-membership .helper { margin: 0 0 12px; }
.database-advanced { min-width: 0; padding: 15px; border: 1px solid var(--heloow-border); border-radius: 14px; background: #fafbf7; }
.database-advanced summary { cursor: pointer; color: var(--heloow-text-strong); font-size: 13px; font-weight: 750; }
.database-advanced summary::marker { color: #6b8c30; }
.database-advanced > .helper { margin: 12px 0 15px; }
.database-advanced .database-membership { margin-bottom: 16px; background: #fff; }
.database-advanced > label { margin-bottom: 7px; }
.database-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--heloow-border); }
.database-form-actions span { flex: 1 1 180px; color: var(--heloow-muted); font-size: 12px; }
.database-form-actions .button { margin: 0; }

.retention-settings { max-width: 1020px; margin-top: 18px; padding: 24px; }
.retention-settings h3 { margin: 5px 0 7px; }
.retention-settings > .helper { margin: 0 0 18px; }
.retention-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.retention-fields label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.retention-fields input { width: 100%; }
.retention-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 18px; border-top: 1px solid var(--heloow-border); padding-top: 17px; }
.retention-actions span { margin-right: auto; color: var(--heloow-muted); font-size: 12px; }
.retention-actions .button { margin: 0; }

.action-policies { margin-top: 22px; padding: 24px; }
.action-policies-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.action-policies-heading h3 { margin: 5px 0 7px; }
.action-policies-heading .helper { margin: 0; }
.action-policies-heading .button { margin: 0; flex: 0 0 auto; }
.action-policies > .helper { margin: 10px 0; }
.action-policies-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.action-policy-card { min-width: 0; padding: 16px; border: 1px solid var(--heloow-border); border-radius: 10px; background: var(--heloow-surface-raised); }
.action-policy-card h4 { margin: 0 0 5px; color: var(--heloow-text-strong); font-size: 14px; overflow-wrap: anywhere; }
.action-policy-card > .helper { margin: 0 0 13px; }
.action-policy-enable { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; }
.action-policy-card input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--heloow-accent); }
.action-policy-sites { display: grid; gap: 8px; margin: 14px 0; padding: 12px; border: 1px solid var(--heloow-border); border-radius: 9px; }
.action-policy-sites legend { padding: 0 5px; font-size: 12px; font-weight: 700; }
.action-policy-sites label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.action-policy-sites .helper { margin: 2px 0 0; }
.action-policy-limit { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.action-policy-limit input { width: 100%; }
.action-policy-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; border-top: 1px solid var(--heloow-border); padding-top: 13px; }
.action-policy-actions span { margin-right: auto; color: var(--heloow-muted); font-size: 12px; }
.action-policy-actions .button { margin: 0; }

.mcp-review { margin-top: 22px; padding: 24px; }
.mcp-review h3 { margin: 5px 0 7px; }
.mcp-review > .helper { margin: 0 0 18px; }
.mcp-review-form { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.mcp-review-form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.mcp-review-form input, .mcp-review-form select { width: 100%; }
.mcp-review-form .button { margin: 0; }
.mcp-review > #mcp-review-status { margin: 12px 0 0; }
.mcp-review-result { margin-top: 18px; border-top: 1px solid var(--heloow-border); padding-top: 17px; }
.mcp-review-result h4 { margin: 0 0 14px; color: var(--heloow-text-strong); font-size: 15px; }
.mcp-review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.mcp-review-grid div { min-width: 0; }
.mcp-review-grid dt { margin-bottom: 5px; color: var(--heloow-muted); font-size: 11px; }
.mcp-review-grid dd { margin: 0; overflow-wrap: anywhere; color: var(--heloow-text-strong); font-size: 13px; }
.mcp-review-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mcp-review-steps > div { min-width: 0; padding: 12px; border: 1px solid var(--heloow-border); border-radius: 9px; background: #151a1d; }
.mcp-review-steps strong { font-size: 12px; }
.mcp-review-steps pre { max-height: 200px; margin: 8px 0 0; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.mcp-review-warning { margin: 14px 0; padding: 12px 14px; border: 1px solid #8a6940; border-radius: 9px; background: #2a2115; color: #f4dfbf; font-size: 12px; }
.mcp-review-actions { display: flex; justify-content: flex-end; }
.mcp-review-actions .button { margin: 0; }

.support-settings { max-width: 1020px; padding: 24px; }
.support-settings .button { margin-top: 0; }
.support-settings-intro, .support-schedule-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.support-settings-intro { padding-bottom: 20px; border-bottom: 1px solid var(--heloow-border); }
.support-settings-intro h3, .support-schedule-heading h3 { margin: 5px 0 0; }
.support-human-fields { margin-top: 3px; }
.support-human-fields.is-inactive .support-schedule-heading,
.support-human-fields.is-inactive .support-weekly,
.support-human-fields.is-inactive > label,
.support-human-fields.is-inactive > textarea,
.support-human-fields.is-inactive > .helper { opacity: .48; }
.support-human-fields-note { margin: 16px 0 0; padding: 10px 13px; border: 1px solid #42617a; border-radius: 9px; background: #152632; color: #c6dce9; font-size: 12px; }
.support-site-picker { width: min(320px, 100%); }
.support-site-picker label, .support-timezone label { display: block; margin-bottom: 7px; }
.ai-settings { margin-top: 22px; padding: 18px; border: 1px solid var(--heloow-border); border-radius: 11px; background: var(--heloow-surface-raised); }
.ai-settings h3 { margin: 0 0 6px; }
.ai-settings .helper { margin: 5px 0 12px; }
.ai-settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-settings-fields label { display: block; margin-bottom: 7px; }
.ai-settings-fields select, .ai-settings-fields input { width: 100%; }
.ai-model-advanced { margin-top: 12px; }
.ai-model-advanced[open] { background: var(--heloow-surface-raised); }
#ai-model-preset-field .helper { min-height: 2.7em; margin: 7px 0 0; line-height: 1.4; }
#ai-model-current:empty { display: none; }
.support-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0; padding: 0; border: 0; }
.support-mode legend { margin-bottom: 10px; padding: 0; color: #cbd2d6; font-size: 13px; font-weight: 700; }
.support-mode-option { display: flex; align-items: flex-start; gap: 12px; min-height: 86px; padding: 15px; border: 1px solid var(--heloow-border); border-radius: 11px; background: var(--heloow-surface-raised); cursor: pointer; }
.support-mode-option:hover, .support-mode-option:has(input:checked) { border-color: var(--heloow-accent); background: var(--heloow-accent-soft); }
.support-mode-option input { flex: 0 0 auto; width: 18px; min-height: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--heloow-accent); }
.support-mode-option span { display: grid; gap: 5px; }
.support-mode-option strong { color: var(--heloow-text-strong); font-size: 13px; }
.support-mode-option small { color: var(--heloow-muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.support-schedule-heading { margin: 26px 0 17px; }
.support-schedule-heading .helper { margin: 5px 0 0; }
.support-timezone { width: min(280px, 100%); flex: 0 0 auto; }
.support-weekly { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 22px; }
.support-day { min-width: 0; padding: 14px; border: 1px solid var(--heloow-border); border-radius: 10px; background: #202427; }
.support-day-heading { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 10px; }
.support-day-heading h4 { margin: 0; color: var(--heloow-text-strong); font-size: 13px; }
.support-day-heading .button { white-space: nowrap; }
.support-day-intervals { display: grid; gap: 8px; }
.support-interval { display: flex; align-items: center; gap: 8px; min-width: 0; }
.support-interval input { width: 80px; min-width: 0; min-height: 36px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.support-interval-separator { color: var(--heloow-muted); font-size: 11px; }
.support-remove { flex: 0 0 auto; color: #c4cdd3; }
.support-day-closed { color: var(--heloow-muted); font-size: 12px; }
.support-settings > label[for="support-closed-message"] { display: block; margin-bottom: 7px; }
.support-settings > textarea { min-height: 72px; }
.support-settings > .helper { margin: 7px 0 0; }
.support-settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 20px; border-top: 1px solid var(--heloow-border); padding-top: 18px; }
.support-settings-actions span { color: var(--heloow-muted); font-size: 12px; }

#mcp-review-discovery { margin: 18px 0; padding: 16px; border: 1px solid #dfe5dd; border-radius: 10px; overflow-wrap: anywhere; }
#mcp-review-discovery h4 { margin: 0 0 10px; }
#mcp-review-discovery p { margin: 8px 0; }
#mcp-review-discovery ul { padding-left: 20px; }

@media (max-width: 760px) {
  .app-header { padding: 13px 16px; }
  .main-content { padding: 22px 16px 48px; }
  .page-heading, .section-heading { align-items: stretch; flex-direction: column; }
  .page-heading h1 { font-size: 27px; }
  .page-heading .button { align-self: flex-start; }
  .filters { width: 100%; min-width: 0; }
  .action-layout, .conversation-layout { grid-template-columns: 1fr; }
  .action-layout .surface { order: 2; }
  .conversation-list { display: flex; overflow: auto; max-height: none; }
  .conversation-item { min-width: 200px; max-width: 260px; flex: 0 0 auto; }
  .card-top { flex-wrap: wrap; }
  .support-weekly { grid-template-columns: 1fr; }
  .support-settings-intro, .support-schedule-heading { align-items: stretch; flex-direction: column; }
  .support-site-picker, .support-timezone { width: 100%; }
  .ai-settings-fields { grid-template-columns: 1fr; }
  .credential-list { grid-template-columns: 1fr; }
  .site-layout { grid-template-columns: 1fr; }
  .site-list { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .site-item { min-width: 170px; max-width: 230px; flex: 0 0 auto; }
  .site-form-grid { grid-template-columns: 1fr; }
  .knowledge-layout { grid-template-columns: 1fr; }
  .knowledge-site-picker { width: 100%; }
  .database-site-picker { width: 100%; }
  .database-fields, .database-toggles { grid-template-columns: 1fr; }
  .mcp-review-form { grid-template-columns: 1fr; }
  .mcp-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcp-review-steps { grid-template-columns: 1fr; }
  .action-policies-list { grid-template-columns: 1fr; }
}
@media (max-width: 490px) {
  .brand small { display: none; }
  .session-controls { gap: 5px; }
  .session-user { max-width: 110px; font-size: 11px; }
  .login-card { padding: 26px; }
  .filters { flex-direction: column; }
  .filters input, .filters select { width: 100%; }
  .card { padding: 16px; }
  .card-actions > * { flex: 1; }
  .card-actions select { width: 100%; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .support-settings { padding: 16px; }
  .credential-settings { padding: 16px; }
  .credential-row { flex-direction: column; }
  .credential-row-actions { justify-content: flex-start; }
  .credential-models-grid { grid-template-columns: 1fr; }
  .credential-actions { align-items: stretch; flex-direction: column-reverse; }
  .credential-actions .button { width: 100%; }
  .site-form { padding: 16px; }
  .site-form-heading { align-items: flex-start; flex-direction: column; }
  .site-form-actions { flex-direction: column; }
  .site-form-actions .button { width: 100%; }
  .knowledge-form { padding: 16px; }
  .knowledge-form-actions { align-items: stretch; flex-direction: column; }
  .knowledge-form-actions .button { width: 100%; }
  .database-form { padding: 16px; }
  .database-form-heading { flex-direction: column; }
  .database-form-actions { align-items: stretch; flex-direction: column; }
  .database-form-actions .button { width: 100%; }
  .retention-settings, .mcp-review { padding: 16px; }
  .retention-fields, .mcp-review-grid { grid-template-columns: 1fr; }
  .retention-actions { align-items: stretch; flex-direction: column; }
  .retention-actions .button, .mcp-review-actions .button { width: 100%; }
  .action-policies { padding: 16px; }
  .action-policies-heading { align-items: flex-start; flex-direction: column; }
  .action-policy-actions { align-items: stretch; flex-direction: column; }
  .action-policy-actions .button { width: 100%; }
  .support-mode { grid-template-columns: 1fr; }
  .support-day-heading { align-items: flex-start; flex-direction: column; }
  .support-interval { flex-wrap: wrap; }
  .support-interval input { flex: 1 1 70px; }
  .support-settings-actions { align-items: stretch; flex-direction: column; }
  .support-settings-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

/* Heloow: preto tinta, marfim e prata com cor reservada para estados. */
@font-face { font-family: Manrope; src: url('/fonts/manrope-400.ttf') format('truetype'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url('/fonts/manrope-500.ttf') format('truetype'); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url('/fonts/manrope-600.ttf') format('truetype'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url('/fonts/manrope-700.ttf') format('truetype'); font-style: normal; font-weight: 700; font-display: swap; }
:root {
  color-scheme: light;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
  --heloow-bg: #f6f6f3;
  --heloow-surface: #fff;
  --heloow-surface-raised: #fafaf8;
  --heloow-surface-soft: #f0f1ee;
  --heloow-text: #3d423e;
  --heloow-text-strong: #141715;
  --heloow-muted: #6b716c;
  --heloow-border: #e2e4df;
  --heloow-accent: #555b56;
  --heloow-accent-soft: #eeefeb;
  --heloow-ivory: #e8e8e2;
  color: var(--heloow-text);
}
body { background: var(--heloow-bg); }
:focus-visible { outline: 3px solid #555d56; outline-offset: 3px; }
.app-shell { background: var(--heloow-bg); }
.app-header { min-height: 76px; padding: 12px 30px; background: #111314; border-bottom: 1px solid #262c27; }
.brand { gap: 11px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; border: 0; background: none; box-shadow: none; color: #f4f4f0; }
.brand strong { font-size: 20px; font-weight: 600; letter-spacing: -.055em; color: #f9faf6; }
.brand small { font-size: 11px; color: #b8c0b7; }
.session-user { color: #c6cec3; }
.app-header .button-quiet { color: #f5f5f1; border: 1px solid #353a35; padding-inline: 19px; }
.app-header .button-quiet:hover { background: #2a302a; }
.main-content { width: 100%; margin: 0; padding: 0; }
.app-footer { background: #111314; border-top: 1px solid #282d29; color: #b3bcb2; }
.notice { position: fixed; z-index: 30; top: 92px; right: 28px; width: min(390px, calc(100vw - 28px)); margin: 0; background: #eaf2d7; border-color: #bed58d; color: #28451b; border-radius: 14px; box-shadow: 0 16px 36px #11131420; }
.notice.is-error { background: #fff0ef; border-color: #e4b6b0; color: #8b302b; }
.dashboard-view { display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: calc(100vh - 76px); }
.dashboard-view[hidden] { display: none; }
.page-heading { grid-column: 2; grid-row: 1; align-items: center; margin: 0; padding: 44px 48px 30px; border-bottom: 1px solid var(--heloow-border); background: #fff; }
.page-heading h1 { margin: 10px 0; font-size: clamp(31px, 2.8vw, 42px); font-weight: 600; letter-spacing: -.055em; }
.page-heading p { max-width: 720px; color: var(--heloow-muted); font-size: 14px; }
.eyebrow { color: #676e68; font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.page-heading .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.page-heading .eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #bfc2bc; box-shadow: 0 0 0 3px #edeeea; }
.tabs { grid-column: 1; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: stretch; align-self: stretch; gap: 4px; overflow: visible; margin: 0; padding: 34px 14px; background: #111314; border: 0; }
.tabs::before { content: "ESPAÇO DE TRABALHO"; margin: 0 14px 16px; color: #8e948e; font-size: 10px; font-weight: 600; letter-spacing: .15em; }
.tab { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 45px; padding: 11px 14px; border: 1px solid transparent; border-radius: 11px; color: #c4c8c3; text-align: left; font-size: 13px; font-weight: 500; }
.tab:hover { background: #242b25; color: #fff; }
.tab.is-active { background: #e8e9e4; color: #151815; border-color: #e8e9e4; font-weight: 600; }
.count { margin: 0; border: 0; background: #343936; color: #f6f6f3; }
.tab.is-active .count { background: #d2d5ce; color: #1a1e1b; }
.view { grid-column: 2; grid-row: 2; min-width: 0; padding: 38px 48px 78px; }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin-bottom: 7px; font-size: clamp(24px, 2vw, 30px); font-weight: 600; letter-spacing: -.045em; }
.section-heading p { font-size: 14px; }
.button { min-height: 43px; border-radius: 11px; font-weight: 600; }
.button-primary { background: #111714; color: #fff; }
.button-primary:hover:not(:disabled) { background: #343a36; }
.button-secondary { background: #fff; border-color: #d0d3cc; color: #272c28; }
.button-secondary:hover:not(:disabled) { background: #f2f3f0; border-color: #aeb4ab; }
.button-quiet { color: #414842; }
.button-quiet:hover:not(:disabled) { background: #eff0ed; }
.button-danger { background: #fff4f2; border-color: #e6b8b2; color: #a13d35; }
.button-danger:hover:not(:disabled) { background: #ffe7e3; }
.button-small { min-height: 36px; }
label { color: #343a35; font-weight: 600; }
input, select, textarea { border-color: #d0d4cc; border-radius: 11px; background: #fff; color: #1e241f; }
input:hover, select:hover, textarea:hover { border-color: #9da49b; }
input:focus, select:focus, textarea:focus { border-color: #606862; }
input::placeholder, textarea::placeholder { color: #858b85; }
.card, .surface, .empty-state { border-color: var(--heloow-border); border-radius: 18px; box-shadow: 0 7px 24px rgba(21, 29, 21, .035); }
.card, .surface { background: #fff; }
.card { padding: 24px; }
.card-description { color: #4c5850; }
.card-subtitle, .meta { color: var(--heloow-muted); }
.meta-grid strong { color: #3e4b40; }
.status-pill { border-color: #d4dcd0; background: #f3f5ef; color: #3a463c; }
.status-open, .status-pending { border-color: #f0d5a0; background: #fff5df; color: #765211; }
.status-in_progress, .status-approved, .status-executing { border-color: #cbd9ed; background: #eaf2ff; color: #315d91; }
.status-closed, .status-executed { border-color: #badfc6; background: #e9f8ed; color: #276940; }
.status-rejected, .status-failed { border-color: #eac2c2; background: #fff0ef; color: #963c3c; }
.summary-chip { background: #fff; color: #4c5b4d; }
.rule-grid div, .credential-row, .site-item, .action-policy-card, .knowledge-item, .support-day { background: #fbfcf8; border-color: var(--heloow-border); border-radius: 14px; }
.rule-grid dt { color: #667566; }
.rule-grid dd { color: #263228; }
.conversation-item { background: #fff; border-radius: 14px; }
.conversation-item:hover, .conversation-item.is-selected, .site-item:hover, .site-item.is-selected { background: #f1f2ee; border-color: #aeb4aa; }
.conversation-message { background: #f2f4ee; border-color: #e0e5db; color: #273027; border-radius: 15px 15px 15px 4px; }
.conversation-message[data-role="user"] { background: #eceee9; border-color: #d4d8d1; color: #252a26; border-radius: 15px 15px 4px 15px; }
.conversation-message[data-role="human"] { background: #edf2e8; border-color: #d4dfce; color: #293b2c; }
.conversation-message small { color: #667269; }
.support-reply-note, .site-toggles label, .database-toggles label, .ai-settings, .support-mode-option, .action-policy-sites, .database-membership { background: #fafbf7; border-color: var(--heloow-border); }
.support-mode-option:hover, .support-mode-option:has(input:checked) { background: #f2f3f0; border-color: #aeb4aa; }
.support-mode legend, .support-mode-option strong { color: var(--heloow-text-strong); }
.support-human-fields-note { background: #f3f4f1; color: #4f5851; border-color: #d5d9d2; }
.credential-form { background: #f8f9f6; border-color: #cbd0c7; }
.credential-badge { border-color: #ddb8b8; background: #fff4f2; color: #934d46; }
.credential-badge.is-ready { border-color: #a7cea7; background: #edf8ed; color: #376b43; }
.button-link { color: #353d36; }
.code-block, .knowledge-preview, .mcp-review-steps > div { background: #f6f8f2; border-color: #dce5d5; color: #2a352c; }
.knowledge-preview pre, .knowledge-detail pre { color: #27342b; }
.knowledge-form .helper.is-error { color: #963c3c; }
.mcp-review-warning { background: #fff5e5; color: #75501e; border-color: #e7cc9a; }
.dialog { background: #fff; border-color: #d7dfd3; border-radius: 20px; color: var(--heloow-text); box-shadow: 0 35px 90px #11131455; }
.dialog::backdrop { background: #10171299; }
.field-error { color: #a23a35; }
.login-view { min-height: calc(100vh - 142px); background: radial-gradient(circle at 50% 0, #edeeea, transparent 40%), var(--heloow-bg); }
.login-card { background: #fff; border: 1px solid var(--heloow-border); border-radius: 22px; box-shadow: 0 24px 80px #1d2a1d12; }
.login-card h1 { font-size: 36px; font-weight: 600; }
.login-card .button-primary { margin-top: 8px; }

@media (max-width: 980px) {
  .dashboard-view { display: block; }
  .page-heading { padding: 32px 28px 25px; }
  .tabs { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; padding: 11px 20px; }
  .tabs::before { display: none; }
  .tab { width: auto; min-height: 42px; flex: 0 0 auto; padding: 9px 13px; }
  .view { padding: 30px 28px 64px; }
}
@media (max-width: 600px) {
  .app-header { padding: 10px 16px; }
  .page-heading { padding: 26px 18px 22px; align-items: flex-start; }
  .page-heading h1 { font-size: 31px; }
  .page-heading .button { align-self: flex-start; }
  .tabs { padding: 9px 12px; }
  .view { padding: 26px 16px 54px; }
  .notice { top: 82px; right: 14px; width: calc(100vw - 28px); }
  .login-view { padding: 24px 16px; }
  .login-card { padding: 26px 22px; }
}

/* Painel real alinhado à vitrine do produto: rail, inbox, conversa e contexto. */
html, body { height: 100%; }
.app-shell { height: 100dvh; min-height: 0; display: grid; grid-template-rows: 48px minmax(0, 1fr); }
.app-header { position: relative; min-height: 48px; height: 48px; padding: 0 17px; background: #1b1f21; border-color: #343a3c; }
.brand-mark { width: 30px; height: 30px; }
.brand { gap: 7px; }
.brand strong { font-size: 15px; }
.brand small { display: none; }
.header-location { position: absolute; left: 50%; transform: translateX(-50%); color: #9da5a4; font-size: 11px; letter-spacing: .025em; }
.session-controls { gap: 10px; }
.session-user { font-size: 11px; }
.app-header .button-quiet { min-height: 30px; padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.main-content { height: 100%; min-height: 0; overflow: hidden; }
.app-footer { display: none; }
.dashboard-view { height: 100%; min-height: 0; grid-template-columns: 164px minmax(0, 1fr); grid-template-rows: 69px minmax(0, 1fr); }
.tabs { grid-column: 1; grid-row: 1 / 3; gap: 0; min-height: 0; padding: 14px 8px 12px; overflow-y: auto; background: #121618; border-right: 1px solid #303537; }
.tabs::before { display: none; }
.nav-group { display: grid; gap: 2px; margin-bottom: 18px; }
.nav-group-label { display: block; padding: 0 9px 7px; color: #818b8b; font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.tab { min-height: 38px; padding: 8px 9px; border-radius: 6px; color: #aeb7b6; font-size: 11px; font-weight: 500; }
.tab:hover { background: #252b2d; }
.tab.is-active { background: #2a3032; border-color: #2a3032; color: #e9ece9; font-weight: 600; }
.count, .tab.is-active .count { min-width: 19px; height: 19px; padding: 0 4px; border-radius: 5px; background: #3c4446; color: #e5e9e6; font-size: 10px; }
.nav-user { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid #343a3c; color: #c9cecc; font-size: 10px; overflow-wrap: anywhere; }
.nav-user-avatar { display: grid; place-items: center; flex: 0 0 23px; height: 23px; border-radius: 50%; background: #3d4548; color: #fff; font-size: 10px; }
.page-heading { grid-column: 2; grid-row: 1; min-height: 69px; margin: 0; padding: 12px 22px; background: #fff; border-bottom: 1px solid #dfe3df; }
.page-heading .eyebrow { font-size: 9px; }
.page-heading .eyebrow::before { width: 5px; height: 5px; box-shadow: none; }
.page-heading h1 { margin: 2px 0 1px; font-size: 19px; font-weight: 600; letter-spacing: -.035em; }
.page-heading p { margin: 0; font-size: 11px; line-height: 1.35; }
.page-heading .button { min-height: 34px; padding: 6px 11px; font-size: 11px; }
.view { grid-column: 2; grid-row: 2; min-height: 0; overflow-y: auto; padding: 22px 24px 38px; background: #f2f3ef; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0 0 3px; font-size: 19px; font-weight: 600; }
.section-heading p { font-size: 11px; }
.card, .surface, .empty-state { border-color: #e0e4de; border-radius: 8px; box-shadow: none; }
.card { padding: 17px 19px; }
.surface { padding: 18px; }
.button, input, select, textarea { border-radius: 6px; }
.button { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.button-small { min-height: 30px; padding: 5px 9px; font-size: 11px; }
input, select, textarea { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.filters { min-width: min(430px, 100%); }
.filters input { min-width: 140px; }
.filters select { width: 160px; }
.status-pill { font-size: 10px; }
.login-view { height: 100%; min-height: 0; }
.login-card { width: min(420px, calc(100% - 32px)); border-radius: 11px; padding: 30px; }
.login-card h1 { font-size: 26px; }
.login-card > p { font-size: 13px; }
.password-field { display: flex; align-items: center; border: 1px solid #d0d4cc; border-radius: 6px; background: #fff; }
.password-field:focus-within { border-color: #606862; outline: 2px solid #60686240; }
.password-field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; }
.password-toggle { flex: 0 0 auto; margin-right: 5px; padding: 5px 8px; border: 0; border-radius: 4px; background: #f1f2ef; color: #414943; font-size: 11px; font-weight: 600; }
.password-toggle:hover { background: #e5e8e3; }

.dashboard-view[data-view="conversations"] { grid-template-rows: minmax(0, 1fr); }
.dashboard-view[data-view="conversations"] .page-heading { display: none; }
.dashboard-view[data-view="conversations"] .tabs { grid-row: 1; }
#view-conversations { grid-row: 1; padding: 0; overflow: hidden; }
.conversation-section-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.conversation-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 0; align-items: stretch; height: 100%; min-height: 0; }
.inbox-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #171b1d; color: #e5e9e7; border-right: 1px solid #343a3c; }
.inbox-heading { padding: 20px 16px 12px; }
.inbox-heading span { display: block; margin-bottom: 4px; color: #929b9b; font-size: 10px; }
.inbox-heading strong { display: block; color: #f2f4f2; font-size: 16px; font-weight: 600; }
.inbox-summary { display: flex; flex-wrap: wrap; gap: 3px 9px; margin-top: 8px; color: #aab4b1; font-size: 11px; }
.inbox-heading .inbox-summary span { margin: 0; color: inherit; font-size: inherit; }
.inbox-heading .inbox-summary span:last-child { color: #e4e8e5; }
.inbox-sound-toggle { min-height: 34px; margin-top: 11px; padding: 6px 10px; border: 1px solid #485051; border-radius: 7px; background: transparent; color: #e7ebe8; font: inherit; font-size: 11px; cursor: pointer; }
.inbox-sound-toggle:hover { background: #303638; }
.inbox-sound-toggle[aria-pressed="true"] { border-color: #838f8b; background: #303638; }
.inbox-heading .inbox-sound-status { display: block; margin: 6px 0 0; color: #aab4b1; font-size: 10px; line-height: 1.35; }
.tab-counts { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.tab .count-unread, .tab.is-active .count-unread { margin: 0; background: #f0f2ee; color: #151b1a; font-weight: 700; }
.count-unread[hidden] { display: none; }
.inbox-search { width: calc(100% - 24px); min-height: 34px; margin: 0 12px 13px; padding: 7px 10px; border: 1px solid #363d3e; background: #24292b; color: #e9ece9; }
.inbox-search::placeholder { color: #9ca5a5; }
.inbox-search:hover { border-color: #5b6464; }
.inbox-search:focus { border-color: #aeb9b7; }
.conversation-list { display: block; flex: 1; min-height: 0; max-height: none; overflow-y: auto; overflow-x: hidden; }
.conversation-list .empty-state { margin: 12px; padding: 22px 13px; background: #22282a; border-color: #343b3c; color: #aeb7b5; font-size: 11px; }
.conversation-list .empty-state strong { color: #eff1ee; }
.conversation-item { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: start; gap: 9px; width: 100%; min-height: 72px; padding: 13px 10px; border: 0; border-top: 1px solid #2a3032; border-radius: 0; background: transparent; text-align: left; color: #c3cbc9; }
.conversation-item:hover, .conversation-item.is-selected { background: #262c2e; border-color: #2a3032; }
.conversation-item.has-unread { background: #22292a; }
.conversation-item.has-unread:hover, .conversation-item.has-unread.is-selected { background: #30383a; }
.conversation-item.has-unread .inbox-text strong { color: #fff; font-weight: 700; }
.conversation-item.has-unread .inbox-text small { color: #dce3df; font-weight: 600; }
.inbox-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 32px; }
.inbox-unread-count { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 7px; background: #edf2ed; color: #18201c; font-size: 11px; font-weight: 700; }
.inbox-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; background: #424a4b; color: #fff; font-size: 10px; }
.inbox-text { min-width: 0; }
.inbox-text strong, .inbox-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-text strong { margin: 0; color: #edf0ed; font-size: 11px; font-weight: 600; }
.inbox-text small { margin-top: 5px; color: #a6afad; font-size: 10px; line-height: 1.35; }
.conversation-item time { padding-top: 1px; color: #929d9b; font-size: 9px; white-space: nowrap; }
.conversation-detail { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 0; background: #f2f3ef; }
.conversation-detail > .empty-state { margin: auto; width: min(90%, 360px); }
#conversation-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#conversation-content[hidden] { display: none; }
.conversation-heading { display: flex; align-items: center; min-height: 74px; padding: 15px 20px; border-bottom: 1px solid #dfe3df; background: #fff; }
.conversation-heading h3 { max-width: 620px; margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.conversation-heading p { font-size: 10px; }
.conversation-messages { flex: 1; min-height: 0; max-height: none; gap: 13px; padding: 24px 22px; }
.conversation-message { max-width: min(78%, 560px); padding: 11px 13px; border: 1px solid #e0e4de; border-radius: 10px 10px 10px 3px; background: #fff; color: #26302a; font-size: 12px; line-height: 1.55; }
.conversation-message[data-role="user"] { border-color: #d5dad3; border-radius: 10px 10px 3px 10px; background: #dfe3dc; color: #232a25; }
.conversation-message[data-role="human"] { border-color: #dfe4dd; background: #fff; color: #26302a; }
.conversation-message small { margin-top: 7px; font-size: 9px; }
.reply-form { display: flex; align-items: flex-end; gap: 9px; padding: 12px 14px; border-top: 1px solid #dfe3df; background: #fff; }
.reply-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.reply-form textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 110px; resize: vertical; }
.reply-form .button { flex: 0 0 auto; min-height: 42px; margin: 0; }
.support-reply-note { margin: 0; padding: 12px 18px; border: 0; border-top: 1px solid #dfe3df; border-radius: 0; background: #fff; color: #66716a; font-size: 11px; }
.conversation-context { min-width: 0; min-height: 0; overflow-y: auto; border-left: 1px solid #e1e5e0; background: #f9faf7; color: #28302b; }
.conversation-context > details > summary { display: block; padding: 22px 16px 0; list-style: none; color: #828c85; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: default; }
.conversation-context > details > summary::-webkit-details-marker { display: none; }
.conversation-context-body { padding: 0 16px 22px; }
.conversation-context-body > p { margin: 10px 0 18px; color: #7b857e; font-size: 10px; line-height: 1.4; }
.conversation-context dl { margin: 0; }
.conversation-context dl > div { padding: 12px 0; border-bottom: 1px solid #e3e7e1; }
.conversation-context dt, .conversation-context-ticket > span { display: block; color: #818b83; font-size: 10px; }
.conversation-context dd, .conversation-context-ticket strong { display: block; margin: 5px 0 0; color: #273029; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.conversation-context-ticket { margin-top: 19px; padding: 14px; border: 1px solid #e1e5df; border-radius: 7px; background: #fff; }
.conversation-context-ticket small { display: block; margin-top: 7px; color: #68736b; font-size: 10px; }
.conversation-technical { margin-top: 22px; border-top: 1px solid #e0e5df; padding-top: 13px; }
.conversation-technical summary { color: #737d75; font-size: 10px; cursor: pointer; }
.conversation-technical dl { margin-top: 8px; }
.conversation-technical dd { font-family: ui-monospace, Consolas, monospace; font-size: 10px; }

@media (max-width: 1100px) {
  .conversation-layout { grid-template-columns: 235px minmax(0, 1fr) 190px; }
  .dashboard-view { grid-template-columns: 150px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { height: auto; min-height: 100dvh; display: block; }
  .app-header { height: 48px; }
  .main-content { height: auto; overflow: visible; }
  .dashboard-view { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 48px); }
  .tabs { display: flex; flex-direction: row; flex: 0 0 auto; gap: 0; order: 0; min-height: 0; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; border-right: 0; border-bottom: 1px solid #343a3c; }
  .nav-group { display: flex; flex: 0 0 auto; gap: 3px; margin: 0 10px 0 0; padding-right: 10px; border-right: 1px solid #3a4041; }
  .nav-group:last-of-type { border-right: 0; }
  .nav-group-label, .nav-user { display: none; }
  .tab { width: auto; min-height: 34px; flex: 0 0 auto; padding: 7px 10px; }
  .page-heading { order: 1; padding: 13px 18px; min-height: 65px; }
  .view { order: 2; flex: 1; min-height: 0; padding: 18px; overflow: visible; }
  .dashboard-view[data-view="conversations"] .page-heading { display: none; }
  #view-conversations { padding: 0; min-height: calc(100dvh - 96px); }
  .conversation-layout { min-height: calc(100dvh - 96px); grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: minmax(460px, 1fr) auto; }
  .conversation-context { grid-column: 1 / -1; min-height: 0; overflow: visible; }
  .conversation-context > details > summary { display: list-item; padding: 13px 18px; cursor: pointer; }
  .conversation-context-body { padding: 0 18px 16px; }
  .conversation-context dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
}
@media (max-width: 640px) {
  .header-location, .session-user { display: none; }
  .app-header { padding: 0 13px; }
  .view { padding: 16px; }
  #view-conversations { padding: 0; }
  .conversation-layout { display: flex; flex-direction: column; min-height: calc(100dvh - 96px); height: auto; }
  .inbox-pane { flex: 0 0 auto; max-height: 172px; }
  .inbox-heading { padding: 10px 14px 7px; }
  .inbox-heading strong { font-size: 13px; }
  .inbox-search { min-height: 30px; margin-bottom: 8px; }
  .conversation-list { display: flex; min-height: 70px; overflow-x: auto; overflow-y: hidden; }
  .conversation-item { flex: 0 0 210px; min-width: 210px; border-right: 1px solid #2a3032; }
  .conversation-detail { flex: 1 1 auto; min-height: 390px; }
  .conversation-heading { min-height: 64px; padding: 10px 14px; }
  .conversation-heading h3 { font-size: 13px; }
  .conversation-messages { padding: 18px 14px; }
  .conversation-message { max-width: 88%; }
  .reply-form { flex-wrap: wrap; }
  .reply-form textarea { flex-basis: 100%; }
  .conversation-context { flex: 0 0 auto; }
}

/* Conversation shell: inbox, chat and context share the same available height. */
.conversation-layout { grid-template-columns: 250px minmax(0, 1fr); }
.conversation-chat-stage { display: grid; grid-template-columns: minmax(0, 1fr) 220px; min-width: 0; min-height: 0; }
.conversation-item .inbox-avatar { display: grid; place-items: center; overflow-wrap: normal; color: #fff; font-size: 11px; }
.conversation-message { font-size: 14px; }
.conversation-message small { font-size: 11px; }
.conversation-message[data-role="assistant"] .conversation-message-body ul,
.conversation-message[data-role="assistant"] .conversation-message-body ol { margin: 6px 0; padding-left: 21px; }
.conversation-message[data-role="assistant"] .conversation-message-body li + li { margin-top: 3px; }
.conversation-message[data-role="assistant"] .conversation-message-body li > ul,
.conversation-message[data-role="assistant"] .conversation-message-body li > ol { margin: 3px 0 4px; }
.conversation-message[data-role="assistant"] .conversation-message-body a { color: #225f83; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.conversation-heading h3 { font-size: 15px; }
.conversation-heading p, .conversation-context > details > summary, .conversation-context-body > p,
.conversation-context dt, .conversation-context-ticket > span, .conversation-context-ticket small,
.conversation-technical summary { font-size: 12px; }
.conversation-context dd, .conversation-context-ticket strong { font-size: 13px; }
.conversation-mobile-button { display: none; }
.form-disclosure, .advanced-panel { margin: 12px 0; border: 1px solid #dfe4dd; border-radius: 9px; background: #fafbf9; }
.form-disclosure > summary, .advanced-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; list-style: none; color: #2b322c; font-size: 13px; font-weight: 600; cursor: pointer; }
.form-disclosure > summary::-webkit-details-marker, .advanced-panel > summary::-webkit-details-marker { display: none; }
.form-disclosure > summary::after, .advanced-panel > summary::after { content: '+'; color: #616b63; font-size: 18px; font-weight: 400; line-height: 1; }
.form-disclosure[open] > summary::after, .advanced-panel[open] > summary::after { content: '−'; }
.form-disclosure[open] > summary, .advanced-panel[open] > summary { border-bottom: 1px solid #e5e9e3; }
.form-disclosure > :not(summary) { margin-left: 15px; margin-right: 15px; }
.form-disclosure > :last-child { margin-bottom: 15px; }
.form-disclosure > .site-form-grid, .form-disclosure > .site-toggles, .form-disclosure > .ai-settings-fields, .form-disclosure > .ai-test-actions { margin-top: 12px; }
.form-disclosure > label { display: block; margin-top: 12px; }
.form-disclosure > input, .form-disclosure > textarea { width: calc(100% - 30px); }
.form-disclosure > .assistant-identity-option { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid #e1e5df; border-radius: 8px; background: #fff; cursor: pointer; }
.assistant-identity-option input { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: #111314; }
.assistant-identity-option span { display: grid; gap: 3px; min-width: 0; }
.assistant-identity-option strong { color: #202722; font-size: 13px; font-weight: 600; }
.assistant-identity-option small { color: #677269; font-size: 12px; line-height: 1.5; }
.assistant-identity > #assistant-default-name-label { margin-top: 15px; }
.assistant-identity > #assistant-default-name { max-width: 360px; }
.widget-appearance > #widget-launcher-text { max-width: 440px; }
.advanced-panel { margin-top: 14px; }
.advanced-panel > .surface { margin: 12px; border: 0; background: #fff; }
.form-disclosure:focus-within, .advanced-panel:focus-within { border-color: #aab4a9; }

@media (max-width: 1100px) {
  .conversation-layout { grid-template-columns: 235px minmax(0, 1fr); }
  .conversation-chat-stage { grid-template-columns: minmax(0, 1fr) 190px; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .conversation-layout { grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: minmax(460px, 1fr); }
  .conversation-chat-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(460px, 1fr) auto; }
  .conversation-context { grid-column: 1; }
}
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .inbox-sound-toggle { min-height: 44px; }
  .app-shell:has(.dashboard-view[data-view="conversations"]:not([hidden])) { display: grid; grid-template-rows: 48px minmax(0, 1fr); height: 100dvh; min-height: 0; overflow: hidden; }
  .app-shell:has(.dashboard-view[data-view="conversations"]:not([hidden])) .main-content { min-height: 0; height: 100%; overflow: hidden; }
  .dashboard-view[data-view="conversations"] { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
  .dashboard-view[data-view="conversations"] .tabs { order: 0; width: 100%; min-height: 50px; padding: 7px 8px; scrollbar-width: none; }
  .dashboard-view[data-view="conversations"]:has(#view-conversations.is-chat-open) .tabs { display: none; }
  .dashboard-view[data-view="conversations"] .tabs::-webkit-scrollbar { display: none; }
  #view-conversations { order: 1; flex: 1; min-height: 0; height: auto; overflow: hidden; }
  .conversation-layout { display: block; min-height: 0; height: 100%; }
  .inbox-pane { display: flex; height: 100%; max-height: none; }
  .inbox-heading { padding: 18px 16px 10px; }
  .inbox-heading strong { font-size: 18px; }
  .inbox-search { min-height: 40px; margin: 0 12px 9px; font-size: 16px; }
  .conversation-list { display: block; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .conversation-item { grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; flex: none; min-width: 0; max-width: none; width: 100%; min-height: 72px; padding: 12px 14px; border-right: 0; }
  .conversation-item .inbox-avatar { width: 37px; height: 37px; border-radius: 11px; }
  .inbox-text strong { font-size: 14px; }
  .inbox-text small { font-size: 12px; }
  .conversation-item time { font-size: 11px; }
  .conversation-chat-stage { display: none; }
  #view-conversations.is-chat-open .inbox-pane { display: none; }
  #view-conversations.is-chat-open .conversation-chat-stage { display: flex; position: relative; flex-direction: column; height: 100%; min-height: 0; }
  .conversation-detail { flex: 1 1 auto; min-height: 0; height: 100%; }
  #conversation-content { min-height: 0; }
  .conversation-heading { flex: 0 0 auto; gap: 10px; min-height: 62px; padding: 9px 12px; }
  .conversation-heading > div { min-width: 0; flex: 1; }
  .conversation-heading h3 { max-width: 100%; font-size: 14px; }
  .conversation-heading p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .conversation-mobile-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 38px; padding: 6px 9px; border: 1px solid #dbe0da; border-radius: 8px; background: #fff; color: #252d28; font: inherit; font-size: 12px; cursor: pointer; }
  .conversation-back { width: 38px; font-size: 23px; line-height: 1; }
  .conversation-context-toggle { font-size: 12px; }
  .conversation-messages { flex: 1 1 auto; min-height: 0; max-height: none; padding: 15px 12px; overflow-y: auto; overscroll-behavior: contain; }
  .conversation-message { max-width: min(88%, 520px); font-size: 14px; }
  .reply-form { position: sticky; bottom: 0; z-index: 1; flex: 0 0 auto; flex-wrap: nowrap; gap: 7px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }
  .reply-form textarea { flex: 1 1 auto; flex-basis: auto; min-height: 42px; height: 44px; max-height: 90px; font-size: 16px; }
  .reply-form .button { flex: 0 0 auto; padding: 7px 10px; }
  .conversation-context { display: none; position: absolute; inset: 0; z-index: 3; min-height: 0; height: 100%; overflow-y: auto; border-left: 0; background: #f9faf7; }
  #view-conversations.is-context-open .conversation-context:not([hidden]) { display: block; }
  .conversation-context-close { display: flex; justify-content: flex-start; width: 100%; min-height: 50px; padding: 10px 15px; border: 0; border-bottom: 1px solid #e1e5e0; border-radius: 0; font-size: 13px; }
  .conversation-context > details > summary { padding: 19px 18px 4px; list-style: none; cursor: default; }
  .conversation-context dl { display: block; }
  .notice { top: auto; right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); padding: 9px 12px; font-size: 12px; }
}

#human-reply { height: 46px; min-height: 46px; border: 0; border-radius: 0; background: #fff; outline: none; box-shadow: none; }
#human-reply:hover, #human-reply:focus, #human-reply:focus-visible { border: 0; outline: none; box-shadow: none; }
.reply-form .reply-send { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; min-height: 46px; margin: 0; padding: 0; border: 0; border-radius: 25%; background: #111314; color: #fff; }
.reply-form .reply-send:hover:not(:disabled) { background: #343b35; }
.reply-send-icon { display: block; width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.conversation-tools { display: flex; justify-content: flex-end; flex: 0 0 auto; padding: 7px 18px; background: #fff; border-bottom: 1px solid #e2e5df; }
.conversation-tools:not(:has(button:not([hidden]))) { display: none; }
.conversation-tools .button { min-height: 34px; font-size: 12px; }
.ticket-auto-summary { margin-top: 16px; padding: 16px 18px; border: 1px solid #e3e6df; border-radius: 9px; background: #f7f8f4; }
.ticket-auto-summary p { margin: 8px 0 0; white-space: pre-wrap; color: #344039; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.ticket-original-report { margin-top: 13px; color: #748071; font-size: 12px; }
.ticket-original-report summary { cursor: pointer; }
.workspace-view { background: #f3f4f0; }
.workspace-view .section-heading { align-items: end; gap: 24px; }
.workspace-view .section-heading h2 { margin-top: 9px; }
.workspace-view .filters > div { display: grid; gap: 6px; min-width: 160px; }
.workspace-view .filters label { font-size: 11px; color: #647066; }
.workspace-view .filters select { min-width: 160px; }
.workspace-view > .helper { margin: -8px 0 22px; }
.analytics-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.analytics-metric { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 23px; border-radius: 12px; box-shadow: none; }
.analytics-metric > span { color: #56625a; font-size: 12px; }
.analytics-metric > strong { color: #171e19; font-size: clamp(28px, 3vw, 42px); line-height: 1.1; font-weight: 600; letter-spacing: -.05em; }
.analytics-metric > small { color: #7b857e; font-size: 11px; line-height: 1.6; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); gap: 20px; }
.analytics-trend, .analytics-breakdown, .team-directory, .workspace-form { min-width: 0; padding: 25px; border-radius: 12px; box-shadow: none; }
.analytics-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.analytics-card-heading h3, .analytics-breakdown h3, .workspace-form h3 { margin: 8px 0; color: #202b23; font-size: 17px; letter-spacing: -.035em; }
.analytics-card-heading p { margin: 5px 0 0; }
.analytics-total { font-size: 11px; color: #6d786f; white-space: nowrap; }
.analytics-chart { display: flex; align-items: stretch; gap: clamp(2px, .65vw, 10px); height: 210px; margin: 32px 0 12px; padding: 0 5px 0; border-bottom: 1px solid #dfe4dc; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #f0f2ed calc(25% - 1px), #f0f2ed 25%); }
.analytics-bar-column { display: flex; align-items: end; justify-content: center; flex: 1; min-width: 0; height: 100%; }
.analytics-bar { display: block; width: 100%; max-width: 38px; min-height: 3px; border-radius: 5px 5px 0 0; background: #39483e; }
.analytics-bar.is-zero { background: #d9e0d5; }
.analytics-axis { display: flex; justify-content: space-between; color: #8a9686; font-size: 10px; }
.analytics-data { color: #66746a; font-size: 12px; }
.analytics-data summary { padding: 10px 0; cursor: pointer; }
.table-scroll { overflow-x: auto; }
.analytics-data table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.analytics-data th, .analytics-data td { padding: 9px 12px; border-bottom: 1px solid #e9ece5; }
.analytics-data thead { background: #f5f7f2; color: #36473b; }
.analytics-status-row { margin: 25px 0; }
.analytics-status-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #5d6c60; font-size: 12px; }
.analytics-status-row strong { color: #23382a; font-weight: 600; }
.analytics-status-track { overflow: hidden; height: 6px; border-radius: 4px; background: #edf0e9; }
.analytics-status-track span { display: block; height: 100%; border-radius: inherit; background: #697e68; }
.analytics-notes { display: flex; align-items: start; gap: 17px; margin-top: 20px; padding: 22px 25px; border-radius: 12px; background: #e9ede4; box-shadow: none; }
.analytics-notes h3 { margin: 2px 0 8px; font-size: 14px; color: #354c38; }
.analytics-notes p { margin: 0; color: #687563; font-size: 12px; line-height: 1.8; }
.analytics-note-mark { font-size: 24px; color: #6a8065; }
.workspace-subnav { display: flex; gap: 5px; width: fit-content; max-width: 100%; margin-bottom: 20px; padding: 4px; border: 1px solid #e1e5dc; border-radius: 10px; background: #e9ece4; }
.workspace-subtab { min-height: 40px; padding: 9px 16px; border: 0; border-radius: 7px; background: transparent; color: #6d7a6e; font-size: 12px; }
.workspace-subtab.is-active { background: #fff; color: #1a2b1d; box-shadow: 0 2px 5px #172c1b0b; font-weight: 600; }
.workspace-subtab span { margin-left: 8px; color: #71816e; }
.team-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; gap: 20px; }
.team-layout:not(:has(.workspace-form:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
.team-users-list { margin-top: 25px; }
.team-person { display: flex; align-items: center; gap: 14px; padding: 19px 0; border-top: 1px solid #e9ece5; }
.team-avatar { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; background: #eef1e9; color: #5d735d; font-size: 15px; font-weight: 600; }
.team-person-info { flex: 1; min-width: 0; }
.team-person-info strong { display: block; overflow-wrap: anywhere; color: #253b2a; font-size: 13px; font-weight: 600; }
.team-person-info small { display: block; margin-top: 4px; overflow-wrap: anywhere; color: #7c8b7d; font-size: 11px; }
.team-role-label { display: inline-block; padding: 5px 9px; border: 1px solid #dce4d6; border-radius: 6px; background: #f4f6f0; color: #65765f; font-size: 10px; }
.team-role-label.is-inactive { color: #966e55; background: #fff8ef; border-color: #e8d9c5; }
.workspace-form { display: grid; gap: 10px; }
.workspace-form > label { margin-top: 5px; font-size: 12px; }
.workspace-form > .helper { margin: -2px 0 2px; }
.workspace-form input, .workspace-form select { width: 100%; }
.team-active-label { display: flex; align-items: center; gap: 9px; }
.team-active-label input { width: 17px; height: 17px; min-height: 0; accent-color: #25372b; }
.workspace-form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.team-roles-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.team-role-card { display: flex; align-items: start; flex-direction: column; gap: 9px; padding: 20px; border: 1px solid #e4e9de; border-radius: 11px; background: #fafbf8; }
.team-role-card .analytics-card-heading { align-items: start; flex-wrap: wrap; gap: 8px; width: 100%; }
.team-role-card h4 { margin: 0; color: #304b35; font-size: 14px; }
.team-role-card p { margin: 0; }
.team-permission-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.team-permission-chips span { padding: 4px 7px; border-radius: 5px; background: #edf1e8; color: #70836c; font-size: 10px; }
.team-role-card > .button { margin-top: auto; }
.team-capabilities { margin: 10px 0 0; padding: 0; border: 0; }
.team-capabilities legend { color: #364b3a; font-size: 13px; font-weight: 600; }
.team-capabilities h4 { margin: 21px 0 9px; color: #6a7c65; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.team-capability { display: flex; align-items: start; gap: 9px; padding: 10px 0; border-bottom: 1px solid #edf0e8; cursor: pointer; }
.team-capability input { flex: 0 0 17px; width: 17px; height: 17px; min-height: 0; margin-top: 1px; accent-color: #263c2c; }
.team-capability strong { display: block; color: #455d49; font-size: 12px; font-weight: 500; }
.team-capability small { display: block; margin-top: 3px; color: #85927f; font-size: 11px; line-height: 1.6; }
@media (max-width: 1200px) { .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .team-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .workspace-view .section-heading { align-items: stretch; flex-direction: column; gap: 15px; }
  .workspace-view .filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; width: 100%; }
  .workspace-view .filters > div, .workspace-view .filters select { min-width: 0; width: 100%; }
  .analytics-metrics { gap: 9px; }
  .analytics-metric { gap: 10px; padding: 17px 14px; }
  .analytics-metric > span, .analytics-metric > small { font-size: 11px; }
  .analytics-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .analytics-trend, .analytics-breakdown, .team-directory, .workspace-form { padding: 18px; }
  .analytics-chart { height: 175px; }
  .analytics-notes { padding: 18px; }
  .team-roles-list { grid-template-columns: minmax(0, 1fr); }
  .team-person { flex-wrap: wrap; gap: 10px; }
  .team-person > .team-role-label { margin-left: 50px; }
  .team-person > .button { margin-left: auto; }
  .team-directory > .analytics-card-heading { align-items: start; flex-direction: column; }
  .workspace-subtab { padding-inline: 11px; }
  .conversation-tools { padding: 5px 12px; }
  .conversation-tools .button { min-height: 40px; }
}
@media (max-width: 760px) {
  #human-reply { height: 44px; min-height: 44px; resize: none; }
  .reply-form .reply-send { flex-basis: 44px; width: 44px; height: 44px; min-height: 44px; }
}

/* Ritmo dos formulários de Configurações, isolado das demais áreas do painel. */
#view-settings { --settings-field-gap: 8px; --settings-group-gap: 20px; }
#view-settings > .surface { padding: 24px; }
#view-settings .credential-heading .helper { margin: 8px 0 var(--settings-group-gap); }
#view-settings .credential-form { gap: 0; padding: 20px; }
#view-settings .credential-form h4 { margin: 0 0 var(--settings-group-gap); }
#view-settings .credential-form > label,
#view-settings .credential-form #credential-endpoint-field > label,
#view-settings .credential-models-grid label { display: block; margin-bottom: var(--settings-field-gap); }
#view-settings .credential-form > input,
#view-settings .credential-form #credential-endpoint-field > input { margin-bottom: var(--settings-field-gap); }
#view-settings .credential-form > .helper:not([role="status"]),
#view-settings .credential-form #credential-endpoint-field > .helper { margin: 0 0 var(--settings-group-gap); }
#view-settings .credential-form #credential-endpoint-field,
#view-settings .credential-form #credential-models-field { gap: 0; margin: 0; }
#view-settings .credential-form #credential-models-field h5 { margin: 0 0 var(--settings-field-gap); }
#view-settings .credential-form #credential-models-field > .helper { margin: 0 0 var(--settings-group-gap); }
#view-settings .credential-actions { margin-top: var(--settings-group-gap); }
#view-settings #credential-status { margin: var(--settings-field-gap) 0 0; }
#view-settings #credential-status:empty { display: none; }

#view-settings .support-settings-intro { margin-bottom: var(--settings-group-gap); }
#view-settings .support-site-picker label,
#view-settings .support-timezone label { margin-bottom: var(--settings-field-gap); }
#view-settings .form-disclosure { margin: 0 0 var(--settings-group-gap); padding: 0; }
#view-settings .form-disclosure > summary { padding: 15px 18px; }
#view-settings .form-disclosure > :not(summary) { margin-left: 18px; margin-right: 18px; }
#view-settings .form-disclosure > p.helper:first-of-type { margin-top: 16px; margin-bottom: var(--settings-group-gap); }
#view-settings .form-disclosure > label:not(.assistant-identity-option) { margin-top: var(--settings-group-gap); margin-bottom: var(--settings-field-gap); }
#view-settings .form-disclosure > input { width: calc(100% - 36px); }
#view-settings .form-disclosure > input + .helper { margin-top: var(--settings-field-gap); margin-bottom: var(--settings-group-gap); }
#view-settings .form-disclosure > .assistant-identity-option { margin-top: var(--settings-group-gap); margin-bottom: var(--settings-group-gap); }
#view-settings .ai-settings { margin-top: 0; padding: 0; }
#view-settings .ai-settings-fields { gap: var(--settings-group-gap); }
#view-settings .ai-settings-fields label { margin-bottom: var(--settings-field-gap); }
#view-settings #ai-model-preset-field .helper { min-height: 0; margin: var(--settings-field-gap) 0 0; }
#view-settings .ai-model-advanced { margin-top: var(--settings-group-gap); margin-bottom: var(--settings-group-gap); }
#view-settings .ai-model-advanced > #ai-reasoning-effort-field { margin-top: var(--settings-group-gap); }
#view-settings #ai-reasoning-effort-field label { display: block; margin-bottom: var(--settings-field-gap); }
#view-settings #ai-reasoning-effort-field .helper { margin: var(--settings-field-gap) 0 0; }
#view-settings #ai-model-current:not(:empty) { margin-top: var(--settings-field-gap); }
#view-settings #ai-provider-status:not(:empty) { margin-top: var(--settings-field-gap); }
#view-settings #ai-provider-status:empty { display: none; }
#view-settings .ai-test-actions { margin-top: var(--settings-group-gap); margin-bottom: 18px; }
#view-settings .support-mode { margin: 0 0 24px; }
#view-settings .support-schedule-heading { margin: 0 0 var(--settings-group-gap); }
#view-settings .support-schedule-heading .helper { margin: var(--settings-field-gap) 0 0; }
#view-settings .support-weekly { margin-bottom: 24px; }
#view-settings .support-human-fields > label { display: block; margin-bottom: var(--settings-field-gap); }
#view-settings .support-human-fields > textarea + .helper { margin: var(--settings-field-gap) 0 0; }
#view-settings .support-settings-actions { margin-top: 24px; }
#view-settings .retention-settings h3 { margin-bottom: 0; }
#view-settings .retention-settings > .helper { margin: var(--settings-field-gap) 0 var(--settings-group-gap); }
#view-settings .retention-fields { gap: var(--settings-group-gap); }
#view-settings .retention-fields label { margin-bottom: var(--settings-field-gap); }

@media (max-width: 760px) {
  #view-settings > .surface { padding: 16px; }
  #view-settings .credential-form { padding: 16px; }
}

/* Integrações por site: tarefas em sequência, detalhes técnicos recolhidos. */
#view-integrations .integration-heading { align-items: end; }
#view-integrations .integration-site-picker { width: min(300px, 100%); flex: 0 0 auto; }
#view-integrations .integration-site-picker label,
#view-integrations .integration-fields label { display: block; margin-bottom: 8px; }
#view-integrations .integration-page-status { margin: 0 0 16px; color: #59665b; font-size: 13px; }
#view-integrations .integration-page-status:empty { display: none; }
#view-integrations .control-accounts { max-width: 1020px; margin: 0 0 20px; padding: 0; overflow: hidden; }
#view-integrations .control-accounts > summary { min-height: 58px; padding: 17px 24px; cursor: pointer; color: #26352a; font-size: 14px; font-weight: 650; }
#view-integrations .control-accounts > .helper { margin: 0 24px 20px; }
#view-integrations .control-account-picker { margin: 0 24px 18px; }
#view-integrations .control-account-picker label,
#view-integrations .control-account-fields label { display: block; margin-bottom: 8px; }
#view-integrations .control-account-picker select { width: min(420px, 100%); }
#view-integrations .control-account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
#view-integrations .control-account-fields > div { min-width: 0; }
#view-integrations .control-account-fields input,
#view-integrations .control-account-fields select { width: 100%; }
#view-integrations .control-account-fields .helper { margin-top: 7px; }
#view-integrations #control-account-form { display: grid; gap: 21px; padding: 0 24px 24px; }
#view-integrations #control-account-form fieldset { padding-top: 17px; }
#view-integrations .control-account-sites,
#view-integrations .control-account-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
#view-integrations .control-account-sites label,
#view-integrations .control-account-features label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 11px; border: 1px solid #dfe5dd; border-radius: 8px; background: #f8faf7; font-size: 12px; }
#view-integrations .control-account-sites input,
#view-integrations .control-account-features input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: #25382b; }
#view-integrations .control-account-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e5e9e3; padding-top: 19px; }
#view-integrations .control-account-actions p { margin: 0; color: #59665b; font-size: 12px; }
#view-integrations .integration-content { display: grid; gap: 20px; max-width: 1020px; }
#view-integrations .integration-overview,
#view-integrations .connector-card,
#view-integrations .integration-discovery,
#view-integrations .integration-form,
#view-integrations .integration-install { min-width: 0; padding: 24px; }
#view-integrations .integration-overview,
#view-integrations .integration-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
#view-integrations h3 { margin: 5px 0 8px; color: #1d2820; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
#view-integrations .helper { margin: 0; color: #68736b; font-size: 12px; line-height: 1.55; }
#view-integrations .integration-privacy-state { margin: 11px 0 0; color: #59665b; font-size: 12px; line-height: 1.5; }
#view-integrations .integration-state-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
#view-integrations .integration-state { white-space: nowrap; padding: 6px 10px; border: 1px solid #d9ded6; border-radius: 7px; background: #f4f6f2; color: #59665b; font-size: 11px; }
#view-integrations .integration-state.is-ready { border-color: #c5d7c5; background: #edf5ed; color: #375e41; }
#view-integrations .integration-form { display: grid; gap: 24px; }
#view-integrations .connector-state { margin-top: 18px; padding: 12px 14px; border: 1px solid #dce4dc; border-radius: 10px; background: #f5f8f3; color: #3d5543; font-size: 13px; line-height: 1.5; }
#view-integrations .connector-facts { display: grid; grid-template-columns: minmax(130px, .4fr) minmax(0, 1fr); gap: 9px 16px; margin: 20px 0 0; font-size: 13px; overflow-wrap: anywhere; }
#view-integrations .connector-facts dt { color: #6d786e; }
#view-integrations .connector-facts dd { margin: 0; color: #26352a; }
#view-integrations .connector-installation { margin-top: 18px; color: #68736b; font-size: 12px; line-height: 1.5; }
#view-integrations .connector-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
#view-integrations .connector-actions .button { min-height: 44px; margin: 0; }
#view-integrations .connector-one-time { margin-top: 18px; padding: 15px 17px; border: 1px solid #dce3da; border-radius: 10px; background: #f7faf5; }
#view-integrations .connector-one-time strong,
#view-integrations .connector-one-time code { display: block; }
#view-integrations .connector-one-time strong { margin-bottom: 8px; font-size: 13px; }
#view-integrations .connector-one-time code { padding: 12px; border: 1px solid #d5ddd4; border-radius: 7px; background: #fff; color: #26352a; font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
#view-integrations .connector-one-time p { margin: 10px 0; color: #59665b; font-size: 12px; }
#view-integrations .connector-one-time .button { min-height: 40px; margin: 0; }
#view-integrations #connector-feedback:not(:empty) { margin: 15px 0 0; color: #59665b; font-size: 12px; }
#view-databases .database-remote { max-width: 850px; padding: 24px; }
#view-databases .database-remote h3 { margin: 7px 0 10px; font-size: 18px; font-weight: 600; }
#view-databases .database-remote p { max-width: 620px; color: #59665b; font-size: 13px; line-height: 1.6; }
#view-databases .database-remote .button { min-height: 44px; margin: 8px 9px 0 0; }
#view-databases .database-remote #database-local-status:not(:empty) { margin: 15px 0 0; }
#view-integrations .integration-discovery-controls { display: flex; align-items: end; gap: 12px; margin-top: 22px; }
#view-integrations .integration-discovery-controls > div { flex: 1 1 320px; min-width: 0; }
#view-integrations .integration-discovery-controls label { display: block; margin-bottom: 8px; }
#view-integrations .integration-discovery-controls select { width: 100%; }
#view-integrations .integration-discovery-controls .helper { margin-top: 8px; }
#view-integrations .integration-discovery-controls .button { flex: 0 0 auto; min-height: 44px; margin: 0; }
#view-integrations #integration-discovery-status:not(:empty) { margin-top: 14px; }
#view-integrations .integration-discovery-report { display: grid; gap: 18px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #e5e9e3; }
#view-integrations .integration-discovery-report h4 { margin: 0 0 -8px; color: #26352a; font-size: 14px; font-weight: 600; }
#view-integrations .integration-discovery-summary strong { display: block; margin-bottom: 7px; color: #26352a; font-size: 15px; }
#view-integrations .integration-discovery-frameworks { margin: 0; color: #435047; font-size: 13px; }
#view-integrations .integration-discovery-stats { padding: 12px 14px; border: 1px solid #dfe5dd; border-radius: 10px; }
#view-integrations .integration-discovery-stats summary { cursor: pointer; font-size: 13px; font-weight: 600; }
#view-integrations .integration-discovery-stats dl { display: grid; grid-template-columns: minmax(100px, 1fr) auto; gap: 7px 16px; margin: 14px 0 0; font-size: 12px; }
#view-integrations .integration-discovery-stats dt { color: #67736a; }
#view-integrations .integration-discovery-stats dd { margin: 0; text-align: right; }
#view-integrations .integration-discovery-findings,
#view-integrations .integration-discovery-warning ul,
#view-integrations .integration-discovery-candidate ul { margin: 0; padding-left: 19px; }
#view-integrations .integration-discovery-findings { display: grid; gap: 12px; padding-left: 0; list-style: none; }
#view-integrations .integration-discovery-findings > li,
#view-integrations .integration-discovery-candidate { min-width: 0; padding: 14px 16px; border: 1px solid #dfe5dd; border-radius: 10px; background: #fafbf9; overflow-wrap: anywhere; }
#view-integrations .integration-discovery-findings strong,
#view-integrations .integration-discovery-candidate strong { display: block; color: #29382d; font-size: 13px; }
#view-integrations .integration-discovery-confidence { display: block; margin-top: 3px; color: #69746a; font-size: 11px; }
#view-integrations .integration-discovery-value { margin: 9px 0 0; color: #435047; font-size: 12px; line-height: 1.5; }
#view-integrations .integration-discovery-evidence { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 19px; color: #58665a; font-size: 12px; line-height: 1.5; }
#view-integrations .integration-discovery-warning { padding: 14px 16px; border: 1px solid #e5d6b4; border-radius: 10px; background: #fffaf0; color: #6d552b; font-size: 12px; line-height: 1.55; }
#view-integrations .integration-discovery-warning strong { display: block; margin-bottom: 7px; }
#view-integrations .integration-discovery-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#view-integrations .integration-discovery-candidate { display: grid; align-content: start; gap: 10px; }
#view-integrations .integration-discovery-candidate .button { justify-self: start; margin: 2px 0 0; }
#view-integrations .integration-discovery-candidate ul { color: #58665a; font-size: 12px; line-height: 1.5; }
#view-integrations .integration-discovery-caution { margin: 0; color: #69746a; font-size: 12px; line-height: 1.5; }
#view-integrations .integration-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#view-integrations .integration-fields > div { min-width: 0; }
#view-integrations .integration-fields input,
#view-integrations .integration-fields select,
#view-integrations .integration-fields textarea { width: 100%; }
#view-integrations .integration-fields .helper { margin-top: 8px; }
#view-integrations .integration-template-action { margin-top: 8px; }
#view-integrations .integration-template-action + .helper { margin-top: 8px; }
#view-integrations .integration-session-note { padding: 15px 17px; border: 1px solid #dfe5dd; border-radius: 11px; background: #f7f9f5; }
#view-integrations .integration-session-note strong { display: block; margin-bottom: 8px; color: #2b3d2e; font-size: 13px; font-weight: 600; }
#view-integrations .integration-toggle { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #dce1d9; border-radius: 9px; background: #f8faf6; white-space: nowrap; }
#view-integrations .integration-toggle input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: #25382b; }
#view-integrations fieldset { min-width: 0; margin: 0; padding: 22px 0 0; border: 0; border-top: 1px solid #e5e9e3; }
#view-integrations fieldset legend { padding: 0; color: #26352a; font-size: 14px; font-weight: 600; }
#view-integrations fieldset > .helper { margin: 8px 0 20px; }
#view-integrations .integration-identity-state { margin: 17px 0 0; padding: 10px 13px; border-radius: 9px; background: #f2f4f0; color: #526154; font-size: 12px; }
#view-integrations .integration-operation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#view-integrations .integration-operation-option { display: flex; align-items: start; gap: 9px; padding: 13px; border: 1px solid #dfe4dc; border-radius: 10px; background: #fafbf8; cursor: pointer; }
#view-integrations .integration-operation-option input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; accent-color: #25382b; }
#view-integrations .integration-operation-option strong { display: block; color: #2a382d; font-size: 13px; }
#view-integrations .integration-operation-option small { display: block; margin-top: 3px; color: #68736b; font-size: 12px; line-height: 1.45; }
#view-integrations .integration-advanced { margin: 0; padding: 0; }
#view-integrations .integration-advanced > .helper { margin-top: 16px; margin-bottom: 20px; }
#view-integrations .integration-advanced > label { display: block; margin-top: 0; margin-bottom: 8px; }
#view-integrations .integration-advanced > .integration-fields { margin-top: 0; margin-bottom: 20px; }
#view-integrations .integration-advanced > textarea { width: calc(100% - 30px); min-height: 160px; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
#view-integrations .integration-advanced > textarea + .helper { margin-top: 8px; margin-bottom: 16px; }
#view-integrations .integration-form-actions,
#view-integrations .integration-install-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
#view-integrations .integration-form-actions { padding-top: 20px; border-top: 1px solid #e5e9e3; }
#view-integrations .integration-form-actions > span { flex: 1 1 200px; color: #59665b; font-size: 12px; }
#view-integrations .integration-test-results { display: grid; gap: 7px; margin: -8px 0 0; padding: 0; list-style: none; }
#view-integrations .integration-test-results li { padding: 10px 12px; border: 1px solid #dce3da; border-radius: 8px; background: #f7faf5; color: #3d5642; font-size: 12px; }
#view-integrations .integration-test-results li.is-error { border-color: #e9c8c4; background: #fff6f4; color: #8e5149; }
#view-integrations .integration-form-actions .button,
#view-integrations .integration-install-actions .button { margin: 0; }
#view-integrations .integration-form-actions .button-danger { margin-right: auto; }
#view-integrations .integration-install-options { margin: 20px 0; }
#view-integrations .integration-install-preview { margin: 20px 0; padding: 18px; border: 1px solid #d9dfd7; border-radius: 11px; background: #f8faf6; color: #2d3a30; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
#view-integrations .integration-install-preview h4 { margin: 0 0 11px; font-size: 14px; }
#view-integrations .integration-install-preview dl { display: grid; grid-template-columns: minmax(120px, .4fr) minmax(0, 1fr); gap: 7px 16px; margin: 0; }
#view-integrations .integration-install-preview dt { color: #6d786e; }
#view-integrations .integration-install-preview dd { margin: 0; }
#view-integrations .integration-plan-discovery { margin-top: 17px; padding-top: 16px; border-top: 1px solid #dfe5dd; }
#view-integrations .integration-plan-discovery h5 { margin: 0 0 8px; font-size: 13px; }
#view-integrations .integration-plan-discovery p { margin: 0 0 8px; }
#view-integrations .integration-plan-discovery ul { margin: 8px 0; padding-left: 19px; }
#view-integrations .integration-plan-warning { margin: 14px 0 0; padding: 10px 12px; border: 1px solid #e5d6b4; border-radius: 8px; background: #fff9ed; color: #795d2a; }
#view-integrations #integration-install-status:not(:empty) { margin: 0 0 16px; }

@media (max-width: 760px) {
  #view-integrations .integration-heading,
  #view-integrations .integration-overview,
  #view-integrations .integration-card-heading { align-items: stretch; flex-direction: column; }
  #view-integrations .integration-site-picker { width: 100%; }
  #view-integrations .integration-overview,
  #view-integrations .connector-card,
  #view-integrations .integration-discovery,
  #view-integrations .integration-form,
  #view-integrations .integration-install { padding: 16px; }
  #view-integrations .control-accounts > summary { padding: 16px; }
  #view-integrations .control-accounts > .helper,
  #view-integrations .control-account-picker { margin-left: 16px; margin-right: 16px; }
  #view-integrations #control-account-form { padding: 0 16px 16px; }
  #view-integrations .control-account-fields { grid-template-columns: minmax(0, 1fr); }
  #view-integrations .control-account-actions,
  #view-integrations .connector-actions { align-items: stretch; flex-direction: column; }
  #view-integrations .control-account-actions .button,
  #view-integrations .connector-actions .button { width: 100%; min-height: 44px; }
  #view-integrations .connector-facts { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  #view-integrations .connector-facts dd { margin-bottom: 8px; }
  #view-databases .database-remote { padding: 16px; }
  #view-integrations .integration-discovery-controls { align-items: stretch; flex-direction: column; }
  #view-integrations .integration-discovery-controls > div { flex: 0 0 auto; width: 100%; }
  #view-integrations .integration-discovery-controls .button { width: 100%; }
  #view-integrations .integration-discovery-candidates { grid-template-columns: minmax(0, 1fr); }
  #view-integrations .integration-state-list { justify-content: flex-start; }
  #view-integrations .integration-fields,
  #view-integrations .integration-operation-list { grid-template-columns: minmax(0, 1fr); }
  #view-integrations .integration-install-preview dl { grid-template-columns: minmax(0, 1fr); }
  #view-integrations .integration-form-actions,
  #view-integrations .integration-install-actions { align-items: stretch; flex-direction: column; }
  #view-integrations .integration-form-actions .button,
  #view-integrations .integration-install-actions .button { width: 100%; min-height: 44px; }
  #view-integrations .integration-form-actions > span { flex: 0 0 auto; }
}
