/* Shared account controls and Xiaoban feedback. All component styles are scoped. */
.account-control,
.web-companion,
#companion-dialog,
.companion-toast {
  --companion-surface: #101b26;
  --companion-surface-raised: #172634;
  --companion-border: #45607270;
  --companion-text: #e1ecf2;
  --companion-muted: #a0b3c3;
  --companion-accent: #b9e7d9;
  font-family: var(--font, system-ui, sans-serif);
}

:where(.account-control, .web-companion, #companion-dialog) button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:where(.account-control, .web-companion, #companion-dialog) :is(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--cyan, #82e5df);
  outline-offset: 3px;
}

:where(.account-control, .web-companion, #companion-dialog) button:disabled {
  cursor: default;
  opacity: .52;
}

/* The account entry stays distinct from the four primary navigation links. */
.account-control {
  position: relative;
  flex: 0 0 auto;
  color: var(--companion-text);
  pointer-events: auto;
}

.account-trigger {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid #607d8a59;
  border-radius: 9px;
  background: #20323e38;
  color: #d5e5e9;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  border-color: #9bbfb591;
  background: #37554d33;
}

.account-trigger > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.account-trigger > svg:last-child {
  width: 12px;
  height: 12px;
  color: #96b5b3;
  transition: transform .18s ease;
}

.account-trigger[aria-expanded="true"] > svg:last-child {
  transform: rotate(180deg);
}

