:root {
  --paper: #f6f3ec;
  --ink: #161514;
  --muted: #6d6961;
  --line: rgba(22, 21, 20, 0.16);
  --soft: rgba(255, 255, 255, 0.5);
  --dark: #10100f;
  --accent: #6d1d28;
  --section-bg: #ebe7dd;
  --library-bg: #f8f7f3;
  --panel-bg: rgba(255, 255, 255, 0.5);
  --asset-bg: #ded9d0;
  --hero-overlay: linear-gradient(90deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.14)), linear-gradient(0deg, rgba(0, 0, 0, 0.42), transparent 42%);
  --header-h: 66px;
  --editor-panel-w: min(430px, 38vw);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  letter-spacing: 0;
  color: var(--ink);
  transition: background 280ms ease, color 280ms ease;
}

body.editor-docked main {
  margin-right: var(--editor-panel-w);
}

body.editor-docked .site-header {
  right: var(--editor-panel-w);
}

button,
input,
textarea,
select {
  font: inherit;
  max-width: 100%;
}

button,
select,
label.import-label {
  cursor: pointer;
}

.site-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  padding: 0 clamp(16px, 4vw, 44px);
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(16, 16, 15, 0.08);
  mix-blend-mode: normal;
}

.brand-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: grid;
  gap: 2px;
  justify-items: start;
  text-transform: uppercase;
}

.brand-button span {
  font-size: 13px;
  letter-spacing: 0.16em;
}

.brand-button small {
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.76;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.nav a.is-hidden {
  display: none;
}

.header-tools {
  justify-self: end;
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-user {
  max-width: 190px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(246, 243, 236, 0.82);
  color: var(--ink);
  padding: 0 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-select {
  max-width: 190px;
  height: 34px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.version-select option {
  color: var(--ink);
}

.site-header .version-select,
.site-header .text-button {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.site-header .text-button:hover,
.site-header .text-button:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.text-button,
.outline-button,
.primary-button {
  min-height: 38px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
}

.primary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.outline-button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.hero {
  position: relative;
  min-height: 92svh;
  overflow: hidden;
  color: #fff;
  display: grid;
  align-items: end;
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-edit-target {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  border: 0;
  background: transparent;
}

body.editor-docked .hero-edit-target {
  display: block;
}

body.editor-docked .hero-edit-target:hover {
  box-shadow: inset 0 0 0 2px rgba(246, 243, 236, 0.72);
  background: rgba(246, 243, 236, 0.035);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-overlay);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 820px;
  padding: calc(var(--header-h) + 30px) clamp(18px, 5vw, 64px) clamp(44px, 7vw, 90px);
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
}

.hero .kicker,
.film-section .kicker {
  color: rgba(255, 255, 255, 0.78);
}

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

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(48px, 9vw, 122px);
  line-height: 0.9;
  max-width: 9ch;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 5.8vw, 80px);
  line-height: 0.98;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 500;
}

.hero-copy p {
  max-width: 760px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.film-section {
  min-height: 100svh;
  padding: 0;
  position: relative;
  background: #11100f;
  color: var(--paper);
  isolation: isolate;
}

.film-section.is-hidden {
  display: none;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.64fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: end;
  margin-bottom: clamp(22px, 4vw, 40px);
}

.film-section > .section-heading {
  position: absolute;
  z-index: 10;
  top: clamp(78px, 10vw, 118px);
  left: clamp(18px, 5vw, 64px);
  right: clamp(18px, 5vw, 64px);
}

.section-copy {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.film-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #151413;
}

.film-video,
.film-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  filter: contrast(1.03) saturate(0.9);
}

.film-fallback {
  z-index: -1;
}

.film-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 48%, rgba(0, 0, 0, 0.24)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent 34%);
}

.film-caption {
  position: absolute;
  z-index: 4;
  left: clamp(18px, 5vw, 64px);
  right: clamp(18px, 5vw, 64px);
  bottom: clamp(26px, 5vw, 60px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
}

.film-caption p {
  max-width: 590px;
  margin-bottom: 0;
  color: rgba(246, 243, 236, 0.82);
  line-height: 1.55;
}

.film-caption span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(246, 243, 236, 0.72);
}

.section {
  padding: clamp(56px, 8vw, 110px) clamp(18px, 5vw, 64px);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  padding: 0 13px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.5vw, 32px);
}

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

