/*
AI mode styles
*/

.ai-mode-page {
    padding: 3rem 0 4rem;
}

.ai-mode-container {
    max-width: 920px;
}

.ai-page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ai-page-header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ai-page-header p {
    max-width: 60ch;
    margin: 0 auto;
    color: var(--text-secondary);
}

[hidden] {
    display: none !important;
}

.ai-period-card,
.ai-detail-panel {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(14,165,233,0.14);
    background: linear-gradient(135deg, rgba(14,165,233,0.04), rgba(20,184,166,0.04));
}

.ai-period-card__header,
.ai-detail-panel__header {
    margin-bottom: 1rem;
}

.ai-period-card__header h3,
.ai-detail-panel__header h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.ai-period-card__header p,
.ai-detail-panel__header p,
.ai-info-box {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

.ai-info-box {
    min-height: 52px;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(14,165,233,0.12);
    background: rgba(255,255,255,0.75);
}

.ai-progress-wrap,
.ai-form-shell {
    padding: 1.5rem;
}

.ai-progress-wrap {
    margin-bottom: 1.25rem;
}

.ai-progress-steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.ai-progress-steps::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.ai-progress-line {
    position: absolute;
    top: 18px;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    z-index: 0;
    transition: width 0.35s ease;
}

.ai-step-indicator {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.ai-step-dot {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.45rem;
    transition: var(--transition);
}

.ai-step-label {
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.ai-step-indicator.active .ai-step-dot,
.ai-step-indicator.completed .ai-step-dot {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.ai-step-indicator.active .ai-step-label {
    color: var(--text-primary);
    font-weight: 700;
}

.ai-form-step {
    display: none;
    animation: aiFadeIn 0.25s ease;
}

.ai-form-step.active {
    display: block;
}

@keyframes aiFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-step-title {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    line-height: 1.15;
}

.ai-step-desc {
    margin: 0 0 1.4rem;
    color: var(--text-secondary);
}

.ai-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.2rem;
    margin-bottom: 0.25rem;
}

.flyup-field .req {
    color: var(--accent);
    margin-left: 0.15rem;
}

.ai-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ai-mode-option,
.ai-chip {
    transition: var(--transition);
    cursor: pointer;
}

.ai-mode-option {
    padding: 1rem;
    text-align: center;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.ai-mode-option h4 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.ai-mode-option p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.ai-mode-option.selected {
    border-color: rgba(14,165,233,0.35);
    box-shadow: 0 10px 24px rgba(14,165,233,0.10);
    background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(20,184,166,0.08));
}

.ai-destination-field {
    margin-bottom: 1.25rem;
}

.ai-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ai-chip {
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.88rem;
}

.ai-chip.selected {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 18px rgba(14,165,233,0.18);
}

.ai-form-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.ai-review-box {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(14,165,233,0.22);
    background: linear-gradient(135deg, rgba(14,165,233,0.06), rgba(20,184,166,0.06));
}

.ai-review-box h4 {
    margin: 0 0 0.45rem;
    color: var(--accent);
}

.ai-review-box p {
    margin: 0;
    color: var(--text-secondary);
}

.ai-loading {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
}

.ai-loading.active {
    display: block;
}

.ai-loading.active.is-generating {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background:
        radial-gradient(circle at 30% 20%, rgba(56,189,248,0.18), transparent 32%),
        radial-gradient(circle at 70% 75%, rgba(20,184,166,0.16), transparent 30%),
        rgba(248,250,252,0.94);
    backdrop-filter: blur(8px);
    text-align: center;
}

.ai-loading.active.is-generating::before {
    content: "";
    position: absolute;
    width: min(520px, calc(100% - 2rem));
    min-height: 330px;
    border-radius: 28px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(14,165,233,0.18);
    box-shadow: 0 28px 80px rgba(15,23,42,0.18);
    z-index: 0;
}

.ai-loading.active.is-generating h3 {
    margin: 0 0 0.55rem;
    font-size: clamp(1.35rem, 3vw, 2rem);
    color: var(--text-primary);
}

.ai-loading.active.is-generating p {
    max-width: 46ch;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.6;
}

body.flyup-ai-generation-in-progress {
    overflow: hidden;
}

.ai-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(15,23,42,0.08);
    border-top-color: var(--accent);
    border-radius: 999px;
    animation: aiSpin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .ai-mode-page {
        padding: 2rem 0 3rem;
    }

    .ai-form-grid,
    .ai-mode-toggle {
        grid-template-columns: 1fr;
    }

    .ai-progress-steps {
        display: none;
    }

    .ai-form-nav {
        flex-direction: column;
    }

    .ai-form-nav .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Point 5 AI pricing modal + generated result */
.ai-service-toggle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-period-field[hidden],
.ai-destination-field[hidden] {
    display: none !important;
}

.ai-price-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.ai-price-modal.is-open {
    display: block;
}

.ai-price-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
}

.ai-price-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(540px, calc(100% - 2rem));
    margin: 3.5vh auto 0;
    padding: 1.15rem 1.2rem;
    max-height: calc(100vh - 7vh);
    overflow-y: auto;
}

.ai-price-modal__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
}

