/* Elll Studio: Cinema Showcase Landing, Visual Studio Creation Dock, 9:16 Poster Gallery & Shared Workspace Chrome (Track A). */
#app { min-height: 100svh; display: flex; flex-direction: column; }
html { scrollbar-gutter: stable; }
body:has(.backdrop) { overflow-y: hidden; }
.top .wrap { min-height: 58px; height: auto; gap: 10px; }
.studio-wordmark {
  display: inline-flex; gap: 9px; align-items: center; justify-content: center; flex: none;
  min-height: 36px; min-width: 36px;
  font-family: "Avenir", system-ui, sans-serif;
  font-size: 21px; line-height: 1; letter-spacing: -.055em; color: var(--text-1);
}
.studio-wordmark b { font-weight: 400; color: var(--text-2); }
.appearance-tools { display: flex; gap: 2px; flex: none; }
.appearance-tools .iconbtn {
  border-color: transparent; min-width: 38px; height: 38px;
  font-size: 14px; color: var(--text-1);
}
.studio-footer {
  margin: auto auto 0; padding-block: 24px 20px;
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--text-3); font-size: var(--fs-xs);
}
.studio-footer::before { content: none; }
.studio-main { padding-bottom: 48px; }
.draft-opening { min-height: 230px; display: flex; gap: 14px; align-content: center; align-items: center; flex-wrap: wrap; }
.draft-opening h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.6rem); }
.draft-opening .notice { flex-basis: 100%; }
.studio-main:has(.library) { padding-top: clamp(14px, 2.2vw, 26px); }
.menu:not(.context) { inset-inline-end: max(18px, calc((100vw - 1260px) / 2)); top: 58px; }
.studio-wordmark:focus-visible, .btn:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .library-project:focus-visible,
.style-card:focus-visible, .dialect-pill:focus-visible {
  outline: 2px solid var(--accent-text); outline-offset: 3px;
}

/* ── Public landing (#/signin): promise, three beats, sample ads, sign-in dialog ── */
.show-top .show-top-wrap { min-height: 56px; flex-wrap: nowrap; }
.show-top-signin { min-height: 40px; padding-inline: 14px; font-size: var(--fs-sm); }

.show-main {
  flex: 1; display: flex; flex-direction: column;
  gap: clamp(40px, 6vw, 72px);
  padding-block: clamp(36px, 7vw, 88px) clamp(40px, 6vw, 72px);
}

.show-hero { display: grid; gap: 28px; justify-items: start; max-width: 760px; }
.show-hero-title {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 600;
  color: var(--text-1);
  max-width: 18ch;
  text-wrap: balance;
}
.show-start-btn { min-height: 52px; padding-inline: 26px; font-size: var(--fs-lg); gap: 10px; }

.show-beats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}
.show-beat { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.show-beat-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-1);
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.show-beat-title { display: block; font-size: var(--fs-base); font-weight: 600; color: var(--text-1); line-height: 1.35; }
.show-beat-line { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }

.show-gallery { min-width: 0; display: grid; gap: 18px; }
.show-gallery-title { margin: 0; font-size: var(--fs-base); font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.show-samples {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px 16px; min-width: 0;
}
.show-sample { min-width: 0; }
.show-sample-btn {
  display: grid; gap: 4px; width: 100%; padding: 0;
  border: 0; background: none; color: inherit; text-align: start;
  cursor: pointer; border-radius: var(--r-card);
}
.show-sample-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.show-sample-media { aspect-ratio: 9 / 16; border-radius: var(--r-card); margin-bottom: 8px; }
.show-sample-btn:hover .show-sample-media img { opacity: .9; }
.show-sample-brand { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); line-height: 1.3; }
.show-sample-line { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.45; }

/* Brand plate: the designed stand-in that shows if a sample picture cannot load. */
.show-plate {
  position: relative; overflow: hidden; width: 100%;
  background: var(--plate, #3d352b);
  display: grid; place-items: center;
}
.show-plate-name {
  padding: 12px; text-align: center;
  color: #f4efe6; font-size: var(--fs-sm); font-weight: 600; line-height: 1.3;
}
.show-plate img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .2s ease;
}

