/*
 * Device Trade-In Calculator — Styles
 * ------------------------------------------------------------------
 * Scoped under .drc-wrapper to avoid bleeding into theme styles.
 * Neutral, confident palette with a single emerald accent.
 * Plays well on any modern WordPress theme.
 */

.drc-wrapper {
    --drc-bg:         #ffffff;
    --drc-surface:    #fafaf7;
    --drc-surface-2:  #f4f3ef;
    --drc-border:     #e4e2db;
    --drc-border-2:   #d4d2c9;
    --drc-ink:        #14181a;
    --drc-ink-2:      #414449;
    --drc-muted:      #7a7c7f;
    --drc-accent:     #0f6b4a;
    --drc-accent-2:   #0d5a3e;
    --drc-accent-soft:#e8f2ed;
    --drc-danger:     #b0282d;
    /* Icon color used inside device tiles (Step 1). Change this one line
     * to recolor the phone/laptop/etc. icons — e.g. #ffffff (white),
     * #111827 (near black), #FFD166 (amber). */
    --drc-tile-icon-color: #FDD85D;
    /* Hover / selected text color for the condition + storage cards
     * (used when the host theme paints the cards in a dark brand color
     * like purple). Change this line to adjust the highlight tone. */
    --drc-card-hover-color: #FDD85D;
    --drc-radius:     14px;
    --drc-radius-sm:  10px;
    --drc-shadow:     0 1px 2px rgba(20,24,26,.04), 0 8px 24px -12px rgba(20,24,26,.12);
    --drc-shadow-lg:  0 20px 60px -30px rgba(20,24,26,.25);
    --drc-font:       ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --drc-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

    font-family: var(--drc-font);
    color: var(--drc-ink);
    width: 100%;
    max-width: 760px;
    margin: 2rem auto;
    box-sizing: border-box;
    line-height: 1.5;
    /* Enable container queries so step layouts (tiles, grade cards, storage
     * buttons) respond to the calculator's *actual* container width, not the
     * viewport. Without this, the form breaks when embedded inside narrow
     * columns (e.g. tablet sidebars where viewport ≥ 640px but the column
     * is only ~300px), because viewport-based media queries fire too early. */
    container-type: inline-size;
    container-name: dtc;
}

.drc-wrapper *,
.drc-wrapper *::before,
.drc-wrapper *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------
 * THEME ISOLATION
 * ------------------------------------------------------------------
 * Prevents the host theme's button/link styles from breaking text
 * visibility inside the calculator (e.g. themes that force white text
 * on every button:hover). We re-assert our own colors on every
 * interactive state. !important is used surgically here because we
 * are competing with theme rules of unknown specificity.
 * ------------------------------------------------------------------ */
.drc-wrapper button,
.drc-wrapper button:hover,
.drc-wrapper button:focus,
.drc-wrapper button:active,
.drc-wrapper button:visited {
    text-decoration: none !important;
    text-shadow: none !important;
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
}
.drc-wrapper select,
.drc-wrapper input,
.drc-wrapper textarea {
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}

/* If host theme exposes a primary color CSS variable, opt in to it.
 * Site builders can override --drc-accent in their own stylesheet
 * (e.g. .drc-wrapper { --drc-accent: var(--theme-primary); }) to
 * make the form pick up the site's brand color. */

/* ------------------------------ CARD SHELL */
.drc-card {
    background: var(--drc-bg);
    border: 1px solid var(--drc-border);
    border-radius: var(--drc-radius);
    padding: clamp(1.25rem, 3vw, 2.5rem);
    box-shadow: var(--drc-shadow);
    position: relative;
    overflow: hidden;
}
.drc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--drc-accent) 0%, #57a986 50%, var(--drc-accent) 100%);
}

