:root {
    --hdc-primary: #6D1232;
    --hdc-primary-dark: #4A0D24;
    --hdc-gold: #D6A84F;
    --hdc-cream: #FFFDF8;
    --hdc-soft: #F8F1E7;
    --hdc-ink: #1E1822;
    --hdc-muted: #6D6570;
    --hdc-line: rgba(109, 18, 50, 0.15);
    --hdc-green: #1F8A5B;
    --hdc-red: #B42318;
}

.hdc-page {
    background: var(--hdc-cream);
    color: var(--hdc-ink);
}

.hdc-page::before {
    opacity: 0.04;
}

body.hdc-guest-mode .dashboard-sidebar,
body.hdc-guest-mode #hdc-dash-header {
    display: none !important;
}

body.hdc-guest-mode .dashboard-container {
    display: block;
}

body.hdc-guest-mode .hdc-main {
    width: 100%;
    margin-left: 0;
}

.hdc-main {
    background: transparent;
}

body:not(.hdc-guest-mode).hdc-page::before {
    background:
        linear-gradient(180deg, rgba(251, 247, 240, 0.88), rgba(255, 253, 248, 1) 46%),
        radial-gradient(circle at 12% 18%, rgba(214, 168, 79, 0.18), transparent 28%),
        radial-gradient(circle at 88% 8%, rgba(109, 18, 50, 0.10), transparent 28%),
        url('/img/Religious-art-background.png') center center / cover no-repeat;
    opacity: 1;
}

body:not(.hdc-guest-mode) .dashboard-container {
    background: transparent;
}

body:not(.hdc-guest-mode) .hdc-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

body:not(.hdc-guest-mode) .dashboard-sidebar {
    background:
        linear-gradient(180deg, rgba(74, 13, 36, 0.98), rgba(109, 18, 50, 0.96)),
        url('/img/Religious-art-background.png') center / cover;
    border-right: 1px solid rgba(214, 168, 79, 0.2);
    box-shadow: 18px 0 50px rgba(27, 20, 32, 0.18);
    scrollbar-width: thin;
    scrollbar-color: rgba(214, 168, 79, 0.42) rgba(255, 255, 255, 0.08);
}

body:not(.hdc-guest-mode) .sidebar-header {
    min-height: 84px;
    padding: 1.35rem 1.35rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body:not(.hdc-guest-mode) .sidebar-logo {
    display: inline-flex;
    align-items: center;
    color: var(--hdc-cream);
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
}

body:not(.hdc-guest-mode) .sidebar-logo::before {
    content: '';
    width: 10px;
    height: 34px;
    border-radius: 999px;
    margin-right: 0.75rem;
    background: linear-gradient(180deg, var(--hdc-gold), #F0D99B);
    box-shadow: 0 0 0 4px rgba(214, 168, 79, 0.12);
}

body:not(.hdc-guest-mode) .sidebar-profile {
    margin: 1rem 1rem 0.5rem;
    padding: 1.15rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body:not(.hdc-guest-mode) .profile-avatar {
    width: 52px;
    height: 52px;
    margin: 0 0 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--hdc-gold), #F0D99B);
}

body:not(.hdc-guest-mode) .profile-avatar i {
    color: var(--hdc-primary-dark);
    font-size: 1.35rem;
}

body:not(.hdc-guest-mode) .profile-name {
    color: var(--hdc-cream);
    font-size: 1rem;
    font-weight: 800;
}

body:not(.hdc-guest-mode) .profile-email {
    color: rgba(255, 253, 248, 0.76);
    font-size: 0.82rem;
    line-height: 1.35;
}

body:not(.hdc-guest-mode) .create-homily-btn {
    margin: 1.15rem 1rem;
}

body:not(.hdc-guest-mode) .create-homily-btn a {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--hdc-gold), #F0D99B);
    color: var(--hdc-primary-dark);
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body:not(.hdc-guest-mode) .create-homily-btn a:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(109, 18, 50, 0.26);
    color: var(--hdc-primary-dark);
}

body:not(.hdc-guest-mode) .sidebar-menu {
    padding: 0.35rem 0 1.25rem;
}

body:not(.hdc-guest-mode) .menu-category {
    padding: 1.1rem 1.35rem 0.55rem;
    color: rgba(255, 253, 248, 0.58);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

body:not(.hdc-guest-mode) .menu-item,
body:not(.hdc-guest-mode) .menu-item-no-auto-close {
    position: relative;
    margin: 0.14rem 0.85rem;
    padding: 0.78rem 0.85rem;
    border: 1px solid transparent;
    border-left: 0;
    border-radius: 8px;
    color: rgba(255, 253, 248, 0.84);
    font-weight: 700;
    gap: 0.75rem;
}

body:not(.hdc-guest-mode) .dashboard-sidebar .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-right: 0;
    border-radius: 8px;
    color: #F0D99B;
    background: rgba(255, 255, 255, 0.08);
}

body:not(.hdc-guest-mode) .menu-item:hover,
body:not(.hdc-guest-mode) .menu-item-no-auto-close:hover,
body:not(.hdc-guest-mode) .menu-item.active,
body:not(.hdc-guest-mode) .menu-item-no-auto-close.active {
    background: rgba(255, 253, 248, 0.12);
    border-color: rgba(214, 168, 79, 0.22);
    color: var(--hdc-cream);
}

body:not(.hdc-guest-mode) .menu-item.active::after,
body:not(.hdc-guest-mode) .menu-item-no-auto-close.active::after {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: -0.85rem;
    width: 4px;
    border-radius: 999px;
    background: var(--hdc-gold);
}

body:not(.hdc-guest-mode) .new-feature-badge {
    top: 5px;
    left: auto;
    right: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--hdc-gold), #F0D99B);
    color: var(--hdc-primary-dark);
    box-shadow: none;
    animation: none;
}