/* Sample dialog */
.show-sample-grid {
  display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 28px; align-items: start;
}
.show-sample-frame { aspect-ratio: 9 / 16; border-radius: var(--r-card); }
.show-sample-copy { display: grid; gap: 14px; min-width: 0; }
.show-sample-about { margin: 0; font-size: var(--fs-base); color: var(--text-1); line-height: 1.55; }
.show-sample-says { margin: 8px 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.show-sample-lines {
  margin: 0; padding-inline-start: 22px;
  display: grid; gap: 10px;
  font-size: var(--fs-base); color: var(--text-1); line-height: 1.5;
}
.show-sample-lines li::marker { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Sign-in dialog */
.show-carry-receipt {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); color: var(--text-1); line-height: 1.45;
}
.show-carry-receipt .ico { color: var(--ok); flex: none; }
.show-signin-form input { min-height: 44px; }
.show-signin-form .btn[type="submit"] { min-height: 48px; }
.show-dev-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.show-dev-row .btn { flex: 1 1 140px; }

[dir=rtl] .show-hero-title { letter-spacing: normal; line-height: 1.3; }

@media (max-width: 899px) {
  .show-samples {
    display: flex; gap: 14px; overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    padding-block-end: 4px;
  }
  .show-samples::-webkit-scrollbar { display: none; }
  .show-sample { flex: 0 0 clamp(140px, 40vw, 180px); scroll-snap-align: start; }
}
@media (max-width: 720px) {
  .show-beats { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .show-sample-grid { grid-template-columns: minmax(0, 1fr); }
  .show-sample-frame { max-width: 220px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .show-start-btn { width: 100%; justify-content: center; }
  .show-hero { justify-items: stretch; }
}

/* ── Home Personal Answer Banner & Higgsfield-Grade Visual Creation Dock ────── */
.hub-answer-slot:not(:empty) { margin-bottom: 14px; }
.hub-answer-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  border-color: var(--accent-text);
  background: color-mix(in srgb, var(--surface-1) 88%, var(--accent-soft));
}
.hub-answer-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.hub-answer-question {
  margin: 0; font-size: var(--fs-base); font-weight: 600; color: var(--text-1); line-height: 1.35;
}

.hub-dock {
  overflow: hidden;
  border-radius: 18px;
  border-color: var(--border-strong);
  background: var(--surface-1);
  transition: border-color .15s;
}
.hub-dock:focus-within { border-color: var(--accent-text); }

.hub-dock-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.hub-head-stack {
  display: grid; gap: 10px; align-items: start;
}
.hub-title {
  margin: 0; font-size: clamp(1.28rem, 2vw, 1.65rem); line-height: 1.16; letter-spacing: -.03em;
}
.hub-kit-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0;
}
.hub-match-receipt {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-weight: 600;
}
.hub-match-receipt:empty { display: none; }

.dock-kit-wrap,
.dock-url-wrap,
.dialect-select-wrap {
  position: relative; display: inline-flex; align-items: center; min-width: 0;
}
.dock-url-wrap { direction: ltr; }
.dock-kit-wrap > .ico,
.dock-url-wrap > .ico,
.dialect-select-wrap > .ico {
  position: absolute; inset-inline-start: 11px; pointer-events: none; color: var(--text-3);
}
select.dock-kit-select {
  min-height: 36px; padding: 6px 12px; padding-inline-start: 32px;
  font-size: var(--fs-xs); font-weight: 600; border-radius: 999px;
  background: var(--surface-2); border-color: var(--border-strong);
  max-width: 220px;
}

.hub-dock-prompt {
  padding: 14px 20px; display: grid; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.hub-brief-input {
  min-height: 76px; font-size: var(--fs-base); background: var(--surface-2);
  border-radius: 12px; padding: 11px 14px;
}
.hub-attach-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dock-url-wrap { flex: 1 1 200px; max-width: 320px; }
.dock-url-wrap input.dock-url-input {
  min-height: 38px; padding: 7px 12px; padding-inline-start: 34px;
  font-size: var(--fs-sm); background: var(--surface-2);
}
.hub-photos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-thumb { width: 52px; height: 52px; }
.hub-thumb-rm {
  position: absolute; inset-block-start: 2px; inset-inline-end: 2px;
  width: 36px; height: 36px; min-width: 36px; min-height: 36px; border: 0; border-radius: 50%;
  background: rgb(18 18 17 / .88); color: #f6f3ec;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.hub-thumb-rm:hover { background: var(--bad); color: #201210; }
.hub-add-photo { min-height: 38px; }

.hub-samples { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hub-sample-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; min-width: 36px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.hub-sample-chip:hover { border-color: var(--accent-text); color: var(--text-1); background: var(--surface-hover); }

/* Visual Style Card Strip (6 bespoke .webp commercial aesthetics) */
.hub-dock-section {
  padding: 13px 20px; display: grid; gap: 9px;
  border-bottom: 1px solid var(--border);
}
.hub-section-label {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.style-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.style-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: #141412;
  color: #f7f4ed;
  cursor: pointer;
  text-align: start;
  transition: transform .2s ease, border-color .18s ease;
}
.style-card-media { position: absolute; inset: 0; overflow: hidden; }
.style-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 2.6s cubic-bezier(.16, 1, .3, 1);
}

.style-card-scrim { display: none; }
.style-card-check {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  opacity: 0; transform: scale(.75);
  transition: opacity .15s, transform .15s;
}
.style-card.on { border-color: var(--accent); }
.style-card.on .style-card-check { opacity: 1; transform: scale(1); }
.style-card-label {
  position: absolute; bottom: 0; inset-inline: 0;
  padding: 8px; display: grid; gap: 2px; pointer-events: none;
  background: rgb(12 12 11 / .82);
}
.style-card-label strong {
  font-size: 12px; font-weight: 700; line-height: 1.22; color: #fffaf3;
}
.style-card-label span {
  font-size: 10.5px; line-height: 1.2; color: rgb(246 243 236 / .8);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 1-Tap Dialect Pill Bar */
.dialect-section { border-bottom: 0; }
.dialect-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.dialect-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; min-width: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-2); font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.dialect-pill:hover { background: var(--surface-hover); color: var(--text-1); }
.dialect-pill.on {
  background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text);
}
.dialect-flag { font-size: 12px; line-height: 1; opacity: .82; font-weight: 700; letter-spacing: .02em; }
select.dialect-more-select {
  min-height: 36px; padding: 6px 12px; padding-inline-start: 32px;
  border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-2); border-color: var(--border-strong);
  width: auto; max-width: 190px;
}
.dialect-more-select.on {
  background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text);
}

