* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   Theme tokens (light/dark)
   ============================================ */

:root {
    color-scheme: light;

    /* Spacing */
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 14px;
    --space-4: 18px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --text-xs: 0.82rem;
    --text-sm: 0.92rem;
    --text-md: 1rem;
    --text-lg: 1.1rem;

    /* Brand + semantic */
    --accent: #2563eb;
    --accent-2: #4f46e5;
    --accent-soft: rgba(37, 99, 235, 0.12);
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Surfaces */
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-2: #f8fafc;
    --overlay: rgba(15, 23, 42, 0.08);

    /* Text */
    --text: #0f172a;
    --text-muted: rgba(15, 23, 42, 0.74);
    --text-subtle: rgba(15, 23, 42, 0.56);

    /* Borders + shadows */
    --border: rgba(15, 23, 42, 0.12);
    --border-strong: rgba(15, 23, 42, 0.18);
    --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.05);
    --shadow-md: 0 10px 30px rgba(2, 6, 23, 0.10);
    --shadow-lg: 0 18px 50px rgba(2, 6, 23, 0.14);

    /* Focus ring */
    --focus: 0 0 0 4px rgba(37, 99, 235, 0.18);

    /* Hero / header */
    --hero-bg: linear-gradient(90deg, #5f6cf3 0%, #6a63e6 45%, #7a5fd5 100%);
    --hero-text: rgba(255, 255, 255, 0.96);
    --hero-text-muted: rgba(255, 255, 255, 0.82);
    --hero-text-subtle: rgba(255, 255, 255, 0.70);

    /* Page frame (surrounding the whole app, not just the header) */
    --page-frame-bg:
        radial-gradient(1100px 650px at 10% -10%, rgba(37, 99, 235, 0.30), transparent 60%),
        radial-gradient(1000px 600px at 95% 0%, rgba(139, 92, 246, 0.26), transparent 58%),
        radial-gradient(900px 520px at 65% 110%, rgba(14, 165, 233, 0.16), transparent 60%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.06) 0%, rgba(15, 23, 42, 0.00) 55%);
    --page-frame-surface: rgba(246, 247, 251, 0.82);
    --page-frame-border: rgba(15, 23, 42, 0.10);
}

html[data-theme="dark"] {
    color-scheme: dark;

    --accent: #60a5fa;
    --accent-2: #818cf8;
    --accent-soft: rgba(96, 165, 250, 0.16);
    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;

    --bg: #0b1220;
    --panel: #0f172a;
    --panel-2: rgba(226, 232, 240, 0.06);
    --overlay: rgba(226, 232, 240, 0.06);

    --text: #e2e8f0;
    --text-muted: rgba(226, 232, 240, 0.80);
    --text-subtle: rgba(226, 232, 240, 0.62);

    --border: rgba(226, 232, 240, 0.14);
    --border-strong: rgba(226, 232, 240, 0.20);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.55);

    --focus: 0 0 0 4px rgba(96, 165, 250, 0.22);

    /* Hero / header */
    --hero-bg: linear-gradient(90deg, #3b4ad6 0%, #4b3fc8 45%, #5a38b8 100%);
    --hero-text: rgba(255, 255, 255, 0.96);
    --hero-text-muted: rgba(255, 255, 255, 0.84);
    --hero-text-subtle: rgba(255, 255, 255, 0.72);

    /* Page frame */
    --page-frame-bg:
        radial-gradient(1200px 700px at 10% -15%, rgba(96, 165, 250, 0.24), transparent 60%),
        radial-gradient(1050px 650px at 95% -5%, rgba(167, 139, 250, 0.20), transparent 58%),
        radial-gradient(900px 550px at 70% 115%, rgba(56, 189, 248, 0.10), transparent 62%),
        linear-gradient(135deg, rgba(2, 6, 23, 0.60) 0%, rgba(11, 18, 32, 0.78) 40%, rgba(2, 6, 23, 0.62) 100%);
    --page-frame-surface: rgba(11, 18, 32, 0.76);
    --page-frame-border: rgba(226, 232, 240, 0.10);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    min-height: 100vh;
    padding: 20px;
    color: var(--text);
}

