:root {
  color-scheme: light;
  --ink: #10213a;
  --muted: #647286;
  --line: #dce4ee;
  --soft: #f3f6f9;
  --navy: #09203f;
  --blue: #1769e0;
  --blue-dark: #0f52b8;
  --white: #fff;
  --shadow: 0 18px 48px rgba(16, 33, 58, .09);
  font-family: "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f7f9fc; color: var(--ink); }
button, textarea, select { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

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

.skip-link { position: fixed; left: 12px; top: -70px; z-index: 100; padding: 10px 14px; background: var(--white); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.boot { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--navy); color: var(--white); }
.boot span { font-size: 2rem; font-weight: 900; letter-spacing: .2em; }

.brand { display: inline-flex; align-items: baseline; gap: 9px; color: var(--white); text-decoration: none; }
.brand span { font-weight: 900; letter-spacing: .13em; }
.brand small { opacity: .7; font-size: .72rem; }
.brand--dark { color: var(--ink); }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 520px); background: var(--navy); }
.login__intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 7vw, 100px); color: var(--white); }
.login__intro .brand { position: absolute; top: 30px; }
.login__intro .eyebrow { color: #80b7ff; }
.login__intro h1 { max-width: 650px; margin: 0; font-size: clamp(2.1rem, 5vw, 4.7rem); line-height: 1.08; letter-spacing: -.04em; }
.login__intro p:last-child { max-width: 580px; margin: 24px 0 0; color: #c9d7e9; line-height: 1.8; }
.login-card { align-self: center; margin: 28px; padding: clamp(28px, 5vw, 52px); background: var(--white); border-radius: 22px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 18px; font-size: 1.35rem; }
.login-card > small { display: block; margin-top: 18px; color: var(--muted); }
.login-status { min-height: 48px; margin-bottom: 16px; padding: 13px 14px; background: var(--soft); border-radius: 10px; color: var(--muted); line-height: 1.5; }
.google-placeholder, .https-link { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); text-decoration: none; }
.google-placeholder span { color: var(--blue); font-weight: 900; }

.topbar { position: sticky; top: 0; z-index: 40; display: flex; min-height: 66px; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 5vw, 68px); border-bottom: 1px solid rgba(220, 228, 238, .8); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--navy); color: var(--white); font-weight: 800; }
.identity { display: grid; max-width: 220px; }
.identity strong, .identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity small { color: var(--muted); font-size: .7rem; }
.topbar button, .text-button { border: 0; background: none; color: var(--muted); cursor: pointer; }

