/* ============================================================
   DIY Center Management System - Custom Styles
   Shared design system and reusable frontend primitives.
   ============================================================ */

:root {
    --diy-red: #730305;
    --diy-red-dark: #4f0203;
    --diy-yellow: #fecb2d;
    --diy-yellow-light: #fff3c4;
    --diy-black: #000000;
    --diy-white: #ffffff;
    --diy-grey-light: #f5f5f5;
    --diy-grey-mid: #e0e0e0;
    --diy-grey-dark: #666666;
    --diy-success: #198754;
    --diy-info: #0d6efd;
    --diy-danger-soft: #fde7e7;
    --diy-success-soft: #e8f5ee;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --font: "Karla", sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--font);
}

html,
body {
    min-height: 100%;
}

body {
    background-color: var(--diy-grey-light);
    color: var(--diy-black);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ============================================================
   Landing page — two-column hero layout
   ============================================================ */
.diy-landing-page {
    background: var(--diy-red);
}

/* Full-viewport wrapper — vertically centres the hero */
.diy-landing-wrap {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    padding-inline: 1.5rem;
    padding-block: clamp(2.5rem, 6vw, 5rem);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Two-column grid: left info | divider | right card */
.diy-landing-hero {
    display: grid;
    grid-template-columns: 1fr auto 380px;
    gap: 0;
    align-items: center;
    width: 100%;
}

/* Left panel */
.diy-landing-left {
    padding-right: 2.5rem;
}

/* Vertical separator */
.diy-landing-divider {
    width: 1px;
    align-self: stretch;
    min-height: 220px;
    background: rgba(255, 255, 255, 0.2);
}

/* Right panel */
.diy-landing-right {
    padding-left: 2.5rem;
}

/* Brand logo — centred in left panel */
.diy-brand-mark {
    display: flex;
    justify-content: center;
}

.diy-login-logo {
    width: min(180px, 100%);
    height: auto;
    display: block;
    object-fit: contain;
}

/* Heading */
.diy-login-title {
    color: var(--diy-white);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
}

/* Body copy */
.diy-landing-lead {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    line-height: 1.6;
}

/* Bullet list */
.diy-landing-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.diy-landing-bullets li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    font-weight: 600;
}

.diy-landing-bullets li i {
    color: var(--diy-yellow);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Sign-in card */
.diy-login-card {
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    background: var(--diy-white);
    border: 0;
    width: 100%;
}

.diy-login-copy {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* CTA button on landing (uses btn-diy — already red) */
.diy-landing-btn {
    font-weight: 800;
    border-radius: 12px;
    min-height: 52px;
    font-size: 1rem;
}

.diy-login-helper,
.diy-login-footer {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
}

/* login.php: same hero layout */
.diy-auth-hero {
    display: grid;
    grid-template-columns: 1fr auto 380px;
    gap: 0;
    align-items: center;
    width: 100%;
}

.diy-auth-hero .diy-landing-story {
    color: var(--diy-white);
    padding-right: 2.5rem;
}

.diy-auth-hero .diy-login-card {
    margin-left: 2.5rem;
}

.diy-kiosk-page {
    background: var(--diy-red);
}

.diy-kiosk-shell {
    width: 100%;
    max-width: 540px;
    margin-inline: auto;
}

.diy-kiosk-logo {
    width: min(150px, 46vw);
    height: auto;
}

.diy-section-link {
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

a {
    color: var(--diy-red);
}

a:hover {
    color: var(--diy-red-dark);
}

label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    margin-top: 4px;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--diy-grey-mid);
    border-radius: var(--radius);
    background: var(--diy-white);
    color: var(--diy-black);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(115, 3, 5, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(115, 3, 5, 0.12);
}

button,
.btn {
    min-height: 44px;
    border-radius: var(--radius);
    font-weight: 700;
}

.form-control-sm,
.form-select-sm {
    min-height: 38px;
}

.form-check-input:checked {
    background-color: var(--diy-red);
    border-color: var(--diy-red);
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    padding-left: 4px;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-800 {
    font-weight: 800 !important;
}

.diy-navbar {
    background-color: var(--diy-red);
    box-shadow: 0 2px 10px rgba(79, 2, 3, 0.24);
    gap: 0.75rem;
    flex-wrap: nowrap;
    padding: 0 1rem;
}

.diy-navbar-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.diy-navbar-logo {
    height: 32px;
    width: auto;
    display: block;
}

.diy-navbar-centre-badge {
    max-width: min(42vw, 240px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.diy-user-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
}

.badge-diy {
    background-color: var(--diy-yellow);
    color: var(--diy-black);
    font-weight: 700;
    border-radius: var(--radius);
    font-size: 0.75rem;
}

.app-main {
    max-width: 1120px;
}

.diy-request-id {
    color: var(--diy-grey-dark);
    font-size: 0.82rem;
}

.diy-alert {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.95rem 1rem;
}

.diy-alert-success {
    background: var(--diy-success-soft);
    color: #155d36;
}

.diy-alert-error {
    background: var(--diy-danger-soft);
    color: #7a1f1f;
}

.notice {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.15);
    color: #16457a;
}

.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--diy-white);
}

.diy-debug-panel {
    border: 1px dashed rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    background: #fbfbfb;
    padding: 1rem;
}

.diy-debug-panel pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    color: #343a40;
}

/* ---- Conversational intro screen (explain-then-begin) ---- */
.diy-intro {
    text-align: center;
    padding: 36px 20px 28px;
}

.diy-intro .intro-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    line-height: 1;
}