.container {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px;
    border-radius: 26px;
}

/* Full-page "frame" around the app: gives the crisp colored borders you asked for. */
.container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--page-frame-bg);
    z-index: -2;
}

.container::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: calc(26px - 1px);
    background: var(--page-frame-surface);
    border: 1px solid var(--page-frame-border);
    box-shadow: 0 18px 55px rgba(2, 6, 23, 0.10);
    z-index: -1;
}

header {
    margin-bottom: 22px;
}

.header-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-5) var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--hero-bg);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.header-brand {
    text-align: center;
    max-width: 860px;
}

.brand-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
    color: var(--hero-text);
    flex: 0 0 auto;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

.header-brand h1 {
    font-size: 2.05rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--hero-text);
}

.header-brand p {
    font-size: var(--text-md);
    color: var(--hero-text-muted);
    line-height: 1.55;
}

.header-brand .powered-by {
    font-size: var(--text-sm);
    color: var(--hero-text-subtle);
    margin-top: 8px;
    font-style: italic;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    position: absolute;
    right: var(--space-4);
    top: var(--space-4);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow: var(--shadow-sm), var(--focus);
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-icon {
    width: 18px;
    height: 18px;
}

.theme-icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-icon-moon {
    display: block;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.icon-button:focus-visible {
    outline: none;
    box-shadow: var(--shadow-sm), var(--focus);
}

.icon {
    width: 18px;
    height: 18px;
}

.ui-settings {
    position: relative;
}

.ui-settings-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 240px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 2000;
}

.ui-settings-title {
    font-weight: 750;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.ui-settings-label {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.ui-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    border: 1px solid transparent;
}

.ui-radio:hover {
    background: var(--panel-2);
    border-color: var(--border);
}

.ui-radio input {
    accent-color: var(--accent);
}

.ui-radio span {
    font-size: var(--text-sm);
    color: var(--text);
}

.content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-top: var(--space-5);
}

@media (min-width: 980px) {
    .app-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.output-placeholder {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
    background: var(--panel-2);
    margin-bottom: var(--space-5);
}

.output-placeholder-title {
    font-weight: 750;
    color: var(--text);
    letter-spacing: -0.01em;
}

.output-placeholder-body {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* ============================================
   Output layout modes
   - html[data-output-mode] controls layout choice
   - html[data-output-state="hidden|visible"] controls initial blank state
   ============================================ */

/* Collapse-until-output should hide the output panel everywhere until there is content. */
html[data-output-mode="collapse_until_output"][data-output-state="hidden"] .app-grid {
    grid-template-columns: 1fr;
}

html[data-output-mode="collapse_until_output"][data-output-state="hidden"] .panel-output {
    display: none;
}

/* Stack-single-column should also hide the output panel until there is content. */
html[data-output-mode="stack_single_column"][data-output-state="hidden"] .panel-output {
    display: none;
}

/* Default: show 2 columns on desktop (when output is present). */
@media (min-width: 980px) {
    html[data-output-mode="collapse_until_output"][data-output-state="hidden"] .app-grid {
        grid-template-columns: 1fr;
    }

    html[data-output-mode="collapse_until_output"][data-output-state="hidden"] .panel-output {
        display: none;
    }

    html[data-output-mode="stack_single_column"] .app-grid {
        grid-template-columns: 1fr;
    }

    html[data-output-mode="stack_single_column"] .panel-output {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}

/* Placeholder visibility */
html[data-output-mode="show_placeholder"][data-output-state="hidden"] #output-placeholder {
    display: block;
}

html:not([data-output-mode="show_placeholder"]) #output-placeholder {
    display: none;
}

html[data-output-mode="show_placeholder"][data-output-state="visible"] #output-placeholder {
    display: none;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-6);
}