.account-trigger-label {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 95;
  width: 260px;
  max-width: calc(100vw - 32px);
  max-height: min(620px, calc(100dvh - 108px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid #68859569;
  border-radius: 13px;
  background: linear-gradient(150deg, #1a2b34f7, #101923fc 55%);
  box-shadow: 0 18px 56px #02070b99, inset 0 1px #ffffff08;
  backdrop-filter: blur(18px);
  color: var(--companion-text);
  pointer-events: auto;
}

.account-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 2px 11px;
  padding: 13px 10px 15px;
}

.account-summary .avatar-letter {
  display: grid;
  grid-column: 1;
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #9dbbac60;
  border-radius: 11px;
  background: linear-gradient(140deg, #bdd8bf, #74998d);
  color: #1a3730;
  font-size: 17px;
  font-weight: 600;
}

/* The account's own picture, shown where the client shows it. */
.account-summary .avatar-letter--picture {
  background: #0e1a16;
}
.account-summary .avatar-letter--picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The header shows the same picture inside the account button. */
.account-trigger-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border-radius: 8px;
}
.account-trigger-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-trigger-avatar svg {
  width: 17px;
  height: 17px;
}

.account-summary strong {
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.6;
}

.account-summary > div {
  grid-column: 2;
  min-width: 0;
}

.account-summary > div > strong {
  display: block;
}

.account-summary p {
  grid-column: 2;
  margin: 0;
  overflow-wrap: anywhere;
  color: #a0b4c1;
  font-size: 11px;
  line-height: 1.65;
}

.account-action {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 11px;
  width: 100%;
  min-height: 46px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbdde6;
  text-align: left;
  transition: background .18s ease, color .18s ease;
}

.account-action:hover:not(:disabled) {
  background: #8bbbad12;
  color: #e0f2e9;
}

.account-action > svg:first-child {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 18px;
  height: 18px;
  color: #9cbfb8;
}

.account-action > svg:last-child:not(:first-child) {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 14px;
  height: 14px;
  color: #8ca9b6;
}

.account-action > span {
  grid-column: 2;
  font-size: 12px;
  line-height: 1.65;
}

.account-action small {
  display: block;
  grid-column: 2;
  color: #95aab8;
  font-size: 10px;
  line-height: 1.65;
}

.account-divider {
  height: 1px;
  margin: 6px 8px;
  background: #6a869b2e;
}

/* The actual yellow classic artwork supplies the character; the UI stays quiet. */
.web-companion {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: grid;
  width: 84px;
  justify-items: center;
  color: var(--companion-text);
}

.pet-launcher {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 21px;
  background: transparent;
  color: inherit;
}

.pet-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 9px 12px #02080d70);
  transform-origin: 50% 75%;
  transition: transform .22s ease, filter .22s ease;
}

.pet-art > svg,
.pet-art > img {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  object-fit: contain;
}

.pet-launcher:hover .pet-art,
.pet-launcher:focus-visible .pet-art {
  transform: translateY(-2px);
  filter: drop-shadow(0 11px 15px #02080d8c);
}

.pet-orbit {
  position: absolute;
  z-index: -1;
  inset: 17px 5px 3px;
  border: 1px solid #7dd8cf26;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #76cfc72b, #76cfc70a 60%, transparent 73%);
  box-shadow: 0 0 32px #70c9c20d;
  pointer-events: none;
}

.web-companion > .pet-orbit {
  inset: 18px 3px 24px;
}

.pet-label {
  display: block;
  margin-top: 1px;
  padding: 3px 9px;
  border: 1px solid #5874833d;
  border-radius: 20px;
  background: #101c27e8;
  color: #bfd1dc;
  font-size: 10px;
  line-height: 1.65;
  white-space: nowrap;
  box-shadow: 0 4px 15px #0002;
  pointer-events: none;
}

.pet-hide {
  position: absolute;
  top: -14px;
  right: -18px;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #b5cbd7;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity .18s ease, color .18s ease;
}

.pet-hide::before {
  position: absolute;
  z-index: -1;
  inset: 11px;
  border: 1px solid #637e8d80;
  border-radius: 50%;
  background: #12202bed;
  content: "";
}

.pet-hide > svg {
  width: 14px;
  height: 14px;
}

.web-companion:hover .pet-hide,
.web-companion:focus-within .pet-hide,
.pet-hide:focus-visible {
  opacity: 1;
}

.pet-hide:hover {
  color: #f0f6fa;
}

.pet-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  z-index: 4;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 156px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 1px solid #6f8b9673;
  border-radius: 15px;
  background: radial-gradient(ellipse at top left, #2f4b452e, transparent 65%), #111d28fa;
  box-shadow: 0 20px 64px #02080db3, inset 0 1px #ffffff08;
  backdrop-filter: blur(16px);
}

.pet-popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.pet-popover-heading .eyebrow {
  color: #9abdb2;
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: .12em;
  line-height: 1.7;
}

.pet-popover .close-btn {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  margin: -10px -10px -10px 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a2bbc9;
  font-size: 23px;
  line-height: 1;
}

.pet-popover-heading .companion-close {
  margin: -10px -10px -10px 0;
}

.pet-popover .close-btn:hover {
  background: #ffffff07;
  color: #e4f0f3;
}

.pet-popover .close-btn svg {
  width: 18px;
  height: 18px;
}

.pet-popover h2 {
  margin: 13px 0 8px;
  color: #e6eee9;
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -.025em;
  line-height: 1.55;
}

.pet-popover > p {
  margin: 0;
  color: #a4b8c6;
  font-size: 12px;
  line-height: 1.9;
}

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

.pet-choice {
  display: flex;
  min-width: 0;
  min-height: 122px;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 14px 12px;
  border: 1px solid #68899655;
  border-radius: 10px;
  background: linear-gradient(135deg, #7ea69b0e, #17273580);
  color: #d2e2e6;
  text-align: left;
  transition: background .18s ease, border-color .18s ease;
}

.pet-choice:hover:not(:disabled) {
  border-color: #96c5b894;
  background: #9ac6b817;
}

.pet-choice > svg {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  color: #aed4c8;
}

.pet-choice:last-child > svg {
  color: #dfcc91;
}

.pet-choice > strong {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.55;
}

.pet-choice > small {
  color: #9fb3c1;
  font-size: 11px;
  line-height: 1.65;
}

.pet-popover-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 17px;
  padding-top: 8px;
  border-top: 1px solid #65809136;
}

.pet-popover-footer :is(button, a) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 5px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b4d2cf;
  font-size: 11px;
  line-height: 1.6;
}

.pet-popover-footer :is(button, a):last-child {
  color: #a1b5c4;
}

.pet-popover-footer :is(button, a):hover {
  color: #e0f1e9;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* This modal never changes the product-thinking or VIS dialog styles. */
body.companion-modal-open {
  overflow: hidden;
}

#companion-dialog.companion-dialog {
  width: min(560px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #6a87966b;
  border-radius: 16px;
  background: #0e1823;
  color: var(--companion-text);
  box-shadow: 0 32px 120px #000b, inset 0 1px #ffffff08;
}

#companion-dialog[open] {
  display: flex;
  flex-direction: column;
}

#companion-dialog::backdrop {
  background: #020910c7;
  backdrop-filter: blur(8px);
}