.diy-intro h2 {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.diy-intro p {
    color: var(--diy-grey-dark);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 28px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.diy-intro.text-start .intro-icon,
.diy-intro.text-start h2,
.diy-intro.text-start p {
    text-align: left;
}

.diy-intro.text-start p {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.btn-begin,
.btn-diy {
    background-color: var(--diy-red);
    color: var(--diy-white);
    border: none;
}

.btn-begin {
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.05rem;
    padding: 13px 36px;
    min-height: 52px;
    width: 100%;
    max-width: 280px;
}

.btn-diy:hover,
.btn-diy:focus,
.btn-begin:hover,
.btn-begin:focus {
    background-color: var(--diy-red-dark);
    color: var(--diy-white);
}

.btn-diy-outline {
    border: 2px solid var(--diy-red);
    color: var(--diy-red);
    background: transparent;
}

.btn-diy-outline:hover,
.btn-diy-outline:focus {
    background: rgba(115, 3, 5, 0.05);
    color: var(--diy-red-dark);
    border-color: var(--diy-red-dark);
}

/* ---- Step section heading ---- */
.diy-step-heading {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.diy-step-sub {
    font-size: 0.88rem;
    color: var(--diy-grey-dark);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ---- Conversational dashboard ---- */
.diy-greeting {
    padding: 28px 20px 4px;
}

.diy-greeting h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.diy-greeting .greeting-meta {
    color: var(--diy-grey-dark);
    font-size: 0.85rem;
    margin-bottom: 0;
}

.diy-question {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 22px 0 14px;
}

/* ---- Large action button (dashboard) ---- */
.diy-big-action {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--diy-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    text-decoration: none;
    color: var(--diy-black);
    border: 2px solid transparent;
    transition: all 0.15s ease;
    margin-bottom: 10px;
    width: 100%;
}

.diy-big-action:hover,
.diy-big-action:focus {
    border-color: var(--diy-red);
    color: var(--diy-black);
    box-shadow: var(--shadow-hover);
}

.diy-big-action .action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--diy-red);
    color: var(--diy-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.diy-big-action .action-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

.diy-big-action .action-text span {
    font-size: 0.78rem;
    color: var(--diy-grey-dark);
}

.diy-big-action .action-chevron {
    margin-left: auto;
    color: var(--diy-grey-mid);
}

/* ---- Stat card ---- */
.diy-stat {
    background: var(--diy-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 8px;
    text-align: center;
}

.diy-stat .stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.diy-stat .stat-label {
    font-size: 0.68rem;
    color: var(--diy-grey-dark);
    margin-top: 4px;
}

/* ---- Selectable cards ---- */
.diy-selectable {
    border: 2px solid var(--diy-grey-mid) !important;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: var(--radius) !important;
}

.diy-selectable:hover,
.diy-selectable:focus {
    border-color: var(--diy-red) !important;
    background-color: rgba(115, 3, 5, 0.03);
}

.diy-selectable.active {
    border-color: var(--diy-red) !important;
    background-color: rgba(115, 3, 5, 0.06);
}

.diy-selectable.greyed {
    opacity: 0.4;
    pointer-events: none;
}

/* ---- Check-item rows ---- */
.diy-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--diy-grey-mid);
    font-size: 0.92rem;
}

.diy-check-row:last-child {
    border-bottom: none;
}

/* ---- Rating buttons ---- */
.diy-rating {
    border: 2px solid var(--diy-grey-mid) !important;
    background: var(--diy-white);
    border-radius: var(--radius) !important;
    font-size: 0.82rem !important;
    padding: 10px 4px !important;
    transition: all 0.15s ease;
}

.diy-rating.active {
    border-color: var(--diy-red) !important;
    background-color: rgba(115, 3, 5, 0.06);
    color: var(--diy-red);
    font-weight: 700;
}

/* ---- Rank badge ---- */
.rank-badge {
    display: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--diy-red);
    color: var(--diy-white);
    font-size: 0.65rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin: 4px auto 0;
}

.rank-badge.visible {
    display: flex;
}

/* ---- System suggestion bubble ---- */
.diy-suggestion {
    background-color: #f0f4ff;
    border: 1px solid #c8d8ff;
    border-radius: var(--radius);
    padding: 14px 16px;
}

.diy-suggestion .suggestion-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4a6cf7;
    margin-bottom: 4px;
}

/* ---- Pending panel (self check-in tablet queue) ---- */
.diy-pending-panel {
    border-left: 4px solid var(--diy-yellow);
    background-color: var(--diy-yellow-light);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.diy-pending-panel .btn {
    min-height: 38px;
}

/* ---- Progress bar ---- */
.diy-progress {
    height: 6px;
    border-radius: 3px;
}

.diy-progress .progress-bar {
    background-color: var(--diy-red);
}

/* ---- Pagination ---- */
.page-link {
    color: var(--diy-red);
}

.page-item.active .page-link {
    background-color: var(--diy-red);
    border-color: var(--diy-red);
    color: var(--diy-white);
}

/* ---- Search and empty states ---- */
.diy-empty-state {
    text-align: center;
    color: var(--diy-grey-dark);
    padding: 2rem 1rem;
}

.diy-empty-state .state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.85rem;
    color: var(--diy-red);
}

.diy-card-preview {
    max-width: 320px;
    margin-inline: auto;
    border-top: 5px solid var(--diy-red);
    padding: 18px 18px 20px;
}

.diy-card-preview .card-name {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.diy-card-preview .card-centre {
    font-size: 0.9rem;
    color: var(--diy-grey-dark);
}

.diy-section-stack > * + * {
    margin-top: 1rem;
}

.diy-history-card {
    padding: 16px 18px;
}

.diy-history-card .history-meta {
    color: var(--diy-grey-dark);
    font-size: 0.82rem;
}

.diy-print-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ---- System / admin controls ---- */
.diy-system-hero {
    background:
        radial-gradient(circle at top right, rgba(244, 189, 24, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(115, 3, 5, 0.06), rgba(115, 3, 5, 0.015));
}

.diy-system-kicker {
    display: inline-block;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--diy-red);
}

.diy-system-stat {
    height: 100%;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--diy-white);
    border: 1px solid rgba(115, 3, 5, 0.08);
}

.diy-system-stat strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
}

.diy-system-stat span {
    display: block;
    margin-top: 0.45rem;
    color: var(--diy-grey-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.diy-system-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--diy-grey-dark);
    border-bottom-width: 1px;
}

.diy-system-table td,
.diy-system-table th {
    vertical-align: middle;
}

.diy-system-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.diy-inline-stack {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.diy-inline-stack select {
    min-width: 180px;
}

.diy-rule-card {
    padding: 14px 16px;
    border-radius: var(--radius);
    background: rgba(115, 3, 5, 0.04);
    border: 1px solid rgba(115, 3, 5, 0.08);
}

.diy-rule-card strong,
.diy-rule-card span {
    display: block;
}

.diy-rule-card span {
    margin-top: 0.25rem;
    color: var(--diy-grey-dark);
    font-size: 0.9rem;
}

.diy-system-control-list {
    display: grid;
    gap: 0.75rem;
}

.diy-system-control-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--diy-grey-mid);
}

