/* Payfold — Deal checklist prototype (snyx showcase; reconstructed from client work, synthetic data). Vanilla CSS on top of tokens.css.
   Desktop-first at 1440. Every colour, size and gap is a token. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.4;
  color: var(--ink); background: var(--paper-2); min-width: 1200px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.ic { width: 16px; height: 16px; fill: none; vertical-align: -3px; flex: none; }
.ic.caret { width: 10px; height: 6px; margin-left: 4px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }

/* ---------------------------------------------------------------- header */
.topbar {
  height: var(--header-h); display: flex; align-items: center;
  padding: 0 var(--sp-6) 0 calc(var(--gutter) + 100px);
  background: linear-gradient(90deg, var(--navy-900) 0%, var(--primary) 45%, var(--primary-2) 100%);
  color: #fff; position: relative; z-index: 20;
}
.brand { display: flex; flex-direction: column; color: #fff; text-decoration: none !important; margin-right: var(--sp-7); position: relative; top: 1px; }
.brand-mark { height: 33px; display: flex; align-items: baseline; }
.brand-word { color: #fff; font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-left: 3px; }
.brand-sub { font-size: 9px; letter-spacing: .32em; font-weight: 700; line-height: 1; margin-top: -4px; margin-left: 1px; opacity: .95; }
.topnav { display: flex; align-items: stretch; height: 100%; margin-left: auto; position: relative; }
.topnav a, .nav-drop {
  display: flex; align-items: center; padding: 0 var(--sp-3); color: #fff; font-size: var(--fs-lg);
  text-decoration: none !important; position: relative; transition: color .15s;
}
.topnav a:hover, .nav-drop:hover, .user-btn:hover { color: var(--teal); }
.topnav a.is-active { color: var(--teal); }
.topnav a.is-active::after { content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 0; height: 3px; background: var(--teal); }
.user { margin-left: calc(var(--sp-7) + 90px); position: relative; }
.user-btn { display: flex; align-items: center; gap: var(--sp-2); color: #fff; font-size: var(--fs-lg); padding: var(--sp-2) 0; transition: color .15s; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--muted); display: grid; place-items: center; }
.avatar .ic { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- dropdowns */
.dropdown {
  position: absolute; z-index: 30; min-width: 200px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: var(--sp-1) 0;
  animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown button, .dropdown a {
  display: block; width: 100%; text-align: left; padding: 10px var(--sp-4); color: var(--ink);
  font-size: var(--fs-md); border-bottom: 1px solid var(--line-2); text-decoration: none !important;
}
.dropdown button:last-child, .dropdown a:last-child { border-bottom: 0; }
.dropdown button:hover, .dropdown a:hover { background: var(--paper-2); }
.dropdown .danger { color: #e11d1d; }
.dropdown--nav { top: 100%; left: var(--sp-2); color: var(--ink); }
.dropdown--right { left: auto; right: 0; }
.dropdown--item { top: 100%; right: 0; width: 200px; }
.dropdown--doc { top: 100%; right: -6px; width: 214px; }

/* ---------------------------------------------------------------- layout */
.split { display: flex; min-height: calc(100vh - var(--header-h)); align-items: stretch; }
.pane--left { width: var(--left-w); flex: none; background: var(--panel); border-right: 1px solid var(--line); box-shadow: 1px 0 0 #fff; display: flex; flex-direction: column; }
.pane--right { flex: 1; min-width: 0; background: var(--paper-2); position: relative; }

.crumbs {
  height: var(--crumb-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line); font-size: var(--fs-xs); letter-spacing: var(--track); text-transform: uppercase; font-weight: 700;
}
.crumb { color: var(--teal); text-decoration: none !important; }
a.crumb:hover { color: var(--green-ink); }
.crumb.is-current { color: var(--primary); }
.crumb-sep { color: var(--muted); font-weight: 400; }
.crumbs--right { padding-left: 0; background: var(--panel); }
.crumb-close {
  width: var(--crumb-h); height: 100%; display: grid; place-items: center; color: #b7bfcc; border-right: 1px solid var(--line); margin-right: var(--sp-3);
  transition: color .15s, background .15s;
}
.crumb-close:hover { color: var(--ink); background: var(--paper-2); }
.crumb-close .ic { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- left pane */
.pane-head { padding: var(--sp-5) var(--gutter) var(--sp-5); }
.title {
  margin: 0; font-size: var(--fs-2xl); font-weight: 700; color: var(--primary); display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line);
}
.title-text[contenteditable] { outline: none; border-bottom: 2px solid var(--teal); }
.icon-btn { color: var(--muted); padding: var(--sp-1); border-radius: var(--radius); display: inline-grid; place-items: center; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--primary); background: var(--line-2); }

.toolbar { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2); height: 38px; padding: 0 var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink-2); font-size: var(--fs-md);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { border-color: #c5cdd9; box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--paper-2); color: #a6adba; border-color: var(--line-2); cursor: default; box-shadow: none; transform: none; }
.btn.is-active { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.btn.is-active:hover { background: var(--primary); }
.btn--primary { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.btn--primary:hover { background: var(--primary); }
.btn--green { background: var(--green); color: #fff; border-color: var(--green); }
.btn--green:hover { background: var(--green-ink); border-color: var(--green-ink); }
.btn--red { background: var(--red); color: #fff; border-color: var(--red); }
.btn--red:hover { background: #cf4747; border-color: #cf4747; }
.btn--dirty { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn--dirty:hover { background: #39a98b; }
.btn .ic { width: 16px; height: 16px; }
#saveBtn { min-width: 112px; justify-content: center; }

.searchrow { display: flex; align-items: center; gap: var(--sp-4); margin-top: var(--sp-4); }
.search { flex: 1; display: flex; align-items: center; gap: var(--sp-2); height: 40px; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.listtoggles { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink-2); }
.linkish { color: inherit; text-align: left; }
.linkish span { text-decoration: none; }
.linkish:hover span { text-decoration: underline; }

.pane-body { flex: 1; background: var(--paper-2); border-top: 1px solid var(--line); padding: var(--sp-5) var(--gutter) var(--sp-7); }
.pane--left .pane-body { min-height: 600px; }

/* checklist cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--sp-3); box-shadow: var(--shadow-1); overflow: visible; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-4) var(--sp-2); cursor: pointer; }
.card-name { font-size: 15px; font-weight: 500; color: var(--ink); }
.card-name[contenteditable] { outline: none; border-bottom: 2px solid var(--teal); }
.card-chev { color: var(--navy-700); transition: transform .2s; }
.card-chev .ic { width: 18px; height: 18px; }
.card:not(.is-open) .card-chev { transform: rotate(0); }
.card.is-open .card-chev { transform: rotate(180deg); }
.progress { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.pct { width: 36px; font-size: var(--fs-md); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pct.is-full { color: var(--teal); font-weight: 500; }
.bar { display: block; flex: 1; height: 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--bar-from), var(--bar-to)); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.items { display: none; border-top: 1px solid var(--line-2); }
.card.is-open .items { display: block; }
.item { position: relative; display: flex; align-items: center; gap: var(--sp-3); min-height: 38px; padding: 0 var(--sp-2) 0 var(--sp-4); border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.item:hover { background: var(--paper-2); }
.item.is-selected, .item.is-selected:hover { background: var(--navy-700); color: #fff; }
.item.is-hidden { display: none; }
.cb { width: 22px; height: 22px; border: 1px solid #cdd4df; border-radius: var(--radius); background: var(--panel); display: grid; place-items: center; color: #fff; flex: none; transition: background .15s, border-color .15s, transform .1s; }
.cb:hover { border-color: var(--green); }
.cb:active { transform: scale(.9); }
.cb.is-done { background: var(--green); border-color: var(--green); }
.cb .ic { width: 14px; height: 14px; opacity: 0; transition: opacity .12s; }
.cb.is-done .ic { opacity: 1; }
.item-name { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.is-done .item-name { color: var(--green-ink); }
.item.is-selected .item-name { color: #fff; }
.item-name[contenteditable] { outline: none; border-bottom: 2px solid var(--teal); white-space: normal; }
.pill-new { display: inline-block; background: var(--pink); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 10px; line-height: 1.2; letter-spacing: .02em; }
.item-meta { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink-2); }
.item.is-selected .item-meta { color: #fff; }
.badge-count { position: relative; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 3px 3px 3px 0; background: var(--badge); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.badge-count::after { content: ""; position: absolute; left: 0; bottom: -4px; border: 2px solid transparent; border-top-color: var(--badge); border-left-color: var(--badge); }
.item.is-selected .badge-count { background: #fff; color: var(--navy-700); }
.item.is-selected .badge-count::after { border-top-color: #fff; border-left-color: #fff; }
.kebab { width: 24px; height: 28px; display: grid; place-items: center; color: #8a94a6; border-radius: var(--radius); }
.kebab:hover { color: var(--primary); background: var(--line-2); }
.kebab.is-open { color: var(--teal); }
.item.is-selected .kebab { color: #fff; }
.kebab .ic { width: 4px; height: 16px; }
.item-add, .card-create { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); min-height: 42px; color: var(--link); font-size: 13px; cursor: pointer; background: var(--panel); }
.item-add:hover, .card-create:hover { background: var(--paper-2); }
.card-create { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); font-size: var(--fs-md); }
.plus-box { width: 22px; height: 22px; border: 1px solid #b9c7e2; border-radius: var(--radius); background: #eef3fb; display: grid; place-items: center; color: var(--link); flex: none; }
.inline-input { flex: 1; height: 30px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--sp-2); outline: none; background: var(--panel); color: var(--ink); }
.inline-input:focus { border-color: var(--primary); box-shadow: var(--focus); }
.hl { background: #fff3b0; border-radius: 2px; }

/* ---------------------------------------------------------------- right pane common */
.rp-body { padding: var(--sp-5) var(--gutter) var(--sp-7); }
.empty { color: var(--muted); padding: var(--sp-7); text-align: center; }

/* documents grid */
.docgrid { display: grid; grid-template-columns: repeat(auto-fill, 196px); gap: var(--sp-5) 18px; padding: var(--sp-5) 18px; }
.doc { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-2); box-shadow: var(--shadow-1); transition: box-shadow .15s, transform .15s; }
.doc:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.doc.is-menu { z-index: 5; }
.doc-thumb { display: flex; justify-content: center; width: 100%; height: 230px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line-2); cursor: zoom-in; padding-top: 10px; }
.doc-thumb .page { zoom: .36; box-shadow: var(--shadow-1); flex: none; }
.doc.is-tilt .doc-thumb .page { transform: rotate(-6deg); }
.doc-foot { display: flex; align-items: center; gap: var(--sp-2); padding-top: var(--sp-2); min-height: 30px; position: relative; }
.doc-status { width: 20px; height: 20px; border: 1px solid #cdd4df; border-radius: var(--radius); display: grid; place-items: center; color: #fff; background: var(--panel); flex: none; transition: background .15s, border-color .15s; }
.doc-status .ic { width: 13px; height: 13px; }
.doc-status.is-verified { background: var(--green); border-color: var(--green); }
.doc-status.is-rejected { border-color: transparent; color: var(--ink-2); }
.doc-status.is-rejected .ic { width: 18px; height: 18px; }
.doc-status:hover { border-color: var(--green); }
.doc-foot .pill-new { margin-left: auto; }
.doc-foot .kebab { margin-left: auto; }
.doc-foot .pill-new + .kebab { margin-left: 0; }
.doc-name-edit { position: absolute; left: 0; right: 0; top: 0; height: 100%; }

/* drawn documents: a sheet of paper, reused at thumb and full size */
.page { width: 420px; height: 560px; background: #fff; box-shadow: var(--shadow-2); padding: 34px 40px; position: relative; color: #1b1b1b; font-family: Georgia, "Times New Roman", serif; }
.page--text h4 { margin: 0 0 14px; text-align: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.page--text .ln { height: 4px; background: #3a3a3a; margin: 0 0 6px 16px; opacity: .75; border-radius: 2px; }
.page--text .ln.w9 { width: 92%; } .page--text .ln.w8 { width: 84%; } .page--text .ln.w7 { width: 70%; } .page--text .ln.w5 { width: 52%; } .page--text .ln.p { margin-bottom: 14px; }
.page--text .ln.n { margin-left: 0; width: 8px; display: inline-block; vertical-align: top; }
.page--text .sig { position: absolute; right: 40px; bottom: 40px; font-style: italic; font-size: 14px; transform: rotate(-8deg); color: #2a2a2a; }
.page--text .ring { position: absolute; left: 10px; width: 10px; height: 10px; border: 2px solid #444; border-radius: 50%; }
.page.is-blur { filter: blur(1.2px) contrast(.8); }

.page--passport { padding: 28px; font-family: var(--font); }
.pp { overflow: hidden; background: linear-gradient(160deg, #dfe3e6, #c7ccd1); border: 1px solid #b4bac0; border-radius: 10px; padding: 14px; font-family: var(--mono); color: #1f2328; font-size: 9px; line-height: 1.35; }
.pp-visa, .pp-id { background: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 6px, transparent 6px 12px); border-radius: 6px; padding: 10px; }
.pp-head { display: flex; justify-content: space-between; font-weight: 700; letter-spacing: .18em; font-size: 12px; margin-bottom: 6px; }
.pp-row { display: flex; gap: 10px; }
.pp-photo { width: 64px; height: 80px; background: #eceff1; border: 1px solid #9aa3ab; display: grid; place-items: center; flex: none; }
.pp-photo svg { width: 50px; height: 64px; }
.pp-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 3px 8px; }
.pp-fields b { display: block; font-size: 6px; letter-spacing: .05em; color: #5b6570; font-weight: 700; }
.pp-fields span { display: block; font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-mrz { margin-top: 8px; font-size: 9.5px; letter-spacing: .03em; white-space: pre; font-weight: 700; overflow: hidden; }
.pp-divider { text-align: center; letter-spacing: .3em; font-weight: 700; font-size: 11px; margin: 10px 0 6px; }

/* viewer (full + split) */
.viewer-head { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 var(--sp-4) 0 18px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.viewer-tools { display: flex; gap: var(--sp-2); }
.viewer-tools .icon-btn { color: var(--navy-700); }
.viewer-tools .icon-btn.is-on { background: var(--navy-700); color: #fff; }
.viewer-stage { display: flex; justify-content: center; padding: var(--sp-5) 0 var(--sp-6); background: var(--paper-2); }
.viewer-stage--clip { height: 350px; overflow: auto; padding-top: var(--sp-5); align-items: flex-start; }
.viewer-stage.is-grab { cursor: grab; }
.viewer-stage.is-grab:active { cursor: grabbing; }
.viewer-stage .page { zoom: 1.15; flex: none; }
.viewer.is-fullscreen { position: fixed; inset: 0; z-index: 40; background: var(--paper-2); overflow: auto; }
.viewer.is-fullscreen .viewer-stage { padding-top: var(--sp-7); }
.actionbar { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); height: 70px; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 6; }
.actionbar .btn { min-width: 92px; justify-content: center; }
.select { position: relative; width: 290px; }
.select-btn { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-3) 0 var(--sp-4); color: var(--ink); transition: border-color .15s; }
.select-btn:hover { border-color: #c5cdd9; }
.select-btn .ic { width: 10px; height: 6px; color: var(--navy-700); transition: transform .15s; }
.select.is-open .select-btn .ic { transform: rotate(180deg); }
.select.is-open .select-btn { border-color: var(--primary); }
.select .dropdown { left: 0; right: 0; top: 100%; }
.select-btn.has-value { color: var(--red); font-weight: 500; }

/* item forms */
.form { padding: var(--sp-6) 0 var(--sp-7); width: 508px; margin: 0 auto; }
.form--wide { width: 508px; margin: 0 auto; padding-top: var(--sp-5); }
.form-head { display: flex; align-items: center; justify-content: space-between; height: 70px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 calc(50% - 254px); }
.form-head .btn--green { min-width: 92px; justify-content: center; }
.attach { color: var(--link); display: inline-flex; align-items: center; gap: var(--sp-2); }
.attach:hover { text-decoration: underline; cursor: pointer; }
.notebox { position: relative; background: #eefaf3; border: 1px solid #bfe8cf; padding: var(--sp-4) var(--sp-6) var(--sp-4) var(--sp-5); font-size: 13px; line-height: 1.5; margin-bottom: var(--sp-5); color: var(--ink-2); }
.notebox .icon-btn { position: absolute; top: 4px; right: 6px; color: var(--green-ink); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-5); }
.field { display: flex; flex-direction: column; gap: var(--sp-2); font-size: 13px; }
.field label { color: var(--ink-2); }
.input, .textarea { height: 40px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--sp-3); background: var(--panel); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--focus); }
.input::placeholder { color: #9aa3b2; }
.input.is-valid { border-color: var(--green); }
.textarea { height: 84px; padding: var(--sp-2) var(--sp-3); resize: vertical; min-height: 60px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }
.notes { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-top: var(--sp-4); }
.notes-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); cursor: pointer; font-size: var(--fs-md); }
.notes-head .ic { width: 18px; height: 18px; color: var(--navy-700); transition: transform .2s; }
.notes.is-open .notes-head .ic { transform: rotate(180deg); }
.notes-body { display: none; border-top: 1px solid var(--line); padding: var(--sp-3) var(--sp-4); }
.notes.is-open .notes-body { display: block; }
.note { padding: var(--sp-2) 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.note + .note { border-top: 1px solid var(--line-2); }
.note b { color: var(--ink); }
.note.is-new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #fff7d6; } to { background: transparent; } }
.note-actions { display: flex; justify-content: flex-end; margin-top: var(--sp-2); }
.link-add { color: var(--link); font-weight: 700; font-size: 13px; }
.link-add:hover { text-decoration: underline; }
.field--full { grid-column: 1 / -1; }
.field .input + .input { margin-top: var(--sp-2); }
.form-actions { display: flex; gap: var(--sp-3); }
.success { color: var(--green-ink); font-weight: 500; display: inline-flex; align-items: center; gap: var(--sp-2); }

/* checklist picker */
.tabs { display: flex; justify-content: center; gap: var(--sp-4); padding: var(--sp-5) 0 var(--sp-4); }
.tab { height: 38px; padding: 0 var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink-2); transition: background .15s, color .15s; }
.tab:hover { border-color: #c5cdd9; }
.tab.is-active { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.lib { width: 508px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.lib-row { display: flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 46px; box-shadow: var(--shadow-1); transition: transform .15s, opacity .2s; }
.lib-row.is-added { color: #a6adba; }
.lib-row.is-leaving { transform: translateX(-24px); opacity: .4; }
.lib-add { width: 52px; align-self: stretch; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--link); font-size: 8px; font-weight: 700; letter-spacing: .08em; transition: background .15s; }
.lib-add:hover { background: #eef3fb; }
.lib-add .ic { width: 20px; height: 12px; }
.lib-row.is-added .lib-add { color: #b7bfcc; cursor: default; }
.lib-row.is-added .lib-add:hover { background: transparent; }
.lib-row.is-added .lib-add .ic { width: 16px; height: 16px; }
.lib-name { flex: 1; padding: 0 var(--sp-4); font-size: var(--fs-md); }
.lib-name[contenteditable] { outline: none; border-bottom: 2px solid var(--teal); }
.lib-row .icon-btn { margin-right: var(--sp-2); }
.lib-row.is-added .icon-btn { color: #c5cdd9; }
.lib-row--create { box-shadow: none; }
.lib-row--create .plus-box { margin: 0 14px; }
.lib-row--create .lib-name { color: var(--link); cursor: pointer; border-left: 1px solid var(--line); min-height: 44px; display: flex; align-items: center; }

/* summary */
.summary { padding: var(--sp-6) var(--gutter) var(--sp-7); }
.summary-title { text-align: center; font-size: 22px; font-weight: 400; color: var(--ink); margin: 0 0 var(--sp-3); }
.summary-progress { display: flex; align-items: center; gap: var(--sp-4); width: 660px; margin: 0 auto; }
.summary-progress .pct { width: 46px; font-size: 20px; color: var(--ink); }
.summary-progress .bar { height: 12px; }
.tabs--text { gap: var(--sp-6); padding-top: var(--sp-6); }
.tabs--text .tab { border: 0; background: none; height: 36px; padding: 0 2px; color: var(--ink); border-radius: 0; position: relative; }
.tabs--text .tab.is-active { background: none; color: var(--muted); }
.tabs--text .tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #c9d0db; }
.badge-pink { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 8px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; margin-left: var(--sp-1); vertical-align: 2px; padding: 0 4px; }
.timeline { position: relative; width: 680px; margin: var(--sp-6) auto 0; padding-bottom: var(--sp-7); }
.timeline::before { content: ""; position: absolute; left: 50%; top: 40px; bottom: 0; width: 1px; background: #c9d0db; }
.tl-month { text-align: center; color: var(--muted); margin-bottom: var(--sp-3); position: relative; z-index: 1; }
.tl-entry { position: relative; min-height: 100px; display: flex; align-items: flex-start; margin-bottom: var(--sp-4); }
.tl-entry.right { justify-content: flex-end; }
.tl-dot { position: absolute; left: 50%; top: 28px; width: 42px; height: 42px; margin-left: -21px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #6b7a8f; box-shadow: 0 0 0 4px var(--paper-2); z-index: 2; transition: transform .15s; }
.tl-entry:hover .tl-dot { transform: scale(1.08); }
.tl-dot.pink { background: var(--pink); } .tl-dot.green { background: var(--green); }
.tl-dot .ic { width: 18px; height: 18px; }
.tl-card { width: 292px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-1); padding: var(--sp-4); position: relative; }
.tl-entry.left .tl-card { margin-right: 28px; }
.tl-entry.right .tl-card { margin-left: 28px; }
.tl-card::after { content: ""; position: absolute; top: 30px; border: 8px solid transparent; }
.tl-entry.left .tl-card::after { right: -16px; border-left-color: var(--panel); }
.tl-entry.right .tl-card::after { left: -16px; border-right-color: var(--panel); }
.tl-card h5 { margin: 0 0 4px; font-size: 15px; font-weight: 400; }
.tl-card .meta { font-size: 12px; color: var(--muted); margin-bottom: var(--sp-2); }
.tl-card .meta b { color: var(--teal); font-weight: 700; }
.tl-link { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.tl-link.pink { color: var(--pink); }
.tl-link:hover { text-decoration: underline; cursor: pointer; }
.tl-card .full { display: none; margin-top: var(--sp-2); color: var(--ink-2); font-size: 13px; }
.tl-card.is-open .full { display: block; }
.tl-entry.is-new { animation: slidein .35s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* toasts */
.toasts { position: fixed; right: var(--sp-5); bottom: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 50; }
.toast { background: var(--navy-900); color: #fff; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: 13px; animation: pop .15s ease-out; max-width: 360px; }
.toast.is-out { opacity: 0; transition: opacity .3s; }

/* ---------------------------------------------------------------- tool layers (review kit)
   review.js parks its Review/Comments buttons bottom-right; keep our toasts clear of them. */
[data-review-on] .toasts { bottom: 72px; }
