/* ============================================================
   signedcopy.css — the "send the signed copy" panel.

   Deliberately the same furniture as sendto.js's chooser, which stacks on
   top of this one: same overlay weight, same card radius, same type scale.
   A consultant presses one button and meets two dialogs in a row; if they
   looked like different products the second would read as a different act.

   Everything is a KDS token with a literal fallback, exactly as the rest of
   the app does it, so the panel is correct before the stylesheet variables
   resolve and on the print sheet.
   ============================================================ */

.sc-ov{
  position:fixed;inset:0;z-index:9000;background:rgba(26,27,24,.44);
  display:flex;align-items:center;justify-content:center;padding:18px;overflow:auto;
}
.sc-card{
  background:var(--paper,#FBF9F4);border-radius:var(--r-md,16px);
  box-shadow:var(--shadow,0 20px 60px -20px rgba(0,0,0,.4));
  width:min(620px,100%);max-height:calc(100vh - 36px);
  display:flex;flex-direction:column;font-family:var(--body,inherit);
}
.sc-head{
  display:flex;align-items:flex-start;gap:12px;
  padding:16px 18px 12px;border-bottom:1px solid var(--stroke,rgba(26,27,24,.12));
}
.sc-head > div{flex:1 1 auto;min-width:0;}
.sc-title{font-family:var(--disp,inherit);font-size:19px;font-weight:700;line-height:1.2;}
.sc-sub{font-size:12.5px;color:var(--ink-soft,#6A685F);margin-top:3px;line-height:1.4;}
.sc-x{
  flex:0 0 auto;border:0;background:transparent;cursor:pointer;
  font-size:22px;line-height:1;color:var(--ink-faint,#9B988D);padding:2px 4px;border-radius:6px;
}
.sc-x:hover{color:var(--ink,#1A1B18);background:var(--stroke-soft,rgba(26,27,24,.07));}

/* The body scrolls; the footer never does. The last thing read before Send
   must not be able to land under the buttons — the same rule sendto.js
   arrived at the hard way. */
.sc-body{padding:14px 18px 0;overflow-y:auto;min-height:0;}
.sc-loading{font-size:13px;color:var(--ink-soft,#6A685F);padding:18px 0 24px;}

/* ---------- the promise, at the top ---------- */
.sc-assure{
  border:1px solid rgba(30,58,51,.18);border-radius:var(--r-sm,10px);
  background:rgba(30,58,51,.05);padding:11px 13px;margin:0 0 14px;
}
.sc-assure-h{
  font-size:11px;letter-spacing:.10em;text-transform:uppercase;font-weight:700;
  color:var(--green,#1E3A33);margin:0 0 5px;
}
.sc-assure p{margin:0;font-size:12.5px;line-height:1.5;color:var(--ink-soft,#6A685F);}
.sc-assure strong{color:var(--ink,#1A1B18);font-weight:600;}

/* ---------- the refusal ---------- */
.sc-refuse{
  border:1px solid rgba(140,59,46,.28);border-radius:var(--r-sm,10px);
  background:rgba(140,59,46,.06);padding:13px 15px;margin:0 0 14px;
}
.sc-refuse-h{
  font-family:var(--disp,inherit);font-size:15px;font-weight:700;line-height:1.3;
  color:var(--red,#8C3B2E);margin:0 0 6px;
}
.sc-refuse p{margin:0;font-size:13.5px;line-height:1.55;color:var(--ink,#1A1B18);}

/* ---------- facts ---------- */
.sc-grid{display:flex;flex-wrap:wrap;gap:6px 22px;margin:0 0 4px;}
.sc-kv{display:flex;gap:8px;align-items:baseline;font-size:13px;min-width:0;}
.sc-kv .k{color:var(--ink-soft,#6A685F);font-size:11px;letter-spacing:.06em;text-transform:uppercase;font-weight:700;}
.sc-kv .v{font-weight:600;overflow:hidden;text-overflow:ellipsis;}

.sc-sec{margin:14px 0 0;}
.sc-sec-h{
  font-size:11px;letter-spacing:.10em;text-transform:uppercase;font-weight:700;
  color:var(--ink-soft,#6A685F);margin:0 0 7px;
}
.sc-signer{padding:5px 0;border-top:1px solid var(--stroke-soft,rgba(26,27,24,.07));}
.sc-signer:first-of-type{border-top:0;}
.sc-signer-n{font-size:13px;font-weight:600;line-height:1.25;}
.sc-signer-m{font-size:11.5px;color:var(--ink-soft,#6A685F);line-height:1.35;}

/* ---------- frozen vs re-rendered: the one thing nobody may skim ---------- */
.sc-source{border-radius:var(--r-sm,10px);padding:10px 12px;border:1px solid var(--stroke,rgba(26,27,24,.12));}
.sc-source-t{font-size:13px;font-weight:700;margin:0 0 4px;}
.sc-source p{margin:0;font-size:12.5px;line-height:1.5;color:var(--ink-soft,#6A685F);}
.sc-source-ok{border-color:rgba(169,130,76,.32);background:rgba(169,130,76,.07);}
.sc-source-ok .sc-source-t{color:var(--gold-deep,#8A6634);}
.sc-source-warn{border-color:rgba(140,59,46,.28);background:rgba(140,59,46,.055);}
.sc-source-warn .sc-source-t{color:var(--red,#8C3B2E);}

.sc-open{
  display:inline-block;margin-top:9px;font-size:13px;font-weight:600;
  color:var(--gold-deep,#8A6634);text-decoration:none;border-bottom:1px solid rgba(169,130,76,.45);
}
.sc-open:hover{color:var(--ink,#1A1B18);border-bottom-color:var(--ink,#1A1B18);}

/* ---------- the covering line ---------- */
.sc-lbl{display:block;font-size:11px;letter-spacing:.06em;text-transform:uppercase;
  font-weight:700;color:var(--ink-soft,#6A685F);margin:0 0 5px;}
.sc-in{
  width:100%;box-sizing:border-box;font:inherit;font-size:13px;line-height:1.45;
  padding:8px 10px;border:1px solid var(--stroke,rgba(26,27,24,.12));
  border-radius:var(--r-sm,10px);background:var(--paper,#FBF9F4);color:var(--ink,#1A1B18);
  resize:vertical;
}
.sc-in:focus{outline:2px solid rgba(169,130,76,.45);outline-offset:1px;border-color:var(--gold,#A9824C);}

/* ---------- the log ---------- */
.sc-histwrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.sc-hist{width:100%;border-collapse:collapse;font-size:12px;min-width:460px;}
.sc-hist th{
  text-align:left;font-size:10px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ink-faint,#9B988D);font-weight:700;padding:0 10px 5px 0;white-space:nowrap;
}
.sc-hist td{
  padding:6px 10px 6px 0;border-top:1px solid var(--stroke-soft,rgba(26,27,24,.07));
  vertical-align:top;line-height:1.35;
}
.sc-faint{font-size:11px;color:var(--ink-faint,#9B988D);}
.sc-mono{font-family:ui-monospace,Menlo,Consolas,monospace;}
.sc-histnote{margin-top:7px;line-height:1.45;}
.sc-chip{
  display:inline-block;padding:1px 7px;border-radius:999px;font-size:10.5px;font-weight:700;
  letter-spacing:.04em;background:var(--stroke-soft,rgba(26,27,24,.07));color:var(--ink-soft,#6A685F);
  white-space:nowrap;
}
.sc-chip-ok{background:rgba(30,58,51,.10);color:var(--green,#1E3A33);}
.sc-chip-warn{background:rgba(169,130,76,.16);color:var(--gold-deep,#8A6634);}
.sc-chip-bad{background:rgba(140,59,46,.12);color:var(--red,#8C3B2E);}

/* ---------- footer ---------- */
.sc-foot{
  position:sticky;bottom:0;display:flex;gap:8px;justify-content:flex-end;
  padding:14px 0 16px;margin-top:16px;background:var(--paper,#FBF9F4);
  border-top:1px solid var(--stroke,rgba(26,27,24,.12));
}

/* The button this file adds to two toolbars it does not own. No new look —
   it is a .btn like its neighbours; this only stops it colliding with them
   on a narrow screen. */
.sc-btn{white-space:nowrap;}

/* ---------- 390px ----------
   A bottom sheet, sized to its content and capped at the viewport. Not a
   stretched full-screen card: on the refusal — which is four lines — that
   left two-thirds of a phone screen blank under a lone Close button, which
   reads as a page that failed to load rather than an answer.

   The footer buttons go full width, and Send sits ABOVE Cancel
   (column-reverse), because at 390 the bottom of the sheet is where the
   thumb rests and the destructive-by-accident tap is the one that closes a
   panel somebody has just filled in. */
@media (max-width:560px){
  .sc-ov{padding:0;align-items:flex-end;}
  .sc-card{width:100%;max-height:100vh;border-radius:var(--r-md,16px) var(--r-md,16px) 0 0;}
  .sc-body{padding:12px 14px 0;}
  .sc-head{padding:14px 14px 10px;}
  .sc-grid{flex-direction:column;gap:4px;}
  .sc-foot{flex-direction:column-reverse;padding:12px 14px 16px;margin:16px -14px 0;}
  .sc-foot .btn{width:100%;justify-content:center;}

  /* The log stops being a table. Five columns at 390 is a sideways scroll
     nobody finds, and the one thing this table is for — proving to an
     inspector who was sent what, when — must not be the part that is off
     the edge of the screen. */
  .sc-histwrap{overflow-x:visible;}
  .sc-hist{min-width:0;}
  .sc-hist thead{display:none;}
  .sc-hist,.sc-hist tbody,.sc-hist tr,.sc-hist td{display:block;width:100%;}
  .sc-hist tr{border-top:1px solid var(--stroke-soft,rgba(26,27,24,.07));padding:8px 0 6px;}
  .sc-hist tr:first-child{border-top:0;}
  .sc-hist td{border-top:0;padding:2px 0;}
  .sc-hist td:empty{display:none;}
  .sc-hist td::before{
    content:attr(data-l);display:block;
    font-size:10px;letter-spacing:.08em;text-transform:uppercase;font-weight:700;
    color:var(--ink-faint,#9B988D);
  }
}