.diy-system-control-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.diy-system-control-row span {
    color: var(--diy-grey-dark);
    font-size: 0.88rem;
}

.diy-system-control-row strong {
    max-width: 58%;
    text-align: right;
    overflow-wrap: anywhere;
}

.diy-system-pre {
    white-space: pre-wrap;
    border-radius: var(--radius);
    padding: 14px;
    background: #111827;
    color: #e5eef8;
    font-size: 0.8rem;
}

/* ---- Member card print ---- */
@media print {
    body * {
        visibility: hidden;
    }

    .diy-print-grid,
    .diy-print-grid *,
    #member-card,
    #member-card * {
        visibility: visible;
    }

    #member-card {
        position: fixed;
        top: 10mm;
        left: 50%;
        transform: translateX(-50%);
        width: 85mm;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: var(--diy-white) !important;
    }

    .diy-print-grid {
        position: static;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10mm;
    }

    .diy-print-grid .diy-card-preview {
        max-width: none;
        width: 100%;
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .no-print {
        display: none !important;
    }
}

/* ---- Responsive ---- */

/* Tablet: collapse to single column, divider becomes horizontal */
@media (max-width: 860px) {
    .diy-landing-hero,
    .diy-auth-hero {
        grid-template-columns: 1fr;
    }

    .diy-landing-left {
        padding-right: 0;
        text-align: center;
    }

    .diy-landing-bullets {
        align-items: center;
    }

    .diy-landing-divider {
        width: 100%;
        min-height: auto;
        height: 1px;
        align-self: auto;
        margin-block: 2rem;
    }

    .diy-landing-right {
        padding-left: 0;
    }

    /* login.php auth hero */
    .diy-auth-hero .diy-landing-story {
        padding-right: 0;
        text-align: center;
    }

    .diy-auth-hero .diy-login-card {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .diy-landing-wrap {
        padding-inline: 1.25rem;
        padding-block: 2rem;
    }

    .diy-login-title {
        font-size: clamp(1.8rem, 7vw, 2.4rem);
    }

    .diy-login-copy,
    .diy-landing-lead {
        font-size: 0.95rem;
    }

    .diy-navbar {
        justify-content: space-between;
    }

    .diy-navbar-centre-badge {
        order: 3;
        width: 100%;
        max-width: 100%;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .diy-login-card .card-body {
        padding: 1.25rem !important;
    }

    .diy-greeting h2 {
        font-size: 1.3rem;
    }

    .diy-intro h2 {
        font-size: 1.4rem;
    }

    .diy-big-action .action-text strong {
        font-size: 0.95rem;
    }

    .app-main {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .diy-system-control-row,
    .diy-inline-stack,
    .diy-system-actions {
        justify-content: stretch;
    }

    .diy-system-control-row {
        flex-direction: column;
    }

    .diy-system-control-row strong {
        max-width: 100%;
        text-align: left;
    }

    .diy-inline-stack select {
        width: 100%;
        min-width: 0;
    }
}

/* ============================================================
   Intake wizard — step transitions, errors, DOB, groups
   ============================================================ */

/* Step enter animation */
@keyframes intakeStepIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.intake-step-enter {
    animation: intakeStepIn 0.22s ease forwards;
}

/* Progress card accent */
.intake-progress-card {
    border-bottom: 3px solid var(--diy-red) !important;
}

/* Inline step error */
.intake-step-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--diy-danger-soft);
    color: #7a1f1f;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 3px solid var(--diy-red);
}

.intake-step-error .fa-circle-exclamation {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Field group separator */
.intake-field-group + .intake-field-group {
    border-top: 1px solid var(--diy-grey-mid);
    padding-top: 20px;
    margin-top: 4px;
}

/* Field group label (uppercase section header) */
.intake-group-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--diy-grey-dark);
    margin-bottom: 4px;
}

