/* Workbench ownership: intake, uploads, project home, composer, and account. */

/* ---------- Frame ---------- */

.workbench {
  margin: 0 auto;
  max-width: 1120px;
  padding: 0 24px 80px;
}

.account-promo {
  display: flex;
  gap: 6px;
  max-width: 18rem;
}

.account-promo-input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  flex: 1 1 auto;
  font-family: var(--brand);
  font-size: var(--fs-slug);
  letter-spacing: 0.06em;
  min-width: 0;
  padding: 7px 9px;
}

.account-promo-input::placeholder { color: var(--faint); }
.account-promo .cl-btn { flex: 0 0 auto; }

/* ---------- Project header: title only ----------
   The project page leads with the project NAME and nothing else in the header:
   the old "PROJECT — NAME" eyebrow, the "Private read" mode chip, and the
   reads-used pass chip are all dropped here. Reads-left + the current standing
   now live in the LIGHT current-state header (.project-standing, below) that the
   home renderer paints into #project-home-main — never a second chip row. So
   collapse the eyebrow + the whole chip cluster on the project view. (#engine-chip
   / #project-pass-counter keep their ids for the JS that still writes them; they
   simply never paint here. The print sheet still hides any .mode-chip.) */
[data-view="project"] #project-eyebrow,
[data-view="project"] .project-head-status {
  display: none;
}

/* ---------- Intake composition ----------
   Shared fields and notices remain component-owned. This sheet owns the
   segmented material/IP control and feature-specific registration flags. */

/* The inline "required for IP" flag — a quiet gold mono tick, NOT gold body
   prose; no kit atom carries an inline gold registration flag. */
