:root {
  color-scheme: light;
  --background: #f5f1e8;
  --foreground: #171612;
  --card: #fbf8f1;
  --card-strong: #fffdf8;
  --primary: #d9572b;
  --primary-soft: rgba(217, 87, 43, 0.12);
  --primary-copy: #b33d18;
  --muted: #eae4d8;
  --muted-foreground: #6f6a60;
  --border: #d9d1c2;
  --border-strong: #c5baa8;
  --surface: rgba(251, 248, 241, 0.8);
  --surface-hover: #eee7db;
  --success: #157a55;
  --danger: #b42318;
  --shadow: 0 28px 80px -48px rgba(42, 33, 24, 0.45);
  --sidebar-width: 216px;
  --topbar-height: 64px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #0d0d11;
  --foreground: #f5f1e8;
  --card: #18181b;
  --card-strong: #1d1d21;
  --primary: #ff7043;
  --primary-soft: rgba(255, 112, 67, 0.13);
  --primary-copy: #ff8c66;
  --muted: #202024;
  --muted-foreground: #aaa7a0;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --surface: rgba(24, 24, 27, 0.78);
  --surface-hover: #232328;
  --success: #67d7ac;
  --danger: #f97066;
  --shadow: 0 32px 90px -44px rgba(0, 0, 0, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 24px);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 78% -10%, color-mix(in oklab, var(--primary) 11%, transparent), transparent 31rem),
    linear-gradient(var(--background), var(--background));
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

button,
a,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  outline: none;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.035em;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-strong);
}

select {
  min-height: 46px;
  padding: 0 42px 0 13px;
  cursor: pointer;
}

textarea {
  min-height: 168px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.65;
}

textarea::placeholder {
  color: var(--muted-foreground);
}

::selection {
  background: color-mix(in oklab, var(--primary) 28%, transparent);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--primary);
  color: #160b07;
  padding: 9px 12px;
  font-weight: 700;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 94%, transparent);
  padding: 18px 13px 14px;
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  flex: none;
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 26px 0 16px;
}

.nav-item,
.sidebar-model-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0 10px;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-item {
  font-size: 0.85rem;
  font-weight: 650;
}

.nav-item:hover,
.sidebar-model-button:hover,
.nav-item.is-active {
  background: var(--surface-hover);
  color: var(--foreground);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item span {
  display: grid;
  width: 20px;
  place-items: center;
  color: var(--primary-copy);
}

.sidebar-section {
  margin-top: 15px;
}

.sidebar-label {
  margin: 0 9px 6px;
  color: var(--muted-foreground);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.sidebar-model-button {
  width: 100%;
  min-height: 34px;
  padding-inline: 9px;
  font-size: 0.75rem;
}

.sidebar-model-button::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--model-color, var(--primary));
  content: "";
}

.sidebar-foot {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 11px;
}

.sidebar-foot p {
  margin: 0 0 3px;
  font-size: 0.72rem;
  font-weight: 750;
}

.sidebar-foot span {
  display: block;
  color: var(--muted-foreground);
  font-size: 0.62rem;
  line-height: 1.45;
}

.page-column {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 88%, transparent);
  padding: 8px clamp(20px, 4vw, 48px);
  backdrop-filter: blur(22px);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-brand strong {
  font-size: 0.84rem;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 0.74rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--success) 12%, transparent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.text-button,
.filter-button,
.prompt-chips button,
.workflow-tab,
.ratio-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  font-size: 1rem;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  padding: 0 15px;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #160b07;
  box-shadow: 0 16px 40px -24px color-mix(in oklab, var(--primary) 65%, transparent);
}

.button-primary:hover {
  background: color-mix(in oklab, var(--primary) 88%, white);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.button-small {
  min-height: 36px;
  padding-inline: 11px;
  font-size: 0.76rem;
}

main,
footer {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 48px;
  align-items: end;
  padding: clamp(54px, 8vw, 104px) 0 38px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary-copy);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 790px;
  margin-bottom: 20px;
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero-description {
  max-width: 710px;
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 1.6vw, 1.13rem);
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-proof div {
  display: grid;
  min-height: 86px;
  align-content: center;
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  text-align: center;
}

.hero-proof div:last-child {
  border-right: 0;
}

.hero-proof strong {
  color: var(--primary-copy);
  font-size: 1.4rem;
  line-height: 1;
}

.hero-proof span {
  margin-top: 7px;
  color: var(--muted-foreground);
  font-size: 0.63rem;
}

.studio-panel {
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.workbench {
  overflow: hidden;
}

.workbench-head,
.section-heading,
.output-head,
.history-head,
.parameter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.workbench-head {
  align-items: center;
  padding: 20px 22px 16px;
}

.workbench-head h2,
.section-heading h2,
.output-head h3,
.history-head h3,
.parameter-head h3 {
  margin-bottom: 0;
}

.workbench-head h2 {
  font-size: 1.25rem;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in oklab, var(--success) 28%, var(--border));
  border-radius: 999px;
  background: color-mix(in oklab, var(--success) 8%, transparent);
  color: var(--success);
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 750;
}

.local-badge span {
  font-size: 0.55rem;
}

.workflow-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-inline: 10px;
}