.panel-output {
    min-height: 260px;
}

@media (min-width: 980px) {
    .panel-output {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow: auto;
    }
}

.panel-output:focus-within {
    outline: none;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
}

.panel-input .form-section {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
}

.panel-input .form-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h2 {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-description {
    color: var(--text-muted);
    font-size: 1em;
    line-height: 1.55;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(79, 70, 229, 0.06) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.section-description::before {
    content: "i";
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    color: var(--accent);
    font-weight: 800;
    line-height: 24px;
    text-align: center;
    margin-top: 1px;
}

.section-description > * {
    margin: 0;
}

.optional {
    font-size: 0.75em;
    color: var(--text-subtle);
    font-weight: normal;
}

.passport-item,
.residency-item,
.visa-status-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.passport-item input,
.residency-item input,
.residency-item select,
.visa-status-item input,
.visa-status-item select {
    flex: 1;
}

input[type="text"],
select {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1em;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    background: var(--panel);
    color: var(--text);
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-add,
.btn-remove,
.btn-submit {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    font-weight: 600;
}

.btn-add {
    background: var(--panel-2);
    color: var(--text);
    border-color: var(--border);
}

.btn-add:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.btn-remove {
    background: rgba(239, 68, 68, 0.10);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.22);
    padding: 8px 15px;
}

.btn-remove:hover {
    transform: translateY(-1px);
    background: rgba(239, 68, 68, 0.14);
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:focus-visible,
.btn-add:focus-visible,
.btn-remove:focus-visible {
    outline: none;
    box-shadow: var(--shadow-sm), var(--focus);
}

.loading {
    text-align: center;
    padding: 40px;
}

.loading p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 8px;
}

.loading-icon {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.loading-globe {
    width: 64px;
    height: 64px;
    color: var(--accent);
    animation: globe-pulse 2s ease-in-out infinite, globe-rotate 8s linear infinite;
}

@keyframes globe-pulse {
    0%, 100% { 
        opacity: 0.7;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes globe-rotate {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.loading-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: sparkle-float 2s ease-in-out infinite;
}

.sparkle:nth-child(1) {
    top: -4px;
    right: 8px;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 50%;
    right: -8px;
    animation-delay: 0.6s;
}

.sparkle:nth-child(3) {
    bottom: 4px;
    left: 4px;
    animation-delay: 1.2s;
}

@keyframes sparkle-float {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1) translateY(-8px);
    }
}

/* Legacy spinner (kept for fallback) */
.spinner {
    border: 4px solid var(--overlay);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    margin-top: 0;
    animation: fadeIn 0.5s;
}

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

.results h2 {
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.visa-status {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 600;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.visa-required {
    background: rgba(245, 158, 11, 0.14);
    border-left: 5px solid var(--warning);
    color: var(--text);
}

.visa-not-required {
    background: rgba(22, 163, 74, 0.14);
    border-left: 5px solid var(--success);
    color: var(--text);
}

.result-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--panel-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.result-section h3 {
    color: var(--text);
    margin-bottom: 15px;
    font-size: 1.2em;
    letter-spacing: -0.01em;
}

.result-section p strong {
    color: var(--text);
}

.result-section h4 {
    color: var(--text-muted);
    margin: 15px 0 10px;
    font-size: 1em;
}

.result-section p,
.result-section ul {
    color: var(--text-muted);
    line-height: 1.6;
}

.result-section ul {
    margin-left: 20px;
    margin-top: 10px;
}

.result-section li {
    margin-bottom: 8px;
}

.gotcha {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.gotcha-WARNING {
    background: rgba(245, 158, 11, 0.14);
    border-left: 4px solid var(--warning);
}

.gotcha-INFO {
    background: rgba(14, 165, 233, 0.14);
    border-left: 4px solid var(--info);
}

.gotcha-CRITICAL {
    background: rgba(239, 68, 68, 0.14);
    border-left: 4px solid var(--danger);
}

.gotcha h4 {
    margin: 0 0 8px 0;
    color: var(--text);
}

.checklist-item {
    padding: 15px;
    background: var(--panel);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 4px solid var(--accent);
    border: 1px solid var(--border);
}

.checklist-item.mandatory {
    border-left-color: var(--danger);
}

.checklist-item h4 {
    margin: 0 0 8px 0;
    color: var(--text);
}

.checklist-item .deadline {
    color: var(--text-subtle);
    font-size: 0.9em;
    margin-top: 8px;
}

.link-section {
    margin-bottom: 15px;
}

.link-section a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.link-section a:hover {
    text-decoration: underline;
}

.error {
    background: rgba(239, 68, 68, 0.14);
    color: var(--text);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-left: 5px solid var(--danger);
    margin-top: 20px;
}

.error h3 {
    margin-bottom: 10px;
}

.processing-time-section {
    background: var(--panel-2);
    border-left: 4px solid var(--accent);
    padding: 0;
}

/* Processing Time Dropdown Styles */
.processing-time-dropdown {
    width: 100%;
}

.processing-time-dropdown summary {
    list-style: none;
    cursor: pointer;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text);
    font-size: 1.1em;
    transition: background-color 0.2s;
}

.processing-time-dropdown summary::-webkit-details-marker {
    display: none;
}

.processing-time-dropdown summary::before {
    content: '▶';
    margin-right: 10px;
    font-size: 0.8em;
    transition: transform 0.2s;
}

.processing-time-dropdown[open] summary::before {
    transform: rotate(90deg);
}

.processing-time-dropdown summary:hover {
    background: var(--accent-soft);
}

.processing-time-summary {
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;
}

.processing-time-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.processing-time-details > p {
    margin: 0;
    padding: 8px 12px;
    background: var(--panel);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

.processing-time-details > p strong {
    color: var(--text);
}

/* Result meta banners (web sources, cache/reflection) */
.web-sources-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    background: var(--panel);
}

.web-sources-icon {
    font-size: 1.35em;
    line-height: 1;
}

.web-sources-title {
    font-weight: 750;
    color: var(--text);
    letter-spacing: -0.01em;
}

.web-sources-subtitle {
    margin-top: 4px;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.meta-badge {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 10px;
}

.meta-badge p {
    margin: 0;
    color: var(--text);
}

.meta-badge-sub {
    margin-top: 6px !important;
    font-size: var(--text-sm);
    color: var(--text-muted) !important;
}

.meta-badge--cache {
    border-left: 4px solid var(--info);
    background: rgba(14, 165, 233, 0.10);
}

.meta-badge--upgrade {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.10);
}

.meta-badge--reflection {
    border-left: 4px solid var(--success);
    background: rgba(22, 163, 74, 0.10);
}

.parsed-confidence {
    margin-top: 10px;
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

/* Autocomplete Styles */
.autocomplete-wrapper {
    position: relative;
    flex: 1;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-md);
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--accent-soft);
    color: var(--text);
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: var(--panel-2);
    border-radius: 0 0 6px 0;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--accent-2);
}

@media (max-width: 768px) {
    body {
        padding: 14px;
    }

    .container {
        padding: 14px;
        border-radius: 22px;
    }

    .container::after {
        border-radius: calc(22px - 1px);
    }

    .header-row {
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-4);
    }

    .header-actions {
        position: static;
        justify-content: flex-end;
        width: 100%;
    }

    .header-brand {
        max-width: 100%;
    }

    .passport-item,
    .residency-item,
    .visa-status-item {
        flex-direction: column;
    }

    .passport-item input,
    .residency-item input,
    .residency-item select,
    .visa-status-item input,
    .visa-status-item select,
    .autocomplete-wrapper {
        width: 100%;
    }
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1em;
    color: var(--text);
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.checkbox-label span {
    font-weight: 500;
}

/* Analysis Mode Section Styles */
.analysis-mode-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.analysis-mode-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.analysis-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-card-content {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.analysis-mode-card:hover .mode-card-content {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.analysis-mode-card input[type="radio"]:checked + .mode-card-content {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(79, 70, 229, 0.08) 100%);
    box-shadow: var(--shadow-md);
}

.analysis-mode-card input[type="radio"]:checked + .mode-card-content::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: bold;
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mode-icon {
    font-size: 1.5em;
}

.mode-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text);
}

.mode-description {
    font-size: 0.9em;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 12px;
}

.mode-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(22, 163, 74, 0.12);
    color: var(--text);
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    align-self: flex-start;
}

.mode-badge.enhanced {
    background: rgba(14, 165, 233, 0.12);
    color: var(--text);
}

@media (max-width: 768px) {
    .analysis-mode-options {
        grid-template-columns: 1fr;
    }
    
    .mode-card-content {
        padding: 16px;
    }
}

/* Feedback buttons styling */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-muted);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feedback-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.feedback-btn.like-btn:hover:not(:disabled) {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.10);
    color: var(--text);
}

