:root {
  color-scheme: light;
  --bg: #ffffff;
  --side: #f6f6f7;
  --side-2: #fafafa;
  --line: #e7e7ea;
  --text: #1f2329;
  --muted: #747987;
  --soft: #f1f2f4;
  --dark: #111827;
  --orange: #ff7a1a;
  --purple: #bd7cff;
  --blue: #4f7cff;
  --shadow: 0 18px 60px rgba(17, 24, 39, 0.14);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body.modal-lock {
  overflow: hidden;
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.primary-sidebar,
.model-sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--side);
}

.primary-sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 14px 10px;
  box-shadow: inset -1px 0 0 rgba(17,24,39,.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 4px;
  color: #69707f;
  font-weight: 900;
}

.brand img {
  border-radius: 7px;
  box-shadow: 0 0 18px rgba(36, 107, 254, 0.14);
}

.main-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  margin-top: 16px;
  overflow: auto;
}

.nav-item,
.side-action,
.side-login,
.new-chat,
.family-item {
  border: 0;
  background: transparent;
  color: #505662;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 12px;
  text-align: left;
  font-weight: 750;
}

.nav-item span {
  width: 20px;
  color: currentColor;
  text-align: center;
  font-size: 16px;
}

.nav-item:hover,
.nav-item.active {
  color: #111827;
  background: #e8e8eb;
}

.nav-icon {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  opacity: .82;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: #6b5cff;
}

.i-chat::before {
  inset: 3px 2px 5px;
  border: 1.8px solid currentColor;
  border-radius: 5px;
}
.i-chat::after {
  left: 6px;
  bottom: 2px;
  width: 7px;
  height: 7px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: skewX(-20deg);
}
.i-apps::before {
  left: 2px;
  top: 4px;
  width: 16px;
  height: 12px;
  border-left: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: skewX(-12deg);
}
.i-apps::after {
  left: 6px;
  top: 8px;
  width: 8px;
  height: 1.8px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}
.i-image::before {
  inset: 3px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
}
.i-image::after {
  left: 5px;
  bottom: 5px;
  width: 10px;
  height: 7px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg);
}
.i-video::before {
  left: 3px;
  top: 5px;
  width: 11px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}
.i-video::after {
  right: 2px;
  top: 7px;
  width: 6px;
  height: 7px;
  border-left: 1.8px solid currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: currentColor;
}
.i-comic::before {
  inset: 3px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  box-shadow: inset 6px 0 0 transparent;
}
.i-comic::after {
  left: 7px;
  top: 3px;
  width: 1.8px;
  height: 14px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor;
}
.i-paper::before {
  left: 5px;
  top: 2px;
  width: 11px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}
.i-paper::after {
  left: 8px;
  top: 8px;
  width: 7px;
  height: 1.6px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}
.i-role::before {
  left: 4px;
  top: 3px;
  width: 12px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}
.i-role::after {
  left: 6px;
  bottom: 2px;
  width: 8px;
  height: 5px;
  border: 1.8px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}
.i-resume::before {
  left: 4px;
  top: 2px;
  width: 12px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}
.i-resume::after {
  left: 7px;
  top: 6px;
  width: 6px;
  height: 1.6px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}
.i-drama::before {
  left: 3px;
  top: 4px;
  width: 14px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 7px 7px 5px 5px;
}
.i-drama::after {
  left: 6px;
  top: 8px;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor, 3px 5px 0 -1px currentColor;
}

.sidebar-actions {
  display: grid;
  gap: 4px;
  max-height: 360px;
  overflow: auto;
  align-self: end;
  padding-top: 10px;
}

.model-sidebar .sidebar-actions {
  max-height: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  border-radius: 9px;
  padding: 0 10px;
  text-align: left;
}

.side-action:hover,
.side-action.pro {
  background: #fff;
}

.side-action.pro {
  border: 1px solid #dedfe3;
  color: #111827;
  font-weight: 900;
}

.side-action small {
  color: #9ca3af;
  font-size: 11px;
}

.side-login {
  min-height: 34px;
  margin-top: 8px;
  border: 1px solid #9aa0aa;
  border-radius: 10px;
  background: #fff;
  font-weight: 850;
}

.model-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 14px 10px;
  background: var(--side-2);
  overflow: hidden;
}

.unified-brand {
  margin-bottom: 8px;
}

.model-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 4px;
}

.model-side-head strong { font-size: 16px; }
.model-side-head button { border: 0; background: transparent; color: #4b5563; font-size: 18px; }

.new-chat {
  min-height: 38px;
  margin: 4px 0 14px;
  border: 1px dashed #d9d9df;
  border-radius: 12px;
  background: #fff;
  color: #4b5563;
  font-weight: 800;
}

.model-family-list {
  overflow: visible;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 2px;
  padding-right: 0;
}

.model-family-list::-webkit-scrollbar,
.chat-history::-webkit-scrollbar {
  width: 6px;
}

.model-family-list::-webkit-scrollbar-thumb,
.chat-history::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c7cad1;
}

.family-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  border-radius: 10px;
  padding: 0 12px;
  text-align: left;
  font-weight: 750;
}

.model-mark {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #6c7cff;
}

.model-mark::before,
.model-mark::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.model-mark.all::before {
  left: 4px;
  top: 2px;
  width: 12px;
  height: 16px;
  background: #6677ff;
  clip-path: polygon(50% 0, 62% 34%, 100% 50%, 62% 66%, 50% 100%, 38% 66%, 0 50%, 38% 34%);
}
.model-mark.gpt::before {
  inset: 3px;
  border: 1.6px solid #8a8f9b;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 3px #fff,
    0 -3px 0 -1px #8a8f9b,
    3px 0 0 -1px #8a8f9b,
    0 3px 0 -1px #8a8f9b,
    -3px 0 0 -1px #8a8f9b;
}
.model-mark.gpt::after {
  left: 7px;
  top: 7px;
  width: 6px;
  height: 6px;
  border: 1.4px solid #8a8f9b;
  border-radius: 50%;
}
.model-mark.gemini::before {
  inset: 3px;
  background: #5e82ff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.model-mark.claude::before {
  inset: 3px;
  border-radius: 50%;
  background: repeating-conic-gradient(#ff7a3d 0 10deg, transparent 10deg 20deg);
}
.model-mark.claude::after {
  inset: 7px;
  border-radius: 50%;
  background: #ff7a3d;
}
.model-mark.deepseek::before {
  left: 2px;
  top: 5px;
  width: 15px;
  height: 10px;
  background: #4f72ff;
  clip-path: polygon(0 55%, 24% 20%, 62% 20%, 84% 0, 76% 42%, 100% 58%, 62% 62%, 42% 100%, 30% 68%);
}
.model-mark.deepseek::after {
  left: 10px;
  top: 8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
}
.model-mark.qwen::before {
  content: "通";
  inset: 2px;
  color: #4f72ff;
  font-size: 14px;
  font-weight: 950;
  line-height: 16px;
}
.model-mark.grok::before {
  content: "𝕏";
  inset: 1px;
  color: #6677ff;
  font-size: 15px;
  font-weight: 950;
  line-height: 18px;
}
.model-mark.scene::before {
  left: 4px;
  top: 2px;
  width: 12px;
  height: 16px;
  background: #ff6a3d;
  clip-path: polygon(50% 0, 62% 34%, 100% 50%, 62% 66%, 50% 100%, 38% 66%, 0 50%, 38% 34%);
}

.family-item:hover,
.family-item.active {
  color: #111827;
  background: #efeff2;
}

.sync-tip {
  margin: 12px 0 4px;
  color: #777d89;
  text-align: center;
  font-size: 12px;
}

.sync-tip.small {
  margin-top: 0;
  color: #9aa1af;
  font-size: 12px;
}

.chat-history {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.history-title {
  color: #9aa1af;
  font-size: 12px;
  font-weight: 900;
}

.history-empty {
  margin: 0;
  border: 1px dashed #e0e2e8;
  border-radius: 12px;
  padding: 18px 10px;
  color: #a1a7b3;
  text-align: center;
  font-size: 12px;
}

.history-item {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 10px;
  overflow: hidden;
  background: transparent;
  color: #555b67;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item + .history-empty {
  display: none;
}

.history-item:hover,
.history-item.active { background: #eef0f3; }

.side-tool-panel {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.side-tool-status {
  color: #98a2b3;
  font-size: 12px;
}

.side-tool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.side-tool-tabs button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #7b8190;
  font-weight: 800;
}

.side-tool-tabs button.active {
  color: #111827;
  border-bottom: 2px solid #6b7280;
}

.paper-stage {
  display: grid;
  gap: 8px;
}

.paper-stage p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.paper-stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.paper-stage-grid button {
  min-height: 96px;
  border: 1px solid #e7e8ec;
  border-radius: 10px;
  background: #fff;
  color: #2a303b;
  text-align: center;
}

.paper-stage-grid b,
.paper-stage-grid span {
  display: block;
}

.paper-stage-grid b {
  margin-bottom: 7px;
  font-size: 13px;
}

.paper-stage-grid span {
  color: #9aa1af;
  font-size: 11px;
}

.paper-stage-grid button:hover {
  border-color: #c9d4ff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.workspace {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 52% 25%, rgba(87, 130, 255, .15), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(186, 72, 255, .11), transparent 28%),
    linear-gradient(#ffffff, #fbfdff 52%, #ffffff);
}

.workspace::before,
.workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.workspace::before {
  opacity: .58;
  background-image:
    linear-gradient(rgba(92, 135, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 135, 255, .08) 1px, transparent 1px),
    radial-gradient(circle, rgba(56, 103, 255, .18) 1px, transparent 1.5px);
  background-size: 72px 72px, 72px 72px, 24px 24px;
  animation: gridDrift 18s linear infinite;
}

.workspace::after {
  opacity: .5;
  background:
    linear-gradient(100deg, transparent 5%, rgba(91, 124, 255, .16) 43%, transparent 58%),
    linear-gradient(80deg, transparent 20%, rgba(184, 79, 255, .12) 48%, transparent 68%);
  transform: translateX(-18%);
  animation: beamSweep 8s ease-in-out infinite alternate;
}

.topbar,
.view {
  position: relative;
  z-index: 1;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 72px 72px, 72px 72px, 24px 24px; }
}

@keyframes beamSweep {
  from { transform: translateX(-20%) skewX(-8deg); }
  to { transform: translateX(16%) skewX(-8deg); }
}

.tool-workbench {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  justify-items: stretch;
}

.tool-hero {
  text-align: center;
}

.tool-hero span {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  min-height: 28px;
  border-radius: 999px;
  color: #7a2cff;
  background: #f3e7ff;
  font-size: 12px;
  font-weight: 900;
}

.tool-hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
}

.tool-hero p {
  margin: 0 auto;
  max-width: 640px;
  color: #727987;
  line-height: 1.8;
}

.tool-preset-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tool-preset-row button,
.tool-options button {
  min-height: 36px;
  border: 1px solid #e3e6ed;
  border-radius: 999px;
  padding: 0 14px;
  color: #596173;
  background: #fff;
  font-weight: 850;
}

.tool-preset-row button:hover,
.tool-options button:hover {
  border-color: #d3b7ff;
  color: #7b22ff;
  background: #fbf6ff;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.role-card-grid button {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid #e3e6ed;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  color: #303846;
  text-align: left;
  box-shadow: 0 10px 28px rgba(17,24,39,.05);
}

.role-card-grid button:hover,
.role-card-grid button.active {
  border-color: #cda7ff;
  background: linear-gradient(180deg, #fff, #fbf5ff);
  box-shadow: 0 16px 36px rgba(138,63,252,.12);
  transform: translateY(-1px);
}

.role-card-grid b {
  color: #151b26;
  font-size: 18px;
}

.role-card-grid span {
  color: #606978;
  line-height: 1.55;
}

.role-card-grid small {
  color: #8a2cff;
  font-weight: 900;
}

.tool-options button.selected-option {
  border-color: #8a3ffc;
  color: #7a24ff;
  background: #f1e5ff;
  box-shadow: inset 0 0 0 1px rgba(138, 63, 252, .18);
}

.tool-composer {
  display: grid;
  gap: 12px;
  border: 1px solid #e3e6ed;
  border-radius: 18px;
  padding: 16px;
  background: #f8f9fb;
  box-shadow: 0 12px 42px rgba(17, 24, 39, .06);
}

.tool-model-picker {
  position: relative;
}

.tool-model-picker .tool-model-menu {
  display: none;
}

.tool-model-picker.expanded .tool-model-menu,
.tool-model-picker:focus-within .tool-model-menu {
  display: block;
}

.tool-model-current {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  border: 1px solid #dfe3eb;
  border-radius: 14px;
  padding: 10px 14px;
  background: #fff;
  color: #202734;
  text-align: left;
}

.tool-model-current .model-logo-mini {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e8fff7;
}

.tool-model-current .model-logo-mini::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #18c891;
  box-shadow: inset 0 0 0 4px #e8fff7;
}

.tool-model-current b,
.tool-model-current small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-model-current b {
  font-size: 16px;
}

.tool-model-current small {
  color: #7b8493;
  font-size: 12px;
}

.tool-model-current i {
  grid-column: 3;
  grid-row: 1 / 3;
  color: #8a91a0;
  font-style: normal;
}

.tool-model-menu {
  position: relative;
  z-index: 3;
  left: 0;
  right: 0;
  top: auto;
  margin-top: 8px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #dfe3eb;
  border-radius: 14px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(17,24,39,.16);
}

.tool-model-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: -8px -8px 8px;
  background: #f2f3f6;
}

.tool-model-tabs button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #5d6573;
  font-weight: 850;
}

