/* QES Regenova Partner Network: warm white, restrained gold, charcoal, serif headings. */
.qpn {
	--qpn-bg: #FAF6EF;
	--qpn-card: #FFFDF9;
	--qpn-gold: #B8914A;
	--qpn-gold-soft: #E9DCC3;
	--qpn-ink: #2B2A28;
	--qpn-muted: #6F6A62;
	--qpn-line: #E7DFD2;
	--qpn-serif: "Cormorant Garamond", "Playfair Display", "Noto Serif TC", Georgia, "Times New Roman", serif;
	--qpn-sans: "Inter", "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
	color: var(--qpn-ink);
	font-family: var(--qpn-sans);
	background: var(--qpn-bg);
	border-radius: 18px;
	padding: clamp(18px, 3vw, 40px);
	box-sizing: border-box;
	line-height: 1.5;
	container-type: inline-size;
	container-name: qpn;
}
.qpn [class*="__value"], .qpn [class*="__price"], .qpn-table, .qpn-card__list strong { font-variant-numeric: lining-nums tabular-nums; }
.qpn *, .qpn *::before, .qpn *::after { box-sizing: border-box; }
.qpn h2, .qpn h3, .qpn h4 { font-family: var(--qpn-serif); color: var(--qpn-ink); font-weight: 600; letter-spacing: .01em; margin: 0; }
.qpn-title { font-size: clamp(28px, 3.4vw, 42px); text-align: center; margin-bottom: 18px !important; }

.qpn-referrer {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	margin: 0 auto 22px; padding: 10px 18px; width: fit-content; max-width: 100%;
	background: var(--qpn-card); border: 1px solid var(--qpn-gold-soft); border-radius: 999px;
	font-size: 14px; color: var(--qpn-muted);
}
.qpn-referrer strong { color: var(--qpn-ink); }
.qpn-referrer__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--qpn-gold); flex: none; }

.qpn-cards { display: grid; gap: clamp(16px, 2vw, 28px); grid-template-columns: minmax(0, 1fr); max-width: 480px; margin: 0 auto; align-items: stretch; }
@container qpn (min-width: 760px) {
	.qpn-cards { max-width: none; }
	.qpn-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.qpn-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.qpn-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container qpn (min-width: 1100px) {
	.qpn-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.qpn-card {
	position: relative; display: flex; flex-direction: column;
	background: var(--qpn-card); border: 1px solid var(--qpn-line); border-radius: 16px;
	padding: 30px 26px 26px; text-align: center;
	box-shadow: 0 1px 0 rgba(184,145,74,.10), 0 18px 40px -28px rgba(43,42,40,.35);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.qpn-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 16px 16px 0 0; background: linear-gradient(90deg, transparent, var(--qpn-gold), transparent); opacity: .8; }
.qpn-card:hover { transform: translateY(-3px); border-color: var(--qpn-gold-soft); box-shadow: 0 1px 0 rgba(184,145,74,.15), 0 26px 50px -30px rgba(43,42,40,.45); }
.qpn-card.is-current { border-color: var(--qpn-gold); }
.qpn-card__eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--qpn-gold); font-weight: 600; }
.qpn-card__title { font-size: clamp(26px, 2.4vw, 34px); margin-top: 6px !important; }
.qpn-card__rule { width: 44px; height: 1px; background: var(--qpn-gold); margin: 14px auto 16px; }
.qpn-card__price { font-family: var(--qpn-serif); font-size: clamp(28px, 2.6vw, 38px); font-weight: 600; line-height: 1.1; white-space: nowrap; }
.qpn-card__price2 { font-size: 14px; color: var(--qpn-muted); margin-top: 4px; }
.qpn-card__list { list-style: none; margin: 22px 0 0; padding: 0; text-align: left; font-size: 14px; }
.qpn-card__list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--qpn-line); }
.qpn-card__list li span { color: var(--qpn-muted); }
.qpn-card__list li strong { font-weight: 600; text-align: right; white-space: nowrap; }
.qpn-card__list li strong small { display: block; font-weight: 400; color: var(--qpn-muted); font-size: 12px; }
.qpn-card__desc { font-size: 14px; color: var(--qpn-muted); margin: 14px 0 0; }
.qpn-card__cta { margin-top: auto; padding-top: 22px; }