.hub-feedback:not(:empty) { padding: 0 20px 12px; }
.hub-composer-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface-1));
}
.hub-foot-left { flex-wrap: wrap; gap: 10px; }
.hub-cost-hint { font-variant-numeric: tabular-nums; }

/* ── Creative Reference Shared Components (used by draft.js & project.js) ──── */
.reference-fields, .ref-file, .ref-full { display: grid; gap: 12px; min-width: 0; }
.reference-fields [hidden] { display: none !important; }
.reference-fields small, .ref-current { color: var(--text-2); font-size: var(--fs-xs); line-height: 1.6; }
.ref-methods, .ref-file-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.ref-methods button { background: transparent; color: var(--text-2); cursor: pointer; border: 1px solid var(--border); border-radius: 99px; padding: 6px 12px; min-height: 44px; font: inherit; font-size: var(--fs-sm); }
.ref-methods button[aria-pressed=true] { color: var(--text-1); background: var(--surface-1); border-color: var(--accent-text); }
.ref-file { gap: 7px; }
.ref-file-preview { display: flex; gap: 10px; align-items: center; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ref-file-preview:empty, .ref-error:empty { display: none; }
.ref-file-preview img, .ref-file-preview video { max-width: min(160px, 45%); max-height: 105px; object-fit: contain; border-radius: 6px; }
.ref-file-preview:has(video) { display: grid; gap: 4px; }
.ref-file-preview video { width: min(100%, 380px); max-width: 100%; height: 160px; max-height: none; background: #151515; }
.ref-current, .ref-full p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.ref-error { color: var(--text-1); border-inline-start: 3px solid var(--accent-text); padding-inline-start: 8px; font-size: var(--fs-sm); }
.project-media-sections { display: grid; gap: 18px; }
.creative-reference-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding: clamp(14px, 2vw, 22px); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface-1); }
.creative-reference-card .grow { min-width: min(150px, 100%); flex: 1; }
.creative-reference-card h2, .ref-full h3 { margin: 0; color: var(--text-1); font-size: var(--fs-lg); }
.creative-reference-card p { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ref-thumb { display: grid; place-items: center; width: 64px; height: 64px; cursor: pointer; border: 0; border-radius: 8px; padding: 0; overflow: hidden; background: var(--surface-2); }
.ref-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ref-full img, .ref-full video { max-width: 100%; width: 100%; max-height: 55vh; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.ref-full a {
  display: inline-flex; align-items: center; min-height: 36px; min-width: 36px;
  color: var(--accent-text); overflow-wrap: anywhere; text-align: start;
}
.ref-full h3 { margin-bottom: 6px; }

/* ── Visual 9:16 Campaign Poster Gallery (Projects) ─────────────────────────── */
.library { margin-top: clamp(24px, 3vw, 38px); }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.library-heading h2, .budget-heading h1 {
  margin: 0; display: flex; align-items: center; gap: 10px;
  font-size: clamp(1.38rem, 2.2vw, 1.95rem); letter-spacing: -.035em; line-height: 1.18;
}
.library-count {
  font-size: var(--fs-xs); font-weight: 600; line-height: 1; letter-spacing: 0;
  border: 1px solid var(--border); padding: 4px 9px; border-radius: 20px; color: var(--text-2);
}
.library-heading input { background: var(--surface-1); }
.library-filters {
  display: flex; gap: 16px; border-block-end: 1px solid var(--border); margin-block: 8px 18px; flex-wrap: wrap;
}
.library-filters button {
  cursor: pointer; background: transparent; color: var(--text-3); padding: 10px 8px;
  border: 0; border-block-end: 2px solid transparent; font-size: var(--fs-sm); font-weight: 600;
  min-height: 40px; min-width: 36px;
}
.library-filters button[aria-pressed=true] { border-color: var(--accent-text); color: var(--text-1); }

/* Projects with a finished video are posters in a gallery; the rest are compact rows under it. */
.project-posters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 212px), 1fr));
  gap: 14px;
}
.project-rows { display: flex; flex-direction: column; gap: 6px; }
.project-posters + .project-rows { margin-top: 14px; }
.library-project.poster-project {
  display: block; min-width: 0; padding: 0; text-align: start;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  transition: border-color .18s ease;
}
.library-project.poster-project:hover { border-color: var(--accent); }
button.library-project { cursor: pointer; }
.poster-stage {
  position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden;
  background: var(--surface-2);
}
.poster-stage img { width: 100%; height: 100%; object-fit: cover; }