body:not(.hdc-guest-mode) .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

body:not(.hdc-guest-mode) .current-plan-info {
    padding: 1rem;
    border: 1px solid rgba(214, 168, 79, 0.22);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.1);
}

body:not(.hdc-guest-mode) .current-plan-info h4,
body:not(.hdc-guest-mode) .homilies-remaining,
body:not(.hdc-guest-mode) .update-plan-btn {
    color: rgba(255, 253, 248, 0.82);
}

body:not(.hdc-guest-mode) .plan-name {
    color: var(--hdc-cream);
}

body:not(.hdc-guest-mode) .plan-badge {
    background: rgba(214, 168, 79, 0.2);
    color: #F0D99B;
}

body:not(.hdc-guest-mode) .dashboard-header {
    background: rgba(255, 253, 248, 0.92);
    border-bottom: 1px solid var(--hdc-line);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 34px rgba(74, 13, 36, 0.06);
}

body:not(.hdc-guest-mode) .header-title h2 {
    color: var(--hdc-ink);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    font-weight: 800;
    letter-spacing: 0;
}

body:not(.hdc-guest-mode) .header-icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
    background: #fff;
    color: var(--hdc-primary-dark);
    box-shadow: 0 6px 16px rgba(27, 20, 32, 0.05);
}

.hdc-guest-header {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.4rem;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 1px solid var(--hdc-line);
    backdrop-filter: blur(12px);
}

.hdc-brand,
.hdc-guest-actions,
.hdc-hero-actions,
.hdc-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hdc-brand {
    color: var(--hdc-primary-dark);
    font-weight: 800;
    text-decoration: none;
}

.hdc-brand img {
    width: 34px;
    height: 34px;
}

.hdc-container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 1.4rem;
}

.hdc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.4rem;
    align-items: stretch;
    padding: clamp(1.4rem, 3vw, 2.4rem) 0 1.2rem;
}

.hdc-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--hdc-primary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0;
    margin-bottom: 0.7rem;
}

.hdc-hero h1 {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(2.1rem, 4vw, 4rem);
    line-height: 1.02;
    color: var(--hdc-primary-dark);
    letter-spacing: 0;
}

