:root {
  --ink: #16201d;
  --muted: #66736f;
  --line: rgba(22, 32, 29, 0.14);
  --paper: rgba(255, 250, 240, 0.78);
  --paper-solid: #fffaf0;
  --ember: #e5532f;
  --ember-dark: #bd341b;
  --moss: #23483e;
  --mint: #cbe8cf;
  --gold: #f4c95d;
  --shadow: 0 24px 70px rgba(36, 42, 34, 0.18);
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  overflow: hidden;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 10% 8%, rgba(244, 201, 93, 0.5), transparent 26rem),
    radial-gradient(circle at 88% 12%, rgba(203, 232, 207, 0.74), transparent 28rem),
    linear-gradient(135deg, #fff7df 0%, #f3ebd2 45%, #dbe8d4 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(22, 32, 29, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 32, 29, 0.04) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

button {
  border: 0;
  cursor: pointer;
}

select,
input[type="checkbox"],
.check-row,
.model-type-tab,
.style-chip,
.image-actions a {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
}

.shell {
  display: grid;
  height: 100vh;
  grid-template-rows: minmax(0, 1fr);
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  animation: rise 0.6s ease both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--ember-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.88;
}

.hero-copy {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.status-card,
.panel {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card {
  display: flex;
  min-width: 230px;
  align-items: center;
  gap: 12px;
  border-radius: 28px;
  padding: 14px 16px;
}

.compact-status {
  min-width: 0;
  margin-bottom: 16px;
  border-radius: 22px;
  box-shadow: none;
}

.status-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: #aeb8b4;
  box-shadow: 0 0 0 6px rgba(174, 184, 180, 0.18);
}

.status-dot.ok {
  background: #27a268;
  box-shadow: 0 0 0 6px rgba(39, 162, 104, 0.16);
}

.status-dot.bad {
  background: var(--ember);
  box-shadow: 0 0 0 6px rgba(229, 83, 47, 0.18);
}

.workspace {
  display: grid;
  gap: 18px;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.topbar-status,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  padding: 10px 14px;
}

.topbar-status small {
  display: block;
  color: var(--muted);
}

.topbar-actions span {
  color: var(--moss);
  font-size: 13px;
  font-weight: 900;
}

.panel {
  border-radius: 30px;
  padding: 22px;
  animation: rise 0.6s ease both;
}

.console-panel {
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.config-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-color: rgba(255, 250, 240, 0.72);
  border-radius: 36px;
  background:
    radial-gradient(circle at 12% 0%, rgba(244, 201, 93, 0.34), transparent 20rem),
    radial-gradient(circle at 92% 12%, rgba(203, 232, 207, 0.64), transparent 22rem),
    rgba(255, 250, 240, 0.94);
  box-shadow: 0 36px 110px rgba(18, 24, 21, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -48%) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
  animation: none;
}

.config-panel.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.config-panel > .panel-title {
  position: sticky;
  top: -22px;
  z-index: 1;
  margin: -22px -22px 20px;
  border-bottom: 1px solid rgba(22, 32, 29, 0.1);
  background: rgba(255, 250, 240, 0.86);
  backdrop-filter: blur(18px);
  border-radius: 36px 36px 0 0;
  padding: 18px 22px;
}

.config-panel > .panel-title small {
  display: block;
  max-width: 560px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.config-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 14px;
}

.config-form-grid .field,
.config-form-grid .check-row {
  margin-bottom: 16px;
}

.config-field-wide {
  grid-column: 1 / -1;
}

.config-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  background: rgba(18, 24, 21, 0.48);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.config-backdrop[hidden] {
  display: none;
}

body.config-open {
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-weight: 900;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.code-label {
  color: var(--moss);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(22, 32, 29, 0.18);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  outline: 0;
  padding: 12px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.58;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(229, 83, 47, 0.7);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 5px rgba(229, 83, 47, 0.1);
}

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

.model-picker {
  display: grid;
  gap: 12px;
  margin: -4px 0 16px;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.34);
  padding: 12px;
}

.profile-card {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.34);
  padding: 12px;
}

.profile-card .compact-title {
  margin-bottom: 0;
}

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

.profile-actions button {
  flex: 1 1 120px;
}

.profile-status {
  border-radius: 16px;
  background: rgba(203, 232, 207, 0.24);
  color: var(--moss);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
  padding: 9px 11px;
}

.model-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.model-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid rgba(22, 32, 29, 0.12);
}