.tool-model-tabs button.active {
  color: #111827;
  background: #fff;
}

.tool-model-menu p {
  margin: 8px 4px;
  color: #d49123;
  font-size: 12px;
  font-weight: 900;
}

.tool-model-list {
  display: grid;
  gap: 3px;
}

.tool-model-list button {
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 0 9px;
  background: transparent;
  color: #27303c;
  text-align: left;
}

.tool-model-list button.active,
.tool-model-list button:hover {
  background: #ececef;
}

.tool-model-list b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.tool-model-list small {
  color: #7d8491;
  white-space: nowrap;
}

.tool-model-list i {
  color: #606775;
  font-style: normal;
}

.model-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #20c995;
  box-shadow: inset 0 0 0 4px #fff;
}

.tool-composer textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: #222733;
  line-height: 1.7;
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tool-options span {
  margin-left: auto;
  border: 1px solid #ffd18a;
  border-radius: 999px;
  padding: 8px 12px;
  color: #f08a00;
  background: #fff7e8;
  font-size: 13px;
  font-weight: 900;
}

.option-dropdown {
  position: relative;
}

.option-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.option-current i {
  color: #7c8493;
  font-style: normal;
}

.option-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: none;
  min-width: 150px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #dfe3eb;
  border-radius: 12px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17,24,39,.16);
}

.option-dropdown.open .option-menu,
.option-dropdown:focus-within .option-menu {
  display: grid;
  gap: 4px;
}

.option-menu button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  background: transparent;
  color: #303846;
  text-align: left;
  font-weight: 850;
}

.option-menu button:hover {
  color: #7a24ff;
  background: #f3e7ff;
}

.tool-options .tool-submit,
.tool-submit {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #8a3ffc, #ff6ab7);
  box-shadow: 0 8px 22px rgba(138, 63, 252, .22);
}

.tool-output {
  min-height: 116px;
  display: grid;
  place-items: center;
  border: 1px dashed #d9dce3;
  border-radius: 16px;
  padding: 20px;
  color: #9aa1af;
  background: #fff;
}

.tool-output.has-result,
.drama-empty.has-result {
  display: block;
  color: #2b3240;
  text-align: left;
}

.result-card {
  display: grid;
  gap: 12px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-head b {
  font-size: 17px;
}

.result-head span {
  border-radius: 999px;
  padding: 6px 10px;
  color: #f08a00;
  background: #fff7e8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.result-card p {
  margin: 0;
  color: #4b5563;
}

.result-card ol {
  margin: 0;
  padding-left: 20px;
  color: #5f6675;
  line-height: 1.9;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.result-actions button,
.result-actions .artifact-download {
  min-height: 34px;
  border: 1px solid #e1e5ee;
  border-radius: 999px;
  padding: 0 14px;
  color: #4f5664;
  background: #fff;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.result-actions button:hover,
.result-actions .artifact-download:hover {
  border-color: #d1b3ff;
  color: #7a24ff;
  background: #faf5ff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
}

.promo-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(800px, calc(100vw - 540px));
  min-height: 36px;
  border: 1px solid #ffd18a;
  border-radius: 999px;
  padding: 0 14px;
  color: #e85900;
  background: #fff7e8;
  box-shadow: 0 6px 22px rgba(255, 122, 26, 0.10);
  font-size: 13px;
  white-space: nowrap;
}

.promo-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-pill strong {
  color: #ff2d55;
}

.top-login {
  position: absolute;
  right: 18px;
  top: 18px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: #f1f2f4;
  color: #444b57;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
  font-weight: 850;
}

.view {
  position: relative;
  display: none;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  padding: 96px 28px 40px;
}

.view.active { display: block; }

#view-chat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 440px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(79,124,255,.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(130,93,255,.08) 1px, transparent 1px),
    radial-gradient(circle, rgba(79,124,255,.22) 1px, transparent 1.5px);
  background-size: 72px 72px, 72px 72px, 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.86), rgba(0,0,0,.18) 70%, transparent);
  animation: sciGrid 18s linear infinite;
}

#view-chat::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 10%;
  top: 132px;
  height: 190px;
  pointer-events: none;
  border-top: 1px solid rgba(105, 125, 255, .20);
  border-bottom: 1px solid rgba(189, 124, 255, .20);
  background:
    linear-gradient(110deg, transparent 0 35%, rgba(255,255,255,.82) 48%, rgba(122,144,255,.28) 52%, transparent 66%),
    repeating-linear-gradient(90deg, transparent 0 52px, rgba(79,124,255,.10) 54px, transparent 58px);
  filter: blur(.2px);
  opacity: .74;
  transform: skewY(-2deg);
  animation: sciSweep 4.8s ease-in-out infinite;
}

@keyframes sciGrid {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 72px 72px, -72px 72px, 22px 22px; }
}

@keyframes sciSweep {
  0%, 100% { opacity: .25; transform: translateX(-10%) skewY(-2deg); }
  45%, 55% { opacity: .82; transform: translateX(8%) skewY(-2deg); }
}

.hero-models {
  position: relative;
  z-index: 1;
  width: min(1280px, 100%);
  margin: 170px auto 10px;
  overflow: hidden;
  color: #10131c;
  font-size: clamp(34px, 4.3vw, 58px);
  font-weight: 950;
  white-space: nowrap;
  letter-spacing: 0;
  perspective: 900px;
}

.hero-models::before,
.hero-models::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 12%;
  pointer-events: none;
}

.hero-models::before {
  left: 0;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0));
}

.hero-models::after {
  right: 0;
  background: linear-gradient(270deg, #fff, rgba(255,255,255,0));
}

.hero-model-track {
  display: inline-flex;
  align-items: baseline;
  gap: 44px;
  min-width: max-content;
  animation: modelMarquee 26s linear infinite;
  filter: drop-shadow(0 10px 20px rgba(79, 124, 255, .12));
}

.hero-model-track span {
  position: relative;
  text-shadow:
    0 1px 0 rgba(255,255,255,.92),
    0 0 18px rgba(124,143,255,.25);
}

.hero-model-track span::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(103, 126, 255, .55), transparent);
  opacity: .6;
}

