/* =====================================
   DENARIUS / SITE ASSISTANT
   Terminal-first optimizer command UI
===================================== */

:root {
  --denarius-console-width: clamp(400px, 30vw, 480px);
  --denarius-console-gap: 24px;
  --denarius-console-nav-offset: 0px;
}

/* =====================================
   ROOT POSITIONING + LAYOUT SAFETY
===================================== */

.site-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;

  z-index: 1400;
}

/*
  Keep the assistant fully self-contained.

  This prevents width + padding overflow issues
  on mobile layouts, command rows, inputs, and
  side-console states regardless of global resets.
*/

.site-assistant,
.site-assistant * {
  box-sizing: border-box;
}

/* =====================================
   FLOATING TOGGLE
===================================== */

.site-assistant-toggle {
  position: relative;

  width: 64px;
  height: 64px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(212, 173, 115, 0.24);
  border-radius: 50%;

  background:
    radial-gradient(circle at 30% 30%, rgba(255, 215, 140, 0.22), transparent 58%),
    linear-gradient(180deg, rgba(24, 24, 24, 0.96), rgba(6, 6, 6, 0.98));

  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 173, 115, 0.08),
    0 0 28px rgba(212, 173, 115, 0.12);

  cursor: pointer;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.site-assistant-toggle:hover {
  transform: translateY(-2px);

  border-color: rgba(212, 173, 115, 0.4);

  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.62),
    0 0 38px rgba(212, 173, 115, 0.18);
}

.site-assistant-toggle:active {
  transform: scale(0.98);
}

.site-assistant-toggle-icon {
  position: relative;
  z-index: 2;

  color: #f5dfb4;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.site-assistant-toggle-pulse {
  position: absolute;
  inset: -6px;

  border-radius: 50%;
  border: 1px solid rgba(212, 173, 115, 0.12);

  animation: assistantPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

.site-assistant.is-open .site-assistant-toggle-pulse {
  display: none;
}

@keyframes assistantPulse {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

/* =====================================
   PANEL SHELL
===================================== */

.site-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 84px;

  width: min(540px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 132px));

  display: flex;
  flex-direction: column;
  overflow: hidden;

  border-radius: 28px;
  border: 1px solid rgba(212, 173, 115, 0.18);

  background:
    radial-gradient(circle at top right, rgba(212, 173, 115, 0.1), transparent 38%),
    radial-gradient(circle at bottom left, rgba(212, 173, 115, 0.04), transparent 34%),
    linear-gradient(180deg, rgba(15, 15, 15, 0.985), rgba(3, 3, 3, 0.99));

  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  box-shadow:
    0 34px 86px rgba(0, 0, 0, 0.74),
    0 0 0 1px rgba(255, 255, 255, 0.025),
    0 0 42px rgba(212, 173, 115, 0.08);

  opacity: 0;
  visibility: hidden;

  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;

  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 220ms ease;
}

.site-assistant.is-open .site-assistant-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* =====================================
   HEADER
===================================== */

