/* ============================================================
   START AN APPLICATION — appstart.css (agent F)

   Everything structural is already in styles.css: .panel, .panel-title,
   .tbl, .chip, .pill, .btn, .frow/.fld, .m-*, .doc-box, .empty. These are
   only the rules this feature adds, all prefixed `as-` so nothing here can
   reach another screen. .dq-* classes on the request review dialog are
   docrequest.js's own, deliberately reused so the two dialogs are the same
   dialog to look at; this file never redefines them.
   ============================================================ */

/* ---------- the start dialog ---------- */
.as-note{color:var(--ink-soft);font-size:13px;line-height:1.55;padding:10px 0}
.as-err{color:var(--red)}
.as-opt{color:var(--ink-faint);font-weight:400;text-transform:none;letter-spacing:0;font-size:11px}
.as-hint{margin-top:12px;color:var(--ink-faint);font-size:11.5px;line-height:1.55}
.as-summary{font-size:13px;color:var(--ink-soft);margin:2px 0 8px}

.as-vouch{display:flex;align-items:center;gap:7px;font-size:11.5px;font-weight:600;color:var(--green);
  margin-bottom:10px}
.as-vouch.as-unvouched{color:var(--ink-faint);font-weight:500}

.as-prev-wrap{margin:4px 0 2px}
.as-prev{display:grid;grid-template-columns:1fr 1fr;gap:18px;
  background:var(--bone);border:1px solid var(--stroke-soft);border-radius:var(--r-md);padding:14px 16px}
.as-prev-h{font-family:var(--disp);font-size:10.5px;font-weight:700;letter-spacing:.11em;
  text-transform:uppercase;color:var(--ink-faint);margin-bottom:8px;display:flex;align-items:center;gap:7px}
.as-n{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:16px;padding:0 5px;
  border-radius:99px;background:rgba(26,27,24,.07);color:var(--ink-soft);
  font-family:var(--body);font-size:10.5px;font-weight:700;letter-spacing:0}
.chip .as-n{margin-left:4px}
.as-list{list-style:none;margin:0;padding:0;font-size:12.5px;line-height:1.5}
.as-list li{position:relative;padding:3px 0 3px 14px;color:var(--ink)}
.as-list li::before{content:'';position:absolute;left:2px;top:11px;width:4px;height:4px;border-radius:50%;
  background:var(--gold)}
.as-cond{color:var(--ink-faint);font-size:11px}

/* The handbook's own sub-heading, shown only where it has more than one —
   in section E the split between what the EMPLOYER provides and what
   supports the application is the substance of the page. */
.as-sec{font-size:10px;font-weight:700;letter-spacing:.11em;text-transform:uppercase;
  color:var(--gold-deep);margin:12px 0 5px}
.as-list + .as-sec,.as-item + .as-sec,.dq-row + .as-sec,.as-form + .as-sec{margin-top:16px}
.as-sec:first-child{margin-top:0}

.as-rcic{margin-top:14px;padding:12px 14px;border-left:2px solid var(--gold);
  background:rgba(169,130,76,.06);border-radius:0 var(--r-sm) var(--r-sm) 0}
/* app_type_notes.body may carry newlines (section F and G's "Application"
   sub-lists are one note, one variant per line) — migration 088 says render
   with white-space:pre-line, so that is what happens. */
.as-rcic p{font-size:12.5px;line-height:1.6;color:var(--ink-soft);white-space:pre-line}
.as-rcic p + p{margin-top:8px}

.as-file{margin-top:18px;padding-top:14px;border-top:1px solid var(--stroke-soft)}

/* .m-card scrolls at 88vh, and a checklist of eighteen items pushes the
   only button that matters out of sight. Pin the footer to the bottom of
   the card's own scrollport — scoped to these two dialogs, never to every
   modal in the app. */
#asBody > .m-foot,
#asReqBody > .m-foot{position:sticky;bottom:0;background:var(--paper);padding-bottom:4px;z-index:2}
/* The acknowledgement sits in this footer, so it has to centre and wrap. */
#asBody > .m-foot{align-items:center;flex-wrap:wrap}

/* ---------- the application screen ---------- */
.as-head{display:flex;align-items:flex-start;gap:20px;flex-wrap:wrap;margin-bottom:16px}
.as-head-l{flex:1 1 320px;min-width:0}
.as-head-r{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.as-kicker{font-size:11.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--ink-faint)}
.as-title{font-family:var(--disp);font-size:25px;font-weight:700;line-height:1.15;margin:4px 0 9px}
.as-chips{display:flex;flex-wrap:wrap;gap:6px}
.as-chip{padding:3px 10px;border-radius:99px;background:var(--bone);border:1px solid var(--stroke-soft);
  font-size:11.5px;font-weight:600;color:var(--ink-soft)}
