/* Agreements, to-dos and the "Your to-do list" strip above the calendar. */
.tk-dialog { border: 0; border-radius: 14px; padding: 0; width: min(720px, calc(100vw - 32px)); max-height: 88vh; background: var(--bg); color: var(--fg); }
.tk-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.tk-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: 88vh; }
.tk-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.tk-panel > header h2 { margin: 0; font-size: 20px; }
.tk-body { overflow-y: auto; padding: 16px 18px; display: grid; gap: 14px; align-content: start; }
.tk-status { margin: 0; padding: 0 18px 14px; font-size: 13px; color: var(--muted); }
.tk-status:empty { display: none; }
.tk-status.err { color: #b42318; }
.tk-body h3 { margin: 4px 0 0; font-size: 15px; }
.tk-callout { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 16%, transparent); font-weight: 600; }
.tk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-list li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.tk-list li > div { display: grid; gap: 3px; flex: 1; }
.tk-list li p { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; }
.tk-list small, .tk-card summary small { color: var(--muted); font-size: 12px; }
.tk-list li.is-done strong { text-decoration: line-through; opacity: .6; }
.tk-list li.is-late small { color: #b42318; }
.tk-check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--gold-ink); background: transparent; color: var(--gold-ink); font: 700 14px var(--body); cursor: pointer; }
.tk-check[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold, #000); }
.tk-admin { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.tk-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tk-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tk-card summary { cursor: pointer; display: grid; gap: 2px; }
.tk-card p { margin: 8px 0; font-size: 14px; }
.tk-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.tk-table th, .tk-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tk-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tk-paper { white-space: normal; line-height: 1.55; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, transparent); max-height: 45vh; overflow-y: auto; font-size: 14px; }
.tk-form { display: grid; gap: 12px; }
.tk-form .field { display: grid; gap: 6px; font-size: 14px; }
.tk-form input:not([type=checkbox]), .tk-form textarea, .tk-form select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: 14px var(--body); min-height: 44px; }
.tk-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.tk-pad canvas { display: block; width: 100%; height: 150px; background: #fff; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; }
.tk-agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.tk-people { display: grid; gap: 8px; }
.tk-people-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; }
.tk-people-list label { display: flex; gap: 8px; align-items: center; min-height: 36px; font-size: 14px; }
.tk-people-list label[hidden] { display: none; }
.tk-people-list small { color: var(--muted); }
.tk-strip { display: grid; gap: 8px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; }
.tk-strip[hidden] { display: none; }
.tk-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-chip { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: transparent; color: var(--fg); font: 600 13px var(--body); cursor: pointer; min-height: 44px; }
.tk-chip small { font-weight: 400; color: var(--muted); }
.tk-chip-sign { border-color: var(--gold-ink); }
.tk-chip.tk-late small { color: #b42318; }
@media (max-width: 640px) { .tk-table th:nth-child(3), .tk-table td:nth-child(3) { display: block; } .tk-actions { justify-content: flex-start; } }
.tk-track { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.tk-track input { width: 18px; height: 18px; accent-color: var(--gold); }
.tk-session { margin: 10px 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, inherit); }
/* Phones: the agreement reads as one page (no small inner scroll box), full-screen sheet, date fields stay in bounds. */
.tk-body { display: block; }
.tk-body > * + * { margin-top: 14px; }
.tk-paper { flex: none; min-height: 0; }
.tk-form input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; box-sizing: border-box; text-align: left; }
.tk-form input, .tk-form textarea, .tk-form select { box-sizing: border-box; max-width: 100%; }
@media (max-width: 640px) {
  .tk-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .tk-panel { height: 100dvh; max-height: 100dvh; }
  .tk-panel > header { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .tk-panel > header h2 { font-size: 17px; line-height: 1.3; }
  .tk-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .tk-paper { max-height: none; overflow: visible; font-size: 15px; }
}
/* Agreements: who has signed, who hasn't, and nudges */
.tk-overview { margin: 4px 0 10px; font-size: 14px; }
.tk-card.has-waiting { border-left: 3px solid var(--gold); }
.tk-card summary small .tk-wait { color: var(--gold-ink); }
.tk-bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; }
.tk-bar i { display: block; height: 100%; background: #2e9d62; }
.tk-group { margin-top: 12px; }
.tk-group h4 { margin: 0; font: 700 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tk-group > h4 { margin-bottom: 6px; }
.tk-signers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.tk-signer { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface); }
.tk-signer > div:first-child { display: grid; min-width: 0; flex: 1 1 200px; }
.tk-signer small { color: var(--muted); font-size: 12px; }
.tk-signer.is-pending { border-left: 3px solid var(--gold); }
.tk-signer .tk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-withdrawn { margin-top: 10px; font-size: 14px; }
.tk-withdrawn summary { cursor: pointer; color: var(--muted); }
.tk-card > .tk-row:last-of-type { margin-top: 12px; justify-content: flex-start; gap: 8px; }
/* Agreements: one card per document — what it is, who signed, who hasn't */
.ag-doc { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 12px; display: grid; gap: 10px; }
.ag-doc.has-waiting { border-left: 4px solid var(--gold); }
.ag-eyebrow { margin: 0; font: 700 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ag-title { margin: 0; font-size: 20px; line-height: 1.25; }
.ag-sub { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.ag-meta { margin: 0; font-size: 13px; color: var(--muted); }
.ag-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-ink); text-decoration: underline; cursor: pointer; }
.ag-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ag-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.ag-stats b { font-size: 24px; line-height: 1; }
.ag-stats span { font-size: 13px; color: var(--muted); }
.ag-stats .ok b { color: #2e9d62; }
.ag-stats .wait b { color: var(--gold-ink); }
.ag-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.ag-col { border-radius: 10px; background: var(--surface); padding: 10px 12px; }
.ag-col.wait { border-top: 3px solid var(--gold); }
.ag-col.ok { border-top: 3px solid #2e9d62; }
.ag-col-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.ag-col-head h4 { margin: 0; font-size: 14px; }
.ag-people { list-style: none; margin: 0; padding: 0; display: grid; }
.ag-people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.ag-people li:first-child { border-top: 0; }
.ag-people li > div:first-child { display: grid; min-width: 0; }
.ag-people small { color: var(--muted); font-size: 12px; }
.ag-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ag-more { position: relative; }
.ag-more summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; background: var(--bg); }
.ag-more summary::-webkit-details-marker { display: none; }
.ag-more[open] > div { position: absolute; right: 0; top: 110%; z-index: 5; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; gap: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12); white-space: nowrap; }
.ag-none { margin: 4px 0; color: var(--muted); font-size: 14px; }
.ag-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ag-note { font-size: 13px; color: var(--muted); flex: 1 1 100%; }
.ag-manage { flex: 1 1 100%; font-size: 14px; }
.ag-manage summary { cursor: pointer; color: var(--muted); }
.ag-copy { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
.ag-copy small { color: var(--muted); }
@media (max-width: 520px) { .ag-stats b { font-size: 20px; } }
/* Documents page */
.dc { padding: 4px 16px 28px; display: grid; gap: 18px; }
.dc-head h2 { margin: 4px 0 4px; font-size: 28px; letter-spacing: -.02em; }
.dc-head .hint { margin: 0; max-width: 640px; }
.dc .status:empty { display: none; }
.dc-sec { display: grid; gap: 10px; }
.dc-sec h3, .dc-yours { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.dc-yours { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.dc-n { font: 700 12px/1 var(--body); padding: 4px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.dc-n.due { background: var(--gold); color: var(--on-gold, #111); }
.dc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dc-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.dc-item.is-pending { border-left: 4px solid var(--gold); }
.dc-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface); }
.dc-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--gold-ink); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.dc-item.is-signed .dc-ico svg, .dc-item.is-signed_elsewhere .dc-ico svg { stroke: #2e9d62; }
.dc-what { display: grid; gap: 3px; min-width: 0; }
.dc-what strong { font-size: 16px; line-height: 1.3; }
.dc-what small { color: var(--muted); font-size: 13px; }
.dc-what small b { color: var(--gold-ink); }
.dc-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dc-none { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface); color: var(--muted); }
.dc-admin { border-top: 1px solid var(--line); padding-top: 18px; }
.dc-admin .ag-doc { margin-top: 0; }
.dc .tk-bar { margin: 0; }
.ag-metarow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .dc-item { grid-template-columns: 40px minmax(0, 1fr); }
  .dc-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .dc-ico { width: 40px; height: 40px; }
}