.feedback-btn.dislike-btn:hover:not(:disabled) {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.10);
    color: var(--text);
}

.feedback-btn.active.like-btn {
    border-color: rgba(22, 163, 74, 0.45);
    background: rgba(22, 163, 74, 0.85);
    color: white;
    cursor: default;
}

.feedback-btn.active.dislike-btn {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.85);
    color: white;
    cursor: default;
}

.feedback-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.feedback-btn:disabled {
    cursor: not-allowed;
}

.feedback-icon {
    font-size: 1.1em;
}

.feedback-section-bottom {
    margin-top: 30px;
    padding: 20px;
    background: var(--panel-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
}

.feedback-prompt {
    font-size: 1.1em;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 15px;
}

.feedback-section-bottom .feedback-buttons {
    justify-content: center;
}

.feedback-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    animation: fadeIn 0.3s;
}

.feedback-message.success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--text);
    border: 1px solid rgba(22, 163, 74, 0.22);
}

.feedback-message.error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--text);
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.feedback-message.info {
    background: rgba(14, 165, 233, 0.12);
    color: var(--text);
    border: 1px solid rgba(14, 165, 233, 0.22);
}

@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .feedback-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .feedback-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Floating Feedback Panel Styles */
.feedback-panel {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
}

.btn-remove {
    white-space: nowrap;
}