.site-assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  padding: 24px 26px 18px;

  flex-shrink: 0;

  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.site-assistant-eyebrow {
  display: inline-flex;
  margin-bottom: 9px;

  color: rgba(212, 173, 115, 0.94);

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-assistant-header h2 {
  margin: 0 0 6px;

  color: #f6f6f6;

  font-size: 24px;
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.site-assistant-header p {
  margin: 0;

  color: rgba(255, 255, 255, 0.62);

  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.site-assistant-help {
  display: none;
}

.site-assistant-close {
  width: 40px;
  height: 40px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 13px;

  background: rgba(255, 255, 255, 0.055);

  color: rgba(255, 255, 255, 0.78);

  font-size: 24px;
  line-height: 1;

  cursor: pointer;

  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.site-assistant-close:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  transform: translateY(-1px);
}

/* =====================================
   MESSAGE STREAM
===================================== */

.site-assistant-messages {
  flex: 1;
  min-height: 0;

  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 20px 24px;

  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-assistant-messages::-webkit-scrollbar {
  width: 6px;
}

.site-assistant-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 173, 115, 0.22);
  border-radius: 999px;
}

/* =====================================
   TERMINAL OUTPUT / USER COMMANDS
===================================== */

.site-assistant-message {
  width: 100%;
  max-width: 100%;

  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;

  padding: 2px 0;

  border: none;
  border-radius: 0;

  background: transparent;
  box-shadow: none;

  color: rgba(255, 255, 255, 0.82);

  font-size: 13px;
  font-weight: 620;
  line-height: 1.5;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-assistant-message::before {
  display: block;

  color: rgba(212, 173, 115, 0.78);

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
}

.site-assistant-message-bot {
  align-self: stretch;
  color: rgba(255, 255, 255, 0.82);
}

.site-assistant-message-bot::before {
  content: "✓";
}

.site-assistant-message-user {
  align-self: stretch;

  color: #f5dfb4;

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.site-assistant-message-user::before {
  content: "<";
  color: rgba(245, 223, 180, 0.92);
}

/* =====================================
   COMMAND REFERENCE PANEL
===================================== */

.site-assistant-command-reference {
  flex-shrink: 0;
  padding: 20px 24px 0;
}

.site-assistant-command-reference + .site-assistant-messages {
  padding-top: 12px;
}

.site-assistant-command-panel {
  width: 100%;
  margin-top: 0;
  padding: 16px 16px 14px;

  flex-shrink: 0;

  border: 1px solid rgba(212, 173, 115, 0.12);
  border-radius: 14px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.012)
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03);

  overflow: hidden;
}

.site-assistant-command-title {
  margin: 0 0 4px;

  color: rgba(212, 173, 115, 0.94);

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.site-assistant-command-subtitle {
  margin: 0 0 12px;

  color: rgba(255, 255, 255, 0.5);

  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.45;
}

.site-assistant-command-list {
  display: grid;
  gap: 0;
}

.site-assistant-command-row {
  display: grid;

  grid-template-columns:
    minmax(78px, 102px)
    minmax(0, 1fr);

  gap: 12px;
  align-items: start;

  padding: 7px 0;

  border-top: 1px solid rgba(255, 255, 255, 0.055);

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 11.5px;
  line-height: 1.45;
}

.site-assistant-command-row:first-child {
  padding-top: 0;
  border-top: none;
}

.site-assistant-command-row:last-child {
  padding-bottom: 0;
}

.site-assistant-command-key {
  color: rgba(245, 223, 180, 0.92);

  font-size: 10.5px;
  font-weight: 780;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-transform: uppercase;
}

.site-assistant-command-example {
  display: block;

  margin: 0;
  padding: 0;

  appearance: none;

  background: transparent;
  border: none;

  color: rgba(255, 255, 255, 0.76);

  font: inherit;
  line-height: inherit;
  text-align: left;

  white-space: normal;
  overflow-wrap: anywhere;

  cursor: default;
  pointer-events: none;
}

/* =====================================
   COMMAND INPUT
===================================== */

.site-assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;

  padding: 14px 18px 18px;

  flex-shrink: 0;

  border-top: 1px solid rgba(255, 255, 255, 0.05);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012),
      rgba(255, 255, 255, 0.006)
    );
}

