:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; flex-shrink: 0; }
.muted { color: var(--muted); }
.pre-line { white-space: pre-line; font-size: 14px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 18px; }
.brand-name { font-size: 18px; margin-right: 8px; }
.badge-local { display: inline-block; font-size: 12px; font-weight: 600; color: #065f46; background: #d1fae5; padding: 2px 8px; border-radius: 999px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tab-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab-btn.active { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.landing-hero { text-align: center; padding: 42px 0 28px; max-width: 820px; margin: 0 auto; }
.landing-hero h1 { font-size: 34px; margin: 8px 0 12px; line-height: 1.25; letter-spacing: -0.02em; }
.land-sub { font-size: 16px; color: var(--muted); margin: 0 0 22px; }
.land-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 32px; }
@media (max-width: 860px) { .features-3 { grid-template-columns: 1fr; } }
.features-3 h3 { margin: 0 0 8px; font-size: 16px; }
.features-3 p { margin: 0; font-size: 14px; }

.workspace { display: grid; grid-template-columns: 1fr 1.05fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .workspace { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row-2, .row-3 { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #374151; }
.label-with-action { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.label-with-action label { margin-bottom: 0; }
.link-btn { background: none; border: 0; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.saved-clients { display: flex; gap: 8px; margin-top: 6px; align-items: center; }

input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; }
.logo-row { display: flex; gap: 8px; align-items: center; }
.logo-row input[type="file"] { min-width: 0; }
.sig-pad { border: 1px dashed #94a3b8; border-radius: 8px; cursor: crosshair; background: #f8fafc; width: 100%; max-width: 340px; height: 80px; display: block; }

.items-header { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 8px; }
.items-header h2 { margin: 0; font-size: 15px; }
.items-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.item-row { display: grid; grid-template-columns: 2fr 70px 95px 36px; gap: 8px; align-items: center; }
.custom-field-row { display: grid; grid-template-columns: 1fr 1.3fr 36px; gap: 8px; align-items: center; }

.btn { border: 0; border-radius: 8px; padding: 9px 15px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: 0.15s ease; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #eff6ff; color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-accent { background: var(--accent); color: #fff; white-space: nowrap; }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.invoice-sheet { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.05); overflow: hidden; }
.inv-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.preview-logo { max-height: 54px; max-width: 160px; margin-bottom: 10px; display: block; object-fit: contain; }
.inv-title { font-size: 26px; font-weight: 800; letter-spacing: 0.04em; text-align: right; color: var(--primary); }
.meta-grid { display: grid; grid-template-columns: auto auto; gap: 4px 14px; font-size: 13px; margin-top: 8px; text-align: right; }
.inv-billto { margin-bottom: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.bill-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }

.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14px; }
.inv-table th { text-align: left; padding: 9px 8px; border-bottom: 2px solid var(--text); font-size: 12px; text-transform: uppercase; }
.inv-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); }
.inv-table .num { text-align: right; }

.inv-totals { margin-left: auto; width: 250px; max-width: 100%; font-size: 14px; }
.tot-row { display: flex; justify-content: space-between; padding: 5px 0; }
.tot-grand { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; font-size: 17px; }
.inv-notes { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); }

.invoice-sheet.theme-navy .inv-top { background: #1e3a5f; color: #fff; margin: -32px -32px 24px; padding: 28px 32px; }
.invoice-sheet.theme-navy .inv-top .muted { color: #cbd5e1; }
.invoice-sheet.theme-navy .inv-title { color: #fff; }
.invoice-sheet.theme-navy .inv-table th { background: #f1f5f9; border-bottom-color: #1e3a5f; color: #1e3a5f; }
.invoice-sheet.theme-slate { border-top: 6px solid #0f766e; }
.invoice-sheet.theme-slate .inv-title { color: #0f766e; }

.pro-showcase { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: var(--radius); padding: 26px; margin-bottom: 36px; }
.pro-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.promo-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.pro-header h2 { margin: 4px 0 6px; font-size: 21px; }
.pro-header p { margin: 0; font-size: 14px; color: #374151; max-width: 760px; }
.pro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .pro-grid { grid-template-columns: 1fr; } }
.pro-item { background: #fff; border: 1px solid #ccfbf1; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.pro-item img { width: 100%; height: 220px; object-fit: contain; background: #f8fafc; border-bottom: 1px solid var(--border); cursor: zoom-in; padding: 6px; }
.pro-item-text { padding: 18px; justify-content: center; }
.pro-badge-box { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 700; background: #eff6ff; color: #1d4ed8; padding: 4px 10px; border-radius: 6px; margin-bottom: 10px; }
.pro-caption { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.pro-item-text .pro-caption { padding: 0; }
.pro-caption strong { font-size: 14px; }
.pro-caption span { font-size: 13px; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi-box strong { font-size: 20px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pill-btn { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.pill-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.status-pill { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-InProgress { background: #dbeafe; color: #1e40af; }
.status-Completed { background: #d1fae5; color: #065f46; }
.status-OnHold { background: #fef3c7; color: #92400e; }
.promo-card { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Modal / Lightbox */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-box { background: #fff; border-radius: 12px; max-width: 920px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px; position: relative; }
.modal-box img { width: 100%; height: auto; display: block; border-radius: 8px; }
.modal-close { position: sticky; top: 0; float: right; background: #111827; color: #fff; border: 0; border-radius: 999px; width: 32px; height: 32px; font-size: 18px; cursor: pointer; }

.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 16px 0; font-size: 13px; color: var(--muted); }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .workspace { display: block; }
  .tab-pane { display: none !important; }
  .tab-pane.active { display: block !important; }
  .invoice-sheet { border: 0; box-shadow: none; padding: 0; }
  .invoice-sheet.theme-navy .inv-top { margin: 0 0 24px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.doc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.doc-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); background: #f3f4f6; color: #9ca3af; cursor: pointer; }
.doc-badge.done { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.doc-badge.done-receipt { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card { background: #fff; border: 1px solid #99f6e4; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.price-card.featured { border: 2px solid var(--accent); box-shadow: 0 6px 20px rgba(15,118,110,0.08); }
.price-num { font-size: 28px; font-weight: 800; color: #0f172a; }
.terms-note { font-size: 12px; color: #475569; margin-top: 8px; line-height: 1.5; }
.terms-note a { color: var(--primary); font-weight: 600; }
.terms-article { max-width: 820px; margin: 28px auto 48px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.terms-article h1 { margin-top: 0; font-size: 26px; color: #1e3a5f; }
.terms-article h2 { margin-top: 22px; font-size: 17px; color: #0f766e; }
.terms-article p, .terms-article li { font-size: 14px; color: #374151; line-height: 1.7; }
.pay-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

.backup-bar { background: #fffbeb; border-bottom: 1px solid #fde68a; padding: 7px 0; font-size: 13px; color: #92400e; }
.backup-bar.saved { background: #ecfdf5; border-bottom-color: #a7f3d0; color: #065f46; }
.btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.rec-tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 999px; margin-left: 6px; }
.rec-yes { background: #d1fae5; color: #065f46; }
.rec-no { background: #f3f4f6; color: #6b7280; }

@media (min-width: 1024px) {
  .topbar-inner { flex-wrap: nowrap; gap: 10px; }
  .brand-name { font-size: 16px; margin-right: 6px; }
  .badge-local { font-size: 11px; padding: 2px 7px; white-space: nowrap; }
  .tab-nav { flex-wrap: nowrap; gap: 4px; }
  .tab-btn { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .topbar-actions { flex-wrap: nowrap; gap: 6px; }
  .topbar-actions .btn-sm, .topbar-actions select { padding: 5px 9px; font-size: 12px; }
}

.pro-grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .pro-grid-4 { grid-template-columns: 1fr; } }

.print-brand-footer { display: none; }
@page { size: auto; margin: 0mm; }
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .invoice-sheet { padding: 16mm 18mm !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
  .invoice-sheet.theme-navy .inv-top { margin: -16mm -18mm 20px !important; padding: 16mm 18mm 22px !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-brand-footer {
    display: block !important; margin-top: 28px; padding-top: 10px;
    border-top: 1px solid #e5e7eb; text-align: center;
    font-size: 11px; color: #9ca3af; letter-spacing: 0.02em;
  }
}

.compare-wrap { margin: 22px 0; overflow-x: auto; background: #fff; border: 1px solid #99f6e4; border-radius: 12px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.compare-table th { background: #f8fafc; font-weight: 700; color: #0f172a; }
.compare-table th.col-pro { background: #0f766e; color: #fff; }
.compare-table td.col-pro { background: #f0fdfa; font-weight: 600; color: #065f46; }
.compare-table tr:last-child td { border-bottom: 0; }

.item-col-heads { display: grid; grid-template-columns: 2fr 70px 95px 36px; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; padding: 0 2px; }
@media (max-width: 600px) { .item-col-heads { display: none; } }

.landing-hero { max-width: 1020px; }
.landing-hero h1 { font-size: clamp(24px, 2.9vw, 32px); }
.compare-table th.col-free { background: #e5e7eb; color: #374151; }
.compare-table td.col-free { background: #f9fafb; color: #6b7280; }

/* SEO Use-Case & FAQ Sections */
.seo-section { margin: 36px 0; }
.seo-section h2 { font-size: 22px; margin: 0 0 8px; color: #0f172a; }
.seo-section .seo-lead { color: #475569; font-size: 15px; margin: 0 0 18px; line-height: 1.65; }
.usecase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.usecase-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 18px; }
.usecase-card h3 { margin: 0 0 6px; font-size: 15px; color: #0f172a; }
.usecase-card p { margin: 0; font-size: 13.5px; color: #475569; line-height: 1.6; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; color: #0f172a; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 18px; font-weight: 500; color: #64748b; flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; color: #0f766e; }
.faq-item p { margin: 10px 0 0; font-size: 14px; color: #475569; line-height: 1.65; }

/* Swiss Geometric Folded-Corner Brand Mark */
.brand-mark-svg { background: transparent !important; padding: 0; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; box-shadow: none !important; }
