:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #172033;
  background: #f7f8fa;
  font-synthesis: none;
}
.screenshot-message {
  width: min(100%, 720px);
  margin: 0 0 28px auto;
  padding: 16px;
  border-radius: 16px;
  background: #eef1f6;
}
.screenshot-message p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #596579;
}
.screenshot-message small {
  display: block;
  margin-top: 8px;
  color: #596579;
}
#screenshots {
  display: grid;
  gap: 12px;
}
#screenshots button {
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  cursor: zoom-in;
}
#screenshots img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
#image-preview {
  width: min(1200px, 96vw);
}
#preview-image {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
}
dialog {
  width: min(680px, 94vw);
  max-height: 85vh;
  overflow: auto;
  border: 1px solid #dfe3ea;
  border-radius: 16px;
  padding: 24px;
  color: #172033;
}
dialog::backdrop {
  background: #17203366;
}
dialog label {
  display: block;
  margin: 14px 0;
}
dialog input {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
}
dialog button,
#mobile-account {
  padding: 9px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}
#account-close {
  float: right;
}
#history-list button,
#device-list a {
  display: block;
  margin: 8px 0;
  text-align: left;
  overflow-wrap: anywhere;
}
#history-detail {
  margin-top: 20px;
}
#account-message {
  color: #6257df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: #f7f8fa;
}
button,
select {
  font: inherit;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: 248px;
  flex-direction: column;
  border-right: 1px solid #e8ebf0;
  background: #fff;
  padding: 22px 16px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  font-size: 17px;
}
.brand-mark,
.avatar,
.answer-avatar {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #6257e7, #8b5cf6);
  color: white;
  font-weight: 800;
}
.brand-mark {
  width: 30px;
  height: 30px;
}
.new-chat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  background: #fff;
  padding: 11px 13px;
  color: #30394c;
}
.history-label {
  margin: 28px 10px 8px;
  color: #9aa2b1;
  font-size: 12px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 10px 12px;
  color: #5b6475;
  font-size: 14px;
}
.history-item.active {
  background: #f0f1f4;
  color: #232b3c;
  font-weight: 600;
}
.chat-icon {
  color: #7c6ee6;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid #edf0f4;
  padding: 18px 8px 0;
}
.sidebar-footer .avatar {
  border-radius: 50%;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 11px;
}
.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}
.sidebar-footer strong {
  font-size: 13px;
}
.sidebar-footer span {
  margin-top: 3px;
  color: #929aaa;
  font-size: 11px;
}
.workspace {
  display: flex;
  width: calc(100% - 248px);
  min-height: 100vh;
  margin-left: 248px;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e8ebf0;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 28px;
  backdrop-filter: blur(14px);
}
.model-control {
  display: flex;
  align-items: center;
  gap: 12px;
}
.model-control label {
  color: #8b93a3;
  font-size: 12px;
}
.model-control select {
  max-width: min(360px, 50vw);
  border: 1px solid #dfe3ea;
  border-radius: 9px;
  background: #fff;
  padding: 9px 34px 9px 11px;
  color: #30394c;
  outline: none;
}
.model-control select:focus {
  border-color: #8275e8;
  box-shadow: 0 0 0 3px rgba(130, 117, 232, 0.12);
}
.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8b93a3;
  font-size: 12px;
}
.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5a524;
}
.status.online i {
  background: #24b47e;
}
.status.error i {
  background: #e5484d;
}
.conversation {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 46px 28px 180px;
}
.empty-state {
  display: grid;
  min-height: calc(100vh - 300px);
  place-content: center;
  text-align: center;
}
.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid #e3e6ec;
  border-radius: 17px;
  background: #fff;
  color: #796de1;
  box-shadow: 0 8px 28px rgba(34, 42, 61, 0.08);
  font-size: 23px;
}
.empty-state h1 {
  margin: 0 0 9px;
  font-size: 22px;
}
.empty-state p {
  max-width: 420px;
  margin: 0;
  color: #929aaa;
  font-size: 14px;
  line-height: 1.7;
}
.answer-card {
  display: flex;
  gap: 15px;
}
.answer-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  font-size: 12px;
}
.answer-content {
  min-width: 0;
  flex: 1;
  border: 1px solid #e7eaf0;
  border-radius: 14px;
  background: #fff;
  padding: 20px 22px;
  box-shadow: 0 10px 32px rgba(31, 42, 68, 0.05);
}
.answer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.answer-heading span {
  color: #9aa2b1;
  font-size: 11px;
}
pre {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #293246;
  font:
    15px/1.8 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}
.error {
  margin: 16px 0 0;
  color: #d83b46;
  font-size: 13px;
}
.composer-wrap {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 248px;
  padding: 24px 28px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(247, 248, 250, 0), #f7f8fa 32%);
}
.composer {
  display: flex;
  width: min(860px, 100%);
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  border: 1px solid #dde2ea;
  border-radius: 15px;
  background: #fff;
  padding: 13px 14px 13px 18px;
  box-shadow: 0 12px 35px rgba(38, 47, 68, 0.1);
}
.composer strong,
.composer span {
  display: block;
}
.composer strong {
  font-size: 13px;
}
.composer span {
  margin-top: 4px;
  color: #959dac;
  font-size: 11px;
}
.composer button {
  border: 0;
  border-radius: 10px;
  background: #6257df;
  padding: 10px 15px;
  color: #fff;
  font-weight: 700;
}
.composer button:disabled {
  background: #d5d8df;
}
.privacy-note {
  margin: 9px auto 0;
  color: #a1a8b4;
  text-align: center;
  font-size: 10px;
}
.hidden {
  display: none;
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .workspace {
    width: 100%;
    margin-left: 0;
  }
  .topbar {
    min-height: 64px;
    padding: 10px 14px;
  }
  .model-control {
    min-width: 0;
    flex: 1;
    gap: 8px;
  }
  .model-control label,
  .status span {
    display: none;
  }
  .model-control select {
    width: 100%;
    max-width: none;
  }
  .conversation {
    padding: 30px 14px 170px;
  }
  .empty-state {
    min-height: calc(100vh - 260px);
  }
  .answer-card {
    gap: 9px;
  }
  .answer-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 10px;
  }
  .answer-content {
    padding: 16px;
  }
  pre {
    font-size: 14px;
  }
  .composer-wrap {
    left: 0;
    padding: 20px 14px max(12px, env(safe-area-inset-bottom));
  }
}

