/* ==========================================================================
   GV Mediatech — Creator Invoice Generator
   Layered on top of styles.css: the nav, buttons, colour tokens and footer
   all come from there, and only the tool itself is styled here.
   ========================================================================== */

.tool-body{background:var(--cream)}

/* ---------- hero ---------- */
.tool-hero{background:var(--forest);color:#fff;padding:52px 0 46px;position:relative;overflow:hidden}
.tool-hero .eyebrow{color:var(--green-lt)}
.tool-h1{font-family:var(--display);font-weight:400;text-transform:uppercase;
  font-size:clamp(2.3rem,6vw,4.1rem);line-height:.98;margin:0 0 18px;letter-spacing:.01em}
.tool-h1 em{font-style:normal;color:var(--orange)}
.tool-sub{max-width:56ch;font-size:1.08rem;color:rgba(255,255,255,.86);margin:0 0 20px}
.tool-privacy{display:inline-block;margin:0;font-size:.92rem;color:rgba(255,255,255,.82);
  background:rgba(255,255,255,.07);border:1px solid var(--line-d);
  border-radius:12px;padding:12px 16px;max-width:62ch}
.tool-privacy strong{color:#fff}

.app-wrap{padding:0 24px 60px;margin-top:-26px;position:relative;z-index:2}
.app-wrap[hidden]{display:none}

/* ---------- profile gate ----------
   The whole sign-in is one tap on your own avatar. No password field unless
   the creator asked for a PIN, because there is no server to authenticate to. */
.gate-wrap{padding:0 24px 60px;margin-top:-26px;position:relative;z-index:2}
.gate-wrap[hidden]{display:none}
.gate-card{background:var(--paper);border:1px solid var(--line);border-radius:18px;
  padding:30px;max-width:640px;margin:0 auto;box-shadow:0 16px 44px rgba(6,43,26,.13)}
.gate-list{display:grid;gap:10px;margin:18px 0 6px}
.gate-row{display:flex;align-items:center;gap:14px;width:100%;text-align:left;
  background:var(--cream);border:1px solid var(--line);border-radius:14px;padding:14px 16px;
  font:inherit;cursor:pointer;transition:border-color .15s ease,transform .15s ease}
.gate-row:hover{border-color:var(--green);transform:translateY(-1px)}
.gate-id{display:flex;flex-direction:column;min-width:0;flex:1}
.gate-id b{font-size:1.02rem}
.gate-id .dim{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gate-lock{font-size:.68rem;font-weight:700;letter-spacing:.1em;color:var(--muted);
  border:1px solid var(--line);border-radius:100px;padding:3px 9px;background:var(--paper)}
.avatar{display:flex;align-items:center;justify-content:center;flex:none;
  width:44px;height:44px;border-radius:50%;font-weight:700;font-size:.94rem;color:#fff;
  background:hsl(var(--hue,150) 46% 34%)}
.avatar--xs{width:24px;height:24px;font-size:.66rem}
.pin-row{display:flex;align-items:center;gap:8px;padding:4px 6px 10px}
.pin-row input{width:120px;margin-top:0}
.pin-err{font-size:.84rem;color:var(--red);font-weight:700}
.gate-new{border-top:1px solid var(--line);margin-top:20px;padding-top:6px}

/* ---------- account bar ---------- */
.acct-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  background:var(--paper);border:1px solid var(--line);border-radius:14px;
  padding:12px 16px;margin-bottom:10px;box-shadow:0 10px 30px rgba(6,43,26,.10)}
.acct-who{display:flex;align-items:center;gap:11px}
.acct-id{display:flex;flex-direction:column;line-height:1.25}
.acct-switch{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-left:auto}
.switch-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);
  background:var(--paper);border-radius:100px;padding:5px 12px 5px 6px;font:inherit;
  font-size:.85rem;font-weight:600;color:var(--ink);cursor:pointer}
.switch-chip[data-addacct]{padding-left:12px;color:var(--muted)}
.switch-chip:hover{border-color:var(--green);color:var(--green-text)}

