*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --blue: #2a7fff;
  --blue-strong: #1a5fcc;
  --orange: #f97316;
  --orange-strong: #ea580c;
  --dark: #0a0a0f;
  --dark2: #13131f;
  --dark3: #1c1c2e;
  --text: #e8eaf6;
  --muted: #8892b0;
  --border: #2a2a45;
  --error: #f87171;
  --success: #4ade80;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --dark: #eef3f9;
  --dark2: #ffffff;
  --dark3: #e7edf6;
  --text: #172033;
  --muted: #59677e;
  --border: #c8d2e1;
  --error: #b42318;
  --success: #16803d;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--dark);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

body.login-mode {
  overflow-y: auto;
}

body.login-mode .app {
  display: none !important;
}

body.app-mode .login-page {
  display: none !important;
}

body.app-mode {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, #1a2a4a 0%, var(--dark) 70%);
}

.login-logo {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.login-logo img {
  width: 210px;
  max-width: 72vw;
}

.login-logo p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-card {
  width: min(400px, 100%);
  padding: 34px 38px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--dark2);
  box-shadow: 0 0 40px rgba(42, 127, 255, 0.11);
}

.compact-card {
  margin-top: 18px;
}

.login-card h1 {
  margin: 0 0 24px;
  font-size: 1.12rem;
  font-weight: 650;
}

.login-card label {
  display: block;
  margin-bottom: 18px;
}

.login-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-card input,
.password-dialog input,
.system-bar textarea,
.input-area textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--dark3);
  color: var(--text);
  outline: none;
}

.login-card input {
  border-radius: 8px;
  padding: 11px 14px;
}

.login-card input:focus,
.password-dialog input:focus,
.system-bar textarea:focus,
.input-area textarea:focus {
  border-color: var(--blue);
}

.login-error {
  display: none;
  margin: -4px 0 14px;
  color: var(--error);
  font-size: 0.82rem;
}

.login-card button:not(.text-button) {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  color: #ffffff;
  font-weight: 700;
}

.microsoft-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-weight: 800;
  text-decoration: none;
}

.microsoft-button:hover {
  background: #ffffff;
  border-color: rgba(42, 127, 255, 0.55);
}

.text-button {
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #bda8ff;
  font-weight: 650;
}

.text-button:hover {
  color: #ffffff;
}

.login-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.app {
  display: flex;
  flex-direction: row;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(42, 127, 255, 0.08), transparent 34%),
    var(--dark);
}

.app-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.app-sidebar {
  display: flex;
  flex: 0 0 292px;
  flex-direction: column;
  width: 292px;
  min-height: 0;
  padding: 20px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #050507;
  color: #f6f7fb;
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 0 8px;
}

.sidebar-brand h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: transparent;
  color: #ffffff;
}

.icon-button span {
  width: 4px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 8px;
}

.icon-button span + span {
  margin-left: 3px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-link,
.recent-chat {
  border: 0;
  background: transparent;
  color: #f5f5f7;
  text-align: left;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 0.98rem;
}

.sidebar-link:hover,
.recent-chat:hover,
.recent-chat.active {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
}

.sidebar-recents {
  min-height: 0;
  margin-top: 24px;
  overflow-y: auto;
  padding: 0 4px 16px;
}

.sidebar-recents h3 {
  margin: 0 0 10px;
  padding: 0 4px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 750;
}

.recent-chats-empty {
  margin: 6px 4px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.recent-chat {
  display: block;
  width: 100%;
  margin-bottom: 5px;
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--orange));
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
}

.sidebar-account strong,
.sidebar-account span {
  display: block;
}

.sidebar-account strong {
  color: #ffffff;
  font-size: 0.9rem;
}