.companion-dialog-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 28px 22px;
  border-bottom: 1px solid #617f9338;
  background: linear-gradient(115deg, #709c8720, transparent 70%);
}

.companion-heading {
  min-width: 0;
}

.companion-kicker {
  display: block;
  color: #a1c4b8;
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: .13em;
  line-height: 1.75;
}

.companion-heading h2 {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: #e7efef;
  font-size: 23px;
  font-weight: 550;
  letter-spacing: -.025em;
  line-height: 1.5;
}

.companion-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  margin: -7px -10px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #adc2d0;
  font-size: 26px;
  line-height: 1;
}

.companion-close:hover {
  border-color: #65809338;
  background: #ffffff06;
  color: #eef7f5;
}

.companion-close > svg {
  width: 20px;
  height: 20px;
}

.companion-dialog-body {
  min-height: 0;
  padding: 25px 28px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding: 18px;
  scrollbar-color: #405c70 #101a25;
}

.companion-intro {
  margin: 0 0 20px;
  color: #a7bac9;
  font-size: 14px;
  line-height: 1.85;
}

.companion-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 22px;
  padding: 5px;
  border: 1px solid #526f843f;
  border-radius: 10px;
  background: #09131d;
}

.companion-tabs > button {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #a1b8c8;
  font-size: 12px;
  line-height: 1.6;
  transition: color .18s ease, background .18s ease;
}

.companion-tabs > button > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.companion-tabs > button:hover:not(:disabled) {
  background: #b1d6cd09;
  color: #d5e7e5;
}

.companion-tabs > button[aria-pressed="true"] {
  border-color: #8baea367;
  background: #36584c47;
  color: #daefe5;
  font-weight: 550;
}

#companion-dialog :is(.feedback-form, .login-form) {
  display: grid;
  gap: 18px;
  min-width: 0;
  margin: 0;
}

#companion-dialog .companion-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

#companion-dialog .companion-field label {
  color: #cfdee8;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

#companion-dialog .field-optional {
  margin-left: 3px;
  color: #9ab0bf;
  font-size: 11px;
  font-weight: 400;
}

#companion-dialog .field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

#companion-dialog .field-label-row :is(small, .character-count, .field-counter) {
  flex: 0 0 auto;
  color: #95abba;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 400;
}

#companion-dialog .companion-field :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #566f826e;
  border-radius: 8px;
  background: #09131e;
  color: #e0ebf3;
  font-family: var(--font, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.55;
  caret-color: var(--cyan, #82e5df);
  color-scheme: dark;
  transition: background .18s ease, border-color .18s ease;
}

#companion-dialog .companion-field :is(input, textarea)::placeholder {
  color: #849bac;
  opacity: 1;
}

#companion-dialog .companion-field :is(input, textarea, select):hover:not(:disabled) {
  border-color: #8aa3b09c;
}

#companion-dialog .companion-field :is(input, textarea, select):focus {
  border-color: #b3dfd2;
  background: #101d29;
}

#companion-dialog .companion-field textarea {
  min-height: 138px;
  resize: vertical;
  line-height: 1.8;
}

#companion-dialog .companion-field select {
  padding-right: 32px;
}

#companion-dialog .companion-field :is(input, textarea, select):disabled {
  color: #a1b0bd;
  opacity: .6;
}

#companion-dialog .companion-field [aria-invalid="true"] {
  border-color: #db8d90;
}

#companion-dialog .companion-field > small {
  color: #a0b3c2;
  font-size: 12px;
  line-height: 1.65;
}

#companion-dialog .field-error {
  margin: 0;
  color: #f2aaa9;
  font-size: 12px;
  line-height: 1.65;
}

#companion-dialog .field-error:empty {
  display: none;
}

#companion-dialog .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

#companion-dialog .companion-check {
  display: flex;
  min-height: 44px;
  align-items: flex-start;
  gap: 10px;
  color: #b2c3cf;
  font-size: 12px;
  line-height: 1.8;
}

