/* Only what Channel Clarity's carried design system does not already give this app. Every value comes from its variables.
   The carried sheets (tokens, signin, workspace-*) are never edited here; each rule below says why it exists. */

/* Channel Clarity's search box carries margin-left:auto and pushes its account control to the right. This bar has no
   search, so the account control takes that margin itself. */
#workspace-root .top .av { margin-left: auto; }

/* .nav and .av set display, which beats the hidden attribute; signed out, both must stay hidden. */
#workspace-root .top [hidden] { display: none; }

/* The carried ops sheet locks body scrolling (each Channel Clarity view scrolls inside itself). The page area is the
   scroll container under the 52px bar, so a page taller than the window still scrolls. The shell focuses it on
   every route for screen readers; it is not a control, so it shows no ring. */
#workspace-root #main { height: calc(100vh - 52px); overflow: auto; outline: 0; }

/* The system marks a bad field nowhere; this is the error color it uses for .ds-err. */
#workspace-root .ds-in[aria-invalid=true] { border-color: var(--err); }

/* Notes, items and post text keep the line breaks people typed. */
#workspace-root .ps-pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Work table columns, sized as Channel Clarity's Requests table: the details cell (.ds-t td.one) takes the width that is
   left, and the customer cell stays on one line. The system scopes that one-line rule to its own page
   ([data-page=requests] td:nth-child(2)); this page is data-page=work and also keeps the job name (column 3) on one line. */
#workspace-root .ds-page[data-page=work] .ds-t td:nth-child(2), #workspace-root .ds-page[data-page=work] .ds-t td:nth-child(3) { white-space: nowrap; }

/* Photo thumbnails: the system has no image part. Sizes and corners are its steps (--s*, --r). */
#workspace-root .ps-photos { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; }
#workspace-root .ps-photos a, #workspace-root .ps-photo-open { display: block; border-radius: var(--r); }
/* A thumbnail is a plain button that opens the photo larger in a dialog (never a link, which would download it). */
#workspace-root .ps-photo-open { padding: 0; border: 0; background: none; cursor: zoom-in; }
#workspace-root dialog.ps-photo-view { max-width: min(96vw, 1280px); }
#workspace-root dialog.ps-photo-view img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: var(--r); }
#workspace-root .ps-photos img, #workspace-root .photo-failed { display: flex; align-items: center; justify-content: center; width: 112px; height: 84px;
  object-fit: cover; border: 1px solid var(--line); border-radius: var(--r); background: var(--wash); color: var(--ink2); font: var(--meta); text-align: center; }
#workspace-root .ps-photos img:not([src]) { color: transparent; }
/* The ad's photo order: one row per photo, a thumbnail the chooser's size, its number, and the two moves beside it. */
#workspace-root .ps-photo-order { display: grid; gap: var(--s2); margin: 0 0 var(--s4); padding: 0; list-style: none; }
#workspace-root .ps-photo-order li { display: flex; align-items: center; gap: var(--s3); }
#workspace-root .ps-photo-order img { flex: none; width: 112px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--wash); color: transparent; }
#workspace-root .ps-photo-order li > div { min-width: 0; }
#workspace-root .ps-photo-order b { display: block; font-weight: 600; }
#workspace-root .ps-moves { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }

/* Channel Clarity is a desktop tool and its system has no narrow layout. Below 900px the table and the side panel
   stack and the page grows instead of scrolling inside itself. */
@media (max-width: 900px) {
  #workspace-root .ds-page { height: auto; overflow: visible; }
  #workspace-root .ds-body { flex-direction: column; padding-left: var(--s4); padding-right: var(--s4); }
  #workspace-root .ds-head, #workspace-root .ds-tabs { padding-left: var(--s4); padding-right: var(--s4); margin-left: 0; margin-right: 0; }
  #workspace-root .ds-tabs { overflow-x: auto; }
  #workspace-root .ds-main { overflow: visible; }
  #workspace-root .ds-side { width: auto; }
  #workspace-root .ds-t.edge th:first-child, #workspace-root .ds-t.edge td:first-child { padding-left: var(--s3); }
  #workspace-root .ds-t.edge th:last-child, #workspace-root .ds-t.edge td:last-child { padding-right: var(--s3); }
  #workspace-root .ds-cols, #workspace-root .ds-form, #workspace-root .ds-two { grid-template-columns: minmax(0, 1fr); }
}

/* Inbox: the "Drafts and unsent messages" fold at the top of the feed. The carried .fold is one flex row, made for a
   closed summary line (Channel Clarity's "Drafts, drops and records"); open, ours holds draft cards with their buttons,
   which must stack under the summary instead of sitting beside it. */
#workspace-root #inbox .feed details.fold[open] { display: block; }
#workspace-root #inbox .feed details.fold[open] > summary { margin-bottom: var(--s3); }

/* Sign-in's main button. Channel Clarity draws its sign-in page outside the app frame, so signin.css
   never meets the frame's general rule for submit buttons (.ops-root button[type=submit], white).
   Here the sign-in card sits inside the frame and that rule wins. This restores signin.css's own values. */
.ops-root .signin .signin-primary { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Connections, Craigslist accounts: each account is its row plus a Details row under it. The pair reads as one entry,
   so the line between them goes and the Details row sits tight under its account. */
#workspace-root .ds-t tr[data-account] td { border-bottom: 0; padding-bottom: var(--s1); }
#workspace-root .ds-t tr.ps-account-details td { padding-top: 0; }
#workspace-root .ds-t tbody tr.ps-account-details:hover td { background: none; }
