/* Contracts, client view, document panel, Extraction review. Kit tokens only. */
.ct-view { min-width: 0; }
.ct-view > .wash, .ct-view > .ct-work { margin-bottom: 16px; }
.ct-head { align-items: center; }
.ct-back { margin-bottom: 12px; }
.ct-gap { margin-top: 16px; }
.ct-h2 { margin: 24px 0 8px; }
.ct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ct-id { font-weight: 500; white-space: nowrap; }

/* Filter row: 32px controls left, count and Expand all right */
.ct-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ct-search { position: relative; width: 220px; flex: 0 1 220px; }
.ct-search svg.lucide { position: absolute; left: 10px; top: 8px; color: var(--muted-foreground); pointer-events: none; }
.ct-search .input { padding-left: 32px; }
.ct-select { width: auto; flex: 0 0 auto; }
.ct-tools-end { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; white-space: nowrap; }

/* Contracts table: fixed widths sum to 954 px, inside the ~960 px content width at 1280 */
.ct-table { table-layout: fixed; }
.ct-c-id { width: 124px; } .ct-c-cust { width: 150px; } .ct-c-type { width: 136px; } .ct-c-rate { width: 160px; }
.ct-c-val { width: 130px; } .ct-c-term { width: 104px; } .ct-c-mod { width: 110px; } .ct-c-act { width: 40px; }
.ct-table td.num .cell-sub { white-space: normal; }
.table td.ct-mod { padding-left: 4px; padding-right: 4px; text-align: right; }
.ct-mod .btn { padding: 0 8px; gap: 4px; }
.ct-ell { overflow: hidden; text-overflow: ellipsis; }
.ct-cust-badge { display: block; margin-top: 4px; }
.ct-idline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-chev { display: inline-flex; color: var(--muted-foreground); }
.ct-chev svg.lucide { transform: rotate(-90deg); transition: transform var(--motion-quick) ease-in-out; }
.ct-chev.open svg.lucide { transform: none; }
.table td.act svg.lucide { color: var(--muted-foreground); }

/* Side panel: document */
.ct-doc { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ct-doc section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ct-dl { display: grid; grid-template-columns: 128px minmax(0, 1fr); margin: 0; }
.ct-dl dt, .ct-dl dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ct-dl dt { color: var(--muted-foreground); padding-right: 12px; }
.ct-dl dt:nth-last-of-type(1), .ct-dl dd:last-child { border-bottom: 0; }
.ct-terms { display: flex; flex-direction: column; gap: 2px; }
.ct-term { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: var(--radius-md); background: var(--background); text-align: left; cursor: pointer; }
.ct-term:hover { background: var(--accent); }
.ct-term.on { background: var(--muted-brand); }
.ct-term-l { display: flex; flex-direction: column; min-width: 0; }
.ct-term-r { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ct-term-r .cite { margin: 0; }
.ct-sheet { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ct-sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--muted); }
.ct-clause { padding: 8px 12px; }
.ct-clause p { margin-top: 4px; color: var(--muted-foreground); }
.ct-clause.on { background: var(--background-brand); box-shadow: inset 2px 0 0 var(--primary); }
.ct-clause.on p { color: var(--foreground); }
.ct-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ct-versions li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ct-versions li:last-child { border-bottom: 0; }
.ct-vpill { flex: 0 0 64px; display: inline-flex; align-items: center; justify-content: center; height: 24px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); white-space: nowrap; }
.ct-vpill.on { background: var(--muted-brand); color: var(--primary); box-shadow: none; }
.ct-flag { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; margin-top: 4px; font-family: var(--font-serif); }
.ct-flag .badge { font-family: var(--font-sans); }
.ct-flag .fina-spark { margin-top: 2px; }

/* Dialogs */
.dialog.ct-dialog { width: min(880px, 100%); display: flex; flex-direction: column; gap: 16px; }
.ct-dialog .dialog-foot { margin-top: 0; }
.ct-dlg-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ct-dlg-table { min-width: 760px; }
.ct-dlg-table input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
.ct-file { word-break: break-all; min-width: 200px; }
.ct-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; border: 2px dashed var(--border); border-radius: var(--radius-lg); text-align: center; }
.ct-drop svg.lucide { width: 20px; height: 20px; color: var(--muted-foreground); }
.ct-work { padding: 16px; }

/* Extraction review */
.ex-detail > td { padding: 0; }
.ex-detail:hover td { background: var(--background); }
.ex-detail-in { display: flex; flex-direction: column; gap: 24px; padding: 16px 16px 24px; border-top: 1px solid var(--border); }
.ex-dhead { gap: 8px; }
.ex-sec { display: flex; flex-direction: column; gap: 8px; }
.ex-sub { table-layout: fixed; border: 1px solid var(--border); border-radius: var(--radius-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.ex-sub th { height: 32px; }
.ex-c1 { width: 24%; }
.ex-c3w { width: 32%; }
.ex-valline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ex-c4 { width: 208px; }
.ex-sub .cite { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-month { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ex-month > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.ex-month-none { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ex-extracted { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ex-pair { gap: 12px; }
.ex-full { align-self: flex-start; }
.table .cell-sub.clamp-2 { display: -webkit-box; }

.ct-effects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ct-effects li { display: flex; flex-direction: column; }
.dialog.ct-dialog-sm { width: min(640px, 100%); }
.ct-client { border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; text-align: left; max-width: 100%; font: inherit; font-weight: 500; }
