/* Līgumi — the agreements app (agreements.js). Built on the data-app pieces in ws.css (.da-head, .da-tabs, .da-search,
   .da-chip) and the tokens in packages/design. One time axis runs through the list; the sheet shows the facts beside the file. */

/* ── the reading bar: what is not read, what it costs, how far it is ── */
.agr-read { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; border-radius: 18px; background: linear-gradient(135deg, var(--bc-plum-tint), #fff 75%); box-shadow: 0 0 0 1px rgba(74, 29, 87, .1); }
.agr-read-t { flex: 1 1 320px; display: grid; gap: 4px; min-width: 0; }
.agr-read-t b { font-size: 14.5px; font-weight: 600; }
.agr-read-t small { font-size: 12.5px; color: var(--bc-ink-2); }
.agr-read-a { display: flex; flex-wrap: wrap; gap: 8px; }
.agr-read--check { background: linear-gradient(135deg, var(--bc-sage-tint), #fff 75%); box-shadow: 0 0 0 1px rgba(79, 127, 69, .15); }
.agr-read--one { padding: 12px 14px; }
.agr-prog { display: block; height: 6px; border-radius: 3px; background: rgba(74, 29, 87, .1); overflow: hidden; }
.agr-prog i { display: block; height: 100%; background: var(--bc-plum); border-radius: 3px; transition: width .4s; }
@media (prefers-reduced-motion: reduce) { .agr-prog i { transition: none; } }

/* ── key numbers ── */
.agr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) repeat(2, minmax(0, 1.25fr)); gap: 10px; }
.agr-kpi { display: grid; align-content: start; gap: 4px; min-height: 84px; padding: 13px 15px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .85); text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 0 0 1px rgba(31, 16, 38, .05); }
.agr-kpi:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 14px 30px -22px rgba(74, 29, 87, .5); }
.agr-kpi.on { background: #fff; box-shadow: 0 0 0 2px var(--c), 0 14px 30px -22px rgba(74, 29, 87, .5); }
.agr-kpi span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--bc-ink-2); }
.agr-kpi span i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.agr-kpi b { font: 700 24px/1.1 var(--bc-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.agr-kpi:nth-child(n+5) b { color: color-mix(in srgb, var(--c) 85%, #000); }

/* ── what needs a person ── */
.agr-needs { display: flex; flex-wrap: wrap; gap: 8px; }
.agr-need { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .09); font: 600 13px/1.2 var(--bc-text); color: var(--bc-ink); cursor: pointer; }
.agr-need b { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: #f1edf6; font: 700 12.5px/1 var(--bc-text); color: var(--bc-ink-2); }
.agr-need--ended_still_used b, .agr-need--notice_by b, .agr-need--decide b { background: #fdecd3; color: #9a4b00; }
.agr-need--no_income b, .agr-need--not_ours b { background: #fbe1e6; color: #a3223b; }
.agr-need:hover { box-shadow: inset 0 0 0 1.5px var(--bc-plum); }
.agr-need.on { background: var(--bc-ink); color: #fff; box-shadow: none; }

.agr-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.agr-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.agr-kind { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--c) 10%, #fff); font: 600 12.5px/1.2 var(--bc-text); color: color-mix(in srgb, var(--c) 75%, #000); cursor: pointer; }
.agr-kind i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.agr-kind small { font-weight: 500; opacity: .7; }
.agr-kind.on { box-shadow: inset 0 0 0 1.5px var(--c); background: color-mix(in srgb, var(--c) 16%, #fff); }

/* ── the list: one row per agreement, one time axis for all ── */
.agr-list { display: grid; gap: 4px; }
.agr-row { --cols: 6px minmax(0, 1.7fr) 176px minmax(150px, 1.25fr) 176px; display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; width: 100%; min-height: 58px; padding: 9px 14px 9px 0; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .82); text-align: left; font: inherit; color: inherit; cursor: pointer; overflow: hidden; }
.agr-row:hover { background: #fff; box-shadow: 0 0 0 1px rgba(123, 92, 214, .25); }
.agr-row:focus-visible { outline: 2.5px solid var(--bc-focus); outline-offset: 2px; }
.agr-row.aside { opacity: .72; }
.agr-row.on { background: #fff; box-shadow: 0 0 0 2px var(--bc-plum); }
.agr-row.sk { min-height: 58px; background: linear-gradient(90deg, rgba(255,255,255,.5), rgba(255,255,255,.95), rgba(255,255,255,.5)); background-size: 200% 100%; animation: da-sk 1.2s linear infinite; cursor: default; }
.agr-row--axis { position: sticky; top: 0; z-index: 2; min-height: 30px; padding-top: 4px; padding-bottom: 4px; background: rgba(246, 245, 248, .92); backdrop-filter: blur(6px); cursor: default; box-shadow: none !important; }
.agr-kb { align-self: stretch; width: 6px; border-radius: 0 4px 4px 0; background: var(--k); }
.agr-main { min-width: 0; }
.agr-main b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-main small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--bc-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-nx { font-style: normal; font-weight: 600; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #f1edf6; color: var(--bc-ink-2); }
.agr-nx--ended_still_used, .agr-nx--notice_by, .agr-nx--decide { background: #fdecd3; color: #9a4b00; }
.agr-nx--no_income, .agr-nx--not_ours { background: #fbe1e6; color: #a3223b; }
.agr-row.prop .agr-main b::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--bc-focus); vertical-align: middle; }
.agr-mid { display: grid; justify-items: start; gap: 3px; }
.agr-flow { font-size: 12px; font-weight: 600; color: var(--bc-ink-2); white-space: nowrap; }
.agr-flow--in { color: #2f6b3a; } .agr-flow--out { color: #a3223b; } .agr-flow--both { color: #5b3fb3; }
.agr-val { display: inline-flex; align-items: baseline; gap: 2px; font: 700 14.5px/1.2 var(--bc-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agr-val small { font: 500 11.5px var(--bc-text); color: var(--bc-ink-3); }
.agr-val i { display: inline-flex; margin-left: 4px; color: var(--bc-ink-3); } .agr-val .bc-icon { width: 13px; height: 13px; }
.agr-val--in { color: #2f6b3a; } .agr-val--out { color: #8f1f35; } .agr-val--none { color: var(--bc-ink-3); font-weight: 500; }
.agr-end { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
/* a row's own actions: shown on hover or keyboard focus, always on touch */
.agr-row { position: relative; }
.agr-acts { position: absolute; top: 6px; right: 8px; z-index: 1; display: inline-flex; gap: 2px; padding: 2px; border-radius: 12px; background: #fff; box-shadow: 0 6px 18px -8px rgba(31, 16, 38, .35), 0 0 0 1px rgba(31, 16, 38, .06); opacity: 0; pointer-events: none; transition: opacity .12s; }
.agr-row:hover .agr-acts, .agr-row:focus-within .agr-acts { opacity: 1; pointer-events: auto; }
@media (hover: none) { .agr-acts { position: static; opacity: 1; pointer-events: auto; box-shadow: none; background: none; } }
.agr-ab { display: inline-flex; align-items: center; gap: 6px; padding: 6px; border: 0; border-radius: 9px; background: none; color: var(--bc-ink-2); font: 600 12.5px/1.2 var(--bc-text); cursor: pointer; }
.agr-ab:hover, .agr-ab:focus-visible { background: rgba(74, 29, 87, .08); color: var(--bc-plum); }
.agr-ab .bc-icon { width: 16px; height: 16px; }
.agr-sg { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--bc-ink-3); white-space: nowrap; }
.agr-sg .bc-icon { width: 12px; height: 12px; }
.agr-sg--electronic { color: #2f6b3a; } .agr-sg--unsigned_copy, .agr-sg--unclear { color: #9a4b00; }
.agr-st { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 13%, #fff); font: 600 12px/1.2 var(--bc-text); color: color-mix(in srgb, var(--c) 70%, #000); white-space: nowrap; }
.agr-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.agr-gh { display: flex; align-items: center; gap: 8px; margin: 14px 4px 4px; font: 700 13px/1 var(--bc-text); color: var(--bc-ink-2); letter-spacing: 0; }
.agr-gh i { width: 9px; height: 9px; border-radius: 50%; }
.agr-gh small { font-weight: 500; color: var(--bc-ink-3); }

/* the track: a line of years, today as a plum line, the agreement as a bar, the notice window hatched */
.agr-track { position: relative; display: block; height: 24px; border-radius: 6px;
  background: linear-gradient(to right, transparent calc(var(--now) - 1px), rgba(74, 29, 87, .55) calc(var(--now) - 1px), rgba(74, 29, 87, .55) calc(var(--now) + 1px), transparent calc(var(--now) + 1px)),
    linear-gradient(rgba(31, 16, 38, .06), rgba(31, 16, 38, .06)) center / 100% 2px no-repeat; }
.agr-bar { position: absolute; top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; background: var(--c); }
.agr-bar.fin { border-radius: 0 5px 5px 0; background: linear-gradient(to right, transparent, var(--c) 40%); }
.agr-bar.fout { border-radius: 5px 0 0 5px; background: linear-gradient(to right, var(--c) 55%, transparent); }
.agr-bar.dash { background: repeating-linear-gradient(90deg, var(--c) 0 7px, transparent 7px 11px); }
.agr-notice { position: absolute; top: 50%; height: 16px; margin-top: -8px; background: repeating-linear-gradient(135deg, rgba(217, 119, 6, .55) 0 3px, rgba(217, 119, 6, .12) 3px 6px); border-radius: 3px; }
.agr-dlm { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg); background: #d97706; box-shadow: 0 0 0 2px #fff; }
.agr-nod { position: absolute; left: 0; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11.5px; color: var(--bc-ink-3); background: rgba(255, 255, 255, .9); padding: 0 6px; border-radius: 4px; }
.agr-axis { position: relative; height: 20px; }
.agr-axis span { position: absolute; top: 3px; font-size: 11px; font-weight: 600; color: var(--bc-ink-3); padding-left: 4px; border-left: 1px solid rgba(31, 16, 38, .15); line-height: 14px; }
.agr-today { position: absolute; top: 0; transform: translateX(-50%); padding: 2px 7px; border-radius: 999px; background: var(--bc-plum); color: #fff; font: 700 10.5px/1.2 var(--bc-text); white-space: nowrap; z-index: 1; }

/* ── the sheet: the facts beside the file ── */
.agr-layer { position: fixed; z-index: 70; overflow: hidden; }
.agr-sheet { position: absolute; inset: 0; display: grid; padding: 12px; background: rgba(31, 16, 38, .3); backdrop-filter: blur(2px); animation: agr-in .18s ease-out; }
@keyframes agr-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .agr-sheet { animation: none; } }
.agr-sh-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); width: 100%; max-width: 1380px; height: 100%; min-height: 0; margin: 0 auto; border-radius: 24px; background: #fff; overflow: hidden; box-shadow: var(--bc-float); }
.agr-sh-in--one { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 0 0 auto; }
.agr-sh-l { overflow-y: auto; padding: 22px 28px 28px; display: grid; align-content: start; gap: 16px; }
.agr-sh-r { background: var(--bc-canvas); border-left: 1px solid var(--bc-line); min-height: 0; display: flex; }
.agr-sh-h { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-right: 44px; }
.agr-sh-h h2 { flex-basis: 100%; margin-top: 6px; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.12; }
.agr-sh-sub { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--bc-ink-3); }
.agr-sh-acts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.agr-sh-acts .agr-ab { box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .1); padding: 6px 10px; border-radius: 999px; }
.agr-sh-who { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.agr-x { position: absolute; top: -4px; right: -8px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(31, 16, 38, .05); color: var(--bc-ink-2); cursor: pointer; }
.agr-x:hover { background: rgba(31, 16, 38, .1); }
.agr-x .bc-icon { width: 20px; height: 20px; }
.agr-pc { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 12px 4px 4px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .12); font: 600 13px/1.2 var(--bc-text); color: var(--bc-ink); cursor: pointer; }
.agr-pc i, .agr-av { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: #ece6f7; color: var(--bc-plum); font: 700 10.5px/1 var(--bc-text); font-style: normal; }
.agr-av.p { background: #e0f0e6; color: #2f6b3a; }
.agr-av.big { width: 52px; height: 52px; font-size: 17px; flex-basis: 52px; }
.agr-pc:hover { box-shadow: inset 0 0 0 1.5px var(--bc-plum); }
.agr-sec { display: grid; gap: 8px; }
.agr-sec h4 { font: 700 13.5px/1.2 var(--bc-text); color: var(--bc-ink-2); letter-spacing: 0; }
.agr-sec h4 small { font-weight: 500; color: var(--bc-ink-3); }
.agr-sum { font-size: 15.5px; line-height: 1.55; }
.agr-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; color: var(--bc-ink-2); }
.agr-note .bc-icon { width: 16px; height: 16px; margin-top: 1px; color: var(--bc-ink-3); }
.agr-note--warn { padding: 10px 12px; border-radius: 12px; background: #fdf1e3; color: #7a3d00; }
.agr-note--lead { padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(31, 16, 38, .06); font-size: 14px; color: var(--bc-ink); }
.agr-rd { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #f7f4fb; font-size: 13px; color: var(--bc-ink-2); }
.agr-rd.applied { background: var(--bc-sage-tint); }
.agr-rd p { margin: 0; }
.agr-rd-w { color: #5b3fb3; font-weight: 600; }
.agr-rd-ok { display: flex; align-items: center; gap: 6px; color: #2f6b3a; font-weight: 600; }
.agr-rd-ok .bc-icon, .agr-rd-a .bc-icon { width: 16px; height: 16px; }
.agr-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--bc-plum); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.agr-gg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agr-gg div { padding: 12px 14px; border-radius: 14px; background: #faf8fc; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .05); }
.agr-gg small { font-size: 12px; font-weight: 600; color: var(--bc-ink-3); }
.agr-gg p { margin: 3px 0 0; font-size: 14px; line-height: 1.4; }
.agr-when { padding: 6px 0 0; }
.agr-track.big { height: 34px; margin-top: 4px; background-size: auto, 100% 2px; }
.agr-track.big .agr-bar { height: 14px; margin-top: -7px; border-radius: 7px; }
.agr-tick { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--bc-ink-2); }
.agr-tick--signed { width: 8px; height: 8px; margin: -4px 0 0 -4px; box-shadow: inset 0 0 0 2px var(--bc-ink-3); }
.agr-tick--ends { box-shadow: inset 0 0 0 3px var(--bc-ink); }
.agr-dl-list, .agr-dl { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0 0; }
.agr-dl div { display: grid; gap: 1px; }
.agr-dl dt { font-size: 11.5px; font-weight: 600; color: var(--bc-ink-3); }
.agr-dl dd { margin: 0; font-size: 14px; font-weight: 600; }
.agr-dl .hot dd { color: #9a4b00; }
.agr-q { display: inline-grid; place-items: center; min-width: 18px; height: 16px; margin-left: 3px; padding: 0 3px; border-radius: 5px; font: 700 11px/1 var(--bc-display); vertical-align: 1px; cursor: pointer; }
.agr-q.ok { background: var(--bc-sage-tint); color: #2f6b3a; }
.agr-q.no { background: #fdecd3; color: #9a4b00; }
.agr-q.rec { background: #f1edf6; color: var(--bc-ink-3); cursor: help; }
.agr-money { display: grid; gap: 8px; }
.agr-est { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 14px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, #e6f2ea, #fff 80%); box-shadow: inset 0 0 0 1px rgba(47, 107, 58, .15); }
.agr-est--out { background: linear-gradient(135deg, #fbe7eb, #fff 80%); box-shadow: inset 0 0 0 1px rgba(143, 31, 53, .12); }
.agr-est small { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--bc-ink-2); }
.agr-est.was { filter: saturate(.25); opacity: .85; }
.agr-est b { font: 700 26px/1.1 var(--bc-display); font-variant-numeric: tabular-nums; color: #2f6b3a; }
.agr-est--out b { color: #8f1f35; }
.agr-est span { font-size: 12px; color: var(--bc-ink-3); line-height: 1.35; }
.agr-ml { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.agr-ml li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 8px 10px; border-radius: 10px; background: #faf8fc; font-size: 13.5px; }
.agr-ml li span { color: var(--bc-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-ml li b { font-variant-numeric: tabular-nums; text-align: right; }
.agr-ml li em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--bc-ink-3); }
.agr-ml li .agr-q { position: relative; grid-column: 2; justify-self: end; }
.agr-duties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.agr-dcol { padding: 12px 14px; border-radius: 14px; background: #faf8fc; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .05); }
.agr-dcol--us { background: #f4f0fb; }
.agr-dcol h5 { margin: 0 0 6px; font: 700 13px/1 var(--bc-text); color: var(--bc-plum); }
.agr-dcol--them h5 { color: var(--bc-ink-2); }
.agr-dcol ul, .agr-pen, .agr-parties, .agr-files, .agr-pagr { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.agr-dcol li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 13.5px; line-height: 1.4; }
.agr-dcol li .bc-icon { width: 15px; height: 15px; margin-top: 2px; color: var(--bc-ink-3); }
.agr-dcol li small { color: var(--bc-ink-3); }
.agr-pen li { padding: 8px 10px; border-radius: 10px; background: #fdf6ee; font-size: 13.5px; }
.agr-parties li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 9px 12px; border-radius: 12px; background: #faf8fc; }
.agr-parties li.us { background: #f4f0fb; }
.agr-parties b { font-size: 14px; } .agr-parties small { grid-column: 1; font-size: 12px; color: var(--bc-ink-3); }
.agr-parties em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 12px; font-weight: 600; color: var(--bc-plum); }
.agr-files li { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #faf8fc; }
.agr-files li.on { background: #fff; box-shadow: inset 0 0 0 2px var(--bc-plum); }
.agr-file-i { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; }
.agr-file-i span { display: grid; gap: 2px; min-width: 0; }
.agr-files .agr-file-i .bc-icon { width: 18px; height: 18px; color: var(--bc-ink-3); margin-top: 1px; }
.agr-files b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-files small { font-size: 12px; color: var(--bc-ink-3); }
.agr-file-a { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 28px; }
.agr-file-a button, .agr-file-a a, .agr-vb { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .12);
  font: 600 12.5px/1.2 var(--bc-text); color: var(--bc-plum); text-decoration: none; cursor: pointer; white-space: nowrap; }
.agr-file-a button:hover, .agr-file-a a:hover, .agr-vb:hover { box-shadow: inset 0 0 0 1.5px var(--bc-plum); }
.agr-file-a .bc-icon, .agr-vb .bc-icon { width: 15px; height: 15px; }
.agr-foot { margin: 0; font-size: 13px; }

/* setting aside, signing */
.agr-pick { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #fdf1e3; }
.agr-pick p { margin: 0; font-size: 13px; color: #7a3d00; }
.agr-note .bc-icon { flex: none; }
.agr-sign { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #faf8fc; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .05); }
.agr-sign--electronic { background: #eef5ea; box-shadow: inset 0 0 0 1px rgba(47, 107, 58, .15); }
.agr-sign--unsigned_copy, .agr-sign--unclear { background: #fdf6ee; }
.agr-sign-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.agr-sign-h .bc-icon { width: 18px; height: 18px; color: var(--bc-ink-2); flex: none; }
.agr-sigs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.agr-sigs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .8); }
.agr-sigs span { display: grid; min-width: 0; } .agr-sigs b { font-size: 13.5px; } .agr-sigs small { font-size: 12px; color: var(--bc-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-sigs em { font-style: normal; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--bc-ink-2); } .agr-sigs em.v-ok { color: #2f6b3a; } .agr-sigs em.v-invalid, .agr-sigs em.v-drift { color: #a3223b; }

/* the procedures behind the app */
.agr-procs { display: grid; gap: 12px; margin-top: 8px; padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px rgba(31, 16, 38, .05); }
.agr-procs-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.agr-procs-h h3 { font-size: 18px; } .agr-procs-h p { margin: 4px 0 0; font-size: 13px; color: var(--bc-ink-2); max-width: 60ch; }
.agr-procs-l { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.agr-proc { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .08); color: inherit; text-decoration: none; }
.agr-proc:hover { box-shadow: inset 0 0 0 1.5px var(--bc-plum); }
.agr-proc img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.agr-proc span { display: grid; gap: 2px; min-width: 0; grid-column: 1 / -1; } .agr-proc img + span { grid-column: auto; }
.agr-proc b { font-size: 14px; } .agr-proc small { font-size: 12px; color: var(--bc-ink-3); }
.agr-proc em { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: 12px; font-weight: 600; color: #2f6b3a; } .agr-proc em .bc-icon { width: 13px; height: 13px; }
.agr-toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 12px); padding: 10px 16px; border-radius: 12px; background: var(--bc-ink); color: #fff; font: 600 13.5px var(--bc-text); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.agr-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .agr-toast { transition: none; } .agr-acts { transition: none; } }

/* the file itself */
.agr-vw { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.agr-vw--empty { align-items: center; justify-content: center; gap: 8px; color: var(--bc-ink-3); font-size: 14px; }
.agr-vw--empty .bc-icon { width: 34px; height: 34px; }
.agr-vw-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bc-line); background: #fff; }
.agr-vw-h b { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-vw-h { flex-wrap: wrap; row-gap: 8px; }
.agr-vw-h b { flex: 1 1 160px; }
.agr-vw-c { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--bc-line); background: var(--bc-sage-tint); font-size: 12.5px; color: #2f5a2a; }
.agr-vw-c .bc-icon { width: 15px; height: 15px; flex: none; }
.agr-vw-c button { margin: 0 4px 0 0; padding: 2px 8px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .7); font: 600 12px var(--bc-text); cursor: pointer; }
.agr-vw-c button.on { background: #fff; box-shadow: inset 0 0 0 1.5px #4f7f45; }
.agr-word { background: #e9e5ef; }
.agr-pdf { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
.agr-img { flex: 1; min-height: 0; object-fit: contain; margin: 12px auto; max-width: calc(100% - 24px); }
.agr-vw-l { padding: 20px; color: var(--bc-ink-3); font-size: 14px; }
.agr-text { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 22px 26px 40px; background: #fff; font: 400 13.5px/1.65 var(--bc-text); white-space: pre-wrap; overflow-wrap: anywhere; color: #2d2233; }
.agr-text mark { background: #e8f0e4; color: inherit; border-radius: 3px; box-shadow: 0 0 0 2px #e8f0e4; }
.agr-text mark.hot { background: #ffe3a3; box-shadow: 0 0 0 3px #ffe3a3; }
.agr-pg { display: block; margin: 14px 0 6px; text-align: center; color: var(--bc-ink-3); font-size: 11.5px; letter-spacing: .08em; }

/* ── the parties ── */
.agr-plist { display: grid; gap: 4px; }
.agr-prow { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 150px; gap: 12px; align-items: center; width: 100%; padding: 10px 14px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .82); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.agr-prow:hover { background: #fff; box-shadow: 0 0 0 1px rgba(123, 92, 214, .25); }
.agr-prow.on { background: #fff; box-shadow: 0 0 0 2px var(--bc-plum); }
.agr-prow .agr-av { width: 30px; height: 30px; font-size: 11px; }
.agr-pa { display: flex; gap: 6px; }
.agr-pa em { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #f1edf6; font: 600 12px/1.2 var(--bc-text); font-style: normal; color: var(--bc-ink-2); }
.agr-pa em.no { background: #fdecd3; color: #9a4b00; }
.agr-pa .bc-icon { width: 13px; height: 13px; }
.agr-pm { display: grid; justify-items: end; gap: 2px; font: 700 14px/1.2 var(--bc-display); font-variant-numeric: tabular-nums; }
.agr-pm .in { color: #2f6b3a; } .agr-pm .out { color: #8f1f35; } .agr-pm .z { color: var(--bc-ink-3); font-weight: 500; }
.agr-pstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.agr-ps { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: #faf8fc; box-shadow: inset 0 0 0 1px rgba(31, 16, 38, .05); }
.agr-ps small { font-size: 12px; font-weight: 600; color: var(--bc-ink-2); }
.agr-ps b { font: 700 24px/1.1 var(--bc-display); font-variant-numeric: tabular-nums; }
.agr-ps span { font-size: 12px; color: var(--bc-ink-3); }
.agr-pagr button { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; width: 100%; padding: 9px 12px 9px 0; border: 0; border-radius: 12px; background: #faf8fc; text-align: left; font: inherit; cursor: pointer; overflow: hidden; }
.agr-pagr button:hover { box-shadow: inset 0 0 0 1px rgba(123, 92, 214, .3); }
.agr-pagr b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-pact { display: flex; flex-wrap: wrap; gap: 8px; }
.agr-pact .bc-icon { width: 16px; height: 16px; }

/* ── narrower: the list answers to its own width (the app rail takes a third of the screen), the sheet to the screen ── */
.agr { container: agr / inline-size; }
@container agr (max-width: 1180px) {
  .agr-row { --cols: 6px minmax(0, 1.6fr) 150px minmax(120px, 1fr) 150px; gap: 10px; }
  .agr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container agr (max-width: 940px) {
  .agr-row { --cols: 6px minmax(0, 1fr) 196px; grid-template-areas: 'k m e' 'k t v'; row-gap: 5px; }
  .agr-row > .agr-kb { grid-area: k; } .agr-row > .agr-main { grid-area: m; } .agr-row > .agr-end { grid-area: e; } .agr-row > .agr-track { grid-area: t; }
  .agr-row > .agr-mid { grid-area: v; display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; }
  .agr-row--axis { grid-template-areas: 'k t v'; } .agr-row--axis > span:not(.agr-kb) { display: none; } .agr-row--axis > .agr-axis { grid-area: t; }
  .agr-prow { grid-template-columns: 30px minmax(0, 1fr) auto; } .agr-prow .agr-pa { grid-column: 2; grid-row: 2; }
}
@container agr (max-width: 560px) {
  .agr-row { --cols: 6px minmax(0, 1fr) auto; grid-template-areas: 'k m e' 'k t t' 'k v v'; }
  .agr-row--axis { grid-template-areas: 'k t t'; }
  .agr-row > .agr-mid { justify-content: flex-start; }
  .agr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agr-kpi { min-height: 72px; } .agr-kpi b { font-size: 20px; }
  .agr-st { font-size: 11.5px; padding: 3px 8px; }
  .agr-main b { white-space: normal; }
  .agr-row .agr-end { align-self: start; }
  .agr-axis span:nth-child(even) { display: none; }
}
.agr-sheet { container: agrsh / inline-size; }
@container agrsh (max-width: 760px) {
  .agr-sh-in { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .agr-sh-l { overflow: visible; }
  .agr-sh-r { min-height: 72vh; border-left: 0; border-top: 1px solid var(--bc-line); }
}
@container agrsh (max-width: 560px) {
  .agr-gg, .agr-money { grid-template-columns: minmax(0, 1fr); }
  .agr-sh-l { padding: 18px 16px 24px; }
}
@media (max-width: 640px) {
  .agr-sheet { padding: 0; }
  .agr-sh-in { border-radius: 0; }
}