.workflow-tab {
  position: relative;
  min-height: 52px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-weight: 700;
}

.workflow-tab::after {
  position: absolute;
  right: 10%;
  bottom: -1px;
  left: 10%;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.workflow-tab:hover,
.workflow-tab.is-active {
  color: var(--foreground);
}

.workflow-tab.is-active::after {
  background: var(--primary);
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.composer-main {
  min-width: 0;
  border-right: 1px solid var(--border);
}

.field-block,
.parameter-panel {
  padding: 22px;
}

.field-block + .field-block {
  border-top: 1px solid var(--border);
}

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

.field-heading label,
.control-field > span,
.control-field legend {
  font-size: 0.77rem;
  font-weight: 750;
}

.field-heading > span {
  color: var(--muted-foreground);
  font-size: 0.67rem;
}

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

.model-picker-row select {
  padding-left: 48px;
  font-weight: 750;
}

.model-symbol {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 10px;
  display: grid;
  width: 27px;
  height: 27px;
  transform: translateY(-50%);
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
  color: var(--model-color, var(--primary-copy));
  font-size: 0.72rem;
}

.field-note {
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 0.74rem;
}

.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.capability-list span,
.model-tags span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  padding: 4px 8px;
  color: var(--muted-foreground);
  font-size: 0.61rem;
  font-weight: 650;
}

.drop-zone {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  background: color-mix(in oklab, var(--card) 72%, transparent);
  cursor: pointer;
  padding: 14px;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.drop-zone > span:last-child {
  display: grid;
}

.drop-zone strong {
  font-size: 0.76rem;
}

.drop-zone small {
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 0.65rem;
}

.drop-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-copy);
  font-size: 1.1rem;
}

.reference-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.reference-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card-strong);
}

.reference-thumb {
  display: grid;
  width: 100%;
  height: 70px;
  place-items: center;
  overflow: hidden;
  background: #0a0a0d;
  color: #f5f1e8;
  font-size: 0.68rem;
}

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

.reference-meta {
  display: grid;
  padding: 7px 28px 7px 8px;
}

.reference-meta strong,
.reference-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-meta strong {
  font-size: 0.62rem;
}

.reference-meta span {
  color: var(--muted-foreground);
  font-size: 0.56rem;
}

.remove-reference {
  position: absolute;
  right: 5px;
  bottom: 7px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.65rem;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.prompt-chips button,
.filter-button {
  min-height: 31px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0 10px;
  font-size: 0.65rem;
  font-weight: 700;
}

.prompt-chips button:hover,
.filter-button:hover,
.filter-button.is-active {
  border-color: color-mix(in oklab, var(--primary) 50%, var(--border));
  background: var(--primary-soft);
  color: var(--primary-copy);
}

.validation-message {
  min-height: 1.1em;
  margin: 8px 0 -6px;
  color: var(--danger);
  font-size: 0.7rem;
}

.parameter-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 17px;
  background: color-mix(in oklab, var(--card) 68%, transparent);
}

.parameter-head {
  align-items: center;
}

.parameter-head h3 {
  font-size: 1rem;
}

.text-button {
  color: var(--muted-foreground);
  padding: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.text-button:hover {
  color: var(--primary-copy);
}

.control-field {
  display: grid;
  gap: 7px;
  margin: 0;
  border: 0;
  padding: 0;
}

.control-field > span,
.control-field legend {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.control-field output {
  color: var(--primary-copy);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.67rem;
}

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

.ratio-button {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-strong);
  color: var(--muted-foreground);
  font-size: 0.6rem;
  font-weight: 750;
}

.ratio-button:hover,
.ratio-button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-copy);
}

.ratio-glyph {
  display: block;
  min-width: 9px;
  min-height: 9px;
  max-width: 24px;
  max-height: 19px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--muted);
  padding: 11px;
}

.privacy-note > span {
  color: var(--success);
  font-size: 1rem;
}

.privacy-note p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.64rem;
  line-height: 1.5;
}

.privacy-note strong {
  color: var(--foreground);
}

.build-button {
  width: 100%;
  margin-top: auto;
}

.preview-section,
.catalog-section,
.boundary-section {
  padding-top: clamp(70px, 9vw, 112px);
}

.section-heading {
  align-items: end;
  margin-bottom: 24px;
}

.section-heading h2 {
  max-width: 650px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.section-heading > p {
  max-width: 390px;
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.empty-preview {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  padding: 36px;
  text-align: center;
}

.empty-preview h3 {
  margin: 20px 0 7px;
}

.empty-preview p {
  max-width: 480px;
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.empty-orbit {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--primary-soft), transparent 60%),
    var(--card);
  color: var(--primary);
  box-shadow: 0 0 0 11px color-mix(in oklab, var(--primary) 4%, transparent);
}

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

.output-card {
  min-width: 0;
  overflow: hidden;
}

.output-head,
.history-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.output-head h3,
.history-head h3 {
  font-size: 1rem;
}

.output-card pre {
  min-height: 360px;
  max-height: 540px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  color: var(--muted-foreground);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.68;
  white-space: pre-wrap;
}

.history-panel {
  margin-top: 14px;
  overflow: hidden;
}

.history-list {
  display: grid;
  gap: 1px;
  background: var(--border);
}

.history-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 0;
  background: var(--card);
  color: inherit;
  cursor: pointer;
  padding: 13px 18px;
  text-align: left;
}