.feedback-toggle {
    width: 36px;
    height: auto;
    padding: 14px 8px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.feedback-toggle:hover {
    width: 40px;
    box-shadow: -6px 6px 20px rgba(0, 0, 0, 0.3);
}

.feedback-banner-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.feedback-form-container {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    width: 320px;
    background: var(--panel);
    border-radius: 12px;
    box-shadow: -8px 8px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.feedback-panel.open .feedback-form-container {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.feedback-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 12px 12px 0 0;
}

.feedback-form-header h3 {
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}

.feedback-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.feedback-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.feedback-form-body {
    padding: 20px;
}

.feedback-form-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    resize: none;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    line-height: 1.5;
    background: var(--panel);
    color: var(--text);
}

.feedback-form-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus);
}

.feedback-form-body textarea::placeholder {
    color: var(--text-subtle);
}

.feedback-char-count {
    text-align: right;
    font-size: 0.85em;
    color: var(--text-subtle);
    margin-top: 8px;
}

.feedback-char-count.near-limit {
    color: var(--warning);
}

.feedback-char-count.at-limit {
    color: var(--danger);
}

.feedback-form-footer {
    padding: 0 20px 20px;
}

.feedback-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feedback-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-success {
    padding: 40px 20px;
    text-align: center;
}

.feedback-success .success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
    border-radius: 50%;
    color: white;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.feedback-success p {
    color: var(--text);
    font-size: 1.1em;
    font-weight: 500;
    margin: 0;
}

/* Animation for feedback toggle pulse */
@keyframes pulse {
    0% { box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: -4px 4px 22px rgba(37, 99, 235, 0.45); }
    100% { box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.2); }
}

