:root {
  --app-font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --preview-code-font: var(--app-font);
  --page-bg: #eef3f7;
  --panel-bg: #ffffff;
  --panel-border: #d7e0e8;
  --panel-text: #111827;
  --panel-muted: #637182;
  --sidebar-bg: #303030;
  --sidebar-bg-solid: #303030;
  --sidebar-text: #e6e6e6;
  --sidebar-muted: #a2a2a2;
  --sidebar-active: rgb(255 255 255 / 0.1);
  --content-bg: #030303;
  --content-bg-solid: #030303;
  --content-bg-edge: #030303;
  --content-text: #f5f5f5;
  --content-control-contrast: #101820;
  --content-muted: rgb(245 245 245 / 0.58);
  --content-card: #262626;
  --content-border: rgb(255 255 255 / 0.1);
  --content-field: #2a2a2a;
  --control-glass-base: #383838;
  --control-glass-bg: color-mix(in srgb, var(--control-glass-base) 66%, transparent);
  --control-glass-hover: color-mix(in srgb, var(--control-glass-base) 82%, transparent);
  --control-glass-border: color-mix(in srgb, var(--content-text) 18%, transparent);
  --control-glass-icon: var(--content-text);
  --control-primary-base: #75451f;
  --control-primary-bg: color-mix(in srgb, var(--control-primary-base) 84%, transparent);
  --control-primary-hover: color-mix(in srgb, var(--control-primary-base) 96%, transparent);
  --control-primary-icon: #ffffff;
  --floating-glass-bg: color-mix(in srgb, var(--sidebar-bg-solid) 78%, transparent);
  --floating-glass-border: color-mix(in srgb, var(--sidebar-text) 20%, transparent);
  --floating-glass-text: var(--sidebar-text);
  --floating-glass-muted: var(--sidebar-muted);
  --effect-ambient: none;
  --effect-stars: none;
  --effect-ambient-opacity: 0;
  --effect-stars-opacity: 0;
  --effect-ambient-animation: none;
  --effect-stars-animation: none;
  --accent: #ff8a3d;
  --ui-blue: #1f5f9f;
  --ui-blue-dark: #172554;
  --ui-blue-soft: #edf6ff;
  --ui-border-blue: #bdd5ec;
  --menu-weight: 700;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--panel-text);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.74), transparent 38%),
    var(--page-bg);
  font-family: var(--app-font);
  letter-spacing: 0;
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 14px;
  height: min(100vh, 860px);
  min-height: 0;
  max-height: 100vh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px;
  overflow: hidden;
}

.control-pane,
.output-panel {
  min-width: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.control-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 28px);
  padding: 13px;
  overflow-y: auto;
}