.site-assistant-input {
  width: 100%;
  min-width: 0;
  height: 46px;

  padding: 0 14px;

  border-radius: 12px;
  border: 1px solid rgba(212, 173, 115, 0.14);

  background: rgba(255, 255, 255, 0.028);

  color: rgba(255, 255, 255, 0.9);

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 12.5px;
  font-weight: 600;

  caret-color: rgba(212, 173, 115, 0.95);

  outline: none;

  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.site-assistant-input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.site-assistant-input:focus {
  border-color: rgba(212, 173, 115, 0.34);

  background: rgba(255, 255, 255, 0.045);

  box-shadow:
    0 0 0 3px rgba(212, 173, 115, 0.06);
}

.site-assistant-send {
  min-width: 72px;
  height: 46px;

  padding: 0 16px;

  border-radius: 12px;
  border: 1px solid rgba(212, 173, 115, 0.2);

  background:
    linear-gradient(
      180deg,
      rgba(212, 173, 115, 0.16),
      rgba(212, 173, 115, 0.08)
    );

  color: #f5dfb4;

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  cursor: pointer;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.site-assistant-send:hover {
  transform: translateY(-1px);

  border-color: rgba(212, 173, 115, 0.34);

  background:
    linear-gradient(
      180deg,
      rgba(212, 173, 115, 0.24),
      rgba(212, 173, 115, 0.12)
    );

  color: #ffffff;
}

/* =====================================
   SUGGESTIONS / ACTION BUTTONS
===================================== */

.site-assistant-suggestions,
.site-assistant-actions {
  display: grid;
  gap: 8px;

  margin-top: 12px;
}

.site-assistant-suggestions button,
.site-assistant-actions button {
  width: 100%;
  min-height: 40px;

  padding: 0 14px;

  border-radius: 999px;
  border: 1px solid rgba(212, 173, 115, 0.18);

  background: rgba(212, 173, 115, 0.07);

  color: rgba(255, 255, 255, 0.84);

  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;

  cursor: pointer;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.site-assistant-suggestions button:hover,
.site-assistant-actions button:hover {
  transform: translateY(-1px);

  border-color: rgba(212, 173, 115, 0.3);
  background: rgba(212, 173, 115, 0.12);

  color: #ffffff;
}

/* =====================================
   STARTER BUTTONS
===================================== */

.site-assistant-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 18px;
}

.site-assistant-starters button {
  appearance: none;
  cursor: pointer;

  padding: 10px 14px;

  border-radius: 999px;
  border: 1px solid rgba(214, 176, 116, 0.18);

  background:
    linear-gradient(
      180deg,
      rgba(38, 34, 28, 0.96),
      rgba(28, 24, 20, 0.94)
    );

  color: rgba(245, 240, 232, 0.94);

  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;

  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.site-assistant-starters button:hover {
  transform: translateY(-1px);

  border-color: rgba(214, 176, 116, 0.34);

  background:
    linear-gradient(
      180deg,
      rgba(46, 40, 33, 0.98),
      rgba(34, 29, 24, 0.96)
    );
}

.site-assistant-starters button:active {
  transform: translateY(0);
}

/* =====================================
   LIGHT MODE
===================================== */

body:not(.dark-mode) .site-assistant-toggle {
  border-color: rgba(184, 139, 79, 0.26);

  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(184, 139, 79, 0.2),
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.985),
      rgba(246, 241, 232, 0.985)
    );

  box-shadow:
    0 18px 40px rgba(80, 55, 22, 0.13),
    0 0 0 1px rgba(184, 139, 79, 0.08),
    0 0 28px rgba(184, 139, 79, 0.08);
}

body:not(.dark-mode) .site-assistant-toggle-icon {
  color: #8a5d20;
}

body:not(.dark-mode) .site-assistant-panel {
  border-color: rgba(184, 139, 79, 0.18);

  background:
    radial-gradient(
      circle at top right,
      rgba(184, 139, 79, 0.11),
      transparent 38%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(184, 139, 79, 0.055),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(255, 252, 246, 0.985),
      rgba(246, 241, 232, 0.99)
    );

  box-shadow:
    0 34px 86px rgba(80, 55, 22, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.48),
    0 0 42px rgba(184, 139, 79, 0.06);
}

body:not(.dark-mode) .site-assistant-header {
  border-bottom-color: rgba(80, 55, 22, 0.075);
}

body:not(.dark-mode) .site-assistant-eyebrow {
  color: rgba(138, 93, 32, 0.95);
}

body:not(.dark-mode) .site-assistant-header h2 {
  color: #17130d;
}

body:not(.dark-mode) .site-assistant-header p {
  color: rgba(23, 19, 13, 0.62);
}

body:not(.dark-mode) .site-assistant-close {
  background: rgba(80, 55, 22, 0.055);
  color: rgba(23, 19, 13, 0.7);
}

body:not(.dark-mode) .site-assistant-close:hover {
  background: rgba(80, 55, 22, 0.095);
  color: #17130d;
}

body:not(.dark-mode) .site-assistant-messages::-webkit-scrollbar-thumb {
  background: rgba(184, 139, 79, 0.24);
}

body:not(.dark-mode) .site-assistant-message-bot {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.8),
      rgba(255, 255, 255, 0.5)
    );

  border-color: rgba(80, 55, 22, 0.075);

  color: rgba(23, 19, 13, 0.82);
}