.sidebar-account span:not(.sidebar-avatar) {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-open-button {
  display: none;
}

body.sidebar-collapsed .app-sidebar {
  flex-basis: 78px;
  width: 78px;
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-brand > div,
body.sidebar-collapsed .sidebar-link span:not(.sidebar-icon),
body.sidebar-collapsed .sidebar-recents,
body.sidebar-collapsed .sidebar-account div {
  display: none;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar-account {
  justify-content: center;
  padding-inline: 0;
}

body.public-booth-mode .app {
  flex-direction: column;
}

body.public-booth-mode .app-sidebar,
body.public-booth-mode .sidebar-open-button,
body.public-booth-mode .system-bar,
body.public-booth-mode .doc-bar {
  display: none !important;
}

body.public-booth-mode .header-actions {
  display: flex !important;
  width: auto;
}

body.public-booth-mode .header-actions > :not(.theme-toggle) {
  display: none !important;
}

body.public-booth-mode .app-main {
  width: 100%;
}

body.public-booth-mode .app-header {
  min-height: 82px;
}

body.public-booth-mode .header-logo {
  flex: 1;
  justify-content: center;
}

body.public-booth-mode .header-logo p {
  text-align: center;
}

.app-header,
.system-bar,
.doc-bar,
.input-area {
  border-color: var(--border);
  border-style: solid;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 20px;
  border-width: 0 0 1px;
  background: var(--dark2);
}

.header-logo,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-mark {
  width: 122px;
  height: 58px;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
}

.header-logo p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.booth-hero {
  display: grid;
  grid-template-columns: 150px minmax(300px, 1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: center;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 22% 20%, rgba(42, 127, 255, 0.2), transparent 34%),
    radial-gradient(circle at 92% 30%, rgba(249, 115, 22, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(42, 127, 255, 0.18), rgba(249, 115, 22, 0.09)),
    var(--dark2);
}

.booth-hero.is-collapsed {
  display: none;
}

.booth-flow-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(19, 19, 31, 0.94);
}

.booth-flow-nav button {
  border: 1px solid rgba(42, 127, 255, 0.42);
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.12);
  color: #cfe1ff;
  padding: 7px 13px;
  font-size: 0.76rem;
  font-weight: 750;
}

.booth-flow-nav button:hover,
.booth-flow-nav button:focus-visible {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.13);
  color: #ffffff;
}

.booth-flow-nav span {
  color: var(--muted);
  font-size: 0.72rem;
}

.booth-poster-panel {
  display: grid;
  align-content: start;
  justify-items: center;
  margin: 0;
  min-width: 0;
}

.booth-copy {
  display: grid;
  align-content: start;
  min-width: 0;
  padding-top: 2px;
}

.booth-scs-logo {
  display: block;
  width: min(100%, 180px);
  max-height: 62px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.24));
}

.event-label {
  margin: 0;
  color: var(--orange);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-badge {
  display: block;
  width: 100%;
  height: auto;
  max-height: 190px;
  border: 1px solid rgba(42, 127, 255, 0.28);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  object-position: center;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.event-badge-fallback {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(42, 127, 255, 0.36);
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.12);
  color: #cfe1ff;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.booth-message {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.advisor-label {
  width: fit-content;
  border: 1px solid rgba(249, 115, 22, 0.38);
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: #fed7aa;
  padding: 5px 10px;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.booth-copy h1 {
  margin: 0;
  max-width: 540px;
  font-size: clamp(1.55rem, 2.35vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.booth-copy p {
  max-width: 560px;
  margin: 0;
  color: #dbe6ff;
  font-size: clamp(0.86rem, 1.05vw, 1rem);
  line-height: 1.3;
}

.contact-label {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(42, 127, 255, 0.36);
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.12);
  color: #9fc5ff;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.guided-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: center;
  max-height: none;
  overflow: visible;
}

.menu-card {
  display: grid;
  gap: 4px;
  min-height: 0;
  border: 1px solid rgba(42, 127, 255, 0.26);
  border-radius: 8px;
  background: rgba(19, 19, 31, 0.86);
  color: var(--text);
  min-height: 76px;
  padding: 14px 16px;
  text-align: left;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.menu-card:hover,
.menu-card:focus-visible {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.13);
}

.menu-card strong {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.2;
}

.menu-card span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.pill,
.ghost-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--dark3);
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pill {
  padding: 5px 12px;
}

.ghost-button {
  padding: 5px 12px;
}

.ghost-button:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.mode-toggle {
  border-color: rgba(42, 127, 255, 0.55);
  color: #cfe1ff;
}

.password-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--dark2);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.portfolio-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: 980px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.chat-search-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
}

.chat-search-results {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-search-result {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--dark3);
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
}

.chat-search-result:hover,
.chat-search-result:focus-visible {
  border-color: var(--blue);
  background: rgba(42, 127, 255, 0.12);
}

.chat-search-result strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-dialog .chat-search-result span {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: none;
}