/* The stand-in when a project has no thumbnail yet (UX Rule 11): a flat plate and its first letter. */
.poster-studio-plate {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center;
  background: var(--surface-2);
}
.poster-plate-monogram {
  font-size: 3.6rem; font-weight: 400; line-height: 1;
  color: var(--text-3);
  transform: translateY(-12%);
}

.poster-scrim { display: none; }
.poster-top-bar {
  position: absolute; top: 10px; inset-inline: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; flex-wrap: wrap;
}
.poster-top-bar .chip {
  background: var(--canvas);
  font-size: 11px; padding: 2px 8px;
}
.poster-qa-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: rgb(14 14 13 / .76); border: 1px solid rgb(255 255 255 / .16);
  color: #fffaf3; font-size: 11px; font-weight: 700;
}
.poster-qa-badge svg { color: #fa9866; width: 12px; height: 12px; }

.poster-bottom-bar {
  position: absolute; bottom: 0; inset-inline: 0;
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
  color: #f7f4ed;
  background: rgb(14 14 13 / .86);
}
.poster-pills {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.poster-meta-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px;
  background: rgb(255 255 255 / .14);
  color: #f7f4ed; font-size: 11px; font-weight: 600; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.poster-meta-pill.kit { background: rgb(250 152 102 / .24); color: #ffd4bc; }
.poster-bottom-bar h3 {
  margin: 0; font-size: 1.02rem; line-height: 1.26; letter-spacing: -.02em;
  color: #fffaf3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.poster-liner {
  margin: 0; font-size: 11.5px; line-height: 1.38; color: rgb(246 243 236 / .76);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.poster-foot-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding-top: 5px; border-top: 1px solid rgb(255 255 255 / .12);
  font-size: 11px; color: rgb(246 243 236 / .74);
}
.poster-foot-meta > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.poster-arrow { flex: none; display: inline-flex; color: #fa9866; }
.queue-answer {
  display: inline-flex; align-items: center; gap: 4px; color: inherit; flex: none;
  text-decoration: underline; text-underline-offset: 3px;
}

.project-shelf > .notice, .library-empty { grid-column: 1 / -1; }
.library-empty {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 24px 20px; align-items: center;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); color: var(--text-2);
}

/* ── Budget Summary ─────────────────────────────────────────────────────────── */
.budget-heading { margin-block: 12px 22px; display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.budget-summary { background: var(--surface-1); border: 1px solid var(--border); padding: clamp(18px, 3vw, 35px); border-radius: var(--r-card); }
.budget-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; gap: 15px; }
.budget-summary dt { color: var(--text-2); font-size: var(--fs-sm); }
.budget-summary dd { margin: 6px 0 0; text-align: match-parent; font-size: clamp(1.35rem, 3.4vw, 3.15rem); letter-spacing: -.055em; line-height: 1.15; }
.budget-summary meter { display: block; width: 100%; height: 10px; margin-top: 22px; accent-color: var(--accent); }
.budget-summary meter::-webkit-meter-bar { background: var(--surface-2); border: 0; }
.budget-summary meter::-webkit-meter-optimum-value { background: var(--accent); }
.budget-breakdown { margin: 18px 0 0; padding: 0; display: flex; gap: 10px 18px; flex-wrap: wrap; font-size: var(--fs-sm); list-style: none; }
.budget-breakdown li { display: flex; gap: 6px; }

[dir=rtl] :is(.hub-title, .library-heading h2, .budget-heading h1, .poster-bottom-bar h3) {
  letter-spacing: normal; line-height: 1.32;
}

/* ── Home: the older unfinished ads, a quiet list under the one card ───────── */
.home-open-more { margin-top: 4px; }
.home-open-more > summary {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text-2); font-size: var(--fs-sm); cursor: pointer;
}
.home-open-list { list-style: none; margin: 0; padding: 0; display: grid; }
.home-open-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.home-open-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }
.home-open-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-open-actions { display: inline-flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.home-open-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-1); font: inherit; font-size: var(--fs-sm);
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px;
}
.home-open-link:hover { text-decoration-color: currentColor; }
.library[hidden], .library [hidden] { display: none !important; }