.model-type-tab {
  position: relative;
  border-radius: 0;
  background: transparent;
  color: rgba(35, 72, 62, 0.76);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 8px 11px;
}

.model-type-tab::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  content: "";
}

.model-type-tab.active {
  color: var(--moss);
}

.model-type-tab.active::after {
  background: var(--ember);
}

.mini-field {
  margin-bottom: 0;
}

#modelSelect {
  min-height: 180px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 13px;
}

#modelSelect option {
  padding: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -2px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.check-row input {
  width: auto;
}

.creator-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 20%, rgba(229, 83, 47, 0.18), transparent 18rem),
    linear-gradient(135deg, rgba(22, 32, 29, 0.92), rgba(35, 72, 62, 0.9));
  color: #fffaf0;
  padding: 22px;
}

.creator-kicker {
  margin: 0 0 8px;
  color: rgba(244, 201, 93, 0.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.creator-hero h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.creator-hero p:not(.creator-kicker) {
  max-width: 620px;
  margin: 10px 0 0;
  color: rgba(255, 250, 240, 0.72);
  line-height: 1.7;
}

.creator-panel {
  display: grid;
  gap: 15px;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.5);
  padding: 16px;
}

.drama-hero {
  background:
    radial-gradient(circle at 82% 18%, rgba(244, 201, 93, 0.2), transparent 18rem),
    linear-gradient(135deg, rgba(35, 72, 62, 0.94), rgba(22, 32, 29, 0.92));
}

.drama-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.5);
  padding: 16px;
}

.drama-output-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.52);
  padding: 12px;
}

.drama-output-options .check-row {
  margin: 0;
}

.video-status-card {
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--moss);
  font-weight: 900;
  line-height: 1.7;
  padding: 12px 14px;
}

.video-preview {
  width: 100%;
  max-height: 520px;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 24px;
  background: #111;
  box-shadow: 0 22px 54px rgba(22, 32, 29, 0.2);
}

.creator-settings {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.5fr;
  gap: 12px;
}

.style-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.style-chip {
  border: 1px solid rgba(22, 32, 29, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--moss);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 900;
}

.style-chip.active,
.style-chip:hover {
  background: var(--moss);
  color: #fffaf0;
}

.creator-prompt {
  display: grid;
  gap: 10px;
}

.creator-prompt span,
.advanced-drawer summary {
  color: var(--moss);
  font-size: 13px;
  font-weight: 900;
}

.creator-prompt textarea {
  min-height: 210px;
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.9);
  font-family: var(--sans);
  font-size: 16px;
}

.advanced-drawer {
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.52);
  padding: 12px;
}

.advanced-drawer summary {
  cursor: pointer;
}

.advanced-drawer .field {
  margin-top: 12px;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.generate-btn {
  min-width: 180px;
  box-shadow: 0 16px 34px rgba(229, 83, 47, 0.25);
}

.quick-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 32px;
  background:
    radial-gradient(circle at 78% 10%, rgba(244, 201, 93, 0.32), transparent 18rem),
    linear-gradient(135deg, rgba(22, 32, 29, 0.95), rgba(35, 72, 62, 0.88));
  color: #fffaf0;
  padding: 24px;
}

.quick-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.quick-header h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.quick-header p:not(.creator-kicker) {
  max-width: 760px;
  margin: 12px 0 0;
  color: rgba(255, 250, 240, 0.74);
  line-height: 1.7;
}

.quick-prompt {
  display: grid;
  gap: 10px;
}

.quick-prompt span {
  color: rgba(244, 201, 93, 0.94);
  font-size: 13px;
  font-weight: 900;
}

.prompt-title,
.inline-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.polish-btn,
.mini-icon-btn,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.polish-btn,
.mini-icon-btn {
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 999px;
  background: rgba(244, 201, 93, 0.96);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.mini-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
}

.polish-btn:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.quick-prompt textarea {
  min-height: 190px;
  border-color: rgba(255, 250, 240, 0.2);
  border-radius: 26px;
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
}

.quick-controls {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr;
  gap: 12px;
}

.quick-card .field span {
  color: rgba(255, 250, 240, 0.78);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-status {
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.12);
  color: rgba(255, 250, 240, 0.86);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  padding: 11px 13px;
}

.quick-results {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  margin-top: 18px;
}