.portfolio-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.portfolio-heading span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portfolio-heading h2 {
  margin: 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.portfolio-grid label {
  min-width: 0;
}

.portfolio-grid textarea {
  resize: vertical;
}

.portfolio-wide {
  grid-column: 1 / -1;
}

.portfolio-actions {
  justify-content: space-between;
}

#portfolioStatus[data-state="error"] {
  color: #ff8a86;
}

#portfolioStatus[data-state="success"] {
  color: #8bd6ae;
}

.password-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.password-dialog h2 {
  margin: 0 0 20px;
  font-size: 1.05rem;
}

.dialog-help {
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.password-dialog label {
  display: block;
  margin-bottom: 16px;
}

.password-dialog span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.password-dialog input {
  border-radius: 8px;
  padding: 11px 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.dialog-primary {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 750;
}

.privacy-notice {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.assessment-processing-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--dark2);
  color: var(--text);
  padding: 34px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.assessment-processing-dialog::backdrop {
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(5px);
}

.assessment-processing-dialog h2 {
  margin: 18px 0;
  font-size: 1.3rem;
}

.processing-mark {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.processing-mark span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  animation: processing-pulse 1.1s infinite ease-in-out;
}

.processing-mark span:nth-child(2) { animation-delay: 0.15s; }
.processing-mark span:nth-child(3) { animation-delay: 0.3s; }

.processing-steps {
  display: grid;
  gap: 9px;
  margin: 0 0 22px;
  text-align: left;
}

.processing-steps p {
  margin: 0;
  color: var(--muted);
  opacity: 0.5;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.processing-steps p::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: currentColor;
}

.processing-steps p.is-active {
  color: var(--blue);
  opacity: 1;
  transform: translateX(4px);
}

.processing-steps p.is-complete {
  color: var(--success);
  opacity: 1;
}

.processing-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--dark3);
}

.processing-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  transform-origin: left;
  animation: processing-progress 2.7s linear forwards;
}

@keyframes processing-pulse {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-5px); opacity: 1; }
}

@keyframes processing-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

:root[data-theme="light"] .login-page {
  background: radial-gradient(ellipse at 50% 0%, #dbeafe 0%, var(--dark) 72%);
}

:root[data-theme="light"] .app-sidebar {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

:root[data-theme="light"] .sidebar-link,
:root[data-theme="light"] .sidebar-brand span,
:root[data-theme="light"] .sidebar-account span {
  color: var(--muted);
}

:root[data-theme="light"] .booth-hero {
  background:
    radial-gradient(circle at 22% 20%, rgba(42, 127, 255, 0.14), transparent 34%),
    radial-gradient(circle at 92% 30%, rgba(249, 115, 22, 0.1), transparent 34%),
    linear-gradient(135deg, #edf4ff, #ffffff);
}

:root[data-theme="light"] .booth-flow-nav {
  background: rgba(255, 255, 255, 0.96);
}

:root[data-theme="light"] .menu-card,
:root[data-theme="light"] .message.assistant .bubble,
:root[data-theme="light"] .score-card {
  color: var(--text);
  background: #ffffff;
}

:root[data-theme="light"] .menu-card h2,
:root[data-theme="light"] .report-heading strong,
:root[data-theme="light"] .score-card strong {
  color: var(--text);
}

:root[data-theme="light"] .bubble-actions button,
:root[data-theme="light"] .score-card span {
  color: #174ea6;
}

.system-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-width: 0 0 1px;
  background: var(--dark3);
  color: var(--muted);
  font-size: 0.75rem;
}

.system-bar span {
  flex: 0 0 auto;
}

.system-bar textarea {
  min-height: 36px;
  max-height: 92px;
  resize: vertical;
  border-radius: 6px;
  padding: 7px 9px;
  background: var(--dark2);
  font-size: 0.75rem;
}

.doc-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 20px;
  border-width: 0 0 1px;
  background: var(--dark2);
  color: var(--muted);
  font-size: 0.75rem;
}

.doc-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
}

.doc-category span {
  font-size: 0.7rem;
  text-transform: uppercase;
}

.doc-category select {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--dark3);
  color: var(--text);
  padding: 6px 10px;
}

.upload-button {
  flex: 0 0 auto;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--dark3);
  padding: 6px 12px;
  color: var(--muted);
  font-weight: 650;
}

.document-action-button {
  cursor: pointer;
}

.upload-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.upload-button:disabled,
.document-action-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.upload-button input {
  display: none;
}