.ai-price-summary dl {
    display: grid;
    gap: 0.35rem;
    margin: 0.75rem 0 0.55rem;
}

.ai-price-summary dl > div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.65rem;
    padding: 0.48rem 0;
    border-bottom: 1px solid var(--border);
}

.ai-price-summary dt {
    color: var(--text-secondary);
    font-weight: 700;
}

.ai-price-summary dd {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.ai-price-summary__total dd {
    color: var(--accent);
    font-size: 1.12rem;
}

.ai-price-modal__actions {
    display: flex;
    gap: 0.7rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.ai-price-modal__note {
    margin: 0.55rem 0 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.ai-result-shell {
    margin-top: 1.5rem;
}

.ai-generated-report {
    padding: 1.3rem;
}

.ai-generated-report h2 {
    margin-top: 0;
}

.ai-generated-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ai-generated-grid article,
.ai-generated-day {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.ai-generated-grid article span {
    display: inline-flex;
    margin-left: 0.5rem;
    color: var(--accent);
    font-weight: 800;
}

.ai-generated-day {
    margin-top: 1rem;
}

.ai-generated-day ul {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .ai-service-toggle {
        grid-template-columns: 1fr;
    }

    .ai-generated-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ai-price-summary dl > div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .ai-price-modal__actions {
        flex-direction: column;
    }

    .ai-price-modal__actions .btn {
        width: 100%;
        justify-content: center;
    }
}


.flyup-report-view__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.flyup-report-view__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
    justify-content: flex-end;
}

.flyup-report-view__meta span {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .flyup-report-view__header {
        flex-direction: column;
    }

    .flyup-report-view__meta {
        justify-content: flex-start;
    }
}


.ai-report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.ai-report-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.ai-edit-notice {
    margin-bottom: 1rem;
}

.ai-report-stage {
    position: relative;
}

.ai-report-stage.is-editing .ai-report-content {
    outline: 2px dashed rgba(14,165,233,0.45);
    outline-offset: 8px;
    border-radius: 18px;
}

.ai-report-content.is-editing {
    cursor: text;
}

.ai-report-stage.is-user-edited .flyup-report-view {
    border-color: rgba(14,165,233,0.30);
}

@media (max-width: 768px) {
    .ai-report-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-report-toolbar__actions {
        width: 100%;
        justify-content: stretch;
    }

    .ai-report-toolbar__actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

.ai-service-toggle--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-mode-option__badge {
    display: inline-flex;
    margin-bottom: 0.55rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(14,165,233,0.10);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-inline-note {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.ai-gastronomy-toggle {
    margin-top: 0.2rem;
}

.ai-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 600;
}

.ai-checkbox-row--toggle {
    width: 100%;
    justify-content: flex-start;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(14,165,233,0.16);
    background: rgba(255,255,255,0.9);
}

.ai-checkbox-row--toggle span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ai-checkbox-row--toggle small {
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
}

.ai-checkbox-row input[type="checkbox"],
.ai-checkbox-card input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0;
    flex: 0 0 20px;
    accent-color: var(--accent);
}

.ai-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.ai-checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 72px;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.ai-checkbox-card span {
    font-weight: 600;
}

.ai-gastronomy-options {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(14,165,233,0.16);
    background: linear-gradient(135deg, rgba(14,165,233,0.05), rgba(20,184,166,0.05));
}

.ai-gastronomy-options__intro {
    margin-bottom: 0.9rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-dietary-other-field {
    margin-top: 1rem;
}

.ai-form-grid--gastronomy {
    align-items: end;
}

@media (max-width: 768px) {
    .ai-service-toggle--two,
    .ai-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.ai-checkbox-card input:checked + span {
    color: var(--text-primary);
}

.ai-checkbox-card:has(input:checked) {
    border-color: rgba(14,165,233,0.35);
    background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(20,184,166,0.08));
}

.ai-page-header__note {
    margin-top: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.14);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.4;
}

.flyup-dashboard-badge.badge-subtle {
    background: rgba(14, 165, 233, 0.08);
    color: var(--accent);
    border: 1px solid rgba(14, 165, 233, 0.14);
}

.flyup-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin: 0 0 1rem;
}

.flyup-report-actions__btn {
  min-height: 46px;
}

.flyup-report-actions__hint {
  margin: -.25rem 0 1rem;
  color: var(--text-secondary);
  font-size: .92rem;
}


.flyup-report-actions {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(56,189,248,0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(30,41,59,0.92));
    box-shadow: 0 14px 34px rgba(2,6,23,0.26);
    color: #e2e8f0;
}
.flyup-report-actions__title {
    margin-bottom: 0.75rem;
    font-weight: 800;
    color: #ffffff;
}
.flyup-report-actions__btn {
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
}
.flyup-report-actions__hint {
    margin: 0.25rem 0 0;
    color: #cbd5e1;
    font-size: 0.92rem;
}


.flyup-report-actions__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.flyup-report-actions__status-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.flyup-report-actions__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.flyup-report-actions__status--connected {
    background: rgba(16, 185, 129, 0.14);
    color: #d1fae5;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.flyup-report-actions__plan {
    margin: 0.5rem 0 0.85rem;
    color: #cbd5e1;
    font-size: 0.94rem;
}

.flyup-report-actions__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.flyup-report-actions__messages {
    display: grid;
    gap: 0.35rem;
}

.flyup-report-actions__connect {
    min-height: 42px;
}


/* ========================================================
   STEP16 - Light styling for Google/report action blocks
======================================================== */
.flyup-report-actions {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(219,231,243,0.95) !important;
    border-radius: 18px;
    background: rgba(255,255,255,0.94) !important;
    box-shadow: 0 14px 34px rgba(15,23,42,0.06) !important;
    color: var(--text-primary) !important;
}

.flyup-report-actions__title {
    color: var(--text-primary) !important;
}

.flyup-report-actions__hint,
.flyup-report-actions__plan {
    color: var(--text-secondary) !important;
}

.flyup-report-actions__status {
    background: rgba(248,250,252,0.95);
    border: 1px solid rgba(219,231,243,0.95);
    color: var(--text-secondary);
}

.flyup-report-actions__status--connected {
    background: rgba(22,163,74,0.10) !important;
    color: #15803d !important;
    border: 1px solid rgba(22,163,74,0.16) !important;
}

.flyup-report-actions__btn,
.flyup-report-actions__connect {
    min-height: 44px;
}


.flyup-report-admin-note,
.flyup-report-admin-footer {
    margin-top: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.flyup-report-admin-footer {
    margin-top: 1.2rem;
}

/* Step53 Phase 1 — generation progress */
.ai-generation-progress {
    width: min(420px, 100%);
    height: 10px;
    margin: 1.25rem auto 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.14);
}

.ai-generation-progress span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #5eead4);
    transition: width 0.55s ease;
}

.ai-generation-percent {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Step53 Phase 4 — managed report rendering */
.flyup-report-view__sections {
    display: grid;
    gap: 0.95rem;
}

.flyup-report-managed-section {
    min-width: 0;
}

.flyup-report-section-group {
    display: grid;
    gap: 0.75rem;
}

.flyup-report-section-group > h3 {
    margin: 0.5rem 0 0.15rem;
    font-size: 1.18rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.flyup-report-view.ai-generated-report {
    overflow: hidden;
}

.flyup-report-view__header {
    break-inside: avoid;
    page-break-inside: avoid;
}

.flyup-report-managed-section,
.flyup-ai-accordion,
.ai-generated-place,
.ai-generated-subsection,
.ai-generated-grid article {
    break-inside: avoid;
    page-break-inside: avoid;
}

@media print {
    .flyup-report-view__sections {
        gap: 0.65rem;
    }

    .flyup-ai-accordion {
        border: 1px solid #dbe7f3 !important;
        box-shadow: none !important;
    }

    .flyup-ai-accordion__content {
        display: block !important;
    }

    .flyup-report-admin-note,
    .flyup-report-admin-footer {
        border: 1px solid #dbe7f3 !important;
        background: #ffffff !important;
    }
}

.ai-loading.active.is-generating > * {
    position: relative;
    z-index: 1;
}

/* Phase16L: clearer insufficient credit state in AI price modal */
.ai-price-summary__warning dd {
    color: #b45309;
    font-weight: 800;
}
.ai-price-summary__warning {
    background: rgba(245, 158, 11, 0.08);
    border-radius: 14px;
}

/* Phase16O: controlled AI status messages (no native browser alert during generation) */
.flyup-ai-status-message {
    max-width: 760px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    border-radius: 18px;
}

.flyup-ai-status-message h2 {
    margin-top: 0;
    margin-bottom: 0.65rem;
}

.flyup-ai-status-message p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.flyup-ai-status-message--warning {
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.96));
}

.flyup-ai-status-message--error {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.96));
}