.as-chip.hot{background:rgba(140,59,46,.10);border-color:rgba(140,59,46,.24);color:var(--red)}

.as-grid{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:16px;align-items:start}

.as-forms{display:flex;flex-direction:column;gap:2px}
.as-form{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;padding:7px 0;
  border-bottom:1px solid var(--stroke-soft);font-size:13px}
.as-form:last-child{border-bottom:0}
/* Body font with tabular figures, not the display face: "IMM 5476" set in
   Bricolage at 12px reads as "IMM 547G", and an IMM number a consultant
   misreads is the one thing on this panel that must be exact. */
.as-form-c{flex:0 0 auto;font-family:var(--body);font-weight:700;font-size:12.5px;letter-spacing:.02em;
  font-variant-numeric:tabular-nums;white-space:nowrap;
  color:var(--gold-deep);background:rgba(169,130,76,.10);border-radius:var(--r-sm);padding:2px 8px}
.as-form-n{flex:1 1 140px;min-width:0;color:var(--ink)}
.as-form-w{flex:0 0 auto;font-size:11px;color:var(--ink-faint)}

.as-items{display:flex;flex-direction:column}
.as-item{display:flex;align-items:flex-start;gap:11px;padding:8px 0;
  border-bottom:1px solid var(--stroke-soft)}
.as-item:last-child{border-bottom:0}
.as-item .doc-box{flex:0 0 auto;margin-top:1px}
.as-item .as-nobox{opacity:.3;cursor:default}
.as-item-l{flex:1 1 0%;min-width:0}
.as-item-n{font-size:13px;line-height:1.4}
.as-item.on .as-item-n{color:var(--ink-soft)}
.as-item-c{font-size:11px;color:var(--ink-faint);margin-top:1px}
.as-item-f{display:flex;flex-wrap:wrap;gap:6px;margin-top:5px}
.as-item > .pill{flex:0 0 auto;margin-top:1px}

/* ---------- the list ---------- */
.as-toggle{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--ink-soft);
  white-space:nowrap;cursor:pointer}
.as-toggle input{accent-color:var(--gold);width:14px;height:14px}
.as-due-hot{color:var(--red);font-weight:600}
.chip.as-chip-0{opacity:.5}
.chip.as-chip-0:hover,.chip.as-chip-0.on{opacity:1}
.as-unmapped{font-style:italic}
tr[data-asrow]{cursor:pointer}

/* ============================================================
   PROVENANCE — WHO SAID THIS  (CONTRACT9, agent S)

   Three kinds of line, and the difference has to be visible wherever a line
   is shown. The design problem is that two of the three are the ordinary case:
   tagging eighteen handbook documents as loudly as one proposed line would
   teach a consultant to stop reading the tags altogether, which is the exact
   failure this is meant to prevent.

   So: handbook and firm are quiet grey type, proposed is the only thing on the
   line wearing a colour and a border. The colour is the orange already in
   styles.css (.pill.orange, #A4501A) — deliberately NOT gold, which everywhere
   else in PASSAGE means "the firm's own", and NOT red, which means a deadline
   or an error. Nothing here is dismissible.
   ============================================================ */
.as-prov{display:inline-flex;align-items:center;gap:4px;vertical-align:baseline;white-space:nowrap;
  font-size:10px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;
  color:var(--ink-faint);border-radius:99px;padding:1px 6px;background:rgba(26,27,24,.045)}
.as-prov-h,.as-prov-f{font-weight:600}
.as-prov-c{color:var(--green);background:rgba(30,58,51,.08)}
/* The vetted tick on a confirmed line — the visible counterpart of a proposed
   line never being allowed one. */
.as-prov-v{color:var(--green);font-weight:700;margin-left:1px}
/* The one that has to stop somebody. A dashed edge because everything else in
   this app that is solid-bordered is settled. */
.as-prov-p{color:#A4501A;background:rgba(196,98,24,.13);border:1px dashed rgba(196,98,24,.55);
  padding:0 6px;font-weight:700}

/* The line itself, so a proposed item is findable by eye in a list of twenty
   without reading a single tag. */
