/* ===========================================
   HTML Reference Page Parity
   Keeps the Claude reference alignment while using Historicum tokens.
   =========================================== */

body.historicum-community-page,
body.historicum-community-blog-page,
body.historicum-social-page,
body.historicum-events-page,
body.historicum-collaborations-page,
body.historicum-custom-projects-page,
body.historicum-training-page,
body.historicum-policy-page,
body.historicum-privacy-page,
body.historicum-returns-page,
body.historicum-regulations-page,
body.historicum-error-page,
body.woocommerce-account {
    margin: 0 !important;
    padding-top: 0 !important;
    background: #000000 !important;
    color: #ffffff;
}

body.historicum-community-page .h-page-wrapper,
body.historicum-community-blog-page .h-page-wrapper,
body.historicum-social-page .h-page-wrapper,
body.historicum-events-page .h-page-wrapper,
body.historicum-collaborations-page .h-page-wrapper,
body.historicum-custom-projects-page .h-page-wrapper,
body.historicum-training-page .h-page-wrapper,
body.historicum-policy-page .h-page-wrapper,
body.historicum-privacy-page .h-page-wrapper,
body.historicum-returns-page .h-page-wrapper,
body.historicum-error-page .h-page-wrapper {
    padding-top: 0 !important;
}

body.historicum-community-page .site-header,
body.historicum-community-blog-page .site-header,
body.historicum-social-page .site-header,
body.historicum-events-page .site-header,
body.historicum-collaborations-page .site-header,
body.historicum-custom-projects-page .site-header,
body.historicum-training-page .site-header,
body.historicum-policy-page .site-header,
body.historicum-error-page .site-header,
body.woocommerce-account .site-header,
body.historicum-community-page #masthead,
body.historicum-community-blog-page #masthead,
body.historicum-social-page #masthead,
body.historicum-events-page #masthead,
body.historicum-collaborations-page #masthead,
body.historicum-custom-projects-page #masthead,
body.historicum-training-page #masthead,
body.historicum-policy-page #masthead,
body.historicum-error-page #masthead,
body.woocommerce-account #masthead {
    display: none !important;
}

.h-ref-page,
.h-ref-page * {
    box-sizing: border-box;
}

.h-ref-page {
    min-height: 100vh;
    overflow: hidden;
    background: transparent;
    color: #ffffff;
    font-family: var(--h-font-cormorant);
}

.h-ref-page a {
    text-decoration: none;
}

.h-ref-page .hero {
    position: relative;
    min-height: auto;
    padding: 118px 40px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a0a0a;
    color: #ffffff;
    text-align: center;
}

body.historicum-community-page .h-ref-page .hero,
body.historicum-training-page .h-ref-page .hero {
    min-height: 600px;
    padding: 132px 40px 90px;
}

.h-ref-page .hero-content {
    position: relative;
    z-index: 2;
    width: min(1040px, 100%);
}

.h-ref-page .hero h1 {
    margin: 0 0 20px;
    color: #ffffff;
    font-family: var(--h-font-cinzel);
    font-size: clamp(42px, 8vw, 96px);
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 1.03;
    text-transform: uppercase;
}

.h-ref-page .hero-subtitle,
.h-ref-page .subtitle {
    margin: 0;
    color: #f5f0e6;
    font-family: var(--h-font-cormorant);
    font-size: clamp(20px, 3vw, 32px);
    font-style: italic;
    line-height: 1.35;
}

.h-ref-page .diagonal-band {
    position: absolute;
    width: 150%;
    height: 100px;
    background: linear-gradient(90deg, transparent, var(--h-accent), transparent);
    opacity: 0.15;
    transform: rotate(-5deg);
    pointer-events: none;
}

.h-ref-page .diagonal-band-1 {
    top: 15%;
    left: -25%;
}

.h-ref-page .diagonal-band-2 {
    right: -25%;
    bottom: 20%;
}

.h-ref-page .btn-gold,
.h-ref-page .btn-outline,
.h-ref-page .btn-follow,
.h-ref-page .blog-link,
.h-ref-page .collab-link,
.h-ref-page .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 15px 35px;
    font-family: var(--h-font-cinzel);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    text-transform: uppercase;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.h-ref-page .btn-gold,
.h-ref-page .btn-follow,
.h-ref-page .page-link.active {
    border: 2px solid var(--h-accent);
    background: var(--h-accent);
    color: #0a0a0a !important;
}

.h-ref-page .btn-outline,
.h-ref-page .page-link {
    border: 2px solid currentColor;
    background: transparent;
    color: inherit !important;
}

.h-ref-page .btn-gold:hover,
.h-ref-page .btn-outline:hover,
.h-ref-page .btn-follow:hover,
.h-ref-page .page-link:hover {
    transform: translateY(-2px);
}

.h-ref-page .h-rip-section {
    padding: 0;
    background: #0a0a0a;
}

.h-ref-page .h-rip-paper-inner {
    background: var(--h-paper);
    color: #0a0a0a;
}

.h-ref-page .h-torn-top,
.h-ref-page .h-torn-bottom {
    display: block;
    height: 50px;
    width: 100%;
    background-repeat: no-repeat;
    background-size: 150% 100%;
    position: relative;
    z-index: 2;
}

.h-ref-page .h-torn-top {
    background-position: bottom left;
}

.h-ref-page .h-torn-bottom {
    background-position: top left;
    transform: scaleY(-1);
}

.h-ref-page .section-title,
.h-ref-page .policy-title,
.h-ref-page .account-title {
    margin: 0 0 15px;
    color: inherit;
    font-family: var(--h-font-cinzel);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
}

.h-ref-page .section-subtitle {
    margin: 0 auto 50px;
    max-width: 780px;
    color: #666666;
    font-size: clamp(18px, 2.4vw, 24px);
    font-style: italic;
    text-align: center;
}

/* Community hub */
.h-ref-page .tiles-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px;
}

.h-ref-page .tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.h-ref-page .destination-tile {
    position: relative;
    display: flex;
    aspect-ratio: 4 / 3;
    min-height: 255px;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    background:
        linear-gradient(to top, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0.12)),
        url("https://historicum.pl/wp-content/uploads/2026/04/Workshop2.jpg") center/cover;
    color: inherit;
    transition: transform 0.3s ease;
}

.h-ref-page .destination-tile:hover {
    transform: translateY(-8px);
}

.h-ref-page .tile-content {
    position: relative;
    z-index: 2;
    padding: 40px;
}

.h-ref-page .tile-category,
.h-ref-page .blog-category,
.h-ref-page .collab-type {
    margin-bottom: 15px;
    color: var(--h-accent);
    font-family: var(--h-font-cinzel);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.h-ref-page .tile-title,
.h-ref-page .event-name,
.h-ref-page .collab-name,
.h-ref-page .project-name,
.h-ref-page .platform-name {
    margin: 0 0 15px;
    color: inherit;
    font-family: var(--h-font-cinzel);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.h-ref-page .tile-description,
.h-ref-page .event-description,
.h-ref-page .collab-description,
.h-ref-page .project-description,
.h-ref-page .platform-description {
    margin: 0 0 20px;
    color: inherit;
    font-size: 16px;
    line-height: 1.6;
}

.h-ref-page .tile-link {
    color: var(--h-accent);
    font-family: var(--h-font-cinzel);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Blog */
.h-ref-page .featured-post,
.h-ref-page .filter-section,
.h-ref-page .blog-grid-section,
.h-ref-page .pagination {
    background: var(--h-paper);
    color: #0a0a0a;
}

.h-ref-page .featured-post {
    padding: 80px 40px 40px;
}

.h-ref-page .featured-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.h-ref-page .featured-image,
.h-ref-page .blog-card-image,
.h-ref-page .event-image,
.h-ref-page .collab-photo,
.h-ref-page .project-image,
.h-ref-page .image-placeholder {
    background:
        linear-gradient(135deg, rgba(235, 188, 0, 0.20), rgba(10, 10, 10, 0.20)),
        url("https://historicum.pl/wp-content/uploads/2026/04/Workshop2.jpg") center/cover;
}

.h-ref-page .featured-image {
    min-height: 420px;
}

.h-ref-page .featured-image img,
.h-ref-page .blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.h-ref-page .featured-content h2,
.h-ref-page .account-card h2 {
    margin: 0 0 20px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.1;
}

.h-ref-page .featured-excerpt,
.h-ref-page .blog-excerpt,
.h-ref-page .blog-date {
    color: #666666;
    font-size: 18px;
    line-height: 1.6;
}

.h-ref-page .filter-section {
    padding: 40px 40px 0;
}

.h-ref-page .filter-pills {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 12px;
}

.h-ref-page .filter-pill {
    border: 2px solid #0a0a0a;
    background: transparent;
    color: #0a0a0a;
    padding: 10px 25px;
    font-family: var(--h-font-cormorant);
    font-size: 16px;
}

.h-ref-page .filter-pill.active {
    border-color: var(--h-accent);
    background: var(--h-accent);
}

.h-ref-page .blog-grid-section {
    padding: 60px 40px 40px;
}

.h-ref-page .blog-grid {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.h-ref-page .blog-card,
.h-ref-page .event-card,
.h-ref-page .participate-card,
.h-ref-page .collab-card,
.h-ref-page .feature-card,
.h-ref-page .pricing-card,
.h-ref-page .account-card,
.h-ref-page .platform-block {
    background: #ffffff;
    color: #0a0a0a;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.h-ref-page .blog-card-image,
.h-ref-page .event-image {
    display: block;
    min-height: 220px;
}

.h-ref-page .blog-card-content,
.h-ref-page .event-content {
    padding: 30px;
}

.h-ref-page .blog-card h3 {
    margin: 0 0 10px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-size: 24px;
}

.h-ref-page .blog-link,
.h-ref-page .collab-link {
    min-height: 0;
    padding: 0;
    border: 0;
    color: var(--h-accent) !important;
}

.h-ref-page .pagination {
    padding: 0 40px 80px;
}

.h-ref-page .pagination-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.h-ref-page .page-link {
    min-width: 48px;
    min-height: 48px;
    padding: 0 14px;
    color: #0a0a0a !important;
}

.h-ref-page .page-link.current {
    border-color: var(--h-accent);
    background: var(--h-accent);
}

/* Social */
.h-ref-page .platforms-section {
    padding: 80px 40px;
    background: var(--h-paper);
    color: #0a0a0a;
}

.h-ref-page .platforms-grid {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
}

.h-ref-page .platform-block {
    padding: 40px;
}

.h-ref-page .platform-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.h-ref-page .platform-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    align-items: center;
    justify-content: center;
    background: var(--h-accent);
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-weight: 700;
}

.h-ref-page .platform-embed,
.h-ref-page .juicer-feed-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    margin: 26px 0;
    padding: 26px;
    border: 2px dashed #d4d4d4;
    background: #f8f4eb;
    color: #666666;
    text-align: center;
}

.h-ref-page .juicer-feed-panel {
    display: block;
    max-width: 1200px;
    margin: 0 auto 40px;
    text-align: center;
}

.h-ref-page .platform-block .btn-follow {
    width: 100%;
}

.h-ref-page .juicer-feed-panel h2 {
    margin: 0 0 12px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    text-transform: uppercase;
}

/* Events */
.h-ref-page .our-events-section,
.h-ref-page .participate-section {
    padding: 80px 40px;
}

.h-ref-page .our-events-section {
    background: var(--h-paper);
    color: #0a0a0a;
}

.h-ref-page .participate-section,
.h-ref-page .carousel-section,
.h-ref-page .dark-section {
    background: #0a0a0a;
    color: #ffffff;
}

.h-ref-page .events-grid {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.h-ref-page .event-meta {
    color: #666666;
    font-size: 16px;
    font-style: italic;
}

.h-ref-page .event-role {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--h-accent-hover);
    font-family: var(--h-font-cinzel);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.h-ref-page .participate-card .btn-outline {
    color: #0a0a0a !important;
}

.h-ref-page .placeholder-card {
    display: flex;
    min-height: 360px;
    align-items: center;
    justify-content: center;
    border: 2px dashed #d4d4d4;
    color: #666666;
    text-align: center;
}

.h-ref-page .participate-card.past {
    opacity: 0.72;
}

/* Collaborations */
.h-ref-page .carousel-section {
    padding: 70px 40px 90px;
}

.h-ref-page .carousel-container {
    max-width: 1280px;
    margin: 0 auto;
    overflow-x: auto;
}

.h-ref-page .carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 360px);
    gap: 28px;
    padding-bottom: 18px;
    scroll-snap-type: x mandatory;
}

.h-ref-page .collab-card {
    padding: 0 0 28px;
    overflow: hidden;
    scroll-snap-align: start;
}

.h-ref-page .collab-card > *:not(.collab-photo) {
    margin-left: 28px;
    margin-right: 28px;
}

.h-ref-page .collab-photo {
    min-height: 240px;
    margin-bottom: 26px;
}

/* Custom projects */
.h-ref-page .masonry-section {
    padding: 80px;
    background: var(--h-paper);
}

.h-ref-page .masonry-grid {
    columns: 3 260px;
    column-gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
}

.h-ref-page .project-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 30px;
    break-inside: avoid;
}

.h-ref-page .project-image {
    position: relative;
    min-height: 340px;
    overflow: hidden;
}

.h-ref-page .project-overlay {
    position: absolute;
    inset: auto 0 0;
    padding: 32px;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.94), transparent);
    color: #ffffff;
}