.asset-card button {
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
  position: relative;
}

.asset-card.selected button::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}

.asset-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: var(--asset-bg);
}

.asset-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.asset-meta small {
  color: var(--muted);
  font-size: inherit;
}

.asset-note {
  margin: -4px 0 0;
  min-height: 2.8em;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.asset-tags {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.textile-section {
  background: var(--section-bg);
}

.textile-section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(300px, 0.72fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: end;
  margin-bottom: clamp(22px, 4vw, 44px);
}

.textile-section-head .section-copy {
  margin: 0;
}

.textile-workspace {
  height: min(820px, calc(100svh - 150px));
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(300px, 0.9fr) minmax(320px, 1fr);
  border: 1px solid var(--line);
  background: var(--panel-bg);
  overflow: hidden;
}

.textile-search-panel,
.textile-detail-panel,
.textile-lookbook-panel {
  min-width: 0;
  padding: clamp(16px, 2vw, 24px);
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
}

.textile-search-panel,
.textile-detail-panel {
  border-right: 1px solid var(--line);
}

.textile-search-panel label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.textile-search-panel textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  padding: 14px;
  line-height: 1.55;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

.textile-results {
  display: grid;
  gap: 10px;
}

.textile-match-card,
.textile-lookbook-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  text-align: left;
}

.textile-match-card {
  min-height: 84px;
  padding: 9px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.textile-match-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.textile-match-card img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  background: var(--asset-bg);
}

.textile-match-card span,
.textile-lookbook-card span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.textile-match-card b,
.textile-lookbook-card b {
  overflow-wrap: anywhere;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

.textile-match-card small,
.textile-lookbook-card small {
  color: var(--muted);
  line-height: 1.35;
  font-size: 11px;
}

.textile-panel-title h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
  font-weight: 400;
}

.textile-hero {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--asset-bg);
  border: 1px solid var(--line);
}

.textile-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.textile-swatch {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 4px 9px 4px 5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px;
}

.textile-swatch i {
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
}

.textile-spec-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.textile-spec-list div {
  display: grid;
  gap: 7px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.textile-spec-list b {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
}

.textile-spec-list span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.textile-tags {
  padding-top: 2px;
}

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

.textile-lookbook-card {
  display: grid;
}

.textile-lookbook-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--asset-bg);
}

.textile-lookbook-card span {
  padding: 10px;
}

.library-section {
  background: var(--library-bg);
}

.library-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 4vw, 46px);
}

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

.library-grid,
.job-list {
  display: grid;
  gap: 10px;
}

.library-card,
.job-card {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  color: var(--ink);
  text-align: left;
}

.library-card {
  min-height: 92px;
  padding: 10px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
}

.library-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.library-card span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.library-card small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.editor-section {
  padding: clamp(56px, 8vw, 110px) clamp(18px, 5vw, 64px);
  background: #161514;
  color: var(--paper);
}

.editor-side-panel {
  position: fixed;
  z-index: 80;
  inset: 0 0 0 auto;
  width: var(--editor-panel-w);
  min-width: 380px;
  overflow-y: auto;
  background: #161514;
  color: var(--paper);
  border-left: 1px solid rgba(246, 243, 236, 0.16);
  padding: 18px;
  box-shadow: -18px 0 70px rgba(0, 0, 0, 0.28);
}

.side-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.side-panel-head h2 {
  font-size: 30px;
}

.panel-tabs {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 0;
  margin-bottom: 12px;
  background: #161514;
}

.panel-tabs .chip {
  min-height: 34px;
  border-radius: 0;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}