.quick-result-card {
  min-width: 0;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.48);
  padding: 16px;
}

.quick-chat,
.quick-visual {
  display: grid;
  max-height: 620px;
  gap: 14px;
  overflow: auto;
}

.quick-chat.empty,
.quick-visual.empty {
  display: block;
}

.tabs,
.action-row,
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tabs {
  display: none;
  margin-bottom: 20px;
}

.tab,
.ghost,
.secondary,
.primary {
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tab {
  background: rgba(255, 255, 255, 0.54);
  color: var(--moss);
}

.tab.active {
  background: var(--moss);
  color: #fffaf0;
}

.primary {
  background: var(--ember);
  color: #fffaf0;
  box-shadow: 0 13px 26px rgba(229, 83, 47, 0.22);
}

.secondary {
  background: var(--gold);
  color: var(--ink);
}

.ghost {
  border: 1px solid rgba(22, 32, 29, 0.12);
  background: rgba(255, 255, 255, 0.48);
  color: var(--moss);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.tab:hover {
  transform: translateY(-1px);
}

.primary:disabled,
.secondary:disabled,
.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: none;
  animation: fade 0.22s ease both;
}

.codex-chat-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: 300px minmax(0, 1fr);
  background:
    radial-gradient(circle at 16% 10%, rgba(244, 201, 93, 0.26), transparent 19rem),
    linear-gradient(135deg, rgba(255, 250, 240, 0.94), rgba(244, 238, 217, 0.78));
}

.conversation-sidebar {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid rgba(22, 32, 29, 0.1);
  background: rgba(255, 250, 240, 0.7);
  padding: 18px;
}

.conversation-sidebar__top,
.conversation-sidebar__foot {
  display: grid;
  gap: 12px;
}

.sidebar-config-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 18%, rgba(244, 201, 93, 0.34), transparent 8rem),
    radial-gradient(circle at 95% 5%, rgba(203, 232, 207, 0.78), transparent 9rem),
    rgba(255, 250, 240, 0.78);
  box-shadow: 0 14px 36px rgba(22, 32, 29, 0.08);
  padding: 14px;
}

.sidebar-config-card strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-config-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sidebar-config-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 9px;
  align-items: center;
}

.sidebar-model-refresh {
  min-width: 0;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(244, 201, 93, 0.18);
}

.config-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.new-conversation-btn {
  width: 100%;
  border-radius: 18px;
  background: var(--moss);
  color: #fffaf0;
  font-weight: 900;
  padding: 13px 15px;
  text-align: left;
}

.conversation-search {
  display: grid;
  gap: 7px;
}

.conversation-search span,
.composer-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.conversation-search input {
  border-radius: 16px;
  padding: 10px 12px;
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 16px -6px;
  overflow: auto;
  padding: 0 6px;
}

.conversation-empty {
  border: 1px dashed rgba(22, 32, 29, 0.18);
  border-radius: 20px;
  color: var(--muted);
  line-height: 1.7;
  padding: 16px;
}

.conversation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease;
}

.conversation-item:hover,
.conversation-item.active {
  background: rgba(35, 72, 62, 0.1);
}

.conversation-item.active {
  box-shadow: inset 4px 0 0 var(--ember);
}