/* Training */
.h-ref-page .hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 36px;
}

.h-ref-page .paper-section,
.h-ref-page .dark-section {
    padding: 80px 40px;
}

.h-ref-page .paper-section {
    background: var(--h-paper);
    color: #0a0a0a;
}

.h-ref-page .two-column {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.h-ref-page .two-column p,
.h-ref-page .credentials-list,
.h-ref-page .tier-features,
.h-ref-page .policy-section p,
.h-ref-page .policy-section li,
.h-ref-page .account-card p,
.h-ref-page .account-content p {
    font-size: 18px;
    line-height: 1.7;
}

.h-ref-page .credentials-list,
.h-ref-page .tier-features {
    margin: 0 0 36px;
    padding: 0;
    list-style: none;
}

.h-ref-page .credentials-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
}

.h-ref-page .credentials-list li::before {
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    background: var(--h-accent);
}

.h-ref-page .image-placeholder,
.h-ref-page .video-placeholder {
    display: flex;
    min-height: 330px;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--h-font-cinzel);
    text-align: center;
    text-transform: uppercase;
}

.h-ref-page .quote-block {
    margin-top: 40px;
    color: var(--h-accent);
    font-size: clamp(28px, 4vw, 44px);
    font-style: italic;
    line-height: 1.2;
}

.h-ref-page .cards-grid,
.h-ref-page .steps-grid,
.h-ref-page .pricing-grid,
.h-ref-page .quick-actions {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}

.h-ref-page .steps-grid,
.h-ref-page .pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.h-ref-page .feature-card,
.h-ref-page .step,
.h-ref-page .pricing-card,
.h-ref-page .quick-action-card {
    padding: 40px 30px;
}

.h-ref-page .feature-card {
    border-top: 4px solid var(--h-accent);
    text-align: center;
}

.h-ref-page .feature-card h3,
.h-ref-page .step h3,
.h-ref-page .pricing-card h3,
.h-ref-page .quick-action-title {
    margin: 0 0 15px;
    color: inherit;
    font-family: var(--h-font-cinzel);
    font-size: 22px;
    text-transform: uppercase;
}

.h-ref-page .step {
    border: 1px solid rgba(235, 188, 0, 0.45);
    color: #ffffff;
    text-align: center;
}

.h-ref-page .testimonials-placeholder {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 20px;
    border: 2px dashed rgba(235, 188, 0, 0.35);
    color: #666666;
    text-align: center;
}

.h-ref-page .step-number {
    width: 58px;
    height: 58px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--h-accent);
    color: var(--h-accent);
    font-family: var(--h-font-cinzel);
    font-size: 28px;
}

.h-ref-page .video-section {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.h-ref-page .video-placeholder {
    min-height: 420px;
    background: #000000;
}

.h-ref-page .thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.h-ref-page .thumbnail {
    min-height: 120px;
    background:
        linear-gradient(135deg, rgba(235, 188, 0, 0.16), rgba(10, 10, 10, 0.16)),
        url("https://historicum.pl/wp-content/uploads/2026/04/Workshop2.jpg") center/cover;
}

.h-ref-page .video-caption,
.h-ref-page .small-text {
    margin-top: 22px;
    color: #666666;
    font-size: 16px;
}

.h-ref-page .pricing-card {
    position: relative;
    border: 2px solid #d4d4d4;
    text-align: center;
}

.h-ref-page .pricing-card.featured {
    border-color: var(--h-accent);
}

.h-ref-page .popular-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--h-accent);
    padding: 8px 18px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.h-ref-page .tier-price {
    margin-bottom: 24px;
    color: var(--h-accent);
    font-family: var(--h-font-cinzel);
    font-size: 34px;
}

.h-ref-page .final-cta {
    text-align: center;
}

.h-ref-page .final-cta h2 {
    margin: 0 0 18px;
    color: #ffffff;
    font-family: var(--h-font-cinzel);
    font-size: clamp(36px, 6vw, 68px);
}

/* Policy pages */
.h-ref-page .policy-shell,
body.woocommerce-account .account-shell {
    min-height: 100vh;
    padding: 132px 24px 90px;
    background: transparent;
}

.h-ref-page .policy-paper,
.h-ref-page .account-paper {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(34px, 6vw, 70px);
    background: var(--h-paper);
    color: #0a0a0a;
}

.h-ref-page .policy-title,
.h-ref-page .account-title {
    color: #0a0a0a;
}

.h-ref-page .policy-date,
.h-ref-page .policy-subtitle,
.h-ref-page .account-greeting {
    margin: -4px 0 36px;
    color: #666666;
    font-size: 18px;
    text-align: center;
}

.h-ref-page .policy-intro {
    margin-bottom: 40px;
    padding: 24px;
    border-left: 4px solid var(--h-accent);
    background: rgba(235, 188, 0, 0.12);
    font-size: 20px;
    line-height: 1.65;
}

.h-ref-page .policy-section,
.h-ref-page .policy-contact {
    padding: 34px 0;
    border-top: 1px solid rgba(10, 10, 10, 0.16);
}

.h-ref-page .policy-section h2,
.h-ref-page .policy-contact h2 {
    margin: 0 0 18px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.h-ref-page .policy-section h3,
.h-ref-page .policy-contact h3 {
    margin: 22px 0 8px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-size: 18px;
}

.h-ref-page .policy-highlight,
.h-ref-page .contact-box {
    margin-top: 18px;
    padding: 18px 20px;
    border-left: 4px solid var(--h-accent);
    background: rgba(235, 188, 0, 0.13);
}

.h-ref-page .definition-list {
    display: grid;
    gap: 16px;
}

.h-ref-page .definition-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.42);
}

.h-ref-page .definition-term {
    margin-bottom: 8px;
    color: #0a0a0a;
    font-family: var(--h-font-cinzel);
    font-weight: 700;
}

.h-ref-page .section-number {
    color: var(--h-accent-hover);
}

/* 404 */
.h-ref-page .error-page {
    position: relative;
    min-height: 100vh;
    padding: 132px 20px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.h-ref-page .error-page > .diagonal-band {
    top: 35%;
    left: -25%;
}

.h-ref-page .error-content {
    position: relative;
    z-index: 2;
    width: min(880px, 100%);
}

.h-ref-page .error-code {
    margin-bottom: 30px;
    color: var(--h-accent);
    font-family: var(--h-font-cinzel);
    font-size: clamp(100px, 22vw, 220px);
    font-weight: 700;
    line-height: 0.82;
}

.h-ref-page .error-title {
    margin: 0 0 20px;
    color: #ffffff;
    font-family: var(--h-font-cinzel);
    font-size: clamp(34px, 5vw, 64px);
    text-transform: uppercase;
}

.h-ref-page .error-subtitle {
    margin: 0 0 50px;
    color: #d4d4d4;
    font-size: clamp(20px, 3vw, 30px);
}

.h-ref-page .error-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 50px;
}

.h-ref-page .search-container {
    max-width: 620px;
    margin: 0 auto;
}

.h-ref-page .search-label {
    display: block;
    margin-bottom: 15px;
    color: #d4d4d4;
    font-size: 18px;
}

.h-ref-page .search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.h-ref-page .search-input {
    min-height: 54px;
    border: 2px solid #333333;
    background: #1a1a1a;
    color: #ffffff;
    padding: 0 18px;
    font-family: var(--h-font-cormorant);
    font-size: 18px;
}

.h-ref-page .search-submit {
    min-height: 54px;
    border: 2px solid var(--h-accent);
    background: var(--h-accent);
    color: #0a0a0a;
    padding: 0 28px;
    font-family: var(--h-font-cinzel);
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 1100px) {
    .h-ref-page .tiles-grid,
    .h-ref-page .blog-grid,
    .h-ref-page .events-grid,
    .h-ref-page .cards-grid,
    .h-ref-page .steps-grid,
    .h-ref-page .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .h-ref-page .featured-hero,
    .h-ref-page .two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .h-ref-page .tiles-section,
    .h-ref-page .masonry-section,
    .h-ref-page .paper-section,
    .h-ref-page .dark-section,
    .h-ref-page .our-events-section,
    .h-ref-page .participate-section,
    .h-ref-page .platforms-section {
        padding-left: 24px;
        padding-right: 24px;
    }

    .h-ref-page .tiles-grid,
    .h-ref-page .blog-grid,
    .h-ref-page .events-grid,
    .h-ref-page .platforms-grid,
    .h-ref-page .cards-grid,
    .h-ref-page .steps-grid,
    .h-ref-page .pricing-grid,
    .h-ref-page .quick-actions {
        grid-template-columns: 1fr;
    }

    .h-ref-page .featured-post {
        padding-left: 24px;
        padding-right: 24px;
    }

    .h-ref-page .policy-shell {
        padding: 112px 14px 64px;
    }
}

@media (max-width: 560px) {
    .h-ref-page .hero {
        min-height: 340px;
        padding-top: 104px;
    }

    .h-ref-page .hero h1 {
        letter-spacing: 2px;
    }

    .h-ref-page .tile-content,
    .h-ref-page .platform-block {
        padding: 26px;
    }

    .h-ref-page .search-form,
    .h-ref-page .hero-buttons,
    .h-ref-page .error-buttons {
        grid-template-columns: 1fr;
        display: grid;
    }

    .h-ref-page .btn-gold,
    .h-ref-page .btn-outline,
    .h-ref-page .btn-follow,
    .h-ref-page .search-submit {
        width: 100%;
    }
}

/* Reference pages use the same mask-based rip model as shop/home.
   The SVG is a mask for paper color, not a detached background strip. */
.h-ref-page .h-torn-top,
.h-ref-page .h-torn-bottom {
    position: relative !important;
    display: block !important;
    height: 56px !important;
    overflow: hidden !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    transform: none !important;
    pointer-events: none;
}

.h-ref-page .h-torn-top::before,
.h-ref-page .h-torn-bottom::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--h-paper);
    clip-path: polygon(0 68%, 6% 62%, 12% 70%, 18% 64%, 24% 72%, 30% 66%, 36% 74%, 42% 68%, 48% 76%, 54% 70%, 60% 78%, 66% 71%, 72% 77%, 78% 69%, 84% 75%, 90% 67%, 96% 73%, 100% 70%, 100% 100%, 0 100%);
}