#companion-dialog .companion-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 6px 0 0;
  accent-color: #b9e7d9;
}

#companion-dialog .companion-check label {
  min-height: 44px;
  padding-block: 3px;
  color: inherit;
  font-size: inherit;
  cursor: pointer;
}

#companion-dialog .context-preview {
  min-width: 0;
  padding: 0 13px;
  border: 1px solid #54728538;
  border-radius: 8px;
  background: #0a141e;
  color: #a6bac9;
}

#companion-dialog .context-preview summary {
  min-height: 44px;
  padding: 11px 0;
  font-size: 12px;
  line-height: 1.75;
  cursor: pointer;
}

#companion-dialog .context-preview summary::marker {
  color: #84b1a7;
}

#companion-dialog .context-preview :is(code, pre) {
  display: block;
  margin: 4px 0 13px;
  overflow-wrap: anywhere;
  color: #98adbd;
  font-family: var(--mono, monospace);
  font-size: 10px;
  line-height: 1.85;
  white-space: pre-wrap;
}

#companion-dialog .context-preview p {
  margin: 0 0 12px;
  color: #9db2c1;
  font-size: 11px;
  line-height: 1.8;
}

.companion-inline-message {
  margin: 0;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  border: 1px solid #5f829368;
  border-radius: 8px;
  background: #2340562b;
  color: #c0d6e5;
  font-size: 12px;
  line-height: 1.8;
}

.companion-dialog-body > .companion-inline-message {
  margin-bottom: 18px;
}

.companion-inline-message:empty {
  display: none;
}

.companion-inline-message[data-tone="error"] {
  border-color: #c17a7c70;
  background: #632e352d;
  color: #f0b7b7;
}

.companion-inline-message[data-tone="success"] {
  border-color: #83b49a6e;
  background: #2a51402e;
  color: #c4e8d2;
}

.companion-inline-message[data-tone="info"] {
  border-color: #6a9aaf65;
  background: #24445a2e;
  color: #bbd6e6;
}

.companion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.companion-primary,
.companion-secondary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.65;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.companion-primary {
  border-color: #d5f5e9;
  background: #c3ebdd;
  color: #163a31;
}

.companion-primary:hover:not(:disabled) {
  border-color: #ebfff7;
  background: #d7f8ec;
}

.companion-secondary {
  border-color: #617e9366;
  background: #ffffff03;
  color: #c7dbe6;
}

.companion-secondary:hover:not(:disabled) {
  border-color: #9cbbb79e;
  background: #9bb8ad0e;
  color: #e2efed;
}

.companion-primary > svg,
.companion-secondary > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.companion-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #b3d9cf;
  font-size: 12px;
  line-height: 1.7;
}

.companion-link:hover:not(:disabled) {
  color: #def5e9;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.companion-link > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.companion-actions .draft-save {
  margin-right: auto;
}

.companion-session-note,
.companion-privacy {
  margin: 0;
  overflow-wrap: anywhere;
  color: #9bb0c0;
  font-size: 12px;
  line-height: 1.8;
}

.companion-dialog-body > .companion-session-note {
  margin-bottom: 18px;
}

.companion-privacy {
  margin-top: 18px;
}

.companion-session-note .service-badge {
  margin-left: 8px;
}

#companion-dialog .login-form .companion-privacy {
  margin-top: 0;
}

#companion-dialog .login-form .companion-primary {
  min-width: 140px;
}

#companion-dialog .companion-check a {
  margin-inline: 3px;
  color: #bedfd5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #7398a166;
  border-radius: 20px;
  background: #1e394737;
  color: #b6d0d8;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.7;
  vertical-align: middle;
  white-space: nowrap;
}

#companion-dialog .login-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

#companion-dialog .login-alternatives > button {
  min-height: 44px;
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #55748866;
  border-radius: 8px;
  background: #142432;
  color: #bbd2df;
  font-size: 12px;
  line-height: 1.6;
}

#companion-dialog .login-alternatives > button:hover:not(:disabled),
#companion-dialog .login-alternatives > button[aria-pressed="true"] {
  border-color: #97baaf9c;
  background: #729b8721;
  color: #ddede5;
}

#companion-dialog .login-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  min-width: 0;
}

#companion-dialog .login-code-row > button {
  min-height: 46px;
  white-space: nowrap;
}