.field-required {
  color: var(--gold);
  font-family: var(--brand);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Shared segmented control for material type and IP origin. */
.format-toggle {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.format-option {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 0;
  color: var(--body);
  cursor: pointer;
  font-family: var(--brand);
  font-size: var(--fs-slug);
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  margin-left: -2px;
  min-height: 44px;
  padding: 9px 8px;
  text-transform: uppercase;
}

.format-option:first-child { margin-left: 0; }
.format-option:hover { background: var(--bg); }

.format-option.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  position: relative;
  z-index: 1;
}

/* ---------- File-ready ledger card (PRESERVE) ----------
   Warm ledger surface + hard ink edge (no off-brand blue-gray, no soft radius).
   The copy block and the Remove-file action share the row from the TOP so a
   one-line button never floats mid-paragraph as orphaned debris. */
.upload-status {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 14px 16px;
}

.upload-status > .cl-stack {
  flex: 1 1 auto;
  min-width: 0;
}

/* The trailing action (Remove file / Try another file) stays one line and never
   shrinks, so it reads as a button beside the copy rather than wrapped debris. */
.upload-status > .cl-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.upload-status h3 { font-size: var(--fs-body); margin: 0 0 4px; }
.upload-status p  { margin: 0 0 4px; }

/* ---------- Editable slate title ----------
   The Development Slate cards live in 04-projects.css; only the inline-rename
   affordance on the card title is defined here (its sole definition). */
.project-card h3.project-title { cursor: text; }
.project-card h3.project-title:hover {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.project-card h3.project-title:focus-visible {
  outline: 2px solid var(--accent, #876931);
  outline-offset: 2px;
}
.project-title-input {
  margin: 0;
  padding: 2px 4px;
}

/* Upload state belongs to the workbench that creates it. */
.upload-status.preparing {
  background: var(--screen);
  border: 0;
  color: var(--on-screen);
  padding: 22px 24px;
  position: relative;
}

.upload-status.preparing::before {
  background-image: var(--grain);
  content: "";
  inset: 0;
  opacity: 0.055;
  pointer-events: none;
  position: absolute;
}

.upload-prep {
  position: relative;
}

.upload-status.preparing .cl-eyebrow,
.upload-warning {
  color: var(--screen-dim);
}

.upload-status.preparing h3 {
  color: var(--on-screen);
  font-family: var(--brand);
  font-size: var(--fs-body);
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.upload-track {
  background: rgba(240, 237, 226, 0.14);
  height: 6px;
  margin: 0 0 10px;
  overflow: hidden;
}

.upload-track span {
  background: var(--gold-soft);
  display: block;
  height: 100%;
  transition: width 250ms ease;
  width: 3%;
}

.upload-status.preparing .score-line {
  color: var(--gold-soft);
}

.upload-warning {
  font-size: var(--fs-small);
  margin: 6px 0 14px;
}

.upload-status.preparing #cancel-upload {
  border-color: var(--screen-hairline);
  color: var(--screen-dim);
}

.upload-status.preparing #cancel-upload:hover {
  background: rgba(240, 237, 226, 0.07);
  color: var(--on-screen);
}

.upload-status.failed {
  border-color: rgba(179, 54, 42, 0.5);
  border-left: 4px solid var(--red);
}

body.upload-pending .format-toggle,
body.upload-pending #material {
  opacity: 0.45;
  pointer-events: none;
}

.upload-note {
  color: var(--faint);
  font-size: var(--fs-slug);
  margin: 0;
}

@media (max-width: 560px) {
  .upload-status {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ===========================================================================
   PROJECT HOME (data-view="project")  —  the one-script desk
   SAME layout as the slate: a LIGHT current-state header (the project name, then
   reads-left + the current standing) at the very top, then ONE shared-card grid
   of reads. No black-box hero — the standing rides plain paper. The cards
   themselves (read cards + empty entitlement cards + the add card) are the kit's
   ONE shared .cl-card / .cl-card[data-empty] (css/10-kit.css) with the shared
   per-card menu; 04-projects.css owns the data-treatment-tone accent color for
   the read cards. This block owns ONLY the page composition: the column rhythm,
   the light standing header's three text roles, and the read-card grid columns.
   =========================================================================== */

/* The home column: the standing header sits directly above the read grid as one
   ordered block, with a clear gap down to the grid section (#draft-history). */
.project-home {
  display: block;
  margin: 0 0 var(--space-5);
}

/* Project Home: ONE description line under the title (Title -> Description ->
   "Reads" divider -> cards). #project-home-start stays in the DOM (hidden) as the
   start delegate the in-grid empty cards click. No standing cluster / hero slab. */
.project-home-desc { max-width: 64ch; }

/* ---------- READ GRID (#draft-grid) ----------
   The shared-card grid: read cards + waiting entitlement cards + the add card.
   SAME multi-up rhythm as the slate's project grid (it collapses to one column
   on narrow screens via the shared kit rule); the bespoke single-column ledger
   override is gone now that each read is the shared compact .cl-card. */
#draft-grid.cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) {
  #draft-grid.cl-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .workbench {
    padding: 0 16px 60px;
  }
}

/* Read-composer and account compositions. Shared fields, buttons, lists, and
   dialogs remain owned by the component kit. */
.ip-details {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 20px;
}

.ip-details-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ip-rights-row {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  line-height: 1.5;
  margin: 18px 0 6px;
  max-width: 70ch;
}

.ip-rights-row input {
  margin-top: 4px;
}

.ip-rights-row .field-required {
  margin-left: 4px;
}

.draft-history {
  margin: 0 0 28px;
}

.reads-left {
  color: var(--gold);
  font-family: var(--brand);
  font-size: var(--fs-slug);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#composer-logline {
  min-height: 84px;
}

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

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

.composer-rights {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  gap: 8px;
  margin: 4px 0 10px;
  cursor: pointer;
  user-select: none;
}

.composer-rights input[type="checkbox"] {
  accent-color: var(--gold);
  height: 15px;
  margin: 0;
  width: 15px;
}

body.composer-open {
  overflow: hidden;
}

body.composer-open .projects-shell {
  filter: blur(4px);
}

.account-settings {
  margin: 4px 0 0;
}

.account-profile-name {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  margin: 0;
}

.account-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.account-email-optin {
  align-items: flex-start;
  display: flex;
  cursor: pointer;
  gap: 8px;
  line-height: 1.5;
  max-width: 42ch;
}

.account-email-optin input {
  margin-top: 3px;
}

.account-danger-row {
  margin-top: var(--space-2);
}

@media (max-width: 720px) {
  .ip-details-row {
    grid-template-columns: 1fr;
  }
}

/* Each read card draws the kit's data-accent left rule, colored by the read's
   disposition in the SAME treatment-tone vocabulary the slate cards use
   (04-projects.css owns that mapping for .project-card; this is the
   read-card sibling — same six tones, same accent vars — so the read's standing
   reads off the left edge exactly like a project tile). */
.draft-card[data-treatment-tone="reading"] { --cl-accent: var(--read-running); }
.draft-card[data-treatment-tone="urgent"]  { --cl-accent: var(--red); }
.draft-card[data-treatment-tone="working"] { --cl-accent: var(--yellow); }
.draft-card[data-treatment-tone="ready"]   { --cl-accent: var(--green); }
.draft-card[data-treatment-tone="stalled"] { --cl-accent: var(--locked); }
.draft-card[data-treatment-tone="unread"]  { --cl-accent: var(--gold-display); }