/* Step53 phase16AH12: background generation waiting screen, no fake percentage. */
.flyup-ai-status-message--progress,
.flyup-ai-status-message--success {
    border: 1px solid rgba(14, 165, 233, 0.24);
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
    text-align: center;
}

.flyup-ai-writing-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 999px;
    border: 4px solid rgba(14, 165, 233, 0.14);
    border-top-color: rgba(14, 165, 233, 0.85);
    animation: flyupAiWritingSpin 1s linear infinite;
}

@keyframes flyupAiWritingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Step53 phase16AH13: no fake generation percentage. */
.ai-loading.active.is-generating .ai-generation-percent {
    display: none !important;
}

.ai-loading.active.is-generating .ai-generation-progress {
    width: min(260px, 70vw);
    height: 4px;
    margin-top: 1rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(14,165,233,0.12);
}

.ai-loading.active.is-generating .ai-generation-progress span {
    width: 35% !important;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(14,165,233,0.15), rgba(14,165,233,0.85), rgba(20,184,166,0.3));
    animation: flyupAiIndeterminateProgress 1.4s ease-in-out infinite;
}

@keyframes flyupAiIndeterminateProgress {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(300%); }
}

/* Step 16AH14: no fake progress percentage during AI report writing. */
.ai-generation-progress,
.ai-generation-percent {
    display: none !important;
}

