/*
  Gener8 staff page (/staff). Colours and type from the style kit (kit/css/tokens.css),
  sized in pixels for a laptop rather than a wall.

  Parts: top bar with tabs, sign-in card, toolbars (.bar), the Views filter column
  (.side), cards in a grid (.vcard), the tour editor (form, step list, view picker),
  modals and a toast.
*/
* { box-sizing: border-box; }
html { background: #f1eee8; }
:root[data-theme="dark"] { background: #141311; }
body {
  margin: 0; font-family: var(--font-ui); color: var(--ink); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 22px 60px; }
.top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.brand { font-family: var(--font-display); font-size: 24px; }
.brand b { font-weight: 700; }
.brand span { color: var(--muted); font-style: normal; }
.who { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }

/* ---- Buttons and fields --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-weight: 400; font-size: 14px; white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
textarea { min-height: 64px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.msg { font-size: 14px; color: var(--muted); }
.msg.err { color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.num { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }

.card { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 16px; padding: 22px; box-shadow: var(--panel-shadow); }
.signin { max-width: 440px; margin: 50px auto; }
.signin h1 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; }
.signin p { color: var(--muted); margin: 0 0 16px; }
.signin details { margin-top: 16px; }
.signin summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.signin details .row { margin-top: 10px; }

/* ---- Tabs ----------------------------------------------------------------------------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--well); }
.tabs button { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font-weight: 400; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---- Toolbar and columns ------------------------------------------------------------------ */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.bar .lead { color: var(--muted); font-size: 14px; }
.bar input[type=search] { max-width: 340px; margin-left: auto; }
.bar .spacer { flex: 1; }
.edtitle { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin: 0 6px; }
.cols { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 6px; }
.sidehead { font-family: var(--font-display); font-style: normal; color: var(--muted); font-size: 16px; margin: 10px 0 2px; }
.filters { display: flex; flex-direction: column; gap: 2px; }
.filters button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  border: 0; background: none; padding: 7px 10px; border-radius: 8px;
}
.filters button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 400; }