body:not(.dark-mode) .site-assistant-message-user {
  background:
    linear-gradient(
      180deg,
      rgba(184, 139, 79, 0.135),
      rgba(184, 139, 79, 0.07)
    );

  border-color: rgba(184, 139, 79, 0.2);

  color: #5d3f16;
}

body:not(.dark-mode) .site-assistant-command-panel {
  border-color: rgba(184, 139, 79, 0.15);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.72),
      rgba(255, 255, 255, 0.44)
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body:not(.dark-mode) .site-assistant-command-title {
  color: rgba(122, 81, 27, 0.96);
}

body:not(.dark-mode) .site-assistant-command-subtitle {
  color: rgba(23, 19, 13, 0.5);
}

body:not(.dark-mode) .site-assistant-command-row {
  border-top-color: rgba(80, 55, 22, 0.065);
}

body:not(.dark-mode) .site-assistant-command-key {
  color: rgba(122, 81, 27, 0.9);
}

body:not(.dark-mode) .site-assistant-command-example {
  color: rgba(23, 19, 13, 0.72);
}

body:not(.dark-mode) .site-assistant-form {
  border-top-color: rgba(80, 55, 22, 0.075);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.34),
      rgba(255, 255, 255, 0.15)
    );
}

body:not(.dark-mode) .site-assistant-input {
  border-color: rgba(184, 139, 79, 0.18);

  background: rgba(255, 255, 255, 0.7);

  color: #17130d;
}

body:not(.dark-mode) .site-assistant-input::placeholder {
  color: rgba(23, 19, 13, 0.42);
}

body:not(.dark-mode) .site-assistant-input:focus {
  border-color: rgba(184, 139, 79, 0.4);

  background: rgba(255, 255, 255, 0.9);

  box-shadow:
    0 0 0 3px rgba(184, 139, 79, 0.1);
}

body:not(.dark-mode) .site-assistant-send {
  border-color: rgba(184, 139, 79, 0.24);

  background:
    linear-gradient(
      180deg,
      rgba(184, 139, 79, 0.2),
      rgba(184, 139, 79, 0.095)
    );

  color: #5d3f16;
}

body:not(.dark-mode) .site-assistant-send:hover {
  border-color: rgba(184, 139, 79, 0.38);

  background:
    linear-gradient(
      180deg,
      rgba(184, 139, 79, 0.28),
      rgba(184, 139, 79, 0.135)
    );

  color: #17130d;
}

body:not(.dark-mode) .site-assistant-suggestions button,
body:not(.dark-mode) .site-assistant-actions button {
  border-color: rgba(184, 139, 79, 0.15);

  background: rgba(184, 139, 79, 0.075);

  color: rgba(23, 19, 13, 0.78);
}

body:not(.dark-mode) .site-assistant-suggestions button:hover,
body:not(.dark-mode) .site-assistant-actions button:hover {
  border-color: rgba(184, 139, 79, 0.3);

  background: rgba(184, 139, 79, 0.12);

  color: #17130d;
}