/* Step53 phase16AH17: keep AI waiting overlay above footer and improve popup breathing space. */
.ai-loading.active.is-generating {
    inset: 0 0 clamp(92px, 14vh, 150px) 0;
    min-height: auto;
    padding: clamp(2.2rem, 4vw, 4rem) 1.5rem;
    box-sizing: border-box;
}

.ai-loading.active.is-generating::before {
    width: min(560px, calc(100% - 2rem));
    min-height: 360px;
    border-radius: 30px;
}

.ai-loading.active.is-generating > * {
    position: relative;
    z-index: 1;
}

.ai-loading.active.is-generating h3 {
    max-width: min(480px, calc(100% - 3rem));
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.75rem;
    line-height: 1.22;
}

.ai-loading.active.is-generating p {
    max-width: min(430px, calc(100% - 3rem));
    padding: 0 0.75rem;
}

.ai-loading.active.is-generating .ai-spinner {
    margin-bottom: 1.35rem;
}

@media (max-width: 640px) {
    .ai-loading.active.is-generating {
        inset: 0 0 88px 0;
        padding: 1.75rem 1rem;
    }

    .ai-loading.active.is-generating::before {
        width: calc(100% - 2rem);
        min-height: 330px;
    }
}

/* Step53 phase16AU - AI mode header harmonization + clean loading overlay */
.ai-mode-page .ai-mode-container {
    width: 100%;
}

.ai-mode-page .ai-page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin-bottom: 1.2rem;
    padding: 1.35rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.86);
    box-shadow: 0 18px 45px rgba(15,23,42,0.06);
}

.ai-mode-page .ai-page-header .homepage-hero__eyebrow {
    margin-bottom: 0.45rem;
}

.ai-mode-page .ai-page-header h1 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.65rem, 2.6vw, 2.25rem);
    line-height: 1.08;
}

.ai-mode-page .ai-page-header p {
    max-width: 620px;
    margin: 0;
    line-height: 1.5;
}

.ai-mode-page .ai-loading.active.is-generating {
    inset: 0 !important;
    padding: clamp(2.4rem, 4vw, 4.5rem) 1.5rem !important;
    background:
        radial-gradient(circle at 25% 18%, rgba(56,189,248,0.14), transparent 34%),
        radial-gradient(circle at 75% 78%, rgba(20,184,166,0.13), transparent 32%),
        rgba(248,250,252,0.985) !important;
    backdrop-filter: none !important;
}

.ai-mode-page .ai-loading.active.is-generating::before {
    width: min(560px, calc(100% - 2rem)) !important;
    min-height: 340px !important;
    border-radius: 30px !important;
    background: #fff !important;
    border: 1px solid rgba(14,165,233,0.20) !important;
    box-shadow: 0 28px 80px rgba(15,23,42,0.16) !important;
}

@media (max-width: 760px) {
    .ai-mode-page .ai-page-header {
        align-items: center;
        text-align: center;
        padding: 1.15rem;
    }

    .ai-mode-page .ai-page-header p {
        margin-inline: auto;
    }
}

/* Legal consent inside AI payment confirmation modal */
.ai-terms-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.45rem 0 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.ai-terms-consent input {
    margin-top: 0.12rem;
    flex-shrink: 0;
}

.ai-terms-consent a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.ai-terms-consent a:hover {
    text-decoration: underline;
}

.ai-terms-consent__error {
    margin: 0 0 0.35rem;
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 700;
}

.ai-terms-notice {
    margin: 0.35rem 0 0.25rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: center;
}

.ai-terms-notice a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.ai-terms-notice a:hover {
    text-decoration: underline;
}