/* ---------- tabs ---------- */
.tabs{display:flex;gap:4px;background:var(--paper);border:1px solid var(--line);
  border-radius:14px;padding:6px;overflow-x:auto;box-shadow:0 10px 30px rgba(6,43,26,.10)}
.tab{flex:1 0 auto;border:0;background:transparent;font:inherit;font-weight:700;
  font-size:.94rem;color:var(--muted);padding:11px 16px;border-radius:10px;cursor:pointer;
  white-space:nowrap;transition:background .15s ease,color .15s ease}
.tab:hover{color:var(--ink)}
.tab.is-on{background:var(--forest);color:#fff}
.tab-badge{display:inline-block;min-width:19px;padding:0 5px;margin-left:5px;
  background:var(--rust);color:#fff;border-radius:100px;font-size:.72rem;line-height:19px;
  text-align:center;vertical-align:1px}
.tab-badge[hidden]{display:none}

.panel{padding-top:22px}
.panel:focus{outline:none}

/* ---------- cards ---------- */
.card{background:var(--paper);border:1px solid var(--line);border-radius:16px;
  padding:22px;margin-bottom:18px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin-bottom:6px;flex-wrap:wrap}
.card-head.wrapy{align-items:flex-start}
.card-h{font-family:var(--display);font-weight:400;text-transform:uppercase;
  font-size:1.32rem;line-height:1.1;letter-spacing:.01em;margin:0 0 4px}
.card-note{font-size:.88rem;color:var(--muted);margin:0 0 14px}
.sub-h{font-size:.8rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase;
  color:var(--green-text);margin:22px 0 10px}
.sub-note{font-weight:400;letter-spacing:0;text-transform:none;color:var(--muted)}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.hint{font-size:.83rem;color:var(--muted);margin:12px 0 0}
.empty{font-size:.94rem;color:var(--muted);margin:6px 0;padding:18px;
  background:var(--cream);border-radius:12px}
.dim{color:var(--muted);font-size:.84rem}
.owed{color:var(--rust)}
.late{color:var(--red);font-size:.8rem;font-weight:700}
.r{text-align:right}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---------- forms ---------- */
.fgrid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.fgrid.one{grid-template-columns:1fr}
.fgrid .f-2{grid-column:1/-1}
.fgrid label,.pay-form label{display:block;font-size:.83rem;font-weight:700;color:var(--ink)}
.req{color:var(--rust)}
.opt{font-weight:400;color:var(--muted)}
input,select,textarea{font:inherit;font-size:.95rem;width:100%;margin-top:5px;
  padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:var(--paper);
  color:var(--ink);font-weight:400}
textarea{resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--green);outline-offset:1px;border-color:var(--green)}
.combo{display:flex;gap:6px;margin-top:5px}
.combo input{margin-top:0}
.combo select{margin-top:0;width:78px;flex:none}
.chk{display:flex;align-items:center;gap:9px;font-size:.88rem;font-weight:600;
  margin-top:14px;color:var(--ink)}
.chk input{width:auto;margin:0}
.mini-select{width:auto;margin-top:0;font-size:.88rem;padding:8px 10px}

/* ---------- build layout ---------- */
/* min-width:0 or the grid tracks inherit the items table's min-content width
   and push the whole page sideways. */
.build-grid{display:grid;grid-template-columns:minmax(0,1fr) 336px;gap:18px;align-items:start}
.build-main,.build-side{min-width:0}
.build-side .sticky{position:sticky;top:88px}

/* ---------- deliverable presets ---------- */
.preset-row{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 16px}
.preset{border:1px dashed var(--line);background:var(--cream);border-radius:100px;
  padding:7px 13px;font:inherit;font-size:.82rem;font-weight:600;color:var(--muted);
  cursor:pointer;transition:all .14s ease}