.hero-model-track span:nth-child(7n+1) { color: #d9d9df; }
.hero-model-track span:nth-child(7n+2) { color: #6b51a6; }
.hero-model-track span:nth-child(7n+3) { color: #10131c; }
.hero-model-track span:nth-child(7n+4) { color: #758dff; }
.hero-model-track span:nth-child(7n+5) { color: #6c56a8; }
.hero-model-track span:nth-child(7n+6) { color: #725dff; }
.hero-model-track span:nth-child(7n) { color: #6f9bff; }

.hero-models sup {
  color: #b6bbc6;
  font-size: 13px;
  font-weight: 900;
}

@keyframes modelMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero-subtitle {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #767c8a;
  text-align: center;
  font-size: 16px;
}

.group-banner {
  width: min(740px, 100%);
  min-height: 64px;
  margin: 32px auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #efc7ff;
  border-radius: 16px;
  padding: 0 26px;
  color: #6f35c2;
  background: linear-gradient(90deg, #fff0ff, #fff7fb);
  box-shadow: 0 8px 22px rgba(189, 124, 255, 0.18);
}

.group-banner span {
  font-weight: 900;
}

.group-banner strong {
  justify-self: start;
  overflow: hidden;
  color: #5b6472;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-banner em {
  font-style: normal;
  font-weight: 900;
}

.chat-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: 0 auto;
}

#view-chat.chatting {
  min-height: calc(100vh - 72px);
  padding: 54px 28px 118px;
}

#view-chat.chatting .hero-models,
#view-chat.chatting .hero-subtitle,
#view-chat.chatting .group-banner,
#view-chat.chatting .tool-row {
  display: none;
}

#view-chat.chatting .chat-card {
  width: min(860px, 100%);
  min-height: calc(100vh - 230px);
  display: grid;
  grid-template-rows: minmax(240px, 1fr) auto;
}

#view-chat.chatting .messages {
  max-height: calc(100vh - 250px);
  align-content: start;
  padding: 12px 4px 22px;
}

#view-chat.chatting .ask-box {
  position: fixed;
  z-index: 20;
  left: calc(244px + (100vw - 244px - min(860px, 100vw - 320px)) / 2);
  right: max(28px, calc((100vw - 244px - min(860px, 100vw - 320px)) / 2));
  bottom: 26px;
  min-height: 78px;
  border: 1px solid rgba(132, 146, 176, .22);
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 52px rgba(17,24,39,.12);
  backdrop-filter: blur(14px);
}

.messages {
  min-height: 0;
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.messages.empty {
  max-height: 0;
  margin-bottom: 0;
}

.bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.bubble.ai {
  justify-self: start;
  background: #f3f4f7;
  color: #333946;
}

.bubble.user {
  justify-self: end;
  color: #fff;
  background: #151924;
}

.bubble.usage-bubble {
  justify-self: center;
  max-width: min(720px, 94%);
  padding: 7px 12px;
  border: 1px solid rgba(132, 146, 176, .18);
  border-radius: 999px;
  color: #7b8495;
  background: rgba(247, 248, 251, .86);
  font-size: 12px;
  line-height: 1.35;
}

.artifact-link {
  display: table;
  margin-top: 10px;
  border: 1px solid rgba(125, 94, 255, .24);
  border-radius: 999px;
  padding: 7px 12px;
  color: #6b35ff;
  background: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.artifact-link:hover {
  border-color: rgba(125, 94, 255, .45);
  background: #fff;
}

.task-progress {
  display: grid;
  gap: 10px;
  width: min(100%, 620px);
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(18, 24, 38, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 28px rgba(18, 24, 38, .08);
}

.task-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.task-progress-head strong {
  color: #111827;
}

.task-progress-head span {
  color: #64748b;
}

.task-progress ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-progress li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 12px;
  color: #475569;
}

.task-progress li span {
  color: #2563eb;
  font-weight: 800;
}

.task-progress li em {
  font-style: normal;
  word-break: break-word;
}

.ask-box {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 8px;
  min-height: 88px;
  border-radius: 16px;
  padding: 14px 14px;
  background: #f1f1f3;
}

.ask-box input {
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2d3440;
  font-size: 16px;
}

.tool-plus,
.send-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #6a717e;
  font-size: 20px;
}

.send-btn {
  width: 38px;
  height: 38px;
  color: #fff;
  background: #101828;
  font-size: 18px;
}

.model-chip,
.tool-row button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  color: #5a6270;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
}

.model-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.tool-row button {
  min-height: 34px;
  border: 1px solid rgba(214, 218, 226, .9);
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 22px rgba(17,24,39,.04);
}

.cost-hint {
  margin: 12px 0 0;
  color: #9aa1af;
  text-align: center;
  font-size: 12px;
}

.page-head {
  width: min(960px, 100%);
  margin: 60px auto 24px;
}

.page-head p {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.page-head span { color: var(--muted); }

.apps-grid,
.feature-grid {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.apps-grid button,
.feature-grid button,
.placeholder-tool {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(17, 24, 39, 0.05);
}

.apps-grid button,
.feature-grid button {
  min-height: 132px;
  padding: 20px;
  text-align: left;
}

.apps-grid button:hover,
.feature-grid button:hover { transform: translateY(-2px); border-color: #c6d2ff; }
.apps-grid strong,
.feature-grid strong { display: block; font-size: 19px; }
.apps-grid span,
.feature-grid span { display: block; margin-top: 10px; color: var(--muted); }

.app-studio {
  width: min(1040px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.app-studio-head {
  min-height: 260px;
  border: 1px solid #e7e8ef;
  border-radius: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 20%, rgba(138,63,252,.14), transparent 28%),
    linear-gradient(150deg, #fff, #f7f8ff);
  box-shadow: 0 14px 38px rgba(17,24,39,.06);
}

.app-studio-head span {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  color: #7a24ff;
  background: #f1e4ff;
  font-size: 12px;
  font-weight: 900;
}

.app-studio-head h2 {
  margin: 18px 0 10px;
  font-size: 28px;
}

.app-studio-head p {
  margin: 0;
  color: #6f7787;
  line-height: 1.8;
}

.app-studio .tool-composer {
  min-height: 260px;
}

.app-studio .tool-output {
  grid-column: 1 / -1;
}

.placeholder-tool {
  width: min(780px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.placeholder-tool input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  outline: 0;
}

.placeholder-tool button,
.pay-action {
  border: 0;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-weight: 900;
}

.placeholder-tool button { padding: 0 18px; }

.paper-workbench {
  position: relative;
  min-height: calc(100vh - 72px);
  margin: -96px -28px -40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.82)),
    radial-gradient(circle at 68% 30%, rgba(255,255,255,.2), rgba(255,255,255,.9) 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='820' viewBox='0 0 1400 820'%3E%3Crect width='1400' height='820' fill='%23f6f3ee'/%3E%3Cg opacity='.22'%3E%3Crect x='520' y='190' width='350' height='58' rx='10' fill='%237b5b44' transform='rotate(7 520 190)'/%3E%3Crect x='500' y='250' width='390' height='58' rx='10' fill='%23926d4f' transform='rotate(7 500 250)'/%3E%3Crect x='480' y='310' width='420' height='58' rx='10' fill='%23aa8060' transform='rotate(7 480 310)'/%3E%3Crect x='470' y='370' width='430' height='58' rx='10' fill='%237b5b44' transform='rotate(7 470 370)'/%3E%3Cellipse cx='920' cy='575' rx='260' ry='70' fill='%23d8cabc'/%3E%3Crect x='710' y='520' width='440' height='90' rx='14' fill='%23fffaf3' transform='rotate(-8 710 520)'/%3E%3Ccircle cx='1190' cy='480' r='82' fill='none' stroke='%23bcae9f' stroke-width='15'/%3E%3Crect x='1090' y='545' width='250' height='70' rx='35' fill='%23efe4d8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.real-paper {
  place-items: stretch;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  padding: 118px 38px 38px;
  background:
    linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.94)),
    radial-gradient(circle at 70% 20%, rgba(138,63,252,.10), transparent 36%),
    linear-gradient(120deg, #f7f8fb, #fff);
}

.paper-editor {
  min-width: 0;
  align-self: start;
  border: 1px solid #e5e7ee;
  border-radius: 18px;
  padding: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 52px rgba(17,24,39,.08);
}

.paper-editor-head span {
  color: #7a24ff;
  font-size: 13px;
  font-weight: 950;
}

.paper-editor-head h1 {
  margin: 8px 0 8px;
  font-size: 28px;
}

.paper-editor-head p {
  margin: 0 0 18px;
  color: #6f7787;
}

.paper-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.paper-form label {
  display: grid;
  gap: 7px;
  color: #2c3340;
  font-size: 13px;
  font-weight: 850;
}

.paper-form input,
.paper-form select,
.paper-form textarea {
  min-height: 44px;
  border: 1px solid #e2e5ec;
  border-radius: 12px;
  padding: 0 12px;
  outline: 0;
  background: #fff;
  color: #222733;
}

.paper-form textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.paper-wide,
.paper-form .tool-options,
.paper-form .tool-model-picker {
  grid-column: 1 / -1;
}

.drama-box .tool-model-picker {
  margin-bottom: 12px;
}

.drama-box .tool-model-menu {
  text-align: left;
}

.paper-preview {
  align-self: start;
  display: grid;
  gap: 10px;
  border: 1px solid #e5e7ee;
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 32px rgba(17,24,39,.06);
}

.paper-preview b {
  font-size: 16px;
}

.paper-preview span {
  border-radius: 12px;
  padding: 12px;
  color: #5c6472;
  background: #f4f5f8;
  font-weight: 850;
}

.paper-preview p {
  margin: 8px 0 0;
  color: #7a8290;
  font-size: 13px;
  line-height: 1.75;
}

.paper-flow {
  align-self: stretch;
  min-height: 0;
  overflow: auto;
  border-left: 1px solid #e5e7ee;
  padding-left: 16px;
}

.paper-flow-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.paper-flow-head b {
  font-size: 18px;
}

.paper-flow-head small {
  color: #9aa1af;
}

.paper-flow-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
  border-bottom: 1px solid #dfe3eb;
}

.paper-flow-tabs button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #777f8e;
  font-weight: 850;
}

.paper-flow-tabs button.active {
  color: #111827;
  border-bottom: 2px solid #6c7483;
}

.paper-flow p {
  margin: 16px 0 10px;
  color: #7a8290;
  font-size: 13px;
  font-weight: 900;
}

.paper-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.paper-flow-grid button {
  min-height: 86px;
  border: 1px solid #e7e9ef;
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.82);
  color: #353d4a;
}

.paper-flow-grid button:hover,
.paper-flow-grid button.active {
  border-color: #d8d1ff;
  background: #fbf8ff;
  box-shadow: 0 10px 24px rgba(17,24,39,.06);
}

.paper-flow-grid b,
.paper-flow-grid span {
  display: block;
}

.paper-flow-grid b {
  margin-bottom: 6px;
  font-size: 13px;
}

.paper-flow-grid span {
  color: #9aa1af;
  font-size: 11px;
}

.history-float {
  position: absolute;
  right: 28px;
  top: 28px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  color: #fff;
  background: rgba(17, 24, 39, .32);
  font-weight: 850;
}

.paper-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  color: #3b3f49;
}

.paper-doc-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 16px;
  color: #fff;
  background: rgba(17, 24, 39, .22);
  font-size: 34px;
}

.paper-empty h1 {
  margin: 24px 0 10px;
  font-size: 28px;
}

.paper-empty p {
  margin: 0 0 34px;
  color: #7b8190;
  line-height: 1.8;
}

.paper-progress {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 12px;
}

.paper-progress span {
  min-width: 88px;
  min-height: 70px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(17, 24, 39, .28);
  font-weight: 850;
}

.paper-progress small {
  display: block;
  color: rgba(255,255,255,.72);
  font-weight: 700;
}

.resume-builder {
  width: min(1040px, 100%);
  margin: -28px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
}

.resume-head {
  grid-column: 1 / -1;
  text-align: center;
}

.resume-head span {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  color: #8a2cff;
  background: #f2e4ff;
  font-size: 12px;
  font-weight: 950;
}

.resume-head h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3.6vw, 42px);
}