.history-item:hover {
  background: var(--surface-hover);
}

.history-model {
  display: grid;
}

.history-model strong {
  font-size: 0.76rem;
}

.history-model span,
.history-time {
  color: var(--muted-foreground);
  font-size: 0.62rem;
}

.history-prompt {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

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

.model-card {
  position: relative;
  display: flex;
  min-height: 245px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card);
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.model-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--model-color), transparent 72%);
  content: "";
}

.model-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--model-color) 45%, var(--border));
  box-shadow: 0 24px 64px -42px var(--model-color);
}

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

.model-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--model-color) 12%, var(--muted));
  color: var(--model-color);
  font-weight: 850;
}

.model-kind {
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 4px 8px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.57rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-card h3 {
  margin: 18px 0 3px;
  font-size: 1.08rem;
}

.model-provider {
  margin-bottom: 12px;
  color: var(--model-color);
  font-size: 0.65rem;
  font-weight: 750;
}

.model-card > p {
  margin-bottom: 18px;
  color: var(--muted-foreground);
  font-size: 0.72rem;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.model-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--model-color);
  cursor: pointer;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 750;
}

.boundary-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 54px;
  align-items: center;
  padding-bottom: clamp(74px, 10vw, 132px);
}

.boundary-copy h2 {
  max-width: 600px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 4.5vw, 3.7rem);
  line-height: 1;
}

.boundary-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 24px;
  color: var(--muted-foreground);
}

.boundary-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.diagram-card {
  display: grid;
  min-height: 116px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 15px;
}

.diagram-card span {
  margin-bottom: 16px;
  color: var(--muted-foreground);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
}

.diagram-card strong {
  font-size: 0.78rem;
}

.diagram-card small {
  margin-top: 3px;
  color: var(--success);
  font-size: 0.6rem;
}

.diagram-card.is-private {
  grid-column: 1 / -1;
  min-height: 88px;
  border-style: dashed;
  opacity: 0.65;
}

.diagram-card.is-private span {
  margin-bottom: 8px;
}

.diagram-card.is-private small {
  color: var(--danger);
}

.diagram-arrow,
.diagram-break {
  color: var(--primary-copy);
  font-weight: 850;
}

.diagram-break {
  grid-column: 1 / -1;
  justify-self: center;
  margin-block: -3px;
}

footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--border);
  padding: 28px 0 34px;
}

.footer-brand {
  margin-bottom: 12px;
}

footer p {
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 0.68rem;
}

footer p a,
.footer-links a {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

footer p a:hover,
.footer-links a:hover {
  color: var(--primary-copy);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted-foreground);
  font-size: 0.67rem;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  transform: translateY(160%);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  color: var(--foreground);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 188px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-proof {
    max-width: 520px;
  }

  .composer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 290px);
  }

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

  .boundary-section {
    grid-template-columns: 1fr;
  }

  .boundary-diagram {
    max-width: 620px;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar-height: 58px;
  }

  .sidebar {
    display: none;
  }

  .page-column {
    margin-left: 0;
  }

  .mobile-brand {
    display: flex;
  }

  .topbar-status {
    display: none;
  }

  main,
  footer {
    width: min(100% - 28px, 720px);
  }

  .hero {
    padding-top: 64px;
  }

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

  .composer-main {
    border-right: 0;
  }

  .parameter-panel {
    border-top: 1px solid var(--border);
  }

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

  .output-card pre {
    min-height: 270px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding-inline: 14px;
  }

  .topbar-cta {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .hero-proof {
    grid-template-columns: 1fr;
  }

  .hero-proof div {
    min-height: 66px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .hero-proof div:last-child {
    border-bottom: 0;
  }

  .workbench-head,
  .section-heading,
  .boundary-section,
  footer {
    align-items: flex-start;
  }

  .workbench-head,
  .section-heading,
  footer {
    flex-direction: column;
  }

  .workbench-head {
    gap: 12px;
  }

  .workflow-tabs {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .workflow-tab {
    min-height: 44px;
    border-bottom: 1px solid var(--border);
  }

  .workflow-tab:last-child {
    border-bottom: 0;
  }

  .workflow-tab::after {
    top: 7px;
    right: auto;
    bottom: 7px;
    left: 0;
    width: 3px;
    height: auto;
  }

  .field-block,
  .parameter-panel {
    padding: 18px 15px;
  }

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

  .history-item {
    grid-template-columns: 1fr auto;
  }

  .history-prompt {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .boundary-diagram {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .diagram-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .diagram-card.is-private,
  .diagram-break {
    grid-column: 1;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