.preset:hover{border-style:solid;border-color:var(--green);color:var(--green-text);background:#fff}

/* ---------- items table ---------- */
.items-wrap{overflow-x:auto}
.items{width:100%;border-collapse:collapse;min-width:620px}
.items th{text-align:left;font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted);font-weight:700;padding:0 6px 8px;border-bottom:1px solid var(--line)}
.items td{padding:6px 4px;vertical-align:middle}
.items input{margin-top:0}
.ic-sac{width:90px}.ic-qty{width:74px}.ic-rate{width:110px}
.ic-amt{width:110px;text-align:right}.ic-x{width:34px}
.items .i-amt{text-align:right;font-weight:700;font-size:.92rem;white-space:nowrap}
.items .i-qty,.items .i-rate{text-align:right}
.row-x{border:0;background:transparent;color:var(--muted);font-size:1.4rem;line-height:1;
  cursor:pointer;padding:4px 6px;border-radius:8px}
.row-x:hover{color:var(--red);background:var(--cream)}

/* ---------- totals panel ---------- */
.totals{margin:18px 0 4px;border-top:1px solid var(--line);padding-top:12px}
.t-row{display:flex;justify-content:space-between;gap:10px;font-size:.9rem;
  color:var(--muted);padding:4px 0}
.t-row span:last-child{color:var(--ink);font-weight:600;white-space:nowrap}
.t-strong{border-top:1px solid var(--line);margin-top:6px;padding-top:9px;color:var(--ink);font-weight:700}
.t-final{background:var(--cream);margin:10px -10px 0;padding:11px 10px;border-radius:10px;
  font-weight:700;color:var(--forest);font-size:1.02rem}
.t-final span:last-child{color:var(--forest);font-size:1.14rem}
.t-words{font-size:.78rem;color:var(--muted);margin:8px 0 0;font-style:italic}
.t-note{font-size:.8rem;color:var(--green-text);margin:8px 0 0;font-weight:600}