.resume-head p {
  margin: 0 auto;
  max-width: 720px;
  color: #747c8b;
  line-height: 1.75;
}

.resume-form {
  display: grid;
  gap: 16px;
}

.resume-step,
.resume-result {
  border: 1px solid #e7e9ef;
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 34px rgba(17,24,39,.05);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-title b {
  color: #667085;
  font-size: 13px;
}

.step-title strong {
  font-size: 16px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.choice-grid button,
.tag-cloud button,
.more-jobs {
  min-height: 38px;
  border: 1px solid #e1e5ec;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: #465061;
  font-weight: 850;
}

.choice-grid button:hover,
.choice-grid button.selected-option,
.tag-cloud button:hover,
.tag-cloud button.active {
  border-color: #a149ff;
  color: #8b28ff;
  background: #f5e9ff;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
}

.search-row input,
.resume-step input,
.resume-step textarea {
  min-height: 44px;
  border: 1px solid #e2e5ec;
  border-radius: 12px;
  padding: 0 12px;
  outline: 0;
  background: #fff;
}

.search-row button,
.resume-submit-row .tool-submit {
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #7f33ff, #e95ec8);
  font-weight: 950;
}

.tag-cloud {
  max-height: 126px;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.tag-cloud.expanded {
  max-height: 240px;
}

.tag-cloud::-webkit-scrollbar {
  width: 6px;
}

.tag-cloud::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9cdd6;
}

.more-jobs {
  margin-top: 10px;
  color: #ff7a1a;
  border-color: #ffcf9a;
  background: #fff8ef;
}

.resume-selected {
  display: inline-block;
  margin-top: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #8a2cff;
  background: #f6ebff;
  font-weight: 850;
}

.resume-step.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.resume-step label {
  display: grid;
  gap: 8px;
  color: #333b49;
  font-size: 13px;
  font-weight: 850;
}

.resume-step textarea {
  width: 100%;
  min-height: 128px;
  padding: 12px;
  resize: vertical;
}

.template-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resume-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid #e7e9ef;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.resume-submit-row [data-point-estimate] {
  margin-left: auto;
}

.resume-result {
  align-self: start;
  position: sticky;
  top: 88px;
  min-height: 320px;
  color: #596173;
  line-height: 1.8;
}

.resume-result.has-result {
  color: #27303c;
}

.pricing-page {
  width: min(1120px, 100%);
  margin: -40px auto 0;
}

.back-home {
  border: 0;
  background: transparent;
  color: #667085;
  font-weight: 800;
}

.pricing-page h1 {
  margin: 12px 0 18px;
  text-align: center;
  font-size: 26px;
}

.pricing-tabs {
  width: 246px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #d8dbe2;
  border-radius: 12px;
  padding: 4px;
  background: #f5f6f8;
}

.pricing-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #586070;
  font-weight: 850;
}

.pricing-tabs button.active {
  color: #fff;
  background: #111827;
}

.pricing-promo {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #ffd18a;
  border-radius: 10px;
  color: #ff7a1a;
  background: #fff7e8;
  font-size: 13px;
}

.pricing-promo b {
  border-radius: 6px;
  padding: 3px 7px;
  background: #ffe0b8;
}

.pricing-promo strong {
  color: #ff4d6d;
}

.pricing-note {
  margin: 18px 0;
  color: #667085;
  text-align: center;
}

.plan-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.plan-grid.active {
  display: grid;
}