.h-ref-page .h-torn-bottom::before {
    transform: scaleY(-1);
    transform-origin: center;
}

.h-ref-page .h-torn-top::after,
.h-ref-page .h-torn-bottom::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--h-paper);
    opacity: 0;
}

@supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
    .h-ref-page .h-torn-top::before,
    .h-ref-page .h-torn-bottom::before {
        opacity: 0;
    }

    .h-ref-page .h-torn-top::after,
    .h-ref-page .h-torn-bottom::after {
        opacity: 1;
        -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg");
        -webkit-mask-size: 118% 100%;
        -webkit-mask-repeat: no-repeat;
        mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg");
        mask-size: 118% 100%;
        mask-repeat: no-repeat;
    }

    .h-ref-page .h-torn-top::after {
        -webkit-mask-position: 48% bottom;
        mask-position: 48% bottom;
    }

    .h-ref-page .h-torn-bottom::after {
        -webkit-mask-position: 52% top;
        mask-position: 52% top;
        transform: scaleY(-1);
        transform-origin: center;
    }
}

/* ===========================================
   Shared Page Section Contract
   Mirrors homepage/shop: paper owns the rip, dark sections stay plain black.
   =========================================== */

.h-ref-page {
    overflow: visible !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(20, 44, 30, 0.28), transparent 34%),
        linear-gradient(180deg, #050805 0%, #020302 58%, #050604 100%) !important;
}

.h-ref-page .h-rip-section {
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    isolation: isolate;
    background: #0a0a0a !important;
}

.h-ref-page .h-rip-paper-inner {
    position: relative;
    z-index: 2;
    background: var(--h-paper) !important;
    color: #0a0a0a;
}

.h-ref-page .h-torn-top,
.h-ref-page .h-torn-bottom {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 4 !important;
    display: block !important;
    width: 100% !important;
    height: 62px !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    transform: none !important;
    pointer-events: none;
}

.h-ref-page .h-torn-top {
    top: -61px !important;
}

.h-ref-page .h-torn-bottom {
    bottom: -61px !important;
}

.h-ref-page .h-torn-top::before,
.h-ref-page .h-torn-bottom::before,
.h-ref-page .h-torn-top::after,
.h-ref-page .h-torn-bottom::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--h-paper);
}

.h-ref-page .h-torn-top::before {
    clip-path: polygon(0 70%, 5% 64%, 10% 72%, 16% 63%, 22% 71%, 29% 65%, 35% 73%, 42% 67%, 48% 75%, 55% 69%, 61% 76%, 68% 70%, 75% 77%, 82% 68%, 89% 74%, 95% 66%, 100% 72%, 100% 100%, 0 100%);
}

.h-ref-page .h-torn-bottom::before {
    clip-path: polygon(0 70%, 5% 64%, 10% 72%, 16% 63%, 22% 71%, 29% 65%, 35% 73%, 42% 67%, 48% 75%, 55% 69%, 61% 76%, 68% 70%, 75% 77%, 82% 68%, 89% 74%, 95% 66%, 100% 72%, 100% 100%, 0 100%);
    transform: scaleY(-1);
    transform-origin: center;
}

.h-ref-page .h-torn-top::after,
.h-ref-page .h-torn-bottom::after {
    opacity: 0;
}

@supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
    .h-ref-page .h-torn-top::before,
    .h-ref-page .h-torn-bottom::before {
        opacity: 0;
    }

    .h-ref-page .h-torn-top::after,
    .h-ref-page .h-torn-bottom::after {
        opacity: 1;
        -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg");
        -webkit-mask-size: 126% 100%;
        -webkit-mask-repeat: no-repeat;
        mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg");
        mask-size: 126% 100%;
        mask-repeat: no-repeat;
    }

    .h-ref-page .h-torn-top::after {
        -webkit-mask-position: 42% bottom;
        mask-position: 42% bottom;
    }

    .h-ref-page .h-torn-bottom::after {
        -webkit-mask-position: 58% top;
        mask-position: 58% top;
        transform: scaleY(-1);
        transform-origin: center;
    }
}

.h-ref-page .h-rip-section + .participate-section,
.h-ref-page .h-rip-section + .carousel-section,
.h-ref-page .h-rip-section + .dark-section {
    position: relative;
    z-index: 1;
}

.h-ref-page .policy-shell {
    position: relative !important;
    width: min(94vw, 1480px) !important;
    max-width: 1480px !important;
    min-height: 0 !important;
    margin: 118px auto 96px !important;
    padding: 0 !important;
    isolation: isolate;
    filter: drop-shadow(0 24px 54px rgba(0, 0, 0, 0.34));
    background: transparent !important;
}

.h-ref-page .policy-paper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(34px, 6vw, 70px) !important;
    background: var(--h-paper) !important;
}

.h-ref-page .policy-shell::before,
.h-ref-page .policy-shell::after,
body.woocommerce-account .woocommerce .h-ref-page .account-shell::before,
body.woocommerce-account .woocommerce .h-ref-page .account-shell::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    height: 56px;
    background: var(--h-paper);
    pointer-events: none;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg");
    -webkit-mask-size: 140% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg");
    mask-size: 140% 100%;
    mask-repeat: no-repeat;
}

.h-ref-page .policy-shell::before,
body.woocommerce-account .woocommerce .h-ref-page .account-shell::before {
    top: -55px;
    -webkit-mask-position: 38% bottom;
    mask-position: 38% bottom;
}

.h-ref-page .policy-shell::after,
body.woocommerce-account .woocommerce .h-ref-page .account-shell::after {
    bottom: -55px;
    transform: scaleY(-1);
    -webkit-mask-position: 62% bottom;
    mask-position: 62% bottom;
}

body.woocommerce-account main .woocommerce:has(.h-ref-page) {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    position: relative !important;
    width: min(94vw, 1280px) !important;
    max-width: 1280px !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    isolation: isolate;
    filter: drop-shadow(0 24px 54px rgba(0, 0, 0, 0.34));
    background: transparent !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(34px, 5vw, 64px) !important;
    background: var(--h-paper) !important;
}

@media (max-width: 820px) {
    .h-ref-page .policy-shell,
    body.woocommerce-account .woocommerce .h-ref-page .account-shell {
        width: min(100% - 28px, 1480px) !important;
        margin-top: 112px !important;
        margin-bottom: 70px !important;
    }

    body.woocommerce-account .woocommerce .h-ref-page .account-shell {
        width: min(100% - 28px, 1280px) !important;
        margin-top: 0 !important;
    }

    .h-ref-page .h-torn-top,
    .h-ref-page .h-torn-bottom {
        height: 48px !important;
    }

    .h-ref-page .h-torn-top {
        top: -47px !important;
    }

    .h-ref-page .h-torn-bottom {
        bottom: -47px !important;
    }
}

/* Final reference-page fixes for the blog hero and Patreon training tiers. */
body.historicum-community-blog-page .h-ref-page .hero {
    min-height: 520px;
    padding: 132px 40px 90px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.9)),
        radial-gradient(circle at 30% 20%, rgba(235, 188, 0, 0.2), transparent 36%),
        url("https://historicum.pl/wp-content/uploads/2026/04/Workshop4.jpg") center/cover no-repeat !important;
}

body.historicum-community-blog-page .h-ref-page .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 38%, rgba(0, 0, 0, 0.5)),
        linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.38));
    pointer-events: none;
}

body.historicum-community-blog-page .h-ref-page .hero h1 {
    font-family: var(--h-font-cinzel);
    letter-spacing: 0.08em;
}

body.historicum-community-blog-page .h-ref-page .hero-subtitle {
    max-width: 860px;
    margin: 0 auto;
    font-family: var(--h-font-cormorant);
    font-style: normal;
}

.h-ref-page .pricing-card {
    display: flex;
    flex-direction: column;
}

.h-ref-page .tier-heading {
    margin: 0 0 16px;
    color: #111111;
    font-family: var(--h-font-cinzel);
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.18;
}

.h-ref-page .tier-description,
.h-ref-page .tier-intro,
.h-ref-page .tier-closing {
    margin: 0 0 16px;
    color: #3f372d;
    font-family: var(--h-font-cormorant);
    font-size: 18px;
    line-height: 1.48;
}

.h-ref-page .tier-intro {
    color: #111111;
    font-weight: 700;
}

.h-ref-page .tier-features {
    margin-bottom: 22px;
    text-align: left;
}

.h-ref-page .tier-features li {
    padding-left: 18px;
}

.h-ref-page .tier-features li::before {
    left: 0;
}

.h-ref-page .tier-closing {
    margin-top: auto;
    color: #111111;
    font-weight: 700;
}

.h-ref-page .pricing-card .btn-gold {
    margin-top: 8px;
}

/* Final training-page contract: homepage fonts, real images, paper rips, dark sections fading to black. */
body.historicum-training-page .h-ref-page {
    background: #000000 !important;
    font-family: var(--h-font-cormorant) !important;
}

body.historicum-training-page .h-ref-page .hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.96)),
        #000000 !important;
}

body.historicum-training-page .h-ref-page .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("https://historicum.pl/wp-content/uploads/2026/04/Landing_mainblock_2-1.jpg") center/cover no-repeat;
    opacity: 0.2;
    pointer-events: none;
}

body.historicum-training-page .h-ref-page .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 30%, rgba(235, 188, 0, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(0, 0, 0, 0), #000000 100%);
    pointer-events: none;
}

body.historicum-training-page .h-ref-page .hero-content,
body.historicum-training-page .h-ref-page .diagonal-band {
    position: relative;
    z-index: 2;
}

body.historicum-training-page .h-ref-page h1,
body.historicum-training-page .h-ref-page h2,
body.historicum-training-page .h-ref-page h3,
body.historicum-training-page .h-ref-page h4,
body.historicum-training-page .h-ref-page .section-title,
body.historicum-training-page .h-ref-page .tier-name,
body.historicum-training-page .h-ref-page .tier-heading,
body.historicum-training-page .h-ref-page .btn-gold,
body.historicum-training-page .h-ref-page .btn-outline {
    font-family: var(--h-font-cinzel) !important;
}

body.historicum-training-page .h-ref-page p,
body.historicum-training-page .h-ref-page li,
body.historicum-training-page .h-ref-page .section-subtitle {
    font-family: var(--h-font-cormorant) !important;
}

