.connection-help { font-size: 13px; line-height: 1.6; color: #475467; margin-bottom: 2mm; }
.two-a5 .connection-help { font-size: 11px; line-height: 1.5; }
.custom-wifi-heading { text-align: center; overflow-wrap: anywhere; }
.custom-wifi-heading h3 { font-size: 22px; line-height: 1.4; margin-bottom: 2mm; }
.custom-wifi-heading p { font-size: 13px; line-height: 1.5; color: var(--text-muted); white-space: pre-wrap; }

/* ─── Print Page Header ─────────────────────────────────────────────────── */

.print-header,
.wifi-card {
    text-align: center;
}

.print-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 5mm;
    padding-top: 2mm;
}

.print-wifi-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, #f4a95a 100%);
    box-shadow: 0 4px 14px rgba(232, 131, 58, 0.28);
}

.print-wifi-icon svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

.print-header-text {
    text-align: left;
}

.print-header h2 {
    margin-bottom: 2px;
    font-size: 28px;
    color: var(--text);
    line-height: 1.1;
}

.tagline {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.divider {
    width: 60px;
    height: 3px;
    margin: 5mm auto;
    border-radius: 999px;
    background: var(--accent);
}

/* ─── WiFi Cards Grid ───────────────────────────────────────────────────── */

.wifi-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3mm;
    margin-bottom: 5mm;
}

.wifi-cards[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

.wifi-cards[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wifi-cards[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ─── WiFi Card ─────────────────────────────────────────────────────────── */

.wifi-card {
    position: relative;
    min-width: 0;
    padding: 6mm 4mm 4mm;
    border: 2px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.band-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.band-tag.five-g  { background: var(--text); }
.band-tag.mlo     { background: #5b8c5a; }
.band-tag.guest   { background: #6366f1; }

.ssid-label {
    margin-top: 3mm;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.ssid-name {
    min-height: 40px;
    margin-bottom: 3mm;
    font-size: 16px;
    line-height: 1.2;
    color: var(--text);
    word-break: break-word;
}

/* ─── QR Frame ──────────────────────────────────────────────────────────── */

.qr-frame {
    position: relative;
    width: fit-content;
    margin: 0 auto 4mm;
    padding: 3mm;
    border: 2px solid #f0ebe5;
    border-radius: 14px;
    background: #fff;
}

.qr-code {
    position: relative;
    display: grid;
    place-items: center;
    width: 140px;
    height: 140px;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(232, 131, 58, 0.08), rgba(232, 131, 58, 0.02));
}

.qr-code canvas,
.qr-code img {
    display: block;
}

.qr-placeholder {
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
}

.wifi-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #4a9eff;
    box-shadow: 0 0 0 4px #fff;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.qr-frame.has-qr .wifi-icon-overlay {
    opacity: 1;
}

.qr-no-overlay .qr-frame .wifi-icon-overlay { display: none; }

.wifi-icon-overlay svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.scan-hint {
    min-height: 16px;
    font-size: 10px;
    font-weight: 700;
}

/* ─── In-card Password ──────────────────────────────────────────────────── */

.card-pw-section {
    margin-top: 3mm;
    padding-top: 3mm;
    border-top: 1px dashed var(--border);
    text-align: center;
}

.card-pw-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.card-pw-value {
    font-family: Arial, 'Microsoft JhengHei', sans-serif;
    font-size: 14px;
    letter-spacing: normal;
    color: var(--text);
    word-break: break-all;
    line-height: 1.3;
}

/* ─── Password Section (hidden, legacy anchors kept for JS) ─────────────── */

.password-section {
    display: none;
}

.pw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    justify-items: center;
    gap: 2mm 2mm;
}

.pw-item {
    padding: 0 4px;
    min-width: 0;
}

.pw-label {
    margin-bottom: 2mm;
    font-size: 10px;
    letter-spacing: 0.12em;
}

.pw-value {
    min-height: 30px;
    font-size: 20px;
    letter-spacing: 0.06em;
    color: var(--text);
    word-break: break-all;
}

.pw-value-split {
    min-height: 24px;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--text);
    white-space: nowrap;
}

/* ─── Band Guide ────────────────────────────────────────────────────────── */

.print-band-guide {
    margin: 4mm 8mm 0;
    padding-top: 3mm;
    border-top: 1px solid var(--border);
}

.pbg-title {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c5bbb4;
    margin-bottom: 3mm;
}

.pbg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2mm 8mm;
}

.pbg-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pbg-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.pbg-tag.t24    { background: var(--accent); }
.pbg-tag.t5     { background: var(--text); }
.pbg-tag.tmlo   { background: #5b8c5a; }
.pbg-tag.tguest { background: #6366f1; }

.pbg-item .pbg-desc {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ─── Print Footer ──────────────────────────────────────────────────────── */

.print-footer {
    position: absolute;
    right: 0;
    bottom: 12mm;
    left: 0;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #c5bbb4;
}

.print-wifi-icon { background: none; box-shadow: none; }
.print-wifi-icon img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 5px rgba(31,38,60,.16)); }