/* ── Responsive Breakpoints (1440px, 420px side pane, 390px, 320px: 0px Overflow) ── */
@media (max-width: 900px) {
  .style-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hub-dock-head, .hub-dock-prompt, .hub-dock-section, .hub-composer-foot { padding-inline: 14px; }
  .hub-feedback:not(:empty) { padding-inline: 14px; }
  .style-strip {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-block: 2px 4px;
  }
  .style-strip::-webkit-scrollbar { display: none; }
  .style-card { flex: 0 0 116px; scroll-snap-align: start; }
  .hub-composer-foot .hub-submit { width: 100%; }
  .dock-url-wrap { max-width: none; flex: 1 1 100%; }
  .dock-kit-select { max-width: 100%; }
  .dialect-more-select { max-width: 100%; }
}
@media (max-width: 560px) {
  .top .wrap { min-height: 54px; gap: 5px; }
  .studio-wordmark { gap: 6px; font-size: 18px; min-height: 36px; min-width: 36px; }
  .studio-wordmark img { width: 27px; height: 27px; }
  .appearance-tools { gap: 2px; }
  .appearance-tools .iconbtn { min-width: 36px; min-height: 36px; height: 36px; padding-inline: 6px; }
  .top .pill { min-height: 36px; min-width: 36px; padding-inline: 8px; }
  .avatar { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
  .menu:not(.context) { top: 54px; }
  .library-heading { flex-wrap: wrap; gap: 10px; }
  .library-filters { margin-block: 2px 12px; gap: 10px; }
  .project-posters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .poster-bottom-bar { padding: 10px; }
  .poster-bottom-bar h3 { font-size: 0.94rem; }
  .budget-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget-summary dl > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 379px) {
  .project-posters { grid-template-columns: minmax(0, 1fr); }
  .poster-stage { aspect-ratio: 4 / 5; }
}

/* The unfinished ad on Home carries its own picture when the server sends one (its first look, else the
   person's first photo): a small 9:16 frame at the start of the card. */
.home-resume-pic {
  flex: 0 0 auto; width: 64px; aspect-ratio: 9 / 16;
  border-radius: var(--r-ctl); overflow: hidden;
  background: var(--surface-2);
}
.home-resume-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-resume-pic .brand-monogram { width: 100%; height: 100%; border-radius: 0; }
.home-resume.has-pic > .grow { flex: 1 1 200px; }

/* ── Home: a project with no video yet is a compact row, never a large empty plate ─────────────────────── */
/* A row with no picture carries a flat initial on the row itself, no plate behind it. */
.library-project.poster-project.is-row.no-pic .poster-studio-plate { background: none; }
/* On a phone every project is a row (web/elll.css draws them): the two groups give way to one list, in the
   order the server sent the projects. */
@media (max-width: 720px) {
  .project-shelf { display: flex; flex-direction: column; gap: 6px; }
  .project-shelf > .project-posters,
  .project-shelf > .project-rows { display: contents; }
}
/* On a wide screen the row is the same block of the logo green: the picture at its start, the title and where
   it stands beside it, the state chip at its end. */
@media (min-width: 721px) {
  .library-project.poster-project.is-row {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas: "pic text chip";
    align-items: center; column-gap: 18px;
    min-height: 86px; padding: 0; padding-inline-end: 18px;
    border: 0; background: var(--block); color: var(--block-ink);
  }
  .library-project.poster-project.is-row:hover { background: var(--block-hover); }
  .library-project.is-row .poster-stage { display: contents; }
  .library-project.is-row .poster-stage img,
  .library-project.is-row .poster-studio-plate {
    grid-area: pic; align-self: stretch;
    width: 64px; height: 100%; min-height: 86px; object-fit: cover;
  }
  .library-project.is-row .poster-studio-plate { background: var(--surface-2); }
  .library-project.is-row .poster-plate-monogram { font-size: 1.5rem; transform: none; color: var(--block-line); }
  .library-project.is-row .poster-top-bar { position: static; grid-area: chip; justify-content: flex-end; }
  .library-project.is-row .poster-bottom-bar {
    position: static; grid-area: text; padding: 12px 0; gap: 2px;
    background: none; color: inherit;
  }
  .library-project.is-row .poster-bottom-bar h3 { color: var(--block-ink); font-size: 1.125rem; -webkit-line-clamp: 1; }
  .library-project.is-row .poster-foot-meta {
    justify-content: flex-start; gap: 14px;
    padding-top: 0; border-top: 0; color: var(--block-line); font-size: .875rem;
  }
}