body.historicum-training-page .h-ref-page .h-rip-section {
    position: relative;
    z-index: 2;
    overflow: visible !important;
    background:
        linear-gradient(180deg, #000000 0%, #06120d 48%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-rip-paper-inner {
    position: relative;
    z-index: 2;
    width: min(100%, 1480px);
    margin: 0 auto;
    background: var(--h-paper) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom {
    position: relative !important;
    z-index: 3 !important;
    background: transparent !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top::before,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top::after,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom::before,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom::after {
    background-color: var(--h-paper) !important;
}

body.historicum-training-page .h-ref-page .dark-section {
    position: relative;
    z-index: 1;
    background:
        radial-gradient(72% 90% at 50% 12%, rgba(14, 64, 42, 0.34), rgba(0, 0, 0, 0) 62%),
        linear-gradient(180deg, #000000 0%, #07140e 48%, #000000 100%) !important;
    color: #ffffff !important;
}

body.historicum-training-page .h-ref-page .final-cta {
    background: linear-gradient(180deg, #06120d 0%, #000000 70%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .training-image-card {
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(235, 188, 0, 0.4);
    background: #000000;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
}

body.historicum-training-page .h-ref-page .training-image-card img,
body.historicum-training-page .h-ref-page .feature-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.historicum-training-page .h-ref-page .training-image-card {
    min-height: 360px;
}

body.historicum-training-page .h-ref-page .feature-card {
    overflow: hidden;
    padding: 0 0 30px !important;
    background: rgba(255, 255, 255, 0.5);
}

body.historicum-training-page .h-ref-page .feature-card img {
    aspect-ratio: 16 / 10;
    margin-bottom: 26px;
}

body.historicum-training-page .h-ref-page .feature-card h3,
body.historicum-training-page .h-ref-page .feature-card p {
    padding-right: 24px;
    padding-left: 24px;
}

body.historicum-training-page .h-ref-page .training-video-preview {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.74)),
        var(--training-video-image) center/cover no-repeat !important;
}

body.historicum-training-page .h-ref-page .thumbnail {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.28)),
        var(--training-thumb-image) center/cover no-repeat !important;
}

body.historicum-training-page .h-ref-page .training-reviews-grid {
    display: grid;
    max-width: 1180px;
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

body.historicum-training-page .h-ref-page .training-review-card {
    padding: 34px 28px;
    border: 1px solid rgba(235, 188, 0, 0.42);
    background: rgba(0, 0, 0, 0.46);
    color: #ffffff;
}

body.historicum-training-page .h-ref-page .training-review-card .h-stars {
    margin-bottom: 16px;
    color: var(--h-accent);
    letter-spacing: 0.16em;
}

body.historicum-training-page .h-ref-page .pricing-grid {
    width: min(94vw, 1400px) !important;
    max-width: 1400px !important;
    gap: clamp(18px, 2.2vw, 34px) !important;
}

body.historicum-training-page .h-ref-page .final-cta .subtitle {
    margin-bottom: 34px !important;
}

@media (max-width: 900px) {
    body.historicum-training-page .h-ref-page .training-reviews-grid,
    body.historicum-training-page .h-ref-page .pricing-grid,
    body.historicum-training-page .h-ref-page .cards-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Final training structure repair: full-width paper/dark rhythm with only a 10% hero image layer. */
body.historicum-training-page,
body.historicum-training-page .site,
body.historicum-training-page #page,
body.historicum-training-page .h-page-wrapper,
body.historicum-training-page .h-ref-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    background: #000000 !important;
}

body.historicum-training-page .h-ref-page {
    display: block !important;
    color: #ffffff !important;
}

body.historicum-training-page .h-ref-page .hero {
    position: relative !important;
    width: 100% !important;
    min-height: 600px !important;
    padding: 132px 40px 92px !important;
    overflow: hidden !important;
    background: #000000 !important;
    isolation: isolate !important;
}

body.historicum-training-page .h-ref-page .hero::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    opacity: 0.20 !important;
    pointer-events: none !important;
    background: url('https://historicum.pl/wp-content/uploads/2026/04/Landing_mainblock_2-1.jpg') center center / cover no-repeat !important;
}

body.historicum-training-page .h-ref-page .hero::after {
    content: none !important;
    display: none !important;
}

body.historicum-training-page .h-ref-page .hero-content,
body.historicum-training-page .h-ref-page .diagonal-band {
    position: relative !important;
    z-index: 2 !important;
}

body.historicum-training-page .h-ref-page .h-rip-section,
body.historicum-training-page .h-ref-page .h-ref-paper-section,
body.historicum-training-page .h-ref-page .h-rip-paper-inner,
body.historicum-training-page .h-ref-page .paper-section,
body.historicum-training-page .h-ref-page .dark-section {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

body.historicum-training-page .h-ref-page .h-rip-section,
body.historicum-training-page .h-ref-page .h-ref-paper-section {
    position: relative !important;
    background: #000000 !important;
    z-index: 1 !important;
}

body.historicum-training-page .h-ref-page .h-rip-paper-inner,
body.historicum-training-page .h-ref-page .paper-section {
    position: relative !important;
    background: var(--h-paper) !important;
    color: #111111 !important;
}

body.historicum-training-page .h-ref-page .paper-section {
    padding: clamp(52px, 6vw, 82px) clamp(28px, 6vw, 92px) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .paper-section {
    padding-top: clamp(38px, 4vw, 58px) !important;
    padding-bottom: clamp(38px, 4vw, 62px) !important;
}

body.historicum-training-page .h-ref-page .dark-section {
    position: relative !important;
    padding: clamp(72px, 7vw, 112px) clamp(28px, 6vw, 92px) !important;
    color: #ffffff !important;
    background: linear-gradient(180deg, #020806 0%, #000000 82%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .dark-section:nth-of-type(4n),
body.historicum-training-page .h-ref-page .final-cta {
    background: linear-gradient(180deg, #03110b 0%, #000000 74%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .section-title,
body.historicum-training-page .h-ref-page .section-subtitle,
body.historicum-training-page .h-ref-page .paper-section h2,
body.historicum-training-page .h-ref-page .paper-section h3,
body.historicum-training-page .h-ref-page .paper-section h4,
body.historicum-training-page .h-ref-page .paper-section p,
body.historicum-training-page .h-ref-page .paper-section li {
    color: #111111 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.historicum-training-page .h-ref-page .dark-section .section-title,
body.historicum-training-page .h-ref-page .dark-section h2,
body.historicum-training-page .h-ref-page .dark-section h3,
body.historicum-training-page .h-ref-page .dark-section p,
body.historicum-training-page .h-ref-page .dark-section li,
body.historicum-training-page .h-ref-page .dark-section strong {
    color: #ffffff !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.historicum-training-page .h-ref-page .dark-section .section-subtitle {
    color: rgba(255, 255, 255, 0.78) !important;
}

body.historicum-training-page .h-ref-page .two-column,
body.historicum-training-page .h-ref-page .cards-grid,
body.historicum-training-page .h-ref-page .steps-grid,
body.historicum-training-page .h-ref-page .pricing-grid,
body.historicum-training-page .h-ref-page .training-reviews-grid,
body.historicum-training-page .h-ref-page .video-section {
    width: min(100%, 1500px) !important;
    max-width: 1500px !important;
    margin-right: auto !important;
    margin-left: auto !important;
    overflow: visible !important;
}

body.historicum-training-page .h-ref-page .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(18px, 2vw, 30px) !important;
}

body.historicum-training-page .h-ref-page .feature-card {
    position: relative !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fffaf0 !important;
    color: #111111 !important;
    border: 1px solid rgba(36, 25, 13, 0.18) !important;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.12) !important;
}

body.historicum-training-page .h-ref-page .feature-card img {
    display: block !important;
    width: 100% !important;
    height: clamp(150px, 14vw, 230px) !important;
    object-fit: cover !important;
}

body.historicum-training-page .h-ref-page .feature-card h3,
body.historicum-training-page .h-ref-page .feature-card p {
    position: relative !important;
    z-index: 2 !important;
    color: #111111 !important;
    padding-right: 24px !important;
    padding-left: 24px !important;
}

body.historicum-training-page .h-ref-page .feature-card h3 {
    margin-top: 24px !important;
}

body.historicum-training-page .h-ref-page .feature-card p {
    padding-bottom: 28px !important;
}

body.historicum-training-page .h-ref-page .training-image-card {
    overflow: hidden !important;
    min-height: 0 !important;
    background: #050806 !important;
}

body.historicum-training-page .h-ref-page .training-image-card img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

body.historicum-training-page .h-ref-page .pricing-grid {
    width: min(96vw, 1520px) !important;
    max-width: 1520px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.historicum-training-page .h-ref-page .final-cta .subtitle {
    margin-bottom: 34px !important;
}

@media screen and (max-width: 1100px) {
    body.historicum-training-page .h-ref-page .cards-grid,
    body.historicum-training-page .h-ref-page .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media screen and (max-width: 720px) {
    body.historicum-training-page .h-ref-page .hero {
        min-height: 460px !important;
        padding: 110px 22px 70px !important;
    }

    body.historicum-training-page .h-ref-page .cards-grid,
    body.historicum-training-page .h-ref-page .pricing-grid,
    body.historicum-training-page .h-ref-page .two-column {
        grid-template-columns: 1fr !important;
    }

    body.historicum-training-page .h-ref-page .paper-section,
    body.historicum-training-page .h-ref-page .dark-section {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }
}

/* Training page final layout pass. */
body.historicum-training-page .h-ref-page .hero {
    display: flex !important;
    min-height: clamp(560px, 72vh, 760px) !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(118px, 11vw, 156px) clamp(24px, 5vw, 72px) clamp(92px, 8vw, 128px) !important;
    background:
        linear-gradient(90deg, rgba(0, 35, 23, 0.7) -18%, rgba(0, 0, 0, 0.98) 34%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .hero::before {
    opacity: 0.20 !important;
}

body.historicum-training-page .h-ref-page .hero::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    z-index: 1 !important;
    pointer-events: none !important;
    background:
        linear-gradient(90deg, rgba(0, 42, 28, 0.48) -20%, rgba(0, 0, 0, 0) 42%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.9)) !important;
}

body.historicum-training-page .h-ref-page .hero-content {
    display: flex !important;
    min-height: 320px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    text-align: center !important;
}

body.historicum-training-page .h-ref-page .diagonal-band {
    z-index: 0 !important;
    opacity: 0.055 !important;
    filter: blur(1px) !important;
}

body.historicum-training-page .h-ref-page .diagonal-band-1 {
    top: 7% !important;
    left: -42% !important;
}

body.historicum-training-page .h-ref-page .diagonal-band-2 {
    right: -44% !important;
    bottom: 9% !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .two-column {
    grid-template-columns: minmax(0, 0.92fr) minmax(260px, 420px) !important;
    max-width: 1120px !important;
    align-items: stretch !important;
    gap: clamp(28px, 4vw, 58px) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-text-card {
    display: flex !important;
    min-height: clamp(260px, 24vw, 360px) !important;
    align-items: center !important;
    padding: clamp(24px, 3vw, 44px) !important;
    border-left: 4px solid var(--h-accent) !important;
    background: rgba(255, 255, 255, 0.38) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-image-card {
    max-width: 420px !important;
    min-height: clamp(260px, 24vw, 360px) !important;
    margin: 0 !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-image-card img {
    height: 100% !important;
    min-height: clamp(260px, 24vw, 360px) !important;
    object-fit: cover !important;
}

body.historicum-training-page .h-ref-page .dark-section {
    background:
        radial-gradient(56% 88% at -14% 42%, rgba(0, 76, 50, 0.38), transparent 66%),
        radial-gradient(52% 84% at 114% 52%, rgba(0, 62, 42, 0.32), transparent 68%),
        linear-gradient(180deg, #000000 0%, #020806 48%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .dark-section:nth-of-type(4n),
body.historicum-training-page .h-ref-page .final-cta {
    background:
        radial-gradient(48% 86% at -16% 50%, rgba(0, 72, 48, 0.32), transparent 70%),
        radial-gradient(48% 86% at 116% 50%, rgba(0, 64, 42, 0.28), transparent 70%),
        linear-gradient(180deg, #000000 0%, #010403 58%, #000000 100%) !important;
}

body.historicum-training-page .h-ref-page .feature-card {
    display: flex !important;
    min-height: 100% !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.historicum-training-page .h-ref-page .feature-card p {
    flex: 1 1 auto !important;
    overflow: visible !important;
}

body.historicum-training-page .h-ref-page .video-section {
    width: min(100%, 1560px) !important;
    min-height: clamp(520px, 66vh, 820px) !important;
    display: grid !important;
    align-content: center !important;
    gap: clamp(22px, 3vw, 44px) !important;
}

body.historicum-training-page .h-ref-page .training-video-preview {
    min-height: clamp(320px, 46vw, 620px) !important;
}

body.historicum-training-page .h-ref-page .training-reviews-grid.h-training-testimonials-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
    max-width: 1280px !important;
    gap: clamp(18px, 2.4vw, 34px) !important;
}

body.historicum-training-page .h-ref-page .h-testimonial-text-card {
    min-height: 260px !important;
    padding: 32px 28px !important;
    border: 1px solid rgba(235, 188, 0, 0.34) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(20, 20, 20, 0.2)),
        #080808 !important;
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.46) !important;
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease !important;
}

body.historicum-training-page .h-ref-page .h-testimonial-text-card:hover {
    transform: translateY(-6px) !important;
    border-color: var(--h-accent) !important;
    box-shadow: 0 26px 50px rgba(0, 0, 0, 0.58) !important;
}

body.historicum-training-page .h-ref-page .h-testimonial-text-card .h-stars,
body.historicum-training-page .h-ref-page .h-testimonial-text-card .h-testimonial-name {
    color: var(--h-accent) !important;
    font-family: var(--h-font-cinzel) !important;
}

body.historicum-training-page .h-ref-page .h-testimonial-text-card .h-testimonial-text {
    color: rgba(255, 255, 255, 0.88) !important;
    font-family: var(--h-font-cormorant) !important;
    font-size: 20px !important;
    line-height: 1.45 !important;
}

body.historicum-training-page .h-ref-page .pricing-grid {
    width: min(98vw, 1680px) !important;
    max-width: 1680px !important;
    gap: clamp(16px, 2vw, 30px) !important;
}

body.historicum-training-page .h-ref-page .pricing-card {
    padding: clamp(26px, 2.8vw, 42px) !important;
}

body.historicum-training-page .h-ref-page .tier-description,
body.historicum-training-page .h-ref-page .tier-intro,
body.historicum-training-page .h-ref-page .tier-closing {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

@media screen and (max-width: 980px) {
    body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .two-column,
    body.historicum-training-page .h-ref-page .training-reviews-grid.h-training-testimonials-grid {
        grid-template-columns: 1fr !important;
    }

    body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-image-card {
        max-width: 100% !important;
    }
}

/* Training priority repair: centered hero overlay and homepage-style attached paper rips. */
body.historicum-training-page .h-ref-page .hero {
    display: grid !important;
    place-items: center !important;
    min-height: clamp(560px, 72vh, 760px) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.historicum-training-page .h-ref-page .hero::before {
    background-position: center center !important;
    background-size: cover !important;
    opacity: 0.22 !important;
}

body.historicum-training-page .h-ref-page .hero-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    z-index: 5 !important;
    width: min(920px, calc(100vw - 40px)) !important;
    min-height: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    transform: translate(-50%, -50%) !important;
}

body.historicum-training-page .h-ref-page .hero-content h1,
body.historicum-training-page .h-ref-page .hero-content .hero-subtitle {
    width: 100% !important;
    text-align: center !important;
}

body.historicum-training-page .h-ref-page .hero-buttons {
    justify-content: center !important;
}

body.historicum-training-page .h-ref-page .diagonal-band {
    z-index: 1 !important;
    opacity: 0.035 !important;
}

body.historicum-training-page .h-ref-page .diagonal-band-1 {
    left: -56% !important;
    top: 2% !important;
}

body.historicum-training-page .h-ref-page .diagonal-band-2 {
    right: -58% !important;
    bottom: 0 !important;
}

body.historicum-training-page .h-ref-page .h-rip-section,
body.historicum-training-page .h-ref-page .h-ref-paper-section {
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #000000 !important;
}

body.historicum-training-page .h-ref-page .h-rip-paper-inner {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    background: var(--h-paper) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 4 !important;
    display: block !important;
    width: 100% !important;
    height: 62px !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: var(--h-paper) !important;
    background-color: var(--h-paper) !important;
    background-image: none !important;
    pointer-events: none !important;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    -webkit-mask-repeat: no-repeat !important;
    -webkit-mask-size: 118% 100% !important;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    mask-repeat: no-repeat !important;
    mask-size: 118% 100% !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top {
    top: -61px !important;
    transform: none !important;
    -webkit-mask-position: 48% bottom !important;
    mask-position: 48% bottom !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom {
    bottom: -61px !important;
    transform: scaleY(-1) !important;
    transform-origin: center !important;
    -webkit-mask-position: 52% top !important;
    mask-position: 52% top !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top::before,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-top::after,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom::before,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom::after {
    content: none !important;
    display: none !important;
}

/* Training bottom rip repair: copy homepage bottom-edge behavior and keep it above the next dark section. */
body.historicum-training-page .h-ref-page .h-ref-paper-section {
    z-index: 6 !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section + .dark-section {
    z-index: 1 !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom {
    bottom: -61px !important;
    z-index: 30 !important;
    display: block !important;
    background-color: var(--h-paper) !important;
    background-image: none !important;
    transform: scaleY(-1) !important;
    transform-origin: center !important;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    -webkit-mask-repeat: no-repeat !important;
    -webkit-mask-size: 118% 100% !important;
    -webkit-mask-position: 52% top !important;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    mask-repeat: no-repeat !important;
    mask-size: 118% 100% !important;
    mask-position: 52% top !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom::before,
body.historicum-training-page .h-ref-page .h-ref-paper-section .h-torn-bottom::after {
    content: none !important;
    display: none !important;
    background: none !important;
    background-image: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

body.historicum-training-page .h-ref-page .final-cta .small-text a,
body.historicum-training-page .h-ref-page .final-cta .small-text a:visited {
    color: var(--h-accent, #ebbc00) !important;
}

@media screen and (max-width: 767px) {
    body.historicum-training-page .h-ref-page .pricing-grid {
        justify-items: center !important;
    }

    body.historicum-training-page .h-ref-page .pricing-card {
        width: min(100%, 420px) !important;
        margin-right: auto !important;
        margin-left: auto !important;
        text-align: center !important;
    }

    body.historicum-training-page .h-ref-page .pricing-card .tier-features {
        text-align: left !important;
    }

    body.historicum-training-page .h-ref-page .final-cta {
        padding-top: 86px !important;
        padding-bottom: 104px !important;
    }
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .paper-section {
    padding-top: clamp(42px, 5vw, 72px) !important;
    padding-bottom: clamp(44px, 5vw, 76px) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .two-column {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 330px) !important;
    max-width: 1060px !important;
    align-items: center !important;
    gap: clamp(24px, 4vw, 54px) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-text-card {
    min-height: clamp(220px, 20vw, 300px) !important;
    padding: clamp(22px, 3vw, 38px) !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-image-card {
    width: min(330px, 100%) !important;
    max-width: 330px !important;
    min-height: clamp(220px, 20vw, 300px) !important;
    justify-self: center !important;
}

body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-image-card img {
    min-height: clamp(220px, 20vw, 300px) !important;
    height: 100% !important;
}

body.historicum-training-page .h-ref-page .training-image-card-dark img {
    object-position: center center !important;
}

@media screen and (max-width: 780px) {
    body.historicum-training-page .h-ref-page .hero {
        min-height: 500px !important;
    }

    body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .two-column {
        grid-template-columns: 1fr !important;
    }

    body.historicum-training-page .h-ref-page .h-ref-paper-section:first-of-type .training-image-card {
        max-width: min(360px, 100%) !important;
    }
}

/* Community final contract: subtle hero image and a connected cream paper/footer rip. */
body.historicum-community-page .h-ref-page .hero {
    isolation: isolate !important;
    background:
        linear-gradient(180deg, #000000 0%, #050806 48%, #000000 100%) !important;
}

body.historicum-community-page .h-ref-page .hero::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: url("https://historicum.pl/wp-content/uploads/2026/05/546082371_24598669926418799_6988863607962584155_n.jpg") center/cover no-repeat !important;
    opacity: 0.2 !important;
    pointer-events: none !important;
}

body.historicum-community-page .h-ref-page .hero::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    background:
        radial-gradient(70% 80% at 14% 42%, rgba(0, 55, 36, 0.18), transparent 62%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.76)) !important;
    pointer-events: none !important;
}

body.historicum-community-page .h-ref-page .hero .diagonal-band,
body.historicum-community-page .h-ref-page .hero .hero-content {
    position: relative !important;
    z-index: 2 !important;
}

body.historicum-community-page .h-ref-page .h-ref-paper-section {
    position: relative !important;
    z-index: 4 !important;
    margin-bottom: 62px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
    background: #000000 !important;
}

body.historicum-community-page .h-ref-page .h-rip-paper-inner {
    position: relative !important;
    z-index: 2 !important;
    background: #f5f0e6 !important;
}

body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-top,
body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-bottom {
    position: absolute !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 20 !important;
    display: block !important;
    height: 62px !important;
    margin: 0 !important;
    overflow: hidden !important;
    background-color: #f5f0e6 !important;
    background-image: none !important;
    pointer-events: none !important;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    -webkit-mask-repeat: no-repeat !important;
    -webkit-mask-size: 118% 100% !important;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    mask-repeat: no-repeat !important;
    mask-size: 118% 100% !important;
}

body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-top {
    top: -61px !important;
    transform: none !important;
    -webkit-mask-position: 48% bottom !important;
    mask-position: 48% bottom !important;
}

body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-bottom {
    bottom: -61px !important;
    transform: scaleY(-1) !important;
    transform-origin: center !important;
    -webkit-mask-position: 52% top !important;
    mask-position: 52% top !important;
}

body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-top::before,
body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-top::after,
body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-bottom::before,
body.historicum-community-page .h-ref-page .h-ref-paper-section .h-torn-bottom::after {
    content: none !important;
    display: none !important;
}


/* ===========================================
   Round 2 policy/regulations continuous gradient fixes
   =========================================== */
body.historicum-policy-page,
body.historicum-privacy-page,
body.historicum-returns-page,
body.historicum-regulations-page,
body.historicum-error-page,
body.woocommerce-account {
    background-color: #000000 !important;
    background-image: linear-gradient(180deg, #102118 0%, #0b1711 18%, #060d09 38%, #020302 62%, #000000 74%, #000000 100%) !important;
    background-attachment: scroll !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    min-height: 100vh;
}

body.historicum-policy-page .h-page-wrapper,
body.historicum-privacy-page .h-page-wrapper,
body.historicum-returns-page .h-page-wrapper,
body.historicum-regulations-page .h-page-wrapper,
body.historicum-error-page .h-page-wrapper,
body.woocommerce-account .h-page-wrapper,
.h-ref-page,
.h-ref-page .policy-shell,
body.woocommerce-account .account-shell {
    background: transparent !important;
}

/* ===========================================
   GLOBAL PAPER RIP FIX
   Ensure dark sections allow torn edges to render
   into their space from adjacent rip-sections.
   =========================================== */
.h-ref-page .dark-section,
.h-ref-page .hero,
.h-ref-page section.dark-section,
.h-ref-page section.hero {
    position: relative;
    overflow: visible !important;
    z-index: 1;
}

.h-ref-page .h-rip-section {
    position: relative !important;
    overflow: visible !important;
    z-index: 3;
}

.h-ref-page .h-rip-section .h-rip-paper-inner {
    position: relative;
    z-index: 2;
}

.h-ref-page .h-torn-top,
.h-ref-page .h-torn-bottom {
    z-index: 4 !important;
    pointer-events: none;
}

/* ===========================================
   Commerce shell normalization
   - one paper-rip system for checkout/account
   - regulations-style background and spacing
   =========================================== */
body.historicum-checkout-page,
body.historicum-account-page,
body.woocommerce-account {
    background:
        radial-gradient(ellipse at 18% 8%, rgba(153, 113, 16, 0.16), transparent 44%),
        linear-gradient(180deg, #0b0905 0%, #070603 42%, #020202 78%, #000000 100%) !important;
    background-attachment: scroll !important;
}

body.historicum-checkout-page header:not(#h-header):not(.h-header),
body.historicum-checkout-page .site-header:not(#h-header):not(.h-header),
body.historicum-checkout-page #masthead,
body.historicum-checkout-page footer:not(#h-site-footer):not(.h-site-footer),
body.historicum-checkout-page .site-footer:not(#h-site-footer):not(.h-site-footer),
body.historicum-checkout-page #colophon,
body.historicum-account-page header:not(#h-header):not(.h-header),
body.historicum-account-page .site-header:not(#h-header):not(.h-header),
body.historicum-account-page #masthead,
body.historicum-account-page footer:not(#h-site-footer):not(.h-site-footer),
body.historicum-account-page .site-footer:not(#h-site-footer):not(.h-site-footer),
body.historicum-account-page #colophon,
body.woocommerce-account header:not(#h-header):not(.h-header),
body.woocommerce-account .site-header:not(#h-header):not(.h-header),
body.woocommerce-account #masthead,
body.woocommerce-account footer:not(#h-site-footer):not(.h-site-footer),
body.woocommerce-account .site-footer:not(#h-site-footer):not(.h-site-footer),
body.woocommerce-account #colophon,
body.woocommerce-account .footer-widgets,
body.woocommerce-account .botiga-footer,
body.woocommerce-account .botiga-copyright {
    display: none !important;
}

body.historicum-checkout-page .site-content,
body.historicum-checkout-page #page,
body.historicum-account-page .site-content,
body.historicum-account-page #page,
body.woocommerce-account .site-content,
body.woocommerce-account #page {
    background: transparent !important;
}

body.historicum-checkout-page .h-ref-page .h-checkout-policy-shell {
    width: min(96vw, 1360px) !important;
    max-width: 1360px !important;
    margin: 118px auto 92px !important;
}

body.historicum-checkout-page .h-checkout-policy-paper {
    max-width: none !important;
}

body.historicum-checkout-page .h-checkout-main-title {
    margin: 0 0 26px;
}

body.historicum-checkout-page .h-checkout-topline {
    margin-bottom: 28px;
}

body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    width: min(96vw, 1320px) !important;
    max-width: 1320px !important;
    margin: 118px auto 92px !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    width: 100% !important;
    max-width: none !important;
    padding: clamp(34px, 5vw, 64px) !important;
}

body.woocommerce-account .h-ref-page-account .account-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 38px;
    align-items: start;
}

body.woocommerce-account .h-ref-page-account .account-content {
    min-width: 0;
    display: grid;
    gap: 26px;
}

body.woocommerce-account .h-ref-page-account .account-card {
    padding: clamp(22px, 2.2vw, 34px);
}

@media (max-width: 991px) {
    body.historicum-checkout-page .h-ref-page .h-checkout-policy-shell,
    body.woocommerce-account .woocommerce .h-ref-page .account-shell {
        width: min(100% - 24px, 1360px) !important;
        margin-top: 104px !important;
    }

    body.woocommerce-account .h-ref-page-account .account-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===========================================
   Commerce tuning (2026-05-14)
   =========================================== */
body.historicum-checkout-page .h-ref-page .h-checkout-policy-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 90px !important;
}

body.historicum-checkout-page .h-checkout-policy-paper {
    width: 100% !important;
    max-width: none !important;
    padding: clamp(30px, 3.5vw, 56px) !important;
}

body.historicum-checkout-page .h-checkout-main-title {
    margin: 0 0 28px !important;
    font-family: var(--h-font-cinzel) !important;
    font-size: clamp(36px, 5vw, 62px) !important;
    letter-spacing: 0.06em !important;
    line-height: 1.08 !important;
    text-transform: uppercase !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr) !important;
    gap: 30px !important;
    align-items: start !important;
}

body.historicum-checkout-page .h-med-checkout-forms {
    display: grid !important;
    gap: 24px !important;
}

body.historicum-checkout-page .h-checkout-panel,
body.historicum-checkout-page .h-checkout-summary-panel {
    border-radius: 10px !important;
    overflow: hidden;
}

@media (max-width: 959px) {
    body.historicum-checkout-page .h-med-checkout-layout {
        grid-template-columns: 1fr !important;
    }
}

body.historicum-cart-page .h-med-cart-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.26fr) minmax(300px, 0.74fr) !important;
    gap: 24px !important;
    align-items: start !important;
}

body.historicum-cart-page .h-med-cart-header,
body.historicum-cart-page .h-med-cart-item {
    grid-template-columns: minmax(280px, 2.4fr) minmax(88px, 1fr) minmax(88px, 1fr) minmax(122px, 1fr) minmax(96px, 1fr) 86px !important;
    gap: 14px !important;
}

body.historicum-cart-page .h-med-cart-header span,
body.historicum-cart-page .h-med-cart-item {
    letter-spacing: 0.04em !important;
}

body.historicum-cart-page .h-med-order-summary {
    padding: 24px !important;
}

@media (max-width: 1180px) and (min-width: 901px) {
    body.historicum-cart-page .h-med-cart-layout {
        grid-template-columns: minmax(0, 1.22fr) minmax(280px, 0.78fr) !important;
    }
}

body.woocommerce-account .entry-content > .woocommerce,
body.woocommerce-account main .woocommerce {
    width: min(99vw, 1600px) !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    width: min(99vw, 1600px) !important;
    max-width: 1600px !important;
    margin: 110px auto 90px !important;
}

body.woocommerce-account .h-ref-page-account .account-greeting {
    margin: 6px 0 32px !important;
    text-align: left !important;
}

body.woocommerce-account .h-ref-page-account .account-grid {
    grid-template-columns: 320px minmax(0, 1fr) !important;
    gap: 36px !important;
}

body.woocommerce-account .h-ref-page-account .account-nav {
    display: grid !important;
    gap: 12px !important;
}

body.woocommerce-account .h-ref-page-account .account-nav a,
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    border: 2px solid #0a0a0a !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
}

body.woocommerce-account .h-ref-page-account .account-content,
body.woocommerce-account .h-ref-page-account .account-native-content {
    display: grid;
    gap: 22px;
}

body.woocommerce-account .h-ref-page-account .account-native-content,
body.woocommerce-account .h-ref-page-account .account-native-content table,
body.woocommerce-account .h-ref-page-account .account-native-content .shop_table,
body.woocommerce-account .h-ref-page-account .account-native-content form,
body.woocommerce-account .h-ref-page-account .account-native-content .woocommerce-Addresses {
    width: 100% !important;
}

body.woocommerce-account .h-ref-page-account .account-native-content .shop_table,
body.woocommerce-account .h-ref-page-account .account-native-content table {
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.42);
}

body.woocommerce-account .h-ref-page-account .account-native-content th,
body.woocommerce-account .h-ref-page-account .account-native-content td {
    padding: 14px !important;
}

@media (max-width: 991px) {
    body.historicum-checkout-page .h-ref-page .h-checkout-policy-shell,
    body.woocommerce-account .woocommerce .h-ref-page .account-shell {
        width: calc(100% - 20px) !important;
        margin: 98px auto 70px !important;
    }

    body.woocommerce-account .h-ref-page-account .account-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   Commerce alignment hotfix (2026-05-14 b)
   =========================================== */
body.historicum-checkout-page,
body.historicum-account-page,
body.woocommerce-account {
    margin: 0 !important;
}

body.historicum-checkout-page .h-page-wrapper.h-checkout-page-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.historicum-checkout-page .h-ref-page.h-checkout-page-shell .h-checkout-policy-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 90px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.historicum-checkout-page .h-checkout-policy-paper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

body.woocommerce-account .h-page-wrapper.h-account-page-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 90px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.woocommerce-account .h-ref-page-account .account-title {
    display: inline !important;
    margin: 0 !important;
}

body.woocommerce-account .h-ref-page-account .account-greeting {
    display: inline !important;
    margin: 0 0 0 14px !important;
    text-align: left !important;
    vertical-align: baseline;
}

body.woocommerce-account .h-ref-page-account .account-grid {
    margin-top: 24px !important;
}

body.woocommerce-account .h-ref-page-account .account-nav a,
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    border-width: 1px !important;
}

body.woocommerce-account .h-ref-page-account .account-native-content,
body.woocommerce-account .h-ref-page-account .account-native-content p,
body.woocommerce-account .h-ref-page-account .account-native-content li,
body.woocommerce-account .h-ref-page-account .account-native-content span,
body.woocommerce-account .h-ref-page-account .account-native-content td,
body.woocommerce-account .h-ref-page-account .account-native-content th,
body.woocommerce-account .h-ref-page-account .account-native-content a,
body.woocommerce-account .h-ref-page-account .account-native-content h2,
body.woocommerce-account .h-ref-page-account .account-native-content h3,
body.woocommerce-account .h-ref-page-account .account-native-content label {
    color: #0a0a0a !important;
}

@media (max-width: 991px) {
    body.historicum-checkout-page .h-ref-page.h-checkout-page-shell .h-checkout-policy-shell,
    body.woocommerce-account .woocommerce .h-ref-page .account-shell {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.woocommerce-account .h-ref-page-account .account-title,
    body.woocommerce-account .h-ref-page-account .account-greeting {
        display: block !important;
    }

    body.woocommerce-account .h-ref-page-account .account-greeting {
        margin: 10px 0 0 !important;
    }
}

/* ===========================================
   Final account/checkout authority (2026-05-14 f)
   =========================================== */
.h-ref-page-account .account-shell,
body.historicum-account-page .woocommerce .h-ref-page .account-shell,
body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 92px !important;
    padding: 0 !important;
    background: transparent !important;
    filter: drop-shadow(0 24px 54px rgba(0, 0, 0, 0.34));
    isolation: isolate;
}

.h-ref-page-account .account-paper,
body.historicum-account-page .woocommerce .h-ref-page .account-paper,
body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(34px, 4vw, 62px) max(24px, calc((100vw - 1400px) / 2)) !important;
    background: var(--h-paper) !important;
}

.h-ref-page-account .account-shell::before,
.h-ref-page-account .account-shell::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1 !important;
    height: 56px !important;
    background: var(--h-paper) !important;
    pointer-events: none !important;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    -webkit-mask-size: 140% 100% !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    mask-size: 140% 100% !important;
    mask-repeat: no-repeat !important;
}

.h-ref-page-account .account-shell::before {
    top: -55px !important;
    -webkit-mask-position: 38% bottom !important;
    mask-position: 38% bottom !important;
}

.h-ref-page-account .account-shell::after {
    bottom: -55px !important;
    transform: scaleY(-1) !important;
    -webkit-mask-position: 62% bottom !important;
    mask-position: 62% bottom !important;
}

.h-ref-page-account .account-heading,
.h-ref-page-account .account-grid {
    width: 100% !important;
    max-width: 1400px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.h-ref-page-account .account-heading {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 14px 18px !important;
    margin-bottom: 30px !important;
}

.h-ref-page-account .account-title,
.h-ref-page-account .account-greeting {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: left !important;
}

.h-ref-page-account .account-grid {
    display: grid !important;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
    gap: 38px !important;
    align-items: start !important;
    justify-content: center !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 760px) minmax(430px, 540px) !important;
    justify-content: center !important;
    gap: 32px !important;
    align-items: start !important;
}

body.historicum-checkout-page .h-checkout-panel {
    padding: 24px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    width: 100% !important;
    max-width: none !important;
    padding: 24px !important;
    justify-self: stretch !important;
}

body.historicum-checkout-page .h-checkout-review-order th,
body.historicum-checkout-page .h-checkout-review-order td {
    padding: 10px 0 !important;
    vertical-align: top !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
}

@media (max-width: 991px) {
    .h-ref-page-account .account-paper {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }

    .h-ref-page-account .account-grid,
    body.historicum-checkout-page .h-med-checkout-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   Checkout layout from marked reference
   =========================================== */
body.historicum-checkout-page .h-checkout-policy-paper .h-med-checkout-form {
    width: min(1280px, 94vw) !important;
    max-width: 1280px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    display: grid !important;
    grid-template-columns: minmax(420px, 540px) minmax(500px, 620px) !important;
    justify-content: center !important;
    align-items: start !important;
    gap: 36px !important;
}

body.historicum-checkout-page .h-med-checkout-forms {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    min-width: 0 !important;
}

body.historicum-checkout-page .h-checkout-billing,
body.historicum-checkout-page .h-checkout-shipping {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

body.historicum-checkout-page .h-checkout-panel {
    padding: 22px 24px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 22px 26px !important;
    align-self: start !important;
    justify-self: stretch !important;
}

body.historicum-checkout-page .h-checkout-summary-panel h2 {
    margin-bottom: 14px !important;
    padding-bottom: 12px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel p {
    margin: 0 0 16px !important;
}

body.historicum-checkout-page .h-checkout-review-order table,
body.historicum-checkout-page .h-checkout-review-order .shop_table {
    width: 100% !important;
    table-layout: fixed !important;
}

body.historicum-checkout-page .h-checkout-review-order th,
body.historicum-checkout-page .h-checkout-review-order td {
    padding: 9px 0 !important;
    line-height: 1.35 !important;
    vertical-align: top !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

body.historicum-checkout-page .h-checkout-review-order .product-name {
    width: 68% !important;
}

body.historicum-checkout-page .h-checkout-review-order .product-total {
    width: 32% !important;
    text-align: right !important;
    white-space: nowrap !important;
}

body.historicum-checkout-page .h-checkout-review-order #payment {
    margin-top: 16px !important;
}

body.historicum-checkout-page .h-checkout-review-order #payment div.payment_box {
    margin: 12px 0 !important;
    padding: 14px !important;
}

body.historicum-checkout-page .h-checkout-review-order #place_order {
    margin-top: 14px !important;
}

@media (max-width: 1120px) {
    body.historicum-checkout-page .h-med-checkout-layout {
        grid-template-columns: 1fr !important;
        width: min(720px, 100%) !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }
}

/* ===========================================
   Account inner authority
   =========================================== */
.h-ref-page-account {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.h-ref-page-account .account-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 92px !important;
}

.h-ref-page-account .account-paper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(34px, 4vw, 62px) 24px !important;
}

.h-ref-page-account .account-inner {
    width: min(1400px, 100%) !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

.h-ref-page-account .account-heading,
.h-ref-page-account .account-grid {
    width: 100% !important;
    max-width: none !important;
}

.h-ref-page-account .account-grid {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    grid-template-columns: minmax(0, 720px) minmax(500px, 620px) !important;
    gap: 32px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    padding: 20px !important;
}

@media (max-width: 991px) {
    .h-ref-page-account .account-grid,
    body.historicum-checkout-page .h-med-checkout-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   Account + checkout stabilisation (2026-05-14 e)
   =========================================== */
body.historicum-account-page,
body.woocommerce-account {
    background:
        radial-gradient(ellipse at 18% 8%, rgba(153, 113, 16, 0.16), transparent 44%),
        linear-gradient(180deg, #0b0905 0%, #060503 48%, #000000 92%, #000000 100%) !important;
}

body.historicum-account-page .h-account-page-shell,
body.woocommerce-account .h-account-page-shell,
body.historicum-account-page .h-ref-page-account,
body.woocommerce-account .h-ref-page-account {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.h-ref-page-account .account-shell,
body.historicum-account-page .woocommerce .h-ref-page .account-shell,
body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 92px !important;
    padding: 0 !important;
    background: transparent !important;
    filter: drop-shadow(0 24px 54px rgba(0, 0, 0, 0.34));
    isolation: isolate;
}

.h-ref-page-account .account-paper,
body.historicum-account-page .woocommerce .h-ref-page .account-paper,
body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(34px, 4vw, 62px) max(24px, calc((100vw - 1400px) / 2)) !important;
    background: var(--h-paper) !important;
}

.h-ref-page-account .account-shell::before,
.h-ref-page-account .account-shell::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1 !important;
    height: 56px !important;
    background: var(--h-paper) !important;
    pointer-events: none !important;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    -webkit-mask-size: 140% 100% !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    mask-size: 140% 100% !important;
    mask-repeat: no-repeat !important;
}

.h-ref-page-account .account-shell::before {
    top: -55px !important;
    -webkit-mask-position: 38% bottom !important;
    mask-position: 38% bottom !important;
}

.h-ref-page-account .account-shell::after {
    bottom: -55px !important;
    transform: scaleY(-1) !important;
    -webkit-mask-position: 62% bottom !important;
    mask-position: 62% bottom !important;
}

.h-ref-page-account .account-heading,
.h-ref-page-account .account-grid {
    width: 100% !important;
    max-width: 1400px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.h-ref-page-account .account-heading {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 14px 18px !important;
    margin-bottom: 30px !important;
}

.h-ref-page-account .account-title,
.h-ref-page-account .account-greeting {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: left !important;
}

.h-ref-page-account .account-grid {
    display: grid !important;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
    gap: 38px !important;
    align-items: start !important;
    justify-content: center !important;
}

.h-ref-page-account .account-nav a,
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    border-width: 1px !important;
}

.h-ref-page-account .account-native-content,
.h-ref-page-account .account-native-content * {
    color: #0a0a0a !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 760px) minmax(430px, 540px) !important;
    justify-content: center !important;
    gap: 32px !important;
    align-items: start !important;
}

body.historicum-checkout-page .h-checkout-panel {
    padding: 24px !important;
}

body.historicum-checkout-page .h-checkout-shipping {
    padding-bottom: 20px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    width: 100% !important;
    max-width: none !important;
    padding: 24px !important;
    justify-self: stretch !important;
}

body.historicum-checkout-page .h-checkout-summary-panel p {
    margin-bottom: 16px !important;
}

body.historicum-checkout-page .h-checkout-review-order th,
body.historicum-checkout-page .h-checkout-review-order td {
    padding: 10px 0 !important;
    vertical-align: top !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
}

body.historicum-checkout-page .h-checkout-review-order .product-name {
    min-width: 180px;
}

body.historicum-checkout-page .h-checkout-review-order #payment {
    margin-top: 16px !important;
}

body.historicum-checkout-page .h-checkout-review-order #place_order {
    margin-top: 14px !important;
}

@media (max-width: 991px) {
    .h-ref-page-account .account-paper {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }

    .h-ref-page-account .account-grid,
    body.historicum-checkout-page .h-med-checkout-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   Layout refinement (2026-05-14 c)
   =========================================== */
body.historicum-checkout-page .h-checkout-policy-paper .h-checkout-heading-row,
body.historicum-checkout-page .h-checkout-policy-paper .h-checkout-topline,
body.historicum-checkout-page .h-checkout-policy-paper .h-med-checkout-form,
body.historicum-checkout-page .h-checkout-policy-paper .h-checkout-endpoint-content {
    width: min(1360px, 94vw) !important;
    max-width: 1360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.historicum-checkout-page .h-checkout-heading-row,
body.historicum-checkout-page .h-checkout-main-title {
    text-align: center !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr) !important;
    gap: 30px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    width: 100% !important;
    max-width: 460px !important;
    justify-self: end !important;
}

body.historicum-cart-page .h-commerce-rec-copy {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 112px;
}

body.historicum-cart-page .h-commerce-rec-copy strong,
body.historicum-cart-page .h-commerce-rec-copy em {
    text-align: center !important;
    align-self: center !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    padding: 0 !important;
}

body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(34px, 4vw, 64px) 0 !important;
}

body.woocommerce-account .h-ref-page-account .account-grid {
    width: min(1360px, 94vw) !important;
    max-width: 1360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.woocommerce-account .h-ref-page-account .account-title {
    width: auto !important;
    max-width: none !important;
    text-align: left !important;
}

body.woocommerce-account .h-ref-page-account .account-greeting {
    width: auto !important;
    max-width: none !important;
    text-align: left !important;
}

/* ===========================================
   Stable commerce layout reset (2026-05-14 d)
   =========================================== */
body.historicum-checkout-page .h-page-wrapper.h-checkout-page-shell,
body.historicum-checkout-page .h-ref-page.h-checkout-page-shell,
body.historicum-account-page .h-page-wrapper.h-account-page-shell,
body.historicum-account-page .h-ref-page-account,
body.historicum-account-page .woocommerce,
body.woocommerce-account .h-page-wrapper.h-account-page-shell,
body.woocommerce-account .h-ref-page-account,
body.woocommerce-account .woocommerce {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    overflow: visible !important;
}

body.historicum-checkout-page .h-ref-page.h-checkout-page-shell .h-checkout-policy-shell,
body.historicum-account-page .woocommerce .h-ref-page .account-shell,
body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 110px 0 90px !important;
    padding: 0 !important;
}

body.historicum-checkout-page .h-checkout-policy-paper,
body.historicum-account-page .woocommerce .h-ref-page .account-paper,
body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-top: clamp(34px, 4vw, 64px) !important;
    padding-bottom: clamp(34px, 4vw, 64px) !important;
    padding-right: max(24px, calc((100vw - 1480px) / 2)) !important;
    padding-left: max(24px, calc((100vw - 1480px) / 2)) !important;
}

body.historicum-checkout-page .h-checkout-policy-paper .h-checkout-heading-row,
body.historicum-checkout-page .h-checkout-policy-paper .h-checkout-topline,
body.historicum-checkout-page .h-checkout-policy-paper .h-med-checkout-form,
body.historicum-checkout-page .h-checkout-policy-paper .h-checkout-endpoint-content {
    width: 100% !important;
    max-width: 1480px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 820px) minmax(440px, 560px) !important;
    justify-content: center !important;
    gap: 34px !important;
    align-items: start !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch !important;
}

body.historicum-checkout-page .h-checkout-review-order table {
    width: 100% !important;
    table-layout: auto !important;
}

body.historicum-checkout-page .h-checkout-review-order th,
body.historicum-checkout-page .h-checkout-review-order td {
    word-break: normal !important;
    overflow-wrap: normal !important;
}

body.historicum-checkout-page .h-checkout-review-order .product-name {
    min-width: 190px;
}

body.historicum-account-page .h-ref-page-account .account-grid,
body.woocommerce-account .h-ref-page-account .account-grid {
    width: 100% !important;
    max-width: 1480px !important;
    margin: 28px auto 0 !important;
    grid-template-columns: minmax(240px, 300px) minmax(0, 980px) !important;
    justify-content: center !important;
    gap: 38px !important;
}

body.historicum-account-page .h-ref-page-account .account-title,
body.woocommerce-account .h-ref-page-account .account-title {
    display: inline !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: left !important;
}

body.historicum-account-page .h-ref-page-account .account-greeting,
body.woocommerce-account .h-ref-page-account .account-greeting {
    display: inline !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 0 0 14px !important;
    color: #4a4339 !important;
    text-align: left !important;
}

body.historicum-account-page .h-ref-page-account .account-nav a,
body.woocommerce-account .h-ref-page-account .account-nav a,
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    border-width: 1px !important;
}

body.historicum-account-page .h-ref-page-account .account-native-content,
body.historicum-account-page .h-ref-page-account .account-native-content *,
body.woocommerce-account .h-ref-page-account .account-native-content,
body.woocommerce-account .h-ref-page-account .account-native-content * {
    color: #0a0a0a !important;
}

@media (max-width: 991px) {
    body.historicum-checkout-page .h-checkout-policy-paper,
    body.historicum-account-page .woocommerce .h-ref-page .account-paper,
    body.woocommerce-account .woocommerce .h-ref-page .account-paper {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }

    body.historicum-checkout-page .h-med-checkout-layout,
    body.historicum-account-page .h-ref-page-account .account-grid,
    body.woocommerce-account .h-ref-page-account .account-grid {
        grid-template-columns: 1fr !important;
    }

    body.historicum-account-page .h-ref-page-account .account-title,
    body.historicum-account-page .h-ref-page-account .account-greeting,
    body.woocommerce-account .h-ref-page-account .account-title,
    body.woocommerce-account .h-ref-page-account .account-greeting {
        display: block !important;
    }

    body.historicum-account-page .h-ref-page-account .account-greeting,
    body.woocommerce-account .h-ref-page-account .account-greeting {
        margin: 10px 0 0 !important;
    }
}

/* ===========================================
   Final commerce layout authority
   =========================================== */
body.historicum-account-page,
body.woocommerce-account {
    background:
        radial-gradient(circle at 24% 0%, rgba(151, 101, 17, 0.34), transparent 36%),
        radial-gradient(circle at 78% 18%, rgba(85, 58, 9, 0.28), transparent 34%),
        linear-gradient(180deg, #161006 0%, #0c0905 48%, #030303 100%) !important;
}

body.historicum-account-page .h-account-page-shell,
body.woocommerce-account .h-account-page-shell,
body.historicum-account-page .site-content,
body.historicum-account-page #primary,
body.historicum-account-page .site-main,
body.historicum-account-page main .woocommerce,
body.woocommerce-account .site-content,
body.woocommerce-account #primary,
body.woocommerce-account .site-main,
body.woocommerce-account main .woocommerce,
body.woocommerce-account .entry-content > .woocommerce {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    float: none !important;
}

body.historicum-account-page main .woocommerce,
body.historicum-account-page main .woocommerce:has(.h-ref-page-account),
body.woocommerce-account main .woocommerce,
body.woocommerce-account main .woocommerce:has(.h-ref-page-account),
body.woocommerce-account main .woocommerce:has(.h-ref-page) {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    overflow: visible !important;
}

body.woocommerce-account .container,
body.woocommerce-account .content-wrapper,
body.woocommerce-account .content-area {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

.h-ref-page-account {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.h-ref-page-account .account-shell,
body.historicum-account-page .woocommerce .h-ref-page .account-shell,
body.woocommerce-account .woocommerce .h-ref-page .account-shell {
    position: relative !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 112px 0 96px !important;
    padding: 0 !important;
    background: transparent !important;
    filter: drop-shadow(0 24px 54px rgba(0, 0, 0, 0.34));
    isolation: isolate;
}

.h-ref-page-account .account-paper,
body.historicum-account-page .woocommerce .h-ref-page .account-paper,
body.woocommerce-account .woocommerce .h-ref-page .account-paper {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(38px, 4.6vw, 70px) clamp(20px, 3.4vw, 52px) !important;
    background: var(--h-paper) !important;
}

.h-ref-page-account .account-shell::before,
.h-ref-page-account .account-shell::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1 !important;
    display: block !important;
    width: auto !important;
    height: 56px !important;
    background: var(--h-paper) !important;
    pointer-events: none !important;
    -webkit-mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    -webkit-mask-size: 140% 100% !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-image: url("https://historicum.pl/wp-content/uploads/2026/04/torn-edge.svg") !important;
    mask-size: 140% 100% !important;
    mask-repeat: no-repeat !important;
}

.h-ref-page-account .account-shell::before {
    top: -55px !important;
    -webkit-mask-position: 50% bottom !important;
    mask-position: 50% bottom !important;
}

.h-ref-page-account .account-shell::after {
    bottom: -55px !important;
    transform: scaleY(-1) !important;
    -webkit-mask-position: 50% bottom !important;
    mask-position: 50% bottom !important;
}

.h-ref-page-account .account-inner,
.h-ref-page-account .account-heading,
.h-ref-page-account .account-grid {
    box-sizing: border-box !important;
    width: min(1400px, 100%) !important;
    max-width: 1400px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.h-ref-page-account .account-heading {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 12px 18px !important;
    margin-bottom: 30px !important;
    text-align: left !important;
}

.h-ref-page-account .account-title,
.h-ref-page-account .account-greeting {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: left !important;
}

.h-ref-page-account .account-grid {
    display: grid !important;
    grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) !important;
    gap: 38px !important;
    align-items: start !important;
    justify-content: center !important;
}

.h-ref-page-account .account-nav,
body.woocommerce-account .woocommerce-MyAccount-navigation {
    width: 100% !important;
    max-width: none !important;
}

.h-ref-page-account .account-nav a,
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    border-width: 1px !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
}

.h-ref-page-account .account-content,
.h-ref-page-account .account-native-content,
.h-ref-page-account .account-card {
    min-width: 0 !important;
}

.h-ref-page-account .account-native-content,
.h-ref-page-account .account-native-content * {
    color: #0a0a0a !important;
}

body.historicum-checkout-page .h-checkout-policy-paper .h-med-checkout-form {
    width: min(1220px, 94vw) !important;
    max-width: 1220px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

body.historicum-checkout-page .h-med-checkout-layout {
    display: grid !important;
    grid-template-columns: minmax(390px, 530px) minmax(500px, 610px) !important;
    justify-content: center !important;
    align-items: start !important;
    gap: clamp(26px, 3vw, 42px) !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

body.historicum-checkout-page .h-med-checkout-forms {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.historicum-checkout-page .h-checkout-panel,
body.historicum-checkout-page .h-checkout-summary-panel {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}

body.historicum-checkout-page .h-checkout-panel {
    padding: 22px 24px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel {
    justify-self: stretch !important;
    align-self: start !important;
    padding: 22px clamp(22px, 2.4vw, 30px) !important;
}

body.historicum-checkout-page .h-checkout-summary-panel h2 {
    margin-bottom: 14px !important;
    padding-bottom: 12px !important;
}

body.historicum-checkout-page .h-checkout-summary-panel p {
    max-width: 260px !important;
    margin: 0 0 16px !important;
}

body.historicum-checkout-page .h-checkout-review-order table,
body.historicum-checkout-page .h-checkout-review-order .shop_table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

body.historicum-checkout-page .h-checkout-review-order th,
body.historicum-checkout-page .h-checkout-review-order td {
    padding: 9px 0 !important;
    line-height: 1.35 !important;
    vertical-align: top !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

body.historicum-checkout-page .h-checkout-review-order .product-name {
    width: 68% !important;
    min-width: 0 !important;
}

body.historicum-checkout-page .h-checkout-review-order .product-total {
    width: 32% !important;
    text-align: right !important;
    white-space: nowrap !important;
}

body.historicum-checkout-page .h-checkout-review-order #payment,
body.historicum-checkout-page .h-checkout-review-order .woocommerce-checkout-payment {
    margin-top: 16px !important;
}

body.historicum-checkout-page .h-checkout-review-order .payment_box,
body.historicum-checkout-page .h-checkout-review-order .woocommerce-privacy-policy-text {
    padding: 14px !important;
}

body.historicum-checkout-page .h-checkout-review-order #place_order {
    margin-top: 14px !important;
}

@media (max-width: 1120px) {
    body.historicum-checkout-page .h-checkout-policy-paper .h-med-checkout-form {
        width: min(760px, 94vw) !important;
    }

    body.historicum-checkout-page .h-med-checkout-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 991px) {
    .h-ref-page-account .account-paper {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }

    .h-ref-page-account .account-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .h-ref-page-account .account-heading {
        display: block !important;
    }

    .h-ref-page-account .account-greeting {
        margin-top: 10px !important;
    }
}

/* Community page final structure contract. */
body.historicum-community-page .h-ref-page .hero {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: clamp(460px, 44vw, 620px) !important;
    padding: 124px 32px 88px !important;
    overflow: hidden !important;
    background:
        radial-gradient(86% 88% at 16% 46%, rgba(0, 54, 35, 0.44), rgba(0, 0, 0, 0) 68%),
        linear-gradient(135deg, #052819 0%, #011108 44%, #000000 100%) !important;
}

body.historicum-community-page .h-ref-page .hero::before {
    opacity: 0.26 !important;
}

body.historicum-community-page .h-ref-page .hero::after {
    background:
        radial-gradient(92% 86% at 16% 48%, rgba(0, 54, 35, 0.42), rgba(0, 15, 10, 0.2) 42%, rgba(0, 0, 0, 0) 72%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.82)) !important;
}

body.historicum-community-page .h-ref-page .hero .diagonal-band {
    display: none !important;
}

body.historicum-community-page .h-ref-page .hero-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    text-align: center !important;
}

body.historicum-community-page .h-ref-page .hero h1,
body.historicum-community-page .h-ref-page .hero-subtitle {
    text-align: center !important;
}

body.historicum-community-page .h-ref-page .tiles-section {
    max-width: 1500px !important;
    padding: clamp(54px, 6vw, 86px) clamp(20px, 5vw, 80px) !important;
}

body.historicum-community-page .h-ref-page .destination-tile {
    border-radius: 8px !important;
    background: #03120c !important;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.2) !important;
}

body.historicum-community-page .h-ref-page .destination-tile::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0.62) 54%, rgba(0, 0, 0, 0.96) 84%, #000000 100%) !important;
    pointer-events: none !important;
}

body.historicum-community-page .h-ref-page .tile-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(50%);
    transform: scale(1.01);
    transition: transform 0.35s ease;
}

body.historicum-community-page .h-ref-page .destination-tile:hover .tile-image {
    transform: scale(1.05);
}

body.historicum-community-page .h-ref-page .tile-content {
    display: flex !important;
    min-height: 100% !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding: 30px !important;
}

body.historicum-community-page .h-ref-page .tile-title {
    margin-bottom: 8px !important;
    color: #ffffff !important;
    font-size: clamp(24px, 2.1vw, 34px) !important;
    line-height: 1.08 !important;
}

body.historicum-community-page .h-ref-page .tile-description {
    margin-bottom: 18px !important;
    color: rgba(255, 255, 255, 0.86) !important;
}

body.historicum-community-page .h-ref-page .tile-category,
body.historicum-community-page .h-ref-page .tile-link {
    color: var(--h-accent, #ebbc00) !important;
}

body.historicum-community-page .h-ref-page .destination-tile.is-work-in-progress {
    cursor: default !important;
    opacity: 0.54 !important;
    filter: grayscale(1) saturate(0.35) !important;
}

body.historicum-community-page .h-ref-page .destination-tile.is-work-in-progress:hover {
    transform: none !important;
}

body.historicum-community-page .h-ref-page .destination-tile.is-work-in-progress .tile-image {
    filter: grayscale(1) saturate(0.25) brightness(0.72) !important;
    transform: scale(1.01) !important;
}

body.historicum-community-page .h-ref-page .destination-tile.is-work-in-progress .tile-link {
    color: rgba(255, 255, 255, 0.68) !important;
}

body.historicum-community-page .h-ref-page .destination-tile.is-work-in-progress .tile-arrow {
    display: none !important;
}

@media screen and (max-width: 900px) {
    body.historicum-community-page .h-ref-page .tiles-grid {
        grid-template-columns: 1fr !important;
    }
}


/* ============================================================
   NEXT 2 TRAINING PAGE PATCH — pricing centering + AMMA shadow
   ============================================================ */

/* Join the Training — pricing grid centered with normal block sizing */
body.historicum-training-page .pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
    justify-items: stretch;
    align-items: stretch;
}

body.historicum-training-page .pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: inherit;
}

body.historicum-training-page .pricing-card.featured {
    border-color: rgba(235, 188, 0, 0.42);
    background: rgba(235, 188, 0, 0.06);
}

@media (max-width: 991px) {
    body.historicum-training-page .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 460px;
        gap: 18px;
        padding: 0 18px;
    }
}

/* AMMA "What Is AMMA?" image — drop shadow matches Fighters Favorite spec */
body.historicum-training-page .training-image-card,
body.historicum-training-page .training-image-card img {
    border-radius: 8px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
    filter: none;
}
body.historicum-training-page .training-image-card {
    overflow: hidden;
    background: transparent;
}
body.historicum-training-page .training-image-card img {
    display: block;
    width: 100%;
    height: auto;
}

/* Match same shadow style to the dark-card variant on the Andrzej Studencki section */
body.historicum-training-page .training-image-card-dark,
body.historicum-training-page .training-image-card-dark img {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
}