.doc-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(42, 127, 255, 0.34);
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.12);
  color: #78b2ff;
  padding: 4px 10px;
  font-size: 0.7rem;
}

.doc-tag button {
  border: 0;
  background: transparent;
  color: currentColor;
  padding: 0;
  line-height: 1;
}

.doc-status {
  color: var(--orange);
}

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px;
}

.messages::-webkit-scrollbar {
  width: 5px;
}

.messages::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--border);
}

.message {
  display: flex;
  gap: 10px;
  max-width: 800px;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant,
.message.error {
  align-self: flex-start;
}

.avatar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
}

.message.user .avatar {
  background: linear-gradient(135deg, var(--orange), var(--orange-strong));
}

.message.assistant .avatar,
.message.error .avatar {
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
}

.bubble {
  max-width: 640px;
  border-radius: 14px;
  padding: 11px 15px;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.bubble-actions button {
  border: 1px solid rgba(42, 127, 255, 0.38);
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.12);
  color: #cfe1ff;
  padding: 7px 11px;
  font-size: 0.75rem;
  font-weight: 750;
  touch-action: manipulation;
}

.bubble-actions button:hover,
.bubble-actions button:focus-visible {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.18);
  color: #ffffff;
}

.readiness-report {
  display: grid;
  gap: 14px;
}

.report-heading {
  display: grid;
  gap: 4px;
}

.report-heading span,
.report-list strong {
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-heading strong {
  color: #ffffff;
  font-size: 2.15rem;
  line-height: 1;
}

.report-heading em,
.score-card em {
  color: var(--muted);
  font-style: normal;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.score-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(42, 127, 255, 0.26);
  border-radius: 8px;
  background: rgba(42, 127, 255, 0.08);
  padding: 10px;
}

.score-card span {
  color: #cfe1ff;
  font-size: 0.72rem;
  font-weight: 750;
}

.score-card strong {
  color: #ffffff;
  font-size: 1.35rem;
}

.report-list ol,
.report-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.source-label {
  margin: 10px 0 0;
  color: #9fc5ff;
  font-size: 0.7rem;
  font-weight: 750;
}

.feedback-actions,
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.feedback-actions button,
.report-actions button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe6ff;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 750;
}

.feedback-actions button:hover,
.report-actions button:hover {
  border-color: var(--orange);
  color: #ffffff;
}

.message.user .bubble {
  border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, var(--orange), var(--orange-strong));
  color: #ffffff;
}

.message.assistant .bubble {
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  background: var(--dark2);
  color: var(--text);
}

.message.error .bubble {
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-bottom-left-radius: 4px;
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-5px);
  }
}

.input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-width: 1px 0 0;
  background: var(--dark2);
}

.input-area textarea {
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.5;
}

.input-area textarea::placeholder {
  color: var(--muted);
}

.input-area button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
}

.input-area button:disabled {
  cursor: not-allowed;
  background: var(--border);
}

.input-area svg {
  fill: #ffffff;
}

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

@media (max-width: 1180px) {
  .booth-hero {
    grid-template-columns: 138px minmax(0, 1fr);
    max-height: none;
  }

  .guided-menu {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body.app-mode {
    overflow-y: auto;
  }

  body.app-mode .app {
    min-height: 100dvh;
    height: auto;
  }

  .app-main {
    width: 100%;
    min-height: 100dvh;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(84vw, 310px);
    flex-basis: auto;
    transform: translateX(-104%);
    transition: transform 160ms ease;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.38);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .app-sidebar {
    width: min(84vw, 310px);
    padding: 20px 14px;
  }

  body.sidebar-collapsed .sidebar-brand > div,
  body.sidebar-collapsed .sidebar-link span:not(.sidebar-icon),
  body.sidebar-collapsed .sidebar-recents,
  body.sidebar-collapsed .sidebar-account div {
    display: block;
  }

  body.sidebar-collapsed .sidebar-link,
  body.sidebar-collapsed .sidebar-account {
    justify-content: flex-start;
  }

  .sidebar-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
  }

  .booth-hero {
    grid-template-columns: 1fr;
    max-height: none;
    gap: 12px;
    padding: 12px;
  }

  .booth-copy {
    gap: 12px;
    align-items: start;
  }

  .booth-poster-panel {
    align-content: start;
  }

  .booth-message {
    gap: 8px;
  }

  .event-badge {
    max-height: 176px;
  }

  .advisor-label {
    padding: 5px 9px;
    font-size: 0.62rem;
    white-space: normal;
  }

  .booth-copy h1 {
    max-width: 100%;
    font-size: clamp(1.65rem, 8vw, 2.45rem);
    line-height: 1.02;
  }

  .booth-copy p {
    font-size: 0.95rem;
  }

  .guided-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: auto;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
  }

  .header-logo {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .header-logo-mark {
    width: 92px;
    height: 46px;
    flex: 0 0 auto;
  }

  .header-logo p {
    max-width: 62vw;
    font-size: 0.68rem;
    line-height: 1.25;
    text-align: right;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pill,
  .ghost-button {
    font-size: 0.72rem;
    padding: 6px 10px;
  }

  .system-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 8px 14px;
  }

  .system-bar textarea {
    max-height: 76px;
  }

  .doc-bar {
    padding: 8px 14px;
  }

  .upload-button {
    width: 100%;
    text-align: center;
  }

  .messages {
    padding: 14px;
  }

  .bubble {
    max-width: min(68vw, 640px);
  }
}