#companion-dialog .login-benefits {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid #56718438;
  color: #adc1ce;
  font-size: 12px;
  line-height: 1.75;
  list-style: none;
}

#companion-dialog .login-benefits > :is(li, div, p) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}

#companion-dialog .login-benefits svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: #a8c9ba;
}

.companion-empty {
  padding: 24px 0 20px;
  text-align: center;
}

.companion-empty > svg,
.companion-empty .companion-empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin: 0 auto 18px;
  padding: 13px;
  border: 1px solid #6f978859;
  border-radius: 16px;
  background: #5c8a6c17;
  color: #bbd7c7;
}

.companion-empty h3 {
  margin: 0;
  color: #e0eae9;
  font-size: 19px;
  font-weight: 550;
  line-height: 1.6;
}

.companion-empty p {
  max-width: 370px;
  margin: 11px auto 0;
  color: #a6bbca;
  font-size: 13px;
  line-height: 1.9;
}

.companion-empty .companion-actions {
  justify-content: center;
  margin-top: 22px;
}

.feedback-receipt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 18px 0;
  padding: 18px;
  overflow-wrap: anywhere;
  border: 1px solid #80a99665;
  border-radius: 10px;
  background: linear-gradient(120deg, #6d9c7820, #18322f26);
  color: #c5ddcf;
  font-size: 13px;
  line-height: 1.8;
}

.feedback-receipt :is(code, .mono) {
  color: #def0e8;
  font-family: var(--mono, monospace);
  font-size: 12px;
  letter-spacing: .035em;
}

:is(.feedback-receipt, .feedback-list-item) :is(.status-pill, .feedback-status, .feedback-status-pill) {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #8eaf945c;
  border-radius: 20px;
  background: #85a68814;
  color: #c4d9bb;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.7;
  white-space: nowrap;
}

.feedback-list {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 18px;
}

.feedback-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 7px 12px;
  width: 100%;
  min-height: 86px;
  padding: 16px;
  border: 1px solid #617f9255;
  border-radius: 10px;
  background: #1424328c;
  color: #ccdde6;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}

.feedback-list-top {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: #a7bdca;
  font-size: 10px;
  line-height: 1.8;
}

.feedback-list-top > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.feedback-list-top .mono {
  font-size: 10px;
}

.feedback-list-top .feedback-status {
  flex: 0 0 auto;
}

.feedback-list-item:hover:not(:disabled) {
  border-color: #8cb1a780;
  background: #26423961;
}

.feedback-list-item strong,
.feedback-list-item .feedback-item-title {
  grid-column: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #d9e7ed;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}

.feedback-list-item :is(.status-pill, .feedback-status, .feedback-status-pill) {
  grid-column: 2;
  grid-row: 1;
  margin-top: 2px;
}

.feedback-list-item > small,
.feedback-list-item .feedback-meta,
.feedback-list-item .feedback-item-meta,
.feedback-list-item .feedback-list-meta {
  grid-column: 1 / -1;
  color: #a3b7c5;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.8;
}

.feedback-list-item .feedback-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feedback-list-meta > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #adccc6;
}

.feedback-list-item :is(.feedback-meta, .feedback-item-meta) {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
}

.feedback-detail-copy {
  margin: 18px 0;
  overflow-wrap: anywhere;
  color: #c6d8e4;
  font-size: 14px;
  line-height: 1.95;
  white-space: pre-wrap;
}

.feedback-replies {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.feedback-replies article {
  min-width: 0;
  padding: 16px;
  border: 1px solid #6380924f;
  border-radius: 10px;
  background: #172a373d;
}

.feedback-replies article :is(h3, strong) {
  color: #cbdedb;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.7;
}

.feedback-replies article p {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  color: #bacfdd;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.feedback-replies small {
  display: block;
  margin-top: 8px;
  color: #99b0c1;
  font-size: 11px;
  line-height: 1.7;
}

#companion-dialog .reply-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.companion-empty.receipt-intro {
  padding: 16px 0 8px;
}

.companion-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 140;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 17px;
  overflow-wrap: anywhere;
  border: 1px solid #8bb3a878;
  border-radius: 10px;
  background: #13232ef5;
  box-shadow: 0 10px 36px #0008;
  backdrop-filter: blur(12px);
  color: #d5e9df;
  font-size: 12px;
  line-height: 1.75;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