.feedback-toggle.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Mobile responsive for feedback panel */
@media (max-width: 768px) {
    .feedback-panel {
        right: 0;
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .feedback-toggle {
        width: 32px;
        padding: 12px 6px;
    }
    
    .feedback-banner-text {
        font-size: 0.75em;
        letter-spacing: 0.5px;
    }
    
    .feedback-form-container {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 100px;
        top: auto;
        transform: translateY(20px);
        width: auto;
    }
    
    .feedback-panel.open .feedback-form-container {
        transform: translateY(0);
    }
}

/* ============================================
   Natural Language Query Section Styles
   ============================================ */

.nl-section {
    border-bottom: none;
}

.nl-query-disabled-hint {
    margin: 10px 0 0 0;
    padding: 10px 12px;
    background: var(--panel-2);
    border-radius: 8px;
    border-left: 3px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 500;
}

.nl-section.nl-section-disabled {
    opacity: 0.75;
}

.nl-section.nl-section-disabled .nl-query-input {
    background: var(--panel-2);
}

.nl-query-input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    line-height: 1.6;
    background: var(--panel-2);
    color: var(--text);
}

.nl-query-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus);
    background: var(--panel);
}

.nl-query-input::placeholder {
    color: var(--text-subtle);
    font-style: italic;
}

/* NL Analysis Mode Section */
.nl-analysis-mode {
    margin-top: 20px;
    margin-bottom: 20px;
}

.analysis-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-size: 0.95em;
}

.nl-mode-options {
    gap: 12px;
}

.nl-mode-options .analysis-mode-card {
    flex: 1;
}

.nl-mode-options .mode-card-content {
    padding: 14px;
}

.nl-mode-options .mode-description {
    font-size: 0.85em;
    margin-bottom: 8px;
}

.nl-mode-options .mode-badge {
    font-size: 0.75em;
    padding: 3px 10px;
}

/* NL Submit Button */
.nl-submit-btn {
    width: 100%;
    margin-top: 0;
}

/* Parsed Preview Section */
.parsed-preview {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.10) 0%, rgba(14, 165, 233, 0.10) 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.parsed-preview h3 {
    color: var(--text);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.parsed-content {
    background: var(--panel);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.parsed-content p {
    margin: 8px 0;
    color: var(--text);
}

.parsed-content strong {
    color: var(--text);
}

.parsed-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.parsed-actions .btn-submit {
    flex: 2;
}

.parsed-actions .btn-add {
    flex: 1;
}

.parsed-warning {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 6px;
    padding: 10px 15px;
    margin-top: 10px;
    color: var(--text);
    font-size: 0.9em;
}

/* ============================================
   Analysis Info + Progress (NL streaming)
   ============================================ */

.analysis-info {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.10) 0%, rgba(14, 165, 233, 0.10) 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s;
}

.analysis-info h3 {
    color: var(--text);
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.analysis-info-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 720px) {
    .analysis-info-body {
        grid-template-columns: 1fr 1fr;
    }
}

.analysis-info-panel {
    background: var(--panel);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
}

.analysis-info-panel h4 {
    margin-bottom: 10px;
    font-size: 0.95em;
    color: var(--text-muted);
}

.analysis-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.analysis-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--panel-2);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.analysis-info-label {
    font-size: 0.8em;
    color: var(--text-subtle);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.analysis-info-value {
    font-size: 0.98em;
    color: var(--text);
    font-weight: 600;
}

.analysis-progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analysis-progress-list li {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--panel-2);
    border-left: 3px solid var(--border);
    color: var(--text-muted);
    font-size: 0.95em;
}

.analysis-progress-list li.active {
    border-left-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

.analysis-progress-list li.completed {
    border-left-color: var(--success);
    background: rgba(22, 163, 74, 0.12);
    color: var(--text);
}

/* ============================================
   Collapsible Traditional Form Styles
   ============================================ */

.traditional-form-details {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.traditional-form-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 20px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-muted);
    transition: all 0.3s ease;
    list-style: none;
}

