:root {
  --ink: #1b1f24; --muted: #5b6573; --line: #d9dee5; --bg: #f5f7fa; --card: #fff;
  --brand: #1F4E79; --brand-2: #2a6aa3; --ok: #1f7a3f; --warn: #a15c00; --bad: #b42318;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; display: flex; gap: 8px; align-items: center; font-size: 18px; }
.logo { background: #fff; color: var(--brand); border-radius: 6px; padding: 2px 6px; font-size: 13px; }
.badge { font-size: 11px; font-weight: 600; border: 1px solid #ffffff88; border-radius: 99px; padding: 1px 8px; }
.top .ghost { color: #fff; border-color: #ffffff55; }

.layout { display: grid; grid-template-columns: minmax(320px, 1fr) 420px; gap: 24px; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.panel.left { display: flex; flex-direction: column; gap: 12px; }
.h { font-weight: 650; font-size: 17px; }
textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
select { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; flex: 1; min-width: 180px; }
button.primary { background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; cursor: pointer; }
button.primary:disabled { opacity: .55; cursor: progress; }
button.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
button.ghost:disabled { opacity: .45; }
.status { min-height: 1.3em; color: var(--muted); font-size: 14px; }
.status.err { color: var(--bad); }
.summary { background: #eef4fa; border: 1px solid #cfe0f0; border-radius: 10px; padding: 12px; font-size: 15px; line-height: 1.45; }
.icon-box { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.icon-box img { border-radius: 18px; flex: none; box-shadow: 0 1px 4px #0002; }
.icon-controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.h.small { font-size: 15px; }
.file-btn { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #fff; }
.bg-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.bg-pick input { width: 36px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; }
button.buy { background: #b7791f; color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; cursor: pointer; }
.buy-dialog { width: min(560px, 94vw); }
.buy-dialog label { display: block; margin-top: 10px; font-weight: 600; font-size: 14px; }
.buy-dialog label input { font-weight: 400; }
.pay-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0; }
.pay-row img { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.price { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.gst-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px 12px; }
.gst-box legend { font-size: 14px; font-weight: 600; color: var(--brand); padding: 0 4px; }
.buy-dialog textarea { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; resize: vertical; }
.buy-dialog .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
@media (max-width: 520px) { .buy-dialog .two { grid-template-columns: 1fr; } }
.buy-dialog label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 12px; }
.buy-dialog label.check input { width: auto; margin: 0; }
.buy-dialog select { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; background: #fff; }
.ref { margin-top: 8px; font-size: 15px; }
.ref b { font-family: ui-monospace, monospace; background: #fff6e0; padding: 2px 6px; border-radius: 4px; }
.primary-link { display: inline-block; margin-top: 10px; background: var(--brand); color: #fff; padding: 9px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.note.trial.full { color: var(--ok); background: #e9f7ef; border-color: #b7e2c6; }
.label-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.label-box code, .print-dialog code { background: #f1f3f6; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted-inline { color: var(--muted); font-size: 13px; font-weight: 400; }
.lbl-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.lbl-head { align-items: center; }
.lbl-head .lbl-name { flex: 1; min-width: 140px; font-weight: 600; }
.lbl-card input, .lbl-card select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.lbl-card select { flex: 1; min-width: 0; }
table.map { width: 100%; border-collapse: collapse; font-size: 14px; }
table.map td, table.map th { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.map th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.map select, table.map input { width: 100%; }
table.map input { margin-top: 4px; }
.lbl-where { display: flex; flex-direction: column; gap: 6px; }
.att { font-size: 14px; }
button.link { background: none; border: 0; color: var(--bad); cursor: pointer; padding: 0 4px; font-size: 13px; }
pre.prn { background: #f6f7f9; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.small-btn { align-self: flex-start; padding: 6px 10px !important; font-size: 13px; }
.print-dialog { width: min(620px, 94vw); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.note.trial { color: #7a4b00; background: #fff6e0; border: 1px solid #f3d9a4; border-radius: 8px; padding: 8px 10px; }
.note.trial:empty { display: none; }
.note.center { text-align: center; margin-top: 10px; }
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
pre { max-height: 360px; overflow: auto; font-size: 12px; }
dialog { border: 0; border-radius: 14px; padding: 20px; width: min(420px, 92vw); }
dialog input { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; }
menu { display: flex; justify-content: flex-end; padding: 0; margin: 12px 0 0; }
.foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 28px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 90vw; z-index: 10; }

/* ---------- phone preview ---------- */
.phone { width: 380px; max-width: 100%; height: 760px; margin: 0 auto; border: 10px solid #1d1d1f; border-radius: 36px; background: #fff; overflow: hidden; box-shadow: 0 10px 30px #0002; }
@media (max-width: 860px) { .phone { height: 680px; } }
.app { --primary: #6750a4; height: 100%; display: flex; flex-direction: column; background: #fdf8fd; color: #1d1b20; font-size: 15px; }
.app .placeholder { margin: auto; color: var(--muted); padding: 24px; text-align: center; }
.appbar { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-size: 21px; }
.appbar .icon { border: 0; background: none; font-size: 22px; cursor: pointer; padding: 0 4px; }
.appbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen { flex: 1; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.tabs { display: flex; background: #f3edf7; padding: 8px 4px 10px; }
.tab { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; cursor: pointer; color: #49454f; }
.tab-icon { font-size: 18px; padding: 2px 18px; border-radius: 99px; }
.tab.on { color: #1d1b20; font-weight: 600; }
.tab.on .tab-icon { background: color-mix(in srgb, var(--primary) 18%, white); }
.t-title { font-size: 22px; }
.t-caption { font-size: 13px; color: #49454f; }
.btn { background: var(--primary); color: #fff; border: 0; border-radius: 99px; padding: 12px; font-weight: 600; cursor: pointer; width: 100%; }
.btn.outline { background: none; color: var(--primary); border: 1px solid #79747e; }
.btn.small { width: auto; padding: 6px 14px; }
.field-wrap { display: flex; align-items: center; border: 1px solid #79747e; border-radius: 6px; background: #fff; }
.field-wrap .lead { padding: 0 4px 0 12px; color: #49454f; }
.field-wrap .field { border: 0; outline: none; }
.field-wrap:focus-within { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.field { width: 100%; padding: 13px 12px; border: 1px solid #79747e; border-radius: 6px; background: #fff; outline-color: var(--primary); }
.list { display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; align-items: center; gap: 12px; background: #ece6f0; border-radius: 12px; padding: 12px 16px; }
.card.tap { cursor: pointer; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 600; }
.card-sub { font-size: 13px; color: #49454f; }
.card-right { font-size: 16px; white-space: nowrap; }
.group { display: flex; justify-content: space-between; padding: 8px 0 4px; border-bottom: 1px solid #cac4d0; font-size: 16px; }
.group span { color: var(--primary); }
.empty { color: #49454f; }
.form { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 13px; color: #49454f; font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid #79747e; background: none; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.chip.on { background: color-mix(in srgb, var(--primary) 18%, white); border-color: transparent; font-weight: 600; }
.switch-row { display: flex; justify-content: space-between; align-items: center; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-head { display: flex; justify-content: space-between; }
.bar { height: 12px; border-radius: 6px; background: var(--primary); }
.row .grow, .grow { flex: 1; }
.app .row { align-items: center; }
.count { min-width: 40px; text-align: center; font-size: 20px; }
.emoji { font-size: 48px; }
.detail { padding: 4px 0; }
.appbar .spacer { flex: 1; }
.set-title { color: var(--primary); font-size: 13px; font-weight: 600; margin-top: 14px; padding-bottom: 4px; border-bottom: 1px solid #cac4d0; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: default; }
.set-row .grow div:last-child { font-size: 12px; color: #49454f; }
.set-row.danger { color: #b3261e; cursor: pointer; }