/* ------------------------------ HEADER */
.drc-header { margin-bottom: 1.75rem; }
.drc-title {
    font-family: var(--drc-font-display);
    font-size: clamp(1.5rem, 2.5vw, 1.9rem);
    font-weight: 600;
    color: var(--drc-ink);
    margin: 0 0 .5rem;
    letter-spacing: -.01em;
}
.drc-subtitle {
    color: var(--drc-muted);
    font-size: .95rem;
    margin: 0;
    max-width: 58ch;
}

/* ------------------------------ STEP INDICATOR */
.drc-steps {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--drc-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.drc-steps::-webkit-scrollbar { display: none; }

.drc-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--drc-muted);
    white-space: nowrap;
    padding: .35rem .65rem;
    border-radius: 100px;
    transition: color .25s ease, background .25s ease;
}
.drc-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--drc-surface-2);
    color: var(--drc-muted);
    font-size: .75rem;
    font-weight: 600;
    transition: background .25s ease, color .25s ease;
}
.drc-step.is-active        { color: var(--drc-ink); background: var(--drc-accent-soft); }
.drc-step.is-active span   { background: var(--drc-accent); color: #fff; }
.drc-step.is-completed span{ background: var(--drc-ink); color: #fff; }
.drc-step.is-completed     { color: var(--drc-ink-2); }

/* ------------------------------ SECTIONS */
.drc-section {
    display: none;
    animation: dtc-fade .3s ease;
}
.drc-section.is-active { display: block; }

@keyframes dtc-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.drc-label {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    color: var(--drc-ink);
    margin-bottom: 1rem;
}
.drc-required { color: var(--drc-danger); margin-left: 2px; }

/* ------------------------------ DEVICE TILES (STEP 1) */
.drc-tiles {
    display: grid;
    /* `minmax(0, 1fr)` (vs. plain `1fr`) lets columns shrink below their
     * content's min-width, so long device labels can never push the grid
     * past its container. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}
/* When the calculator itself is narrow (e.g. embedded in a 280–360px
 * sidebar), keep tiles legible by dropping to two columns. */
@container dtc (max-width: 360px) {
    .drc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.drc-tile {
    appearance: none;
    background: var(--drc-surface);
    border: 1.5px solid var(--drc-border);
    border-radius: var(--drc-radius-sm);
    padding: 1.5rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    font-family: inherit;
    color: var(--drc-ink-2);
    transition: all .2s ease;
    position: relative;
}
.drc-tile:hover {
    border-color: var(--drc-ink);
    background: var(--drc-bg) !important;
    color: var(--drc-ink) !important;
    transform: translateY(-1px);
    box-shadow: var(--drc-shadow);
}
.drc-tile:focus,
.drc-tile:focus-visible {
    color: var(--drc-ink) !important;
    background: var(--drc-bg) !important;
    outline: none;
    border-color: var(--drc-accent);
    box-shadow: 0 0 0 3px var(--drc-accent-soft);
}
.drc-tile.is-active,
.drc-tile.is-active:hover,
.drc-tile.is-active:focus {
    border-color: var(--drc-accent) !important;
    background: var(--drc-accent-soft) !important;
    color: var(--drc-accent-2) !important;
}
.drc-tile-icon,
.drc-tile-label { color: inherit !important; }
.drc-tile.is-active::after {
    content: '✓';
    position: absolute;
    top: 8px; right: 10px;
    font-size: .85rem;
    color: var(--drc-accent);
    font-weight: 700;
}
.drc-tile-icon { color: currentColor; }

/* Force icon size + color so the host theme can't shrink or recolor them.
 * The size is driven by the per-brand --drc-tile-icon-size variable set
 * inline on .drc-tile-icon from the admin "Device Icons" page (defaults
 * to 44px). We keep !important because some themes force `width: auto`
 * on button descendants. */
.drc-wrapper .drc-tile .drc-tile-icon svg {
    width:  var(--drc-tile-icon-size, 44px) !important;
    height: var(--drc-tile-icon-size, 44px) !important;
    color: var(--drc-tile-icon-color) !important;
    stroke: var(--drc-tile-icon-color) !important;
}
/* Uploaded raster icons (PNG / JPG / WebP / SVG) — sized by the same
 * per-brand variable so each device tile can have its own icon size. */
.drc-wrapper .drc-tile .drc-tile-icon .drc-tile-img {
    display: block;
    width:  var(--drc-tile-icon-size, 44px) !important;
    height: var(--drc-tile-icon-size, 44px) !important;
    object-fit: contain;
}
.drc-wrapper .drc-tile .drc-tile-label {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    /* Allow long device names ("MacBook Pro 16") to wrap onto two lines
     * inside narrow tiles instead of forcing the column wider. The
     * `!important` on white-space defeats themes that apply nowrap to
     * buttons/button children. */
    text-align: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* ------------------------------ SELECT (STEP 2) */
.drc-select {
    width: 100%;
    padding: .85rem 2.5rem .85rem 1rem;
    font-size: .95rem;
    font-family: inherit;
    line-height: 1.4;
    min-height: 48px;
    color: var(--drc-ink);
    background: var(--drc-bg);
    border: 1.5px solid var(--drc-border);
    border-radius: var(--drc-radius-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314181a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.drc-select:focus {
    outline: none;
    border-color: var(--drc-accent);
    box-shadow: 0 0 0 3px var(--drc-accent-soft);
}

/* ------------------------------ GRADE CARDS (STEP 3) */
.drc-grades {
    display: grid;
    /* Default: vertical / single column. Stays this way on phones AND
     * tablets, so the three condition cards (Excellent / Good / Poor)
     * stack neatly down the page and never clip on the right edge.
     *
     * The cards are tall enough to be tap-friendly and the user can read
     * the full grade description without horizontal cramming, which is
     * what most modern checkout flows do anyway. */
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
}
/* PRIMARY: Only switch to a 3-column row when the *calculator's container*
 * is genuinely desktop-wide (≥ 720px). Previously this threshold was
 * 480px, which still fired on tablets when the form sat inside a wider
 * content column and clipped the third card. Tablets are now reliably
 * vertical. */
@container dtc (min-width: 720px) {
    .drc-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* FALLBACK for browsers without container query support (rare in 2026 —
 * Chrome 105+, Safari 16+, Firefox 110+ all support them). Use a wide
 * viewport breakpoint so a narrow embed on a tablet/laptop still stacks
 * the cards rather than clipping. */
@supports not (container-type: inline-size) {
    @media (min-width: 1100px) {
        .drc-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }
}
.drc-grade-card {
    appearance: none;
    background: var(--drc-surface);
    border: 1.5px solid var(--drc-border);
    border-radius: var(--drc-radius-sm);
    padding: 1.25rem 1rem;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    color: var(--drc-ink);
    transition: all .2s ease;
    min-height: 110px;
}
.drc-grade-card:hover:not(.is-disabled) {
    border-color: var(--drc-ink);
    background: var(--drc-bg) !important;
    color: var(--drc-ink) !important;
    transform: translateY(-1px);
    box-shadow: var(--drc-shadow);
}
.drc-grade-card:focus,
.drc-grade-card:focus-visible {
    color: var(--drc-ink) !important;
    background: var(--drc-bg) !important;
    outline: none;
    border-color: var(--drc-accent);
    box-shadow: 0 0 0 3px var(--drc-accent-soft);
}
.drc-grade-card.is-active,
.drc-grade-card.is-active:hover,
.drc-grade-card.is-active:focus {
    border-color: var(--drc-accent) !important;
    background: var(--drc-accent-soft) !important;
    color: var(--drc-ink) !important;
}
.drc-grade-card.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    background: var(--drc-surface-2);
}
/* Card body — give the flex children block-level behaviour with a hard
 * width cap so long titles or subtitles wrap onto a second/third line
 * inside the card instead of overflowing into the neighbouring card.
 *
 * `white-space: normal !important` is needed because some host themes
 * apply `white-space: nowrap` to buttons or button descendants, which
 * would prevent wrapping no matter what `overflow-wrap` says.
 *
 * `overflow-wrap: anywhere` lets words break mid-character if a single
 * word is wider than the card (e.g. extremely long model names). */
.drc-wrapper .drc-grade-card .drc-grade-title,
.drc-wrapper .drc-grade-card .drc-grade-sub {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
    -webkit-hyphens: auto;
    hyphens: auto;
}
.drc-grade-card { min-width: 0; }

.drc-grade-title {
    font-weight: 600;
    font-size: .95rem;
}
.drc-grade-sub {
    font-size: .82rem;
    color: var(--drc-muted);
    line-height: 1.4;
}
.drc-grade-na {
    display: inline-block;
    margin-top: .25rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--drc-danger);
    font-weight: 600;
}

/* ------------------------------ STORAGE BUTTONS (STEP 4) */
.drc-storage {
    display: grid;
    /* 110px minimum (down from 150px) keeps two columns visible inside
     * narrow embeds (~280px) instead of falling back to a single column.
     * `auto-fit` still expands to more columns when there's room. */
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .6rem;
}
/* In genuinely narrow containers, drop to a single column rather than
 * cramming an unreadable two-column layout. */
@container dtc (max-width: 280px) {
    .drc-storage { grid-template-columns: minmax(0, 1fr); }
}
.drc-storage-btn {
    appearance: none;
    background: var(--drc-surface);
    border: 1.5px solid var(--drc-border);
    border-radius: var(--drc-radius-sm);
    padding: .9rem .75rem;
    cursor: pointer;
    font-family: inherit;
    color: var(--drc-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    transition: all .2s ease;
}
.drc-storage-btn:hover:not(.is-disabled) {
    border-color: var(--drc-ink);
    background: var(--drc-bg) !important;
    color: var(--drc-ink) !important;
}
.drc-storage-btn:focus,
.drc-storage-btn:focus-visible {
    color: var(--drc-ink) !important;
    background: var(--drc-bg) !important;
    outline: none;
    border-color: var(--drc-accent);
    box-shadow: 0 0 0 3px var(--drc-accent-soft);
}
.drc-storage-btn.is-active,
.drc-storage-btn.is-active:hover,
.drc-storage-btn.is-active:focus {
    border-color: var(--drc-accent) !important;
    background: var(--drc-accent-soft) !important;
    color: var(--drc-accent-2) !important;
}
.drc-storage-btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}
.drc-storage-btn { min-width: 0; }
.drc-wrapper .drc-storage-btn .drc-storage-cap,
.drc-wrapper .drc-storage-btn .drc-storage-preview {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
}
.drc-storage-cap {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
}
.drc-storage-preview {
    font-size: .78rem;
    color: var(--drc-muted);
}
.drc-storage-na {
    font-size: .7rem;
    color: var(--drc-danger);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.drc-charger-notice {
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: var(--drc-surface-2);
    border-left: 3px solid var(--drc-accent);
    border-radius: 6px;
    font-size: .82rem;
    color: var(--drc-ink-2);
}

/* ------------------------------ DARK-TILE TEXT OVERRIDES
 * When the host theme paints .drc-grade-card / .drc-storage-btn in a
 * solid dark brand color (e.g. purple), the default muted subtext
 * (grey on purple) becomes unreadable. Force white at rest and a
 * bright accent on hover / selected so both lines stay visible.
 * Disabled state keeps its own opacity treatment from above.
 * ------------------------------------------------------------------ */

/* Default — white on the painted card */
.drc-wrapper .drc-grade-card .drc-grade-title,
.drc-wrapper .drc-grade-card .drc-grade-sub,
.drc-wrapper .drc-storage-btn .drc-storage-cap,
.drc-wrapper .drc-storage-btn .drc-storage-preview {
    color: #ffffff !important;
}

/* Hover + selected — switch to the highlight tone */
.drc-wrapper .drc-grade-card:hover:not(.is-disabled) .drc-grade-title,
.drc-wrapper .drc-grade-card:hover:not(.is-disabled) .drc-grade-sub,
.drc-wrapper .drc-grade-card.is-active .drc-grade-title,
.drc-wrapper .drc-grade-card.is-active .drc-grade-sub,
.drc-wrapper .drc-storage-btn:hover:not(.is-disabled) .drc-storage-cap,
.drc-wrapper .drc-storage-btn:hover:not(.is-disabled) .drc-storage-preview,
.drc-wrapper .drc-storage-btn.is-active .drc-storage-cap,
.drc-wrapper .drc-storage-btn.is-active .drc-storage-preview {
    color: var(--drc-card-hover-color) !important;
}

/* ------------------------------ QUOTE CARD (STEP 5) */
.drc-quote-card {
    background: linear-gradient(180deg, var(--drc-surface) 0%, var(--drc-bg) 100%);
    border: 1px solid var(--drc-border);
    border-radius: var(--drc-radius);
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.drc-quote-summary {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin-bottom: 1.25rem;
}
.drc-quote-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--drc-muted);
    font-weight: 600;
}
.drc-quote-device {
    font-family: var(--drc-font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--drc-ink);
}
.drc-quote-config {
    font-size: .85rem;
    color: var(--drc-muted);
}

/* Cash / Voucher toggle */
.drc-quote-toggle {
    display: inline-flex;
    background: var(--drc-surface-2);
    border-radius: 100px;
    padding: 4px;
    margin-bottom: 1.25rem;
}
.drc-toggle-btn {
    appearance: none;
    background: transparent !important;
    border: 0;
    padding: .5rem 1.25rem;
    font-family: inherit;
    font-weight: 600;
    font-size: .85rem;
    color: var(--drc-muted) !important;
    cursor: pointer;
    border-radius: 100px;
    transition: all .25s ease;
}
.drc-toggle-btn:hover,
.drc-toggle-btn:focus {
    color: var(--drc-ink) !important;
    background: transparent !important;
}
.drc-toggle-btn.is-active,
.drc-toggle-btn.is-active:hover,
.drc-toggle-btn.is-active:focus {
    background: var(--drc-ink) !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* Price display */
.drc-price-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .15rem;
    margin-bottom: .5rem;
    font-family: var(--drc-font-display);
}
.drc-price-currency {
    font-size: 1.75rem;
    color: var(--drc-accent);
    font-weight: 500;
}
.drc-price-amount {
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 600;
    color: var(--drc-accent);
    letter-spacing: -.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.drc-price-note {
    font-size: .85rem;
    color: var(--drc-muted);
    margin: 0;
}

/* ------------------------------ CONTACT FIELDSET */
.drc-contact {
    border: 1px solid var(--drc-border);
    border-radius: var(--drc-radius-sm);
    padding: 1.25rem;
    margin: 0 0 1.25rem;
    background: var(--drc-bg);
}
.drc-contact legend {
    padding: 0 .5rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--drc-ink);
}
.drc-field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.drc-field:last-child { margin-bottom: 0; }
.drc-field label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--drc-ink-2);
    margin-bottom: .4rem;
}
.drc-field input,
.drc-field textarea {
    width: 100%;
    padding: .75rem .9rem;
    font-size: .95rem;
    font-family: inherit;
    color: var(--drc-ink);
    background: var(--drc-bg);
    border: 1.5px solid var(--drc-border);
    border-radius: var(--drc-radius-sm);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.drc-field input:focus,
.drc-field textarea:focus {
    outline: none;
    border-color: var(--drc-accent);
    box-shadow: 0 0 0 3px var(--drc-accent-soft);
}
.drc-field textarea { resize: vertical; min-height: 80px; }
.drc-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
/* Two-up only when the calculator itself has the room. */
@container dtc (min-width: 480px) {
    .drc-field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drc-field-row .drc-field { margin-bottom: 0; }
}
@supports not (container-type: inline-size) {
    @media (min-width: 720px) {
        .drc-field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .drc-field-row .drc-field { margin-bottom: 0; }
    }
}

/* ------------------------------ ACTIONS & BUTTONS */
.drc-actions {
    display: flex;
    gap: .6rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.drc-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.5rem;
    font-family: inherit;
    font-size: .93rem;
    font-weight: 600;
    border-radius: var(--drc-radius-sm);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all .2s ease;
    position: relative;
    min-height: 44px;
}
.drc-btn-ghost {
    background: transparent !important;
    color: var(--drc-ink-2) !important;
    border-color: var(--drc-border);
}
.drc-btn-ghost:hover,
.drc-btn-ghost:focus {
    border-color: var(--drc-ink);
    color: var(--drc-ink) !important;
    background: transparent !important;
}

.drc-btn-primary {
    background: var(--drc-ink) !important;
    color: #fff !important;
    border-color: var(--drc-ink);
    margin-left: auto;
}
.drc-btn-primary:hover,
.drc-btn-primary:focus {
    background: #000 !important;
    border-color: #000;
    color: #fff !important;
}
.drc-btn-primary:disabled { opacity: .7; cursor: wait; }

.drc-btn-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: dtc-spin .8s linear infinite;
}
.drc-btn.is-loading .drc-btn-label  { display: none; }
.drc-btn.is-loading .drc-btn-spinner { display: inline-block; }
@keyframes dtc-spin { to { transform: rotate(360deg); } }

/* ------------------------------ FEEDBACK */
.drc-feedback {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: var(--drc-radius-sm);
    font-size: .88rem;
}
.drc-feedback.is-error {
    background: #fdecec;
    border: 1px solid #f2b6b8;
    color: var(--drc-danger);
}
.drc-feedback.is-info {
    background: var(--drc-accent-soft);
    border: 1px solid #bfe0d0;
    color: var(--drc-accent-2);
}

/* ------------------------------ SUCCESS SCREEN */
.drc-success {
    text-align: center;
    padding: 2rem 1rem;
    animation: dtc-fade .4s ease;
}
.drc-success-icon {
    display: inline-flex;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--drc-accent);
    background: var(--drc-accent-soft);
    border-radius: 50%;
}
.drc-success-icon .drc-success-img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.drc-success h3 {
    font-family: var(--drc-font-display);
    font-size: 1.6rem;
    color: var(--drc-ink);
    margin: 0 0 .5rem;
}
.drc-success p {
    color: var(--drc-muted);
    max-width: 40ch;
    margin: 0 auto 1.25rem;
}

/* ------------------------------ SMALL SCREENS / NARROW CONTAINERS */
/* Container query — fires whenever the calculator itself is narrow,
 * regardless of viewport. This is what fixes embeds in tablet sidebars. */
@container dtc (max-width: 480px) {
    .drc-tile  { padding: 1rem .5rem; }
    .drc-tile-label { font-size: .85rem; }
    .drc-actions { flex-direction: column-reverse; }
    .drc-btn { width: 100%; }
    .drc-grade-card { padding: 1rem .85rem; min-height: 0; }
    .drc-card { padding: 1.1rem; }
    .drc-title { font-size: 1.35rem; }
    .drc-quote-card { padding: 1.25rem 1rem; }
}

/* Viewport fallback for browsers without container query support, and a
 * final safety net for genuinely tiny phone viewports. */
@media (max-width: 480px) {
    .drc-tiles { gap: .5rem; }
    .drc-tile  { padding: 1rem .5rem; }
    .drc-tile-label { font-size: .85rem; }
    .drc-actions { flex-direction: column-reverse; }
    .drc-btn { width: 100%; }
    .drc-wrapper { margin: 1rem auto; }
}

/* ---- Service buttons (repair-specific, replaces old grade/storage styles) ---- */
.drc-services {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}
.drc-service-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid var(--drc-border, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color .2s, background .2s;
    font-size: var(--drc-body-size, 15px);
}
.drc-service-btn:hover:not(:disabled) {
    border-color: var(--drc-accent, #0f6b4a);
    background: var(--drc-accent-soft, #e8f2ed);
}
.drc-service-btn.is-active {
    border-color: var(--drc-accent, #0f6b4a);
    background: var(--drc-accent, #0f6b4a);
    color: #fff;
}
.drc-service-btn.is-unavailable {
    opacity: .45;
    cursor: not-allowed;
    background: #f5f5f5;
}
.drc-svc-name  { font-weight: 600; }
.drc-svc-price { font-weight: 700; font-size: 1.05em; white-space: nowrap; margin-left: 12px; }
.drc-service-btn.is-active .drc-svc-price { color: #fff; }

/* ------------------------------ STEP ERROR MESSAGE */
.drc-step-error {
    display: none;
    margin: 0 0 .75rem;
    padding: .6rem .85rem;
    background: #fdecec;
    border: 1px solid #f2b6b8;
    border-radius: var(--drc-radius-sm);
    color: var(--drc-danger);
    font-size: .85rem;
    font-weight: 500;
}

/* ------------------------------ "OTHER" SERVICE BUTTON */
.drc-service-btn--other {
    border-style: dashed;
}
.drc-service-btn--other .drc-svc-name {
    font-weight: 600;
}
.drc-svc-other-arrow {
    color: var(--drc-accent, #0f6b4a) !important;
    font-weight: 700;
    font-size: 1.15em;
}
.drc-service-btn--other.is-active .drc-svc-other-arrow {
    color: #fff !important;
}

/* ------------------------------ "OTHER" / CONTACT SCREEN */
.drc-contact-screen {
    text-align: center;
    padding: 2rem 1rem;
    animation: dtc-fade .4s ease;
}
.drc-contact-icon {
    display: inline-flex;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--drc-accent);
    background: var(--drc-accent-soft);
    border-radius: 50%;
}
.drc-contact-icon svg {
    width: 40px;
    height: 40px;
}
.drc-contact-screen h3 {
    font-family: var(--drc-font-display);
    font-size: 1.5rem;
    color: var(--drc-ink);
    margin: 0 0 .6rem;
}
.drc-contact-screen p {
    color: var(--drc-muted);
    max-width: 46ch;
    margin: 0 auto 1.25rem;
    line-height: 1.55;
}
.drc-contact-phone {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0 auto 1.5rem;
    padding: .8rem 1.5rem;
    background: var(--drc-accent-soft);
    border: 1.5px solid var(--drc-accent);
    border-radius: 100px;
    color: var(--drc-accent-2) !important;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: .01em;
    transition: background .2s ease, transform .2s ease;
}
.drc-contact-phone:hover,
.drc-contact-phone:focus {
    background: var(--drc-accent);
    color: #fff !important;
    transform: translateY(-1px);
}
.drc-contact-phone svg { flex: 0 0 auto; }

/* ------------------------------ CONTACT BUTTONS (WhatsApp / Call / Form) */
.drc-contact-buttons {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    max-width: 360px;
    margin: 0 auto 1.5rem;
}
.drc-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: .85rem 1.25rem;
    border-radius: 100px;
    font-size: 1.02rem;
    font-weight: 600;
    text-decoration: none !important;
    letter-spacing: .01em;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}
.drc-contact-btn:hover,
.drc-contact-btn:focus {
    filter: brightness(.93);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
    text-decoration: none !important;
}
.drc-contact-btn:active {
    transform: translateY(0);
    filter: brightness(.88);
}
.drc-contact-btn svg { flex: 0 0 auto; }
.drc-contact-btn span { display: inline-flex; flex-direction: column; align-items: flex-start; }
.drc-contact-btn-sub {
    display: block;
    font-size: .78rem;
    font-weight: 500;
    opacity: .85;
    margin-top: 1px;
    letter-spacing: .02em;
}

@media (max-width: 480px) {
    .drc-contact-buttons { max-width: 100%; }
    .drc-contact-btn { padding: .8rem 1rem; font-size: .95rem; }
}

/* Centered action row (used on the contact screen) */
.drc-actions.drc-actions--center {
    justify-content: center;
}
.drc-actions.drc-actions--center .drc-btn-primary {
    margin-left: 0;
}

/* ------------------------------ APPOINTMENT SCHEDULING (Contact step) */
.drc-schedule {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px dashed var(--drc-field-border, #d8dcde);
}
.drc-schedule-legend {
    font-weight: 700;
    color: var(--drc-ink);
    margin: 0 0 .8rem;
    font-size: 1rem;
}
.drc-schedule-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
    margin-bottom: 1rem;
}
.drc-radio-card {
    position: relative;
    display: block;
    cursor: pointer;
}
.drc-radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.drc-radio-card-body {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    border: 1.5px solid var(--drc-field-border, #d8dcde);
    border-radius: var(--drc-radius-sm, 10px);
    background: #fff;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    height: 100%;
}
.drc-radio-dot {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--drc-muted);
    position: relative;
    transition: border-color .2s ease;
}
.drc-radio-dot::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--drc-accent);
    transform: scale(0);
    transition: transform .15s ease;
}
.drc-radio-text {
    font-size: .95rem;
    font-weight: 600;
    color: var(--drc-ink-2, #414449);
    line-height: 1.25;
}
.drc-radio-card:hover .drc-radio-card-body {
    border-color: var(--drc-accent);
}
.drc-radio-card input:checked + .drc-radio-card-body {
    border-color: var(--drc-accent);
    background: var(--drc-accent-soft);
    box-shadow: 0 0 0 1px var(--drc-accent);
}
.drc-radio-card input:checked + .drc-radio-card-body .drc-radio-dot {
    border-color: var(--drc-accent);
}
.drc-radio-card input:checked + .drc-radio-card-body .drc-radio-dot::after {
    transform: scale(1);
}
.drc-radio-card input:focus-visible + .drc-radio-card-body {
    box-shadow: 0 0 0 3px var(--drc-accent-soft);
}

/* Conditional panels */
.drc-schedule-panel {
    margin-top: .4rem;
    padding: 1rem 1.1rem;
    border-radius: var(--drc-radius-sm, 10px);
    background: #f6f8f7;
    border: 1px solid var(--drc-field-border, #e1e5e7);
    animation: dtc-fade .3s ease;
}
.drc-schedule-panel .drc-field { margin-top: 0; margin-bottom: .9rem; }
.drc-schedule-panel .drc-field:last-of-type { margin-bottom: 0; }
.drc-schedule-notice {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin: .9rem 0 0;
    padding: .8rem .9rem;
    border-radius: var(--drc-radius-sm, 10px);
    font-size: .9rem;
    line-height: 1.5;
    color: var(--drc-ink-2, #414449);
}
.drc-schedule-notice--pickup {
    background: #fff7e6;
    border: 1px solid #f4d28a;
}
.drc-schedule-notice--dropoff {
    background: var(--drc-accent-soft);
    border: 1px solid var(--drc-accent);
    margin-top: 0;
}
.drc-fee-line {
    color: #9a6a00;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .01em;
}
.drc-map-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-top: .9rem;
    padding: .7rem 1.2rem;
    border-radius: 100px;
    background: var(--drc-accent);
    color: #fff !important;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none !important;
    transition: filter .2s ease, transform .2s ease;
}
.drc-map-btn:hover,
.drc-map-btn:focus {
    filter: brightness(.93);
    transform: translateY(-1px);
}
.drc-map-btn svg { flex: 0 0 auto; }

@media (max-width: 480px) {
    .drc-schedule-options { grid-template-columns: 1fr; }
}
