/* Start screen */
.boot-overlay{display:none;position:fixed;inset:0;z-index:1000;background:#f6f7f9;align-items:center;justify-content:center;flex-direction:column;color:#243449}
body.booting .boot-overlay{display:flex}
.boot-mark{width:83px;height:83px;border-radius:19px;background:linear-gradient(145deg,#78ad27,#b4d769);color:white;font-size:55px;line-height:83px;text-align:center;font-weight:900;box-shadow:0 20px 42px #46632d29}
.boot-name{font-size:39px;font-weight:800;letter-spacing:9px;margin:18px 0 1px;padding-left:9px}
.boot-subtitle{font-size:12px;letter-spacing:2px;color:#738094;text-transform:uppercase}
.boot-loader{width:190px;height:3px;background:#dae2da;margin-top:48px;overflow:hidden;border-radius:5px}
.boot-loader:after{content:"";display:block;width:42%;height:100%;background:#89b637;animation:boot-sweep 1.35s ease-in-out infinite}
@keyframes boot-sweep{from{transform:translateX(-100%)}to{transform:translateX(345%)}}
body.gallery-mode .top,body.gallery-mode .app{display:none!important}
.template-home{display:none;flex:1;min-height:0;background:#f4f6f8;color:#263243}
body.gallery-mode .template-home{display:flex}
.home-rail{width:208px;flex:none;background:#293547;color:#d6deea;display:flex;flex-direction:column;padding:28px 14px}
.home-rail-brand{display:flex;gap:11px;align-items:center;color:#fff;font-size:19px;letter-spacing:2px;margin:0 12px 40px}
.rail-mark{display:inline-grid;place-items:center;width:35px;height:35px;border-radius:9px;background:#89b637;color:#fff;font-size:24px;font-weight:900;letter-spacing:0}
.rail-link{display:flex;align-items:center;gap:13px;width:100%;border:0;border-radius:9px;background:transparent;color:#d6deea;text-align:left;padding:12px 14px;font-size:14px}
.rail-link.active,.rail-link:hover{background:#3d4b61;color:#fff}
.rail-bottom{margin:auto 12px 0;color:#e5ebf3;font-size:13px;font-weight:700}.rail-bottom small{font-size:11px;color:#aab6c7;font-weight:400}
.home-content{min-width:0;flex:1;overflow:auto;padding:47px clamp(24px,4vw,68px) 50px;scrollbar-width:thin}
.home-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:0 0 35px;max-width:1560px}
.home-eyebrow{color:#6e902f;font-size:11px;font-weight:800;letter-spacing:2.4px}
.home-head h1{font-size:clamp(32px,3vw,45px);line-height:1.1;letter-spacing:-1.6px;margin:10px 0 12px}
.home-head p{margin:0;color:#657287;font-size:14px;max-width:650px}
.home-current{white-space:nowrap;padding:11px 15px;background:#fff;border:1px solid #d5dfe8;border-radius:9px;color:#293547;font-weight:700;box-shadow:0 3px 12px #2935470a}
.home-current span{font-size:17px;margin-left:10px;color:#7daa33}
.home-toolbar{display:flex;align-items:center;justify-content:space-between;max-width:1560px;margin-bottom:22px;color:#718096;font-size:12px;font-weight:700}
.home-search{display:flex;align-items:center;gap:10px;width:min(440px,70%);padding:0 12px;border:1px solid #d4dde6;border-radius:8px;background:#fff;color:#8390a3;font-size:22px}
.home-search input[type=search]{border:0;box-shadow:none;padding:11px 0;background:transparent;font-size:13px}
.template-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:26px 22px;max-width:1560px}
.template-card{display:block;min-width:0;padding:10px 10px 0;text-align:left;background:#fff;border:1px solid #e0e6eb;border-radius:13px;box-shadow:0 7px 20px #26384c0b;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;overflow:hidden}
.template-card:hover,.template-card:focus-visible{transform:translateY(-3px);border-color:#89b637;box-shadow:0 12px 28px #26384c20;outline:none}
.template-card.selected{border-color:#89b637;box-shadow:0 0 0 2px #89b63755,0 7px 20px #26384c0b}
.card-page{display:flex;position:relative;flex-direction:column;width:100%;aspect-ratio:210/297;background:#fff;box-shadow:0 0 0 1px #e7ebf0;overflow:hidden;color:#2c3440;padding:0 8% 5%;font-family:Arial,sans-serif}
.template-photo{position:absolute;inset:0;z-index:5;width:100%;height:100%;object-fit:contain;background:#fff;display:block}
.template-photo[hidden]{display:none}
.mini-header{display:flex;justify-content:space-between;align-items:start;min-height:27%;padding-top:10%;position:relative}
.mini-logo{font-size:clamp(7px,.76vw,12px);font-weight:900;letter-spacing:.3px;line-height:1.2;z-index:1}
.mini-invoice{font-size:clamp(10px,1.3vw,21px);letter-spacing:1px;font-weight:900;color:var(--mini-accent);z-index:1}
.mini-meta{display:flex;justify-content:space-between;gap:5%;padding:6% 0 9%;font-size:clamp(5px,.48vw,8px);line-height:1.9}
.mini-meta>span{display:flex;flex-direction:column}.mini-meta b{color:var(--mini-accent);font-size:1.2em}.mini-meta i,.mini-table i,.mini-lines i{font-style:normal}
.mini-table{display:block}.mini-table>span{display:grid;grid-template-columns:1fr 15% 25%;padding:4% 3%;font-size:clamp(4px,.48vw,8px);align-items:center;border-bottom:1px solid #e8ebef}.mini-table>span i:last-child{text-align:right}
.mini-table .mini-table-head{background:var(--mini-dark);color:white;font-weight:700;border:0}
.mini-bottom{display:flex;justify-content:space-between;align-items:end;gap:8%;margin-top:8%;font-size:clamp(5px,.52vw,9px)}
.mini-lines{width:36%}.mini-lines i{display:block;width:100%;height:2px;background:#e6e9ed;margin:6px 0}.mini-lines i:last-child{width:65%}
.mini-total{display:flex;justify-content:space-between;width:50%;padding:5% 6%;background:var(--mini-accent);color:#fff}.mini-total strong{margin-left:4px}
.mini-footer{height:8%;width:100%;background:var(--mini-dark);position:absolute;bottom:0;left:0}
.card-info{display:flex;justify-content:space-between;align-items:start;gap:8px;min-height:69px;padding:15px 3px 13px}
.card-info strong{display:block;color:#293547;font-size:13px}.card-info small{display:block;color:#7a8698;font-size:11px;margin-top:3px;line-height:1.3}.card-info em{font-style:normal;font-size:9px;font-weight:800;color:#64852a;background:#f0f5e8;padding:4px 6px;border-radius:4px;text-transform:uppercase;letter-spacing:.4px}
.no-template-results{grid-column:1/-1;padding:40px;background:white;border:1px dashed #cbd5e1;border-radius:10px;text-align:center;color:#68768a}
.home-note{font-size:12px;color:#8792a2;margin-top:30px}
.mini-classic .mini-header:before{content:"";position:absolute;top:0;left:-10%;width:80%;height:89%;background:var(--mini-dark);clip-path:polygon(0 0,100% 0,72% 100%,0 100%)}
.mini-classic .mini-header:after{content:"";position:absolute;top:0;left:60%;width:7%;height:89%;background:var(--mini-accent);transform:skew(-29deg)}
.mini-classic .mini-logo{color:#fff}.mini-classic .mini-table-head i:nth-child(-n+2){background:var(--mini-accent)}
.mini-executive .mini-header,.mini-gold .mini-header{background:var(--mini-dark);margin:0 -9%;padding:10% 9% 0}.mini-executive .mini-logo,.mini-gold .mini-logo{color:#fff}.mini-executive .mini-invoice{color:#fff}.mini-executive .mini-header{border-bottom:8px solid var(--mini-accent)}
.mini-minimal .mini-header{border-bottom:2px solid #30363f}.mini-minimal .mini-invoice{color:#30363f;font-weight:400;letter-spacing:2px}.mini-minimal .mini-table-head,.mini-mono .mini-table-head{background:transparent;color:#222;border-block:1px solid #222}
.mini-nordic{border-left:8px solid var(--mini-accent)}.mini-nordic .mini-table-head,.mini-ocean .mini-table-head{background:#e4f1f9;color:var(--mini-dark)}.mini-nordic .mini-footer{background:#e4f1f9}
.mini-copper{background:#fffaf6}.mini-copper .mini-header{background:#f4e8de;margin:0 -9%;padding:10% 9% 0}.mini-copper .mini-table-head{background:var(--mini-dark)}
.mini-emerald .mini-header{border-top:14px solid var(--mini-dark)}.mini-emerald .mini-table-head{background:var(--mini-accent)}.mini-emerald .mini-footer{background:var(--mini-accent)}
.mini-gold .mini-invoice{color:var(--mini-accent)}.mini-gold .mini-table-head{background:#313842;color:#e7ca87}.mini-gold .mini-total{background:var(--mini-dark);color:#e7ca87}
.mini-coral{background:#fffcfa}.mini-coral .mini-header{background:#fce9e4;margin:0 -9%;padding:10% 9% 0}.mini-coral .mini-table-head{background:var(--mini-accent)}
.mini-slate .mini-invoice{background:#eaf0f3;padding:6px}.mini-slate .mini-table-head{background:#eaf0f3;color:var(--mini-dark)}
.mini-indigo .mini-header{background:linear-gradient(130deg,var(--mini-dark),var(--mini-accent));margin:0 -9%;padding:10% 9% 0}.mini-indigo .mini-logo,.mini-indigo .mini-invoice{color:#fff}.mini-indigo .mini-table-head{background:var(--mini-accent)}
.mini-ocean .mini-header{border-top:11px solid var(--mini-accent)}.mini-ocean .mini-footer{background:#d7f2ef}
.mini-mono .mini-header{border-top:10px solid #222;border-bottom:2px solid #222}.mini-mono .mini-invoice{color:#222;letter-spacing:3px}.mini-mono .mini-total{background:#222}
@media(max-width:1250px){.template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:850px){.home-rail{width:65px;padding:20px 8px}.home-rail-brand{margin:0 auto 30px}.home-rail-brand strong,.rail-link span,.rail-bottom{display:none}.rail-link{justify-content:center;font-size:20px}.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.home-content{padding:25px 14px}.home-head{display:block}.home-current{margin-top:18px}.template-grid{gap:12px}.card-info{display:block}.card-info em{display:inline-block;margin-top:8px}.home-search{width:80%}}

/* Editable and printable layouts. All invoice fields are shared. */
.invoice:not(.template-classic){--template-paper:#fff;background:var(--template-paper)}
.invoice:not(.template-classic) .inv-top{min-height:185px;padding:30px 42px 22px;align-items:flex-start}
.invoice:not(.template-classic) .inv-top:before,.invoice:not(.template-classic) .inv-top:after{display:none}
.invoice:not(.template-classic) .brand-panel{color:var(--navy);width:45%;max-width:45%;padding-top:8px}
.invoice:not(.template-classic) .business-name,.invoice:not(.template-classic) .brand-panel.has-logo .business-name{color:var(--navy)}
.invoice:not(.template-classic) .brand-panel:not(.has-logo){padding-top:20px}
.invoice:not(.template-classic) .inv-title{padding-top:5px;max-width:45%}
.invoice:not(.template-classic) .inv-title h2{color:var(--brand)}
.invoice:not(.template-classic) .inv-items th{background:var(--navy);color:var(--navy-ink)}
.invoice:not(.template-classic) .inv-items th:first-child,.invoice:not(.template-classic) .inv-items th:nth-child(2){background:var(--brand);color:var(--accent-ink)}
.invoice:not(.template-classic) .grand{background:var(--brand);color:var(--accent-ink)}
.invoice:not(.template-classic) .grand strong{color:var(--accent-ink)}
.invoice:not(.template-classic) .invoice-footer{background:var(--navy);color:var(--navy-ink)}
.invoice:not(.template-classic) .footer-contact{color:var(--navy-ink)}
.invoice.template-executive .inv-top{background:var(--navy);border-bottom:8px solid var(--brand)}
.invoice.template-executive .brand-panel,.invoice.template-executive .business-name,.invoice.template-executive .brand-panel.has-logo .business-name,.invoice.template-executive .inv-title h2,.invoice.template-executive .inv-top-meta,.invoice.template-executive .inv-top-meta strong{color:var(--navy-ink)}
.invoice.template-executive .inv-items th:first-child,.invoice.template-executive .inv-items th:nth-child(2){background:var(--navy);color:var(--navy-ink)}
.invoice.template-executive .inv-items tbody tr:nth-child(odd){background:#f1f6fa}
.invoice.template-minimal .inv-top{min-height:175px;border-bottom:2px solid #30363f;margin:0 42px;padding:30px 0 20px}
.invoice.template-minimal .inv-title h2{font-weight:400;letter-spacing:4px;color:#30363f}
.invoice.template-minimal .inv-items{border-collapse:collapse;border-spacing:0;width:100%;margin:0}
.invoice.template-minimal .inv-items th,.invoice.template-mono .inv-items th{background:transparent!important;color:#202833!important;border-top:1px solid #202833;border-bottom:1px solid #202833;font-weight:700}
.invoice.template-minimal .inv-items tbody tr:nth-child(odd),.invoice.template-mono .inv-items tbody tr:nth-child(odd){background:#fff}
.invoice.template-minimal .inv-items td,.invoice.template-mono .inv-items td{border-bottom:1px solid #e5e7eb}
.invoice.template-minimal .invoice-footer{background:#f4f6f7;color:#30363f}
.invoice.template-minimal .footer-contact{color:#30363f}
.invoice.template-nordic{border-left:10px solid var(--brand)}
.invoice.template-nordic .inv-top{border-bottom:1px solid #d4e7f5}
.invoice.template-nordic .inv-items th{background:#e5f2fb;color:#173f68}
.invoice.template-nordic .inv-items th:first-child,.invoice.template-nordic .inv-items th:nth-child(2){background:#d8ecf9;color:#173f68}
.invoice.template-nordic .invoice-footer{background:#e5f2fb;color:#173f68}
.invoice.template-nordic .footer-contact{color:#173f68}
.invoice.template-copper{--template-paper:#fffcf8}
.invoice.template-copper .inv-top{background:#f4e9df;border-bottom:5px solid var(--brand)}
.invoice.template-copper .inv-title h2{font-family:Georgia,serif;letter-spacing:1px}
.invoice.template-copper .inv-items tbody tr:nth-child(odd){background:#f8f0e8}
.invoice.template-emerald .inv-top{border-top:16px solid var(--navy);border-bottom:2px solid var(--brand)}
.invoice.template-emerald .inv-items th{background:var(--brand)}
.invoice.template-emerald .inv-items tbody tr:nth-child(odd){background:#eaf6f2}
.invoice.template-emerald .invoice-footer{background:var(--brand)}
.invoice.template-gold .inv-top{background:var(--navy);border-bottom:6px solid var(--brand)}
.invoice.template-gold .brand-panel,.invoice.template-gold .business-name,.invoice.template-gold .brand-panel.has-logo .business-name,.invoice.template-gold .inv-top-meta,.invoice.template-gold .inv-top-meta strong{color:#f8f3e9}
.invoice.template-gold .inv-title h2{color:var(--brand);font-family:Georgia,serif;letter-spacing:2px}
.invoice.template-gold .inv-items th{background:#313842;color:#f0d69e}
.invoice.template-gold .grand{background:var(--navy);color:#f0d69e}.invoice.template-gold .grand strong{color:#f0d69e}
.invoice.template-coral{--template-paper:#fffdfa}
.invoice.template-coral .inv-top{background:#fce9e4;border-bottom:6px solid var(--brand)}
.invoice.template-coral .inv-title h2{font-family:Georgia,serif;font-weight:700}
.invoice.template-coral .inv-items th{background:var(--brand);color:#fff}
.invoice.template-coral .inv-items tbody tr:nth-child(odd){background:#fff2ed}
.invoice.template-slate .inv-title{background:#eaf0f3;padding:14px 17px;border-radius:4px}
.invoice.template-slate .inv-items th,.invoice.template-slate .inv-items th:first-child,.invoice.template-slate .inv-items th:nth-child(2){background:#eaf0f3;color:#283b4a}
.invoice.template-slate .inv-items td{border-bottom:1px solid #dbe4e9}
.invoice.template-slate .grand{border-radius:5px}
.invoice.template-indigo .inv-top{background:linear-gradient(120deg,var(--navy),var(--brand))}
.invoice.template-indigo .brand-panel,.invoice.template-indigo .business-name,.invoice.template-indigo .brand-panel.has-logo .business-name,.invoice.template-indigo .inv-title h2,.invoice.template-indigo .inv-top-meta,.invoice.template-indigo .inv-top-meta strong{color:#fff}
.invoice.template-indigo .inv-items th{background:var(--brand)}
.invoice.template-indigo .inv-items tbody tr:nth-child(odd){background:#f2f0fb}
.invoice.template-ocean .inv-top{border-top:13px solid var(--brand);border-bottom:2px solid #b4e4e1}
.invoice.template-ocean .inv-items th,.invoice.template-ocean .inv-items th:first-child,.invoice.template-ocean .inv-items th:nth-child(2){background:#dff4f1;color:#1a4652}
.invoice.template-ocean .invoice-footer{background:#dff4f1;color:#1a4652}.invoice.template-ocean .footer-contact{color:#1a4652}
.invoice.template-mono .inv-top{margin:0 42px;padding:28px 0 17px;min-height:170px;border-top:11px solid #222;border-bottom:2px solid #222}
.invoice.template-mono .inv-title h2{color:#222;letter-spacing:5px;font-weight:900}
.invoice.template-mono .grand{background:#222;color:#fff}.invoice.template-mono .grand strong{color:#fff}
@media print{.template-home,.boot-overlay{display:none!important}.invoice:not(.template-classic) .inv-top{min-height:178px}.invoice.template-minimal .inv-top,.invoice.template-mono .inv-top{min-height:165px}.invoice.template-nordic{border-left-width:8px}}
