/* sender app */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.4rem; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; gap: .2rem; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: .4rem .75rem; border-radius: 8px; }
.topbar nav a.on, .topbar nav a:hover { color: var(--ink); background: var(--line-2); }
.trial-pill { font-size: 11.5px; font-weight: 600; color: #a23a22; background: var(--amber-soft); border: 1px solid #ffd2c4; padding: .2rem .6rem; border-radius: 999px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; cursor: pointer; border: 0; }
.main { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: radial-gradient(1200px 600px at -10% -10%, rgba(255, 107, 74, .22) 0%, transparent 60%), linear-gradient(160deg, #1f2a44, #172036 60%, #1f2a44); color: #e2e8f0; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .sl-word { color: #fff; } .auth-art .sl-word b { color: var(--mint); }
.auth-art h2 { font-size: 34px; line-height: 1.15; color: #fff; max-width: 15ch; letter-spacing: -.02em; }
.auth-art h2 em { font-style: normal; color: var(--mint); }
.auth-art ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; color: #cbd5e1; }
.auth-art li::before { content: '✓'; color: var(--mint); font-weight: 800; margin-right: .6rem; }
.auth-form { display: grid; place-items: center; padding: 2rem 1.2rem; background: #fff; }
.auth-form form { width: min(380px, 100%); }
.auth-form h1 { font-size: 26px; margin-bottom: .3rem; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.2rem; }
.kpi { padding: .9rem 1rem; cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: #b8c4d4; transform: translateY(-1px); }
.kpi .n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi.on { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(232, 85, 58, .14); }
.list-tools { display: flex; gap: .6rem; align-items: center; padding: .75rem .9rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-tools input { max-width: 300px; }
table.env { width: 100%; border-collapse: collapse; }
table.env th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
table.env td { padding: .75rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.env tr.click { cursor: pointer; } table.env tr.click:hover td { background: #fafbfd; }
.env-title b { display: block; font-size: 14px; } .env-title span { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .12rem .55rem .12rem .4rem; }
.chip .dot { width: 8px; height: 8px; }
.chip.signed { background: var(--green-soft); border-color: #bfe5cd; } .chip.needs_fix { background: var(--amber-soft); border-color: #fde68a; } .chip.declined { background: var(--red-soft); border-color: #f8c4c4; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } table.env .hide-sm { display: none; } .topbar nav { display: none; } }

/* editor */
.editor { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 53px); }
.ed-side { border-right: 1px solid var(--line); background: #fff; overflow: auto; padding: 1rem 1rem 6rem; }
.ed-side h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 1.1rem 0 .5rem; }
.ed-main { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.ed-toolbar { display: flex; gap: .5rem; align-items: center; padding: .55rem .9rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.palette button { display: flex; align-items: center; gap: .45rem; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: .5rem .6rem; cursor: pointer; font-weight: 600; font-size: 13px; text-align: left; }
.palette button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); }
.palette button i { font-style: normal; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, #fff); color: var(--c); font-size: 12px; }
.signer-row { display: grid; grid-template-columns: 12px 1fr auto; gap: .55rem; align-items: start; padding: .6rem; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: .45rem; cursor: pointer; background: #fff; }
.signer-row.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 14%, transparent); }
.signer-row .dot { margin-top: .45rem; background: var(--c); }
.signer-row .fields-n { font-size: 11.5px; color: var(--muted); }
.signer-edit { display: grid; gap: .4rem; margin-top: .45rem; }
.signer-edit input { padding: .4rem .55rem; font-size: 13px; }
.ai-banner { border-radius: 12px; padding: .7rem .8rem; font-size: 12.8px; background: var(--paper); border: 1px solid var(--line); }
.ai-banner.ok { background: linear-gradient(135deg, #ecfdf8, #f0f9ff); border-color: #bde9df; }
.ai-banner.warn { background: var(--amber-soft); border-color: #fde68a; }
.fld.ed { cursor: move; }
.fld.ed.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); z-index: 5; }
.fld.ed .x { position: absolute; right: -1px; top: -1px; width: 16px; height: 16px; border-radius: 0 3px 0 6px; background: var(--c); color: #fff; font-size: 10px; display: none; place-items: center; cursor: pointer; }
.fld.ed:hover .x, .fld.ed.sel .x { display: grid; }
.fld.ed .rs { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--c) 50%); }
.pdf-layer.placing { cursor: copy; }
.drop { border: 2px dashed #b6c3d4; border-radius: 18px; background: #fff; padding: 3rem 1.5rem; text-align: center; cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--teal-2); background: var(--teal-soft); }
.drop .big { font-size: 42px; }
.file-list { display: grid; gap: .4rem; margin-top: 1rem; text-align: left; }
.file-list div { display: flex; align-items: center; gap: .5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; font-size: 13px; }
.check-list { display: grid; gap: .45rem; }
.check-list div { display: flex; gap: .55rem; align-items: flex-start; font-size: 13.5px; padding: .55rem .7rem; border-radius: 10px; background: var(--paper); }
.check-list .bad { background: var(--red-soft); } .check-list .warn { background: var(--amber-soft); } .check-list .ok { background: var(--green-soft); }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; height: auto; } .ed-side { border-right: 0; padding-bottom: 1rem; } .ed-main .pdf-scroll { height: 70vh; } }

/* detail */
.detail { display: grid; grid-template-columns: 380px 1fr; gap: 1.2rem; align-items: start; }
.detail .pdf-scroll { height: calc(100vh - 190px); border-radius: var(--r); border: 1px solid var(--line); }
.signer-card { padding: .9rem 1rem; border-left: 4px solid var(--c); }
.signer-card + .signer-card { margin-top: .6rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.2rem; font-size: 12.8px; }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal-2); }
.timeline li::after { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--faint); font-size: 11.5px; }
@media (max-width: 980px) { .detail { grid-template-columns: 1fr; } }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }

/* account notices under the top bar: confirm e-mail, trial ending / ended, team bigger than the plan */
.trial-pill { text-decoration: none; }
.trial-pill.ended { color: #991b1b; background: var(--red-soft); border-color: #fecaca; }
.app-notes { max-width: 1180px; margin: .8rem auto 0; padding: 0 1.4rem; display: grid; gap: .5rem; }
.app-note { display: flex; align-items: center; gap: .8rem; font-size: 13px; border-radius: 10px; padding: .55rem .8rem; border: 1px solid #fde68a; background: var(--amber-soft); color: #7c4a03; }
.app-note.bad { border-color: #fecaca; background: var(--red-soft); color: #991b1b; }
table.plans { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plans th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
table.plans td { padding: .45rem .4rem; border-bottom: 1px solid var(--line-2); }
table.plans tr.on td { background: var(--teal-soft); }
@media (max-width: 640px) { .app-notes { padding: 0 .8rem; } .app-note { flex-wrap: wrap; } }
.bill { background: var(--paper); border-radius: 10px; padding: .6rem .75rem; display: grid; gap: .25rem; }

/* brand tagline under the logo (brand kit: "Clear steps. Smoother signing."): the two phrases rise in turn, then a coral line draws under the second; plays once */
.auth-art .sl-logo { height: 34px; }
.sl-tagline { margin-top: .7rem; font-size: 15px; font-weight: 500; letter-spacing: .01em; color: rgba(255, 255, 255, .78); }
.sl-tagline span { display: inline-block; opacity: 0; transform: translateY(6px); animation: tagIn .6s cubic-bezier(.2, .7, .2, 1) .15s forwards; }
.sl-tagline span + span { position: relative; animation-delay: .7s; color: #fff; }
.sl-tagline span + span::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; background: var(--amber); transform: scaleX(0); transform-origin: left; animation: tagLine .7s cubic-bezier(.2, .7, .2, 1) 1.3s forwards; }
@keyframes tagIn { to { opacity: 1; transform: none; } }
@keyframes tagLine { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .sl-tagline span { animation: none; opacity: 1; transform: none; }
  .sl-tagline span + span::after { animation: none; transform: scaleX(1); }
}

/* invoices (public/app/bills.js) */
.bill-new { max-width: 980px; }
.magic { background: linear-gradient(135deg, #fff, #fff4ef); border-color: #ffd9cc; }
.magic label { font-size: 15px; color: var(--ink); }
.magic textarea { font-size: 15.5px; line-height: 1.5; resize: vertical; min-height: 84px; }
.examples { display: flex; flex-wrap: wrap; gap: .35rem; }
.examples .ex { border: 1px dashed #f3b9a8; background: #fff; color: var(--ink-2); border-radius: 999px; padding: .2rem .65rem; font-size: 12px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.examples .ex:hover { border-style: solid; background: var(--teal-soft); }
.draft .lbl, .bill-settings .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; margin: 1rem 0 .4rem; }
.draft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin-top: .8rem; }
.draft-grid textarea, .bill-settings textarea { resize: vertical; }
.lines { display: grid; gap: .45rem; margin-bottom: .45rem; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 92px 32px; gap: .45rem; align-items: start; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.line .line-desc { display: grid; gap: .3rem; }
.line .amt { padding-top: .55rem; text-align: right; font-weight: 700; font-size: 13.5px; }
.line .zh-box { font-size: 13px; padding: .4rem .6rem; background: var(--paper); }
.lang-en .zh-box:placeholder-shown, .lang-en .zh-only:placeholder-shown { display: none; }   /* an English invoice: the Chinese boxes only when they have text */
.draft input[type=number], .bill-settings input[type=number] { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .55rem .6rem; background: #fff; }
.lang-zh .en-box { order: 2; font-size: 13px; padding: .4rem .6rem; background: var(--paper); }
.lang-zh .zh-box { font-size: 14.5px; padding: .55rem .7rem; background: #fff; }
.draft input.need, .draft .need, .draft input[type=number].need { border-color: #f59e0b !important; background: #fffbeb !important; }
.draft input.mt { border-color: #93c5fd; }
.total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: .8rem; padding: .5rem .6rem; border-top: 1px dashed var(--line); margin-top: .3rem; }
.total-row b { font-size: 24px; letter-spacing: -.02em; }
.chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .2rem .7rem; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.chip-btn.on, .chip-btn:hover { border-color: var(--teal-2); background: var(--teal-soft); color: var(--teal); }
.opts { display: grid; gap: .5rem; margin-top: 1rem; }
.opt { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; cursor: pointer; }
.opt input { width: auto; margin-top: .2rem; accent-color: var(--teal); }
.opt b { font-size: 13.5px; } .opt .tiny { display: block; margin-top: .1rem; }
.proof-card { border-left: 4px solid #f59e0b; }
.proofs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.proofs a { display: inline-flex; align-items: center; font-size: 12.5px; }
.proofs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
[data-bill-settings] { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .draft-grid { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr 1fr 32px; }
  .line .line-desc { grid-column: 1 / -1; } .line .amt { display: none; }
}
/* one-tap send buttons for an invoice link (bills.js shareBar) */
.share-bar { display: flex; flex-wrap: wrap; gap: .4rem; }
.share { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .4rem .85rem; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.share::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.share.wa { color: #128c4b; border-color: #b6ecc9; background: #f0fbf4; } .share.wx { color: #07a35a; border-color: #bfe9d2; background: #f1fbf6; }
.share.sms { color: var(--blue); border-color: #cfdcfb; background: var(--blue-soft); } .share.mail, .share.more { color: var(--ink-2); }
.share:hover { filter: brightness(.97); }
/* guided one-sentence invoice: templates above the box, what was recognized below it (bills.js compose) */
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .55rem; }
.tpl { border: 1px solid #f3c7b8; background: #fff; color: var(--ink); border-radius: 999px; padding: .22rem .7rem; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tpl:hover { background: var(--teal-soft); border-color: var(--teal-2); }
.tpl.own { border-style: dashed; color: var(--ink-2); font-weight: 500; }
.guide { display: grid; gap: .25rem; margin-top: .55rem; }
.guide:empty { display: none; }
.guide .g { display: flex; align-items: baseline; gap: .45rem; font-size: 13px; color: var(--ink-2); }
.guide .g i { font-style: normal; width: 18px; height: 18px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; transform: translateY(2px); }
.guide .g-ok i { background: var(--green-soft); color: var(--green); }
.guide .g-need { color: #92400e; } .guide .g-need i { background: #fef3c7; color: #b45309; }
.guide .g-opt { color: var(--muted); } .guide .g-opt i { background: var(--line-2); color: var(--faint); }