/* PHASE16CX — Guest AI page layout fix (loaded after dashboard.css) */
.ai-mode-page .flyup-dashboard-layout--guest {
    display: block !important;
    width: 100% !important;
}
.ai-mode-page .flyup-dashboard-main--guest {
    width: 100% !important;
    max-width: 1120px !important;
    margin: 0 auto !important;
}
.ai-mode-page .flyup-dashboard-main--guest .ai-mode-container {
    width: 100% !important;
    max-width: 920px !important;
    margin: 0 auto !important;
}
.ai-page-header__note--guest,
.ai-info-box--guest-demo {
    display: block;
    max-width: 720px;
    margin: 1rem auto 0;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(14, 165, 233, 0.22);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(20, 184, 166, 0.08));
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
}
@media (max-width: 768px) {
    .ai-mode-page {
        padding-top: 2rem;
    }
    .ai-mode-page .flyup-dashboard-main--guest .ai-mode-container {
        max-width: 100% !important;
    }
    .ai-progress-steps {
        gap: 0.35rem;
    }
    .ai-step-label {
        font-size: 0.68rem;
    }
}


/* Phase16CY - separate Planner / Inspiration quiz presentation */
.ai-form-shell--separate-quiz .ai-service-toggle--two {
    margin-bottom: 1rem;
}

.ai-form-shell--separate-quiz .ai-mode-option:not(.selected) {
    opacity: 0.72;
}

.ai-quiz-track-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem 1rem;
    align-items: center;
    margin: 1rem 0 1.1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(14, 165, 233, 0.18);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(20, 184, 166, 0.07));
}

.ai-quiz-track-card span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-quiz-track-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.ai-quiz-track-card a {
    grid-row: 1 / span 2;
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.ai-form-shell.is-inspiration-quiz [data-service-visibility="report"],
.ai-form-shell.is-planner-quiz [data-service-visibility="inspiration"] {
    display: none !important;
}

@media (max-width: 720px) {
    .ai-quiz-track-card {
        grid-template-columns: 1fr;
    }

    .ai-quiz-track-card a {
        grid-row: auto;
        grid-column: auto;
        width: 100%;
    }
}


/* Phase16DB - cleaner public Planner/Inspiration wording */
.ai-form-shell--separate-quiz #aiOfferCommitmentNote[hidden],
#aiOfferCommitmentNote[hidden] {
    display: none !important;
}

.ai-form-shell--separate-quiz .ai-mode-option:not(.selected) {
    opacity: 1;
    cursor: pointer;
}

.ai-form-shell--separate-quiz .ai-mode-option[disabled],
.ai-form-shell--separate-quiz .ai-mode-option[aria-disabled="true"] {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

.ai-quiz-track-card {
    background: rgba(255,255,255,0.82);
    border-color: rgba(219,231,243,0.95);
}

.ai-quiz-track-card span {
    color: var(--accent);
    letter-spacing: 0.01em;
    text-transform: none;
}

.ai-quiz-track-card strong {
    font-size: 1.02rem;
}

.ai-quiz-track-card a {
    white-space: nowrap;
}

/* PHASE16DK — Inspiration guest note aligned with form cards */
.ai-form-shell .ai-info-box--guest-demo {
    width: 100%;
    max-width: none;
    margin: 1rem 0 0;
    text-align: left;
}

.ai-form-shell.is-inspiration-quiz .ai-info-box--guest-demo {
    width: 100%;
    max-width: none;
    margin: 1rem 0 0;
}

/* PHASE16DL — Autocomplete fields and inspiration notice spacing */
.ai-form-shell .ai-info-box--guest-demo {
    margin: 1.25rem 0 1.25rem !important;
}
.ai-form-shell.is-inspiration-quiz .ai-info-box--guest-demo {
    margin: 1.25rem 0 1.25rem !important;
}
input[list].form-control {
    appearance: auto;
}

/* PHASE16DM — polished country/city autocomplete */
.flyup-autocomplete-wrap {
    position: relative;
}

.flyup-autocomplete-panel {
    position: fixed;
    z-index: 99990;
    overflow-y: auto;
    padding: 0.45rem;
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(14px);
}

.flyup-autocomplete-panel[hidden] {
    display: none !important;
}

.flyup-autocomplete-option {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.72rem 0.82rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.flyup-autocomplete-option:hover,
.flyup-autocomplete-option:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.10), rgba(20, 184, 166, 0.08));
}

.flyup-autocomplete-option__title {
    font-weight: 800;
    line-height: 1.2;
}

.flyup-autocomplete-option__meta,
.flyup-autocomplete-empty {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.35;
}

.flyup-autocomplete-empty {
    padding: 0.8rem 0.9rem;
}

.ai-form-shell input.form-control:not([list]) {
    appearance: none;
}

@media (max-width: 720px) {
    .flyup-autocomplete-panel {
        max-height: 260px;
        border-radius: 16px;
    }
}

/* PHASE16DN — keep autocomplete panel directly attached to the active field */
.flyup-autocomplete-panel {
    box-sizing: border-box;
}