body:not(.dark-mode) .site-assistant-starters button {
  border-color: rgba(184, 148, 92, 0.16);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.965),
      rgba(248, 244, 236, 0.94)
    );

  color: #241f17;

  box-shadow:
    0 10px 24px rgba(15, 10, 4, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body:not(.dark-mode) .site-assistant-starters button:hover {
  border-color: rgba(184, 148, 92, 0.32);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 1),
      rgba(245, 239, 228, 0.985)
    );

  box-shadow:
    0 14px 32px rgba(15, 10, 4, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* =====================================
   MOBILE
===================================== */

@media (max-width: 768px) {
  /* -------------------------------------
     MOBILE TOKENS
  ------------------------------------- */

  :root {
    --mobile-denarius-height: 260px;
    --mobile-denarius-keyboard-height: 148px;
  }

  /* -------------------------------------
     MOBILE ROOT / LAYER
  ------------------------------------- */

  .site-assistant {
    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;

    z-index: 2200;
  }

 /* -------------------------------------
   MOBILE CLOSED LAUNCHER
------------------------------------- */

.site-assistant-toggle {
  width: calc(100% - 24px);
  height: 54px;

  margin: 0 12px max(12px, env(safe-area-inset-bottom));

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 20px;

  border-radius: 999px;

  border: 1px solid rgba(184, 139, 79, 0.24);

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 236, 190, 0.36),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(255, 252, 245, 0.985),
      rgba(241, 224, 185, 0.96)
    );

  box-shadow:
    0 16px 38px rgba(88, 61, 24, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);

  transition:
    transform 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.site-assistant-toggle:hover {
  border-color: rgba(184, 139, 79, 0.34);

  box-shadow:
    0 20px 44px rgba(88, 61, 24, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.site-assistant-toggle::before {
  display: none;
}

.site-assistant-toggle::after {
  content: "Open Denarius";

  color: rgba(34, 25, 14, 0.96);

  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace
  );

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-assistant-toggle-icon {
  display: none;
}

.site-assistant-toggle-pulse {
  display: none;
}

.site-assistant.is-open .site-assistant-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
}

  /* -------------------------------------
     MOBILE OPEN RAIL
  ------------------------------------- */

  .site-assistant-panel {
    position: fixed;

    left: 0;
    right: 0;
    top: auto;
    bottom: 0;

    width: 100%;
    height: var(--mobile-denarius-height);
    max-width: none;
    max-height: var(--mobile-denarius-height);

    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 22px 22px 0 0;

    box-shadow:
      0 -10px 28px rgba(0, 0, 0, 0.28),
      0 -1px 0 rgba(212, 173, 115, 0.12);

    transform: translateY(100%) scale(1);
    transform-origin: bottom center;
  }

  .site-assistant.is-open .site-assistant-panel {
    transform: translateY(0) scale(1);
  }

  /* -------------------------------------
     MOBILE PAGE INTEGRATION
  ------------------------------------- */

  body.denarius-console-open:not(.mobile-tool-open) {
    overflow: hidden;
    scroll-padding-bottom: var(--mobile-denarius-height);
  }

  body.denarius-console-open:not(.mobile-tool-open) > main.container {
    height: calc(100dvh - var(--mobile-denarius-height));
    min-height: 0;
    max-height: calc(100dvh - var(--mobile-denarius-height));

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    padding-bottom: 0 !important;
  }

  body.denarius-console-open:not(.mobile-tool-open) > .site-footer {
    display: none;
  }

  /* -------------------------------------
     MOBILE KEYBOARD MODE
  ------------------------------------- */

  body.denarius-keyboard-open:not(.mobile-tool-open) {
    --mobile-denarius-height: var(--mobile-denarius-keyboard-height);
  }

  .site-assistant.denarius-keyboard-open .site-assistant-panel {
    border-radius: 18px 18px 0 0;
  }

  /* -------------------------------------
   MOBILE RAIL HEADER
------------------------------------- */

.site-assistant-header {
  align-items: center;

  gap: 12px;

  padding: 11px 16px 8px;
}

.site-assistant-header > div:first-child {
  min-width: 0;
}

.site-assistant-eyebrow {
  margin-bottom: 3px;

  font-size: 8.5px;
  letter-spacing: 0.13em;
}

.site-assistant-header h2 {
  margin-bottom: 0;

  font-size: 16px;
  letter-spacing: -0.03em;
}

.site-assistant-header p {
  display: none;
}

.site-assistant-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;

  flex-shrink: 0;

  margin-left: auto;
}

.site-assistant-help,
.site-assistant-close {
  width: 34px;
  height: 34px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  cursor: pointer;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.site-assistant-help {
  border: 1px solid rgba(184, 139, 79, 0.2);

  background:
    linear-gradient(
      180deg,
      rgba(184, 139, 79, 0.14),
      rgba(184, 139, 79, 0.07)
    );

  color: rgba(138, 93, 32, 0.95);

  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
}

.site-assistant-help:hover,
.site-assistant-help[aria-expanded="true"] {
  border-color: rgba(184, 139, 79, 0.34);

  background:
    linear-gradient(
      180deg,
      rgba(184, 139, 79, 0.22),
      rgba(184, 139, 79, 0.11)
    );

  color: #5d3f16;

  transform: translateY(-1px);
}

.site-assistant-close {
  border: none;

  background: rgba(255, 255, 255, 0.055);

  color: rgba(255, 255, 255, 0.78);

  font-size: 20px;
  line-height: 1;
}

.site-assistant-close:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  transform: translateY(-1px);
}

.site-assistant.denarius-keyboard-open .site-assistant-header {
  padding: 6px 14px 4px;
}

.site-assistant.denarius-keyboard-open .site-assistant-eyebrow,
.site-assistant.denarius-keyboard-open .site-assistant-header h2 {
  display: none;
}

.site-assistant.denarius-keyboard-open .site-assistant-header-actions {
  margin-left: auto;
}

.site-assistant.denarius-keyboard-open .site-assistant-help,
.site-assistant.denarius-keyboard-open .site-assistant-close {
  width: 30px;
  height: 30px;

  border-radius: 10px;

  font-size: 18px;
}

.site-assistant.denarius-keyboard-open .site-assistant-help {
  font-size: 12px;
}

  /* -------------------------------------
   MOBILE COMMAND HELP
------------------------------------- */

.site-assistant-command-reference {
  display: none;

  flex: 1;
  min-height: 0;

  padding: 10px 14px 0;

  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  animation: denariusHelpReveal 180ms ease;
}

.site-assistant.denarius-help-open:not(.denarius-keyboard-open)
  .site-assistant-command-reference {
  display: block;

  flex: 1;
  min-height: 0;
  max-height: 100%;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-assistant.denarius-help-open:not(.denarius-keyboard-open)
  .site-assistant-messages {
  display: none;
}

.site-assistant-command-panel {
  padding: 14px 14px 12px;

  border-radius: 14px;

  border: 1px solid rgba(184, 139, 79, 0.14);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.035),
      rgba(255, 255, 255, 0.015)
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.site-assistant-command-title {
  margin-bottom: 4px;

  font-size: 9px;
  letter-spacing: 0.16em;
}

.site-assistant-command-subtitle {
  margin-bottom: 10px;

  color: rgba(255, 255, 255, 0.58);

  font-size: 10.5px;
  line-height: 1.45;
}

.site-assistant-command-list {
  gap: 0;
}

.site-assistant-command-row {
  grid-template-columns: 1fr;

  gap: 3px;

  padding: 8px 0;

  font-size: 11px;
  line-height: 1.42;
}

.site-assistant-command-key {
  color: rgba(245, 223, 180, 0.94);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.site-assistant-command-example {
  color: rgba(255, 255, 255, 0.74);

  overflow-wrap: anywhere;
}

.site-assistant.denarius-keyboard-open .site-assistant-command-reference {
  display: none !important;
}

@keyframes denariusHelpReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

  /* -------------------------------------
     MOBILE MESSAGES
  ------------------------------------- */

  .site-assistant-messages {
    padding: 10px 16px;
    gap: 7px;
  }

  .site-assistant.denarius-keyboard-open .site-assistant-messages {
    padding: 5px 14px 4px;
    gap: 4px;
  }

  .site-assistant-command-reference + .site-assistant-messages {
    padding-top: 10px;
  }

  .site-assistant-message {
    grid-template-columns: 15px minmax(0, 1fr);
    gap: 6px;

    max-width: 100%;

    padding: 0;

    border-radius: 0;

    font-size: 12px;
    line-height: 1.4;
  }

  .site-assistant.denarius-keyboard-open .site-assistant-message {
    grid-template-columns: 13px minmax(0, 1fr);
    gap: 5px;

    font-size: 11px;
    line-height: 1.25;
  }

  .site-assistant-message-user {
    color: #f5dfb4;

    font-size: 11.5px;
  }

  .site-assistant.denarius-keyboard-open .site-assistant-message-user {
    font-size: 10.5px;
  }

  .site-assistant-message-bot {
    color: rgba(255, 255, 255, 0.82);
  }

  .site-assistant-message:not(:nth-last-child(-n + 2)) {
    display: none;
  }

  .site-assistant.denarius-keyboard-open .site-assistant-message:not(:last-child) {
    display: none;
  }

  /* -------------------------------------
     MOBILE INPUT BAR
  ------------------------------------- */

  .site-assistant-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;

    padding: 9px 14px max(10px, env(safe-area-inset-bottom));
  }

  .site-assistant.denarius-keyboard-open .site-assistant-form {
    gap: 7px;

    padding: 6px 12px max(7px, env(safe-area-inset-bottom));
  }

  .site-assistant-input {
    min-width: 0;
    height: 44px;

    padding: 0 13px;

    border-radius: 14px;

    font-size: 16px;
  }

  .site-assistant.denarius-keyboard-open .site-assistant-input {
    height: 40px;

    border-radius: 13px;
  }

  .site-assistant-send {
    min-width: 56px;
    height: 44px;

    padding: 0 13px;

    border-radius: 14px;

    font-size: 0.74rem;
  }

  .site-assistant.denarius-keyboard-open .site-assistant-send {
    min-width: 52px;
    height: 40px;

    padding: 0 11px;

    border-radius: 13px;
  }

  /* -------------------------------------
     MOBILE STARTERS / ACTIONS
  ------------------------------------- */

  .site-assistant-starters {
    gap: 8px;

    margin-top: 8px;
  }

  .site-assistant-starters button {
    width: 100%;
    justify-content: flex-start;

    padding: 9px 12px;
    border-radius: 16px;

    text-align: left;
  }
}

/* =====================================
   MOBILE — SMALL PHONES
===================================== */

@media (max-width: 420px) {
  /* -------------------------------------
     SMALL PHONE TOKENS
  ------------------------------------- */

  :root {
    --mobile-denarius-height: 250px;
    --mobile-denarius-keyboard-height: 136px;
  }

  /* -------------------------------------
     SMALL PHONE LAUNCHER
  ------------------------------------- */

  .site-assistant-toggle {
    width: calc(100% - 20px);
    margin: 0 10px max(10px, env(safe-area-inset-bottom));
  }

  /* -------------------------------------
     SMALL PHONE RAIL
  ------------------------------------- */

  .site-assistant-panel {
    border-radius: 20px 20px 0 0;
  }

  /* -------------------------------------
     SMALL PHONE HEADER
  ------------------------------------- */

  .site-assistant-header {
    padding: 10px 14px 7px;
  }

  .site-assistant-eyebrow {
    font-size: 8px;
  }

  .site-assistant-header h2 {
    font-size: 15.5px;
  }

  .site-assistant-close {
    width: 32px;
    height: 32px;
  }

  /* -------------------------------------
     SMALL PHONE MESSAGES
  ------------------------------------- */

  .site-assistant-messages {
    padding: 9px 14px;
  }

  /* -------------------------------------
     SMALL PHONE INPUT BAR
  ------------------------------------- */

  .site-assistant-form {
    padding: 8px 12px max(9px, env(safe-area-inset-bottom));
  }

  .site-assistant-input {
    height: 42px;
  }

  .site-assistant-send {
    min-width: 52px;
    height: 42px;
    padding: 0 11px;
  }
}

/* =====================================
   MOBILE — SHORT HEIGHT
===================================== */

@media (max-height: 720px) and (max-width: 768px) {
  /* -------------------------------------
     SHORT HEIGHT TOKENS
  ------------------------------------- */

  :root {
    --mobile-denarius-height: 240px;
    --mobile-denarius-keyboard-height: 128px;
  }

  /* -------------------------------------
     SHORT HEIGHT HEADER
  ------------------------------------- */

  .site-assistant-header {
    padding: 9px 14px 7px;
  }

  .site-assistant-eyebrow {
    display: none;
  }

  /* -------------------------------------
     SHORT HEIGHT MESSAGES
  ------------------------------------- */

  .site-assistant-message {
    font-size: 11.5px;
    line-height: 1.35;
  }
}

/* =====================================
   DESKTOP SIDE CONSOLE
===================================== */

@media (min-width: 1181px) {
  #siteNav {
    z-index: 1600;

    transition:
      width 220ms ease,
      margin-right 220ms ease,
      background-color 220ms ease,
      border-color 220ms ease,
      box-shadow 220ms ease;
  }

  body.denarius-console-open #siteNav {
    width: calc(100% - var(--denarius-console-width));
    margin-right: var(--denarius-console-width);
  }

  body.denarius-console-open > main.container,
  body.denarius-console-open > .site-footer {
    width: min(
      calc(
        100% - var(--denarius-console-width) - var(--denarius-console-gap) - 40px
      ),
      1880px
    ) !important;

    margin-left: 20px;
    margin-right: calc(
      var(--denarius-console-width) + var(--denarius-console-gap)
    );

    transition:
      width 220ms ease,
      margin-right 220ms ease;
  }

  body.denarius-console-open .site-assistant {
    top: var(--denarius-console-nav-offset);
    right: 0;
    bottom: 0;
    width: var(--denarius-console-width);
  }

  body.denarius-console-open .site-assistant-panel {
    position: fixed;

    top: var(--denarius-console-nav-offset);
    right: 0;
    bottom: 0;
    left: auto;

    width: var(--denarius-console-width);
    height: calc(100vh - var(--denarius-console-nav-offset));
    max-height: none;

    border-radius: 0;
    border-top: none;
    border-right: none;
    border-bottom: none;

    opacity: 1;
    visibility: visible;
    transform: none;
  }

  body.denarius-console-open .site-assistant-toggle {
    display: none;
  }
}

