/* Billing Desk upgrade: fattah.info brand + new components */
:root { --gold: #C8873A; --gold-ink: #8a4a12; --pale: #f3eaf8; --deep: #3a1a52; --brand: #6B2D8B; }
body { font-family: var(--font); color: var(--fg); }
.head h2 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 700; letter-spacing: -.01em; line-height: 1.18; }
.head h2 em { font-weight: 400; color: var(--brand); }
.box h3 { font-size: 21px; font-weight: 700; }
.tile .v { font-size: 32px; font-weight: 700; color: var(--deep); }
.brand h1 { font-size: 26px; font-weight: 700; }
.lede, .list span.d, .note, .src { color: #3d2860; }
.head .eyebrow { color: #972288; font-weight: 900; font-size: 11px; }
.tile .k, th { font-size: 11px; }
.tab { font-size: 13px; }
table { font-size: 13px; }

/* search */
.find { position: relative; }
.find-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--gold); padding: 0 14px; min-height: 52px; }
.find-box svg { flex: none; }
.find-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px var(--font); color: var(--fg); padding: 12px 0; }
.find-box .hint { font-size: 12px; color: #62507a; white-space: nowrap; }
.find-res { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(58,26,82,.22); max-height: min(70vh, 560px); overflow: auto; color: var(--fg); }
.find-res .fr-head { padding: 9px 16px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #62507a; border-bottom: 1px solid var(--line); }
.fr-row { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--pale); }
.fr-row:hover { background: var(--pale); }
.fr-row b { display: block; font-size: 14px; }
.fr-row span.d { display: block; font-size: 12px; color: #62507a; }
.fr-go { font-size: 13px; font-weight: 700; color: var(--brand); background: none; border: 0; cursor: pointer; padding: 8px 4px; white-space: nowrap; font-family: var(--font); }
.fr-empty { padding: 16px; font-size: 14px; color: #3d2860; }
@media (max-width: 620px) {
  .find-box .hint { display: none; }
  .fr-row { grid-template-columns: 1fr; gap: 6px; }
}

/* copy anywhere */
.cp { cursor: pointer; border: 1px dashed transparent; border-bottom-color: rgba(107,45,139,.45); padding: 0 2px; border-radius: 2px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); white-space: nowrap; transition: background .15s; }
.cp::after { content: ""; width: 12px; height: 12px; flex: none; opacity: .55; background: no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B2D8B' stroke-width='2.4'%3E%3Crect x='9' y='9' width='11' height='11' rx='1'/%3E%3Cpath d='M5 15V5h10'/%3E%3C/svg%3E"); }
.cp:hover, .cp:focus-visible { background: var(--pale); border-color: var(--brand); }
.cp:hover::after { opacity: 1; }
.cp.done { background: #e6f2ea; border-color: #2E7D4F; }
.chip-code { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--brand); background: #fff; color: var(--deep); font: 700 14px var(--mono); padding: 7px 10px; cursor: pointer; white-space: nowrap; }
.chip-code:hover { background: var(--pale); }
.result .big { cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #1a0a2e; color: #fff; padding: 12px 18px; font-size: 14px; z-index: 90; transition: opacity .2s, transform .2s; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-family: var(--mono); color: #F2C894; }

/* update banner */
.whatsnew { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--brand); padding: 16px 20px; margin-bottom: 26px; }
.whatsnew .tag { background: var(--brand); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .12em; padding: 5px 9px; }
.whatsnew .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.whatsnew .body > b { font-size: 15px; }
.whatsnew .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.whatsnew .pills button { background: var(--pale); border: 0; padding: 7px 10px; font: 400 13px var(--font); color: var(--fg); cursor: pointer; text-align: left; }
.whatsnew .pills button:hover { background: #e7d6f1; }

/* start here */
.start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .start { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .start { grid-template-columns: 1fr; } }
.start button { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: #fff; border: 1px solid var(--line); padding: 16px; cursor: pointer; font-family: var(--font); color: var(--fg); min-height: 44px; transition: border-color .15s, box-shadow .15s; }
.start button:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(58,26,82,.1); }
.start .n { font: 700 13px var(--mono); color: var(--gold); padding-top: 2px; }
.start b { display: block; font-size: 15px; }
.start span.d { display: block; font-size: 13px; color: #62507a; margin-top: 2px; }

/* how-to steps */
.howto { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 4px 0 0; padding: 10px 14px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: #3d2860; counter-reset: s; }
.howto li { counter-increment: s; display: flex; gap: 8px; align-items: baseline; }
.howto li::before { content: counter(s); font: 700 12px var(--mono); color: #fff; background: var(--brand); width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; }

.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.mt { margin-top: 16px; }

/* copy format switch */
.cpfmt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: 12px; color: #E4D6EE; }
.cpfmt button { background: transparent; color: #E4D6EE; border: 1px solid #8f7aa6; padding: 6px 10px; font: 400 12px var(--font); cursor: pointer; min-height: 34px; }
.cpfmt button[aria-pressed="true"] { background: #fff; color: var(--deep); border-color: #fff; font-weight: 700; }
.cpfmt .ex { font-family: var(--mono); opacity: .75; margin-left: 4px; }
@media (max-width: 620px) { .cpfmt .ex { display: none; } }

/* separate copy buttons */
.cpbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.cpbig { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 12px; background: #fff; border: 1px solid var(--brand); color: var(--deep); cursor: pointer; text-align: left; font-family: var(--font); }
.cpbig span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); display: inline-flex; align-items: center; gap: 5px; }
.cpbig span::after { content: ""; width: 12px; height: 12px; background: no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B2D8B' stroke-width='2.4'%3E%3Crect x='9' y='9' width='11' height='11' rx='1'/%3E%3Cpath d='M5 15V5h10'/%3E%3C/svg%3E"); }
.cpbig b { font: 700 18px var(--mono); }
.cpbig:hover { background: var(--pale); }
.cpbig.done { background: #e6f2ea; border-color: #2E7D4F; }
@media (max-width: 420px) { .cpbtns { grid-template-columns: 1fr 1fr; } .cpbtns .cpbig:first-child { grid-column: 1 / -1; } }

/* forms */
.forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .forms { grid-template-columns: 1fr; } }
.formcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: #fff; border: 1px solid var(--line); color: var(--fg); text-decoration: none; text-align: left; font-family: var(--font); cursor: pointer; }
.formcard:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(58,26,82,.1); }
.formcard b { font-size: 15px; }
.formcard .d { font-size: 13px; color: #3d2860; line-height: 1.5; }
.formcard .go { font-size: 13px; font-weight: 700; color: var(--brand); margin-top: auto; }

/* print sheet */
#printSheet { display: none; }
@media print {
  body.printing > *:not(main), body.printing main > *:not(#printSheet) { display: none !important; }
  body.printing main { padding: 0 !important; max-width: none !important; }
  body.printing #printSheet { display: block !important; color: #000; font: 10pt/1.35 var(--font); }
  #printSheet .ps-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #3a1a52; padding-bottom: 6px; margin-bottom: 8px; font-size: 9pt; }
  #printSheet .ps-head b { display: block; font: 700 16pt var(--serif); color: #3a1a52; }
  #printSheet h3 { font: 700 11pt var(--font); color: #3a1a52; margin: 10px 0 4px; break-after: avoid; }
  #printSheet table { width: 100%; border-collapse: collapse; font-size: 9pt; break-inside: auto; }
  #printSheet table.half { width: 60%; }
  #printSheet th { text-align: left; background: #f3eaf8 !important; padding: 3px 6px; font-size: 8pt; text-transform: uppercase; letter-spacing: .04em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printSheet td { padding: 3px 6px; border-bottom: 0.5pt solid #ccc; vertical-align: top; }
  #printSheet tr { break-inside: avoid; }
  #printSheet .m { font-family: var(--mono); white-space: nowrap; }
  #printSheet .s { font-size: 8pt; }
  #printSheet .ps-note, #printSheet .ps-foot { font-size: 8.5pt; margin-top: 8px; }
  @page { margin: 12mm; }
}
@media (max-width: 560px) { .whatsnew { flex-direction: column; gap: 10px; padding: 14px 16px; } }
@media print { #printSheet .cp { border: 0; padding: 0; } #printSheet .cp::after { display: none; } }