/* =====================================================================
   STEP53 PHASE17CA — HTML editor presentation only
   Scope: AI saved report opened from the pencil button (?view=html-editor).
   PDF/export renderer is not touched.
===================================================================== */
.ai-result-shell--html-editor {
    --html-editor-card: rgba(255,255,255,0.94);
    --html-editor-border: rgba(14,165,233,0.18);
    --html-editor-accent: #0ea5e9;
    --html-editor-accent-2: #14b8a6;
    --html-editor-text: #0f172a;
    --html-editor-muted: #475569;
    max-width: 1160px;
    margin-inline: auto;
}

.ai-result-shell--html-editor .ai-report-toolbar.card {
    position: sticky;
    top: 88px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid var(--html-editor-border);
    border-radius: 24px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 18px 42px rgba(15,23,42,0.08);
    backdrop-filter: blur(14px);
}

.ai-result-shell--html-editor .ai-report-toolbar__meta,
.ai-result-shell--html-editor .ai-report-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.ai-result-shell--html-editor .badge-html-editor {
    background: rgba(14,165,233,0.08);
    color: #0369a1;
    border-color: rgba(14,165,233,0.18);
}

.ai-result-shell--html-editor .ai-report-stage {
    margin-top: 1.15rem;
    padding: clamp(0.85rem, 1.6vw, 1.35rem);
    border-radius: 30px;
    background:
        radial-gradient(circle at 18% 0%, rgba(14,165,233,0.18), transparent 34%),
        radial-gradient(circle at 90% 18%, rgba(20,184,166,0.14), transparent 36%),
        linear-gradient(180deg, #e8fbff 0%, #f8fdff 100%);
    border: 1px solid rgba(56,189,248,0.16);
    box-shadow: 0 24px 62px rgba(15,23,42,0.08);
}

.ai-result-shell--html-editor .ai-report-content {
    max-width: 1080px;
    margin-inline: auto;
}

.ai-result-shell--html-editor .ai-report-content.is-editing {
    background: rgba(255,255,255,0.62);
    border-radius: 24px;
    caret-color: var(--html-editor-accent);
}

.ai-result-shell--html-editor .ai-report-stage.is-editing .ai-report-content {
    outline: 3px dashed rgba(14,165,233,0.46);
    outline-offset: 10px;
    box-shadow: 0 0 0 8px rgba(14,165,233,0.06);
}

.ai-result-shell--html-editor .flyup-report-view.ai-generated-report.card {
    width: 100%;
    margin: 0;
    padding: clamp(1.1rem, 2vw, 1.65rem);
    border-radius: 26px;
    border: 1px solid rgba(14,165,233,0.18);
    background: rgba(255,255,255,0.96);
    box-shadow: 0 20px 50px rgba(15,23,42,0.08);
    color: var(--html-editor-text);
}

.ai-result-shell--html-editor .flyup-report-view__header {
    margin-bottom: 1.25rem;
    padding: clamp(1.1rem, 2vw, 1.6rem);
    border-radius: 24px;
    border: 1px solid rgba(14,165,233,0.18);
    background:
        linear-gradient(135deg, rgba(240,249,255,0.98), rgba(236,254,255,0.9)),
        radial-gradient(circle at 90% 0%, rgba(14,165,233,0.20), transparent 34%);
}

.ai-result-shell--html-editor .flyup-report-view__intro h2,
.ai-result-shell--html-editor .ai-generated-report h2 {
    color: var(--html-editor-text);
    font-size: clamp(1.45rem, 3.2vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 0.6rem;
}

.ai-result-shell--html-editor .flyup-report-view__intro p,
.ai-result-shell--html-editor .ai-generated-report p,
.ai-result-shell--html-editor .ai-generated-report li,
.ai-result-shell--html-editor .ai-generated-report span,
.ai-result-shell--html-editor .ai-generated-report small,
.ai-result-shell--html-editor .ai-generated-report div {
    font-size: clamp(0.95rem, 1.2vw, 1.04rem);
    line-height: 1.68;
}

.ai-result-shell--html-editor .ai-generated-report small {
    color: var(--html-editor-muted);
}

.ai-result-shell--html-editor .flyup-report-view__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.ai-result-shell--html-editor .flyup-report-view__meta span,
.ai-result-shell--html-editor .ai-generated-report .flyup-dashboard-badge {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.62rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(14,165,233,0.16);
    color: #0f172a;
    font-weight: 800;
}

.ai-result-shell--html-editor .flyup-ai-accordion {
    overflow: hidden;
    margin: 1rem 0;
    border-radius: 24px;
    border: 1px solid var(--html-editor-border);
    background: var(--html-editor-card);
    box-shadow: 0 12px 34px rgba(15,23,42,0.06);
}

.ai-result-shell--html-editor .flyup-ai-accordion[open] {
    border-color: rgba(14,165,233,0.30);
    box-shadow: 0 18px 46px rgba(14,165,233,0.10);
}

.ai-result-shell--html-editor .flyup-ai-accordion__summary {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    color: #0f172a;
    font-size: clamp(1.02rem, 1.5vw, 1.22rem);
    font-weight: 900;
    letter-spacing: -0.015em;
    cursor: pointer;
    list-style: none;
}

.ai-result-shell--html-editor .flyup-ai-accordion__summary::-webkit-details-marker {
    display: none;
}

.ai-result-shell--html-editor .flyup-ai-accordion__summary::before {
    content: '';
    width: 0.34rem;
    align-self: stretch;
    min-height: 1.9rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--html-editor-accent), var(--html-editor-accent-2));
    box-shadow: 0 0 0 4px rgba(14,165,233,0.08);
    flex: 0 0 auto;
}