.side-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:16px}
.side-note{font-size:.84rem;color:var(--green-text);margin:10px 0 0;font-weight:600;min-height:1em}
.btn--quiet{border-color:var(--line);color:var(--muted);font-weight:600}
.btn--quiet:hover{background:var(--cream);color:var(--ink);border-color:var(--muted)}
.btn--danger{border-color:var(--red);color:var(--red)}
.btn--danger:hover{background:var(--red);color:#fff;border-color:var(--red)}

/* ---------- preview ---------- */
.preview-card{padding:22px}
.preview-scroll{overflow-x:auto;background:var(--cream);border-radius:12px;padding:18px}

/* ============================ the invoice sheet ============================
   One stylesheet drives the on-screen preview and the printed page, so what a
   creator sees really is what the brand gets. */
.sheet{background:var(--t-paper,#fff);color:var(--t-ink,var(--ink));width:794px;max-width:100%;margin:0 auto;
  padding:40px 42px;font-size:12.5px;line-height:1.45;
  box-shadow:0 8px 30px rgba(6,43,26,.12);border-radius:6px}
.sheet .s-top{display:flex;justify-content:space-between;gap:30px;
  border-bottom:2px solid var(--t-title,var(--forest));padding-bottom:18px}
.s-logo{max-height:52px;width:auto;margin-bottom:8px}
.s-name{font-size:19px;font-weight:700;color:var(--t-title,var(--forest));line-height:1.15}
.s-sub{font-size:12px;color:var(--muted)}
.s-mut{color:var(--t-muted,var(--muted));font-size:11.5px}
.s-fine{color:var(--t-muted,var(--muted));font-size:10.5px;line-height:1.4;margin-top:4px}
.s-meta{text-align:right;flex:none;min-width:210px}
.s-title{font-family:var(--display);font-size:26px;text-transform:uppercase;
  color:var(--t-title,var(--forest));line-height:1;margin-bottom:10px}
.s-meta>div{display:flex;justify-content:flex-end;gap:12px;font-size:11.5px}
.s-meta>div span{color:var(--muted)}
.s-meta>div b{min-width:96px;text-align:right}
.s-mid{display:flex;justify-content:space-between;gap:24px;padding:18px 0}
.s-cap{font-size:9.5px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;
  color:var(--t-cap,var(--green-text));margin:12px 0 4px}
.s-billto .s-cap{margin-top:0}
.s-name2{font-size:15px;font-weight:700;color:var(--t-title,var(--forest))}
.s-attn{margin-top:5px;font-size:11.5px;font-weight:600}
.s-due{flex:none;background:var(--t-panel,var(--cream));border-radius:10px;padding:14px 18px;
  text-align:right;min-width:200px}
.s-due .s-cap{margin:0 0 2px}
.s-big{font-size:24px;font-weight:700;color:var(--t-title,var(--forest));line-height:1.1}
.s-items{width:100%;border-collapse:collapse;margin-top:6px}
.s-items th{background:var(--t-title,var(--forest));color:#fff;font-size:9.5px;letter-spacing:.1em;
  text-transform:uppercase;text-align:left;padding:8px 8px}
.s-items th.r,.s-items td.r{text-align:right}
.s-items td{padding:9px 8px;border-bottom:1px solid var(--t-rule,var(--line));vertical-align:top;font-size:11.5px}
.s-items td strong{font-size:12.5px}
.s-bottom{display:flex;gap:28px;margin-top:20px;align-items:flex-start}
.s-left{flex:1;min-width:0}
.s-right{flex:none;width:290px}
.s-words{font-size:11px;font-style:italic;color:var(--t-ink,var(--ink));
  background:var(--t-panel,var(--cream));padding:8px 10px;border-radius:8px}
.s-pay div{display:flex;gap:10px;font-size:11.5px}
.s-pay span{color:var(--muted);min-width:88px}
.s-tot{width:100%;border-collapse:collapse}
.s-tot td{padding:4px 0;font-size:11.5px;color:var(--muted)}
.s-tot td.r{color:var(--ink);font-weight:600;white-space:nowrap}
.s-tot .s-strong td{border-top:1px solid var(--line);padding-top:8px;color:var(--ink);font-weight:700}
.s-tot .s-final td{background:var(--t-panel,var(--cream));font-weight:700;
  color:var(--t-title,var(--forest));font-size:13.5px;padding:9px 8px}
.s-sign{margin-top:26px;text-align:right}
.s-sign img{max-height:46px;width:auto;margin-left:auto}
.s-signgap{height:34px}
.s-signline{border-top:1px solid var(--line);margin:4px 0 5px}
.s-foot{margin-top:22px;padding-top:10px;border-top:1px solid var(--line);
  font-size:9.5px;color:var(--muted);text-align:center}

/* ---------- dashboard ---------- */
.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.stat-tile{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:18px}
.stat-tile.is-bad{border-color:rgba(228,96,24,.5);background:#FFF8F3}
.stat-k{font-size:.74rem;font-weight:700;letter-spacing:.13em;text-transform:uppercase;
  color:var(--muted)}
.stat-v{font-family:var(--display);font-size:1.9rem;line-height:1.1;color:var(--forest);margin:6px 0 2px}
.stat-tile.is-bad .stat-v{color:var(--rust)}
.stat-n{font-size:.82rem;color:var(--muted)}

.action-centre{border-color:rgba(12,144,108,.4)}
.act{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;
  padding:14px;border:1px solid var(--line);border-radius:12px;margin-bottom:10px;
  background:var(--cream)}
.act-h{font-weight:700}
.act-no{font-weight:400;color:var(--muted);font-size:.86rem}
.act-sub{font-size:.86rem;color:var(--muted)}
.act-btns{display:flex;gap:6px;flex-wrap:wrap}

.bar-row{display:grid;grid-template-columns:104px 1fr 96px;align-items:center;gap:10px;
  margin-bottom:9px;font-size:.85rem}
.bar-k{color:var(--muted)}
.bar-track{background:var(--cream);border-radius:100px;height:12px;overflow:hidden}
.bar-fill{display:block;height:100%;background:var(--green);border-radius:100px}
.bar-fill.is-warn{background:var(--orange)}
.bar-fill.is-bad{background:var(--rust)}
.bar-v{text-align:right;font-weight:700;white-space:nowrap}

.mini-table{width:100%;border-collapse:collapse}
.mini-table td{padding:9px 4px;border-bottom:1px solid var(--line);vertical-align:top;font-size:.92rem}
.mini-table tr:last-child td{border-bottom:0}

.log{list-style:none;margin:0;padding:0;font-size:.88rem}
.log li{padding:7px 0;border-bottom:1px solid var(--line)}
.log li:last-child{border-bottom:0}
.log-d{color:var(--muted);font-size:.8rem;display:inline-block;min-width:82px}

/* ---------- invoice list ---------- */
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{border:1px solid var(--line);background:var(--paper);border-radius:100px;
  padding:8px 15px;font:inherit;font-size:.85rem;font-weight:600;color:var(--muted);cursor:pointer}
.chip.is-on{background:var(--forest);border-color:var(--forest);color:#fff}
.head-tools{display:flex;gap:8px;align-items:center}
.head-tools input{margin-top:0;min-width:220px}

.inv-table{width:100%;border-collapse:collapse;margin-top:14px}
.inv-table th{text-align:left;font-size:.72rem;letter-spacing:.13em;text-transform:uppercase;
  color:var(--muted);padding:0 8px 10px;border-bottom:1px solid var(--line)}
.inv-table th.r{text-align:right}
.inv-table td{padding:12px 8px;border-bottom:1px solid var(--line);font-size:.92rem;vertical-align:top}
.inv-table tr[data-id]{cursor:pointer}
.inv-table tr[data-id]:hover td{background:var(--cream)}

.pill{display:inline-block;padding:4px 11px;border-radius:100px;font-size:.76rem;font-weight:700;
  white-space:nowrap}
.pill.is-draft{background:#EFEDE7;color:var(--muted)}
.pill.is-sent{background:#E6F2ED;color:var(--green-text)}
.pill.is-partial{background:#FDF0DC;color:#8A5A08}
.pill.is-overdue{background:#FBE4DE;color:var(--red)}
.pill.is-paid{background:var(--green);color:#fff}
.pill.is-cancelled{background:#EFEDE7;color:var(--muted);text-decoration:line-through}

/* ---------- clients ---------- */
.client-card{border:1px solid var(--line);border-radius:14px;padding:18px;margin-bottom:12px}
.client-head{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}
.client-name{font-size:1.1rem;font-weight:700;color:var(--forest)}
.client-money{text-align:right;font-size:.95rem}
.poc-row{display:flex;justify-content:space-between;align-items:center;gap:14px;
  flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.poc-links{display:flex;gap:6px;flex-wrap:wrap}
.client-log{margin-top:12px}
.client-log summary{cursor:pointer;font-size:.86rem;font-weight:700;color:var(--green-text)}

/* ---------- setup extras ---------- */
.mini-prev{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:16px}
.mini-prev img{max-height:54px;width:auto;border:1px solid var(--line);border-radius:8px;padding:6px;
  background:#fff}
.mini-prev img.sig{max-height:44px}
.ladder{list-style:none;margin:6px 0 0;padding:0}
.ladder li{display:flex;justify-content:space-between;gap:14px;padding:9px 0;
  border-bottom:1px solid var(--line);font-size:.9rem}
.ladder li:last-child{border-bottom:0}
.ladder span{color:var(--muted);text-align:right}

/* ---------- modal ---------- */
.modal{position:fixed;inset:0;z-index:200;display:flex;align-items:flex-start;
  justify-content:center;padding:5vh 16px}
.modal[hidden]{display:none}
.modal-back{position:absolute;inset:0;background:rgba(6,43,26,.58)}
.modal-box{position:relative;background:var(--paper);border-radius:18px;width:min(720px,100%);
  max-height:90vh;overflow-y:auto;padding:24px;box-shadow:0 30px 70px rgba(6,43,26,.3)}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.modal-x{border:0;background:transparent;font-size:1.8rem;line-height:1;cursor:pointer;
  color:var(--muted);padding:0 4px}
.modal-x:hover{color:var(--ink)}
.modal-open{overflow:hidden}
.m-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}
.m-stat{background:var(--cream);border-radius:10px;padding:11px}
.m-stat span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;
  color:var(--muted);font-weight:700}
.m-stat b{font-size:1.02rem;color:var(--forest)}
.m-line{font-size:.9rem;color:var(--muted);margin:0 0 14px}
.m-acts{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.m-msg{background:var(--cream);border-radius:10px;padding:14px;font-size:.84rem;
  white-space:pre-wrap;word-wrap:break-word;font-family:var(--sans);color:var(--ink);
  max-height:230px;overflow-y:auto;margin:0 0 6px}
.pay-form{display:grid;grid-template-columns:1fr 1fr 1fr 1fr auto;gap:7px;align-items:center;
  margin-top:12px}
.pay-form input,.pay-form select{margin-top:0}

/* ---------- toast ---------- */
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:300;
  background:var(--forest);color:#fff;padding:14px 20px;border-radius:100px;
  font-size:.92rem;font-weight:600;box-shadow:0 14px 34px rgba(6,43,26,.32);
  max-width:calc(100% - 32px);text-align:center}
.toast[hidden]{display:none}

/* ---------- CTA band ---------- */
.tool-cta{background:var(--forest);color:#fff;padding:64px 0}
.tool-cta .h2,.tool-cta .lead{color:#fff}
.tool-cta .lead{max-width:64ch;color:rgba(255,255,255,.86)}
.tool-cta .kicker{color:var(--green-lt)}
.tool-cta .hero-cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}

/* ---------- responsive ---------- */
@media (max-width:1040px){
  .build-grid{grid-template-columns:minmax(0,1fr)}
  .build-side .sticky{position:static}
  .stat-row{grid-template-columns:1fr 1fr}
}
@media (max-width:760px){
  .two-col{grid-template-columns:1fr}
  .fgrid{grid-template-columns:1fr}
  .m-grid{grid-template-columns:1fr 1fr}
  .pay-form{grid-template-columns:1fr 1fr}
  .app-wrap{padding-left:16px;padding-right:16px}
  .card{padding:18px}
  .sheet{padding:24px 20px;font-size:11.5px}
  .sheet .s-top,.s-mid,.s-bottom{flex-direction:column}
  .s-meta,.s-due{text-align:left;min-width:0}
  .s-meta>div{justify-content:flex-start}
  .s-meta>div b{text-align:left}
  .s-right{width:100%}
  .s-sign{text-align:left}
  .s-sign img{margin-left:0}
  .head-tools{width:100%}
  .head-tools input{min-width:0;flex:1}
}
@media (max-width:520px){
  .stat-row{grid-template-columns:1fr}
  .act-btns{width:100%}
}

/* ---------- print ----------
   Only the sheet in #printArea goes to paper. Everything else on the page —
   nav, tabs, the builder — is chrome. */
#printArea{display:none}
@media print{
  body.printing{background:#fff}
  body.printing>*{display:none!important}
  body.printing>#printArea{display:block!important;box-shadow:none;border-radius:0;
    width:auto;max-width:none;padding:0;margin:0}
  body.printing #printArea .s-items th{-webkit-print-color-adjust:exact;print-color-adjust:exact;
    background:#062B1A!important;color:#fff!important}
  body.printing #printArea .s-due,body.printing #printArea .s-words,
  body.printing #printArea .s-tot .s-final td{-webkit-print-color-adjust:exact;
    print-color-adjust:exact;background:#FBF8F2!important}
  body.printing #printArea .s-items tr{break-inside:avoid}
  @page{size:A4;margin:14mm}
}

/* ---------- deliverable links, scan-to-pay and the "block" masthead ---------- */
.s-dl{color:var(--t-accent,var(--green-text));font-size:10.5px;font-weight:600;
  text-decoration:none}
.s-dl:hover{text-decoration:underline}
.s-qr{display:flex;align-items:center;gap:12px;margin-top:14px;padding:10px 12px;
  background:var(--t-panel,var(--cream));border-radius:10px;width:fit-content}
.s-qr svg{display:block;border-radius:4px}
.s-qr span{font-size:9.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--t-cap,var(--green-text));line-height:1.5}
.sheet[data-head="block"] .s-top{background:var(--t-title,var(--forest));color:#fff;
  margin:-40px -42px 0;padding:26px 42px 22px;border-bottom:0}
.sheet[data-head="block"] .s-name,
.sheet[data-head="block"] .s-name+.s-sub,
.sheet[data-head="block"] .s-top .s-mut{color:#fff}
.sheet[data-head="block"] .s-top .s-mut{opacity:.72}
.sheet[data-head="block"] .s-title{color:var(--t-accent,var(--orange))}
.sheet[data-head="block"] .s-meta>div b{color:#fff}
.sheet[data-head="block"] .s-meta>div span{color:rgba(255,255,255,.66)}
.sheet[data-head="plain"] .s-top{border-bottom-width:1px}
@media (max-width:760px){
  .sheet[data-head="block"] .s-top{margin:-24px -20px 0;padding:20px}
}

/* ---------- theme picker ---------- */
.theme-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:6px 0 16px}
.theme-card{border:2px solid var(--line);background:var(--paper);border-radius:12px;
  padding:8px;font:inherit;font-size:.78rem;font-weight:700;cursor:pointer;text-align:center}
.theme-card.is-on{border-color:var(--green);box-shadow:0 0 0 3px rgba(12,144,108,.14)}
.theme-card b{display:block;margin-top:7px;font-weight:700}
.theme-prev{display:block;border:1px solid;border-radius:7px;overflow:hidden;
  padding:0 0 8px;position:relative;height:56px}
.theme-band{display:block;height:15px}
.theme-line{display:block;height:3px;border-radius:2px;margin:7px 8px 0}
.theme-line.short{width:46%}
.theme-amt{display:block;height:9px;width:38%;border-radius:2px;margin:8px 8px 0 auto}
.accent-pick{display:flex;gap:8px;align-items:center;margin-top:5px}
.accent-pick input[type="color"]{width:52px;height:42px;padding:3px;margin:0;flex:none;
  border-radius:10px;cursor:pointer}
@media (max-width:520px){.theme-row{grid-template-columns:1fr 1fr}}

/* ---------- draggable line items ---------- */
.items tr[draggable="true"]{cursor:grab}
.items tr.dragging{opacity:.45}
.grip{color:var(--line);font-size:1rem;line-height:1;margin-right:4px;cursor:grab;
  user-select:none;vertical-align:middle}
.items .i-url{margin-top:5px;font-size:.82rem;padding:7px 10px;color:var(--muted)}
.nav-acct{margin-left:0}
.sub-h[hidden]{display:none}

/* ---------- the always-there new-invoice button ----------
   Sits above the page but under the modal and the toast, and gets out of the
   way on paper. Never shown on the sign-in gate, where there is no profile to
   file an invoice under. */
.fab{position:fixed;right:24px;bottom:24px;z-index:150;
  display:inline-flex;align-items:center;gap:9px;
  background:var(--orange);color:var(--forest);border:2px solid var(--orange);
  font:inherit;font-weight:700;font-size:1rem;padding:15px 24px;border-radius:100px;
  cursor:pointer;box-shadow:0 12px 30px rgba(6,43,26,.28);
  transition:transform .16s ease,background .16s ease,box-shadow .16s ease}
.fab:hover{background:var(--rust);border-color:var(--rust);color:#fff;
  transform:translateY(-2px);box-shadow:0 16px 36px rgba(6,43,26,.34)}
.fab[hidden]{display:none}
.fab-plus{font-size:1.32rem;line-height:1;margin-top:-2px}
@media (prefers-reduced-motion:reduce){.fab{transition:none}.fab:hover{transform:none}}
@media (max-width:560px){
  .fab{right:16px;bottom:16px;padding:15px 18px}
  .fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .fab-plus{font-size:1.5rem;margin:0}
}
.modal-open .fab{display:none}
@media print{.fab{display:none!important}}

/* the toast is centred; on narrow screens it would sit under the FAB */
@media (max-width:560px){.toast{bottom:92px}}