/* DOB row — compact, centred number inputs */
.diy-dob-row #dob-day,
.diy-dob-row #dob-year {
    text-align: center;
    letter-spacing: 0.05em;
}

#age-preview {
    min-height: 1.2em;
}

/* Pre-check screen action buttons */
.intake-precheck-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.intake-precheck-actions .btn {
    width: 100%;
    max-width: 280px;
}

/* Loading button state */
.btn-intake-next[disabled] {
    opacity: 0.75;
    cursor: not-allowed;
}

/* Consent checkboxes — comfortable spacing */
#intake-form [data-intake-step="9"] .diy-check-row {
    align-items: flex-start;
    padding-top: 4px;
    padding-bottom: 14px;
    line-height: 1.5;
}

#intake-form [data-intake-step="9"] .diy-check-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* ============================================================
   Post-intake "What's next?" option cards
   ============================================================ */
.diy-next-option {
    border: 1.5px solid var(--diy-grey-light);
    border-radius: var(--diy-radius);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.diy-next-option:hover {
    border-color: var(--diy-red);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    color: inherit;
    text-decoration: none;
}

.diy-next-icon {
    font-size: 1.5rem;
}

/* ============================================================
   History page — tabs and visit cards
   ============================================================ */
.diy-history-tabs {
    gap: 4px;
    border-bottom: 2px solid var(--diy-grey-mid);
}

.diy-history-tabs .nav-link {
    border: none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--diy-grey-dark);
    background: transparent;
    transition: background 0.12s, color 0.12s;
}