.ai-result-shell--html-editor .flyup-ai-accordion__summary::after {
    content: '+';
    margin-left: auto;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(14,165,233,0.09);
    color: #0369a1;
    font-weight: 900;
}

.ai-result-shell--html-editor .flyup-ai-accordion[open] .flyup-ai-accordion__summary::after {
    content: '–';
}

.ai-result-shell--html-editor .flyup-ai-accordion__content {
    padding: clamp(1rem, 2vw, 1.45rem);
    background: #fff;
}

.ai-result-shell--html-editor .ai-generated-day {
    padding: 0;
    background: transparent;
    border: 0;
}

.ai-result-shell--html-editor .ai-generated-day > p {
    margin: 0 0 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(240,249,255,0.8);
    border: 1px solid rgba(14,165,233,0.12);
}

.ai-result-shell--html-editor .ai-generated-subsection,
.ai-result-shell--html-editor .ai-generated-place,
.ai-result-shell--html-editor .ai-generated-option,
.ai-result-shell--html-editor .ai-generated-transition,
.ai-result-shell--html-editor .ai-generated-hotel-start,
.ai-result-shell--html-editor .ai-generated-hotel-return,
.ai-result-shell--html-editor .ai-generated-grid > article {
    margin: 0.85rem 0;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(226,232,240,0.95);
    background: linear-gradient(180deg, #ffffff, #f8fcff);
    box-shadow: 0 6px 18px rgba(15,23,42,0.035);
}

.ai-result-shell--html-editor .ai-generated-subsection h4,
.ai-result-shell--html-editor .ai-generated-place__title strong,
.ai-result-shell--html-editor .ai-generated-grid > article h3,
.ai-result-shell--html-editor .ai-generated-grid > article h4 {
    color: #0f172a;
    font-size: clamp(1rem, 1.25vw, 1.12rem);
    font-weight: 900;
    margin-bottom: 0.45rem;
}

.ai-result-shell--html-editor .ai-generated-transition,
.ai-result-shell--html-editor .ai-generated-hotel-start,
.ai-result-shell--html-editor .ai-generated-hotel-return {
    border-left: 4px solid var(--html-editor-accent);
    background: #f0f9ff;
}

.ai-result-shell--html-editor .ai-generated-place {
    border-left: 4px solid var(--html-editor-accent-2);
}

.ai-result-shell--html-editor .ai-generated-place__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.ai-result-shell--html-editor .ai-generated-place__links a,
.ai-result-shell--html-editor .ai-generated-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--html-editor-accent), var(--html-editor-accent-2));
    color: #fff !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(14,165,233,0.18);
}

.ai-result-shell--html-editor .ai-generated-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.85rem;
}

.ai-result-shell--html-editor .ai-generated-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
    padding: 0;
    margin: 0.75rem 0;
    list-style: none;
}

.ai-result-shell--html-editor .ai-generated-meta-list li {
    margin: 0;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    background: rgba(248,250,252,0.96);
    border: 1px solid rgba(226,232,240,0.96);
}

.ai-result-shell--html-editor .ai-generated-meta-list li strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #475569;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-result-shell--html-editor table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(226,232,240,0.95);
    background: #fff;
}

.ai-result-shell--html-editor table th,
.ai-result-shell--html-editor table td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid rgba(226,232,240,0.95);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.ai-result-shell--html-editor table th {
    background: #eaf7ff;
    color: #0f172a;
    font-weight: 900;
}

