/* Site Builder — Plan, the Updates panel's third tab (public/plan.js)
   The panel's own skin (.upc, updates.css), widened into a dashboard: a bar
   across the top (your plans, Delete, where the plan is at, Build it), then
   three columns — the deliverables on the left, the conversation in the
   middle (Focus mode's bubbles, focus.css, over the panel's composer), the
   plan on the right. The side columns sit on a faint sand, the conversation
   on the panel's paper. Narrow screens stack them. */

/* ---- Plan up: the panel widens, and the Updates tab's insides step aside ---- */
.upc.is-plan { width: min(max(var(--upc-w, 448px), 1180px), calc(100vw - 24px)); }
.upc.is-plan:not(.sized-h) { height: min(820px, calc(100vh - 44px)); }
.upc.is-plan > :is(.upc-search, #upc-scroll, .upc-compose, .upc-foot) { display: none !important; }
.upc-tabs .ag-tab[data-tab="plan"][aria-selected="true"] svg { color: var(--clay); }

.upl { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.upl[hidden] { display: none; }

/* ---- the bar: your plans · new · delete … where it is at · Build it ---- */
.upl-bar { display: flex; align-items: center; gap: 6px; padding: 2px 14px 10px 16px; border-bottom: 1px solid var(--cl-line); flex-shrink: 0; }
.upl-bar .upc-x { margin: 0; }
.upl-plans {
  flex: 0 1 auto; max-width: 300px; height: 30px; padding: 0 26px 0 12px; background-color: transparent; background-position: right 9px center;
  border: 1px solid var(--cl-line); border-radius: 999px; box-shadow: none;
  font: 650 12px var(--sans); color: var(--cl-ink); cursor: pointer; text-overflow: ellipsis;
}
.upl-plans:hover:not(:disabled) { background-color: var(--cl-sand); }
.upl-plans:disabled { cursor: default; color: var(--cl-muted); }
.upl-bar-gap { flex: 1; }
.upl-state { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 11.5px; color: var(--cl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upl-state .upd-spin { width: 11px; height: 11px; color: var(--clay); }
.upl-state .upd-link { font-size: 11.5px; color: #A64B28; }
.upl .btn.icon.confirm { gap: 5px; padding: 4px 10px 4px 8px; background: #C03A31; border-color: transparent; color: #fff; font-size: 12px; }
.upl .btn.icon.confirm:hover { background: #A8322A; }
.upl-del[hidden], .upl-build[hidden] { display: none; }
/* Build it: the plan goes to Claude to build — the dashboard's one filled pill */
.upl-build {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 14px 0 11px; flex-shrink: 0;
  border-radius: 999px; background: linear-gradient(180deg, #D98A6C 0%, #C9643F 100%); color: #fff; cursor: pointer;
  font: 650 12.5px var(--sans); box-shadow: 0 1px 2px rgba(20, 20, 19, .14), 0 4px 12px rgba(201, 100, 63, .25), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: filter .16s var(--ease-out), transform .32s var(--ease-spring), opacity .16s var(--ease-out);
}
.upl-build svg { width: 14px; height: 14px; }
.upl-build:hover:not(:disabled) { filter: brightness(1.06); }
.upl-build:active:not(:disabled) { transform: scale(.96); transition-duration: .06s; }
.upl-build:disabled { opacity: .45; cursor: default; box-shadow: none; }
.upl-build.loading { opacity: .6; cursor: progress; }
.upl-build.confirm { background: linear-gradient(180deg, #A64B28 0%, #8C3A1C 100%); }
.upl-build:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

/* ---- the three columns ---- */
.upl-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(260px, 370px); }
.upl-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.upl-dl, .upl-pl { background: rgba(240, 238, 230, .38); }
.upl-dl { border-right: 1px solid var(--cl-line); border-bottom-left-radius: 22px; }
.upl-pl { border-left: 1px solid var(--cl-line); border-bottom-right-radius: 22px; }
.upl-col-head { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 10px 10px 4px 16px; flex-shrink: 0; }
.upl-col-head h3 { margin: 0; font: 700 10.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--cl-muted); }
.upl-by { flex: 1; min-width: 0; font-size: 11px; color: var(--cl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upl-col-head .upc-count { margin-right: auto; }
.upl-tool { margin: 0; }
.upl-tool svg { width: 15px; height: 15px; }
.upl-tool.on { background: var(--clay-soft); color: #A64B28; }
.upl-col-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 14px 16px; }
.upl-col-body[hidden] { display: none; }
.upl-ph { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--cl-muted); }

/* the deliverables: one card each, a clay tick, ✕ on hover to take one out */
.upl-dl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upl-dl-list li:not(.upl-ph) {
  position: relative; display: flex; align-items: flex-start; gap: 9px; padding: 9px 28px 9px 10px;
  background: rgba(255, 255, 255, .88); border: 1px solid var(--cl-line-soft); border-radius: 12px;
  font-size: 13px; line-height: 1.45; color: var(--cl-ink); overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(20, 20, 19, .04); animation: upf-in .32s var(--ease-out) backwards;
}
.upl-tick { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--clay-soft); color: #A64B28; }
.upl-tick svg { width: 11px; height: 11px; }
.upl-x {
  all: unset; position: absolute; top: 7px; right: 6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  color: var(--cl-muted); cursor: pointer; opacity: 0; transition: opacity .16s var(--ease-out), background-color .16s var(--ease-out);
}
.upl-x svg { width: 12px; height: 12px; }
.upl-dl-list li:hover .upl-x, .upl-x:focus-visible { opacity: 1; }
.upl-x:hover { background: rgba(20, 20, 19, .07); color: var(--cl-ink); }
.upl-x:disabled { display: none; }
.upl-x:focus-visible { outline: 2px solid var(--clay); outline-offset: 1px; }

/* add a deliverable / add to the plan: a slim pill at each column's foot */
.upl-add { display: flex; align-items: center; gap: 6px; padding: 9px 10px 12px 12px; border-top: 1px solid var(--cl-line-soft); flex-shrink: 0; }
.upl-add[hidden] { display: none; }
.upl-add input {
  flex: 1; min-width: 0; height: 32px; padding: 0 13px; border: 1px solid var(--cl-line); border-radius: 999px;
  background: rgba(255, 255, 255, .9); box-shadow: none; font: 13px var(--sans); color: var(--cl-ink);
}
.upl-add input:focus { border-color: var(--clay); box-shadow: 0 0 0 2.5px rgba(217, 119, 87, .16); outline: none; }
.upl-add input:disabled { opacity: .55; }
.upl-add .comp-btn:disabled { opacity: .4; cursor: default; }

/* the plan: Markdown, or its own text box while you edit it */
.upl-pl-body { font-size: 13px; color: var(--cl-ink); overflow-wrap: anywhere; }
.upl-pl-body.md :is(h3, h4, h5, h6):first-child { margin-top: 2px; }
.upl-pl-edit { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 12px 14px; }
.upl-pl-edit[hidden] { display: none; }
.upl-pl-edit textarea {
  flex: 1; min-height: 120px; resize: none; padding: 10px 12px; border: 1px solid var(--cl-line); border-radius: 12px;
  background: #fff; font: 12px/1.55 var(--mono); color: var(--cl-ink);
}
.upl-pl-edit textarea:focus { border-color: var(--clay); box-shadow: 0 0 0 2.5px rgba(217, 119, 87, .16); outline: none; }
.upl-pl-acts { display: flex; justify-content: flex-end; gap: 6px; }
.upl-pl-acts .btn { padding: 5px 13px; font-size: 12.5px; }

/* the conversation */
.upl-feed { gap: 10px; padding-top: 12px; }
.upl .upl-compose { padding-bottom: 10px; }
.upl #upl-msg { min-height: 44px; max-height: 26vh; }
.upl-empty > svg { width: 26px; height: 26px; color: var(--clay); margin-bottom: 2px; }
.upl-updated { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: -2px 0 2px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--clay-soft); color: #A64B28; font: 600 11px var(--sans); }
.upl-updated svg { width: 12px; height: 12px; }
.upl-dirty { margin: 0; padding: 4px 6px 0; font-size: 11.5px; line-height: 1.45; color: #8A5A12; }
.upl-dirty[hidden] { display: none; }
.upl-dirty .upd-link { font-size: 11.5px; color: #A64B28; }

/* narrow: the columns stack — deliverables, the conversation, the plan */
@media (max-width: 900px) {
  .upc.is-plan:not(.sized-h) { height: calc(100vh - 44px); }
  .upl-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .upl-dl, .upl-pl { max-height: 21vh; border: none; border-radius: 0; }
  .upl-dl { border-bottom: 1px solid var(--cl-line); }
  .upl-pl { border-top: 1px solid var(--cl-line); border-bottom-left-radius: 22px; border-bottom-right-radius: 22px; }
  .upl-state { display: none; }
}
@media (prefers-reduced-motion: reduce) { .upl-dl-list li { animation: none; } }