.diy-history-tabs .nav-link:hover {
    color: var(--diy-red);
    background: rgba(115, 3, 5, 0.04);
}

.diy-history-tabs .nav-link.active {
    color: var(--diy-red);
    background: #fff;
    border-bottom: 2px solid var(--diy-red);
    margin-bottom: -2px;
}

/* ============================================================
   History page — visit cards
   ============================================================ */
.diy-visit-card {
    padding: 14px 16px;
}

.diy-visit-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--diy-red);
    color: var(--diy-white);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
}

.diy-visit-avatar-muted {
    background: var(--diy-grey-mid);
    color: var(--diy-grey-dark);
}

.diy-visit-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.84rem;
    color: var(--diy-grey-dark);
}

.history-meta {
    font-size: 0.84rem;
    color: var(--diy-grey-dark);
}

/* ============================================================
   Bottom mobile navigation
   ============================================================ */
.diy-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-top: 1px solid var(--diy-grey-mid);
    height: 60px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
    /* Safe-area inset for notched phones */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Bottom nav is full-width on all screen sizes */

.diy-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--diy-grey-dark);
    text-decoration: none;
    background: none;
    border: none;
    padding: 6px 4px;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.diy-bottom-nav-item i {
    font-size: 1.2rem;
}

.diy-bottom-nav-item:hover,
.diy-bottom-nav-item.active {
    color: var(--diy-red);
    text-decoration: none;
}

/* Push main content above the nav bar */
.diy-has-bottom-nav .app-main {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 1rem) !important;
}

/* ============================================================
   More offcanvas panel
   ============================================================ */
.diy-more-offcanvas {
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
}

.diy-more-offcanvas .offcanvas-header {
    padding: 20px 20px 16px;
}

.diy-more-section {
    padding: 8px 0 0;
}

.diy-more-section + .diy-more-section {
    border-top: 1px solid var(--diy-grey-mid);
    margin-top: 4px;
}

.diy-more-section-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--diy-grey-dark);
    padding: 8px 20px 4px;
}

.diy-more-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.12s;
}

a.diy-more-item:hover {
    background: var(--diy-grey-light);
    color: inherit;
    text-decoration: none;
}

.diy-more-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--diy-grey-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.diy-more-profile {
    align-items: flex-start;
    cursor: default;
}

.diy-more-profile .diy-more-item-icon {
    margin-top: 2px;
}

.diy-more-support-tag {
    display: flex;
    align-items: flex-start;
    background: var(--diy-grey-light);
    border-radius: var(--radius);
    margin: 4px 16px 12px;
    padding: 12px 14px;
    font-weight: 400;
    gap: 10px;
}