.panel-tabs .chip[aria-pressed="true"] {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.panel-view {
  display: grid;
  gap: 14px;
}

.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.before-after-grid figure {
  margin: 0;
  display: grid;
  gap: 7px;
}

.before-after-grid figure > span,
.before-after-grid small {
  color: rgba(246, 243, 236, 0.54);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.selected-preview.after:empty,
.selected-preview.after {
  background-color: rgba(255, 255, 255, 0.035);
  background-size: cover;
  background-position: center;
}

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

.generation-control-panel {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.generation-panel-head,
.generation-status-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.generation-panel-head h3 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.15;
}

.generation-panel-head > span,
.generation-status-head span {
  flex: 0 0 auto;
  border: 1px solid rgba(246, 243, 236, 0.16);
  padding: 5px 8px;
  color: rgba(246, 243, 236, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.generation-control-panel label,
.control-label,
.toggle-row {
  display: grid;
  gap: 8px;
  color: rgba(246, 243, 236, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.generation-control-panel select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(246, 243, 236, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  padding: 9px 10px;
}

.generation-control-panel option {
  color: var(--ink);
}

.segmented-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.toggle-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.generation-hint {
  margin: 0;
  color: rgba(246, 243, 236, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.prompt-preview {
  border: 1px solid rgba(246, 243, 236, 0.12);
  padding: 9px;
}

.prompt-preview summary {
  color: rgba(246, 243, 236, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.prompt-preview textarea {
  margin-top: 8px;
}

.generation-status {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(246, 243, 236, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.generation-status:empty {
  display: none;
}

.generation-status p {
  margin: 0;
  color: rgba(246, 243, 236, 0.68);
  font-size: 12px;
  line-height: 1.45;
}

.generation-status small {
  color: rgba(246, 243, 236, 0.42);
  overflow-wrap: anywhere;
}

.usage-dashboard {
  display: grid;
  gap: 12px;
}

.usage-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.usage-hero h3 {
  margin: 3px 0 6px;
  font-size: 24px;
}

.usage-hero p {
  margin: 0;
  color: rgba(246, 243, 236, 0.66);
  font-size: 12px;
  line-height: 1.5;
}

.usage-hero small {
  display: block;
  margin-top: 8px;
  color: rgba(246, 243, 236, 0.48);
  font-size: 10px;
  line-height: 1.45;
}

.usage-hero > span {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(246, 243, 236, 0.18);
  display: grid;
  place-items: center;
  color: var(--paper);
  font-size: 18px;
}

.usage-hero.ready > span {
  border-color: rgba(180, 220, 176, 0.42);
  color: rgba(210, 242, 205, 0.9);
}

.usage-hero.watch > span,
.usage-hero.active > span {
  border-color: rgba(235, 196, 118, 0.5);
  color: rgba(250, 220, 160, 0.94);
}

.usage-hero.high > span {
  border-color: rgba(226, 128, 116, 0.5);
  color: rgba(248, 172, 160, 0.94);
}

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

.usage-card,
.usage-recommendation,
.usage-recent {
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.usage-card {
  display: grid;
  gap: 7px;
}

.usage-card span,
.usage-card small,
.usage-job-row small,
.usage-job-row span {
  color: rgba(246, 243, 236, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
}

.usage-card b {
  font-size: 18px;
}

.usage-meter {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.usage-meter i {
  display: block;
  height: 100%;
  background: color-mix(in srgb, var(--accent) 70%, #ffffff 18%);
}

.usage-recommendation,
.usage-recent {
  display: grid;
  gap: 8px;
}

.usage-recommendation p {
  margin: 0;
  color: rgba(246, 243, 236, 0.68);
  font-size: 12px;
  line-height: 1.5;
}

.usage-job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid rgba(246, 243, 236, 0.1);
}

.usage-job-row b {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-job-row.failed span:first-of-type {
  color: rgba(248, 172, 160, 0.92);
}

.error-text {
  color: #f3a6a6 !important;
}

.copy-edit-panel {
  display: grid;
  gap: 12px;
}

.textile-admin-panel {
  display: grid;
  gap: 14px;
}

.textile-admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.textile-admin-tools label:not(.import-label),
.textile-record-form label {
  display: grid;
  gap: 8px;
  color: rgba(246, 243, 236, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.textile-admin-tools input,
.textile-record-form input,
.textile-record-form textarea {
  width: 100%;
  border: 1px solid rgba(246, 243, 236, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  padding: 11px 12px;
  line-height: 1.5;
}

.textile-record-form textarea {
  resize: vertical;
}

.admin-textile-list {
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(246, 243, 236, 0.12);
  padding: 8px;
}

.admin-textile-card {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(246, 243, 236, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  padding: 7px;
  text-align: left;
}

.admin-textile-card[aria-pressed="true"] {
  border-color: rgba(246, 243, 236, 0.68);
}

.admin-textile-card img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.admin-textile-card span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-textile-card b {
  overflow-wrap: anywhere;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.admin-textile-card small {
  color: rgba(246, 243, 236, 0.58);
  font-size: 10px;
}

.textile-record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid rgba(246, 243, 236, 0.14);
  padding-top: 14px;
}

.textile-record-form .wide,
.textile-image-preview,
.textile-record-form .editor-actions {
  grid-column: 1 / -1;
}

.textile-image-preview {
  min-height: 90px;
  border: 1px solid rgba(246, 243, 236, 0.14);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.textile-image-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
}

.textile-image-preview small {
  color: rgba(246, 243, 236, 0.58);
  overflow-wrap: anywhere;
}

.copy-edit-panel label {
  display: grid;
  gap: 8px;
  color: rgba(246, 243, 236, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.copy-edit-panel select,
.copy-edit-panel textarea {
  width: 100%;
  border: 1px solid rgba(246, 243, 236, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  padding: 12px;
  line-height: 1.5;
}

.copy-edit-panel option {
  color: var(--ink);
}

.side-job-board,
.editor-side-panel .dashboard-grid,
.editor-side-panel .metric-grid,
.editor-side-panel .member-row,
.editor-side-panel .signup-request-card {
  grid-template-columns: 1fr;
}

.editor-side-panel .member-row > span,
.editor-side-panel .member-actions {
  grid-column: 1 / -1;
}

.editor-side-panel .member-actions {
  justify-content: start;
}

.thread-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.thread-card > small {
  color: rgba(246, 243, 236, 0.42);
  overflow-wrap: anywhere;
}

.thread-step-list {
  display: grid;
  gap: 8px;
}

.thread-step-list .job-card {
  background: rgba(255, 255, 255, 0.045);
}

.job-progress-bar {
  position: relative;
  overflow: hidden;
  height: 20px;
  border: 1px solid rgba(246, 243, 236, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.job-progress-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: color-mix(in srgb, var(--accent) 72%, #ffffff 14%);
  transition: width 420ms ease;
}

.job-progress-bar span {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  color: rgba(246, 243, 236, 0.84);
  font-size: 10px;
}

[data-copy-target] {
  outline-offset: 4px;
}

body.editor-docked [data-copy-target]:hover {
  outline: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
}

.copy-history {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.copy-history small {
  color: rgba(246, 243, 236, 0.48);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 160;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  min-width: min(340px, calc(100vw - 36px));
  border: 1px solid rgba(246, 243, 236, 0.22);
  background: rgba(18, 17, 16, 0.92);
  color: #f6f3ec;
  padding: 13px 15px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
  animation: toast-flash 900ms ease-in-out 2;
}

.toast-message.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms ease;
}

@keyframes toast-flash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.42); }
}

.editor-login-section {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  align-items: center;
  padding: clamp(18px, 5vw, 64px);
  background: rgba(22, 21, 20, 0.62);
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.login-panel {
  position: relative;
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 0.64fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: start;
  border: 1px solid var(--line);
  background: var(--section-bg);
  padding: clamp(22px, 4vw, 44px);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.28);
}

.login-panel h2 {
  max-width: 9ch;
}

.login-panel > div:not(.editor-actions) {
  grid-row: 1 / span 2;
}

.login-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  padding: clamp(18px, 3vw, 28px);
}

.login-form h3 {
  margin: 0;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.signup-form {
  background: rgba(255, 255, 255, 0.32);
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.login-form input,
.login-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  padding: 10px 12px;
}

.login-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 46px);
  align-items: start;
}

.selected-panel,
.editor-main {
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: clamp(18px, 3vw, 28px);
}

.selected-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
  border: 1px solid rgba(246, 243, 236, 0.18);
}

.selected-panel p,
.editor-section .section-copy,
.job-card p {
  color: rgba(246, 243, 236, 0.68);
  line-height: 1.6;
}

.quick-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.editor-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.admin-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(246, 243, 236, 0.16);
}

.dashboard-head,
.panel-head,
.identity-card,
.member-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

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

.dashboard-head h3,
.panel-head h3 {
  margin: 0;
}

.dashboard-session,
.panel-head small {
  color: rgba(246, 243, 236, 0.52);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

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

.metric-card {
  min-height: 92px;
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.metric-card span,
.metric-card small,
.member-row > span,
.identity-card small {
  color: rgba(246, 243, 236, 0.56);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.metric-card b {
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.44fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.dashboard-panel {
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}

.panel-head {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 10px;
}

.admin-record-list,
.member-table {
  display: grid;
  gap: 8px;
}

.identity-card {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
  border: 1px solid rgba(246, 243, 236, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.identity-card b,
.member-identity b {
  display: block;
  overflow-wrap: anywhere;
}

.member-row {
  grid-template-columns: minmax(160px, 1.1fr) 82px minmax(140px, 0.8fr) minmax(150px, 0.8fr) auto;
  padding: 12px;
  border: 1px solid rgba(246, 243, 236, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.member-identity small {
  display: block;
  margin-top: 4px;
  color: rgba(246, 243, 236, 0.54);
  overflow-wrap: anywhere;
}

.role-badge {
  width: max-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(246, 243, 236, 0.2);
  padding: 0 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
  color: rgba(246, 243, 236, 0.72);
}

.role-badge.admin {
  border-color: rgba(205, 177, 113, 0.48);
  color: rgba(244, 215, 146, 0.92);
}

.member-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: rgba(246, 243, 236, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid textarea,
.prompt-preview {
  width: 100%;
  border: 1px solid rgba(246, 243, 236, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

.import-label input {
  display: none;
}

.job-board {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.member-approval-panel {
  margin-top: 24px;
}

.admin-dashboard .member-approval-panel {
  margin-top: 0;
}

.editor-top.compact {
  margin-bottom: 14px;
}

.signup-request-list {
  display: grid;
  gap: 10px;
}

.signup-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.signup-request-card b,
.signup-request-card small {
  display: block;
}

.signup-request-card small,
.signup-request-card p {
  color: rgba(246, 243, 236, 0.56);
}

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

.job-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(246, 243, 236, 0.16);
}

.job-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.job-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(246, 243, 236, 0.18);
  padding: 0 8px;
  color: rgba(246, 243, 236, 0.76);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
  white-space: nowrap;
}

.job-status.completed {
  border-color: rgba(180, 220, 176, 0.38);
  color: rgba(210, 242, 205, 0.88);
}

.job-status.paused {
  border-color: rgba(235, 196, 118, 0.42);
  color: rgba(250, 220, 160, 0.9);
}

.job-status.failed {
  border-color: rgba(226, 128, 116, 0.44);
  color: rgba(248, 172, 160, 0.92);
}

.job-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.job-progress {
  margin-top: 8px;
  color: rgba(246, 243, 236, 0.54);
  font-size: 12px;
}

.job-result {
  width: 100%;
  margin: 10px 0;
  padding: 0;
  border: 1px solid rgba(246, 243, 236, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  display: grid;
  text-align: left;
}

.job-result img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.job-result span {
  padding: 9px 10px 10px;
  color: rgba(246, 243, 236, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.history-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.history-images img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
}

.job-card small {
  color: rgba(246, 243, 236, 0.48);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.72);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.asset-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  border: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

.asset-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.asset-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(280px, 0.36fr);
}

.asset-dialog img {
  width: 100%;
  height: min(86svh, 860px);
  object-fit: cover;
  display: block;
}

.dialog-copy {
  padding: clamp(22px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dialog-copy h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  font-weight: 400;
}

.dialog-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(246, 243, 236, 0.88);
  color: var(--ink);
}

@media (max-width: 980px) {
  body.editor-docked main {
    margin-right: 0;
  }

  body.editor-docked .site-header {
    right: 0;
  }

  .editor-side-panel {
    width: min(460px, 100vw);
    min-width: 0;
  }

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

  .nav {
    display: none;
  }

  .section-heading,
  .textile-section-head,
  .textile-workspace,
  .library-layout,
  .editor-shell,
  .editor-top,
  .dashboard-head,
  .dashboard-grid,
  .job-board,
  .signup-request-card,
  .asset-dialog[open] {
    grid-template-columns: 1fr;
  }

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

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

  .member-row > span,
  .member-actions {
    grid-column: 1 / -1;
  }

  .member-actions {
    justify-content: start;
  }

  .textile-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .textile-search-panel,
  .textile-detail-panel {
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  h1 {
    max-width: 11ch;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 98px;
  }

  .site-header {
    height: auto;
    min-height: var(--header-h);
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: center;
    padding: 10px 14px 12px;
    color: var(--ink);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    mix-blend-mode: normal;
  }

  .brand-button {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-button span,
  .brand-button small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-tools {
    width: 100%;
    justify-self: stretch;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .version-select {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    min-width: 0;
    color: var(--ink);
    background: var(--paper);
    font-size: 10px;
  }

  .header-user {
    flex: 1 1 100%;
    max-width: none;
    justify-content: flex-end;
  }

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

  .textile-admin-tools,
  .textile-record-form {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 82svh;
    align-items: end;
  }

  .film-section {
    min-height: 84svh;
  }

  .film-caption {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: calc(var(--header-h) + 22px) 16px 34px;
  }

  h1 {
    font-size: clamp(40px, 15vw, 64px);
    line-height: 0.94;
    max-width: 10ch;
  }

  h2 {
    font-size: clamp(30px, 10vw, 46px);
  }

  .hero-copy p {
    max-height: 11.5em;
    overflow: auto;
    font-size: 13px;
  }

  .section {
    padding: 46px 16px;
  }

  .section-heading {
    gap: 14px;
    margin-bottom: 22px;
  }

  .section-copy {
    font-size: 14px;
  }

  .filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .chip {
    flex: 0 0 auto;
  }

  .asset-grid,
  .login-panel,
  .textile-section-head,
  .textile-workspace,
  .textile-lookbook-grid,
  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .textile-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .textile-search-panel,
  .textile-detail-panel {
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .asset-meta {
    grid-template-columns: 1fr;
  }

  .library-card {
    grid-template-columns: 58px 1fr;
  }

  .library-card small {
    grid-column: 2;
  }

  .library-head {
    display: grid;
    align-items: start;
  }

  .editor-section {
    padding: 46px 16px;
  }

  .editor-side-panel {
    inset: var(--header-h) 0 0;
    width: 100%;
    padding: 14px;
    border-left: 0;
    border-top: 1px solid rgba(246, 243, 236, 0.16);
  }

  .panel-tabs {
    top: -14px;
  }

  .before-after-grid {
    grid-template-columns: 1fr;
  }

  .editor-login-section {
    padding: 16px;
  }

  .editor-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .job-card-top {
    grid-template-columns: 1fr;
  }

  .text-button,
  .outline-button,
  .primary-button {
    min-height: 42px;
    padding: 0 12px;
  }

  .asset-dialog {
    width: min(100vw - 18px, 520px);
    max-height: calc(100svh - 18px);
  }

  .asset-dialog img {
    height: 54svh;
  }

  .dialog-copy {
    padding: 18px;
  }
}