@media (max-width: 1000px) {
  .site-header .nav-right .nav-cta {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header .nav-shell {
    position: relative;
    gap: 12px;
  }

  .site-header .nav-right {
    display: flex;
    gap: 0;
    margin-left: auto;
  }

  .site-header .menu-toggle {
    min-height: 44px;
    gap: 8px;
    margin-left: 0;
    padding-left: 4px;
  }

  /* Anchor the mobile panel to the navigation, not the account icon. */
  .account-control {
    position: static;
  }

  .account-trigger {
    gap: 6px;
    padding-inline: 8px;
    border-radius: 8px;
    font-size: 11px;
  }

  .account-trigger-label {
    max-width: 64px;
  }

  .account-popover {
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 94px);
  }

  .account-action > span {
    font-size: 13px;
  }

  .account-action small {
    font-size: 11px;
  }

  .web-companion {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 76px;
  }

  .pet-launcher,
  .pet-art {
    width: 76px;
    height: 76px;
  }

  .pet-label {
    padding: 3px 8px;
    font-size: 9px;
  }

  .pet-hide {
    top: -14px;
    right: -12px;
  }

  .pet-popover {
    bottom: calc(100% + 12px);
    width: min(320px, calc(100vw - 32px));
    max-height: calc(100dvh - 136px);
    padding: 19px;
  }

  #companion-dialog.companion-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 13px;
  }

  .companion-dialog-head {
    gap: 12px;
    padding: 21px 20px 18px;
  }

  .companion-heading h2 {
    font-size: 21px;
  }

  .companion-kicker {
    font-size: 8px;
  }

  .companion-close {
    margin-right: -8px;
  }

  .companion-dialog-body {
    padding: 22px 20px 24px;
  }

  .companion-intro {
    font-size: 13px;
  }

  .companion-tabs {
    gap: 4px;
    margin-block: 16px 20px;
    padding: 4px;
  }

  .companion-tabs > button {
    padding-inline: 7px;
    font-size: 12px;
  }

  #companion-dialog .companion-field :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    font-size: 16px;
  }

  #companion-dialog .companion-field textarea {
    min-height: 145px;
  }

  #companion-dialog .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  #companion-dialog .login-code-row > button {
    padding-inline: 11px;
    font-size: 12px;
  }

  .companion-actions {
    gap: 8px;
  }

  .companion-actions > :is(.companion-primary, .companion-secondary) {
    flex: 1;
  }

  .companion-actions .draft-save {
    width: 100%;
    justify-content: flex-start;
    margin-right: 0;
  }

  .feedback-receipt,
  .feedback-list-item,
  .feedback-replies article {
    padding: 15px;
  }

  .feedback-list-item {
    gap: 6px 8px;
  }

  .feedback-list-item strong,
  .feedback-list-item .feedback-item-title {
    font-size: 13px;
  }

  .companion-toast {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .account-trigger {
    width: 44px;
    gap: 0;
    padding: 0;
  }

  .account-trigger > svg:last-child {
    display: none;
  }

  .account-trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .companion-dialog-head {
    padding-inline: 16px;
  }

  .companion-dialog-body {
    padding-inline: 16px;
  }

  .pet-popover {
    padding: 17px;
  }

  .pet-choice {
    padding-inline: 10px;
  }
}

@media (hover: none) {
  .pet-hide {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.account-control, .web-companion, #companion-dialog, .companion-toast),
  :where(.account-control, .web-companion, #companion-dialog, .companion-toast) *,
  :where(.account-control, .web-companion, #companion-dialog, .companion-toast) *::before,
  :where(.account-control, .web-companion, #companion-dialog, .companion-toast) *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .pet-launcher:hover .pet-art,
  .pet-launcher:focus-visible .pet-art {
    transform: none;
  }
}

/* The artwork is a drag handle; ordinary taps and keyboard clicks still open it. */
.pet-launcher { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.pet-launcher img { -webkit-user-drag: none; }
.web-companion.is-dragging .pet-launcher { cursor: grabbing; }
.web-companion.is-dragging .pet-art { transition: none; transform: none; }
.web-companion .pet-popover { position: fixed; right: auto; bottom: auto; }