.plan-card {
  position: relative;
  min-height: 360px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  border: 1px solid #ffd18a;
  border-radius: 16px;
  padding: 24px 18px 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.plan-card em {
  position: absolute;
  top: -12px;
  right: 18px;
  border-radius: 999px;
  padding: 3px 12px;
  color: #fff;
  background: #5d6675;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.plan-card h3 {
  margin: 0;
  font-size: 19px;
}

.plan-card strong {
  color: #ff2d55;
  font-size: 30px;
  font-weight: 950;
}

.plan-card strong small {
  color: #7b8190;
  font-size: 14px;
}

.plan-card ul {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid #e8e8ec;
  list-style: none;
  color: #222733;
  line-height: 2.1;
}

.plan-card li::before {
  content: "✓";
  margin-right: 8px;
  color: #00b578;
}

.plan-card button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(90deg, #ff2d55, #e6007e);
  font-weight: 900;
}

.plan-card.orange button { background: linear-gradient(90deg, #ff9f0a, #ff6a00); }
.plan-card.dark { border-color: #a7adb7; box-shadow: 0 10px 28px rgba(17,24,39,.10); }
.plan-card.dark button { background: #5d6675; }
.plan-card.blue { border-color: #9bbcff; }
.plan-card.blue button { background: #246bfe; }

.credit-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.credit-grid.active {
  display: grid;
}

.credit-grid article {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid #ffe0b8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.credit-grid article.hot {
  border-color: #ffcb7a;
  box-shadow: 0 12px 34px rgba(255, 122, 26, 0.12);
}

.credit-grid em {
  position: absolute;
  right: 12px;
  top: -10px;
  border-radius: 999px;
  padding: 3px 10px;
  color: #fff;
  background: #ff7a1a;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.credit-grid strong {
  color: #ffb000;
  font-size: 34px;
  font-weight: 950;
}

.credit-grid span {
  color: #667085;
}

.credit-grid b {
  color: #ff2d55;
  font-size: 26px;
}

.credit-grid small {
  color: #98a2b3;
}

.drama-layout {
  width: min(1220px, 100%);
  min-height: calc(100vh - 124px);
  margin: -48px auto 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
}

.drama-panel {
  border-right: 1px solid var(--line);
  padding: 12px 12px 0 0;
  color: #667085;
}

.drama-primary,
.drama-lib {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid #e5d0ff;
  background: #f2ddff;
  color: #8a2cff;
  font-weight: 900;
}

.drama-lib {
  margin-top: 10px;
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #5f6675;
}

.drama-history {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
}

.drama-panel p {
  margin-top: 52px;
  text-align: center;
  color: #a1a7b3;
  font-size: 13px;
  line-height: 1.8;
}

.drama-main {
  display: grid;
  justify-items: center;
  align-content: start;
  padding-top: 70px;
}

.drama-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #e4c2ff;
  border-radius: 16px;
  color: #b32cff;
  background: #f6e6ff;
  font-size: 24px;
}

.drama-main h1 {
  margin: 22px 0 8px;
  font-size: 30px;
}

.drama-main h1 span {
  color: #c42fff;
}

.drama-main > p {
  margin: 0 0 34px;
  color: #667085;
}

.drama-box {
  width: min(760px, 100%);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  background: #f8f8fa;
}

.drama-box input {
  width: 100%;
  min-height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
}

.drama-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.drama-tools button,
.drama-tabs button {
  min-height: 34px;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 0 12px;
  color: #6b7280;
  background: #fff;
  font-weight: 800;
}

.drama-tools .credit {
  margin-left: auto;
  border-color: #ffd18a;
  color: #f08a00;
  background: #fff7e8;
}

.drama-tools .drama-send {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #b13cff, #ff75bd);
}

.drama-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 58px;
}

.drama-tabs button.active {
  border-color: #e6c2ff;
  color: #951cff;
  background: #f4e3ff;
}

.drama-cards {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.drama-cards button {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid #e4e7ee;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.86);
  color: #27303c;
  text-align: left;
  box-shadow: 0 10px 24px rgba(17,24,39,.05);
}

.drama-cards button:hover {
  border-color: #cda7ff;
  color: #7a24ff;
  background: #fbf5ff;
  transform: translateY(-1px);
}

.drama-cards b {
  font-size: 15px;
}

.drama-cards span {
  color: #7b8493;
  font-size: 12px;
  line-height: 1.45;
}

.drama-empty {
  width: min(900px, 100%);
  min-height: 98px;
  display: grid;
  place-items: center;
  margin-top: 14px;
  border: 1px dashed #d9dce3;
  border-radius: 14px;
  color: #9aa1af;
  font-size: 13px;
}

dialog {
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
}

.onboarding-modal {
  width: min(520px, calc(100vw - 36px));
  border: 0;
  border-radius: 26px;
  padding: 0;
  background: transparent;
}

.onboarding-card {
  padding: 54px 42px 36px;
  border-radius: 26px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.onboarding-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  color: #f5bd32;
  font-size: 34px;
}

.onboarding-card h2 {
  margin: 0 0 18px;
  font-size: 28px;
}

.onboarding-card p {
  margin: 0 auto;
  max-width: 380px;
  color: #777d89;
  font-size: 18px;
  line-height: 1.75;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 32px;
}

.onboarding-dots span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #e2e4e8;
}

.onboarding-dots span.active {
  background: #7d8492;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.onboarding-actions button {
  min-height: 58px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #6b7280;
  font-size: 18px;
  font-weight: 850;
}

.onboarding-actions button:last-child {
  border-color: #7f8796;
  color: #fff;
  background: #737b8b;
}

.modal-close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
  font-size: 24px;
}

.account-modal {
  width: min(780px, calc(100vw - 28px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.account-modal[open] {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.login-showcase {
  min-height: 520px;
  padding: 30px;
  color: #fff;
  background: linear-gradient(160deg, #353535, #8d939b);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.login-brand img { border-radius: 8px; }
.login-brand strong { display: block; }
.login-brand span { display: block; color: rgba(255,255,255,.72); font-size: 12px; }

.login-showcase h2 {
  margin: 0 0 14px;
  font-size: 25px;
  line-height: 1.22;
}

.login-showcase p,
.login-showcase li {
  color: rgba(255,255,255,.82);
  line-height: 1.75;
}

.login-showcase ul {
  list-style: none;
  padding: 0;
  margin: 26px 0;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.logo-grid span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.84);
  font-size: 11px;
  font-weight: 800;
}

.login-panel {
  padding: 34px 30px;
}

.login-panel h2 {
  margin: 0 0 8px;
}

.login-panel > p {
  margin: 0 0 22px;
  color: #9aa1ad;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.login-form label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}

.code-row label {
  min-width: 0;
}

.code-btn {
  min-height: 50px;
  border: 1px solid #f3c78d;
  border-radius: 12px;
  background: #fff;
  color: #e88826;
  font-weight: 900;
}

.agreement {
  margin: 2px 0 18px;
  color: #a1a6b0;
  text-align: center;
  font-size: 12px;
}

.agreement a {
  color: #d99836;
}

.login-form label span {
  color: #8a91a0;
}

.login-form input {
  min-width: 0;
  border: 0;
  outline: 0;
}

.login-form button {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #111827;
  font-weight: 900;
}

.login-form.compact {
  grid-template-columns: 1fr auto;
}

.login-form.compact label {
  grid-template-columns: 64px minmax(0, 1fr);
}

.login-form.compact button {
  padding: 0 16px;
}

.account-status,
.invite-card,
.access-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
}

.account-status span,
.invite-card p,
.access-panel span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.invite-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.invite-card p { grid-column: 1 / -1; margin: 0; }
.invite-card button,
.access-panel button {
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  background: #111827;
  color: #fff;
  font-weight: 800;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.access-panel input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  outline: 0;
}

.access-panel span { grid-column: 1 / -1; }

.center-modal {
  width: min(880px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  overflow: auto;
  background: #f6f7fb;
  box-shadow: var(--shadow);
}

.center-modal[open] {
  display: block;
}

.center-page {
  padding: 26px;
}

.center-page h1 {
  margin: 12px 0 18px;
  font-size: 28px;
}

.center-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.center-card,
.center-action {
  border: 1px solid #e4e7ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .05);
}

.profile-card {
  grid-column: span 2;
  min-height: 150px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #8a3ffc, #ff72ba);
  font-size: 26px;
  font-weight: 950;
}

.profile-card strong,
.profile-card span {
  display: block;
}

.profile-card span {
  margin: 6px 0 10px;
  color: #7a8290;
}

.profile-card button,
.center-action {
  border: 0;
}

.profile-card button {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: #7a24ff;
  background: #f2e6ff;
  font-weight: 850;
}

.plan-badge {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  background: #111827;
}

.plan-badge small {
  color: rgba(255,255,255,.68);
}

.quota-card {
  grid-row: span 2;
  padding: 18px;
}

.quota-card h3 {
  margin: 0 0 12px;
}

.quota-card p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 7px;
  color: #5c6472;
  font-size: 13px;
}

.quota-card i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a3ffc var(--w), #edf0f5 0);
}

.quota-card i.darkbar {
  background: linear-gradient(90deg, #111827 var(--w), #edf0f5 0);
}

.center-action {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  text-align: left;
}

.center-action b {
  font-size: 16px;
}

.center-action span {
  color: #7a8290;
  font-size: 13px;
}

.center-action.hot {
  color: #fff;
  background: linear-gradient(135deg, #8a3ffc, #ff72ba);
}

.center-action.hot span {
  color: rgba(255,255,255,.82);
}

.center-action.danger b {
  color: #e5484d;
}

.center-theme-panel {
  grid-column: span 2;
  min-height: 104px;
  border: 1px solid #e4e7ef;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .05);
}

.center-theme-panel[hidden] {
  display: none;
}

.center-theme-panel button {
  min-height: 72px;
  border: 1px solid #e7e9f0;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #222936;
  background: #f8f9fb;
  text-align: left;
  font-weight: 900;
}

.center-theme-panel button.active {
  border-color: #b781ff;
  background: #f3e8ff;
  color: #7a24ff;
}

.feedback-modal {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: #172033;
  background: #fff;
  box-shadow: 0 28px 90px rgba(17,24,39,.28);
}

.feedback-card {
  padding: 26px;
}

.feedback-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.feedback-card p {
  margin: 0 0 18px;
  color: #737b8d;
  line-height: 1.7;
}

.feedback-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.feedback-form label {
  display: grid;
  gap: 7px;
  color: #343b48;
  font-size: 13px;
  font-weight: 850;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #e1e5ee;
  border-radius: 12px;
  padding: 0 12px;
  outline: 0;
  background: #f8f9fb;
}

.feedback-form textarea {
  min-height: 132px;
  padding: 12px;
  resize: vertical;
}

.feedback-wide,
.feedback-form button,
#feedbackResult {
  grid-column: 1 / -1;
}

.feedback-form button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(90deg, #8a3ffc, #ff6ab7);
  font-weight: 950;
}

#feedbackResult {
  min-height: 20px;
  color: #7a24ff;
  font-size: 13px;
  font-weight: 850;
}

.theme-popover {
  position: fixed;
  z-index: 80;
  width: 178px;
  border: 1px solid #e1e4eb;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(17,24,39,.18);
}

.theme-popover b {
  display: block;
  margin: 4px 8px 8px;
  color: #7a8290;
  font-size: 12px;
}

.theme-popover button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px 1fr 16px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #313844;
  text-align: left;
  font-weight: 850;
}

.theme-popover button:hover,
.theme-popover button.active {
  background: #f2f3f6;
}

.theme-ico {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111827 0 50%, #fff 50% 100%);
  border: 1px solid #d9dce4;
}

.theme-ico.dark {
  background: #111827;
}

.theme-ico.light {
  background: #fff;
}

.theme-dark {
  color-scheme: dark;
  --bg: #111318;
  --side: #181b22;
  --side-2: #151821;
  --line: #2a2f3a;
  --text: #f5f7fb;
  --muted: #a5adbc;
  --soft: #222733;
}

.theme-dark body,
.theme-dark .workspace,
.theme-dark .topbar {
  background: #111318;
}

.theme-dark .primary-sidebar,
.theme-dark .model-sidebar,
.theme-dark .tool-composer,
.theme-dark .tool-output,
.theme-dark .apps-grid button,
.theme-dark .app-studio-head,
.theme-dark .paper-editor,
.theme-dark .paper-preview,
.theme-dark .account-modal,
.theme-dark .center-modal,
.theme-dark .model-modal,
.theme-dark .pro-modal,
.theme-dark .theme-popover,
.theme-dark .chat-card .messages,
.theme-dark .ask-box,
.theme-dark .new-chat,
.theme-dark .side-action.pro,
.theme-dark .side-login {
  background: #181b22;
  color: #f5f7fb;
  border-color: #2a2f3a;
}

.theme-dark input,
.theme-dark textarea,
.theme-dark select {
  background: #111318;
  color: #f5f7fb;
  border-color: #2a2f3a;
}

.theme-dark .hero-models::before {
  background: linear-gradient(90deg, #111318, rgba(17,19,24,0));
}

.theme-dark .hero-models::after {
  background: linear-gradient(270deg, #111318, rgba(17,19,24,0));
}

.model-modal {
  width: min(650px, calc(100vw - 24px));
  max-height: min(650px, calc(100vh - 40px));
  border: 1px solid #d7d9df;
  border-radius: 12px;
  padding: 0 0 14px;
  background: #f3f3f5;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.model-modal-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #d7d9df;
}

.model-modal-head button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #59606c;
  font-weight: 850;
}

.model-modal-head button.active {
  background: #fff;
}

.model-search {
  width: calc(100% - 24px);
  min-height: 34px;
  margin: 10px 12px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
  background: #e8e8eb;
}

.model-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: min(520px, calc(100vh - 150px));
  overflow: auto;
  padding: 0 12px;
}

.model-group {
  min-height: 0;
  max-height: min(500px, calc(100vh - 170px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.model-group::-webkit-scrollbar {
  width: 6px;
}

.model-group::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c7cad1;
}

.model-group h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  color: #7b8190;
  font-size: 13px;
}

.model-group h3 span {
  color: #5d7fff;
}

.model-group h3 small {
  margin-left: 2px;
  color: #a3a8b4;
  font-size: 10px;
}

.model-group button {
  width: 100%;
  min-height: 92px;
  border: 0;
  border-radius: 7px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  color: #1f2329;
  text-align: left;
  font-size: 13px;
}

.model-group button:hover,
.model-group button.active {
  background: #dddde1;
}

.model-row-icon {
  display: none;
  color: #5d7fff;
  text-align: center;
  font-weight: 900;
}

.model-logo {
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111827;
  font-size: 12px;
  font-weight: 950;
}

.model-logo::before {
  content: "N";
}

.brand-openai::before {
  content: "◎";
  font-size: 19px;
  line-height: 1;
}

.brand-claude {
  background: #8b5a2b;
}

.brand-claude::before {
  content: "C";
}

.brand-gemini {
  background: linear-gradient(135deg, #4285f4, #a142f4);
}

.brand-gemini::before {
  content: "G";
}

.brand-deepseek {
  background: #2563eb;
}

.brand-deepseek::before {
  content: "D";
}

.brand-qwen {
  background: #6d5dfc;
}

.brand-qwen::before {
  content: "Q";
}

.brand-grok {
  background: #111;
}

.brand-grok::before {
  content: "X";
}

.model-logo {
  position: relative;
  overflow: hidden;
  object-fit: cover;
}

.model-logo::before {
  display: none;
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background:
    radial-gradient(circle at 25% 30%, #6cf 0 2px, transparent 3px),
    radial-gradient(circle at 72% 25%, #a7f 0 2px, transparent 3px),
    radial-gradient(circle at 36% 74%, #8f6 0 2px, transparent 3px),
    linear-gradient(135deg, #13233e, #04070e);
  box-shadow: 0 0 8px rgba(118, 140, 255, .38);
}

.brand-openai {
  background: #101318;
}

.brand-openai::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, transparent 0 18deg, #fff 18deg 30deg, transparent 30deg 78deg, #fff 78deg 90deg, transparent 90deg 138deg, #fff 138deg 150deg, transparent 150deg 198deg, #fff 198deg 210deg, transparent 210deg 258deg, #fff 258deg 270deg, transparent 270deg 318deg, #fff 318deg 330deg, transparent 330deg);
  box-shadow: inset 0 0 0 4px #101318;
}

.brand-claude::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 8%, #fff 0 18%, transparent 19%),
    radial-gradient(ellipse at 92% 50%, #fff 0 18%, transparent 19%),
    radial-gradient(ellipse at 50% 92%, #fff 0 18%, transparent 19%),
    radial-gradient(ellipse at 8% 50%, #fff 0 18%, transparent 19%),
    radial-gradient(circle, #fff 0 18%, transparent 19%);
}

.brand-gemini::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 0;
  background: linear-gradient(135deg, #fff, #dbeafe);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.brand-deepseek::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 35%, #fff 0 2px, transparent 3px);
}

.brand-qwen::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
}

.brand-grok::before {
  content: "";
  width: 15px;
  height: 15px;
  background:
    linear-gradient(45deg, transparent 43%, #fff 44% 56%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, #fff 44% 56%, transparent 57%);
}

.model-modal {
  width: min(680px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 34px));
  border: 1px solid rgba(211, 216, 228, .92);
  border-radius: 16px;
  padding: 0 0 16px;
  color: #101828;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 26px 80px rgba(15, 23, 42, .20);
}

.model-modal-title {
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid rgba(226, 232, 240, .85);
}

.model-modal-title strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 850;
}

.model-modal .modal-close {
  top: 15px;
  right: 18px;
  color: #64748b;
}

.model-columns {
  max-height: min(612px, calc(100vh - 108px));
  padding: 10px 16px 0;
}

.model-group {
  max-height: none;
  padding-right: 2px;
}

.model-group button {
  min-height: 104px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 13px 14px;
  color: #101828;
  background: transparent;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.model-group button:hover {
  border-color: rgba(203, 213, 225, .86);
  background: rgba(248, 250, 252, .92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.model-group button.active {
  border-color: rgba(129, 140, 248, .32);
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.82), 0 12px 28px rgba(99, 102, 241, .10);
}

.model-logo {
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.model-row-text b {
  margin-bottom: 5px;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0;
}

.model-row-text small {
  margin-top: 3px;
  color: #5f6b7a;
  font-size: 11.5px;
  font-weight: 760;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.model-group button i {
  align-self: start;
  min-width: 28px;
  padding-top: 4px;
  color: #0f172a;
  font-size: 12px;
}

.theme-dark .model-modal {
  border-color: rgba(51, 65, 85, .9);
  background: linear-gradient(180deg, #151923 0%, #10131a 100%);
  color: #f8fafc;
}

.theme-dark .model-modal-title {
  border-bottom-color: rgba(51, 65, 85, .9);
}

.theme-dark .model-modal-title strong,
.theme-dark .model-row-text b,
.theme-dark .model-group button i {
  color: #f8fafc;
}

.theme-dark .model-row-text small {
  color: #aab4c3;
}

.theme-dark .model-group button:hover {
  border-color: rgba(71, 85, 105, .9);
  background: rgba(30, 41, 59, .62);
}

.theme-dark .model-group button.active {
  border-color: rgba(129, 140, 248, .42);
  background: linear-gradient(180deg, rgba(49, 46, 129, .62), rgba(15, 23, 42, .95));
}

.model-row-text {
  min-width: 0;
}

.model-row-text b,
.model-row-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-row-text small {
  margin-top: 3px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
}

.model-group button i {
  align-self: start;
  padding-top: 2px;
  color: #111827;
  font-style: normal;
  font-weight: 900;
}

.pro-modal {
  width: min(820px, calc(100vw - 28px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.pro-modal[open] {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.pro-left,
.pro-plans {
  padding: 34px;
}

.pro-left {
  color: #fff;
  background: linear-gradient(160deg, #111827, #424b5f);
}

.pro-left ul {
  margin: 24px 0 0;
  padding-left: 18px;
  line-height: 2;
}

.pro-plans label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
}

.pro-plans label.selected {
  border-color: #c495ff;
  background: #faf4ff;
}

.pay-action {
  display: grid;
  place-items: center;
  min-height: 46px;
  margin-top: 18px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .primary-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: auto;
    grid-template-rows: auto auto;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav {
    display: flex;
    overflow-x: auto;
    margin-top: 6px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .sidebar-actions {
    display: none;
  }

  .model-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .model-family-list,
  .chat-history {
    display: flex;
    overflow-x: auto;
  }

  .family-item,
  .history-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .promo-pill {
    max-width: calc(100vw - 96px);
  }

  .top-login {
    right: 10px;
  }

  .view {
    padding: 24px 12px 30px;
  }

  .hero-models {
    margin-top: 38px;
    justify-content: flex-start;
    overflow-x: hidden;
    gap: 24px;
    font-size: 34px;
  }

  .ask-box {
    grid-template-columns: 34px minmax(0, 1fr) 38px;
  }

  .model-chip {
    display: none;
  }

  .apps-grid,
  .feature-grid,
  .account-modal[open],
  .pro-modal[open],
  .model-columns {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    display: none;
  }

  .login-form.compact {
    grid-template-columns: 1fr;
  }
}

.force-mobile .app-shell {
  grid-template-columns: 1fr;
}

.force-mobile .primary-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: auto;
  grid-template-rows: auto auto;
  gap: 8px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.force-mobile .main-nav,
.force-mobile .model-family-list,
.force-mobile .chat-history {
  display: flex;
  overflow-x: auto;
}

.force-mobile .nav-item,
.force-mobile .family-item,
.force-mobile .history-item {
  flex: 0 0 auto;
  white-space: nowrap;
}

.force-mobile .sidebar-actions {
  display: none;
}

.force-mobile .model-sidebar {
  min-height: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.force-mobile .promo-pill {
  max-width: calc(100vw - 96px);
}

.force-mobile .view {
  padding: 24px 12px 30px;
}

.force-mobile .hero-models {
  margin-top: 38px;
  justify-content: flex-start;
  overflow-x: hidden;
  gap: 24px;
  font-size: 34px;
}

.force-mobile .ask-box {
  grid-template-columns: 34px minmax(0, 1fr) 38px;
}

.force-mobile .model-chip {
  display: none;
}

.force-mobile .apps-grid,
.force-mobile .feature-grid,
.force-mobile .account-modal[open],
.force-mobile .pro-modal[open],
.force-mobile .model-columns {
  grid-template-columns: 1fr;
}

.force-mobile .login-showcase {
  display: none;
}

.force-mobile #view-chat.chatting {
  padding: 18px 10px 112px;
  min-height: calc(100vh - 128px);
}

.force-mobile #view-chat.chatting .chat-card {
  min-height: calc(100vh - 210px);
}

.force-mobile #view-chat.chatting .messages {
  max-height: calc(100vh - 236px);
}

.force-mobile #view-chat.chatting .ask-box {
  left: 10px;
  right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom));
}

.force-mobile .tool-workbench,
.force-mobile .resume-builder,
.force-mobile .drama-layout,
.force-mobile .app-studio {
  width: 100%;
  margin: 0;
  grid-template-columns: 1fr;
}

.force-mobile .tool-hero {
  text-align: left;
}

.force-mobile .tool-hero h1,
.force-mobile .resume-head h1,
.force-mobile .drama-main h1 {
  font-size: 28px;
}

.force-mobile .tool-options,
.force-mobile .drama-tools,
.force-mobile .tool-preset-row {
  overflow-x: auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
}

.force-mobile .tool-options > *,
.force-mobile .drama-tools > *,
.force-mobile .tool-preset-row > * {
  flex: 0 0 auto;
}

.force-mobile .tool-model-menu,
.force-mobile .option-menu {
  position: fixed;
  left: 10px;
  right: 10px;
  top: auto;
  bottom: calc(14px + env(safe-area-inset-bottom));
  max-height: 72vh;
  overflow: auto;
  z-index: 80;
  border-radius: 18px;
}

.force-mobile .paper-workbench,
.force-mobile .real-paper {
  margin: 0;
  min-height: auto;
  grid-template-columns: 1fr;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.force-mobile .paper-form,
.force-mobile .resume-step.two-col,
.force-mobile .choice-grid,
.force-mobile .template-grid,
.force-mobile .role-card-grid,
.force-mobile .drama-cards,
.force-mobile .image-preview-grid,
.force-mobile .image-preview-grid.media-grid-1 {
  grid-template-columns: 1fr;
}

.force-mobile .paper-flow {
  order: -1;
  max-height: 260px;
  overflow: auto;
}

.force-mobile .paper-flow-grid,
.force-mobile .tag-cloud,
.force-mobile .drama-cards {
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
}

.force-mobile .drama-layout {
  min-height: auto;
  gap: 14px;
}

.force-mobile .drama-panel {
  display: none;
}

.force-mobile .drama-main {
  padding-top: 0;
  justify-items: stretch;
}

.force-mobile .drama-tabs {
  margin-top: 18px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.force-mobile .account-modal[open],
.force-mobile .center-modal[open],
.force-mobile .feedback-modal[open],
.force-mobile .pro-modal[open] {
  width: min(96vw, 520px);
  max-height: 88vh;
  overflow: auto;
}

.force-mobile .center-theme-panel {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
}

.image-preview-grid {
  margin: 12px 0 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.image-preview-grid.media-grid-1 {
  grid-template-columns: minmax(260px, 520px);
}

.image-preview-grid figure {
  margin: 0;
}

.ai-generated-preview {
  width: 100%;
  min-height: 220px;
  display: block;
  border-radius: 18px;
  object-fit: cover;
  background: #eef2ff;
  box-shadow: 0 16px 38px rgba(126, 63, 252, .20);
}

.ai-image-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border-radius: 18px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 24% 22%, rgba(255,255,255,.45), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(145,90,255,.58), transparent 30%),
    linear-gradient(135deg, #172033, #7b3cff 48%, #ff73ba);
  box-shadow: 0 16px 38px rgba(126,63,252,.22);
}

.ai-image-preview span {
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 950;
}

.ai-image-preview b {
  max-width: 80%;
  font-size: 18px;
  line-height: 1.45;
}

.image-preview-grid figcaption {
  margin-top: 8px;
  color: #8b93a3;
  font-size: 12px;
}

.video-preview-card {
  margin: 12px 0 16px;
  display: grid;
  gap: 10px;
}

.video-screen {
  min-height: 260px;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  overflow: hidden;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.28), transparent 24%),
    linear-gradient(135deg, #101827, #6d5cff 48%, #27d6ff);
  box-shadow: 0 16px 38px rgba(39, 98, 255, .20);
}

.video-screen::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
}

.video-screen span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  clip-path: polygon(35% 25%, 35% 75%, 76% 50%);
}

.video-screen b {
  font-size: 30px;
  letter-spacing: 0;
}

.video-screen em,
.video-preview-card p {
  margin: 0;
  color: #eef4ff;
  font-style: normal;
}

.video-preview-card p {
  color: #7a8290;
  font-size: 13px;
}

.model-config-wrap {
  max-height: 520px;
  overflow: auto;
}

.model-config-table {
  min-width: 1180px;
}

.model-config-table input,
.model-config-table select,
.model-config-table textarea {
  width: 100%;
  min-width: 88px;
  box-sizing: border-box;
  border: 1px solid rgba(127, 139, 161, .28);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255,255,255,.92);
  color: #172033;
  font: inherit;
}

.model-config-table textarea {
  min-width: 180px;
  min-height: 44px;
  resize: vertical;
}

.model-config-table input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  accent-color: #6157ff;
}

.admin-agent-form {
  display: grid;
  grid-template-columns: 180px 180px minmax(260px, 1fr) 130px;
  gap: 10px;
  align-items: stretch;
}

.admin-agent-form textarea {
  min-height: 78px;
  resize: vertical;
}

.admin-agent-form button {
  min-height: 48px;
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-inline-actions button,
.site-ops-grid button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  background: #111827;
  font-weight: 800;
}

.site-ops-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}

.site-ops-grid label {
  display: grid;
  gap: 6px;
  color: #556070;
  font-size: 13px;
  font-weight: 800;
}

.site-ops-grid select {
  min-height: 40px;
  border: 1px solid rgba(127, 139, 161, .28);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
}

.site-file-editor {
  width: 100%;
  min-height: 360px;
  box-sizing: border-box;
  border: 1px solid rgba(127, 139, 161, .24);
  border-radius: 12px;
  padding: 14px;
  background: #0f172a;
  color: #dbeafe;
  font: 13px/1.55 Consolas, "SFMono-Regular", monospace;
  resize: vertical;
}

@media (max-width: 900px) {
  .admin-agent-form {
    grid-template-columns: 1fr;
  }

  .site-ops-grid {
    grid-template-columns: 1fr;
  }
}

/* final layout guard: keep the public shell from falling back to the old 3-column draft */
body:not(.admin-page) .app-shell {
  grid-template-columns: 200px minmax(0, 1fr);
}

body:not(.admin-page) .workspace {
  width: auto;
  max-width: none;
  grid-column: 2;
}

@media (max-width: 980px) {
  body:not(.admin-page) .app-shell {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page) .workspace {
    grid-column: 1;
  }
}

.force-mobile body:not(.admin-page) .app-shell,
html.force-mobile body:not(.admin-page) .app-shell {
  grid-template-columns: 1fr;
}

html.force-mobile body:not(.admin-page) .workspace {
  grid-column: 1;
}

/* premium minimal home polish */
body:not(.admin-page) .workspace {
  background:
    radial-gradient(circle at 50% 22%, rgba(102, 123, 255, .22), transparent 34%),
    radial-gradient(circle at 70% 34%, rgba(196, 118, 255, .18), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 48%, #ffffff 100%);
}

body:not(.admin-page) .workspace::before {
  opacity: .72;
  background-image:
    linear-gradient(rgba(74, 111, 255, .105) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 111, 255, .105) 1px, transparent 1px),
    radial-gradient(circle, rgba(73, 108, 255, .30) 1px, transparent 1.7px);
  background-size: 76px 76px, 76px 76px, 23px 23px;
}

body:not(.admin-page) .workspace::after {
  opacity: .66;
  background:
    linear-gradient(104deg, transparent 20%, rgba(255,255,255,.86) 38%, rgba(105,126,255,.30) 45%, rgba(255,255,255,.72) 52%, transparent 66%),
    radial-gradient(ellipse at 55% 32%, rgba(255,255,255,.92), rgba(255,255,255,0) 42%);
  filter: blur(.1px);
}

body:not(.admin-page) #view-chat {
  padding-top: 104px;
}

body:not(.admin-page) #view-chat::before {
  height: 620px;
  opacity: .88;
  background:
    linear-gradient(90deg, rgba(75, 110, 255, .10) 1px, transparent 1px),
    linear-gradient(0deg, rgba(112, 95, 255, .10) 1px, transparent 1px),
    radial-gradient(circle, rgba(62, 94, 255, .30) 1px, transparent 1.55px);
  background-size: 80px 80px, 80px 80px, 22px 22px;
}

body:not(.admin-page) #view-chat::after {
  left: 8%;
  right: 6%;
  top: 122px;
  height: 265px;
  border-color: rgba(118, 132, 255, .18);
  background:
    linear-gradient(108deg, transparent 0 31%, rgba(255,255,255,.96) 43%, rgba(113,133,255,.34) 49%, rgba(255,255,255,.84) 56%, transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 62px, rgba(77, 109, 255, .12) 64px, transparent 68px);
  opacity: .9;
}

body:not(.admin-page) .hero-models {
  width: min(1500px, 100%);
  margin: 188px auto 22px;
  font-size: clamp(54px, 5.7vw, 92px);
  font-weight: 920;
  line-height: 1.02;
}

body:not(.admin-page) .hero-model-track {
  gap: 58px;
  animation-duration: 30s;
  filter: drop-shadow(0 16px 28px rgba(89, 111, 255, .20));
}

body:not(.admin-page) .hero-model-track span {
  text-shadow:
    0 1px 0 rgba(255,255,255,.96),
    0 0 26px rgba(103,124,255,.28);
}

body:not(.admin-page) .hero-model-track span:nth-child(7n+1) { color: rgba(16, 24, 40, .16); }
body:not(.admin-page) .hero-model-track span:nth-child(7n+2) { color: #151b2d; }
body:not(.admin-page) .hero-model-track span:nth-child(7n+3) { color: #5875ff; }
body:not(.admin-page) .hero-model-track span:nth-child(7n+4) { color: #5f45a7; }
body:not(.admin-page) .hero-model-track span:nth-child(7n+5) { color: #6e4cff; }
body:not(.admin-page) .hero-model-track span:nth-child(7n+6) { color: rgba(96, 122, 255, .26); }
body:not(.admin-page) .hero-model-track span:nth-child(7n) { color: #121826; }

body:not(.admin-page) .hero-models::before {
  width: 18%;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.86) 42%, rgba(255,255,255,0));
}

body:not(.admin-page) .hero-models::after {
  width: 18%;
  background: linear-gradient(270deg, #fff 0%, rgba(255,255,255,.86) 42%, rgba(255,255,255,0));
}

body:not(.admin-page) .chat-card {
  width: min(780px, 100%);
}

body:not(.admin-page) .ask-box {
  min-height: 88px;
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(255,255,255,.82);
  box-shadow:
    0 26px 80px rgba(15, 23, 42, .10),
    inset 0 1px 0 rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
}

body:not(.admin-page) .ask-box input {
  color: #111827;
  font-size: 16px;
  font-weight: 520;
}

body:not(.admin-page) .ask-box input::placeholder {
  color: #8a94a6;
}

body:not(.admin-page) .tool-plus {
  color: #667085;
}

body:not(.admin-page) .model-chip {
  min-height: 38px;
  padding: 0 13px;
  color: #334155;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

body:not(.admin-page) .send-btn {
  width: 42px;
  height: 42px;
  background: linear-gradient(180deg, #111827, #020617);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .22);
}

@media (max-width: 980px) {
  body:not(.admin-page) #view-chat {
    padding-top: 34px;
  }

  body:not(.admin-page) .hero-models {
    margin-top: 64px;
    font-size: clamp(40px, 12vw, 64px);
  }

  body:not(.admin-page) .ask-box {
    min-height: 78px;
    border-radius: 18px;
  }
}

/* premium mobile app polish */
@media (max-width: 760px) {
  body:not(.admin-page) .app-shell {
    min-height: 100svh;
    grid-template-columns: 1fr;
    background: #fff;
  }

  body:not(.admin-page) .model-sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 66px;
    height: 66px;
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, .82);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 10px 34px rgba(15, 23, 42, .05);
  }

  body:not(.admin-page) .unified-brand {
    height: 44px;
    margin: 0;
    padding: 0;
    color: #0f172a;
  }

  body:not(.admin-page) .unified-brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  body:not(.admin-page) .unified-brand span {
    font-size: 15px;
    font-weight: 900;
  }

  body:not(.admin-page) .new-chat {
    grid-column: 2;
    min-height: 38px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    padding: 0 14px;
    color: #fff;
    background: #111827;
    font-size: 13px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  }

  body:not(.admin-page) .chat-history,
  body:not(.admin-page) .side-tool-panel {
    display: none;
  }

  body:not(.admin-page) .sidebar-actions {
    position: fixed;
    z-index: 45;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 20px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .16);
    backdrop-filter: blur(18px);
  }

  body:not(.admin-page) .side-action,
  body:not(.admin-page) .side-login {
    min-height: 40px;
    margin: 0;
    border: 0;
    border-radius: 14px;
    padding: 0 6px;
    color: #334155;
    background: transparent;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
  }

  body:not(.admin-page) .side-action.pro {
    color: #111827;
    background: #f1f5f9;
  }

  body:not(.admin-page) .workspace {
    min-height: calc(100svh - 66px);
    background:
      radial-gradient(circle at 50% 18%, rgba(105, 122, 255, .24), transparent 38%),
      radial-gradient(circle at 80% 30%, rgba(198, 118, 255, .17), transparent 28%),
      linear-gradient(180deg, #fff 0%, #fbfcff 58%, #fff 100%);
  }

  body:not(.admin-page) .topbar {
    min-height: 0;
    height: 0;
    padding: 0;
  }

  body:not(.admin-page) .top-login {
    display: none;
  }

  body:not(.admin-page) #view-chat {
    min-height: calc(100svh - 66px);
    padding: 64px 16px 108px;
  }

  body:not(.admin-page) #view-chat::before {
    height: 520px;
    background-size: 54px 54px, 54px 54px, 18px 18px;
    opacity: .82;
  }

  body:not(.admin-page) #view-chat::after {
    left: 0;
    right: 0;
    top: 78px;
    height: 230px;
    opacity: .72;
  }

  body:not(.admin-page) .hero-models {
    width: 100%;
    margin: 78px auto 24px;
    font-size: clamp(48px, 16vw, 72px);
    line-height: .98;
  }

  body:not(.admin-page) .hero-model-track {
    gap: 34px;
    animation-duration: 24s;
  }

  body:not(.admin-page) .chat-card {
    width: 100%;
  }

  body:not(.admin-page) .ask-box {
    grid-template-columns: 34px minmax(0, 1fr) auto 42px;
    min-height: 78px;
    border-radius: 22px;
    padding: 12px 12px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .13), inset 0 1px 0 rgba(255,255,255,.96);
  }

  body:not(.admin-page) .model-chip {
    display: inline-flex;
    max-width: 108px;
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  body:not(.admin-page) .send-btn {
    width: 42px;
    height: 42px;
  }
}

html.force-mobile body:not(.admin-page) .model-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
}

html.force-mobile body:not(.admin-page) .app-shell {
  min-height: 100svh;
  grid-template-columns: 1fr;
  background: #fff;
}

html.force-mobile body:not(.admin-page) .model-sidebar {
  min-height: 66px;
  height: 66px;
  border-right: 0;
  border-bottom: 1px solid rgba(226, 232, 240, .82);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 34px rgba(15, 23, 42, .05);
}

html.force-mobile body:not(.admin-page) .unified-brand {
  height: 44px;
  margin: 0;
  padding: 0;
  color: #0f172a;
}

html.force-mobile body:not(.admin-page) .unified-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

html.force-mobile body:not(.admin-page) .unified-brand span {
  font-size: 15px;
  font-weight: 900;
}

html.force-mobile body:not(.admin-page) .new-chat {
  grid-column: 2;
  min-height: 38px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: #111827;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}

html.force-mobile body:not(.admin-page) .chat-history,
html.force-mobile body:not(.admin-page) .side-tool-panel {
  display: none;
}

html.force-mobile body:not(.admin-page) .sidebar-actions {
  position: fixed;
  z-index: 45;
  top: auto;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 20px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 22px 60px rgba(15, 23, 42, .16);
  backdrop-filter: blur(18px);
}

html.force-mobile body:not(.admin-page) .side-action,
html.force-mobile body:not(.admin-page) .side-login {
  min-height: 40px;
  margin: 0;
  border: 0;
  border-radius: 14px;
  padding: 0 6px;
  color: #334155;
  background: transparent;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

html.force-mobile body:not(.admin-page) .side-action.pro {
  color: #111827;
  background: #f1f5f9;
}

html.force-mobile body:not(.admin-page) .workspace {
  min-height: calc(100svh - 66px);
  background:
    radial-gradient(circle at 50% 18%, rgba(105, 122, 255, .24), transparent 38%),
    radial-gradient(circle at 80% 30%, rgba(198, 118, 255, .17), transparent 28%),
    linear-gradient(180deg, #fff 0%, #fbfcff 58%, #fff 100%);
}

html.force-mobile body:not(.admin-page) .topbar {
  min-height: 0;
  height: 0;
  padding: 0;
}

html.force-mobile body:not(.admin-page) .top-login {
  display: none;
}

html.force-mobile body:not(.admin-page) #view-chat {
  min-height: calc(100svh - 66px);
  padding: 64px 16px 108px;
}

html.force-mobile body:not(.admin-page) #view-chat::before {
  height: 520px;
  background-size: 54px 54px, 54px 54px, 18px 18px;
  opacity: .82;
}

html.force-mobile body:not(.admin-page) #view-chat::after {
  left: 0;
  right: 0;
  top: 78px;
  height: 230px;
  opacity: .72;
}

html.force-mobile body:not(.admin-page) .hero-models {
  width: 100%;
  margin: 78px auto 24px;
  font-size: clamp(48px, 16vw, 72px);
  line-height: .98;
}

html.force-mobile body:not(.admin-page) .hero-model-track {
  gap: 34px;
  animation-duration: 24s;
}

html.force-mobile body:not(.admin-page) .chat-card {
  width: 100%;
}

html.force-mobile body:not(.admin-page) .ask-box {
  grid-template-columns: 34px minmax(0, 1fr) auto 42px;
  min-height: 78px;
  border-radius: 22px;
  padding: 12px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 22px 60px rgba(15, 23, 42, .13), inset 0 1px 0 rgba(255,255,255,.96);
}

html.force-mobile body:not(.admin-page) .model-chip {
  display: inline-flex;
  max-width: 108px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

html.force-mobile body:not(.admin-page) .send-btn {
  width: 42px;
  height: 42px;
}

html.force-mobile body:not(.admin-page) .model-sidebar .sidebar-actions,
html.force-mobile body:not(.admin-page) .sidebar-actions.unified-actions {
  inset: auto 12px calc(10px + env(safe-area-inset-bottom)) 12px !important;
  top: auto !important;
  bottom: calc(10px + env(safe-area-inset-bottom)) !important;
}

/* unified NEXA brand mark */
body:not(.admin-page) .unified-brand {
  height: 48px;
  margin: 0 0 10px;
  padding: 0 4px;
  gap: 12px;
  color: #111827;
  font-weight: 950;
}

body:not(.admin-page) .unified-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .16), 0 0 18px rgba(80, 106, 255, .18);
}

body:not(.admin-page) .unified-brand span {
  color: #0b1020;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  body:not(.admin-page) .unified-brand {
    height: 46px;
    margin: 0;
    gap: 10px;
  }

  body:not(.admin-page) .unified-brand img {
    width: 34px;
    height: 34px;
  }

  body:not(.admin-page) .unified-brand span {
    font-size: 16px;
  }
}

html.force-mobile body:not(.admin-page) .unified-brand {
  height: 46px;
  margin: 0;
  gap: 10px;
}

html.force-mobile body:not(.admin-page) .unified-brand img {
  width: 34px;
  height: 34px;
}

html.force-mobile body:not(.admin-page) .unified-brand span {
  font-size: 16px;
}

/* mobile chat mode reset */
@media (max-width: 760px) {
  body:not(.admin-page).chat-mode .workspace {
    background: #fbfcff;
  }

  body:not(.admin-page).chat-mode #view-chat {
    min-height: calc(100svh - 66px);
    padding: 14px 12px calc(170px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.98) 100%);
  }

  body:not(.admin-page).chat-mode #view-chat::before,
  body:not(.admin-page).chat-mode #view-chat::after {
    display: none;
  }

  body:not(.admin-page).chat-mode #view-chat .hero-models,
  body:not(.admin-page).chat-mode #view-chat .hero-subtitle,
  body:not(.admin-page).chat-mode #view-chat .group-banner,
  body:not(.admin-page).chat-mode #view-chat .tool-row {
    display: none !important;
  }

  body:not(.admin-page).chat-mode #view-chat .chat-card {
    width: 100%;
    min-height: calc(100svh - 236px);
    display: block;
    margin: 0;
  }

  body:not(.admin-page).chat-mode #view-chat .messages {
    width: 100%;
    max-height: none;
    overflow: visible;
    display: grid;
    align-content: end;
    gap: 11px;
    margin: 0;
    padding: 10px 2px 148px;
  }

  body:not(.admin-page).chat-mode #view-chat .messages.empty {
    max-height: 0;
    padding: 0;
  }

  body:not(.admin-page).chat-mode #view-chat .bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.58;
    letter-spacing: 0;
    scroll-margin-bottom: 156px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
  }

  body:not(.admin-page).chat-mode #view-chat .bubble.ai {
    justify-self: start;
    color: #273142;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(226, 232, 240, .88);
  }

  body:not(.admin-page).chat-mode #view-chat .bubble.user {
    justify-self: end;
    color: #fff;
    background: linear-gradient(180deg, #111827 0%, #020617 100%);
    border-bottom-right-radius: 8px;
  }

  body:not(.admin-page).chat-mode #view-chat .bubble.usage-bubble {
    max-width: 86%;
    padding: 7px 10px;
    border-radius: 999px;
    color: #64748b;
    background: rgba(241, 245, 249, .92);
    box-shadow: none;
    font-size: 12px;
    line-height: 1.35;
  }

  body:not(.admin-page).chat-mode #view-chat .ask-box {
    position: fixed;
    z-index: 44;
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 66px;
    grid-template-columns: 34px minmax(0, 1fr) auto 42px;
    gap: 8px;
    border-radius: 22px;
    border: 1px solid rgba(203, 213, 225, .9);
    padding: 10px 11px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .16), inset 0 1px 0 rgba(255,255,255,.95);
    backdrop-filter: blur(18px);
  }

  body:not(.admin-page).chat-mode #view-chat .ask-box input {
    height: 40px;
    font-size: 15px;
  }

  body:not(.admin-page).chat-mode #view-chat .model-chip {
    max-width: 104px;
    min-height: 36px;
    border-radius: 999px;
    font-size: 12px;
  }

  body:not(.admin-page).chat-mode #view-chat .send-btn {
    width: 42px;
    height: 42px;
  }
}

