.tc-tile-customizer *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Avenir LT Std', Arial, sans-serif;
}
.tc-tile-customizer{
    position: fixed;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    inset: 0;
    z-index: 999999;
    padding-top: 4rem;
    display: none; /* Hidden by default */
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    color: #1C1C1C;
}
.tc-tile-customizer .eyebrow{
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    font-weight: 900;
    font-style: italic;
    color: #7D6B51;
    margin-bottom: 16px;
}
.tc-tile-customizer .hero-copy h1{
    font-family: 'Work Sans', Arial, sans-serif;
    font-size: 48px;
    line-height: 1.2;
    margin: 0 0 24px 0;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.tc-tile-customizer .hero-copy .line1,
.tc-tile-customizer .hero-copy .line2{
    display: block;
    font-weight: bolder;
}
.tc-tile-customizer .hero-paragraph{
    margin-top: 0;
    max-width: min(620px, 100%);
    line-height: 1.65;
    font-size: 15px;
    font-weight: 400;
    font-family: 'Avenir LT Std', Arial, sans-serif;
}
.tc-tile-customizer .container{
    display: grid;
    gap: 40px;
    max-width: 1400px;
    width: min(100%, 1400px);
    margin: 0 auto;
    /* padding: 0 20px; */
    border-radius: 30px;
}
.tc-tile-customizer .main-card{
    position: relative;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    padding: 70px;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 70px;
    align-items: stretch;
}
.tc-tile-customizer .form-section{
    background: transparent;
    padding: 0;
}
.tc-tile-customizer .preview-section{
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* ---------------------------------------------------------------------------
   Live preview
   The wood plus the ceramic plate is now a single background photo; only the
   customer's text and icon are rendered on top of it.
   --------------------------------------------------------------------------- */
.tc-tile-customizer .preview-card{
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 681 / 684;
    background-image: url(https://iheartdogs.com/wp-content/uploads/2026/08/Live-preview-background.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
    container-type: inline-size;
}
.tc-tile-customizer .live-badge{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #ffffff;
    color: #3c522e;
    font-size: 0.9rem;
    font-weight: 700;
    font-style: italic;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.tc-tile-customizer .live-badge i{
    color: #32DA08;
    font-size: 0.65rem;
}
/* Text safe-area: the white plate inside the photo, kept clear of the corner brackets. */
.tc-tile-customizer .tile{
    position: absolute;
    inset: 11% 14% 12%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: #1C1C1C;
    font-family: 'Work Sans', Arial, sans-serif;
    overflow: hidden;
}
/* --tile-scale is set by the script so a long name or message shrinks the whole
   engraving to fit the plate instead of being clipped by it. */
.tc-tile-customizer .tile-inner{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1.5cqw;
    gap: calc(1.5cqw * var(--tile-scale, 1));
}
.tc-tile-customizer .tile-prefix{
    color: var(--tile-heading, #1C1C1C);
    font-size: 22px;
    font-size: calc(8cqw * var(--tile-scale, 1));
    font-weight: 500;
    line-height: 1.1;
    font-family: 'fantasy', serif;
}
.tc-tile-customizer .tile-name{
    color: var(--tile-body, #1C1C1C);
    font-size: 30px;
    font-size: calc(8cqw * var(--tile-scale, 1));
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.tc-tile-customizer .tile-icon{
    display: block;
    line-height: 0;
    width: 34%;
    width: calc(34cqw * var(--tile-scale, 1));
    margin: 1.5cqw 0;
    margin: calc(1.5cqw * var(--tile-scale, 1)) 0;
}
.tc-tile-customizer .tile-icon img{
    width: 100%;
    height: auto;
    display: block;
    /* No colour filter here: the icons are already black artwork and their paw
       cut-outs are opaque white, so any brightness filter fills them in. */
}
.tc-tile-customizer .tile-message{
    color: var(--tile-body, #1C1C1C);
    font-size: 17px;
    font-size: calc(3.6cqw * var(--tile-scale, 1));
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.tc-tile-customizer .tile-date{
    color: var(--tile-heading, #1C1C1C);
    font-size: 30px;
    font-size: calc(6.2cqw * var(--tile-scale, 1));
    font-weight: 800;
    line-height: 1;
    padding-top: 10px;
}
.tc-tile-customizer .tile-message:empty,
.tc-tile-customizer .tile-date:empty{
    display: none;
}

/* ---------------------------------------------------------------------------
   Form controls
   --------------------------------------------------------------------------- */
.tc-tile-customizer label{
    font-weight: 700;
    margin-bottom: 10px;
    color: #3c3a36;
}
.tc-tile-customizer .field-error{
    font-size: 0.85rem;
    color: #c02c2c;
}
.tc-tile-customizer .field-error:not(:empty){
    margin-top: 8px;
}
.tc-tile-customizer .input-error{
    border-color: #d32f2f;
    box-shadow: 0 0 0 1px rgba(211, 47, 47, 0.18);
}
.tc-tile-customizer input,
.tc-tile-customizer textarea{
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #e0dcd5;
    border-radius: 14px;
    font-size: 1rem;
    color: #1C1C1C;
    background: #fcfcfb;
}
.tc-tile-customizer input:focus,
.tc-tile-customizer textarea:focus{
    border-color: #b8b1a2;
    outline: none;
}
.tc-tile-customizer .controls-card{
    margin-top: 20px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 13.9px rgba(0, 0, 0, 0.14);
    padding: 18px;
    border: 1px solid #ece8e2;
}
.tc-tile-customizer .controls-inner{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
    align-items: start;
}
.tc-tile-customizer .field{
    display: flex;
    flex-direction: column;
}
.tc-tile-customizer .field label,
.tc-tile-customizer .field .field-label{
    font-size: 0.85rem;
    color: #1C1C1C;
    margin-bottom: 8px;
    font-weight: 700;
}
.tc-tile-customizer .field input,
.tc-tile-customizer .field textarea{
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e7e1d9;
    background: #fbfbfa;
}
.tc-tile-customizer .field textarea{
    min-height: 180px;
    line-height: 1.5;
    resize: vertical;
}
.tc-tile-customizer .small-label{
    display: block;
    font-size: 0.9rem;
    color: #3c3a36;
    margin-bottom: 10px;
    font-weight: 700;
}


/* Icon picker: chosen independently of the dedication. */
.tc-tile-customizer .icons{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tc-tile-customizer .icon-btn{
    width: 58px;
    height: 58px;
    padding: 8px;
    border: 1px solid #e0d9cc;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease, background .2s ease;
}
.tc-tile-customizer .icon-btn img{
    width: 100%;
    height: 100%;
    display: block;
    /* the artwork is not square, so fit it in the box rather than stretch it */
    object-fit: contain;
}
.tc-tile-customizer .icon-btn:hover{
    border-color: #b8a98c;
}
.tc-tile-customizer .icon-btn.active{
    border-color: #5c482d;
    background: #f3ede2;
}
/* Dedication picker: each option carries the phrase printed on the tile. */
.tc-tile-customizer .dedications{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tc-tile-customizer .dedication-btn{
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0d9cc;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1C1C1C;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.tc-tile-customizer .dedication-btn em{
    font-style: italic;
    font-weight: 400;
}
.tc-tile-customizer .dedication-btn:hover{
    border-color: #b8a98c;
}
.tc-tile-customizer .dedication-btn.active{
    background: #5c482d;
    border-color: #5c482d;
    color: #ffffff;
}

/* ---------------------------------------------------------------------------
   Chrome: close button, actions
   --------------------------------------------------------------------------- */
.tc-tile-customizer .close-btn{
    position: absolute;
    top: -15px;
    right: -15px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #D3D3D3;
    color: #1C1C1C;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 10;
}
.tc-tile-customizer .close-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}
.tc-tile-customizer .close-btn i{
    font-size: 1.1rem;
}
.tc-tile-customizer .close-btn:hover{
    transform: translateY(-2px);
    background: #ffffff;
}
.tc-tile-customizer .finish-btn i{
    margin-left: 10px;
    font-size: 0.95rem;
}
.tc-tile-customizer .finish-btn,
.tc-tile-customizer .secondary-btn{
    border: none;
    border-radius: 999px;
    cursor: pointer;
    padding: 16px 22px;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin: 0 auto;
}
.tc-tile-customizer .finish-btn{
    background: #E22626;
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(229, 57, 53, 0.18);
    max-width: 480px;
    width: 100%;
}
.tc-tile-customizer .finish-btn .arrow{
    margin-left: 8px;
}
.tc-tile-customizer .secondary-btn{
    background: #ffffff;
    color: #4c4339;
    border: 1px solid #d8d1c7;
    margin-bottom: 18px;
}
.tc-tile-customizer .finish-btn:hover,
.tc-tile-customizer .secondary-btn:hover{
    transform: translateY(-2px);
}
.tc-tile-customizer .finish-btn:disabled{
    opacity: 0.7;
    cursor: default;
    transform: none;
}
.tc-tile-customizer .preview-step-btn,
.tc-tile-customizer .back-to-edit,
.tc-tile-customizer .preview-heading{
    display: none;
}
.tc-tile-customizer .back-to-edit{
    background: none;
    border: none;
    cursor: pointer;
    color: #4c4339;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: underline;
    padding: 8px;
    margin-top: -10px;
}
.tc-tile-customizer .preview-heading{
    color: #8a8178;
    font-style: italic;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}
@media (max-width: 1023px) {
    .tc-tile-customizer{
        padding: 24px;
    }
    .tc-tile-customizer .main-card{
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 28px;
    }
    .tc-tile-customizer .hero-copy h1{
        font-size: 34px;
        line-height: 1.3;
    }
    .tc-tile-customizer .hero-paragraph{
        max-width: 100%;
    }
    .tc-tile-customizer .controls-inner{
        grid-template-columns: 1fr;
    }
    .tc-tile-customizer .field textarea{
        min-height: 140px;
    }
    .tc-tile-customizer .finish-btn{
        max-width: 100%;
    }
}
@media (max-width: 767px) {
    .tc-tile-customizer{
        padding: 16px;
    }
    .tc-tile-customizer .container{
        gap: 20px;
        padding: 0 12px;
    }
    .tc-tile-customizer .main-card{
        padding: 30px 18px;
        gap: 20px;
    }
    .tc-tile-customizer .hero-copy h1{
        font-size: 30px;
    }
    .tc-tile-customizer .controls-card{
        padding: 14px;
    }
    .tc-tile-customizer .controls-inner{
        gap: 12px;
    }
    .tc-tile-customizer .close-btn{
        top: -12px;
        right: -12px;
        width: 44px;
        height: 44px;
    }
    .tc-tile-customizer .live-badge{
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .tc-tile-customizer .preview-step-btn{
        display: block;
    }
    .tc-tile-customizer .preview-heading{
        display: block;
    }
    .tc-tile-customizer .main-card:not(.preview-active) .preview-section{
        display: none;
    }
    .tc-tile-customizer .main-card.preview-active .form-section{
        display: none;
    }
    .tc-tile-customizer .main-card.preview-active .back-to-edit{
        display: block;
    }
}
.tc-tile-customizer .controls-card #tcName::placeholder,
.tc-tile-customizer .controls-card #tcDate::placeholder,
.tc-tile-customizer .controls-card #tcMessage::placeholder{
    color: #1c1c1c;
    font-size: 14px;
}