@media (min-width: 1181px) and (max-width: 1450px) {
  body.denarius-console-open > main.container,
  body.denarius-console-open > .site-footer {
    width: calc(
      100% - var(--denarius-console-width) - var(--denarius-console-gap) - 28px
    ) !important;

    margin-left: 14px;
    margin-right: calc(
      var(--denarius-console-width) + var(--denarius-console-gap)
    );
  }

  body.denarius-console-open .credit-hero,
  body.denarius-console-open .hero-section,
  body.denarius-console-open .hero-grid,
  body.denarius-console-open .cc-hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.denarius-console-open .credit-hero > *,
  body.denarius-console-open .hero-section > *,
  body.denarius-console-open .hero-grid > *,
  body.denarius-console-open .cc-hero-grid > * {
    min-width: 0;
  }
}

@media (max-width: 1180px) {
  body.denarius-console-open > main.container,
  body.denarius-console-open > .site-footer {
    width: auto !important;
    margin-left: auto;
    margin-right: auto;
  }

  body.denarius-console-open #siteNav {
    width: auto;
    margin-right: 0;
  }

  body.denarius-console-open .site-assistant {
    width: auto;
  }
}

/* =====================================
   MOBILE DARK MODE DENARIUS LAUNCHER
   Shared pages outside credit-card mobile bundle
===================================== */

