/* Contracts uses the approved workspace surfaces without affecting other trackers. */
#appShell.ui-workspace #paneContracts { display:flex; flex-direction:column; gap:22px; container-type:inline-size; min-width:0; }
#appShell.ui-workspace #paneContracts:is(.u-hidden,[hidden]) { display:none; }
#appShell #paneContracts [hidden] { display:none !important; }
#appShell #paneContracts :is(h2,p) { margin:0; }
#appShell #paneContracts h2 { font-size:14px; font-weight:650; color:var(--ui-ink); }
#appShell #paneContracts small { font-size:10px; line-height:1.65; color:var(--ui-ink-secondary); }
#appShell #paneContracts .workspace-page-head { align-items:flex-end; }
#appShell #paneContracts .contract-page-actions { display:flex; gap:9px; flex-wrap:wrap; margin-left:auto; }
#appShell #paneContracts .contract-primary { background:var(--ui-blue); border-color:var(--ui-blue); color:#fff; box-shadow:none; }
#appShell #paneContracts button:disabled { cursor:default; opacity:.5; }
#appShell #paneContracts :is(button,input,select,textarea):focus-visible { outline:3px solid var(--ui-blue); outline-offset:3px; }
#appShell #paneContracts .contract-notice { display:flex; align-items:center; gap:16px; justify-content:space-between; padding:15px 18px; border:1px solid color-mix(in srgb,var(--ui-amber) 28%,var(--ui-line)); border-radius:9px; background:var(--ui-amber-soft); color:var(--ui-amber); font-size:12px; line-height:1.65; }
#appShell #paneContracts .contract-notice button { color:inherit; flex-shrink:0; }
#appShell #paneContracts .contract-text-button { padding:4px 0; border:0; background:none; box-shadow:none; color:var(--ui-blue); text-align:left; font-size:11px; cursor:pointer; white-space:normal; }
#appShell #paneContracts .contract-text-button:hover { text-decoration:underline; }
#appShell #paneContracts .contract-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--ui-line); border-radius:11px; background:var(--ui-surface); overflow:hidden; }
#appShell #paneContracts .contract-metric { display:flex; flex-direction:column; align-items:flex-start; min-width:0; padding:23px; border-right:1px solid var(--ui-line); gap:8px; }
#appShell #paneContracts .contract-metric:last-child { border-right:0; }
#appShell #paneContracts .contract-metric > span { font-size:11px; color:var(--ui-ink-secondary); }
#appShell #paneContracts .contract-metric strong { font-size:clamp(21px,2.1cqi,29px); font-weight:650; letter-spacing:-.8px; line-height:1.4; overflow-wrap:anywhere; color:var(--ui-ink); font-variant-numeric:tabular-nums; }
#appShell #paneContracts .contract-metric small { overflow-wrap:anywhere; }
#appShell #paneContracts .contract-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:22px; align-items:start; }
#appShell #paneContracts :is(.contract-main,.contract-side) { min-width:0; display:grid; gap:18px; }
#appShell #paneContracts .contract-panel { border:1px solid var(--ui-line); border-radius:11px; background:var(--ui-surface); overflow:hidden; min-width:0; }
#appShell #paneContracts .contract-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:21px; }
#appShell #paneContracts .contract-count { display:inline-block; margin-left:7px; padding:3px 6px; border:1px solid var(--ui-line); border-radius:5px; background:var(--ui-surface-muted); font-size:10px; font-weight:500; color:var(--ui-ink-secondary); }
#appShell #paneContracts .contract-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:0 20px 17px; }
#appShell #paneContracts .contract-filters { display:flex; flex-wrap:wrap; gap:4px; margin-right:auto; }
#appShell #paneContracts .contract-filters button { border:1px solid transparent; background:none; box-shadow:none; color:var(--ui-ink-secondary); font-size:11px; padding:8px 9px; border-radius:7px; }
#appShell #paneContracts .contract-filters button[aria-pressed="true"] { border-color:color-mix(in srgb,var(--ui-blue) 30%,var(--ui-line)); background:var(--ui-blue-soft); color:var(--ui-blue); }
#appShell #paneContracts :is(#contractsSearch,#contractsSort) { min-height:36px; font-size:11px; padding:8px 10px; width:auto; border:1px solid var(--ui-line); border-radius:7px; background:var(--ui-surface-solid); color:var(--ui-ink); max-width:100%; }
#appShell #paneContracts #contractsSearch { width:175px; }
#appShell #paneContracts .contract-table-wrap { width:100%; max-width:100%; overflow:auto; }
#appShell #paneContracts .contract-register { width:100%; min-width:680px; border-collapse:collapse; text-align:left; background:transparent; color:var(--ui-ink); }
#appShell #paneContracts .contract-register th { padding:13px 16px; border-block:1px solid var(--ui-line); background:var(--ui-surface-muted); text-transform:uppercase; letter-spacing:.8px; font-size:9px; font-weight:600; color:var(--ui-ink-secondary); white-space:nowrap; }
#appShell #paneContracts .contract-register td { padding:22px 16px; border:0; border-bottom:1px solid var(--ui-line); font-size:11px; background:transparent; vertical-align:middle; font-variant-numeric:tabular-nums; }
#appShell #paneContracts .contract-register :is(th,td):first-child { padding-left:22px; }
#appShell #paneContracts .contract-register tbody tr { background:transparent; }
#appShell #paneContracts .contract-register tbody tr:hover { background:var(--ui-surface-muted); }
#appShell #paneContracts .contract-register tbody tr:last-child td { border-bottom:0; }
#appShell #paneContracts .contract-register td small { display:block; margin-top:5px; }
#appShell #paneContracts .contract-name { display:block; min-height:24px; max-width:240px; padding:0; border:0; background:none; box-shadow:none; font-size:12px; font-weight:600; text-align:left; color:var(--ui-ink); line-height:1.6; overflow-wrap:anywhere; white-space:normal; }
#appShell #paneContracts .contract-name:hover { color:var(--ui-blue); text-decoration:underline; }
#appShell #paneContracts .contract-vendor { max-width:240px; overflow-wrap:anywhere; }
#appShell #paneContracts .contract-money { white-space:nowrap; font-weight:600; }
#appShell #paneContracts .contract-progress { display:block; width:90px; height:4px; margin-top:8px; border:0; border-radius:5px; overflow:hidden; background:var(--ui-line); accent-color:var(--ui-blue); }
#appShell #paneContracts .contract-progress::-webkit-progress-bar { background:var(--ui-line); border-radius:5px; }
#appShell #paneContracts .contract-progress::-webkit-progress-value { background:var(--ui-blue); border-radius:5px; }
#appShell #paneContracts .contract-progress::-moz-progress-bar { background:var(--ui-blue); border-radius:5px; }
#appShell #paneContracts .contract-progress.complete::-webkit-progress-value { background:var(--ui-green); }
#appShell #paneContracts .contract-progress.complete::-moz-progress-bar { background:var(--ui-green); }
#appShell #paneContracts .contract-badge { display:inline-flex; padding:6px 8px; border-radius:5px; font-size:9px; font-weight:600; white-space:nowrap; background:var(--ui-blue-soft); color:var(--ui-blue); }
#appShell #paneContracts .contract-badge:is(.ending,.expired,.schedule) { background:var(--ui-amber-soft); color:var(--ui-amber); }
#appShell #paneContracts .contract-badge.complete { background:var(--ui-green-soft); color:var(--ui-green); }
#appShell #paneContracts .contract-view { border:0; background:none; box-shadow:none; color:var(--ui-ink-secondary); padding:7px; }
#appShell #paneContracts .contract-panel-foot { display:flex; align-items:center; gap:8px; padding:14px 21px; border-top:1px solid var(--ui-line); font-size:10px; color:var(--ui-ink-secondary); }
#appShell #paneContracts .contract-panel-foot > span { margin-right:auto; }
#appShell #paneContracts .contract-panel-foot button { font-size:10px; padding:6px 9px; }
#appShell #paneContracts .contract-footnote { font-size:11px; line-height:1.7; color:var(--ui-ink-secondary); overflow-wrap:anywhere; }
#appShell #paneContracts .contract-status-row { display:flex; align-items:center; gap:12px; border-top:1px solid var(--ui-line); padding-top:17px; }
#appShell #paneContracts .contract-status-row[data-state="error"] p { color:var(--ui-red); }
#appShell #paneContracts .contract-side-panel { padding:21px; }
#appShell #paneContracts .contract-side-panel > small { display:block; margin-top:7px; }
#appShell #paneContracts .contract-side-head { display:flex; gap:9px; justify-content:space-between; align-items:center; }
#appShell #paneContracts .contract-schedule-item { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:12px; padding:17px 0; border-bottom:1px solid var(--ui-line); }
#appShell #paneContracts .contract-schedule-item:last-child { border:0; padding-bottom:0; }
#appShell #paneContracts .contract-calendar { text-align:center; background:var(--ui-surface-muted); border:1px solid var(--ui-line); border-radius:7px; padding:6px 2px; }
#appShell #paneContracts .contract-calendar small { display:block; font-size:8px; text-transform:uppercase; }
#appShell #paneContracts .contract-calendar strong { font-size:15px; color:var(--ui-ink); }
#appShell #paneContracts .contract-schedule-item .contract-name { font-size:11px; font-weight:500; }
#appShell #paneContracts .contract-schedule-item small { display:block; margin-top:4px; }
#appShell #paneContracts .contract-ending-item { margin-top:18px; }
#appShell #paneContracts .contract-ending-item strong { display:block; font-size:11px; color:var(--ui-ink); overflow-wrap:anywhere; }
#appShell #paneContracts .contract-ending-item p { margin:5px 0; font-size:10px; line-height:1.7; color:var(--ui-ink-secondary); }
#appShell #paneContracts .contract-empty { padding:28px 21px; font-size:12px; color:var(--ui-ink-secondary); text-align:center; white-space:normal; }
#appShell #paneContracts .contract-side-panel .contract-empty { padding:20px 0 0; text-align:left; }
#appShell #paneContracts .contract-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#appShell #paneContracts .contract-dialog { box-sizing:border-box; padding:0; color:var(--ui-ink); background:var(--ui-surface-solid); border:1px solid var(--ui-line); overflow:auto; box-shadow:0 20px 70px rgb(15 23 42 / 20%); }
#appShell #paneContracts .contract-dialog::backdrop { background:rgb(15 23 42 / 40%); }
#appShell #paneContracts .contract-drawer { position:fixed; inset:0 0 0 auto; margin:0; width:min(460px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; border-radius:0; border-width:0 0 0 1px; }
#appShell #paneContracts .contract-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:17px; padding:26px; border-bottom:1px solid var(--ui-line); }
#appShell #paneContracts .contract-dialog-head > div { min-width:0; }
#appShell #paneContracts .contract-dialog-head h2 { font-size:21px; line-height:1.5; overflow-wrap:anywhere; }
#appShell #paneContracts .contract-dialog-head :is(small,p) { display:block; margin-top:8px; font-size:11px; color:var(--ui-ink-secondary); overflow-wrap:anywhere; line-height:1.65; }
#appShell #paneContracts #contractsDetailBadge { margin:12px 0 9px; }
#appShell #paneContracts .contract-drawer-body { padding:26px; }
#appShell #paneContracts .contract-payment-hero { padding:21px; border:1px solid var(--ui-line); border-radius:10px; background:var(--ui-surface-muted); }
#appShell #paneContracts .contract-payment-hero > strong { display:block; font-size:30px; margin:10px 0; font-weight:650; letter-spacing:-1px; overflow-wrap:anywhere; }
#appShell #paneContracts .contract-payment-hero .contract-progress { width:100%; height:6px; margin:17px 0 8px; }
#appShell #paneContracts .contract-facts { display:grid; grid-template-columns:1fr 1fr; gap:23px 17px; margin:26px 0; }
#appShell #paneContracts .contract-facts dt { margin-bottom:7px; font-size:9px; text-transform:uppercase; letter-spacing:.5px; color:var(--ui-ink-secondary); }
#appShell #paneContracts .contract-facts dd { margin:0; font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
#appShell #paneContracts .contract-notes { padding:15px; border:1px solid var(--ui-line); border-radius:8px; background:var(--ui-surface-muted); font-size:12px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
#appShell #paneContracts .contract-drawer-actions { display:grid; gap:10px; margin:20px 0 16px; }
#appShell #paneContracts .contract-danger { color:var(--ui-red); }
#appShell #paneContracts .contract-editor { width:min(700px,calc(100vw - 32px)); max-height:calc(100dvh - 36px); border-radius:14px; }
#appShell #paneContracts .contracts-form { padding:24px; gap:19px; }
#appShell #paneContracts .contracts-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
#appShell #paneContracts :is(.contracts-form-grid label,.contracts-notes-label) { font-size:11px; color:var(--ui-ink-secondary); min-width:0; }
#appShell #paneContracts :is(.contracts-form-grid input,.contracts-notes-label textarea) { width:100%; min-width:0; padding:10px 11px; border:1px solid var(--ui-line); border-radius:7px; background:var(--ui-surface-solid); color:var(--ui-ink); font-size:12px; box-shadow:none; }
#appShell #paneContracts .contract-form-status { font-size:12px; color:var(--ui-ink-secondary); line-height:1.6; }
#appShell #paneContracts .contract-form-status[data-state="error"] { color:var(--ui-red); }
#appShell #paneContracts .contract-form-status:empty { display:none; }
@container(max-width:1050px) {
  #appShell #paneContracts .contract-layout { grid-template-columns:minmax(0,1fr); }
  #appShell #paneContracts .contract-side { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container(max-width:650px) {
  #appShell #paneContracts .contract-page-actions { margin-left:0; }
  #appShell #paneContracts .contract-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appShell #paneContracts .contract-metric { padding:17px; }
  #appShell #paneContracts .contract-metric:nth-child(2) { border-right:0; }
  #appShell #paneContracts .contract-metric:nth-child(-n+2) { border-bottom:1px solid var(--ui-line); }
  #appShell #paneContracts .contract-side { grid-template-columns:minmax(0,1fr); }
  #appShell #paneContracts :is(.contract-notice,.contract-panel-foot,.contract-panel-head) { flex-wrap:wrap; }
  #appShell #paneContracts .contract-filters { width:100%; }
  #appShell #paneContracts #contractsSearch { flex:1; min-width:130px; }
}
@media(max-width:500px) {
  #appShell #paneContracts .contracts-form-grid { grid-template-columns:minmax(0,1fr); }
  #appShell #paneContracts :is(.contracts-form,.contract-dialog-head,.contract-drawer-body) { padding:20px; }
}
@media(pointer:coarse) {
  #appShell #paneContracts :is(button,.contract-name,.contract-text-button,.contract-view,.contract-filters button) { min-height:44px; }
}