.hdc-hero p {
    max-width: 720px;
    margin: 1rem 0 1.35rem;
    color: var(--hdc-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.hdc-hero-panel,
.hdc-input-card,
.hdc-result-card,
.hdc-report,
.hdc-seo-section,
.hdc-modal-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(74, 13, 36, 0.09);
}

.hdc-hero-panel {
    display: grid;
    align-content: center;
    padding: 1.2rem;
}

.hdc-hero-panel div {
    padding: 1rem 0;
    border-bottom: 1px solid var(--hdc-line);
}

.hdc-hero-panel div:last-child {
    border-bottom: 0;
}

.hdc-hero-panel strong {
    display: block;
    color: var(--hdc-primary-dark);
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.hdc-hero-panel span,
.hdc-form-note {
    color: var(--hdc-muted);
    line-height: 1.55;
}

.hdc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.75rem 1rem;
    border-radius: 7px;
    border: 1px solid transparent;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hdc-btn:hover {
    transform: translateY(-1px);
}

.hdc-btn-primary {
    background: var(--hdc-primary);
    color: #fff;
    box-shadow: 0 12px 26px rgba(109, 18, 50, 0.2);
}

.hdc-btn-secondary {
    background: #fff;
    color: var(--hdc-primary-dark);
    border-color: var(--hdc-line);
}

.hdc-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    transform: none;
}

.hdc-btn-spinner {
    width: 18px;
    height: 18px;
    object-fit: contain;
    animation: hdcSpin 1.2s linear infinite;
}

.hdc-quota-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    color: var(--hdc-primary-dark);
    border: 1px solid var(--hdc-line);
    border-radius: 999px;
    padding: 0.48rem 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.hdc-quota-pill.warning {
    color: #8A5D0A;
    background: #FFF8E7;
}

.hdc-quota-pill.danger {
    color: var(--hdc-red);
    background: #FFF5F3;
}

.hdc-workbench {
    display: grid;
    grid-template-columns: minmax(290px, 0.95fr) minmax(290px, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.hdc-input-card,
.hdc-result-card,
.hdc-report {
    padding: 1.1rem;
}

.hdc-card-header {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hdc-step {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    background: var(--hdc-gold);
    color: var(--hdc-primary-dark);
    font-weight: 900;
}

.hdc-card-header h2,
.hdc-result-card h2,
.hdc-report h2,
.hdc-seo-section h2 {
    margin: 0;
    color: var(--hdc-primary-dark);
    font-size: 1.35rem;
    letter-spacing: 0;
}

.hdc-card-header p,
.hdc-result-card p {
    margin: 0.25rem 0 0;
    color: var(--hdc-muted);
    line-height: 1.5;
}

.hdc-input-card label {
    display: block;
    margin: 0.85rem 0 0.35rem;
    color: var(--hdc-primary-dark);
    font-weight: 800;
}

.hdc-input-card label span {
    color: var(--hdc-muted);
    font-weight: 600;
}

.hdc-input-card input,
.hdc-input-card select,
.hdc-input-card textarea,
.hdc-modal-card input {
    width: 100%;
    border: 1px solid var(--hdc-line);
    border-radius: 7px;
    background: #fff;
    color: var(--hdc-ink);
    padding: 0.75rem 0.85rem;
    font: inherit;
    outline: none;
}

.hdc-input-card textarea {
    resize: vertical;
    min-height: 180px;
}

.hdc-input-card input:focus,
.hdc-input-card select:focus,
.hdc-input-card textarea:focus,
.hdc-modal-card input:focus {
    border-color: var(--hdc-primary);
    box-shadow: 0 0 0 3px rgba(109, 18, 50, 0.08);
}

.hdc-load-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--hdc-soft);
    border-radius: 7px;
    color: var(--hdc-muted);
}

.hdc-load-btn,
.hdc-text-btn {
    border: 0;
    background: transparent;
    color: var(--hdc-primary);
    font-weight: 800;
    cursor: pointer;
}

.hdc-recorder {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: var(--hdc-soft);
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
}

.hdc-record-btn {
    min-height: 64px;
    border: 0;
    border-radius: 8px;
    background: var(--hdc-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-weight: 900;
    cursor: pointer;
}

.hdc-record-btn.recording {
    background: var(--hdc-red);
}

.hdc-timer {
    min-width: 74px;
    font-weight: 900;
    color: var(--hdc-primary-dark);
    text-align: center;
}

.hdc-audio-preview {
    margin-top: 0.85rem;
}

.hdc-audio-preview audio {
    width: 100%;
}

.hdc-upload {
    margin-top: 0.9rem;
}

.hdc-analyze {
    width: 100%;
    margin-top: 1rem;
}

.hdc-result-card {
    grid-column: 1 / -1;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.65rem;
}

.hdc-result-card > i {
    font-size: 2.2rem;
    color: var(--hdc-gold);
}

.hdc-result-card.hdc-error > i {
    color: var(--hdc-red);
}

.hdc-loading {
    align-items: center;
    text-align: center;
}

.hdc-site-spinner {
    width: 74px;
    height: 74px;
    object-fit: contain;
    margin-bottom: 0.4rem;
    animation: hdcSpin 1.2s linear infinite;
}

@keyframes hdcSpin {
    to { transform: rotate(360deg); }
}

.hdc-report {
    grid-column: 1 / -1;
}

.hdc-report-top {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 1rem;
}

.hdc-score {
    width: 136px;
    height: 136px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fff, #F7E6BC);
    border: 9px solid var(--hdc-gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--hdc-primary-dark);
    font-weight: 900;
}

.hdc-score strong {
    font-size: 2.2rem;
    line-height: 1;
}

.hdc-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 0.65rem;
    margin: 1rem 0;
}

.hdc-metric {
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #fff;
}

.hdc-metric span {
    display: block;
    color: var(--hdc-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.hdc-metric strong {
    color: var(--hdc-primary-dark);
    font-size: 1.35rem;
}

.hdc-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.hdc-feedback-block {
    background: #fff;
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
    padding: 1rem;
}

.hdc-feedback-block h3 {
    margin: 0 0 0.65rem;
    color: var(--hdc-primary-dark);
    font-size: 1rem;
}

.hdc-feedback-block ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--hdc-ink);
    line-height: 1.6;
}

.hdc-transcript {
    grid-column: 1 / -1;
}

.hdc-transcript details {
    margin-top: 0.85rem;
}

.hdc-transcript summary {
    cursor: pointer;
    color: var(--hdc-primary);
    font-weight: 800;
}

.hdc-seo-section {
    margin-top: 1.2rem;
    padding: 1.2rem;
}

.hdc-seo-section p {
    color: var(--hdc-muted);
    line-height: 1.7;
}

.hdc-seo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.hdc-seo-grid article {
    padding: 0.95rem;
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
    background: #fff;
}

.hdc-seo-grid h3 {
    margin: 0 0 0.35rem;
    color: var(--hdc-primary-dark);
}

.hdc-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
    background: rgba(25, 18, 25, 0.55);
}

.hdc-modal.active {
    display: flex;
}

.hdc-modal-card {
    width: min(720px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    padding: 1.2rem;
    position: relative;
}

.hdc-modal-close {
    position: absolute;
    right: 0.8rem;
    top: 0.8rem;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--hdc-soft);
    color: var(--hdc-primary-dark);
    cursor: pointer;
}

.hdc-homily-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.hdc-homily-item {
    border: 1px solid var(--hdc-line);
    border-radius: 8px;
    padding: 0.85rem;
    cursor: pointer;
    background: #fff;
}

.hdc-homily-item:hover {
    border-color: var(--hdc-primary);
}

.hdc-homily-title {
    color: var(--hdc-primary-dark);
    font-weight: 900;
}

.hdc-homily-meta,
.hdc-homily-preview {
    color: var(--hdc-muted);
    margin-top: 0.3rem;
    line-height: 1.5;
    font-size: 0.92rem;
}

.hdc-account-card {
    text-align: center;
}

.hdc-account-card > i {
    color: var(--hdc-gold);
    font-size: 2.4rem;
}

.hdc-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(14px);
    background: var(--hdc-primary-dark);
    color: #fff;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    opacity: 0;
    pointer-events: none;
    z-index: 2500;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: min(92vw, 520px);
}

.hdc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 1040px) {
    .hdc-hero,
    .hdc-workbench {
        grid-template-columns: 1fr;
    }

    .hdc-result-card,
    .hdc-report {
        grid-column: auto;
    }

    .hdc-seo-grid,
    .hdc-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body:not(.hdc-guest-mode) .hdc-main {
        margin-left: 0;
        width: 100%;
    }

    .hdc-container {
        padding: 1rem;
    }

    .hdc-guest-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .hdc-guest-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hdc-hero-actions,
    .hdc-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hdc-btn {
        width: 100%;
    }

    .hdc-recorder,
    .hdc-report-top,
    .hdc-report-grid {
        grid-template-columns: 1fr;
    }

    .hdc-score {
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    .hdc-hero h1 {
        font-size: 2.25rem;
    }

    .hdc-seo-grid,
    .hdc-metrics {
        grid-template-columns: 1fr;
    }

    .hdc-card-header {
        gap: 0.65rem;
    }

    .hdc-guest-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