@media (max-width: 560px) {
  .login-page {
    justify-content: flex-start;
    padding: 18px 14px 28px;
  }

  .login-logo {
    margin-bottom: 18px;
  }

  .login-logo img {
    width: 168px;
  }

  .login-card {
    padding: 24px 18px;
    border-radius: 12px;
  }

  .app-header {
    max-height: none;
    overflow: visible;
  }

  .booth-hero {
    grid-template-columns: 1fr;
    max-height: none;
    gap: 10px;
    padding: 10px;
  }

  .booth-flow-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
  }

  .booth-flow-nav button {
    width: 100%;
  }

  .booth-copy {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .event-badge,
  .event-badge-fallback,
  .booth-message,
  .advisor-label,
  .booth-copy h1,
  .booth-copy p,
  .contact-label {
    grid-column: 1;
    grid-row: auto;
  }

  .event-badge {
    width: min(124px, 42vw);
    max-height: 138px;
    justify-self: center;
  }

  .booth-poster-panel {
    justify-items: center;
  }

  .advisor-label {
    justify-self: start;
    max-width: 100%;
    padding: 4px 8px;
    font-size: 0.56rem;
    line-height: 1.2;
  }

  .booth-message {
    gap: 7px;
  }

  .booth-copy h1 {
    font-size: clamp(1.34rem, 8vw, 1.86rem);
    line-height: 1;
  }

  .booth-copy p {
    font-size: 0.8rem;
    line-height: 1.34;
  }

  .contact-label {
    max-width: 100%;
    font-size: 0.68rem;
    white-space: normal;
  }

  .guided-menu {
    grid-template-columns: 1fr;
  }

  .menu-card {
    min-height: 56px;
    padding: 10px 12px;
  }

  .menu-card strong {
    font-size: 0.86rem;
  }

  .menu-card span {
    font-size: 0.7rem;
  }

  .header-logo {
    align-items: center;
  }

  .header-logo p {
    font-size: 0.64rem;
    text-align: right;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .header-actions > * {
    min-width: 0;
    text-align: center;
  }

  .system-bar {
    display: none;
  }

  .doc-bar {
    gap: 8px;
  }

  .upload-button {
    width: 100%;
    text-align: center;
  }

  .messages {
    gap: 12px;
    padding: 12px 10px;
    flex: 0 0 auto;
    overflow: visible;
  }

  .message {
    gap: 8px;
    max-width: 100%;
  }

  .avatar {
    width: 28px;
    height: 28px;
    font-size: 0.66rem;
  }

  .bubble {
    max-width: calc(100vw - 78px);
    padding: 10px 12px;
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .bubble-actions {
    flex-direction: column;
  }

  .bubble-actions button {
    width: 100%;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .input-area {
    position: sticky;
    bottom: 0;
    gap: 8px;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--dark2);
  }

  .input-area textarea {
    min-height: 44px;
    max-height: 96px;
    border-radius: 8px;
    font-size: 1rem;
  }

  .input-area button {
    width: 44px;
    height: 44px;
  }

  .password-dialog {
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    padding: 20px;
  }

  .portfolio-dialog {
    width: calc(100vw - 20px);
    padding: 16px;
  }

  .chat-search-dialog {
    width: calc(100vw - 20px);
    padding: 16px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-wide {
    grid-column: auto;
  }

  .portfolio-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}