/* Chat transcript: right-aligned user image, left-aligned assistant text. */
body,
.workspace {
  background: #fff;
}
.sidebar {
  display: none;
}
.workspace {
  margin-left: 0;
  width: 100%;
}
.conversation {
  width: 100%;
  max-width: 1700px;
  padding: 28px 24px 160px;
}
.screenshot-message {
  width: min(60%, 820px);
  margin: 0 0 32px auto;
  background: #f3f4f6;
  padding: 14px;
  border-radius: 12px;
}
.screenshot-message .user-heading {
  text-align: right;
  font-size: 11px;
  color: #89909b;
  margin-bottom: 8px;
}
#question-prompt {
  color: #202124;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
#screenshots img {
  max-height: 520px;
}
.answer-avatar {
  display: none;
}
.answer-card {
  width: 100%;
}
.answer-content {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.answer-heading {
  justify-content: flex-start;
  font-size: 12px;
  gap: 10px;
}
.answer-heading strong {
  font-weight: 500;
}
#answer {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.9;
  color: #202124;
}
.composer-wrap {
  left: 0;
  background: linear-gradient(180deg, #ffffff00, #fff 35%);
}
.composer {
  box-shadow: none;
  min-height: 52px;
}
@media (max-width: 760px) {
  .conversation {
    padding: 22px 14px 150px;
  }
  .screenshot-message {
    width: 94%;
    padding: 10px;
  }
  .answer-content {
    padding: 0;
  }
}

/* Reference-inspired layout; retain the desktop-driven screenshot workflow. */
.sidebar {
  display: flex;
  padding: 20px 14px;
}
.workspace {
  margin-left: 248px;
  width: calc(100% - 248px);
}
.brand-mark,
.avatar {
  background: #e7e9ee;
  color: #596579;
}
.new-chat {
  cursor: pointer;
}
.history-item {
  text-decoration: none;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.history-item:hover {
  background: #f3f4f6;
}
#sidebar-history {
  overflow-y: auto;
  min-height: 0;
  font-size: 12px;
  color: #929aaa;
}
.sidebar-hint {
  padding: 0 12px;
  line-height: 1.7;
}
.sidebar-footer {
  flex-shrink: 0;
}
.conversation {
  max-width: 1000px;
  padding-bottom: 190px;
}
.composer-wrap {
  left: 248px;
}
.composer {
  max-width: 760px;
  border-radius: 18px;
  min-height: 82px;
  box-shadow: 0 5px 16px #1720330d;
}
.composer button {
  background: #343c4a;
  cursor: pointer;
}
.empty-icon {
  color: #9aa2b1;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 32px;
}
.empty-state h1 {
  font-weight: 600;
}
.topbar {
  min-height: 68px;
}
.privacy-note a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #8275e8;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .workspace {
    margin-left: 0;
    width: 100%;
  }
  .composer-wrap {
    left: 0;
  }
  .composer {
    min-height: 72px;
  }
  .topbar {
    gap: 10px;
  }
  #mobile-account {
    white-space: nowrap;
    font-size: 12px;
  }
  dialog {
    padding: 18px;
    width: calc(100vw - 24px);
  }
}

.sidebar .new-chat { border: 0; border-bottom: 1px solid #e5e7eb; background: white; border-radius: 0; padding: 12px 14px 20px; text-align: left; margin-bottom: 10px; }
.sidebar .new-chat span { margin-left: 8px; font-size: 20px; }
.sidebar .history-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 11px 12px; border-radius: 8px; }
.sidebar .history-item.active { background: #d4d8df; }
.sidebar .sidebar-footer { border-top: 1px solid #e5e7eb; padding: 20px 12px 0; }
.account-menu-wrap { position: relative; margin-left: auto; flex-shrink: 0; }
#mobile-account { display: inline-flex; border: 1px solid #dce1e8; border-radius: 8px; padding: 8px 12px; background: white; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
#user-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 200px; background: white; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 24px #0002; z-index: 50; overflow: hidden; }
#user-menu[hidden] { display: none; }
#user-menu button { display: block; width: 100%; border: 0; border-radius: 0; background: white; text-align: left; padding: 14px 16px; cursor: pointer; }
#user-menu button:hover { background: #f5f6f8; }
.online-row { padding: 14px 16px; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
.online-dot { display: inline-block; width: 8px; height: 8px; background: #22c55e; border-radius: 50%; margin-right: 6px; }
#user-menu .logout-item { color: #e33b3b; }
#credit-log { max-height: 50vh; overflow: auto; }
#credit-log p { padding: 12px 0; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
@media (max-width: 600px) { .topbar .status { display: none; } #mobile-account { max-width: 120px; } }

#model-hint { display: none !important; }
