:root {
  --navy: #10162f;
  --ink: #192039;
  --muted: #5d667b;
  --blue: #554be8;
  --blue-dark: #4035c9;
  --canvas: #f3f5fa;
  --line: #e2e7f0;
  --violet-wash: #f1f0ff;
  --green: #176e56;
  --green-wash: #e7f6ef;
  --amber: #9a5b12;
  --amber-wash: #fff4e5;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.5 "Segoe UI Variable", "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
::selection { color: white; background: var(--blue); }
input, textarea { caret-color: var(--blue); }
:root { scrollbar-color: #bec3d5 transparent; }
:focus-visible { outline: 3px solid #a9f5df; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 10px 15px; color: white; background: var(--navy); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.boot-view { min-height: 100vh; display: grid; place-items: center; color: #cbd0ed; background: var(--navy); font-size: 16px; }

.account-view { min-height: 100vh; color: white; background: var(--navy); }
.account-top { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 64px); }
.account-top .brand { margin: 0; }
.account-actions { display: flex; align-items: center; gap: 18px; }
.account-person { display: inline-flex; align-items: center; gap: 12px; color: #cbd0ed; font-size: 13px; font-weight: 650; }
.header-signout, .login-site-link { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 13px; border: 1px solid #747ba1; border-radius: 9px; color: white; background: transparent; text-decoration: none; font-size: 13px; font-weight: 650; }
.header-signout:hover, .login-site-link:hover { border-color: #aaa9f9; background: #252b51; }
.account-content { min-height: calc(100vh - 88px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, .92fr); }
.account-intro { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 80px clamp(28px, 6vw, 104px); overflow: hidden; isolation: isolate; }
.account-intro h1 { max-width: 650px; margin: 0 0 22px; font-size: clamp(42px, 4.5vw, 72px); line-height: 1.04; letter-spacing: -.045em; text-wrap: balance; }
.account-intro p { max-width: 470px; margin: 0; color: #b5bedc; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; }
.account-orbit { position: absolute; z-index: -1; width: min(48vw, 630px); aspect-ratio: 1; right: -14%; top: -26%; opacity: .6; }
.account-orbit span { position: absolute; inset: 0; border: 1px solid #6c70bf; border-radius: 43% 57% 51% 49% / 54% 40% 60% 46%; transform: rotate(-26deg); }
.account-orbit span:nth-child(2) { inset: 14%; border-color: #7770db; transform: rotate(21deg); }
.account-orbit span:nth-child(3) { inset: 29%; border-color: #a7a0ff; transform: rotate(-36deg); }
.account-choices { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(24px, 5vw, 88px); color: var(--ink); background: var(--canvas); }
.account-choices h2 { margin: 0 0 22px; font-size: 25px; letter-spacing: -.035em; }
.account-choices > p { max-width: 430px; margin: 22px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-panel form { width: min(100%, 440px); display: grid; gap: 10px; }
.login-panel h2 { margin: 0; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.2; letter-spacing: -.04em; }
.login-panel form > p:first-of-type { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.login-panel label { margin-top: 7px; color: var(--ink); font-size: 14px; }
.login-panel input { min-height: 50px; padding: 12px 14px; font-size: 16px; }
.login-panel input[aria-invalid="true"] { border-color: #ad3845; outline-color: #f4cdd2; }
.field-error { color: #a52d3b; font-size: 13px; }
.login-panel .form-error { margin: 0; font-size: 13px; }
.login-submit { min-height: 50px !important; margin-top: 12px; font-size: 15px !important; }
.login-help { max-width: 380px; margin: 17px 0 0; color: var(--muted); font-size: 13px; }
.empty-companies { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: white; }
.company-list { display: grid; gap: 10px; }
.company-choice { width: 100%; min-height: 104px; display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 17px; padding: 18px 20px; border: 1px solid #dce1ec; border-radius: 16px; color: var(--ink); background: white; text-align: left; box-shadow: 0 6px 24px rgba(19,26,63,.035); transition: border-color .2s, box-shadow .2s, transform .2s; }
.company-choice:hover, .company-choice:focus-visible { border-color: #a8a3f7; box-shadow: 0 13px 31px rgba(20,24,39,.11); transform: translateY(-2px); }
.company-symbol { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: #e8e7ff; background: #29276c; font-size: 21px; font-weight: 800; }
.company-symbol.eksempelfirma { color: #114e43; background: #b4efdb; }
.company-choice-copy { min-width: 0; display: grid; gap: 3px; }
.company-choice-copy strong { font-size: 17px; letter-spacing: -.02em; }
.company-choice-copy > span { color: var(--muted); font-size: 13px; }
.company-choice-side { display: flex; align-items: center; gap: 15px; }
.company-type { color: #626b80; font-size: 12px; font-weight: 700; }
.company-arrow { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #f1f0ff; color: var(--blue-dark); }
.company-arrow::after { content: ""; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg) translate(-1px,1px); }
.auth-workspace { min-height: 100vh; background: #f5f6fb; }
.auth-workspace-top { position: sticky; z-index: 5; top: 0; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(22px, 4vw, 64px); color: white; background: var(--navy); box-shadow: 0 8px 30px rgba(16,22,47,.08); }
.auth-brand-wrap { display: flex; align-items: center; gap: 22px; min-width: 0; }
.auth-workspace-top .brand { margin: 0; }
.auth-company-name { min-width: 0; max-width: 260px; overflow: hidden; padding-left: 22px; border-left: 1px solid #434a6d; color: #cbd0ed; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.auth-workspace-actions { display: flex; gap: 10px; align-items: center; }
.auth-workspace-actions .quiet-button { min-height: 44px; color: white; border-color: #747ba1; }
.auth-workspace-actions .quiet-button:hover { background: #252b51; }
.auth-workspace-main { width: min(100% - 48px, 1400px); margin: 0 auto; padding: clamp(32px, 4vw, 58px) 0 70px; }
.auth-nav { display: flex; gap: 5px; width: fit-content; margin-bottom: 31px; padding: 5px; border: 1px solid #e1e4ee; border-radius: 12px; background: #ebeef6; }
.auth-nav button { min-height: 40px; padding: 8px 17px; border: 0; border-radius: 8px; color: #5f6880; background: transparent; font-size: 13px; font-weight: 750; }
.auth-nav button:hover { color: var(--blue-dark); }
.auth-nav button[aria-current="page"] { color: var(--ink); background: white; box-shadow: 0 2px 9px rgba(17,25,57,.1); }
.auth-page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
.auth-page-head h1 { margin: 0; font-size: clamp(35px, 4vw, 50px); line-height: 1.08; letter-spacing: -.05em; }
.auth-page-head p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.auth-refresh, .auth-retry { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 16px; border: 1px solid #d4daea; border-radius: 11px; color: var(--ink); background: white; font-size: 13px; font-weight: 750; box-shadow: 0 4px 16px rgba(23,30,64,.035); }
.auth-refresh:hover, .auth-retry:hover { border-color: #aaa9ef; background: #f8f7ff; }
.auth-refresh span { color: var(--blue); font-size: 23px; line-height: .5; }
.auth-inbox { min-height: min(700px, calc(100vh - 260px)); display: grid; grid-template-columns: minmax(300px, 370px) minmax(0,1fr); overflow: hidden; border: 1px solid #dfe3ee; border-radius: 19px; background: white; box-shadow: 0 22px 70px rgba(28,36,75,.065); }
.auth-conversation-panel { min-width: 0; border-right: 1px solid var(--line); }
.auth-panel-head { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.auth-panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.auth-panel-head > span { min-width: 29px; padding: 3px 8px; border-radius: 30px; color: #4435c8; background: #f0efff; font-size: 12px; font-weight: 800; text-align: center; }
.auth-inbox-status { color: var(--muted); font-size: 13px; }
.auth-inbox-status:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.auth-inbox-status p { margin: 0; }
.auth-inbox-status .auth-retry { min-height: 36px; padding: 6px 10px; }
.auth-conversation-list { max-height: min(690px, calc(100vh - 330px)); overflow-y: auto; }
.auth-conversation { width: 100%; min-height: 147px; display: grid; align-content: center; gap: 7px; padding: 17px 21px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; transition: background .16s, box-shadow .16s; }
.auth-conversation:hover { background: #f7f7fe; }
.auth-conversation.active { background: #f3f2ff; box-shadow: inset 3px 0 #6458ed; }
.auth-conversation-top, .auth-conversation-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-conversation-top strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.auth-conversation-top time { flex: 0 0 auto; color: #7b8397; font-size: 11px; }
.auth-conversation-subject { overflow: hidden; font-size: 14px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.auth-conversation-preview { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.auth-conversation-meta { color: #717a90; font-size: 11px; }
.auth-conversation-status { padding: 3px 8px; border-radius: 30px; color: #3d37a5; background: #e8e7ff; font-weight: 800; }
.auth-load-more { width: calc(100% - 32px); min-height: 44px; display: block; margin: 16px; border: 1px solid #d5d9e9; border-radius: 10px; color: var(--blue-dark); background: white; font-size: 13px; font-weight: 750; }
.auth-load-more:hover { background: #f6f5ff; }
.auth-detail-panel { min-width: 0; }
#auth-conversation-detail { min-height: 100%; padding: clamp(23px,3vw,40px); }
.auth-detail-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.auth-detail-head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 31px); line-height: 1.18; letter-spacing: -.04em; overflow-wrap: anywhere; }
.auth-detail-head p { margin: 10px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.auth-detail-status { flex: 0 0 auto; padding: 6px 11px; border-radius: 30px; color: #3d37a5; background: #eeedff; font-size: 12px; font-weight: 800; }
.auth-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 22px 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); color: #777f93; font-size: 12px; }
.auth-message-thread { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.auth-message { max-width: min(100%, 670px); padding: 17px 20px; border: 1px solid #e4e7f0; border-radius: 15px 15px 15px 3px; background: #f6f7fb; }
.auth-message.outbound { margin-left: auto; border-color: #e2dfff; border-radius: 15px 15px 3px 15px; background: #f1efff; }
.auth-message.internal { border-color: #f1dfbf; background: #fffaef; }
.auth-message-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-message-line strong { font-size: 12px; }
.auth-message-line time { color: #777f93; font-size: 11px; }
.auth-message p { margin: 10px 0 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.auth-thread-notice { margin: 0 0 25px; padding: 11px 14px; border-radius: 9px; color: #784c14; background: #fff5e6; font-size: 13px; }
.auth-placeholder { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; color: var(--muted); text-align: center; }
.auth-placeholder-symbol { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid #d8d5ff; border-radius: 18px; color: #6558dd; background: #f4f2ff; font-size: 24px; }
.auth-placeholder h3 { margin: 0 0 7px; color: var(--ink); font-size: 21px; letter-spacing: -.035em; }
.auth-placeholder p { max-width: 380px; margin: 0; font-size: 14px; }
.auth-placeholder .auth-retry { margin-top: 19px; }
.auth-detail-back { display: none; }
.auth-knowledge { min-height: min(700px, calc(100vh - 260px)); display: grid; grid-template-columns: minmax(300px,370px) minmax(0,1fr); overflow: hidden; border: 1px solid #dfe3ee; border-radius: 19px; background: white; box-shadow: 0 22px 70px rgba(28,36,75,.065); }
.auth-knowledge-panel { min-width: 0; border-right: 1px solid var(--line); }
.auth-knowledge-list { max-height: min(690px, calc(100vh - 330px)); overflow-y: auto; }
.auth-knowledge-row { width: 100%; min-height: 116px; display: grid; align-content: center; gap: 8px; padding: 17px 21px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; transition: background .16s; }
.auth-knowledge-row:hover { background: #f7f7fe; }
.auth-knowledge-row.active { background: #f3f2ff; box-shadow: inset 3px 0 #6458ed; }
.auth-knowledge-row-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-knowledge-row-line strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.auth-knowledge-row-preview { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.auth-knowledge-row-date { color: #81889b; font-size: 11px; }
.auth-knowledge-pill { flex: 0 0 auto; padding: 4px 8px; border-radius: 30px; font-size: 11px; font-weight: 800; }
.auth-knowledge-pill.published { color: #176e56; background: #e5f5ed; }
.auth-knowledge-pill.draft { color: #7558a8; background: #f0eaff; }
.auth-knowledge-detail { min-width: 0; }
#auth-knowledge-detail { min-height: 100%; padding: clamp(23px,3vw,40px); }
.auth-knowledge-body { max-width: 760px; margin: 27px 0; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.auth-knowledge-source { margin: 0; padding-top: 19px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.auth-knowledge-source a { color: var(--blue-dark); font-weight: 700; }
.auth-knowledge-form { max-width: 720px; display: grid; gap: 17px; }
.auth-knowledge-form h2 { margin: 0; font-size: clamp(23px,2.4vw,31px); letter-spacing: -.04em; }
.auth-knowledge-form-intro { margin: -10px 0 4px; color: var(--muted); font-size: 13px; }
.auth-knowledge-field { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
.auth-knowledge-field input, .auth-knowledge-field textarea, .auth-knowledge-field select { width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid #d6dbe8; border-radius: 10px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 400; outline-color: #aaa3ff; }
.auth-knowledge-field textarea { min-height: 190px; resize: vertical; line-height: 1.6; }
.auth-knowledge-field input:focus, .auth-knowledge-field textarea:focus, .auth-knowledge-field select:focus { border-color: #8f84f2; }
.auth-knowledge-field [aria-invalid="true"] { border-color: #b23941; }
.auth-knowledge-field-error, .auth-knowledge-feedback { color: #a52d3b; font-size: 12px; font-weight: 500; }
.auth-knowledge-feedback { min-height: 18px; margin: -6px 0; }
.auth-knowledge-hint { margin: -4px 0 0; color: var(--muted); font-size: 12px; }
.auth-knowledge-form > .primary-button { width: fit-content; min-width: 130px; min-height: 44px; }
.auth-connections-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(290px,.7fr); align-items: start; gap: 22px; }
.auth-connection-main, .auth-connections-other { min-width: 0; padding: clamp(22px,3vw,34px); border: 1px solid #dfe3ee; border-radius: 19px; background: white; box-shadow: 0 15px 48px rgba(28,36,75,.045); }
.auth-connection-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.auth-connection-heading h2, .auth-connections-other h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.auth-connection-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.auth-connection-state { flex: 0 0 auto; padding: 6px 10px; border-radius: 30px; color: #71559f; background: #f0eaff; font-size: 11px; font-weight: 800; }
.auth-connection-state.active { color: #176e56; background: #e4f5ec; }
#auth-connections-status:not(:empty) { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
#auth-connections-status p { margin: 0; }
.auth-website-form { display: grid; gap: 17px; }
.auth-website-form textarea[name="allowed_origins"] { min-height: 104px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.auth-field-hint { margin: -10px 0 0; color: var(--muted); font-size: 12px; }
.auth-website-toggle { min-height: 48px; display: flex; align-items: center; gap: 11px; margin-top: 2px; font-size: 13px; font-weight: 700; }
.auth-website-toggle input { width: 19px; height: 19px; margin: 0; accent-color: var(--blue); }
.auth-website-form > .primary-button { width: fit-content; min-width: 160px; min-height: 44px; }
.auth-install { margin-top: 31px; padding-top: 25px; border-top: 1px solid var(--line); }
.auth-install h3, .auth-website-summary h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.auth-install p, .auth-website-summary p, .auth-website-domains p { margin: 7px 0 15px; color: var(--muted); font-size: 13px; }
.auth-embed-code { width: 100%; min-height: 92px; padding: 13px; border: 1px solid #d9ddea; border-radius: 10px; color: #3a3f62; background: #f7f8fc; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; resize: vertical; }
.auth-install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-top: 11px; }
.auth-copy-feedback { color: var(--green); font-size: 12px; }
.auth-website-summary { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-website-domains { padding-top: 21px; }
.auth-website-domains strong { font-size: 13px; }
.auth-website-domains p { margin-bottom: 0; overflow-wrap: anywhere; }
.auth-connections-other h2 { margin-bottom: 16px; font-size: 18px; }
#auth-other-connections { display: grid; gap: 10px; }
.auth-other-connection { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.auth-other-connection-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.auth-other-connection-head h3 { margin: 0; font-size: 14px; }
.auth-other-connection-head span { flex: 0 0 auto; color: #7558a8; font-size: 11px; font-weight: 750; }
.auth-other-connection p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.account-person { max-width: min(36vw, 300px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .account-intro h1 { animation: arrive .55s cubic-bezier(.16,1,.3,1) both; }
  .account-intro p { animation: arrive .55s .08s cubic-bezier(.16,1,.3,1) both; }
  .account-orbit { animation: orbit-arrive .8s cubic-bezier(.16,1,.3,1) both; }
  .auth-inbox { animation: arrive .38s cubic-bezier(.16,1,.3,1) both; }
  .auth-knowledge { animation: arrive .38s cubic-bezier(.16,1,.3,1) both; }
}
@keyframes arrive { from { opacity: .6; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit-arrive { from { opacity: 0; transform: scale(.9) rotate(-8deg); } to { opacity: .6; transform: scale(1) rotate(0); } }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; align-self: start; min-height: 100vh; display: flex; flex-direction: column; gap: 29px; padding: 29px 15px 19px; color: white; background: var(--navy); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; margin-left: 13px; color: white; text-decoration: none; font-size: 24px; font-weight: 800; letter-spacing: -.055em; }
.brand-mark { position: relative; display: inline-block; width: 28px; height: 28px; transform: rotate(-8deg); }
.brand-mark i { position: absolute; inset: 0; border: 2px solid #8d89ff; border-radius: 45% 55% 60% 40% / 55% 42% 58% 45%; }
.brand-mark i:last-child { inset: 6px; background: #8d89ff; border: 0; }
.company-switch { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #424968; border-radius: 12px; color: white; background: #202743; text-align: left; transition: background .18s, border-color .18s; }
.company-switch:hover { border-color: #777fbd; background: #2a3152; }
.company-switch-copy { min-width: 0; flex: 1; }
.company-switch-copy strong, .company-switch-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch-copy strong { font-size: 13px; }
.company-switch-copy small { color: #b1bad8; font-size: 12px; }
.switch-chevron { width: 8px; height: 8px; margin-right: 4px; border-right: 1.5px solid #c8cbe9; border-bottom: 1.5px solid #c8cbe9; transform: rotate(45deg) translateY(-2px); font-size: 0; }
.sidebar-foot { margin-top: auto; padding: 15px 13px 0; border-top: 1px solid #353c5c; color: white; font-size: 13px; font-weight: 700; }
.sidebar-foot span { display: block; color: #aeb7d5; font-size: 12px; font-weight: 400; }
.side-nav { display: grid; gap: 5px; }
.side-nav button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 12px 14px; border: 0; border-radius: 11px; color: #bfc7e3; background: transparent; text-align: left; font-weight: 650; transition: background .18s, color .18s; }
.side-nav button:hover, .side-nav button.active { color: white; background: #30365d; }
.side-nav button span { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 7px; color: #fff; background: var(--blue); font-size: 12px; }
.workspace-avatar { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; background: #d7d5ff; color: var(--navy); font-weight: 800; }

main { min-width: 0; }
.demo-notice { padding: 10px 34px; color: #404477; background: #eae9ff; border-bottom: 1px solid #dcdbf5; font-size: 12px; font-weight: 700; }
.view { max-width: 1600px; margin: auto; }
.page-header { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 34px 22px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1px; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.055em; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.primary-button, .quiet-button, .outline-button, .danger-button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 750; }
.primary-button { color: white; background: var(--blue); border: 1px solid var(--blue); }
.primary-button:hover { background: var(--blue-dark); }
.plus-icon { position: relative; width: 12px; height: 12px; display: inline-block; }
.plus-icon::before, .plus-icon::after { content: ""; position: absolute; background: currentColor; border-radius: 1px; }
.plus-icon::before { width: 12px; height: 2px; left: 0; top: 5px; }
.plus-icon::after { width: 2px; height: 12px; left: 5px; top: 0; }
.quiet-button { color: var(--ink); background: transparent; border: 1px solid transparent; }
.quiet-button:hover { background: #edeff6; }
.outline-button { color: var(--blue-dark); background: white; border: 1px solid #bdbbfa; }
.outline-button:hover { background: #f6f5ff; }
.danger-button { color: #913e42; background: white; border: 1px solid #e5c6c8; }
.danger-button:hover { background: #fff2f2; }

.inbox-layout { min-height: calc(100vh - 160px); display: grid; grid-template-columns: minmax(280px, 345px) minmax(0,1fr); margin: 0 22px 22px; background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 16px 42px rgba(26,35,76,.045); }
.ticket-column { border-right: 1px solid var(--line); min-width: 0; }
.ticket-toolbar { padding: 22px 18px 10px; }
.ticket-toolbar h2 { margin-bottom: 14px; font-size: 16px; letter-spacing: -.03em; }
.filters { display: flex; gap: 4px; padding: 3px; border-radius: 9px; background: #f2f4f8; }
.filters button { flex: 1; padding: 7px 6px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; white-space: nowrap; }
.filters button.active { color: var(--ink); background: white; box-shadow: 0 1px 5px rgba(24,31,61,.1); }
.ticket-list { padding-top: 6px; }
.ticket-row { width: 100%; display: block; padding: 17px 20px; border: 0; border-bottom: 1px solid #edf0f5; background: white; text-align: left; transition: background .18s, box-shadow .18s; }
.ticket-row:hover { background: #f9faff; }
.ticket-row.active { position: relative; background: #f1f0ff; }
.ticket-row.active::before { position: absolute; content: ""; left: 0; top: 0; bottom: 0; width: 1px; background: var(--blue); }
.ticket-row-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.ticket-row-top strong { color: var(--ink); font-size: 13px; }
.ticket-row h3 { margin: 7px 0 4px; font-size: 14px; line-height: 1.3; letter-spacing: -.015em; }
.ticket-row p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 7px; background: #f0f2f6; color: #5c6476; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status.pending_approval { background: var(--violet-wash); color: var(--blue-dark); }
.status.collecting { background: var(--amber-wash); color: var(--amber); }
.status.ready_for_team, .status.needs_team { background: #eaf0fb; color: #355586; }
.status.answered_demo, .status.approved_demo { background: var(--green-wash); color: var(--green); }
.status.rejected { background: #f7ebec; color: #9b4147; }

.case-column { min-width: 0; padding: clamp(22px, 3vw, 42px); }
.case-empty { min-height: 400px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--muted); }
.case-empty h2 { color: var(--ink); }
.case-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.case-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 5px; }
.case-head h2 { max-width: 650px; margin: 0; font-size: clamp(23px, 2.5vw, 31px); line-height: 1.2; letter-spacing: -.035em; }
.case-head p { margin: 0; color: var(--muted); font-size: 12px; }
.case-id { color: var(--muted); font-size: 12px; white-space: nowrap; }
.case-section { padding: 25px 0 0; }
.case-section h3 { margin-bottom: 13px; font-size: 14px; letter-spacing: -.02em; }
.message-card { padding: 19px 21px; border-radius: 13px; background: #f5f7fb; line-height: 1.65; white-space: pre-wrap; }
.answer-panel, .review-panel, .handoff-panel { margin-top: 24px; padding: 22px 23px; border-radius: 13px; }
.answer-panel { background: var(--green-wash); }
.answer-panel h3 { color: var(--green); }
.answer-panel p, .review-panel p, .handoff-panel p { margin-bottom: 12px; line-height: 1.6; }
.source { margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(20,93,67,.18); color: var(--green); font-size: 12px; font-weight: 700; }
.review-panel { background: var(--violet-wash); }
.review-panel h3 { color: var(--blue-dark); }
.handoff-panel { background: #edf3fb; }
.handoff-panel h3 { color: #355586; }
.small-note { color: var(--muted); font-size: 12px; }
.fact-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 24px; margin: 18px 0; }
.fact { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.fact dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.fact dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 750; }
.missing-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 12px 0 0; list-style: none; }
.missing-list li { padding: 5px 8px; border-radius: 7px; background: white; color: var(--amber); font-size: 11px; font-weight: 750; }
.action-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.intake-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
label { display: grid; gap: 6px; color: #3c455b; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid #cfd6e4; border-radius: 9px; background: white; color: var(--ink); font-size: 13px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid #d3d1ff; }
.intake-form .wide { grid-column: 1 / -1; }
.intake-form button { justify-self: start; }
.audit-list { margin: 0; padding: 0 0 0 17px; color: var(--muted); font-size: 12px; }
.audit-list li { margin-bottom: 8px; }
.empty-list { margin: 12px 18px 24px; color: var(--muted); font-size: 13px; }
.mobile-back { display: none; }
.view:not([hidden]) { animation: view-enter .25s cubic-bezier(.16,1,.3,1); }
@keyframes view-enter { from { opacity: .7; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.info-view { padding-bottom: 30px; }
.info-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,340px); gap: 20px; margin: 0 22px; }
.knowledge-entry, .info-aside, .connection-list, .connection-note { background: white; border: 1px solid var(--line); border-radius: 16px; }
.knowledge-entry { padding: 24px 28px; margin-bottom: 12px; }
.knowledge-entry h2, .info-aside h2, .connection-list h2 { margin-bottom: 9px; font-size: 18px; letter-spacing: -.03em; }
.knowledge-entry p, .info-aside p, .connection-list p { margin-bottom: 0; color: var(--muted); }
.info-aside { padding: 24px 26px; align-self: start; }
.info-aside p + p { margin-top: 14px; }
.connection-list { margin: 0 22px; padding: 0 26px; }
.connection-list article { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.connection-list article:last-child { border-bottom: 0; }
.connection-list span { padding: 6px 9px; border-radius: 8px; color: #6a7182; background: #f0f2f6; font-size: 11px; font-weight: 750; }
.connection-note { margin: 14px 22px; padding: 16px 26px; color: var(--muted); font-size: 13px; }

dialog { width: min(500px,calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 25px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); box-shadow: 0 28px 90px rgba(18,24,58,.25); }
dialog::backdrop { background: rgba(12,17,39,.55); }
.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.dialog-top h2 { margin: 0 0 5px; font-size: 23px; letter-spacing: -.04em; }
.dialog-top + p { margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.close-button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #eef0f5; color: var(--ink); font-size: 22px; line-height: 1; }
dialog form { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.form-error { margin: 0; color: #b23941; font-size: 12px; }
.toast { position: fixed; z-index: 20; bottom: 22px; right: 22px; max-width: 380px; padding: 13px 17px; border-radius: 10px; color: white; background: var(--navy); box-shadow: 0 14px 35px rgba(16,20,48,.2); font-size: 13px; animation: toast-enter .22s cubic-bezier(.16,1,.3,1); }
@keyframes toast-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1050px) {
  .app-shell { display: block; }
  .sidebar { position: static; min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 12px 18px; }
  .brand { flex: 0 0 auto; margin: 0; font-size: 21px; }
  .company-switch { width: 205px; margin-left: auto; }
  .side-nav { display: flex; gap: 3px; }
  .side-nav button { width: auto; justify-content: center; padding: 9px 11px; font-size: 12px; }
  .side-nav button span, .sidebar-foot { display: none; }
  .account-content { grid-template-columns: minmax(0,1fr) minmax(380px,.9fr); }
  .auth-connections-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 780px) {
  .account-content { display: block; }
  .account-intro { min-height: 310px; padding: 58px 28px; }
  .account-intro h1 { max-width: 600px; font-size: clamp(38px,7vw,54px); }
  .account-orbit { width: 400px; right: -110px; top: -130px; }
  .account-choices { min-height: calc(100vh - 398px); padding: 44px 28px 60px; }
  .sidebar { flex-wrap: wrap; gap: 10px; }
  .side-nav { order: 3; width: 100%; }
  .side-nav button { flex: 1; }
  .company-switch { width: min(45%,220px); }
  .demo-notice { padding: 8px 17px; }
  .page-header { min-height: 0; padding: 22px 17px; }
  .inbox-layout { display: block; min-height: 0; margin: 0 10px 20px; }
  .ticket-column { border-right: 0; }
  .ticket-list { display: block; }
  .ticket-row { width: 100%; border-bottom: 1px solid var(--line); }
  .ticket-row p { -webkit-line-clamp: 1; margin-bottom: 6px; }
  .case-column { display: none; min-height: 450px; }
  .inbox-layout.show-case .ticket-column { display: none; }
  .inbox-layout.show-case .case-column { display: block; }
  .mobile-back { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; margin: -11px 0 14px; padding: 8px 0; border: 0; color: var(--blue-dark); background: transparent; font-size: 13px; font-weight: 750; }
  .mobile-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
  .info-layout { grid-template-columns: 1fr; margin-inline: 10px; }
  .connection-list, .connection-note { margin-inline: 10px; }
  .auth-workspace-top { flex-wrap: wrap; }
  .auth-workspace-actions { width: 100%; justify-content: space-between; }
  .auth-inbox { display: block; min-height: 470px; }
  .auth-conversation-panel { border-right: 0; }
  .auth-conversation-list { max-height: none; }
  .auth-detail-panel { display: none; }
  .auth-inbox.show-detail .auth-conversation-panel { display: none; }
  .auth-inbox.show-detail .auth-detail-panel { display: block; }
  .auth-detail-back { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 0; border: 0; color: var(--blue-dark); background: transparent; font-size: 13px; font-weight: 750; }
  .auth-detail-back::before { content: ''; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
  .auth-knowledge { display: block; min-height: 470px; }
  .auth-knowledge-panel { border-right: 0; }
  .auth-knowledge-list { max-height: none; }
  .auth-knowledge-detail { display: none; }
  #auth-knowledge-view.show-detail .auth-knowledge-panel { display: none; }
  #auth-knowledge-view.show-detail .auth-knowledge-detail { display: block; }
}
@media (max-width: 520px) {
  .account-top { height: 70px; padding-inline: 20px; }
  .account-person { font-size: 11px; }
  .account-actions { gap: 8px; }
  .header-signout, .login-site-link { padding-inline: 10px; font-size: 12px; }
  .account-content { min-height: calc(100vh - 70px); }
  .account-intro { min-height: 280px; padding: 40px 22px; }
  .account-intro h1 { font-size: clamp(34px,9vw,43px); }
  .account-intro p { font-size: 15px; }
  .account-choices { padding: 38px 18px 50px; }
  .account-choices h2 { font-size: 22px; }
  .company-choice { grid-template-columns: 44px minmax(0,1fr) 27px; gap: 11px; min-height: 96px; padding: 13px; }
  .company-symbol { width: 44px; height: 44px; border-radius: 12px; }
  .company-choice-copy strong { font-size: 15px; }
  .company-choice-copy > span { font-size: 12px; }
  .company-type { display: none; }
  .company-arrow { width: 27px; height: 27px; }
  .sidebar { align-items: start; flex-wrap: wrap; }
  .brand { font-size: 20px; }
  .brand-mark { width: 24px; height: 24px; }
  .company-switch { min-width: 0; width: 160px; padding: 6px; }
  .company-switch-copy strong { font-size: 12px; }
  .company-switch-copy small { font-size: 11px; }
  .side-nav { width: 100%; }
  .side-nav button { flex: 1; }
  .page-header { align-items: start; flex-direction: column; }
  .page-header .primary-button { width: 100%; }
  .fact-list, .intake-form { grid-template-columns: 1fr; }
  .case-head { display: block; }
  .case-id { margin-top: 8px; }
  .case-column { padding: 20px 16px; }
  .connection-list article { align-items: start; flex-direction: column; }
  .auth-workspace-top { gap: 9px; padding: 12px 17px; }
  .auth-brand-wrap { width: 100%; justify-content: space-between; }
  .auth-company-name { max-width: 170px; }
  .auth-workspace-actions { gap: 8px; }
  .auth-workspace-main { width: min(100% - 24px, 1400px); padding-top: 30px; }
  .auth-page-head { align-items: start; }
  .auth-page-head h1 { font-size: 35px; }
  .auth-page-head p { font-size: 13px; }
  .auth-refresh { padding-inline: 10px; }
  .auth-inbox { border-radius: 14px; }
  .auth-message-line { align-items: start; flex-direction: column; gap: 3px; }
  .auth-nav { width: 100%; margin-bottom: 26px; }
  .auth-nav button { flex: 1; }
  .auth-knowledge { border-radius: 14px; }
  .auth-nav button { padding-inline: 6px; font-size: 12px; }
  .auth-connection-main, .auth-connections-other { padding: 21px 18px; border-radius: 14px; }
  .auth-connection-heading { align-items: start; flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view:not([hidden]), .toast { animation: none; }
  .company-choice, .ticket-row, .side-nav button, .company-switch { transition: none; }
  .auth-inbox, .auth-knowledge { animation: none; }
  .auth-conversation, .auth-knowledge-row { transition: none; }
}