.traditional-form-toggle::-webkit-details-marker {
    display: none;
}

.traditional-form-toggle:hover {
    background: var(--accent-soft);
    color: var(--text);
    border-color: var(--border-strong);
}

.traditional-form-details.traditional-form-disabled .traditional-form-toggle {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.traditional-form-details.traditional-form-disabled .traditional-form-toggle:hover {
    background: var(--panel-2);
    color: var(--text-muted);
    border-color: var(--border);
}

.traditional-form-disabled-hint {
    font-size: 0.85em;
    color: var(--text-subtle);
    margin-left: 8px;
    font-weight: 500;
}

.toggle-arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.traditional-form-details[open] .toggle-arrow {
    transform: rotate(90deg);
}

.traditional-form-details[open] .traditional-form-toggle {
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border-color: transparent;
}

.traditional-form-content {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 25px;
    background: var(--panel);
    animation: slideDown 0.3s ease-out;
}

/* ============================================
   Ask | Examples tabs + Examples layout
   ============================================ */

.input-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
}

.input-tab {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 750;
    font-size: 1.05rem; /* bigger Ask/Examples */
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.input-tab:hover {
    transform: translateY(-1px);
    color: var(--text);
}

.input-tab:focus-visible {
    outline: none;
    box-shadow: var(--shadow-sm), var(--focus);
}

.input-tab.active {
    background: var(--panel);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.examples-panel {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.examples-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 980px) {
    .examples-list {
        gap: var(--space-5);
    }
}

.example-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.example-card-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(79, 70, 229, 0.06) 100%);
}

.example-card-title {
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    font-size: 1.05rem;
    line-height: 1.25;
}

.example-card-desc {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.example-card-body {
    padding: 16px 18px 18px 18px;
}

.example-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 980px) {
    .example-card-grid {
        grid-template-columns: 1.25fr 0.75fr;
        align-items: start;
        gap: 16px;
    }
}

.example-card-query-label {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    margin-bottom: 8px;
}

.example-card-query-text {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 12px;
    color: var(--text);
    line-height: 1.55;
    font-size: var(--text-md);
}

.example-card-prefill {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.example-prefill-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.example-prefill-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    align-items: baseline;
}

.example-prefill-k {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.example-prefill-v {
    color: var(--text);
    font-weight: 650;
    font-size: var(--text-sm);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.example-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 14px;
}

.example-card-actions .example-action {
    width: auto;
    margin-top: 0;
    padding: 10px 14px;
    border-radius: 999px;
}

.example-card-actions .example-action-primary {
    font-size: 0.98rem;
    padding: 10px 16px;
}

.example-card-actions .example-action-secondary {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
}

.example-card-actions .example-action-secondary:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .input-tabs {
        width: 100%;
        justify-content: space-between;
    }
    .input-tab {
        flex: 1;
        text-align: center;
    }
    .example-card-actions {
        justify-content: stretch;
    }
    .example-card-actions .example-action {
        flex: 1;
        justify-content: center;
        width: 100%;
    }
}

/* Hide the analysis mode section in traditional form since it's now in NL section */
.traditional-form-content #analysis-mode-section {
    display: block;
}

@media (max-width: 768px) {
    .nl-query-input {
        padding: 14px;
        font-size: 0.95em;
    }
    
    .nl-mode-options {
        flex-direction: column;
    }
    
    .nl-mode-options .mode-card-content {
        padding: 12px;
    }
    
    .parsed-actions {
        flex-direction: column;
    }
    
    .parsed-actions .btn-submit,
    .parsed-actions .btn-add {
        flex: none;
        width: 100%;
    }
    
    .traditional-form-toggle {
        padding: 12px 16px;
        font-size: 0.9em;
    }
    
    .traditional-form-content {
        padding: 15px;
    }
}