/* ---- Cards ----------------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.vcard { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.thumb { aspect-ratio: 16 / 10; background: linear-gradient(160deg, #e9e6df, #cfcbc2); display: grid; place-items: center; position: relative; }
:root[data-theme="dark"] .thumb { background: linear-gradient(160deg, #2a2824, #1c1b18); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { font-family: var(--font-display); font-style: normal; color: var(--muted); font-size: 18px; }
.badge { position: absolute; left: 8px; top: 8px; background: var(--panel); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 400; }
.badge.tour { background: var(--ink); color: var(--panel); }
.vbody { padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.vbody h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.meta { color: var(--muted); font-size: 13px; }
.note { font-size: 13px; color: var(--ink); opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.folderchip { align-self: flex-start; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--well); color: var(--muted); margin-top: 3px; }
/* Made by a demo account (removed from /admin) */
.folderchip.demo { background: #fff1d6; color: #8a5a00; font-weight: 700; }
/* Shown to demo accounts at the top of the staff page */
/* Demo accounts cannot submit requests (the database refuses them too) */
.is-demo .atlasbar { display: none; }
.demobar { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #fff1d6; color: #5d4300; font-size: 14px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 14px; }
.edit { padding: 0 14px 14px; display: grid; gap: 8px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; }

/* ---- Tour editor -------------------------------------------------------------------------------- */
.cols.editor { grid-template-columns: 340px 1fr; }
.form { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.steplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.steplist li {
  display: grid; grid-template-columns: 28px 128px 1fr auto; gap: 12px; align-items: start;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; padding: 10px;
}
.steplist li.dragging { opacity: .4; }
.steplist li.over { outline: 2px dashed var(--accent); }
.steplist .n { counter-increment: step; font-family: var(--font-mono); color: var(--faint); cursor: grab; padding-top: 6px; text-align: center; }
.steplist .n::before { content: counter(step); }
.steplist .t { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.steplist .info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.steplist .info b { font-size: 14px; }
.steplist .info textarea { min-height: 52px; }
.steplist .info .row label { flex-direction: row; align-items: center; gap: 6px; }
.steplist .info select { width: auto; padding: 5px 8px; }
.steplist .ctl { display: flex; flex-direction: column; gap: 4px; }
.steplist:empty::after { content: 'No steps yet. Add saved views from the list below.'; color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.picker { padding: 14px; }
.picker .row b { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.picker input[type=search] { max-width: 300px; margin-left: auto; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; max-height: 420px; overflow: auto; }
.pick { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); text-align: left; padding: 0; display: flex; flex-direction: column; }
.pick:active { transform: scale(.98); }
.pick span { padding: 6px 8px 8px; font-size: 13px; line-height: 1.3; }
.pick small { color: var(--muted); display: block; }

/* ---- Modals and toast ---------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal .card { text-align: center; max-width: 380px; width: 100%; }
.modal .card.wide { max-width: 520px; text-align: left; }
.modal h2 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; margin: 12px 0; }
.qr img, .qr canvas { display: block; }
.lnk { font-weight: 700; word-break: break-all; margin-bottom: 14px; }
.addlist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 16px; max-height: 320px; overflow: auto; }
.addlist button { display: flex; justify-content: space-between; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--panel); padding: 10px 18px; border-radius: 999px; font-size: 14px;
}

@media (max-width: 860px) {
  .cols, .cols.editor { grid-template-columns: 1fr; }
  .side, .form { position: static; }
  .steplist li { grid-template-columns: 24px 90px 1fr; }
  .steplist .ctl { grid-column: 1 / -1; flex-direction: row; }
}

/* ---- Pathology tab: one row per condition ------------------------------------------- */
.pathtable { display: flex; flex-direction: column; gap: 28px; }
.parea { display: flex; flex-direction: column; gap: 12px; }
.parea h2 { margin: 0 0 2px; font-size: 20px; font-family: var(--font-display, inherit); font-weight: 700; }
.parea h2 .num { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.prow { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1.4fr) minmax(260px, 1.6fr); gap: 14px 22px; align-items: start; }
.prow h3 { margin: 0 0 2px; font-size: 17px; }
.prow .kick { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.prow .src { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.prow .levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prow .levels a { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.prow .shows { font-size: 13px; color: var(--ink); line-height: 1.45; }
.prow .review { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prow .review textarea, .prow .review .wide { grid-column: 1 / -1; }
.prow .review textarea { min-height: 54px; }
.prow .review .row { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.prow .review .stamp { font-size: 12px; color: var(--muted); }
.status { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--well, #eee); color: var(--muted); }
.status.reviewed { background: #dff2e6; color: #1f6b3a; }
.status.sent { background: #fff1d6; color: #8a5a00; }
.status.changes { background: #fde3e0; color: #a3261a; }
@media (max-width: 900px) { .prow { grid-template-columns: 1fr; } }

/* ---- Stories tab and story editor -------------------------------------------------------------- */
.vcard.story .vbody { padding-top: 14px; }
.vcard.story .vbody .row { justify-content: space-between; align-items: center; }
.pages li { grid-template-columns: 24px 1fr auto; }
.pages li:empty::after { display: none; }
.pages.steplist:empty::after { content: 'No pages yet. Press Add a page.'; }
.pages .info input[type=text] { font-weight: 700; }
.pages .info textarea { min-height: 72px; }
.setup { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 14px; padding: 10px 12px; border-radius: 10px; background: var(--well); }
.setup label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.setup label.check { flex-direction: row; align-items: center; gap: 6px; align-self: end; padding-bottom: 6px; color: var(--ink); font-size: 13px; }
.setup select, .setup input[type=number] { width: 100%; padding: 5px 8px; font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.pages .ctl a.btn { text-decoration: none; display: inline-grid; place-items: center; }

/* A story page recorded on the model (story maker): its picture and where to change it */
.setup.recorded { display: flex; gap: 12px; align-items: center; grid-template-columns: none; }
.setup.recorded img { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; flex: none; }
#makeApp { width: auto; flex: none; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font: inherit; }

/* Share links for a story (share-links.js) */
.sharelinks { max-width: 680px !important; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.sl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sl-list li { padding: 10px 12px; border-radius: 10px; background: var(--well); display: flex; flex-direction: column; gap: 6px; }
.sl-list .sl-main { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.sl-list .lnk { font-family: var(--font-mono, monospace); font-size: 13px; word-break: break-all; }
.sl-list .meta { font-size: 12px; color: var(--muted); }
.sl-form { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.sl-form h3 { margin: 0; font-size: 16px; }
.sl-ticks { display: flex; flex-direction: column; gap: 6px; }
.sl-ticks .check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sl-ticks .check.sub { padding-left: 26px; }
.sl-ticks .check.off { opacity: .45; }
.sl-ticks .check.always { color: var(--muted); }
.sharelinks .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.sharelinks label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sharelinks label.check { flex-direction: row; align-items: center; color: var(--ink); font-size: 14px; }
.sharelinks input[type=text], .sharelinks input[type=date], .sharelinks select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font: inherit; font-size: 14px; color: var(--ink); }

/* ---- Library tab: one row per entry (library-page.js) and its form (library-editor.js) ---- */
.lfilters select { width: auto; padding: 7px 10px; }
.liblist { display: flex; flex-direction: column; gap: 10px; }
.lrow { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 10px 14px 10px 10px; display: grid; grid-template-columns: 160px 1fr 220px; gap: 16px; align-items: center; }
.lpic { aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; background: var(--well); }
.lpic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lpic .ph { display: block; width: 100%; height: 100%; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 30%, #f6f2ea), color-mix(in srgb, var(--c) 80%, #2b241c)); }
.linfo { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.linfo .kick { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.linfo h3 { margin: 0; font-size: 16px; }
.ltags { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ltags span:first-child { color: var(--ink); }
.lctl { display: flex; flex-direction: column; gap: 6px; }
.lctl select { padding: 6px 9px; }
.libedit { max-width: 760px !important; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.libedit .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.libedit .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.libedit .sidehead { margin: 4px 0 0; }
.libedit .ticks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 12px; }
.libedit .ticks .check { font-size: 13px; }
.libedit .picrow { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: center; }
.libedit .lepic { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--well); display: grid; place-items: center; padding: 6px; text-align: center; }
.libedit .lepic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.libedit label.btn { flex-direction: row; color: var(--ink); cursor: pointer; }
@media (max-width: 900px) { .lrow { grid-template-columns: 110px 1fr; } .lctl { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; } .libedit .ticks { grid-template-columns: 1fr 1fr; } }

/* Who asked for a library entry (requests) */
.linfo .asked { font-size: 13px; color: var(--accent); }
.lereqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lereqs li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--well); font-size: 14px; }
.linfo .asked .due.soon { color: #8a5a00; font-weight: 700; }
.linfo .asked .due.late { color: #a3261a; font-weight: 700; }

/* ---- BLISs Anatomy tab (atlas-page.js, atlas-report.js): to check, how it works, report, filters, cards ---- */
.tabcount { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
#atlasPage .sech { margin: 0; font-size: 18px; }
.todo { background: var(--panel); border: 2px solid var(--accent); border-radius: 18px; padding: 16px 18px 18px; margin-bottom: 16px; }
.todo.empty { border: 1px dashed var(--line); padding: 14px 18px; }
.todo-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.todo-head h2 { margin: 0; font-size: 22px; }
/* Waiting for you tabs (atlas-page.js): Research to check, Models to check */
.todo-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--well); }
.todo-tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 15px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.todo-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.todo-tabs button:disabled { opacity: .45; cursor: default; }
.todo .todo-tabs .count { min-width: 24px; height: 24px; font-size: 13px; }
.todo-tabs button:not([aria-selected="true"]) .count { background: var(--line); color: var(--ink); }
/* Up next for building (atlas-page.js): folds open and shut */
.nextup { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px; padding: 14px 18px; margin-bottom: 16px; }
.nextup > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.nextup > summary::-webkit-details-marker { display: none; }
.nextup > summary::before { content: '\25B8'; color: var(--muted); align-self: center; transition: transform var(--dur) var(--ease); }
.nextup[open] > summary::before { transform: rotate(90deg); }
.nextup[open] > summary { margin-bottom: 12px; }
.nextup h2 { margin: 0; font-size: 20px; }
.nextup .count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--well); font-size: 13px; vertical-align: 2px; }
.todo-hint { margin: -4px 0 12px; }
.todo-fold { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.todo-fold::before { content: '\25B8'; color: var(--muted); font-size: 16px; transform: rotate(90deg); transition: transform var(--dur) var(--ease); }
.todo.shut .todo-fold::before { transform: none; }
.todo.shut { padding-bottom: 6px; }
.todo.shut .todo-head { margin-bottom: 10px; }
.todo .count { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 15px; vertical-align: 2px; }
.howto { background: var(--well); border-radius: 14px; padding: 10px 16px; margin-bottom: 16px; }
.howto summary { cursor: pointer; font-weight: 700; }
.howsteps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 8px; padding: 0; list-style: none; counter-reset: s; }
.howsteps li { counter-increment: s; background: var(--panel); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.4; }
.howsteps li b::before { content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: var(--panel); font-size: 12px; }
.howsteps li span { color: var(--muted); }
/* Progress log (atlas-report.js): one compact line per update, grouped by day */
.reports { margin-bottom: 18px; }
.reports .bar { margin-bottom: 6px; }
.log { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 4px 14px 6px; margin-bottom: 8px; }
.lday { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.logline { border-top: 1px solid var(--line); }
.lday + .logline { border-top: 0; }
.logline > summary { display: flex; gap: 10px; align-items: center; padding: 7px 0; cursor: pointer; list-style: none; font-size: 14px; }
.logline > summary::-webkit-details-marker { display: none; }
.logline time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 40px; }
.logline .sum { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logline[open] .sum { white-space: normal; }
.logline.failed .sum { color: var(--danger); font-weight: 700; }
.lchip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--well); white-space: nowrap; }
.lchip.warn { color: var(--danger); }
.logline .by { font-size: 12px; color: var(--faint); white-space: nowrap; }
.lbody { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 12px 50px; font-size: 13px; }
.lsec b { font-size: 12px; color: var(--muted); }
.lsec ul { margin: 2px 0 0; padding-left: 18px; line-height: 1.45; }
.lsec.warn b { color: var(--danger); }
.reports > div > .btn, .reports #logOlder, .reports #logLess { margin-right: 6px; }
.atlasfilters { position: sticky; top: 0; z-index: 2; background: #f1eee8; padding: 10px 0; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
:root[data-theme="dark"] .atlasfilters { background: #141311; }
.atlasfilters .frow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.atlasfilters input[type=search] { flex: 1; min-width: 200px; max-width: 360px; margin-left: auto; }
.atotal, .lib-h { display: flex; align-items: center; gap: 10px; }
.abar { display: inline-flex; width: 160px; height: 8px; border-radius: 999px; background: var(--well); overflow: hidden; }
.abar i { display: block; height: 100%; }
.abar .done { background: #3f9a5e; }
.abar .building { background: #d9a43f; }
.atotal .num, .lib-h .num, .akind .num { font-size: 13px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chipgap { width: 14px; }
/* BLISs Anatomy: Requested for row (label, and a count on each client) */
.chips[hidden] { display: none; }
.chiplabel { font-size: 13px; font-weight: 700; color: #6b2fa3; margin-right: 4px; }
:root[data-theme="dark"] .chiplabel { color: #c9a5ef; }
.chip .ccount { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--well); color: var(--ink); font-size: 12px; font-weight: 700; }
.atlaslist { display: flex; flex-direction: column; gap: 28px; }
.lib-h { margin: 0 0 6px; font-size: 22px; font-weight: 700; flex-wrap: wrap; }
.lib-h > i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); }
.lib-h .abar { margin-left: 8px; }
.akind { margin: 14px 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
/* A card: same look as the library's (library/css/library.css), sized for a laptop */
.acard { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.acard:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.acard:active { transform: scale(.985); }
.acard.tocheck { border: 2px solid var(--accent); }
.acard .lc-pic { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(160deg, #e9e6df, #cfcbc2); overflow: hidden; }
.acard .lc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acard .lc-ph { position: absolute; inset: 0; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 30%, #f6f2ea), color-mix(in srgb, var(--c) 80%, #2b241c)); }
.acard .lc-badges { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.lc-badge { padding: 3px 9px; border-radius: 99px; font-size: 12px; background: var(--panel); color: var(--ink); }
.lc-badge.st-planned { background: #ece7dc; color: #5d574d; }
.lc-badge.st-researching, .lc-badge.st-building { background: #fff1d6; color: #8a5a00; }
.lc-badge.st-research_review, .lc-badge.st-in_review { background: var(--accent); color: var(--accent-ink); }
.lc-badge.st-ready { background: #dff2e6; color: #1f6b3a; }
.acard .lc-asked { font-size: 13px; font-weight: 700; color: #6b2fa3; line-height: 1.3; }
:root[data-theme="dark"] .acard .lc-asked { color: #c9a5ef; }
.acard .lc-asked .due.soon { color: #8a5a00; }
.acard .lc-asked .due.late { color: var(--danger); }
.lc-badge.push { background: #1f6b3a; color: #fff; font-weight: 700; }
.lc-badge.req { background: #6b2fa3; color: #fff; font-weight: 700; }
.atlasbar { margin-bottom: 12px; }
.lc-badge.new { background: #a3261a; color: #fff; font-weight: 700; }
.lc-badge.cm { background: rgba(23, 21, 15, .75); color: #fff; }
.acard .lc-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 8px; flex: 1; }
.acard .lc-kick { font-size: 12px; color: var(--muted); }
.acard .lc-title { font-size: 16px; line-height: 1.2; }
.acard .lc-sum { font-size: 13px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard .lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; font-size: 12px; }
.acard .ac-act { display: flex; gap: 6px; padding: 0 12px 12px; }
.acard .ac-act .btn { flex: 1; justify-content: center; text-decoration: none; display: inline-flex; align-items: center; }
/* Five progress dots: done (green), now (accent), to come (grey) */
.steps5 { display: inline-flex; gap: 4px; }
.steps5 i { width: 18px; height: 5px; border-radius: 3px; background: var(--line); }
.steps5 i.done { background: #3f9a5e; }
.steps5 i.now { background: var(--accent); }
.atlasreport { max-width: 640px !important; display: flex; flex-direction: column; gap: 10px; }
.atlasreport label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.atlasreport textarea { min-height: 70px; }
@media (max-width: 900px) { .howsteps { grid-template-columns: 1fr; } }

/* ---- One BLISs Anatomy item: stage, research pack, builds, comments (atlas-item.js, atlas-pack.js) ---- */
.atlasitem { max-width: 900px !important; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.atlasitem .kick { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.atlasitem h2 { margin: 2px 0 0; }
.atlasitem .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.atlasitem .spacer { flex: 1; }
.atlasitem select { width: auto; padding: 6px 9px; }
.atlasitem textarea { width: 100%; min-height: 70px; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
/* Steps across the top of the item panel, and the "your turn" box */
.ai-steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.ai-steps li { counter-increment: s; flex: 1; padding: 8px 6px 6px; border-top: 5px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; }
.ai-steps li::before { content: counter(s) '. '; }
.ai-steps li.done { border-color: #3f9a5e; color: var(--ink); }
.ai-steps li.now { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.ai-now { padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 2px solid var(--accent); }
.ai-now h3 { margin: 0 0 4px; font-size: 18px; color: var(--accent); }
.ai-now p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.ai-now.quiet { background: var(--well); border: 0; }
.ai-move { font-size: 13px; color: var(--muted); }
.ai-move summary { cursor: pointer; }
.ai-move select { margin: 6px 8px 0 0; }
.aisec { border-top: 1px solid var(--line); padding-top: 10px; }
.aisec h3 { margin: 0 0 8px; font-size: 16px; }
.pack { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; margin-top: 8px; }
.pack .psum { margin: 0; font-size: 15px; }
/* Collapsible parts of the item panel (atlas-item.js, atlas-pack.js) */
.aisec.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.aisec.fold > summary::-webkit-details-marker, .pblock > summary::-webkit-details-marker { display: none; }
.aisec.fold > summary::before, .pblock > summary::before { content: '\25B8'; color: var(--muted); transition: transform var(--dur) var(--ease); }
.aisec.fold[open] > summary::before, .pblock[open] > summary::before { transform: rotate(90deg); }
.aisec.fold > summary h3 { margin: 0; }
.aisec.fold[open] > summary { margin-bottom: 8px; }
.rqlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.rqlist li { padding: 8px 12px; border-radius: 10px; background: var(--well); }
.rqlist p { margin: 4px 0 0; }
.aisub { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pblock { background: var(--well); border-radius: 10px; padding: 8px 12px; }
.pblock > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pblock[open] > summary { margin-bottom: 6px; }
.pblock .pn { font-weight: 400; background: var(--panel); border-radius: 999px; padding: 0 8px; letter-spacing: 0; }
.pack ul { margin: 0; padding-left: 20px; }
.pack p { margin: 2px 0; }
.pack .lic { font-weight: 700; }
.vlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vlist li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: var(--well); }
.vlist .vsum { flex: 1; min-width: 200px; font-size: 14px; }
.cmlist, .cmkids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cmkids { margin-top: 8px; padding-left: 18px; border-left: 3px solid var(--line); }
.cm { padding: 8px 12px; border-radius: 10px; background: var(--well); }
.cmkids .cm { background: var(--panel); }
.cm.done > p, .cm.done > .cmhead { opacity: .6; }
.cmhead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cm p { margin: 4px 0 6px; font-size: 14px; line-height: 1.45; }
.cstate { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #fde3e0; color: #a3261a; }
.cm.question .cstate { background: #fff1d6; color: #8a5a00; }
.cm.done .cstate { background: #dff2e6; color: #1f6b3a; }
.cmpic { max-width: 260px; max-height: 180px; border-radius: 8px; display: block; margin-bottom: 6px; }
.cmform { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cmform label.btn { flex-direction: row; cursor: pointer; }
.ai-now.ready { background: #dff2e6; border-color: #3f9a5e; }
.ai-now.ready h3 { color: #1f6b3a; }
.ai-url { flex: 1; min-width: 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 14px; }
/* Research now / Build now pressed: the instant run is starting on it */
.lc-badge.now { background: var(--accent, #2a3bd1); color: #fff; font-weight: 700; }

/* BLISs Anatomy item: names and descriptions of the parts a build added (atlas-item.js) */
.xlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xlist li { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--well); }
.xlist li.need { box-shadow: inset 0 0 0 2px var(--warn, #c2410c); }
.xlist .xfile { font-size: 13px; color: var(--muted); word-break: break-all; }
.xlist textarea { min-height: 56px; }
.xneed { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #fde8dc; color: #9a3412; }
.warn { color: var(--warn, #c2410c); }