.ai-result-shell--html-editor table tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 900px) {
    .ai-result-shell--html-editor .ai-report-toolbar.card {
        position: relative;
        top: auto;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .ai-result-shell--html-editor .ai-report-toolbar__actions .btn {
        flex: 1 1 150px;
    }

    .ai-result-shell--html-editor .flyup-report-view__meta,
    .ai-result-shell--html-editor .ai-generated-grid,
    .ai-result-shell--html-editor .ai-generated-meta-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ai-result-shell--html-editor {
        max-width: 100%;
    }

    .ai-result-shell--html-editor .ai-report-stage {
        margin-inline: -0.35rem;
        padding: 0.55rem;
        border-radius: 22px;
    }

    .ai-result-shell--html-editor .flyup-report-view.ai-generated-report.card {
        padding: 0.9rem;
        border-radius: 22px;
    }

    .ai-result-shell--html-editor .flyup-report-view__header,
    .ai-result-shell--html-editor .flyup-ai-accordion,
    .ai-result-shell--html-editor .ai-generated-subsection,
    .ai-result-shell--html-editor .ai-generated-place,
    .ai-result-shell--html-editor .ai-generated-option,
    .ai-result-shell--html-editor .ai-generated-transition,
    .ai-result-shell--html-editor .ai-generated-hotel-start,
    .ai-result-shell--html-editor .ai-generated-hotel-return,
    .ai-result-shell--html-editor .ai-generated-grid > article {
        border-radius: 18px;
    }

    .ai-result-shell--html-editor .flyup-ai-accordion__summary {
        padding: 0.9rem;
    }

    .ai-result-shell--html-editor .flyup-ai-accordion__content {
        padding: 0.85rem;
    }

    .ai-result-shell--html-editor .ai-generated-report p,
    .ai-result-shell--html-editor .ai-generated-report li,
    .ai-result-shell--html-editor .ai-generated-report span,
    .ai-result-shell--html-editor .ai-generated-report small,
    .ai-result-shell--html-editor .ai-generated-report div {
        font-size: 0.95rem;
        line-height: 1.62;
    }

    .ai-result-shell--html-editor table,
    .ai-result-shell--html-editor table thead,
    .ai-result-shell--html-editor table tbody,
    .ai-result-shell--html-editor table tr,
    .ai-result-shell--html-editor table th,
    .ai-result-shell--html-editor table td {
        display: block;
        width: 100%;
    }

    .ai-result-shell--html-editor table thead {
        display: none;
    }

    .ai-result-shell--html-editor table tr {
        margin: 0.75rem 0;
        border: 1px solid rgba(226,232,240,0.95);
        border-radius: 16px;
        overflow: hidden;
        background: #fff;
    }

    .ai-result-shell--html-editor table td {
        border-bottom: 1px solid rgba(226,232,240,0.85);
    }
}


/* STEP53 PHASE17CQ — readable HTML download button in HTML editor toolbar */
.ai-report-toolbar__download-html {
    white-space: nowrap;
}

.ai-result-shell--html-editor .ai-report-toolbar__actions {
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* STEP53 PHASE18Y — inline validation for AI form, no native alert pop-up */
.ai-step-validation-notice {
    margin: 0.85rem 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(220, 38, 38, 0.22);
    background: rgba(254, 242, 242, 0.96);
    color: #991b1b;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.45;
}

.ai-step-validation-notice[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    body.flyup-mobile-quiz-active .ai-step-validation-notice {
        margin: 0.7rem 0 0.9rem;
        padding: 0.8rem 0.9rem;
        border-radius: 18px;
        font-size: 0.88rem;
    }
}


/* Phase18AF — the date period explanatory header is removed from markup; keep field-only date card compact. */
.ai-period-card--fields-only {
    padding-top: 1rem;
}

/* Geoapify stay-location verification */
.ai-stay-validation {
    margin-top: 0.55rem;
    padding: 0.62rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.92);
    color: #475569;
    font-size: 0.87rem;
    line-height: 1.35;
}

.ai-stay-validation[hidden],
.ai-stay-candidates[hidden] {
    display: none !important;
}

.ai-stay-validation.is-checking {
    border-color: rgba(14, 165, 233, 0.28);
    background: rgba(240, 249, 255, 0.95);
    color: #0369a1;
}

.ai-stay-validation.is-ok {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(240, 253, 244, 0.95);
    color: #166534;
}

.ai-stay-validation.is-warning {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(255, 251, 235, 0.96);
    color: #92400e;
}

.ai-stay-candidates {
    margin-top: 0.55rem;
    display: grid;
    gap: 0.55rem;
}

.ai-stay-candidate {
    width: 100%;
    display: grid;
    gap: 0.22rem;
    padding: 0.72rem 0.82rem;
    border-radius: 14px;
    border: 1px solid rgba(14, 165, 233, 0.18);
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.ai-stay-candidate:hover {
    border-color: rgba(14, 165, 233, 0.42);
    transform: translateY(-1px);
}

.ai-stay-candidate__main {
    font-weight: 800;
    font-size: 0.92rem;
}

.ai-stay-candidate__address,
.ai-stay-candidate__meta {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.3;
}

.ai-stay-candidate__meta {
    color: #0284c7;
    font-weight: 800;
}