html.force-mobile body:not(.admin-page).chat-mode .workspace {
  background: #fbfcff;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat {
  min-height: calc(100svh - 66px);
  padding: 14px 12px calc(170px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.98) 100%);
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat::before,
html.force-mobile body:not(.admin-page).chat-mode #view-chat::after {
  display: none;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .hero-models,
html.force-mobile body:not(.admin-page).chat-mode #view-chat .hero-subtitle,
html.force-mobile body:not(.admin-page).chat-mode #view-chat .group-banner,
html.force-mobile body:not(.admin-page).chat-mode #view-chat .tool-row {
  display: none !important;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .chat-card {
  width: 100%;
  min-height: calc(100svh - 236px);
  display: block;
  margin: 0;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .messages {
  width: 100%;
  max-height: none;
  overflow: visible;
  display: grid;
  align-content: end;
  gap: 11px;
  margin: 0;
  padding: 10px 2px 148px;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .messages.empty {
  max-height: 0;
  padding: 0;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 18px;
  color: #273142;
  font-size: 15px;
  line-height: 1.58;
  letter-spacing: 0;
  scroll-margin-bottom: 156px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .bubble.ai {
  justify-self: start;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(226, 232, 240, .88);
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .bubble.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(180deg, #111827 0%, #020617 100%);
  border-bottom-right-radius: 8px;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .bubble.usage-bubble {
  max-width: 86%;
  padding: 7px 10px;
  border-radius: 999px;
  color: #64748b;
  background: rgba(241, 245, 249, .92);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.35;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .ask-box {
  position: fixed;
  z-index: 44;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: auto;
  min-height: 66px;
  grid-template-columns: 34px minmax(0, 1fr) auto 42px;
  gap: 8px;
  border-radius: 22px;
  border: 1px solid rgba(203, 213, 225, .9);
  padding: 10px 11px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .16), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(18px);
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .ask-box input {
  height: 40px;
  font-size: 15px;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .model-chip {
  max-width: 104px;
  min-height: 36px;
  border-radius: 999px;
  font-size: 12px;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .send-btn {
  width: 42px;
  height: 42px;
}

@media (max-width: 760px) {
  html body:not(.admin-page).chat-mode #view-chat,
  html body:not(.admin-page).chat-mode #view-chat .chat-card,
  html body:not(.admin-page).chat-mode #view-chat .messages {
    color: #172033 !important;
    background: transparent !important;
  }

  html body:not(.admin-page).chat-mode #view-chat {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
  }

  html body:not(.admin-page).chat-mode #view-chat .ask-box,
  html body:not(.admin-page).chat-mode #view-chat .ask-box input {
    color: #111827 !important;
    background: transparent !important;
  }

  html body:not(.admin-page).chat-mode #view-chat .ask-box {
    background: rgba(255,255,255,.96) !important;
  }

  html body:not(.admin-page).chat-mode #view-chat .ask-box input::placeholder {
    color: #94a3b8 !important;
  }
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat,
html.force-mobile body:not(.admin-page).chat-mode #view-chat .chat-card,
html.force-mobile body:not(.admin-page).chat-mode #view-chat .messages {
  color: #172033 !important;
  background: transparent !important;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .ask-box,
html.force-mobile body:not(.admin-page).chat-mode #view-chat .ask-box input {
  color: #111827 !important;
  background: transparent !important;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .ask-box {
  background: rgba(255,255,255,.96) !important;
}

html.force-mobile body:not(.admin-page).chat-mode #view-chat .ask-box input::placeholder {
  color: #94a3b8 !important;
}