.qpn-btn, .qpn a.qpn-btn, .qpn button.qpn-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 12px 26px; width: 100%;
	background: var(--qpn-ink); color: #fff !important; border: 1px solid var(--qpn-ink); border-radius: 999px;
	font: 600 13px/1.2 var(--qpn-sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none !important; cursor: pointer; white-space: nowrap;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.qpn-btn:hover, .qpn-btn:focus-visible { background: var(--qpn-gold); border-color: var(--qpn-gold); color: #fff !important; }
.qpn-btn:focus-visible { outline: 2px solid var(--qpn-gold); outline-offset: 3px; }
.qpn-btn--ghost { background: transparent; color: var(--qpn-ink) !important; border-color: var(--qpn-gold-soft); }
.qpn-btn.is-disabled { cursor: default; color: var(--qpn-muted) !important; background: transparent; border-color: var(--qpn-line); }
.qpn-disclaimer { margin: 26px auto 0; max-width: 760px; text-align: center; font-size: 12.5px; color: var(--qpn-muted); }

/* Dashboard */
.qpn-dashboard { display: grid; gap: 20px; }
.qpn-dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--qpn-line); }
.qpn .qpn-dash-head a.qpn-btn { width: auto; }
.qpn-dash-head__name { font-size: clamp(28px, 3vw, 38px); margin-top: 4px !important; }
.qpn-dash-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; color: var(--qpn-muted); font-size: 14px; }
.qpn-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--qpn-gold); color: var(--qpn-gold); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.qpn-badge--muted { border-color: var(--qpn-line); color: var(--qpn-muted); }
.qpn-panel { background: var(--qpn-card); border: 1px solid var(--qpn-line); border-radius: 16px; padding: clamp(18px, 2.4vw, 28px); }
.qpn-h { font-size: 24px; margin-bottom: 10px !important; }
.qpn-h4 { font-size: 19px; margin: 22px 0 10px !important; }
.qpn-muted { color: var(--qpn-muted); font-size: 14px; margin: 0 0 12px; }
.qpn-empty { text-align: center; }
.qpn .qpn-empty a.qpn-btn { width: auto; }
.qpn-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.qpn-ref__body { flex: 1 1 320px; min-width: 0; }
.qpn-qr { flex: none; width: 148px; height: 148px; padding: 10px; background: #fff; border: 1px solid var(--qpn-gold-soft); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.qpn-qr img, .qpn-qr svg { width: 100%; height: 100%; display: block; }
.qpn-stats { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@container qpn (min-width: 460px) { .qpn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container qpn (min-width: 900px) { .qpn-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.qpn-stat, .qpn-total { background: var(--qpn-card); border: 1px solid var(--qpn-line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.qpn-stat__label, .qpn-total__label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--qpn-muted); }
.qpn-stat__value, .qpn-total__value { font-family: var(--qpn-serif); font-size: 26px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.qpn-stat__sub { font-size: 12.5px; color: var(--qpn-muted); }
.qpn-totals { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container qpn (min-width: 760px) { .qpn-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.qpn-total { background: var(--qpn-bg); }
.qpn-total--approved .qpn-total__value, .qpn-total--paid .qpn-total__value { color: var(--qpn-gold); }
.qpn-table-wrap { overflow-x: auto; }
.qpn-table { width: 100%; border-collapse: collapse; font-size: 14px; border: 0; margin: 0; }
.qpn-table th, .qpn-table td { border: 0; background: transparent; }
.qpn-table th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--qpn-muted); padding: 10px 12px; border-bottom: 1px solid var(--qpn-gold-soft); white-space: nowrap; }
.qpn-table td { padding: 12px; border-bottom: 1px solid var(--qpn-line); vertical-align: top; }
.qpn-table .num { text-align: right; white-space: nowrap; }
.qpn-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #F1ECE3; color: var(--qpn-muted); }
.qpn-pill--approved { background: #F3E9D4; color: #8A6A2F; }
.qpn-pill--paid { background: #E6EFE3; color: #3F6B3A; }
.qpn-pill--reversed { background: #F5E4E1; color: #9A4A3E; }
.qpn-register .form-row { margin-bottom: 14px; }
.qpn-register input.input-text { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--qpn-line); border-radius: 10px; background: #fff; }
.qpn-secondary-price { color: #6F6A62; font-weight: 400; }

/* ---- Narrow-screen hardening (v1.0.1) ---- */
.qpn { max-width: 100%; overflow-wrap: anywhere; }
.qpn-dashboard { grid-template-columns: minmax(0, 1fr); }
.qpn-dashboard > *, .qpn-cards > *, .qpn-stats > *, .qpn-totals > *, .qpn-ref > * { min-width: 0; }
.qpn-ref__row { display: flex; flex-direction: column; gap: 10px; }
.qpn-ref__link {
	padding: 12px 16px; border: 1px solid var(--qpn-line); border-radius: 14px; background: var(--qpn-bg);
	color: var(--qpn-ink); font: 14px/1.45 var(--qpn-sans); word-break: break-all; overflow-wrap: anywhere; user-select: all;
}
.qpn .qpn-ref button.qpn-copy { width: 100%; }
@container qpn (min-width: 640px) {
	.qpn-ref__row { flex-direction: row; align-items: center; }
	.qpn-ref__link { flex: 1 1 auto; border-radius: 999px; }
	.qpn .qpn-ref button.qpn-copy { width: auto; flex: none; }
}
@container qpn (max-width: 479px) {
	.qpn-ref { flex-direction: column; align-items: stretch; }
	.qpn-qr { align-self: center; }
	.qpn-stat__value { font-size: 22px; }
	.qpn-totals { gap: 8px; }
	.qpn-total { padding: 12px; }
	.qpn-total__value { font-size: 19px; }
	.qpn-card { padding: 26px 18px 20px; }
	.qpn-card__list li strong { white-space: normal; }
	.qpn-btn, .qpn a.qpn-btn, .qpn button.qpn-btn { white-space: normal; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) { .qpn { padding: 14px; border-radius: 14px; } .qpn-panel { padding: 16px; } }
.qpn-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Stack table rows into cards on narrow containers. */
@container qpn (max-width: 599px) {
	.qpn-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.qpn-table--stack, .qpn-table--stack tbody, .qpn-table--stack tr, .qpn-table--stack td { display: block; width: 100%; }
	.qpn-table--stack tr { border: 1px solid var(--qpn-line); border-radius: 12px; padding: 6px 14px; margin: 0 0 10px; background: var(--qpn-bg); }
	.qpn-table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--qpn-line); text-align: right; }
	.qpn-table--stack td:last-child { border-bottom: 0; }
	.qpn-table--stack td::before { content: attr(data-label); flex: none; text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--qpn-muted); padding-top: 2px; }
	.qpn-table--stack .num { white-space: normal; }
}