@media (max-width: 768px) {
  body.dark-mode .site-assistant-toggle,
  body.dark-mode #siteAssistantToggle,
  body.dark-mode [data-assistant-toggle] {
    width: calc(100% - 24px) !important;
    height: 54px !important;

    margin: 0 12px max(12px, env(safe-area-inset-bottom)) !important;
    padding: 0 20px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 999px !important;
    border: 1px solid rgba(226, 183, 106, 0.42) !important;

    background:
      radial-gradient(
        circle at 50% 0%,
        rgba(226, 183, 106, 0.13),
        transparent 64%
      ),
      linear-gradient(
        135deg,
        rgba(19, 16, 12, 0.98) 0%,
        rgba(8, 7, 6, 0.99) 52%,
        rgba(17, 13, 9, 0.98) 100%
      ) !important;

    color: #e8c47f !important;
    -webkit-text-fill-color: #e8c47f !important;

    font-weight: 950 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;

    box-shadow:
      0 0 18px rgba(226, 183, 106, 0.16),
      0 12px 32px rgba(0, 0, 0, 0.48),
      inset 0 1px 0 rgba(255, 232, 184, 0.1),
      inset 0 -1px 0 rgba(226, 183, 106, 0.1) !important;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  body.dark-mode .site-assistant-toggle::after,
  body.dark-mode #siteAssistantToggle::after,
  body.dark-mode [data-assistant-toggle]::after {
    content: "Open Denarius";

    color: #e8c47f !important;
    -webkit-text-fill-color: #e8c47f !important;
  }

  body.dark-mode .site-assistant-toggle-icon,
  body.dark-mode .site-assistant-toggle-pulse {
    display: none !important;
  }
}