main { width: min(920px, calc(100% - 34px)); margin: 0 auto; padding: 52px 0 34px; }
.intro { max-width: 760px; margin-bottom: 28px; }
.intro h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.16; letter-spacing: -.045em; }
.intro > p:not(.eyebrow) { margin: 16px 0 0; color: var(--muted); font-size: 1.04rem; }
.consultation { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.consultation__header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.consultation__tools { display: flex; align-items: center; gap: 4px; }
.text-button { padding: 8px; font-size: .78rem; }
.share-picker { display: grid; gap: 9px; margin: 0 24px 14px; padding: 16px; border: 1px solid #bfd1e7; border-radius: 13px; background: #f8fbff; }
.share-picker h3 { margin: 0 0 2px; font-size: 1rem; }
.share-picker label { font-size: .74rem; font-weight: 800; }
.share-picker input, .share-picker select { width: 100%; padding: 9px 10px; border: 1px solid #c5d1df; border-radius: 8px; background: var(--white); color: var(--ink); }
.share-picker select { min-height: 150px; }
.share-picker p { min-height: 1.4em; margin: 0; color: var(--muted); font-size: .75rem; }
.share-picker__actions { display: flex; justify-content: flex-end; gap: 8px; }
.share-picker__actions button { min-height: 40px; padding: 0 13px; border: 1px solid #b9c9db; border-radius: 8px; background: var(--white); cursor: pointer; }
.share-picker__actions button:last-child { border-color: var(--blue); background: var(--blue); color: var(--white); font-weight: 800; }
.share-picker__actions button:disabled { cursor: wait; opacity: .55; }
.conversation { max-height: 620px; overflow: auto; padding: 8px 24px 4px; }
.conversation__empty { padding: 22px; border: 1px dashed #c6d4e4; border-radius: 13px; background: #f9fbfd; text-align: center; }
.conversation__empty strong { display: block; }
.conversation__empty p { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.turn { display: grid; gap: 10px; margin: 10px 0 20px; opacity: 0; transform: translateY(5px); transition: .18s ease; }
.turn.is-visible { opacity: 1; transform: none; }
.message { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 15px 16px; border-radius: 13px; line-height: 1.75; }
.message > span { color: var(--muted); font-size: .74rem; font-weight: 800; }
.message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message--human { margin-left: clamp(0px, 9vw, 78px); background: var(--navy); color: var(--white); }
.message--human > span { color: #a9bfd9; }
.message--osai { margin-right: clamp(0px, 9vw, 78px); border: 1px solid var(--line); background: #f8fafc; }
.message--supervisor { margin-right: clamp(0px, 9vw, 78px); border: 1px solid #b9d8c2; background: #f4fbf6; }
.message__meta { grid-column: 2; color: var(--muted); font-size: .7rem; }
.turn.is-error .message--osai { border-color: #e6b8b8; background: #fff7f7; }
.handoff-action { margin-right: clamp(0px, 9vw, 78px); padding: 14px; border: 1px solid #bfd1e7; border-radius: 12px; background: #fff; }
.handoff-action strong { display: block; margin-bottom: 4px; color: var(--blue-dark); }
.handoff-action p { margin: 4px 0 10px; line-height: 1.6; }
.handoff-action__button { min-height: 42px; padding: 0 14px; border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: var(--white); cursor: pointer; font-weight: 800; }
.handoff-action__button:disabled { cursor: wait; opacity: .55; }
.handoff-action__status { color: var(--muted); font-size: .78rem; }

.shared-conversation { display: grid; gap: 10px; }
.shared-conversation__back { width: fit-content; color: var(--blue-dark); font-size: .82rem; font-weight: 700; }
.shared-conversation h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.035em; }
.shared-conversation > p:not(.eyebrow) { margin: 0 0 8px; color: var(--muted); }
.shared-conversation__items { display: grid; gap: 18px; }
.shared-turn { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); }
.shared-turn__label { margin: 0; color: var(--blue-dark); font-size: .76rem; font-weight: 800; }
.response-feedback { display: grid; gap: 9px; padding: 14px; border: 1px solid #bfd1e7; border-radius: 12px; background: #f8fbff; }
.response-feedback label { color: var(--ink); font-size: .78rem; font-weight: 800; }
.response-feedback select, .response-feedback textarea { width: 100%; padding: 10px 11px; border: 1px solid #c5d1df; border-radius: 9px; background: var(--white); color: var(--ink); }
.response-feedback textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.response-feedback button { width: fit-content; min-height: 40px; padding: 0 14px; border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: var(--white); cursor: pointer; font-weight: 800; }
.response-feedback__status { margin: 0; color: var(--muted); font-size: .76rem; }
.shared-feedback { padding: 13px 14px; border: 1px solid #b9d8c2; border-radius: 11px; background: #f4fbf6; }
.shared-feedback strong { display: block; margin-bottom: 5px; color: #23623a; font-size: .78rem; }
.shared-feedback p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }

.advisor-form { padding: 18px 24px 22px; }
.question-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: .82rem; font-weight: 800; }
.advisor-form > textarea { display: block; width: 100%; min-height: 122px; resize: vertical; padding: 16px; border: 1.5px solid #c5d1df; border-radius: 13px; background: var(--white); color: var(--ink); line-height: 1.65; outline: none; }
.advisor-form > textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23, 105, 224, .1); }
.examples { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.examples button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: #536277; cursor: pointer; font-size: .75rem; }
.examples button:hover { border-color: #9ebce2; color: var(--blue-dark); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.button { min-height: 46px; padding: 0 18px; border-radius: 11px; cursor: pointer; font-weight: 800; }
.button:disabled { cursor: wait; opacity: .55; }
.button--primary { border: 1px solid var(--blue); background: var(--blue); color: var(--white); }
.button--primary:hover { background: var(--blue-dark); }
.button--voice { border: 1px solid #b9c9db; background: var(--white); color: var(--ink); }
.button--voice span { color: #d34242; font-size: .72rem; }
.advisor-status, .voice-status { margin: 10px 0 0; color: var(--muted); font-size: .76rem; text-align: right; }
.voice-status { color: var(--blue-dark); font-weight: 700; }
.evidence-note { display: flex; gap: 8px; padding: 11px 24px; border-top: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: .72rem; }
.evidence-note strong { color: var(--ink); }

.folds { display: grid; gap: 10px; margin-top: 18px; }
.folds details { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.folds summary { display: flex; min-height: 58px; align-items: center; justify-content: space-between; padding: 0 18px; cursor: pointer; font-weight: 800; list-style: none; }
.folds summary::-webkit-details-marker { display: none; }
.folds summary::after { content: "+"; margin-left: 12px; color: var(--blue); font-size: 1.3rem; }
.folds details[open] summary::after { content: "−"; }
.folds summary small { margin-left: auto; color: var(--muted); font-weight: 500; }
.fold-content { border-top: 1px solid var(--line); padding: 18px; }
.short-list { display: grid; gap: 9px; }
.short-list p { margin: 0; color: var(--muted); }
.short-list strong { display: inline-block; min-width: 92px; color: var(--ink); }
.optional-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.optional-fields label { display: grid; gap: 6px; }
.optional-fields label > span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.optional-fields select, .optional-fields textarea { width: 100%; padding: 11px 12px; border: 1px solid #cbd6e2; border-radius: 9px; background: var(--white); color: var(--ink); }
.optional-fields textarea { resize: vertical; }
.six-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 26px; margin: 0; padding-left: 42px; }
.six-items li { padding: 5px 0; }
.six-items strong, .six-items span { display: block; }
.six-items span { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.fold-note { margin: 12px 18px 18px; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.boundary { margin: 22px 4px 0; color: var(--muted); font-size: .73rem; line-height: 1.7; }

footer { display: flex; justify-content: space-between; width: min(920px, calc(100% - 34px)); margin: 0 auto; padding: 18px 0 34px; color: var(--muted); font-size: .72rem; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; max-width: min(390px, calc(100% - 40px)); padding: 13px 16px; border-radius: 10px; background: var(--navy); color: var(--white); box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .login { display: flex; flex-direction: column; justify-content: center; padding: 24px; }
  .login__intro { display: block; padding: 0 4px 24px; }
  .login__intro .brand { position: static; margin-bottom: 54px; }
  .login__intro h1 { font-size: 2.25rem; }
  .login__intro p:last-child { margin-top: 14px; }
  .login-card { width: 100%; margin: 0; padding: 26px; }
  .topbar { padding: 0 14px; }
  .identity { display: none; }
  main { width: min(100% - 24px, 920px); padding-top: 34px; }
  .intro h1 { font-size: 2.15rem; }
  .intro > p:not(.eyebrow) { font-size: .94rem; line-height: 1.7; }
  .consultation { border-radius: 14px; }
  .consultation__header, .advisor-form { padding-left: 15px; padding-right: 15px; }
  .share-picker { margin-left: 15px; margin-right: 15px; }
  .consultation__header { align-items: flex-start; gap: 8px; }
  .consultation__tools { flex-wrap: wrap; justify-content: flex-end; }
  .conversation { padding-left: 15px; padding-right: 15px; }
  .message { grid-template-columns: 44px minmax(0, 1fr); padding: 13px; }
  .message--human, .message--osai, .message--supervisor, .handoff-action { margin-left: 0; margin-right: 0; }
  .shared-turn { padding: 13px; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button { padding: 0 10px; font-size: .82rem; }
  .advisor-status, .voice-status { text-align: left; }
  .optional-fields, .six-items { grid-template-columns: 1fr; }
  .folds summary small { display: none; }
  footer { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body.is-embedded .skip-link,body.is-embedded .intro,body.is-embedded footer,body.is-embedded .boundary{display:none!important}
body.is-embedded .topbar{min-height:44px;padding:0 12px}body.is-embedded .avatar{width:28px;height:28px}
body.is-embedded main{width:calc(100% - 16px);margin:0 8px;padding:8px 0}body.is-embedded .consultation{border-radius:12px;box-shadow:0 5px 18px rgba(16,33,58,.07)}
body.is-embedded .consultation__header{padding:0 12px}
body.is-embedded .conversation{max-height:46vh;padding:4px 10px 2px}body.is-embedded .turn{gap:5px;margin:5px 0 9px}
body.is-embedded .message{grid-template-columns:42px minmax(0,1fr);gap:6px;padding:8px 9px;border-radius:9px;line-height:1.55}
body.is-embedded .message--human,body.is-embedded .message--osai,body.is-embedded .message--supervisor,body.is-embedded .handoff-action{margin-left:0;margin-right:0}
body.is-embedded .advisor-form{padding:8px 12px 10px}body.is-embedded .question-label{margin-bottom:4px}
body.is-embedded .advisor-form>textarea{min-height:76px;padding:9px;border-radius:9px}body.is-embedded .examples{gap:4px;margin-top:5px}
body.is-embedded .examples button{padding:4px 8px;font-size:.68rem}body.is-embedded .form-actions{gap:6px;margin-top:7px}
body.is-embedded .button{min-height:36px;padding:0 10px;border-radius:8px;font-size:.75rem}body.is-embedded .advisor-status,body.is-embedded .voice-status{margin-top:4px;font-size:.67rem}
body.is-embedded .evidence-note{padding:5px 12px}body.is-embedded .folds{gap:5px;margin-top:6px}body.is-embedded .folds summary{min-height:38px;padding:0 11px;font-size:.78rem}body.is-embedded .fold-content{padding:9px}

/* OSAI Utility Portal visual system — this stylesheet is page-local. */
:root {
  --portal-navy: #061633;
  --portal-navy-deep: #020b1c;
  --portal-panel: #071735;
  --portal-blue: #7da5ff;
  --portal-cyan: #8fe5ff;
  --portal-bg: #e9eef5;
  --portal-line: #c7d1df;
  --portal-dark-line: #244b91;
  --portal-text: #10213a;
  --portal-muted: #5d6f89;
  --portal-grid: 32px;
  --portal-radius: 4px;
  --portal-shadow: 0 18px 36px rgba(5, 20, 52, .18);
}

html,
body {
  min-height: 100%;
}

body {
  background-color: var(--portal-bg);
  color: var(--portal-text);
}

button,
a,
summary,
select,
textarea,
input {
  outline-color: var(--portal-blue);
}

.advisor-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100svh;
  background-color: var(--portal-bg);
  background-image:
    linear-gradient(rgba(115, 138, 171, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 138, 171, .12) 1px, transparent 1px);
  background-size: var(--portal-grid) var(--portal-grid);
}

.advisor-shell > .advisor-sidebar,
.advisor-shell > .advisor-main {
  min-width: 0;
}

.advisor-sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  padding: 22px 14px 14px;
  overflow: hidden;
  border-right: 1px solid #19366b;
  background: var(--portal-navy);
  color: #dce8ff;
}

.advisor-sidebar::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .45;
  background-image:
    linear-gradient(rgba(95, 137, 214, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 137, 214, .14) 1px, transparent 1px);
  background-size: var(--portal-grid) var(--portal-grid);
  pointer-events: none;
}

.advisor-sidebar__brand,
.advisor-sidebar__caption,
.advisor-sidebar__label,
.advisor-sidebar__divider,
.advisor-sidebar__lock,
.advisor-sidebar__session,
.advisor-sidebar__footer,
.advisor-nav {
  position: relative;
  z-index: 1;
}

.advisor-sidebar__brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: fit-content;
  padding: 4px 8px 16px;
  color: #fff;
  text-decoration: none;
}

.advisor-sidebar__brand img {
  display: block;
  width: 132px;
  height: auto;
  filter: brightness(0) invert(1);
}

.advisor-sidebar__brand span {
  color: #93afe0;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .19em;
}

.advisor-sidebar__caption {
  margin: 0 8px 14px;
  color: #7693c7;
  font-size: .62rem;
  letter-spacing: .13em;
}

.advisor-nav {
  display: grid;
  gap: 4px;
}

.advisor-nav__item {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 2px;
  color: #b8c8e5;
  font-size: .77rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.advisor-nav__item:hover,
.advisor-nav__item:focus-visible,
.advisor-nav__item.is-active {
  border-color: #1b3b79;
  border-left-color: var(--portal-blue);
  background: #102b61;
  color: #fff;
}

.advisor-nav__icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #36558e;
  color: #95b9ff;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.advisor-nav__item.is-active .advisor-nav__icon,
.advisor-nav__item:hover .advisor-nav__icon {
  border-color: #86b7ff;
  background: #183a78;
  color: #fff;
}

.advisor-sidebar__divider {
  height: 1px;
  margin: 18px 8px 14px;
  background: #1b3a71;
}

.advisor-sidebar__label {
  margin: 0 8px 7px;
  color: #6986bd;
  font-size: .59rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.advisor-sidebar__lock {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  padding: 7px 9px;
  border: 1px solid #163568;
  border-radius: 2px;
  color: #91a9d0;
  font-size: .71rem;
}

.advisor-sidebar__lock > span:first-child {
  color: #7da5ff;
}

.advisor-sidebar__lock small {
  margin-left: auto;
  color: #6986bd;
  font-size: .56rem;
  letter-spacing: .1em;
}

.advisor-sidebar__session {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 13px 8px 11px;
  border-top: 1px solid #1b3a71;
}

.advisor-sidebar__session > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.advisor-sidebar__session strong,
.advisor-sidebar__session small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advisor-sidebar__session strong {
  color: #edf4ff;
  font-size: .68rem;
}

.advisor-sidebar__session small {
  color: #7f9bca;
  font-size: .58rem;
}

.advisor-sidebar__session-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #52dc9c;
  box-shadow: 0 0 12px rgba(82, 220, 156, .75);
}

.advisor-sidebar__avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 1px solid #4775c5;
  background: #102b61;
  color: #fff;
  font-size: .72rem;
}

.advisor-sidebar__footer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  color: #7895c6;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.advisor-sidebar__online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52dc9c;
  box-shadow: 0 0 10px rgba(82, 220, 156, .8);
}

.advisor-main {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  min-width: 0;
  background-color: rgba(233, 238, 245, .86);
  background-image:
    linear-gradient(rgba(115, 138, 171, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 138, 171, .11) 1px, transparent 1px);
  background-size: var(--portal-grid) var(--portal-grid);
}

.advisor-topline {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 clamp(16px, 2.6vw, 34px);
  border-bottom: 1px solid rgba(157, 176, 203, .65);
  color: #607594;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.advisor-topline > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advisor-topline__state {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #47668f;
}

.advisor-topline__state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0b35c;
  box-shadow: 0 0 9px rgba(240, 179, 92, .65);
}

.login__stage {
  position: relative;
  display: grid;
  width: min(1220px, calc(100% - clamp(28px, 5vw, 74px)));
  min-height: min(690px, calc(100svh - 112px));
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(18px, 3vw, 48px);
  margin: clamp(18px, 3vw, 38px) auto 0;
  padding: clamp(24px, 4vw, 52px);
  overflow: hidden;
  border: 1px solid var(--portal-dark-line);
  border-radius: var(--portal-radius);
  background:
    radial-gradient(circle at 25% 20%, rgba(35, 90, 178, .28), transparent 34%),
    linear-gradient(145deg, #020817, #06152f 54%, #09092b);
  box-shadow: var(--portal-shadow);
  color: #fff;
}

.login__stage::before,
.advisor-main--app .consultation::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .32;
  background-image:
    linear-gradient(rgba(67, 118, 206, .2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 118, 206, .2) 1px, transparent 1px);
  background-size: var(--portal-grid) var(--portal-grid);
  pointer-events: none;
}

.login__intro,
.login-card {
  position: relative;
  z-index: 1;
}

.advisor-shell .login__intro {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(8px, 1vw, 18px);
  color: #fff;
}

.login__intro-meta,
.login-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #7f9fd8;
  font-size: .59rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.login__intro-core {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(34px, 8vh, 82px) 0 34px;
}

.advisor-ai-core {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border: 1px solid #5eb8ff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 5%, #b8f1ff 10%, rgba(94, 184, 255, .92) 28%, rgba(31, 92, 208, .86) 55%, rgba(10, 21, 82, .45) 73%, transparent 74%),
    rgba(35, 94, 194, .35);
  box-shadow: 0 0 12px rgba(67, 180, 255, .85), 0 0 32px rgba(46, 119, 255, .42);
  color: #fff;
}

.advisor-ai-core::before,
.advisor-ai-core::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(112, 194, 255, .45);
  border-radius: 50%;
  content: "";
}

.advisor-ai-core::after {
  inset: -10px;
  border-color: rgba(112, 194, 255, .17);
}

.advisor-ai-core > span {
  position: relative;
  z-index: 1;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 0 8px #0a276d;
}

.login__intro-core > div {
  display: grid;
  gap: 4px;
}

.login__intro-core > div > span {
  color: #86b4ff;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.login__intro-core strong {
  font-size: 1rem;
  line-height: 1.35;
}

.advisor-shell .login__intro .eyebrow {
  margin-bottom: 11px;
  color: var(--portal-cyan);
}

.advisor-shell .login__intro h1 {
  max-width: 650px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.25rem, 5.1vw, 4.9rem);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.advisor-shell .login__intro > p:not(.eyebrow) {
  max-width: 590px;
  margin: 22px 0 0;
  color: #b8c8e3;
  font-size: .92rem;
  line-height: 1.85;
}

.login__signals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 30px;
}

.login__signals span {
  padding: 7px 10px;
  border: 1px solid #365994;
  border-radius: 2px;
  color: #9dbdf3;
  font-size: .66rem;
  font-weight: 800;
}

.advisor-shell .login-card {
  align-self: center;
  width: 100%;
  margin: 0;
  padding: clamp(24px, 3.8vw, 38px);
  border: 1px solid #b8c6da;
  border-radius: var(--portal-radius);
  background: #f4f7fb;
  box-shadow: 0 16px 28px rgba(0, 7, 25, .24);
  color: var(--portal-text);
}

.advisor-shell .login-card::before {
  position: absolute;
  top: -1px;
  right: -1px;
  left: -1px;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, #477ff0, #8fe5ff);
}

.advisor-shell .login-card__meta {
  color: #5a78aa;
}

.advisor-shell .login-card h2 {
  margin: 22px 0 9px;
  color: #0b1b35;
  font-size: 1.22rem;
  line-height: 1.35;
}

.login-card__lead {
  margin: 0 0 18px;
  color: #65758c;
  font-size: .78rem;
  line-height: 1.7;
}

.advisor-shell .login-status {
  min-height: 45px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #cbd6e4;
  border-radius: 2px;
  background: #e9eef5;
  color: #64748b;
  font-size: .75rem;
  line-height: 1.5;
}

.advisor-shell .google-placeholder,
.advisor-shell .https-link {
  min-height: 46px;
  border: 1px solid #b8c6da;
  border-radius: 2px;
  background: #fff;
  color: #10213a;
  font-size: .78rem;
  font-weight: 800;
  transition: border-color .16s ease, background-color .16s ease;
}

.advisor-shell .google-placeholder:not(:disabled):hover,
.advisor-shell .https-link:hover {
  border-color: #4b82ed;
  background: #f5f8ff;
}

.advisor-shell .google-placeholder:disabled {
  cursor: wait;
  opacity: .68;
}

.advisor-shell .google-placeholder span {
  color: #3f73d8;
}

.advisor-shell .login-card__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #d7e0eb;
}

.login-card__note > span {
  color: #338765;
  font-weight: 900;
}

.advisor-shell .login-card__note small {
  color: #687990;
  font-size: .68rem;
  line-height: 1.6;
}

.advisor-main__footer {
  display: flex;
  width: min(1220px, calc(100% - clamp(28px, 5vw, 74px)));
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto;
  padding: 14px 0 20px;
  color: #647894;
  font-size: .63rem;
  letter-spacing: .04em;
}

.advisor-main__footer a {
  color: #476b9f;
  font-weight: 800;
  text-decoration: none;
}

.advisor-main__footer a:hover {
  text-decoration: underline;
}

.advisor-main--app .topbar {
  min-height: 62px;
  padding: 0 clamp(16px, 3vw, 42px);
  border-bottom-color: rgba(157, 176, 203, .7);
  background: rgba(242, 246, 251, .9);
  backdrop-filter: blur(12px);
}

.advisor-main--app .brand--dark {
  color: var(--portal-text);
}

.advisor-main--app main {
  width: min(1100px, calc(100% - clamp(24px, 5vw, 74px)));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 60px) 0 30px;
}

.advisor-main--app .intro {
  max-width: 820px;
  margin-bottom: 30px;
}

.advisor-main--app .intro .eyebrow {
  color: #3d70c7;
}

.advisor-main--app .intro h1 {
  color: #0a1a34;
  font-size: clamp(2.1rem, 4.3vw, 4rem);
}

.advisor-main--app .intro > p:not(.eyebrow) {
  max-width: 700px;
  color: #60718a;
  font-size: .95rem;
  line-height: 1.8;
}

.advisor-main--app .consultation {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--portal-dark-line);
  border-radius: var(--portal-radius);
  background: var(--portal-panel);
  box-shadow: var(--portal-shadow);
  color: #fff;
}

.advisor-main--app .consultation > * {
  position: relative;
  z-index: 1;
}

.advisor-main--app .consultation__header {
  min-height: 82px;
  align-items: center;
  gap: 16px;
  padding: 13px clamp(16px, 2.4vw, 28px);
  border-bottom: 1px solid #244b91;
  background: linear-gradient(90deg, rgba(9, 34, 77, .92), rgba(7, 20, 53, .72));
}

.consultation__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 17px;
}

.consultation__identity > div {
  min-width: 0;
}

.consultation__identity .eyebrow {
  margin-bottom: 3px;
  color: #89b4ff;
  font-size: .58rem;
}

.consultation__identity h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(.98rem, 1.8vw, 1.25rem);
  line-height: 1.3;
}

.consultation__identity small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #a9bddc;
  font-size: .68rem;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advisor-main--app .consultation__identity .advisor-ai-core {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.advisor-main--app .consultation__tools {
  flex: 0 0 auto;
}

.advisor-main--app .text-button {
  padding: 7px 9px;
  border: 1px solid #36578e;
  border-radius: 2px;
  color: #b3c9eb;
  font-size: .66rem;
}

.advisor-main--app .text-button:hover {
  background: #102b61;
  color: #fff;
}

.advisor-main--app .share-picker {
  margin: 14px clamp(16px, 2.4vw, 28px);
  padding: 15px;
  border: 1px solid #36578e;
  border-radius: 2px;
  background: #0a1c3c;
}

.advisor-main--app .share-picker h3,
.advisor-main--app .share-picker label {
  color: #eaf3ff;
}

.advisor-main--app .share-picker input,
.advisor-main--app .share-picker select {
  border-color: #36578e;
  border-radius: 2px;
  background: #071735;
  color: #eef6ff;
}

.advisor-main--app .share-picker p {
  color: #9db5d8;
}

.advisor-main--app .share-picker__actions button {
  border-color: #36578e;
  border-radius: 2px;
  background: #0d244e;
  color: #e8f2ff;
}

.advisor-main--app .share-picker__actions button:last-child {
  border-color: #5b96ff;
  background: #2563d8;
}

.advisor-main--app .conversation {
  max-height: 600px;
  padding: 17px clamp(16px, 2.4vw, 28px) 5px;
  border-bottom: 1px solid #244b91;
  background-color: var(--portal-navy-deep);
  background-image:
    linear-gradient(rgba(66, 111, 187, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 111, 187, .14) 1px, transparent 1px);
  background-size: var(--portal-grid) var(--portal-grid);
}

.advisor-main--app .conversation__empty {
  border-color: #36578e;
  border-radius: 2px;
  background: rgba(8, 27, 63, .84);
}

.advisor-main--app .conversation__empty strong {
  color: #edf5ff;
}

.advisor-main--app .conversation__empty p {
  color: #a8bbda;
}

.advisor-main--app .message {
  border-radius: 2px;
  line-height: 1.7;
}

.advisor-main--app .message--human {
  background: #12336e;
  color: #fff;
}

.advisor-main--app .message--human > span {
  color: #b6d1ff;
}

.advisor-main--app .message--osai {
  border-color: #36578e;
  background: #0a1c3c;
  color: #e8f2ff;
}

.advisor-main--app .message--osai > span,
.advisor-main--app .message__meta {
  color: #8fa9d0;
}

.advisor-main--app .message--supervisor {
  border-color: #397a67;
  background: #0b2a2d;
  color: #e6fff7;
}

.advisor-main--app .message--supervisor > span {
  color: #9de2c8;
}

.advisor-main--app .handoff-action {
  border-color: #36578e;
  border-radius: 2px;
  background: #0a1c3c;
}

.advisor-main--app .handoff-action strong {
  color: #9cc4ff;
}

.advisor-main--app .handoff-action p,
.advisor-main--app .handoff-action__status {
  color: #a8bbda;
}

.advisor-main--app .handoff-action__button {
  border-radius: 2px;
  background: #2563d8;
}

.advisor-main--app .advisor-form {
  padding: 18px clamp(16px, 2.4vw, 28px) 20px;
  background: #061633;
}

.advisor-main--app .question-label {
  color: #eaf3ff;
}

.advisor-main--app .advisor-form > textarea {
  min-height: 118px;
  border: 1px solid #36578e;
  border-radius: 2px;
  background: #071735;
  color: #f4f8ff;
}

.advisor-main--app .advisor-form > textarea::placeholder {
  color: #718bb3;
}

.advisor-main--app .advisor-form > textarea:focus {
  border-color: #75b8ff;
  box-shadow: 0 0 0 3px rgba(91, 150, 255, .18);
}

.advisor-main--app .examples button {
  border-color: #36578e;
  border-radius: 2px;
  background: #0c2147;
  color: #a9c0e2;
}

.advisor-main--app .examples button:hover {
  border-color: #7da5ff;
  background: #102b61;
  color: #fff;
}

.advisor-main--app .button {
  border-radius: 2px;
}

.advisor-main--app .button--voice {
  border-color: #36578e;
  background: #0c2147;
  color: #dbe9ff;
}

.advisor-main--app .button--primary {
  border-color: #5d99ff;
  background: #2563d8;
}

.advisor-main--app .button--primary:hover {
  background: #3274ec;
}

.advisor-main--app .advisor-status,
.advisor-main--app .voice-status {
  color: #9fb6d8;
}

.advisor-main--app .voice-status {
  color: #9fe4ff;
}

.advisor-main--app .evidence-note {
  padding: 10px clamp(16px, 2.4vw, 28px);
  border-top: 0;
  background: #081c3d;
  color: #9fb6d8;
}

.advisor-main--app .evidence-note strong {
  color: #eaf3ff;
}

.advisor-main--app .folds {
  margin-top: 18px;
}

.advisor-main--app .folds details {
  border-color: #c7d1df;
  border-radius: 2px;
  background: rgba(255, 255, 255, .88);
  box-shadow: none;
}

.advisor-main--app .folds summary {
  min-height: 54px;
  padding: 0 16px;
  color: #203553;
}

.advisor-main--app .fold-content,
.advisor-main--app .optional-fields select,
.advisor-main--app .optional-fields textarea {
  border-color: #c7d1df;
}

.advisor-main--app .boundary {
  margin-top: 19px;
  color: #60718a;
}

.advisor-main--app > footer:not(.advisor-main__footer) {
  width: min(1100px, calc(100% - clamp(24px, 5vw, 74px)));
  margin: 0 auto;
  padding: 14px 0 26px;
  color: #647894;
  font-size: .65rem;
}

.advisor-main--app > footer:not(.advisor-main__footer) a {
  color: #476b9f;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .advisor-shell {
    grid-template-columns: 204px minmax(0, 1fr);
  }

  .advisor-sidebar__brand img {
    width: 116px;
  }

  .advisor-nav__item {
    font-size: .7rem;
  }

  .login__stage {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 370px);
  }
}

@media (max-width: 820px) {
  .login__stage {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
    gap: 20px;
    padding: 28px;
  }

  .advisor-shell .login__intro h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
  }

  .login__intro-core {
    margin-top: 32px;
  }

  .advisor-main--app .consultation__header {
    align-items: flex-start;
  }

  .consultation__identity small {
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .advisor-shell.login {
    justify-content: flex-start;
    padding: 0;
  }

  .advisor-shell {
    display: flex;
    flex-direction: column;
  }

  .advisor-sidebar {
    min-height: 0;
    height: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #19366b;
  }

  .advisor-sidebar__brand {
    flex: 0 0 auto;
    padding: 0;
  }

  .advisor-sidebar__brand img {
    width: 88px;
  }

  .advisor-sidebar__brand span,
  .advisor-sidebar__caption,
  .advisor-sidebar__divider,
  .advisor-sidebar__label,
  .advisor-sidebar__lock,
  .advisor-sidebar__session,
  .advisor-sidebar__footer {
    display: none;
  }

  .advisor-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .advisor-nav::-webkit-scrollbar {
    display: none;
  }

  .advisor-nav__item {
    min-height: 34px;
    flex: 0 0 auto;
    gap: 6px;
    padding: 4px 7px;
    font-size: .65rem;
    white-space: nowrap;
  }

  .advisor-nav__item br {
    display: none;
  }

  .advisor-nav__icon {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
    font-size: .52rem;
  }

  .advisor-main {
    min-height: calc(100svh - 54px);
  }

  .advisor-topline {
    min-height: 38px;
    padding: 0 13px;
    font-size: .55rem;
  }

  .login__stage {
    display: flex;
    width: calc(100% - 24px);
    min-height: auto;
    flex-direction: column;
    gap: 18px;
    margin: 12px auto 0;
    padding: 19px;
  }

  .advisor-shell .login__intro {
    display: block;
    padding: 3px 3px 0;
  }

  .login__intro-meta {
    font-size: .51rem;
  }

  .login__intro-core {
    margin: 28px 0 26px;
  }

  .advisor-shell .login__intro h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .advisor-shell .login__intro > p:not(.eyebrow) {
    margin-top: 14px;
    font-size: .78rem;
    line-height: 1.7;
  }

  .login__signals {
    margin-top: 18px;
  }

  .login__signals span {
    padding: 6px 8px;
    font-size: .59rem;
  }

  .advisor-shell .login-card {
    padding: 21px 18px 19px;
  }

  .advisor-shell .login-card h2 {
    margin-top: 17px;
    font-size: 1.04rem;
  }

  .advisor-main__footer {
    width: calc(100% - 24px);
    padding: 12px 0 17px;
    font-size: .58rem;
  }

  .advisor-main--app .topbar {
    min-height: 54px;
    padding: 0 13px;
  }

  .advisor-main--app .brand small {
    display: none;
  }

  .advisor-main--app .identity {
    display: none;
  }

  .advisor-main--app main {
    width: calc(100% - 24px);
    padding-top: 27px;
  }

  .advisor-main--app .intro h1 {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }

  .advisor-main--app .intro > p:not(.eyebrow) {
    font-size: .8rem;
    line-height: 1.7;
  }

  .advisor-main--app .consultation__header {
    display: grid;
    gap: 12px;
    padding: 15px;
  }

  .consultation__identity {
    gap: 14px;
  }

  .advisor-main--app .consultation__identity .advisor-ai-core {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .consultation__identity h2 {
    font-size: .96rem;
  }

  .consultation__identity small {
    font-size: .62rem;
  }

  .advisor-main--app .consultation__tools {
    justify-content: flex-start;
  }

  .advisor-main--app .conversation,
  .advisor-main--app .advisor-form {
    padding-right: 15px;
    padding-left: 15px;
  }

  .advisor-main--app .form-actions {
    grid-template-columns: 1fr 1fr;
  }

  .advisor-main--app > footer:not(.advisor-main__footer) {
    width: calc(100% - 24px);
    padding-bottom: 20px;
  }
}

@media (max-width: 600px) {
  .advisor-nav__item > span:last-child {
    display: none;
  }
}

@media (max-width: 430px) {
  .advisor-sidebar {
    gap: 7px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .advisor-sidebar__brand img {
    width: 76px;
  }

  .advisor-nav__item {
    padding-right: 5px;
    padding-left: 5px;
  }

  .advisor-nav__item > span:last-child {
    display: none;
  }

  .advisor-nav__icon {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .advisor-topline > span:first-child {
    max-width: 58%;
  }

  .login__stage {
    padding: 16px;
  }

  .login__intro-core {
    gap: 13px;
  }

  .advisor-shell .login__intro h1 {
    font-size: 2rem;
  }

  .advisor-shell .login-card {
    padding: 19px 15px 17px;
  }

  .advisor-shell .google-placeholder,
  .advisor-shell .https-link {
    font-size: .7rem;
  }

  .advisor-main--app .form-actions {
    grid-template-columns: 1fr;
  }

  .advisor-main--app .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .advisor-nav__item,
  .advisor-shell .google-placeholder,
  .advisor-shell .https-link {
    transition: none;
  }
}

/* Embedded consultation keeps the original compact contract while retaining the new palette. */
body.is-embedded .advisor-shell {
  display: block;
  min-height: 0;
  background: var(--portal-bg);
}

body.is-embedded .advisor-shell > .advisor-sidebar {
  display: none;
}

body.is-embedded .advisor-main {
  min-height: 0;
}

body.is-embedded .advisor-main--app .topbar {
  min-height: 44px;
}

body.is-embedded .advisor-main--app main {
  width: calc(100% - 16px);
  margin: 0 8px;
  padding: 8px 0;
}

body.is-embedded .advisor-main--app .intro,
body.is-embedded .advisor-main--app > footer:not(.advisor-main__footer),
body.is-embedded .advisor-main--app .boundary {
  display: none;
}