.panel-header {
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0;
  color: var(--panel-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 14px;
}

.status-line {
  min-height: 0;
  color: #0b3f20;
  background: #e8f8ee;
  border: 1px solid #b7e6c7;
  border-radius: 8px;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-section {
  display: grid;
  gap: 7px;
}

.command-section {
  flex: 0 0 auto;
}

.command-panel {
  display: grid;
  gap: 7px;
  padding: 9px;
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.command-panel p {
  margin: 0;
  color: var(--panel-muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.command-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.command-panel code {
  display: block;
  min-width: 0;
  padding: 7px 8px;
  color: #263142;
  background: #ffffff;
  border: 1px solid #dfe6ef;
  border-radius: 7px;
  overflow: hidden;
  font-family: var(--preview-code-font);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-panel.is-online {
  background: #f4f8fc;
  border-color: var(--ui-border-blue);
}

.command-panel.is-online p,
.command-panel.is-online code {
  color: #1d3f5f;
}

.command-panel.is-offline {
  background: #f7f9fc;
  border-color: #cbd6e2;
}

.command-panel.is-offline p {
  color: #45556a;
}

.preset-section {
  min-height: 0;
  flex: 0 0 auto;
}

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

.section-head span {
  color: var(--panel-muted);
  font-size: 12px;
  font-weight: 800;
}

.theme-grid,
.button-grid {
  display: grid;
  gap: 8px;
}

.theme-grid {
  grid-template-columns: 1fr;
  min-height: 0;
  max-height: min(44vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
}

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

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

.theme-button,
.choice-button {
  min-width: 0;
  min-height: 40px;
  color: var(--panel-text);
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px;
  font-weight: 760;
  overflow: hidden;
}

.theme-button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 8px 10px;
  text-align: left;
}

.theme-button strong,
.theme-button span {
  display: block;
}

.theme-button .theme-title-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.theme-button .theme-index {
  flex: 0 0 auto;
  color: #7b8797;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.theme-button strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-copy {
  min-width: 0;
  overflow: hidden;
}

.theme-copy > span:last-child {
  margin-top: 2px;
  color: var(--panel-muted);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-button[aria-pressed="true"],
.choice-button[aria-pressed="true"] {
  border-color: var(--ui-blue);
  background: var(--ui-blue-soft);
  box-shadow: inset 0 0 0 1px var(--ui-blue);
}

.empty-themes {
  min-height: 84px;
  color: var(--panel-muted);
  background: #f8fafc;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.swatch {
  position: relative;
  display: grid;
  grid-template-columns: 32% 68%;
  overflow: hidden;
  width: 58px;
  height: 44px;
  background: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgb(15 23 42 / 0.18),
    inset 0 0 0 1px rgb(255 255 255 / 0.2);
}

.swatch i {
  display: block;
  min-height: 100%;
  background-position: center;
  background-size: cover;
}

.swatch-sidebar {
  border-right: 1px solid rgb(255 255 255 / 0.35);
}

.swatch-content {
  filter: saturate(1.12) brightness(1.05);
}

.swatch .swatch-accent {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 15px;
  height: 15px;
  min-height: 0;
  border: 2px solid rgb(255 255 255 / 0.9);
  border-radius: 999px;
  box-shadow: 0 1px 5px rgb(0 0 0 / 0.28);
}

.primary-action,
.secondary-action {
  min-height: 36px;
  color: #ffffff;
  background: var(--ui-blue);
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.1;
  white-space: nowrap;
}

.launch-action {
  background: var(--ui-blue-dark);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: default;
  opacity: 0.72;
}

.secondary-action {
  min-height: 34px;
  color: #233246;
  background: #eaf0f6;
  border: 1px solid #d2dce8;
}

.reset-action {
  color: var(--panel-text);
  background: #e8eef3;
}

.header-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.theme-toolbar {
  display: grid;
  gap: 8px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-button {
  min-height: 30px;
  color: var(--panel-muted);
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
}

.filter-button[aria-pressed="true"] {
  color: var(--ui-blue);
  background: var(--ui-blue-soft);
  border-color: var(--ui-border-blue);
}

.theme-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--panel-muted);
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.theme-search input {
  min-width: 0;
  height: 28px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--panel-text);
  font: inherit;
}

.compact-control-section .section-head {
  min-height: 22px;
}

.compact-control-section .choice-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.preview-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  max-height: calc(100vh - 28px);
  container-type: inline-size;
  overflow: hidden;
}

.preview-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid rgb(0 0 0 / 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgb(25 40 60 / 0.14);
}

.preview-card.is-applied {
  animation: applied-pulse 1.25s ease-out;
}

.preview-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  padding: 10px 8px;
  font-family: var(--app-font);
  font-weight: 500;
}

.traffic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  padding: 0 6px;
}

.traffic {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.traffic.red {
  background: #ff5f57;
}

.traffic.yellow {
  background: #febc2e;
}

.traffic.green {
  background: #28c840;
}

.preview-sidebar nav {
  display: grid;
  gap: 2px;
}

.preview-section {
  display: grid;
  gap: 2px;
}

.preview-section > span {
  display: block;
  margin: 7px 8px 3px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  text-align: left;
  font-weight: 500;
}

.nav-item strong {
  color: var(--sidebar-muted);
  font-weight: 500;
}

.nav-item.active,
.nav-item:hover {
  background: var(--sidebar-active);
}

.nav-item.folder-item {
  justify-content: flex-start;
  margin-top: 4px;
}

.nav-item.folder-item::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='20' height='18' viewBox='0 0 20 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.8 6.2h4.4l1.7 1.9h7.6c1 0 1.7.8 1.5 1.8l-.8 4.2c-.2.9-.9 1.5-1.8 1.5H4.1c-.9 0-1.6-.7-1.7-1.6L2 8c-.1-1 .7-1.8 1.7-1.8Z'/%3E%3Cpath d='M3 6.3V4.8c0-1 .8-1.7 1.8-1.7h3.1l1.8 1.9h5.1c.9 0 1.6.6 1.7 1.4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='20' height='18' viewBox='0 0 20 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.8 6.2h4.4l1.7 1.9h7.6c1 0 1.7.8 1.5 1.8l-.8 4.2c-.2.9-.9 1.5-1.8 1.5H4.1c-.9 0-1.6-.7-1.7-1.6L2 8c-.1-1 .7-1.8 1.7-1.8Z'/%3E%3Cpath d='M3 6.3V4.8c0-1 .8-1.7 1.8-1.7h3.1l1.8 1.9h5.1c.9 0 1.6.6 1.7 1.4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.82;
}

.nav-item.child-item {
  padding-left: 34px;
}

.nav-item.muted {
  color: var(--sidebar-muted);
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--sidebar-muted);
  padding: 8px;
  font-size: 13px;
}

.preview-meta::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.preview-meta strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.preview-content {
  display: flex;
  min-width: 0;
  color: var(--content-text);
  background: var(--content-bg);
  flex-direction: column;
  font-family: var(--app-font);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.preview-content::before,
.preview-content::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  mix-blend-mode: screen;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.preview-content::before {
  background: var(--effect-ambient);
  opacity: var(--effect-ambient-opacity);
  animation: var(--effect-ambient-animation);
}

.preview-content::after {
  background: var(--effect-stars);
  opacity: var(--effect-stars-opacity);
  animation: var(--effect-stars-animation);
}

.preview-topbar,
.preview-thread,
.composer-row {
  position: relative;
  z-index: 1;
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border-bottom: 1px solid var(--content-border);
  padding: 0 18px;
}

.preview-title {
  margin: 0;
  flex: 1;
  color: var(--content-text);
  font-size: 15px;
  font-weight: 500;
}

.topbar-buttons {
  display: flex;
  gap: 12px;
}

.topbar-buttons span {
  width: 16px;
  height: 16px;
  border-radius: 8px;
  border: 1px solid var(--content-border);
}

.ghost-button {
  min-width: 34px;
  min-height: 32px;
  color: var(--content-text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.preview-thread {
  min-height: 0;
  overflow: hidden;
}

.preview-home {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(28px, 6vw, 64px);
}

.preview-topbar-home .preview-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.preview-topbar-home .topbar-buttons {
  visibility: hidden;
}

.home-start {
  display: grid;
  gap: 28px;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  margin-top: 8px;
}

.home-prompt-title {
  margin: 0;
  color: var(--content-text);
  font-size: clamp(20px, 2.45vw, 30px);
  font-weight: 400;
  line-height: 1.24;
  text-align: center;
}

.prompt-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  color: var(--content-muted);
  background: var(--content-card);
  border: 1px solid var(--content-border);
  border-radius: 22px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.18);
}

.prompt-line {
  min-height: 36px;
  color: var(--content-muted);
  font-size: 17px;
  font-weight: 500;
}

.prompt-toolbar,
.prompt-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
}

.prompt-tools {
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 100%;
}

.round-tool,
.access-tool,
.model-tool,
.mic-tool,
.send-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  overflow: hidden;
  color: var(--control-glass-icon);
  border-radius: 999px;
  font-weight: 750;
}

.round-tool {
  width: 30px;
  font-size: 22px;
  font-weight: 400;
}

.access-tool {
  gap: 8px;
  color: var(--accent);
  min-width: 0;
}

.access-tool::before {
  content: "";
  width: 13px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 6px 6px 8px 8px;
}

.access-tool i,
.model-tool i {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.model-tool {
  min-width: 0;
  padding: 0 10px;
}

.mic-tool {
  width: 22px;
}

.mic-tool::before {
  content: "";
  width: 9px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.send-tool {
  width: 34px;
  height: 34px;
  color: var(--content-bg-solid);
  background: color-mix(in srgb, var(--content-text) 84%, transparent);
  font-size: 20px;
}

.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: fit-content;
  color: var(--content-muted);
  font-size: 13px;
  font-weight: 700;
}

.folder-chip::before {
  content: "";
  width: 14px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 0 32px;
}

.connect-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 118px;
  color: var(--content-text);
  background: color-mix(in srgb, var(--content-card) 58%, transparent);
  border: 1px solid var(--content-border);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.connect-card strong,
.connect-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.connect-card p {
  margin: 0;
  color: var(--content-muted);
  font-size: 13px;
  line-height: 1.3;
}

.connector-mark {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.slack-mark {
  background:
    linear-gradient(90deg, #36c5f0 0 45%, transparent 45%),
    linear-gradient(#2eb67d 0 45%, transparent 45%),
    linear-gradient(90deg, transparent 55%, #ecb22e 55%),
    linear-gradient(transparent 55%, #e01e5a 55%);
}

.gmail-mark {
  background:
    linear-gradient(135deg, #ea4335 0 24%, transparent 24%),
    linear-gradient(225deg, #4285f4 0 24%, transparent 24%),
    linear-gradient(#fbbc04 0 100%);
  clip-path: polygon(0 0, 50% 38%, 100% 0, 100% 100%, 0 100%);
}

.drive-mark {
  background:
    linear-gradient(120deg, #0f9d58 0 34%, transparent 34%),
    linear-gradient(240deg, #4285f4 0 34%, transparent 34%),
    linear-gradient(#f4b400 0 100%);
  clip-path: polygon(50% 0, 100% 86%, 0 86%);
}

.connect-card.is-connected::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #052e16;
  background: #35e285;
  border: 1px solid rgb(187 247 208 / 0.92);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.16);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.preview-data {
  display: none;
}

.output-panel {
  display: grid;
  gap: 12px;
  max-height: 30vh;
  padding: 10px 12px;
  overflow: auto;
}

.output-panel summary {
  cursor: pointer;
  list-style: none;
}

.output-panel summary::-webkit-details-marker {
  display: none;
}

.output-panel pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  color: #dbeafe;
  background: #111827;
  border-radius: 8px;
  padding: 14px;
  font-family: "SFMono-Regular", "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
}

@keyframes applied-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgb(1 105 204 / 0.55),
      0 24px 70px rgb(25 40 60 / 0.18);
  }
  42% {
    box-shadow:
      0 0 0 10px rgb(1 105 204 / 0.22),
      0 24px 70px rgb(25 40 60 / 0.18);
  }
  100% {
    box-shadow:
      0 0 0 0 rgb(1 105 204 / 0),
      0 24px 70px rgb(25 40 60 / 0.18);
  }
}

@keyframes night-drift {
  from {
    transform: translate3d(-0.8%, 0, 0) scale(1.02);
  }
  to {
    transform: translate3d(0.8%, -0.6%, 0) scale(1.04);
  }
}

@keyframes night-twinkle {
  0% {
    opacity: 0.52;
  }
  48% {
    opacity: 0.92;
  }
  100% {
    opacity: 0.62;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-content::before,
  .preview-content::after {
    animation: none;
  }
}

@container (max-width: 1120px) {
  .preview-card {
    grid-template-columns: minmax(210px, 32%) minmax(0, 1fr);
  }

  .preview-home {
    padding: clamp(22px, 4cqw, 40px);
  }

  .home-start {
    gap: 22px;
  }

  .prompt-toolbar {
    flex-wrap: wrap;
  }

  .connect-grid {
    gap: 10px;
    padding: 0;
  }

  .connect-card {
    padding: 14px;
  }
}

@container (max-width: 860px) {
  .preview-card {
    grid-template-columns: minmax(190px, 34%) minmax(0, 1fr);
  }

  .preview-sidebar {
    font-size: 13px;
  }

  .preview-home {
    align-items: start;
    padding: 22px;
  }

  .home-prompt-title {
    font-size: clamp(20px, 4cqw, 26px);
  }

  .prompt-shell {
    border-radius: 18px;
    padding: 14px;
  }

  .prompt-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .prompt-tools {
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .model-tool {
    padding: 0 6px;
  }

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

@container (max-width: 620px) {
  .preview-card {
    display: block;
    height: auto;
    min-height: 0;
  }

  .preview-sidebar {
    max-height: none;
  }

  .preview-content {
    min-height: 560px;
  }

  .preview-home {
    place-items: stretch;
    padding: 18px;
  }

  .home-start {
    gap: 16px;
    margin-top: 0;
  }

  .prompt-line {
    min-height: 28px;
    font-size: 15px;
  }

  .prompt-tools {
    justify-content: flex-start;
  }

  .connect-grid {
    grid-template-columns: 1fr;
  }

  .connect-card {
    min-height: 0;
  }
}

@container (max-width: 420px) {
  .preview-content {
    min-height: 520px;
  }

  .preview-home {
    padding: 14px;
  }

  .home-prompt-title {
    font-size: 20px;
    text-align: left;
  }

  .prompt-shell {
    padding: 12px;
  }

  .round-tool,
  .access-tool,
  .model-tool,
  .mic-tool,
  .send-tool {
    min-height: 26px;
  }
}

@media (max-width: 920px) {
  body,
  .app-shell,
  .control-pane,
  .preview-pane {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body {
    overflow: auto;
  }

  .app-shell,
  .preview-card {
    display: block;
  }

  .app-shell {
    max-width: none;
  }

  .preview-pane {
    display: block;
  }

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

  .preview-card {
    min-height: 720px;
  }

  .theme-grid,
  .button-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }
}