.conversation-pick {
  min-width: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.conversation-name {
  display: block;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-snippet {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-delete {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  font-weight: 900;
}

.conversation-delete:hover {
  background: rgba(229, 83, 47, 0.14);
  color: var(--ember-dark);
}

.conversation-main {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) 230px;
}

.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(22, 32, 29, 0.08);
  background: rgba(255, 250, 240, 0.58);
  padding: 18px 22px;
}

.conversation-kicker {
  margin: 0 0 5px;
  color: var(--ember-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.conversation-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.conversation-header__meta {
  border: 1px solid rgba(35, 72, 62, 0.14);
  border-radius: 999px;
  background: rgba(203, 232, 207, 0.38);
  color: var(--moss);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
}

.conversation-messages {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 26px min(7vw, 84px);
}

.conversation-welcome {
  max-width: 720px;
  margin: 8vh auto 0;
  text-align: center;
}

.conversation-welcome h3 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  letter-spacing: -0.07em;
  line-height: 1;
}

.conversation-welcome p {
  color: var(--muted);
  line-height: 1.8;
}

.conversation-message {
  display: grid;
  gap: 10px;
  max-width: min(860px, 100%);
}

.conversation-message.user {
  justify-self: end;
}

.conversation-message.assistant,
.conversation-message.status {
  justify-self: start;
}

.message-card {
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 34px rgba(22, 32, 29, 0.08);
  padding: 15px 17px;
}

.conversation-message.user .message-card {
  background: linear-gradient(135deg, rgba(35, 72, 62, 0.96), rgba(22, 32, 29, 0.92));
  color: #fffaf0;
}

.conversation-message.status .message-card {
  border-style: dashed;
  background: rgba(203, 232, 207, 0.28);
  color: var(--moss);
}

.message-role {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.conversation-message.user .message-role {
  color: rgba(255, 250, 240, 0.74);
}

.message-body {
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-meta {
  margin-top: 10px;
  color: rgba(102, 115, 111, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.conversation-message.user .message-meta {
  color: rgba(255, 250, 240, 0.66);
}

.message-assets {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.message-assets.images {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.message-image-card,
.message-video-card,
.message-file-card {
  overflow: hidden;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.74);
}

.message-file-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.message-image-card button {
  display: block;
  width: 100%;
  padding: 0;
  background: rgba(22, 32, 29, 0.04);
  cursor: zoom-in;
}

.message-image-card img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.message-video-card video {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #111;
}

.message-asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.message-asset-actions a,
.message-asset-actions button {
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--moss);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 11px;
  text-decoration: none;
}

.chat-composer {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  align-self: stretch;
  margin: 0 min(7vw, 84px) 14px;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 20px 54px rgba(22, 32, 29, 0.14);
  padding: 10px;
}

.composer-attachments {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
}

.composer-attachments[hidden] {
  display: none;
}

.composer-attachment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  max-width: 320px;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  padding: 7px 8px;
}

.composer-attachment__thumb {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(35, 72, 62, 0.08);
  color: var(--moss);
  font-size: 18px;
  font-weight: 900;
}

.composer-attachment__thumb img,
.composer-attachment__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-attachment__name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment__meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.composer-attachment__remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.8);
  color: var(--muted);
  font-weight: 900;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.composer-tools label {
  display: grid;
  flex: 1 1 180px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.composer-tools select {
  min-height: 32px;
  border-radius: 12px;
  font-size: 13px;
  padding: 5px 8px;
}

.composer-input-wrap textarea {
  display: block;
  height: 100%;
  min-height: 0;
  max-height: none;
  width: 100%;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--sans);
  font-size: 16px;
  padding: 14px 190px 48px 52px;
  resize: none;
}

.composer-input-wrap {
  position: relative;
  display: block;
  height: 95%;
}

.attachment-btn {
  position: absolute;
  bottom: 9px;
  left: 11px;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.86);
  color: var(--moss);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.attachment-btn:hover {
  background: rgba(203, 232, 207, 0.62);
}

.composer-inline-actions {
  position: absolute;
  right: 9px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-footer {
  display: none;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.composer-polish-btn {
  min-width: 82px;
  border: 1px solid rgba(244, 201, 93, 0.55);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(244, 201, 93, 0.96), rgba(255, 236, 154, 0.96));
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 12px;
  box-shadow: 0 10px 24px rgba(244, 201, 93, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.composer-polish-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(244, 201, 93, 0.32);
}

.composer-polish-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.composer-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-message-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf0;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.send-message-btn:disabled {
  opacity: 0.42;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.compact {
  align-content: start;
}

.plain-card {
  border: 1px dashed rgba(22, 32, 29, 0.2);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.42);
}

.plain-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.sub2api-summary {
  margin: 16px 0;
  border: 1px solid rgba(35, 72, 62, 0.18);
  border-radius: 20px;
  background: rgba(203, 232, 207, 0.34);
  color: var(--moss);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.7;
  padding: 14px 16px;
}

.route-hint {
  border: 1px solid rgba(35, 72, 62, 0.16);
  border-radius: 18px;
  background: rgba(203, 232, 207, 0.28);
  color: var(--moss);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;
  padding: 11px 13px;
  word-break: break-word;
}

.plain-card p,
.hint {
  color: var(--muted);
  line-height: 1.7;
}

.hint {
  margin: 0;
  font-size: 13px;
}

.chat-log-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 12%, rgba(244, 201, 93, 0.22), transparent 14rem),
    rgba(255, 255, 255, 0.46);
  padding: 16px;
}

.compact-title {
  align-items: flex-start;
  margin-bottom: 0;
}

.compact-title small {
  max-width: 520px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  text-align: right;
}

.chat-log {
  display: grid;
  max-height: 560px;
  gap: 14px;
  overflow: auto;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 250, 240, 0.76), rgba(255, 250, 240, 0.48)),
    linear-gradient(90deg, rgba(35, 72, 62, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(35, 72, 62, 0.04) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  padding: 14px;
}

.chat-log.empty {
  display: block;
}

.chat-bubble {
  width: fit-content;
  max-width: min(760px, 86%);
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(22, 32, 29, 0.08);
  padding: 13px 15px;
}

.chat-bubble.user {
  justify-self: end;
  border-color: rgba(229, 83, 47, 0.22);
  background: linear-gradient(135deg, rgba(229, 83, 47, 0.95), rgba(189, 52, 27, 0.94));
  color: #fffaf0;
}

.chat-bubble.assistant {
  justify-self: start;
  border-color: rgba(35, 72, 62, 0.16);
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(203, 232, 207, 0.42));
}

.chat-bubble-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.chat-bubble-body {
  margin-top: 8px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-meta {
  margin-top: 10px;
  color: rgba(102, 115, 111, 0.9);
  font-family: var(--mono);
  font-size: 11px;
}

.chat-bubble.user .chat-bubble-meta {
  color: rgba(255, 250, 240, 0.72);
}

.output-panel {
  margin-top: 18px;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.image-gallery.empty {
  display: block;
}

.empty-state {
  border: 1px dashed rgba(22, 32, 29, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  line-height: 1.7;
  padding: 22px;
}

.image-card {
  overflow: hidden;
  border: 1px solid rgba(22, 32, 29, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.56);
}

.image-card .preview-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background:
    linear-gradient(45deg, rgba(22, 32, 29, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(22, 32, 29, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(22, 32, 29, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(22, 32, 29, 0.05) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  cursor: zoom-in;
}

.image-card img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.image-meta {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.image-url {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.image-actions a,
.image-actions button {
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--moss);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 11px;
  text-decoration: none;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 21, 0.72);
  backdrop-filter: blur(10px);
}

.image-lightbox__panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
  padding: 16px;
}

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

.image-lightbox__panel img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 190px);
  border-radius: 20px;
  background: rgba(22, 32, 29, 0.06);
  object-fit: contain;
}

.image-lightbox__url {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.lightbox-open {
  overflow: hidden;
}

.output-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 16px;
}

pre {
  min-height: 260px;
  max-height: 560px;
  margin: 8px 0 0;
  overflow: auto;
  border: 1px solid rgba(22, 32, 29, 0.16);
  border-radius: 22px;
  background: #17211e;
  color: #ecf8e8;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.58;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}

.is-loading {
  position: relative;
}

.is-loading::after {
  display: inline-block;
  margin-left: 8px;
  content: "·";
  animation: pulse 0.8s infinite alternate;
}

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

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  from {
    opacity: 0.1;
    transform: translateX(0);
  }
  to {
    opacity: 1;
    transform: translateX(6px);
  }
}

@media (max-width: 1020px) {
  .hero,
  .workspace,
  .output-grid,
  .grid.two,
  .creator-settings,
  .config-form-grid,
  .codex-chat-shell,
  .quick-controls,
  .quick-results {
    grid-template-columns: 1fr;
  }

  .conversation-sidebar {
    min-height: auto;
    max-height: 230px;
    border-right: 0;
    border-bottom: 1px solid rgba(22, 32, 29, 0.1);
  }

  .conversation-main {
    grid-template-rows: auto minmax(0, 1fr) 260px;
  }

  .conversation-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .conversation-messages {
    padding: 22px;
  }

  .chat-composer {
    margin: 0 18px 18px;
  }

  .hero {
    display: grid;
  }

  .creator-hero,
  .quick-header {
    display: grid;
  }

  .status-card {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding: 18px 0;
  }

  .panel {
    border-radius: 22px;
    padding: 16px;
  }

  h1 {
    font-size: 44px;
  }

  .secret-row {
    grid-template-columns: 1fr;
  }

  .conversation-header,
  .composer-footer,
  .topbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .composer-footer {
    grid-template-columns: 1fr auto auto;
  }

  .composer-status {
    grid-column: 1 / -1;
  }
}
