:root {
  --ink: #0d2345;
  --muted: #71809a;
  --soft-muted: #9aa6b9;
  --line: #e1e6ef;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --sidebar: #f8f9fc;
  --coral: #f14559;
  --coral-dark: #d9344a;
  --blue-soft: #eaf1ff;
  --green: #0ca67a;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 18px 60px rgba(25, 42, 72, 0.09);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea, input, select { font: inherit; }

button { color: inherit; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: 100%;
  height: 100%;
  background: var(--canvas);
}

.titlebar {
  height: 44px;
  display: flex;
  align-items: center;
  padding-left: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-app-region: drag;
  user-select: none;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #6e7f99;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.titlebar-drag { flex: 1; height: 100%; }

.workspace {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  height: calc(100% - 44px);
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px 16px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 21px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-word {
  font-size: 17px;
  font-weight: 820;
  letter-spacing: .08em;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
}

.brand-mark i {
  position: absolute;
  width: 10px;
  height: 23px;
  border-radius: 10px;
  background: var(--coral);
  transform-origin: center;
}

.brand-mark i:nth-child(2) { transform: rotate(60deg); opacity: .9; }
.brand-mark i:nth-child(3) { transform: rotate(120deg); opacity: .78; }

.brand-mark::after {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.brand-mark--small { width: 18px; height: 18px; }
.brand-mark--small i { width: 6px; height: 14px; }
.brand-mark--small::after { width: 5px; height: 5px; }

.new-chat {
  display: flex;
  align-items: center;
  width: 100%;
  height: 46px;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #dce3ed;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(22, 39, 69, .035);
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.new-chat:hover {
  border-color: #cbd5e4;
  box-shadow: 0 7px 20px rgba(22, 39, 69, .065);
  transform: translateY(-1px);
}

.new-chat svg { width: 18px; }

kbd {
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft-muted);
  background: #fafbfc;
  font-size: 9px;
  font-family: inherit;
}

.mode-nav {
  display: grid;
  gap: 4px;
  margin: 18px 0 18px;
}

.mode-item,
.history-item {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.mode-item {
  height: 42px;
  gap: 12px;
  padding: 0 12px;
  border-radius: 11px;
  color: #687993;
  font-size: 13px;
  font-weight: 630;
  transition: color .16s ease, background .16s ease;
}

.mode-item svg { width: 18px; }
.mode-item:hover { color: var(--ink); background: #f0f3f8; }
.mode-item.is-active { color: var(--ink); background: #eaf0f8; }
.mode-item.is-active svg { color: var(--coral); }

.history {
  min-height: 0;
  overflow: hidden;
}

.history-list {
  display: grid;
  gap: 2px;
  max-height: 100%;
  overflow-y: auto;
}

.section-label {
  padding: 8px 12px 7px;
  color: #a0abba;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.history-item {
  position: relative;
  height: 38px;
  justify-content: space-between;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  color: #71809a;
  font-size: 12.5px;
  text-align: left;
}

.history-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 10px;
}

.history-row .history-item { padding-right: 35px; }
.history-row:hover,
.history-row.is-current { background: #eef2f7; }
.history-row:hover .history-item,
.history-row.is-current .history-item { color: var(--ink); background: transparent; }

.history-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item:hover,
.history-item.is-current { color: var(--ink); background: #eef2f7; }

.history-more {
  position: absolute;
  right: 5px;
  padding: 4px;
  border: 0;
  color: #8b98ac;
  background: transparent;
  letter-spacing: 1px;
  cursor: pointer;
}

.history-empty {
  margin: 8px 12px;
  color: #a0abba;
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-foot {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.plan-card,
.profile {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.plan-card:hover,
.profile:hover { background: #eef2f7; }

.plan-icon,
.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
}

.plan-icon { color: var(--coral); background: #ffe8ec; }
.plan-icon svg { width: 17px; }
.avatar { color: #fff; background: linear-gradient(145deg, #182f56, #5d7292); font-size: 13px; font-weight: 750; }

.plan-copy,
.profile-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.plan-copy strong,
.profile-copy strong { font-size: 12px; font-weight: 700; }
.plan-copy small,
.profile-copy small { overflow: hidden; color: #8b98ac; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 15px; color: #a0abba; }

.main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 28%, rgba(231, 237, 246, .65), transparent 33%),
    var(--canvas);
}

.main-header {
  display: grid;
  height: 64px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid rgba(222, 228, 237, .9);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px);
}

.conversation-title {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
}

.title-menu {
  display: grid;
  padding: 5px;
  border: 0;
  place-items: center;
  color: #8c99ac;
  background: transparent;
  cursor: pointer;
}

.title-menu svg { width: 15px; height: 15px; }

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.icon-button,
.ghost-button,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #6e7e96;
  background: transparent;
}

.icon-button:hover { background: #eef2f7; }

.ghost-button {
  height: 36px;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #e0e6ee;
  border-radius: 10px;
  color: #65758d;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
}

.ghost-button svg { width: 15px; }
.menu-button,
.sidebar-close { display: none; }

.conversation {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.welcome {
  display: flex;
  max-width: 760px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 28px 170px;
  text-align: center;
}

.welcome-symbol {
  position: relative;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
}

.welcome-symbol span {
  position: absolute;
  top: 5px;
  left: 19px;
  width: 11px;
  height: 38px;
  border-radius: 10px;
  background: var(--coral);
}

.welcome-symbol span:nth-child(2) { transform: rotate(60deg); opacity: .86; }
.welcome-symbol span:nth-child(3) { transform: rotate(120deg); opacity: .7; }
.welcome-symbol::after {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.eyebrow {
  margin: 0 0 12px;
  color: #8c99ab;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.welcome h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.welcome > p:not(.eyebrow) {
  max-width: 540px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.suggestions button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #dfe5ed;
  border-radius: 999px;
  color: #64758e;
  background: rgba(255, 255, 255, .78);
  font-size: 11px;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.suggestions button:hover { color: var(--ink); border-color: #cdd6e3; background: #fff; }

.messages {
  display: none;
  width: min(820px, calc(100% - 48px));
  flex: 1;
  overflow-y: auto;
  padding: 34px 8px 190px;
}

.messages.is-visible { display: block; }

.message {
  display: flex;
  gap: 14px;
  margin-bottom: 27px;
  animation: rise .25s ease both;
}

.message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.message.assistant .message-avatar { color: var(--coral); background: #ffe8ec; }
.message-body { padding-top: 4px; color: #273b5b; font-size: 14px; line-height: 1.7; }
.message-body strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 12px; }
.message-body p { margin: 0; white-space: pre-wrap; }

.composer-wrap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 30px 13px;
  background: linear-gradient(to bottom, rgba(245, 247, 250, 0), var(--canvas) 28%, var(--canvas));
}

.composer {
  position: relative;
  width: min(800px, 100%);
  padding: 15px 14px 12px;
  border: 1px solid #dbe2ec;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.composer:focus-within {
  border-color: #c8d2e0;
  box-shadow: 0 20px 65px rgba(25, 42, 72, .12);
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
  padding: 2px 5px 13px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  line-height: 1.55;
}

.composer textarea::placeholder { color: #9ca8b8; }

.attachment-list {
  display: none;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 3px 11px;
}

.attachment-list.is-visible { display: flex; }

.attachment-chip,
.message-attachment {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  color: #5f7089;
  background: #f7f9fb;
  font-size: 10px;
}

.attachment-chip { max-width: 210px; padding: 7px 8px 7px 10px; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button {
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  place-items: center;
  border-radius: 5px;
  color: #8895a7;
  background: transparent;
  cursor: pointer;
}
.attachment-chip button:hover { color: var(--ink); background: #e8edf4; }

.message-attachments { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.message-attachment { padding: 7px 10px; }

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-left { position: relative; display: flex; align-items: center; gap: 6px; }

.tool-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #74839a;
  background: transparent;
}

.tool-button:hover { background: #f0f3f7; }
.tool-button svg { width: 18px; }

.model-select {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: #52637e;
  background: #f3f5f8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.model-select:hover { background: #eceff4; }
.model-select svg { width: 13px; }
.auto-spark { color: var(--coral); font-size: 15px; }

.model-menu {
  position: absolute;
  bottom: 43px;
  left: 0;
  display: none;
  width: 320px;
  max-height: min(560px, 70vh);
  padding: 7px;
  border: 1px solid #dfe5ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(19, 38, 69, .16);
}

.model-menu.is-open { display: grid; gap: 2px; animation: menuIn .15s ease both; }

.model-menu-head {
  display: grid;
  gap: 9px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid #edf0f4;
}

.model-menu-head > strong { font-size: 11px; }
.model-menu-head input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe5ed;
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
  background: #f7f9fb;
  font-size: 10px;
}
.model-menu-head input:focus { border-color: #c3cedd; background: #fff; }

.model-list {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}

.model-group-label {
  padding: 11px 10px 5px;
  color: #9aa6b7;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.model-menu button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.model-menu button:hover,
.model-menu button.is-selected { background: #f3f5f8; }

.model-glyph {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #1f3456;
  font-size: 11px;
  font-weight: 800;
}

.model-glyph.auto { color: var(--coral); background: #ffe9ed; font-size: 16px; }
.model-glyph.gemini { background: linear-gradient(145deg, #4385f4, #9a67dc); }
.model-glyph.gpt { background: #161f2d; }
.model-glyph.claude { background: #c66b45; }
.model-menu button > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.model-menu strong { color: var(--ink); font-size: 11px; }
.model-menu small { color: #8c99ab; font-size: 9px; }
.model-menu button > span.model-copy { flex: 1; }
.model-cost {
  flex: 0 0 auto !important;
  padding: 4px 6px;
  border-radius: 7px;
  color: #697991;
  background: #e9edf3;
  font-size: 8px;
  font-weight: 800;
}
.model-glyph.google { background: linear-gradient(145deg, #4385f4, #9a67dc); }
.model-glyph.openai { background: #161f2d; }
.model-glyph.anthropic { background: #c66b45; }
.model-glyph.xai { background: #26384f; }
.model-glyph.other { background: #62738c; }

.send-button {
  display: grid;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 11px;
  place-items: center;
  color: #fff;
  background: var(--coral);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease, opacity .16s ease;
}

.send-button:hover:not(:disabled) { background: var(--coral-dark); transform: translateY(-1px); }
.send-button:disabled { opacity: .34; cursor: default; }
.send-button svg { width: 18px; }

.disclaimer {
  margin: 9px 0 0;
  color: #a0abba;
  font-size: 9px;
}

.scrim { display: none; }

.app-dialog {
  width: min(430px, calc(100% - 30px));
  padding: 0;
  border: 1px solid #dde4ed;
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 33, 61, .22);
}

.app-dialog::backdrop { background: rgba(10, 25, 49, .35); backdrop-filter: blur(4px); }
.app-dialog form { padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.dialog-head h2 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.025em; }
.dialog-eyebrow { margin: 0; color: var(--coral); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.field-label { display: block; margin-bottom: 7px; color: #697991; font-size: 11px; font-weight: 700; }
.text-field {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dbe2ec;
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: #f9fafc;
  font-size: 13px;
}
.text-field:focus { border-color: #bdc9d9; background: #fff; box-shadow: 0 0 0 3px rgba(73, 105, 151, .08); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.primary-button,
.danger-button {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.primary-button { color: #fff; background: var(--ink); }
.primary-button:hover { background: #17345f; }
.danger-button { margin-right: auto; color: #c73649; background: #fff0f2; }
.danger-button:hover { background: #ffe4e8; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid #edf0f4; }
.settings-row > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.settings-row strong { font-size: 12px; }
.settings-row small { color: #8996a8; font-size: 10px; }
.status-pill { padding: 5px 8px; border-radius: 999px; color: #07855f; background: #e7f7f1; font-size: 9px; font-weight: 800; }
.version-value { color: #7b899d; font-size: 11px; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding-right: 12px; padding-left: 12px; }
}

@media (max-width: 760px) {
  .titlebar { display: none; }
  .workspace { display: block; height: 100%; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 88vw);
    border-right: 0;
    box-shadow: 20px 0 60px rgba(16, 35, 65, .18);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.is-open { transform: none; }
  .sidebar-close,
  .menu-button { display: inline-flex; }
  .main { height: 100%; }
  .main-header {
    height: 58px;
    grid-template-columns: 1fr auto 1fr;
    padding: 0 12px;
  }
  .ghost-button span { display: none; }
  .ghost-button { width: 36px; padding: 0; border: 0; background: transparent; }
  .welcome { padding: 26px 22px 176px; }
  .welcome h1 { font-size: 34px; }
  .welcome > p:not(.eyebrow) { font-size: 13px; }
  .suggestions { max-width: 380px; }
  .composer-wrap { padding: 14px 12px 9px; }
  .composer { border-radius: 19px; }
  .disclaimer { display: none; }
  .messages { width: 100%; padding: 26px 18px 160px; }
  .model-menu { position: fixed; right: 12px; bottom: 88px; left: 12px; width: auto; }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(10, 25, 49, .35);
    backdrop-filter: blur(3px);
  }
  .scrim.is-visible { display: block; }
}

button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 3px solid #f4a8b3; outline-offset: 3px; }
.connection-state { color: #0b926c; font-size: 10px; white-space: nowrap; }
.connection-state::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.connection-state.is-offline { color: #bc7e26; }
.auth-screen { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 1.08fr 1fr; overflow: auto; background: #fff; }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 84px clamp(32px, 7vw, 120px); overflow: hidden; background: #f4f5f8; }
.auth-story::after { content: ''; position: absolute; bottom: -190px; right: -160px; width: 500px; height: 500px; border: 80px solid #f9e5e9; border-radius: 50%; pointer-events: none; opacity: .8; }
.auth-wordmark { position: absolute; top: 38px; left: clamp(32px, 7vw, 120px); display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 800; letter-spacing: .1em; }
.auth-kicker { color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.auth-story h1 { position: relative; z-index: 1; margin: 22px 0; font-size: clamp(40px, 4.8vw, 72px); line-height: 1.12; letter-spacing: -.055em; font-weight: 750; }
.auth-story em { color: var(--coral); font-style: normal; }
.auth-story > p { position: relative; z-index: 1; max-width: 370px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.auth-models { display: flex; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.auth-models span { padding: 9px 15px; border: 1px solid var(--line); background: #fff9; border-radius: 11px; font-size: 12px; font-weight: 650; }
.auth-story > small { position: absolute; bottom: 35px; font-size: 10px; letter-spacing: .04em; color: var(--muted); }
.auth-panel { padding: 40px 28px; display: flex; align-items: center; justify-content: center; }
.auth-form { width: 100%; max-width: 360px; }
.auth-form h2 { margin: 12px 0; font-size: 31px; letter-spacing: -.035em; }
.form-description { color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #e9ecf2; padding: 4px; border-radius: 13px; background: #f5f7fa; margin: 27px 0; }
.auth-tabs button { padding: 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.auth-tabs button.is-active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px #1523450c; font-weight: 700; }
.auth-form .field-label, #passwordForm .field-label { margin: 16px 0; line-height: 1.6; }
.auth-form input, #passwordForm input { display: block; margin-top: 7px; }
.form-error { font-size: 12px; line-height: 1.6; color: #bc3049; min-height: 18px; }
.auth-submit { width: 100%; height: 46px; background: var(--coral); font-size: 13px; }
.auth-submit:hover { background: var(--coral-dark); }
.text-button { padding: 4px 0; border: 0; background: transparent; color: #78879d; font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--coral); }
#forgotPassword { display: block; margin: 15px auto; }
.auth-footnote { color: #9aa4b4; font-size: 10px; line-height: 1.8; text-align: center; margin-top: 24px; }
.dialog-content { padding: 26px; }
.app-dialog { max-height: calc(100dvh - 40px); overflow: auto; }
.app-dialog h3 { font-size: 13px; margin: 22px 0 12px; }
.close-dialog { font-size: 24px; line-height: 1; }
.plans-dialog { width: min(790px, calc(100% - 28px)); }
.balance-summary { display: flex; align-items: center; justify-content: space-between; padding: 21px 24px; background: #f6f7fa; border: 1px solid var(--line); border-radius: 16px; gap: 20px; }
.balance-summary small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.balance-summary strong { font-size: 32px; letter-spacing: -.04em; }
.balance-summary p { white-space: pre-line; font-size: 11px; line-height: 1.9; color: var(--muted); text-align: right; }
.tariff-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 22px 0 14px; }
.tariff-card { padding: 21px 18px; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; align-items: flex-start; }
.tariff-card.current { border-color: #f3b3bf; background: #fffbfc; }
.tariff-name { font-size: 14px; font-weight: 750; margin-bottom: 19px; }
.tariff-price { font-size: 29px; letter-spacing: -.035em; }
.tariff-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.tariff-card p { font-size: 12px; margin: 20px 0; }
.tariff-card button { width: 100%; font-size: 10px; }
.redeem-form { padding: 18px 0 0 !important; }
.redeem-form > div { display: flex; align-items: center; gap: 10px; }
.redeem-form input { flex: 1; }
.form-feedback { color: #168569; font-size: 12px; line-height: 1.6; }
.usage-heading { display: flex; align-items: center; justify-content: space-between; }
.ledger-list { max-height: 240px; overflow: auto; }
.ledger-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid #eef0f4; padding: 12px 0; font-size: 11px; }
.ledger-row div { display: flex; flex-direction: column; gap: 4px; }
.ledger-row strong { font-weight: 500; }
.ledger-row small { color: var(--muted); font-size: 9px; }
.ledger-row > span { white-space: nowrap; }
.positive { color: #0a9a73; }
.pending-note { color: #a47b24; font-size: 11px; line-height: 1.6; }
.secondary-button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 13px; font-size: 11px; cursor: pointer; }
.secondary-button:hover { background: #f4f6f9; }
.settings-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.message-meta { display: flex; align-items: center; gap: 16px; color: #94a0b1; font-size: 10px; margin-top: 9px; }
.message-meta.has-warning { color: #b88129; }
.message-content .answer-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 9px 0; line-height: 1.75; }
.code-block { max-width: 100%; overflow: auto; padding: 18px; border: 1px solid #e2e7ef; border-radius: 12px; background: #f5f7fa; color: #1a3457; font: 12px/1.7 Consolas, monospace; }
.message-body { min-width: 0; }
.toast { position: fixed; z-index: 100; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: min(600px, calc(100% - 30px)); padding: 14px 20px; border-radius: 13px; background: #152d4d; color: #fff; font-size: 12px; line-height: 1.6; box-shadow: 0 10px 40px #152d4d25; }
.admin-dialog { width: min(900px, calc(100% - 26px)); }
.admin-row { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 12px 0; }
.admin-row > div { display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-wrap: anywhere; }
.admin-row strong { font-size: 12px; }
.admin-row small { font-size: 10px; color: var(--muted); }
.admin-row select { width: 100px; }
.admin-pending { border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; padding: 16px !important; display: flex; flex-wrap: wrap; gap: 10px; }
.admin-pending strong, .admin-pending small, .admin-pending p { width: 100%; overflow-wrap: anywhere; }
.admin-pending strong { font-size: 12px; }.admin-pending small { font-size: 10px; color: var(--muted); }
.admin-pending input { flex: 1; }
@media (max-width: 760px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-story { padding: 78px 28px 28px; min-height: 230px; }
  .auth-wordmark { top: 23px; left: 28px; }
  .auth-story h1 { font-size: 34px; margin: 16px 0 0; }
  .auth-story h1 br { display: none; }.auth-story h1 br::after { content: ' '; }
  .auth-story > p, .auth-models, .auth-story > small, .auth-kicker { display: none; }
  .auth-panel { padding: 30px 26px 40px; align-items: flex-start; }
  .auth-form { max-width: 430px; }
  .connection-state { font-size: 0; }.connection-state::before { width: 7px; height: 7px; }
  .dialog-content { padding: 20px; }
  .tariff-grid { gap: 8px; }.tariff-card { padding: 15px 10px; }.tariff-price { font-size: 23px; }.tariff-card button { padding: 0 6px; font-size: 9px; }
  .balance-summary { padding: 17px; }.balance-summary strong { font-size: 27px; }
  .admin-row { flex-wrap: wrap; }.admin-row > div { flex-basis: 100%; }
  .settings-dialog .dialog-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.history-search { width: 100%; padding: 9px 12px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #ffffff80; color: var(--ink); font: inherit; font-size: 11px; }
.history-search:focus { outline: 2px solid #f6c0ca; }
.media-size { max-width: 140px; border: 0; border-radius: 8px; background: #f2f4f8; color: var(--muted); padding: 8px; font: inherit; font-size: 11px; }
.media-gallery { width: min(950px, calc(100% - 48px)); flex: 1; min-height: 0; overflow-y: auto; padding: 24px 8px 205px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; align-items: start; gap: 20px; }
.media-gallery:empty { display: none; }
.media-card { border: 1px solid var(--line); border-radius: 19px; background: white; overflow: hidden; }
.media-preview { display: block; width: 100%; max-height: 410px; object-fit: contain; background: #f2f4f8; }
.media-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 195px; gap: 16px; color: #8794a8; background: radial-gradient(ellipse at 50% 30%, #fce8ed 0%, #f7f8fc 70%); font-size: 12px; }
.media-mark { font-size: 38px; color: var(--coral); }
.media-placeholder.processing .media-mark, .media-placeholder.submitting .media-mark { animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .3; transform: scale(.9); } }
.media-copy { padding: 17px 19px; }
.media-copy p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.media-copy small { display: block; color: var(--muted); font-size: 10px; line-height: 1.7; }
.media-actions { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.media-actions a { color: var(--ink); text-decoration: none; }
.attachment-preview { display: block; width: 100px; height: 80px; object-fit: cover; border-radius: 8px; margin-bottom: 7px; }
a.message-attachment { color: inherit; text-decoration: none; }
.message-content .inline-bold { display: inline; font-size: inherit; }
.message-content .inline-code { background: #e9edf3; border-radius: 4px; padding: 2px 5px; font-size: .9em; }
.message-content .answer-list { padding-left: 19px; position: relative; }
.answer-list::before { content: '•'; position: absolute; left: 3px; color: var(--coral); }
.message-content h2 { font-size: 21px; }.message-content h3 { font-size: 18px; }.message-content h4 { font-size: 15px; }
.message-content a { color: #3b66ae; }
.connections-dialog { width: min(820px,calc(100% - 28px)); }
.connections-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.connections-dialog form { padding: 0; }
.connection-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.connection-fields .wide-field { grid-column: 1 / -1; }
.connections-dialog .field-label { display: block; line-height: 1.7; margin: 0; }
.connections-dialog .text-field, .connections-dialog select { display: block; width: 100%; margin-top: 5px; }
.connection-details { margin: 20px 0; font-size: 12px; }
.connection-details summary { cursor: pointer; }
.config-json { width: 100%; min-height: 150px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: 12px/1.6 Consolas,monospace; resize: vertical; }
.media-config-row { border: 1px solid var(--line); border-radius: 13px; margin: 16px 0; padding: 16px; display: grid; gap: 10px; font-size: 12px; }
.connection-switch { font-size: 12px; }
.file-row { display: flex; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.file-row > div { flex: 1; min-width: 0; }.file-row a { font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }.file-row small { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); }
.tariff-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }.tariff-card p { white-space: pre-line; line-height: 1.9; }.tariff-card button { margin-top: auto; }
.tariff-card .pending-note { margin-bottom: 12px; }
@media (max-width: 760px) { .media-gallery { width: calc(100% - 24px); grid-template-columns: 1fr; }.tariff-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.connection-fields { grid-template-columns: 1fr; }.connection-fields .wide-field { grid-column: auto; } }