.as-li-p,.as-item-p,.as-form-p{position:relative}
.as-li-p::before{background:#C46218 !important}
.as-item-p,.dq-row.as-item-p{box-shadow:inset 3px 0 0 rgba(196,98,24,.55);padding-left:9px}
.as-form-p{box-shadow:inset 3px 0 0 rgba(196,98,24,.45);padding-left:9px}

/* ---------- the banner ---------- */
.as-prop-panel{margin-bottom:16px;padding:0;border:0;background:none;box-shadow:none}
.as-prop-banner{border-radius:var(--r-md);padding:12px 15px;margin:10px 0;
  background:rgba(196,98,24,.07);border:1px solid rgba(196,98,24,.24)}
.as-prop-banner.hard{background:rgba(196,98,24,.11);border-color:rgba(196,98,24,.45)}
.as-prop-h{font-family:var(--disp);font-size:12.5px;font-weight:700;letter-spacing:.02em;color:#A4501A;
  margin-bottom:4px}
.as-prop-b{font-size:12px;line-height:1.6;color:var(--ink-soft)}
.as-prop-b b{color:var(--ink)}
.as-prop-live:not(:empty){margin:10px 0 2px;padding:8px 12px;border-radius:var(--r-sm);
  background:rgba(196,98,24,.11);border:1px solid rgba(196,98,24,.4);
  font-size:11.5px;line-height:1.55;font-weight:600;color:#A4501A}

/* Proposed notes are NEVER the gold "From the RCIC" block — that block is the
   one thing on the screen that says a named human wrote this. */
.as-rcic.as-rcic-p{border-left-color:#C46218;background:rgba(196,98,24,.06)}
.as-rcic.as-rcic-p .as-prev-h{color:#A4501A}

.as-vouch.as-vouch-p{color:#A4501A;font-weight:600}

/* ---------- the warning before starting an all-proposed application ---------- */
.as-gate{margin-top:16px;padding:13px 15px;border-radius:var(--r-md);
  background:rgba(196,98,24,.09);border:1px solid rgba(196,98,24,.45)}
.as-gate-t{font-family:var(--disp);font-size:13.5px;font-weight:700;color:#A4501A;margin-bottom:5px}
.as-gate-b{font-size:12px;line-height:1.6;color:var(--ink-soft)}
.as-gate-b b{color:var(--ink)}
.as-gate-p{margin-top:8px;font-size:11.5px;font-weight:600;color:#A4501A}
/* The tick lives in the sticky footer, beside the button it unlocks. */
.as-ack-wrap:empty{display:none}
.as-ack-wrap{flex:1 1 200px;min-width:0;margin-right:auto}
.as-gate-ack{display:flex;align-items:center;gap:9px;cursor:pointer;padding:7px 10px;border-radius:var(--r-sm);
  background:rgba(196,98,24,.10);border:1px solid rgba(196,98,24,.45);
  font-size:12px;font-weight:600;color:var(--ink);line-height:1.35}
.as-gate-ack input{accent-color:#C46218;width:16px;height:16px;flex:0 0 16px}
.as-gate-ack b{color:#A4501A}

/* ---------- the list ---------- */
.as-chip.as-chip-p{background:rgba(196,98,24,.12);border-color:rgba(196,98,24,.45);color:#A4501A}
.chip.as-chip-prop{border-color:rgba(196,98,24,.45)}
.as-chip-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#C46218;
  margin-right:6px;vertical-align:middle}
/* Screen-reader only: the chip's mark is a dot, and a dot says nothing to
   somebody who cannot see it. There is no sr-only class in styles.css, so this
   feature brings its own rather than adding one to a file it does not own. */
.as-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}
.t-sub .as-prov{margin-left:4px}

/* ---------- narrow ---------- */
@media (max-width:1000px){
  .as-grid{grid-template-columns:1fr}
}
@media (max-width:640px){
  .as-prev{grid-template-columns:1fr;gap:14px}
  .as-title{font-size:21px}
  .as-head{gap:12px}
  .as-head-r{width:100%}
  .as-head-r .btn{flex:1 1 auto}
  /* The applications table lives in .tbl-wrap, which already scrolls
     sideways; the progress dots are the one column that says nothing a phone
     user can act on, so it goes rather than stretching the row. Scoped to
     this screen's own table, never to .tbl everywhere. */
  #view .as-apps th:nth-child(4), #view .as-apps td:nth-child(4){display:none}
}
@media (max-width:640px){
  /* On a phone the tag goes under the item rather than fighting it for the
     line — but it never goes away. */
  .as-prov{font-size:9.5px}
  .as-gate-b,.as-prop-b{font-size:11.5px}
}
@media (forced-colors:active){
  .as-chip,.as-form-c,.as-n{border:1px solid}
  /* In forced colours every background is thrown away, so the proposed mark
     has to be a border and a word, not a colour. */
  .as-prov-p,.as-prop-banner,.as-gate,.as-prop-live:not(:empty){border:2px dashed}
  .as-chip-dot{border:2px solid}
}
