:root {
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  --accent: #245be8;
  --accent-strong: #194bd0;
  color: #152946;
  background: #f8fafc;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body.branded:not(.theme-on) {
  background-image:
    linear-gradient(rgba(248, 250, 252, 0.45), rgba(248, 250, 252, 0.45)),
    url('/branding/background');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.header {
  min-height: 84px;
  border-bottom: 1px solid #e5eaf1;
  padding: 20px max(24px, calc((100vw - 1080px) / 2));
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 20px;
  font-weight: 650;
  color: #152946;
}
.brand-mark {
  background: #eaf0fe;
  color: var(--accent);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}
.brand-caption {
  font-size: 13px;
  font-weight: 400;
  color: #66768d;
  border-left: 1px solid #dce3ed;
  padding-left: 12px;
}
.account {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}
main {
  width: min(100% - 48px, 1000px);
  margin: 56px auto;
  flex: 1;
}
footer {
  text-align: center;
  color: #78869a;
  font-size: 12px;
  padding: 24px;
}
.wordmark {
  color: #3b506f;
  font-weight: 650;
}
h1 {
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.7px;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 20px;
}
p {
  line-height: 1.65;
}
.muted {
  color: #66768d;
}
.entry {
  max-width: 440px;
  margin: 7vh auto;
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.panel {
  background: white;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  padding: 28px;
}
form {
  display: grid;
  gap: 20px;
}
.sign-in-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #f3f6fb;
  border-radius: 9px;
}
.sign-in-methods button {
  border-color: transparent;
  background: transparent;
}
.sign-in-methods button[aria-pressed='true'] {
  background: white;
  border-color: #d8e0eb;
  color: var(--accent);
}
label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
}
input,
textarea {
  width: 100%;
  border: 1px solid #cbd5e4;
  border-radius: 7px;
  background: white;
  color: #152946;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}
textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.7;
}
button {
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  border-radius: 7px;
  border: 1px solid #d8e0eb;
  background: white;
  color: #243d62;
  padding: 11px 17px;
}
button:hover {
  background: #f3f6fb;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: var(--accent-strong);
}
button.quiet {
  border: 0;
  padding: 6px 0;
  color: #536b8c;
  background: transparent;
}
.wallet-sign-in button {
  width: 100%;
}
.wallet-sign-in p {
  margin: 14px 0 0;
}
button.link {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 600;
  text-align: left;
}
.request-links p {
  margin: 4px 0;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
:focus-visible {
  outline: 3px solid #7196ff;
  outline-offset: 3px;
}
.error {
  color: #b32332;
  background: #fff3f3;
  border-radius: 6px;
  padding: 12px;
  margin: 0;
}
.error:empty {
  display: none;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.intro {
  margin-bottom: 32px;
}
.request-list {
  display: grid;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  padding: 23px 25px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eaf0f6;
  border-radius: 0;
}
.request-row:last-child {
  border-bottom: 0;
}
.request-row strong {
  display: block;
  font-weight: 550;
  font-size: 16px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.request-row small {
  font-weight: 400;
  color: #78869a;
}
.badge {
  display: inline-block;
  flex-shrink: 0;
  background: #edf2fb;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 12px;
  color: #476185;
}
.badge.solved,
.badge.closed {
  background: #e9f4ef;
  color: #337458;
}
.unread-mark,
.unread-total {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, #ffffff);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.unread-mark {
  margin-left: 8px;
  vertical-align: 2px;
}
.unread-total {
  margin-left: 10px;
  vertical-align: 4px;
  font-size: 12px;
}
.empty {
  padding: 55px 24px;
  text-align: center;
}
.conversation {
  max-width: 800px;
  margin: 24px auto;
}
.message {
  max-width: 90%;
  margin: 24px 0;
}
.message.customer {
  margin-left: auto;
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #708099;
  font-size: 12px;
  margin-bottom: 9px;
}
.message.customer .message-meta {
  justify-content: flex-end;
}
.message-body {
  background: white;
  border: 1px solid #e2e8f1;
  border-radius: 10px;
  padding: 18px 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
}
.message.customer .message-body {
  background: #edf3ff;
  border-color: #e1eafa;
}
.message details {
  margin-top: 12px;
  color: #708099;
  font-size: 13px;
}
.message summary {
  cursor: pointer;
}
.message details pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
.reply {
  margin-top: 36px;
}
.new-request {
  max-width: 720px;
  margin: 0 auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) {
  .header {
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  main {
    width: calc(100% - 32px);
    margin: 32px auto;
  }
  .panel {
    padding: 20px;
  }
  .request-row {
    padding: 18px;
    gap: 12px;
  }
  .message {
    max-width: 95%;
  }
  .brand-caption {
    font-size: 12px;
  }
  .account {
    width: 100%;
    justify-content: space-between;
  }
}

.attachment-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}
.attachment-picker[hidden],
.attachment-links[hidden] {
  display: none;
}
.attachment-picker ul {
  flex-basis: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}
.attachment-picker li {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-wrap: anywhere;
  padding: 4px 0;
}
.attachment-picker li button {
  padding: 4px 8px;
  margin-left: auto;
  font-size: 12px;
}
.attachment-links {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attachment-links a {
  display: block;
  padding: 8px 12px;
  border: 1px solid #d9e2f3;
  border-radius: 6px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

/* VOVA-012: My requests and the CC section. */
.request-tabs {
  max-width: 320px;
  margin: -8px 0 16px;
}

/* CODEX-020: one palette for both built-in modes and company themes. */
:root[data-theme] {
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #152946;
  --muted: #52647b;
  --border: #dce3ed;
  --accent-text: #ffffff;
  color: var(--text);
  background: var(--background);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --background: #101827;
  --surface: #182337;
  --text: #f1f5fc;
  --muted: #b2c0d5;
  --border: #40516a;
  --accent: #8baaff;
  --accent-strong: #9cb8ff;
  --accent-text: #101827;
}
body {
  color: var(--text);
  background-color: var(--background);
}
.header,
.panel,
.request-list,
.message-body,
input,
textarea,
select,
button {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.brand,
.wordmark {
  color: var(--text);
}
.muted,
.brand-caption,
footer,
.message-meta,
.request-row small,
.quiet {
  color: var(--muted);
}
button.primary {
  color: var(--accent-text);
  background: var(--accent);
}
.request-row,
.brand-caption {
  border-color: var(--border);
}
.sign-in-methods,
.badge {
  background: var(--surface);
  color: var(--text);
}
/* VOVA-045: only the bubble is a card; the author/date line sits on the page. */
.message.customer .message-body {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}
/* .account raises these above a company theme's generic button rules. */
.account .theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 28%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.account .theme-toggle:hover {
  border-color: color-mix(in srgb, var(--text) 60%, transparent);
  background: transparent;
}
@media (max-width: 600px) {
  .header {
    position: relative;
  }
  .header .account .theme-toggle {
    position: absolute;
    top: 17px;
    right: 16px;
  }
}
.theme-toggle[hidden],
.theme-toggle .theme-sun,
.theme-toggle[data-mode='dark'] .theme-moon {
  display: none;
}
.theme-toggle[data-mode='dark'] .theme-sun {
  display: block;
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button:hover,
.sign-in-methods button[aria-pressed='true'] {
  background: var(--background);
}
button.primary:hover {
  background: var(--accent-strong);
}
.theme-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}
.theme-on #content {
  width: 100%;
  margin: 0;
}
.theme-logo {
  max-width: 160px;
  max-height: 56px;
  object-fit: contain;
}
.brand:has(.theme-logo) .brand-mark {
  display: none;
}
.theme-on [data-escalio] {
  min-width: 0;
  overflow-wrap: anywhere;
}
:root[data-theme='dark'] body.branded:not(.theme-on) {
  background-image: linear-gradient(#10182799, #10182799), url('/branding/background');
}
@media (max-width: 600px) {
  .account {
    gap: 10px;
  }
}

/* ANTON-003: mark as solved and rate a finished request. */
.request-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.feedback {
  margin-top: 24px;
}
.feedback h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.feedback-choices {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.feedback-choices .feedback-choice {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
}
.feedback-choices .feedback-choice[aria-pressed='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.feedback-shown {
  margin: 0 0 8px;
  font-weight: 600;
}
.feedback-summary[hidden],
.feedback-choices[hidden] {
  display: none;
}
/* hidden must win over the card and form layout rules (panel, label, button). */
.feedback[hidden],
.feedback label[hidden],
.feedback button[hidden],
.request-actions button[hidden] {
  display: none;
}
.request-actions .quiet {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
}
.feedback textarea {
  min-height: 84px;
  height: 84px;
}
.feedback > .quiet {
  justify-self: start;
  padding-left: 0;
}

/* ANTON-005: the chat-style home. Navigation on the left, the screen in the middle. */
body.portal-chat main {
  width: min(100% - 32px, 1240px);
  margin: 24px auto;
}
.chat-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.chat-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-nav .chat-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}
/* Navigation, questions and suggestions read as text even when a theme styles
   every button as an action; a theme can still address these classes. */
.chat-nav .chat-nav-item,
.chat-chips .chat-chip,
.chat-suggestions .chat-suggestion {
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
}
.chat-nav .chat-nav-item:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.chat-nav .chat-nav-item[aria-current='page'] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
}
.chat-group-head {
  display: flex;
  align-items: center;
  gap: 2px;
}
.chat-group-head > :first-child {
  flex: 1;
  min-width: 0;
}
.chat-nav .chat-toggle {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
}
.chat-nav .chat-toggle:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}
.chat-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.chat-sub[hidden] {
  display: none;
}
.chat-nav .chat-sub .chat-nav-item {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 450;
}
.chat-community .chat-group-head .chat-nav-heading {
  margin-top: 14px;
}
.chat-community .chat-sub {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.chat-recent,
.chat-community {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-nav-heading {
  margin: 18px 12px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.chat-nav-heading[hidden] {
  display: none;
}
.chat-nav .chat-recent-item {
  padding: 6px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
}
.chat-recent-item span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.chat-count[hidden] {
  display: none;
}
.chat-dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
}
.chat-link::after {
  content: '↗';
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.chat-main {
  min-width: 0;
}
.chat-home {
  max-width: 720px;
  margin: 12vh auto 40px;
  text-align: center;
}
.chat-home h1 {
  margin-bottom: 26px;
}
.chat-composer {
  display: grid;
  gap: 8px;
  padding: 14px 14px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 34px color-mix(in srgb, var(--text) 8%, transparent);
  text-align: left;
}
.chat-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
.chat-composer textarea {
  min-height: 64px;
  max-height: 320px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  resize: none;
  field-sizing: content;
}
.chat-composer textarea:focus-visible {
  outline: none;
}
.chat-composer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.chat-composer .attachment-picker {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.chat-composer .chat-send {
  flex: none;
  margin-left: auto;
  border-radius: 12px;
}
.chat-home > .error {
  text-align: left;
}
.chat-suggestions {
  margin-top: 10px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}
.chat-suggestions[hidden] {
  display: none;
}
.chat-suggestions-title {
  margin: 6px 10px 2px;
  color: var(--muted);
  font-size: 12px;
}
.chat-suggestions .chat-suggestion {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font-weight: 400;
  padding: 9px 10px;
}
.chat-suggestions .chat-suggestion:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.chat-suggestion span {
  color: var(--muted);
  font-size: 13px;
}
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.chat-chips .chat-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}
.chat-chips .chat-chip:hover {
  border-color: var(--accent);
}
.help-center {
  max-width: 760px;
  margin: 8px auto 40px;
}
.help-center input[type='search'] {
  margin: 8px 0 12px;
}
.help-group {
  margin: 28px 0 4px;
  font-size: 15px;
}
.help-item {
  border-bottom: 1px solid var(--border);
}
.help-item summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 4px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.help-item summary::-webkit-details-marker {
  display: none;
}
.help-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.help-item[open] summary::after {
  content: '−';
}
.help-answer {
  padding: 0 4px 18px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.help-more {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 16px 20px;
  text-align: left;
}
.help-more p {
  margin: 0;
}
/* Conversations read like a chat: the customer's bubbles on the right, replies on the page. */
.portal-chat .conversation {
  margin-top: 0;
}
.portal-chat .message.support .message-body {
  border-color: transparent;
  background: transparent;
  padding: 2px 0;
}
.portal-chat .message.customer .message-body {
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
}
@media (max-width: 760px) {
  .chat-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .chat-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .chat-nav .chat-nav-item {
    width: auto;
    white-space: nowrap;
  }
  .chat-nav-heading,
  .chat-recent,
  .chat-nav .chat-toggle,
  .chat-group:not(.chat-community) .chat-sub,
  .chat-community .chat-nav-heading {
    display: none;
  }
  .chat-group,
  .chat-group-head {
    display: flex;
  }
  .chat-community {
    flex-direction: row;
  }
  .chat-home {
    margin-top: 6vh;
  }
}

/* Keep the real layout measurable for recovery checks, but do not paint it
   until the active theme stylesheet and first screen have both loaded. */
body[data-portal-pending] > :not(#portal-startup) {
  opacity: 0 !important;
  pointer-events: none !important;
}
#portal-startup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  padding: 24px !important;
  background: #f8fafc !important;
  color: #152946 !important;
  font:
    15px/1.5 system-ui,
    sans-serif !important;
}
