/* ============================================================
   Sutile — interface do assistente juridico trabalhista
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vollkorn:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* ----------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   ---------------------------------------------------------- */
:root {
    /* Primary Colors — aged-ink navy, warm precision */
    --color-primary: oklch(40% 0.06 255);
    --color-primary-hover: oklch(33% 0.06 255);
    --color-primary-light: oklch(94% 0.018 75);
    --color-primary-dark: oklch(22% 0.04 260);

    /* Accent — amber-ochre for human moments */
    --color-accent: oklch(68% 0.17 57);
    --color-accent-hover: oklch(62% 0.17 57);
    --color-accent-light: oklch(96% 0.04 62);

    /* Semantic Colors */
    --color-danger: oklch(46% 0.16 22);
    --color-danger-hover: oklch(38% 0.16 22);
    --color-danger-light: oklch(97% 0.015 22);
    --color-danger-bg: oklch(91% 0.04 22);

    --color-warning: oklch(65% 0.12 65);
    --color-warning-hover: oklch(55% 0.12 65);
    --color-warning-light: oklch(97% 0.02 75);
    --color-warning-bg: oklch(93% 0.05 65);

    --color-success: oklch(52% 0.13 162);
    --color-success-hover: oklch(43% 0.13 162);
    --color-success-light: oklch(96% 0.025 162);
    --color-success-bg: oklch(88% 0.06 162);

    --color-info: oklch(50% 0.1 250);
    --color-info-light: oklch(96% 0.02 250);
    --color-info-bg: oklch(89% 0.05 250);

    /* Neutral Colors — warm parchment, amber-tinted */
    --color-bg: oklch(97% 0.008 75);
    --color-card: oklch(99% 0.005 75);
    --color-text: oklch(12% 0.015 260);
    --color-text-secondary: oklch(32% 0.012 75);
    --color-muted: oklch(48% 0.01 260);
    --color-placeholder: oklch(65% 0.012 75);
    --color-border: oklch(85% 0.008 75);
    --color-border-light: oklch(91% 0.006 75);

    /* Alias tokens — mapped to semantic equivalents */
    --color-bg-primary: var(--color-card);
    --color-bg-secondary: oklch(95% 0.008 75);
    --color-bg-subtle: oklch(96% 0.007 75);
    --color-text-muted: var(--color-muted);
    --radius: var(--radius-md);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Vollkorn', Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    /* Type scale — base 19.5px: 2xs≈11px, xs≈14.6px, sm≈17px, base≈19.5px, lg≈22px, xl≈24.4px, 2xl≈29.3px, 3xl≈35.2px */
    --font-size-2xs: 0.575rem;  /* micro-labels, badges */
    --font-size-xs: 0.75rem;    /* captions, section headers, timestamps */
    --font-size-sm: 0.875rem;   /* secondary body, sidebar items, form hints */
    --font-size-base: 1rem;     /* primary body, form inputs */
    --font-size-lg: 1.125rem;   /* emphasized body, panel titles */
    --font-size-xl: 1.25rem;    /* subheadings */
    --font-size-2xl: 1.5rem;    /* headings */
    --font-size-3xl: 1.8rem;    /* display headings */

    /* Line heights — semantic roles */
    --lh-tight: 1.15;     /* display headings */
    --lh-snug: 1.3;       /* subheadings, compact UI */
    --lh-base: 1.6;       /* UI body, labels */
    --lh-relaxed: 1.72;   /* transcript entries, form content */
    --lh-loose: 1.85;     /* petição/document reading */

    /* Letter spacing */
    --tracking-tight: -0.015em;  /* display headings */
    --tracking-normal: 0;
    --tracking-wide: 0.04em;     /* small caps, section labels */
    --tracking-wider: 0.08em;    /* badge labels */

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Layout */
    --header-height: 64px;
    --max-width: 1600px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 56px;

    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ----------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 19.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: var(--lh-base);
    min-height: 100vh;
    overflow-y: hidden;
    font-kerning: normal;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

/* Typography hierarchy — Vollkorn for display/headings, Barlow for body */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    /* Vollkorn: activate ligatures, optical kerning, oldstyle numerals */
    font-kerning: normal;
    font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1;
}

/* Fixed scale for app UI — no fluid clamp (that's for marketing pages) */
h1 { font-size: var(--font-size-3xl);  line-height: var(--lh-tight); font-weight: 700; }
h2 { font-size: var(--font-size-2xl);  line-height: var(--lh-tight); }
h3 { font-size: var(--font-size-xl);   line-height: var(--lh-snug);  }
h4 { font-size: var(--font-size-lg);   line-height: var(--lh-snug);  font-weight: 500; }

/* Grain texture overlay — adds organic warmth to the flat background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.app-root {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* ----------------------------------------------------------
   App with Sidebar (authenticated layout)
   ---------------------------------------------------------- */
.app-with-sidebar {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* ----------------------------------------------------------
   SIDEBAR (Collapsible)
   ---------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--color-card) 0%, oklch(98% 0.008 75) 100%);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base), min-width var(--transition-base);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar--collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

.sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar--collapsed .sidebar__header {
    justify-content: center;
}

.sidebar__collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-border-light);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar__collapse-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.sidebar__collapse-btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-base);
}

.sidebar--collapsed .sidebar__collapse-btn svg {
    transform: rotate(180deg);
}

.sidebar__user {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.sidebar--collapsed .sidebar__user {
    display: none;
}

.sidebar__username {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__logout {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    font-size: var(--font-size-xs);
    color: var(--color-danger);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    transition: color var(--transition-fast);
}

.sidebar__logout:hover {
    color: var(--color-danger-hover);
    text-decoration: underline;
}

.sidebar__section {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.sidebar--collapsed .sidebar__section {
    padding: var(--space-3);
}

.sidebar__section-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-2);
}

.sidebar--collapsed .sidebar__section-title {
    display: none;
}

.sidebar__history {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sidebar__history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.sidebar--collapsed .sidebar__history-header {
    justify-content: center;
    padding: var(--space-3);
}

.sidebar__history-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.sidebar--collapsed .sidebar__history-title {
    display: none;
}

.sidebar__history-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
}

.sidebar--collapsed .sidebar__history-body {
    display: none;
}

.sidebar__history-item {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    font-size: var(--font-size-xs);
}

.sidebar__history-item:hover {
    background: var(--color-border-light);
    border-color: var(--color-border);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.sidebar__history-item--active {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.sidebar__history-date {
    font-weight: 500;
    color: var(--color-muted);
}

.sidebar__history-preview {
    margin-top: 2px;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.sidebar__nova-entrevista {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.sidebar__nova-entrevista-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.sidebar__nova-entrevista-btn:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.sidebar__nova-entrevista-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sidebar__nova-entrevista-btn svg {
    flex-shrink: 0;
    display: block;
    line-height: 1;
}

.sidebar__footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sidebar--collapsed .sidebar__footer {
    padding: var(--space-3);
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: var(--space-2);
}

.sidebar__settings-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar__settings-btn:hover {
    background: var(--color-border-light);
    border-color: var(--color-muted);
    color: var(--color-text);
}

.sidebar--collapsed .sidebar__settings-btn {
    width: 36px;
    padding: var(--space-2);
    justify-content: center;
}

.sidebar--collapsed .sidebar__settings-btn span {
    display: none;
}

/* Icons shown when sidebar collapsed (toolbar-style) */
.sidebar__icon-only {
    display: none;
}

.sidebar--collapsed .sidebar__icon-only {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--color-border-light);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-2);
}

.sidebar--collapsed .sidebar__icon-only:hover {
    background: var(--color-border);
    color: var(--color-primary);
}

.sidebar--collapsed .sidebar__icon-only svg {
    width: 18px;
    height: 18px;
}

.qr-modal__code-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-4);
    background: var(--color-bg-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
}

.qr-modal__code-wrapper #qr-code-container {
    width: 220px;
    height: 220px;
}

.qr-modal__hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}


/* ----------------------------------------------------------
   Custom Scrollbar (WebKit)
   ---------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted);
}

/* ----------------------------------------------------------
   Utility: Icons
   ---------------------------------------------------------- */
.icon-sm {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-xs {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}



/* ----------------------------------------------------------
   Status Dot
   ---------------------------------------------------------- */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: background-color var(--transition-base);
}

.status-dot--connected {
    background-color: var(--color-success);
}

.status-dot--disconnected {
    background-color: var(--color-danger);
}

.status-dot--recording {
    background-color: var(--color-danger);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot--processing {
    background-color: var(--color-warning);
    animation: pulse 0.75s ease-in-out infinite;
}

.status-label {
    color: var(--color-muted);
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn--visual-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--success {
    background-color: var(--color-success);
    color: white;
}

.btn--success:hover:not(:disabled) {
    background-color: var(--color-success-hover);
}

.btn--danger {
    background-color: var(--color-danger);
    color: white;
}

.btn--danger:hover:not(:disabled) {
    background-color: var(--color-danger-hover);
}

.btn--warning {
    background-color: var(--color-warning);
    color: #1a1a1a;
}

.btn--warning:hover:not(:disabled) {
    background-color: var(--color-warning-hover);
    color: #1a1a1a;
}

.btn--outline {
    background-color: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.btn--outline:hover:not(:disabled) {
    background-color: var(--color-border-light);
    border-color: var(--color-muted);
}

.btn--sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
}

.spinner--btn {
    width: 8px;
    height: 8px;
    border-width: 2px;
}

.attachment-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: var(--color-primary, #3b82f6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

/* ----------------------------------------------------------
   Flow screens (welcome, configuring)
   ---------------------------------------------------------- */
.flow-welcome {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.proposal-layout-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.proposal-layout-overlay--pass-through .flow-welcome__inner,
.proposal-layout-overlay .flow-config__card {
    pointer-events: auto;
}

.flow-welcome__inner {
    text-align: center;
    color: var(--color-text-secondary);
    max-width: 42rem;
    padding: clamp(1.5rem, 2vw, 2.5rem);
    border-radius: 28px;
    border: 1px solid color-mix(in srgb, var(--color-border) 72%, white);
    background:
        radial-gradient(circle at top, rgba(202, 164, 104, 0.1) 0%, rgba(202, 164, 104, 0) 56%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 245, 239, 0.78) 100%);
    box-shadow: 0 24px 56px rgba(72, 55, 34, 0.08);
    animation: flow-welcome-settle 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.flow-welcome__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    color: var(--color-primary);
    opacity: 0.6;
}

.flow-welcome__eyebrow {
    margin-bottom: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--color-primary) 64%, white);
}

.flow-welcome__title {
    margin-bottom: var(--space-3);
    font-family: var(--font-family-display);
    font-size: clamp(2rem, 2vw + 1.4rem, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--color-text);
    text-wrap: balance;
}

.flow-welcome__text {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
    max-width: 34rem;
    margin-inline: auto;
    line-height: 1.65;
    text-wrap: pretty;
}

.flow-welcome__btn {
    margin-top: var(--space-2);
}

.flow-welcome__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.flow-welcome__note {
    margin-top: var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.flow-config {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    width: 100%;
    max-width: 100%;
}

.flow-config__card {
    max-width: 520px;
    width: 100%;
}

.flow-config__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* ----------------------------------------------------------
   MAIN LAYOUT & GRID (Resizable Layout)
   ---------------------------------------------------------- */
.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    
}

.main-grid {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: var(--space-6);
    padding: var(--space-6);
    max-width: 100%;
    margin: 0;
    overflow: hidden;
}

.main-grid__resizer {
    flex: 0 0 6px;
    cursor: col-resize;
    background: var(--color-border);
    border-radius: var(--radius-full);
    align-self: stretch;
    transition: background-color var(--transition-fast);
}

.main-grid__resizer:hover {
    background: var(--color-muted);
}

/* ----------------------------------------------------------
   Viewing Banner
   ---------------------------------------------------------- */
.viewing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    border-bottom: 1px solid oklch(100% 0 0 / 0.15);
    box-shadow: var(--shadow-sm);
}

.viewing-banner--active {
    background: linear-gradient(135deg, var(--color-success-hover) 0%, var(--color-success) 100%);
}

.viewing-banner__content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-base);
}

.viewing-banner__content svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.viewing-banner .btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.viewing-banner .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Faixa de processamento apos encerrar entrevista */
/* HPI / Transcrição view toggle */
.hpi-view-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-6);
    background: var(--color-border-light);
    border-bottom: 1px solid var(--color-border);
}
.hpi-view-toggle .btn {
    font-size: var(--font-size-sm);
}

/* Documentos quick actions na tela HPI */
.documentos-quick-actions__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.documentos-quick-actions__btn {
    white-space: nowrap;
}

/* ----------------------------------------------------------
   Panels (Cards)
   ---------------------------------------------------------- */
.panel {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-border-light);
    flex-shrink: 0;
}

.panel__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.panel__title .icon-sm {
    color: var(--color-primary);
}

.panel__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.panel__processing-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-warning);
    margin-left: var(--space-2);
    white-space: nowrap;
}

.spinner--inline {
    width: 14px;
    height: 14px;
    border-width: 2px;
    flex-shrink: 0;
}

.panel__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    transition: opacity var(--transition-base);
}

.panel__body--updating {
    animation: content-update 0.6s ease;
}

/* ----------------------------------------------------------
   Empty State
   ---------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--color-muted);
}

.empty-state__icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.empty-state p {
    font-size: var(--font-size-sm);
    max-width: 280px;
    line-height: 1.6;
}

.empty-state--inline {
    padding: var(--space-6) var(--space-4);
    flex-direction: row;
    gap: var(--space-3);
}

.empty-state--inline p {
    max-width: none;
}

.hipoteses-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.hipoteses-list li {
    position: relative;
    padding-left: var(--space-5);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.hipoteses-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-primary);
}

/* Anexos grid (session attachments) */
.anexos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-4);
}

.anexo-card {
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.anexo-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.anexo-thumbnail--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-border-light);
    color: var(--color-muted);
    font-size: var(--font-size-xs);
}

.anexo-info {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
}

.anexo-filename {
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.anexo-type {
    color: var(--color-text-secondary);
    text-transform: capitalize;
}

/* ----------------------------------------------------------
   CDS Sections
   ---------------------------------------------------------- */
.sutile-panel-section {
    margin-bottom: var(--space-6);
}

.sutile-panel-section:last-child {
    margin-bottom: 0;
}

.sutile-panel-section__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}

.sutile-panel-section__title .icon-sm {
    color: var(--color-primary);
}

.sutile-panel-section__title--warning {
    color: var(--color-warning);
}

.sutile-panel-section__title--warning .icon-sm {
    color: var(--color-warning);
}

/* Resposta (CDS) — optional, shown at top when doctor asked a question */
.sutile-panel-section--resposta {
    margin-bottom: var(--space-6);
}

.sutile-resposta__content {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: var(--lh-relaxed);
    white-space: pre-wrap;
    padding: var(--space-3) var(--space-4);
    background: var(--color-info-light);
    border-radius: var(--radius-md);
    border: 1px solid oklch(40% 0.06 255 / 0.2);
}

.sutile-analise-imagem__content {
    background: var(--color-bg);
    border-color: oklch(32% 0.012 75 / 0.2);
}


/* ----------------------------------------------------------
   Alerta Cards (CDS)
   ---------------------------------------------------------- */
.alertas-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.alerta-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.alerta-card--critico {
    background-color: var(--color-danger-light);
    border-color: oklch(46% 0.16 22 / 0.3);
    color: var(--color-danger);
}

.alerta-card--atencao {
    background-color: var(--color-warning-light);
    border-color: oklch(65% 0.12 65 / 0.35);
    color: #92400e;
}

.alerta-card--info {
    background-color: var(--color-info-light);
    border-color: oklch(50% 0.1 250 / 0.3);
    color: #2A4E7A;
}

.alerta-card__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.alerta-card__icon svg {
    width: 100%;
    height: 100%;
}

.alerta-card__text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
}

/* ----------------------------------------------------------
   Diagnosticos Diferenciais (CDS)
   ---------------------------------------------------------- */
.diagnosticos-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.diagnostico-card {
    padding: var(--space-3) var(--space-4);
    background: var(--color-border-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.diagnostico-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.diagnostico-card__name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.diagnostico-card__detail {
    font-size: var(--font-size-xs);
    color: var(--color-muted);
    margin-top: var(--space-2);
    line-height: 1.5;
}

/* ----------------------------------------------------------
   Badges
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.badge--alta {
    background-color: var(--color-success-bg);
    color: #065f46;
}

.badge--media {
    background-color: var(--color-warning-bg);
    color: #92400e;
}

.badge--baixa {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ----------------------------------------------------------
   Exames List (CDS)
   ---------------------------------------------------------- */
.exames-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.exames-list li {
    position: relative;
    padding-left: var(--space-5);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: 1.6;
}

.exames-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary);
}

/* ----------------------------------------------------------
   Interacoes Medicamentosas (CDS)
   ---------------------------------------------------------- */
.interacoes-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.interacao-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning-bg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: #92400e;
    line-height: 1.5;
}

.interacao-card .icon-sm {
    color: var(--color-warning);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ----------------------------------------------------------
   Protocolos List (CDS)
   ---------------------------------------------------------- */
.protocolos-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.protocolos-list li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    padding: var(--space-2) var(--space-3);
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

.protocolos-list .icon-xs {
    color: var(--color-primary);
}

/* ----------------------------------------------------------
   Perguntas Sugeridas (CDS)
   ---------------------------------------------------------- */
.perguntas-list {
    list-style: none;
    counter-reset: perguntas;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.perguntas-list li {
    counter-increment: perguntas;
    position: relative;
    padding-left: var(--space-8);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: 1.6;
}

.perguntas-list li::before {
    content: counter(perguntas);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-size: var(--font-size-xs);
    font-weight: 700;
}

/* ----------------------------------------------------------
   Referencias List (CDS)
   ---------------------------------------------------------- */
.referencias-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.referencias-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    line-height: 1.5;
}

.referencias-list .icon-xs {
    color: var(--color-muted);
    margin-top: 3px;
}

/* ----------------------------------------------------------
   Query Input
   ---------------------------------------------------------- */
.sutile-query {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    background: rgba(245, 243, 237, 0.56);
    backdrop-filter: blur(22px) saturate(1.24);
    -webkit-backdrop-filter: blur(22px) saturate(1.24);
    flex-shrink: 0;
}

.sutile-query--composer {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-top: -1.25rem;
    padding: var(--space-3);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 18px 18px 0 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 38%, rgba(255, 255, 255, 0.04) 100%),
        rgba(245, 243, 237, 0.48);
    box-shadow:
        0 -18px 40px rgba(74, 59, 43, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.sutile-query--main-composer {
    margin-top: -2rem;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    border-top-color: rgba(180, 130, 60, 0.3);
    background:
        linear-gradient(180deg, rgba(255, 248, 230, 0.55) 0%, rgba(255, 248, 230, 0.12) 100%),
        rgba(245, 243, 237, 0.48);
}

.sutile-query--sidebar-composer {
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    border-top-color: rgba(66, 77, 105, 0.25);
    background:linear-gradient(180deg, rgba(203, 204, 210, 0.55) 0%, rgba(238, 241, 250, 0.12) 100%), rgba(245, 243, 237, 0.48)
}

.sutile-query__label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(180, 130, 60, 0.9);
    margin-bottom: var(--space-2);
}

.sutile-query__label--sidebar {
    color: rgba(66, 77, 105, 0.7);
}

.sutile-query__label-icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    opacity: 0.85;
}

.sutile-query__input-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.sutile-query--stacked .sutile-query__input-row {
    align-items: flex-start;
}

.sutile-query__input {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-card);
    outline: none;
    transition: border-color var(--transition-fast);
}

.sutile-query__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.sutile-query__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sutile-query__input::placeholder {
    color: var(--color-placeholder);
}

/* Textarea variant — mesmo estilo da barra de instrucoes */
.sutile-query__input--textarea {
    min-height: 56px;
    resize: vertical;
}

.sutile-query__submit {
    min-width: 72px;
    padding-inline: var(--space-3);
    justify-content: center;
}

.sutile-query__submit--compact {
    min-width: 40px;
    padding-inline: var(--space-2);
}

.sutile-query__feedback {
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.55;
    animation: query-feedback-in 180ms ease-out;
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
    padding: var(--space-2);
    min-width: 36px;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 6px oklch(68% 0.17 57 / 0.3);
}

.btn--primary:disabled {
    background-color: #C4B8AC;
    border-color: #C4B8AC;
    color: #f0ece8;
    opacity: 1;
    box-shadow: none;
}

.btn--primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    box-shadow: 0 3px 10px oklch(68% 0.17 57 / 0.4);
}

/* ----------------------------------------------------------
   CDS History
   ---------------------------------------------------------- */
.sutile-history {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 2px dashed var(--color-border);
}

.sutile-history__entry {
    margin-bottom: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-border-light);
    overflow: hidden;
}

.sutile-history__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    list-style: none;
    gap: var(--space-3);
}

.sutile-history__summary::-webkit-details-marker {
    display: none;
}

.sutile-history__summary::before {
    content: '\25B6';
    font-size: var(--font-size-xs);
    color: var(--color-muted);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

details[open] > .sutile-history__summary::before {
    transform: rotate(90deg);
}

.sutile-history__time {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--color-muted);
    flex-shrink: 0;
}

.sutile-history__content {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
}

.sutile-history__section-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-2);
}

/* ----------------------------------------------------------
   Transcription Panel (Bottom)
   ---------------------------------------------------------- */
.transcription-panel {
    position: relative;
    margin: 0;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transcription-panel__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.transcription-panel__header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.transcription-panel__collapse-btn {
    flex-shrink: 0;
}

.transcription-panel__collapse-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* When collapsed, header is the only visible part — full border and radius */
.transcription-panel--collapsed .transcription-panel__header {
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--color-border);
}

/* When in recording step or transcription view, transcription takes most of main area */
.transcription-panel--recording-full,
.transcription-panel--full {
    flex: 1 1 0 !important;
    min-height: 200px;
}

.transcription-panel__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.transcription-panel__title .icon-sm {
    color: var(--color-primary);
}

.transcription-panel__indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-danger);
}

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-danger);
    animation: pulse 1.5s ease-in-out infinite;
}

.transcription-panel__body {
    /* Flex: take remaining space so content scrolls inside the panel */
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-4) var(--space-6);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    scroll-behavior: smooth;
}

/* ----------------------------------------------------------
   Transcription Config Card — configurar entrevista
   ---------------------------------------------------------- */
.transcription-config-card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--color-border-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.transcription-config-card__title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-2);
}

.transcription-config-card__hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-3);
    line-height: 1.5;
}

.transcription-config-card .session-context-row {
    margin-bottom: var(--space-3);
}

.transcription-config-card__actions {
    margin-bottom: var(--space-2);
}

.transcription-config-reuse-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.transcription-config-card__cta {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    margin: 0;
}

.transcription-config-select {
    width: 100%;
}

@media (max-width: 560px) {
    .transcription-config-card .session-context-row {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------
   Transcript Entries
   ---------------------------------------------------------- */
.transcript-entry {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: opacity var(--transition-fast);
}

.transcript-entry:last-child {
    border-bottom: none;
}

.transcript-entry--partial {
    opacity: 0.6;
}

.transcript-entry--partial .transcript-entry__text {
    font-style: italic;
}

.transcript-entry__time {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--color-muted);
    white-space: nowrap;
    min-width: 60px;
    padding-top: 2px;
}

.transcript-entry__text {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: var(--lh-relaxed);
}

/* Low confidence transcript highlighting */
.low-confidence {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ff9800;
    border-bottom: 1px dashed #ff9800;
    cursor: help;
    padding: 1px 2px;
    border-radius: 2px;
}

.low-confidence:hover {
    background-color: rgba(255, 193, 7, 0.3);
}

/* ----------------------------------------------------------
   Copy Feedback
   ---------------------------------------------------------- */
.copy-feedback {
    color: var(--color-success);
}

/* ----------------------------------------------------------
   Toast Notifications
   ---------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: max(env(safe-area-inset-top, 0px), var(--space-6));
    right: max(env(safe-area-inset-right, 0px), var(--space-6));
    bottom: auto;
    left: auto;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-3);
    width: auto;
    max-width: min(400px, calc(100vw - 2 * var(--space-6)));
    pointer-events: none;
    align-self: flex-end;
}

.toast-container .toast {
    pointer-events: auto;
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    color: var(--color-text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.1) 100%),
        rgba(247, 244, 239, 0.14);
    backdrop-filter: blur(12px) saturate(1.6);
    -webkit-backdrop-filter: blur(12px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        0 18px 40px rgba(34, 27, 20, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    overflow: hidden;
}

.toast::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.06) 38%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.toast__content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.4;
}

.toast--error {
    background:
        linear-gradient(180deg, rgba(255, 245, 245, 0.26) 0%, rgba(255, 232, 232, 0.1) 100%),
        rgba(245, 218, 218, 0.16);
}

.toast--error .icon-sm {
    color: var(--color-danger);
}

.toast--success {
    background:
        linear-gradient(180deg, rgba(247, 255, 250, 0.28) 0%, rgba(230, 247, 238, 0.1) 100%),
        rgba(200, 233, 221, 0.14);
}

.toast--success .icon-sm {
    color: var(--color-success);
}

.toast--warning {
    background:
        linear-gradient(180deg, rgba(255, 252, 243, 0.28) 0%, rgba(249, 239, 214, 0.1) 100%),
        rgba(245, 233, 197, 0.16);
}

.toast--warning .icon-sm {
    color: var(--color-warning);
}

.toast--info {
    background:
        linear-gradient(180deg, rgba(245, 251, 255, 0.28) 0%, rgba(229, 240, 252, 0.1) 100%),
        rgba(217, 230, 245, 0.16);
}

.toast--info .icon-sm {
    color: var(--color-info);
}

.toast__close {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
    flex-shrink: 0;
}

.toast__close svg {
    width: 16px;
    height: 16px;
}

.toast__close:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Toast Transitions */
.toast-enter {
    transition: all var(--transition-slow);
}

.toast-enter-start {
    opacity: 0;
    transform: translateX(100%);
}

.toast-enter-end {
    opacity: 1;
    transform: translateX(0);
}

.toast-leave {
    transition: all var(--transition-slow);
}

.toast-leave-start {
    opacity: 1;
    transform: translateX(0);
}

.toast-leave-end {
    opacity: 0;
    transform: translateX(100%);
}

/* ----------------------------------------------------------
   Approval Modal
   ---------------------------------------------------------- */
.approval-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    padding: var(--space-4);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    pointer-events: auto; /* Standard modal behavior */
}

@media (min-width: 769px) {
    .approval-overlay {
        align-items: center;
    }
}

/* Image expand overlay (full-screen lightbox) */
.image-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    padding: var(--space-4);
    cursor: pointer;
}

.image-overlay__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.image-overlay__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.image-overlay__close svg {
    width: 24px;
    height: 24px;
}

.image-overlay__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: default;
}

.approval-modal {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: 650px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
    overflow: hidden;
    pointer-events: auto;
    border: 1px solid var(--color-border);
}

.approval-modal--editor {
    width: min(96vw, 1180px);
    max-width: 1180px;
    max-height: 92vh;
}

/* ---- Documentos modal ---- */
.approval-modal--documentos {
    width: min(96vw, 1280px);
    max-width: 1280px;
    height: min(94vh, 980px);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
}

.documentos-modal__body {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.documentos-modal__left {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
}

.documentos-modal__right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.documentos-tipo-card {
    display: flex;
    align-items: center;
    padding: 0.625rem var(--space-3);
    border: 1px solid var(--color-border);
    border-left-width: 3px;
    border-left-color: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
    text-align: left;
    width: 100%;
    transition: background 0.15s, border-left-color 0.15s;
}

.documentos-tipo-card:hover {
    background: var(--color-bg-secondary);
}

.documentos-tipo-card--active {
    border-left-color: var(--color-primary);
    background: rgba(17, 109, 255, 0.06);
    color: var(--color-primary);
    font-weight: 500;
}

.documentos-instrucoes-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.documentos-instrucoes-textarea {
    resize: none;
    width: 100%;
    flex: 1;
    min-height: 110px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-card);
    box-sizing: border-box;
    line-height: 1.5;
}

.documentos-instrucoes-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(17, 109, 255, 0.1);
}

@media (max-width: 768px) {
    .approval-modal--documentos {
        width: 100%;
        height: 96vh;
        max-height: 95vh;
    }

    .documentos-modal__body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .documentos-modal__left {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        max-height: 40vh;
    }
}

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

.approval-modal__header {
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.approval-modal__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.approval-modal__title svg {
    color: var(--color-warning);
    width: 16px;
    height: 16px;
}

.approval-modal__subtitle {
    display: none; /* Hide subtitle to save vertical space */
}

.approval-modal__eyebrow {
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.approval-modal__header--editor {
    padding: 1rem 1.25rem 0.85rem;
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.08) 0%, rgba(15, 118, 110, 0.02) 100%);
}

.approval-modal__header-main {
    min-width: 0;
    flex: 1;
}

.approval-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.approval-modal__header-actions .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
}

.approval-modal__close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.approval-modal__close:hover {
    color: var(--color-danger, #b91c1c);
    border-color: rgba(185, 28, 28, 0.22);
    background: #fff;
    transform: rotate(90deg);
}

.approval-modal__close svg {
    width: 18px;
    height: 18px;
}

.approval-modal__content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.approval-modal__content--editor {
    padding: 0;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.07), transparent 24%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 1));
}

.approval-modal__editor-root {
    flex: 1;
    min-height: 520px;
}

.approval-modal__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.7rem 1.1rem 0.8rem;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0));
}

.editor-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 32px;
    padding: 0.42rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    color: #334155;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.editor-toolbar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.07);
}

.editor-toolbar-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.editor-toolbar-btn--accent {
    color: #7c3a1d;
    background: #fff7ed;
    border-color: rgba(194, 65, 12, 0.14);
}

.editor-toolbar-btn--accent-alt {
    color: #5b3aa8;
    background: #f5f3ff;
    border-color: rgba(109, 40, 217, 0.14);
}

.editor-toolbar-btn--heading {
    color: #166534;
    background: #f0fdf4;
    border-color: rgba(22, 101, 52, 0.14);
}

.editor-toolbar-btn--list {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.14);
}

.editor-toolbar-btn--quote {
    color: #0f766e;
    background: #f0fdfa;
    border-color: rgba(13, 148, 136, 0.14);
}

.editor-toolbar-btn--code {
    color: #92400e;
    background: #fffbeb;
    border-color: rgba(217, 119, 6, 0.14);
}

.editor-toolbar-btn--reset {
    color: #334155;
    background: #f8fafc;
    border-color: rgba(100, 116, 139, 0.14);
}

.approval-modal__transcript {
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg);
    margin: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.approval-modal__transcript h3 {
    margin: 0 0 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.approval-modal__textarea-container {
    position: relative;
    width: 100%;
}

.approval-transcript-edit {
    width: 100%;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    padding-right: 140px; /* Space for the floating button */
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-text);
    resize: vertical;
    min-height: 80px;
    outline: none;
}

/* Modal de nome do cliente */
.client-name-input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-bg);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.client-name-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.client-name-input::placeholder {
    color: var(--color-placeholder);
}

/* Contexto da sessao (materia, tipo de entrevista, canal) no modal inicial */
.session-context-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

@media (max-width: 560px) {
    .session-context-row {
        grid-template-columns: 1fr;
    }
}

.session-context-select,
.settings-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    color: var(--color-text);
}

.session-context-select:focus,
.settings-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Self-service question set dropdown: richer select styling */
.self-service-question-set-select {
    min-height: 44px;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    border-radius: 10px;
    border-color: color-mix(in srgb, var(--color-border) 76%, var(--color-primary) 24%);
    background:
        linear-gradient(45deg, transparent 50%, var(--color-text-secondary) 50%) calc(100% - 16px) calc(50% - 2px) / 7px 7px no-repeat,
        linear-gradient(135deg, var(--color-text-secondary) 50%, transparent 50%) calc(100% - 11px) calc(50% - 2px) / 7px 7px no-repeat,
        linear-gradient(to right, color-mix(in srgb, var(--color-border-light) 82%, white 18%), color-mix(in srgb, var(--color-border-light) 82%, white 18%)) calc(100% - 2.25rem) 50% / 1px 60% no-repeat,
        linear-gradient(180deg, color-mix(in srgb, white 86%, var(--color-card) 14%), var(--color-card));
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.self-service-question-set-select:hover {
    border-color: color-mix(in srgb, var(--color-border) 62%, var(--color-primary) 38%);
}

.self-service-question-set-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary-light) 78%, transparent 22%), 0 1px 2px rgba(16, 24, 40, 0.06);
}

.self-service-modal {
    width: min(96vw, 960px);
}

.self-service-invites {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.self-service-invites__title {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}

.self-service-invites__table-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: auto;
    background: var(--color-card);
}

.self-service-invites__table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.self-service-invites__table th,
.self-service-invites__table td {
    text-align: left;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

.self-service-invites__table th {
    white-space: nowrap;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
}

.self-service-invites__table tbody tr:hover {
    background: color-mix(in srgb, var(--color-primary-light) 22%, transparent 78%);
}

.self-service-sort-btn {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.self-service-sort-btn:hover {
    color: var(--color-primary);
}

.self-service-sort-btn:focus {
    outline: none;
    text-decoration: underline;
}

.self-service-invites__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.self-service-invites__cancel-btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
    line-height: 1.25;
}

.self-service-invites__cancel-btn:not(:disabled) {
    color: var(--color-danger);
    border-color: color-mix(in srgb, var(--color-danger) 48%, var(--color-border) 52%);
}

.approval-transcript-edit:focus {
    border-color: var(--color-primary);
}

/* ----------------------------------------------------------
   Modal de edicao da peticao (estilos legados)
   ---------------------------------------------------------- */
.peticao-modal .peticao-modal__intro {
    margin: 0 0 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.peticao-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-8);
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

.peticao-modal__textarea {
    min-height: 220px;
}

/* ----------------------------------------------------------
   Documentos Modal
   ---------------------------------------------------------- */
.documentos-modal .documentos-modal__intro {
    margin: 0 0 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.documentos-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-8);
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

.documentos-modal__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.documentos-modal__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.documentos-modal__field label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.documentos-modal__hint {
    font-size: var(--font-size-xs);
    color: var(--color-muted);
    margin: 0 0 var(--space-1);
}

.documentos-select,
.documentos-input {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.documentos-select:focus,
.documentos-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.documentos-modal__textarea {
    min-height: 180px;
    resize: vertical;
}

.documentos-modal__extras {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-border-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.documentos-modal__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.documentos-modal__row input {
    flex: 1;
    min-width: 120px;
}

.documentos-modal__actions-row {
    margin-top: var(--space-2);
}

.approval-btn--floating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    height: auto !important;
    box-shadow: var(--shadow-md);
}

.approval-modal__legend {
    margin: 6px 0 0;
    font-size: 0.6875rem;
    color: var(--color-muted);
}

.approval-modal__warnings {
    margin: 0 var(--space-4) var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning-bg);
    border-radius: var(--radius-md);
}

.approval-modal__warnings h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400e;
}

.approval-modal__warnings h4 svg {
    width: 14px;
    height: 14px;
}

.approval-modal__warnings ul {
    margin: 0;
    padding-left: 16px;
    font-size: 0.75rem;
    color: #92400e;
}

.approval-modal__warnings li {
    margin-bottom: 2px;
}

.approval-modal__actions {
    padding: var(--space-1) var(--space-4);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
    background: var(--color-card);
    flex-shrink: 0;
}

.approval-modal__actions .btn {
    padding: 4px 10px;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .approval-overlay {
        padding: 2rem var(--space-4) var(--space-4);
        align-items: flex-start;
        justify-content: center;
        background: rgba(0, 0, 0, 0.6);
        pointer-events: auto;
        z-index: 11000;
        overflow-y: auto;
    }

    /* When keyboard is open, shift most approval modals (config, attachments, etc.) up slightly to stay visible.
       Overlays .approval-overlay--fixed (ex.: modal do cliente) nao se movem. */
    body.keyboard-open .approval-overlay:not(.approval-overlay--fixed) .approval-modal {
        transform: translateY(calc(max(var(--keyboard-height, 0px) * -0.4, -180px)));
        transition: transform 0.2s ease-out;
    }

    .approval-modal {
        max-height: 90vh;
        height: auto;
        width: 100%;
        max-width: 500px;
        border-radius: var(--radius-lg);
        animation: slideInUp 0.3s ease-out;
        pointer-events: auto;
    }

    .approval-modal__header {
        padding: var(--space-4);
    }

    .approval-modal--editor {
        width: 100%;
    }

    .approval-modal__toolbar {
        padding: 0.75rem 1rem;
    }

    .approval-modal__header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .editor-toolbar-btn {
        flex: 1 1 calc(50% - 0.6rem);
        justify-content: center;
    }

    .approval-modal__actions {
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + 40px); /* Space for warning bar */
    }

    .proposal-view-toggle--compact {
        gap: 0.16rem;
        padding: 0.16rem;
    }

    .proposal-view-toggle__btn--compact {
        padding: 0.42rem 0.3rem;
        font-size: clamp(0.68rem, 3vw, 0.8rem);
    }
}

/* ----------------------------------------------------------
   HPI Full-Screen Edit Modal (Textarea + Markdown preview)
   ---------------------------------------------------------- */
.hpi-edit-overlay {
    padding: 0 !important;
    z-index: 10000 !important;
}

.hpi-edit-modal {
    background: var(--color-card);
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.hpi-edit-modal__header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg);
    gap: var(--space-4);
}

.hpi-edit-modal__title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.hpi-edit-modal__title svg {
    color: var(--color-primary);
}

.hpi-edit-modal__toolbar {
    padding: var(--space-2) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--color-bg);
}

.hpi-edit-modal__toolbar-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.hpi-edit-modal__toolbar-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-right: var(--space-2);
}

/* Side-by-side layout for documents: form | resizer | editor */
.hpi-edit-modal__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.hpi-edit-modal__body--documents {
    flex-direction: row;
}

.documentos-modal__form-pane {
    padding: 1rem;
    overflow-y: auto;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.hpi-edit-modal__resizer {
    width: 6px;
    flex-shrink: 0;
    background: var(--color-border);
    cursor: col-resize;
    transition: background 0.15s;
}

.hpi-edit-modal__resizer:hover {
    background: var(--color-primary);
}

.hpi-edit-modal__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--color-bg);
}

.hpi-edit-modal__editor-pane,
.hpi-edit-modal__preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hpi-edit-modal__editor-pane {
    border-right: 1px solid var(--color-border);
}

.hpi-edit-modal__pane-label {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.hpi-edit-modal__textarea {
    flex: 1;
    width: 100%;
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--color-text);
    background: var(--color-card);
    border: none;
    padding: var(--space-4);
    resize: none;
    font-family: inherit;
    overflow-y: auto;
}

.hpi-edit-modal__textarea:focus {
    outline: none;
    border: none;
}

.hpi-edit-modal__preview {
    flex: 1;
    padding: var(--space-4) var(--space-6);
    overflow-y: auto;
    background: var(--color-card);
    line-height: 1.8;
    color: var(--color-text);
}

.hpi-edit-modal__preview h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-primary);
}

.hpi-edit-modal__preview h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

.hpi-edit-modal__preview p {
    margin-bottom: var(--space-4);
    text-align: justify;
}

.hpi-edit-modal__preview ul {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

.hpi-edit-modal__preview li {
    margin-bottom: var(--space-2);
}

.hpi-edit-modal__preview strong {
    font-weight: 600;
    color: var(--color-text);
}

.hpi-edit-modal__preview em {
    font-style: italic;
    color: var(--color-text-secondary);
}

.hpi-edit-modal__actions {
    padding: var(--space-4) var(--space-6);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    flex-shrink: 0;
}

.hpi-edit-modal__actions .btn {
    padding: var(--space-2) var(--space-4);
}

.approval-btn {
    position: relative;
    overflow: hidden;
}

.approval-btn__progress {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.3);
    transition: width 0.5s linear;
    z-index: 0;
}

.approval-btn__text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.approval-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Reconnect Overlay
   ---------------------------------------------------------- */
.reconnect-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.reconnect-overlay__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-8);
    background: var(--color-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.reconnect-overlay__content p {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

.reconnect-overlay__detail {
    font-size: var(--font-size-sm) !important;
    font-weight: 400 !important;
    color: var(--color-muted) !important;
}

/* Drag and Drop Overlay */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: oklch(40% 0.06 255 / 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    pointer-events: auto; /* Catch drops */
}

.drag-overlay__content {
    text-align: center;
    color: white;
    padding: 3rem;
    border: 3px dashed rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
}

.drag-overlay__content svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.drag-overlay__content p {
    font-size: 1.5rem;
    font-weight: 500;
}

/* ----------------------------------------------------------
   Mobile Shell
   ---------------------------------------------------------- */

.mobile-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--color-bg);
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
}

/* --- Mobile Top Bar --- */

.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    height: 36px;
    min-height: 36px;
    padding: 0 0.75rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.mobile-topbar__logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mobile-topbar__wing {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.mobile-topbar__wing--left {
    justify-content: flex-start;
    gap: 0.4rem;
}

.mobile-topbar__wing--right {
    justify-content: flex-end;
}

.mobile-topbar__client {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mobile-topbar__client--beside-logo {
    flex: 1;
    min-width: 0;
}

.mobile-topbar__finalize {
    flex-shrink: 0;
    background: #dc2626;
    border: none;
    cursor: pointer;
    padding: 5px 13px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    border-radius: 8px;
    white-space: nowrap;
    font-family: inherit;
}

.mobile-topbar__finalize:hover:not(:disabled) {
    background: #b91c1c;
}

.mobile-topbar__finalize:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mobile-topbar__hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-topbar__hamburger:hover {
    background: var(--color-bg-secondary);
}

/* --- Mobile Nav Drawer --- */

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 260px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    z-index: 51;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-nav-drawer--open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.mobile-nav-drawer__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-nav-drawer__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-nav-drawer__close:hover {
    background: var(--color-bg-secondary);
}

.mobile-nav-drawer__section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    padding: 0.75rem 1rem 0.25rem;
}

.mobile-nav-drawer__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text);
    text-align: left;
    text-decoration: none;
    transition: background 0.12s;
}

.mobile-nav-drawer__item:hover:not(:disabled) {
    background: var(--color-bg-secondary);
}

.mobile-nav-drawer__item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mobile-nav-drawer__item--danger {
    color: var(--color-danger);
}

/* --- Mobile Drawer Overlay --- */

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 50;
}

/* --- Mobile Tab Content --- */

.mobile-tab-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mobile-tab-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-tab-panel__scroller {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.mobile-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 1.25rem;
    text-align: center;
}

.mobile-empty-state__content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 24rem;
}

.mobile-empty-state__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--color-primary) 68%, white);
}

.mobile-empty-state__text {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.mobile-empty-state__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}

.mobile-empty-state__btn:hover {
    opacity: 0.9;
}

.mobile-start-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 2rem 1rem;
}

.mobile-start-actions__btn {
    min-height: 56px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.mobile-start-actions__btn--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.mobile-start-actions__btn--primary:hover:not(:disabled) {
    opacity: 0.9;
}

.mobile-start-actions__btn--outline:hover:not(:disabled) {
    background: var(--color-bg-secondary);
}

.mobile-start-actions__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-viewing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

/* --- Mobile Query Bar --- */

.mobile-querybar {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: 0.5rem 0.75rem;
    flex-shrink: 0;
    position: relative;
}

.mobile-querybar__context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    color: var(--color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.mobile-querybar__context-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.mobile-querybar__context-clear:hover {
    background: var(--color-bg-secondary);
}

.mobile-querybar__row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.mobile-querybar__input {
    flex: 1;
    min-width: 0;
    min-height: 3.35rem;
    max-height: min(40vh, 17.5rem);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
    background: var(--color-bg);
    color: var(--color-text);
}

.mobile-querybar__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(17, 109, 255, 0.15);
}

.mobile-querybar__send-btn {
    background: var(--color-primary);
    border: none;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.mobile-querybar__send-btn--save {
    padding: 5px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.mobile-querybar__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.mobile-querybar__actions .mobile-querybar__send-btn {
    width: 100%;
    min-height: 32px;
    padding: 5px 9px;
}

.mobile-querybar__actions .mobile-querybar__annex-btn.sidebar-annex-btn {
    width: 100%;
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
    flex-shrink: 0;
}

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

/* --- Mini Recording Player --- */

.mobile-player {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-player__main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    min-height: 48px;
}

.mobile-player__btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-player__btn:disabled {
    opacity: 0.4;
}

.mobile-player__mic-btn {
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 6px;
}

.mobile-player__mic-label {
    font-size: var(--font-size-2xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    line-height: 1;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.mobile-player__mic-btn--active {
    color: var(--color-primary);
}

.mobile-player__mic-btn--active .mobile-player__mic-label {
    color: var(--color-primary);
}

.mobile-player__mic-btn--muted {
    color: var(--color-danger, #e53e3e);
}

.mobile-player__mic-btn--muted .mobile-player__mic-label {
    color: var(--color-danger, #e53e3e);
}

.mobile-player__mic-btn--remote {
    color: var(--color-text-muted);
}

.mobile-player__mic-btn--remote .mobile-player__mic-label {
    color: var(--color-text-muted);
}

.mobile-player__waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.mobile-player__bar {
    width: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: height 0.15s ease;
    animation: mobile-waveform 1.2s ease-in-out infinite alternate;
}

.mobile-player__waveform--paused .mobile-player__bar,
.mobile-player__waveform--inactive .mobile-player__bar {
    animation-play-state: paused;
    opacity: 0.2;
}

@keyframes mobile-waveform {
    0% { transform: scaleY(0.5); }
    100% { transform: scaleY(1); }
}

.mobile-player__timer {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    min-width: 3.5em;
}

.mobile-player__wordcount {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

/* --- Bottom Tab Bar --- */

.mobile-tabbar {
    display: flex;
    align-items: stretch;
    height: 48px;
    min-height: 48px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.mobile-tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.65rem;
    padding: 4px 0;
    position: relative;
    transition: color 0.15s;
    font-family: inherit;
}

.mobile-tabbar__item svg {
    width: 20px;
    height: 20px;
}

.mobile-tabbar__item--active {
    color: var(--color-primary);
}

.mobile-tabbar__item--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18%;
    right: 18%;
    height: 3px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-primary) 55%, transparent) 0%,
        var(--color-primary) 35%,
        var(--color-primary) 65%,
        color-mix(in srgb, var(--color-primary) 55%, transparent) 100%
    );
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -1px 8px color-mix(in srgb, var(--color-primary) 35%, transparent);
}

/* --- Mobile Content Rendering --- */

.mobile-viabilidade-content,
.mobile-peticao-content {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--color-text);
    padding: 0.5rem 0;
}

.mobile-viabilidade-content h1,
.mobile-peticao-content h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.mobile-viabilidade-content h2,
.mobile-peticao-content h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
}

.mobile-viabilidade-content p,
.mobile-peticao-content p {
    margin: 0.4rem 0;
}

.mobile-viabilidade-content ul,
.mobile-peticao-content ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

/* Selected question highlight */
.proposal-perguntas-list__item--selected {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    border-radius: 6px;
}

/* Hide desktop layout on mobile, show mobile shell */
@media (max-width: 768px) {
    .proposal-shell {
        display: none !important;
    }

    /* Also hide the desktop viewing banner (mobile has its own) */
    .app-content > div[x-show*="viewingInterview"]:not(.mobile-shell) {
        display: none !important;
    }
}


/* ----------------------------------------------------------
   Spinner
   ---------------------------------------------------------- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner--lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* ----------------------------------------------------------
   Horizontal Resizer (between main grid and transcription)
   ---------------------------------------------------------- */
.horizontal-resizer {
    flex: 0 0 6px;
    cursor: row-resize;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-fast);
}

.horizontal-resizer:hover {
    background: var(--color-muted);
}

/* ----------------------------------------------------------
   Keyframe Animations
   ---------------------------------------------------------- */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

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

@keyframes content-update {
    0% {
        opacity: 1;
    }
    30% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* ----------------------------------------------------------
   RESPONSIVE: Tablet (max-width: 1024px)
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        padding: var(--space-4);
    }

    .panel {
        max-height: none;
    }

    .transcription-panel {
        margin: 0 var(--space-4) var(--space-4);
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .top-bar__controls {
        gap: var(--space-3);
    }
}

/* ----------------------------------------------------------
   RESPONSIVE: Mobile (max-width: 768px)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
    }

    .top-bar__controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-2);
    }

    .top-bar__brand {
        width: 100%;
        justify-content: center;
    }

    .top-bar__history-label {
        display: none;
    }

    /* Make panels full-width and full-height on mobile */
    .main-layout {
        position: relative;
        height: calc(100vh - var(--header-height) - 140px); /* account for tab bar + warning bar */
    }

    .main-grid {
        padding: 0;
        gap: 0;
        margin: 0;
        height: 100%;
        flex-direction: column;
    }

    .panel {
        flex-basis: 100% !important;
        max-width: 100% !important;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0;
    }

    .panel__header {
        padding: var(--space-3) var(--space-4);
    }

    .panel__body {
        padding: var(--space-4);
        flex: 1;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .transcription-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        padding: 0;
        height: 100% !important;
        max-height: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .transcription-panel__header {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .transcription-panel__body {
        max-height: none;
        flex: 1;
        border-radius: 0;
        border-left: none;
        border-right: none;
        overscroll-behavior: contain;
    }

    /* Keep mobile layout fixed without full-page scroll; internal panels handle their own scrolling */
    html,
    body {
        height: 100%;
        padding-bottom: 0;
        overflow: hidden;
    }


    .horizontal-resizer,
    .main-grid__resizer {
        display: none;
    }

    .toast-container {
        top: max(env(safe-area-inset-top, 0px), var(--space-3));
        right: max(env(safe-area-inset-right, 0px), var(--space-3));
        max-width: min(18rem, calc(100vw - 1.5rem));
        gap: var(--space-2);
    }

    .toast-container .toast {
        padding: var(--space-2) var(--space-3);
        gap: var(--space-2);
        border-radius: var(--radius-sm);
    }

    .toast-container .toast__content {
        font-size: var(--font-size-xs);
        gap: var(--space-2);
        line-height: 1.35;
    }

    .toast-container .toast .icon-sm {
        width: 14px;
        height: 14px;
    }

    .toast-container .toast__close {
        padding: 2px;
    }

    .toast-container .toast__close svg {
        width: 12px;
        height: 12px;
    }
}

/* ----------------------------------------------------------
   Login Overlay
   ---------------------------------------------------------- */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-accent) 100%);
    padding: 1rem;
    height: 100vh;
    height: 100dvh;
}

@media (max-width: 768px) {
    .login-overlay {
        align-items: flex-start;
        justify-content: center;
        padding-top: 2rem;
        padding-bottom: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* When keyboard is open, shift login card up slightly to stay visible.
       Use 40% of keyboard height with a max of 200px so it doesn't go off-screen. */
    body.keyboard-open .login-overlay .login-card {
        transform: translateY(calc(max(var(--keyboard-height, 0px) * -0.4, -200px)));
        transition: transform 0.2s ease-out;
    }
}

.login-card {
    /* Frosted glass over login gradient */
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(14, 18, 67, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

/* Slightly wider login card to keep subtitle on one line */
.login-card--login {
    max-width: 460px;
}

/* Wider card for registration form with two columns */
.login-card:has(.register-columns) {
    max-width: 700px;
}

.login-card__header {
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.login-card__icon {
    width: 88px;
    height: 88px;
    display: block;
    margin: 0 auto 1rem;
    object-fit: contain;
    border-radius: 8px;
}

.login-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.25rem;
}

.login-card__subtitle {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin: 0;
    white-space: nowrap;
}

.login-card__form {
    padding: 1rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.login-card__field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.login-card__field input {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card__field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.login-card__field input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-card__hint {
    font-size: 0.8125rem;
    color: var(--color-muted);
    margin: 0.25rem 0 0;
}

.login-card__error {
    color: var(--color-danger);
    font-size: 0.8125rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--color-danger-light);
    border-radius: 6px;
}

.login-card__submit {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ----------------------------------------------------------
   Register Form - Two Column Layout
   ---------------------------------------------------------- */
.register-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.register-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* On smaller screens, stack the columns */
@media (max-width: 640px) {
    .register-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ----------------------------------------------------------
   Historico de entrevistas
   ---------------------------------------------------------- */
.history-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 1rem;
}

.history-panel {
    background: var(--color-card);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.history-panel__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.history-panel__body {
    overflow-y: auto;
    padding: 1rem 1.25rem;
    flex: 1;
}

.history-item {
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.history-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.history-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.history-item__date {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-muted);
}

.history-item__preview {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item__meta {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: 0.375rem;
}

.history-detail__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--color-muted);
}

.history-detail__section {
    margin-bottom: 1.5rem;
}

.history-detail__section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--color-border-light);
}

.history-detail__transcript {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    background: var(--color-bg);
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* ----------------------------------------------------------
   Top Bar: User & Logout
   ---------------------------------------------------------- */
.top-bar__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--color-border);
}

.top-bar__username {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ----------------------------------------------------------
   Alpine.js Cloak (prevent FOUC)
   ---------------------------------------------------------- */
[x-cloak] {
    display: none !important;
}

/* ----------------------------------------------------------
   Help Modal
   ---------------------------------------------------------- */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.help-modal {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--color-border);
    width: 100%;
    max-width: 10000px;
    max-height: 120vh;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
    overflow: hidden;
}

.help-modal__header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 1rem;
}

.help-modal__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.help-modal__title svg {
    color: var(--color-primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.help-modal__tabs {
    display: flex;
    gap: 0;
    padding: 0 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.help-modal__tab {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-family: var(--font-family);
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    margin-bottom: -1px;
}

.help-modal__tab:hover {
    color: var(--color-text);
    background: var(--color-bg-primary);
}

.help-modal__tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg-primary);
}

.help-modal__body {
    flex: 1;
    overflow-y: auto;
}

.help-modal__body h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
    color: var(--color-text);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

.help-modal__body h3:first-child {
    margin-top: 0;
}

.help-modal__body p {
    margin: 0.5rem 0;
    color: var(--color-text-secondary);
    line-height: 1.65;
    font-size: 0.875rem;
}

.help-modal__body ul, .help-modal__body ol {
    padding-left: 1.375rem;
    margin: 0.5rem 0;
}

.help-modal__body li {
    margin: 0.35rem 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.875rem;
}

.help-modal__body strong {
    color: var(--color-text);
    font-weight: 600;
}

.help-step {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    align-items: flex-start;
}

.help-step__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.help-step__body {
    flex: 1;
    min-width: 0;
}

.help-step__body h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    color: var(--color-text);
}

.help-step__body p {
    margin: 0.2rem 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.help-step__body ul {
    margin: 0.3rem 0;
    padding-left: 1.25rem;
}

.help-step__body li {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
    margin: 0.2rem 0;
}

.help-tip {
    background: var(--color-primary-light);
    border: 1px solid oklch(40% 0.06 255 / 0.2);
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--color-text);
    line-height: 1.55;
}

.help-warning {
    background: var(--color-warning-light);
    border: 1px solid oklch(65% 0.12 65 / 0.35);
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--color-text);
    line-height: 1.55;
}

.help-faq-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

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

.help-faq-q {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.375rem;
}

.help-faq-a {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin: 0;
}

.help-faq-a ul {
    margin: 0.35rem 0;
    padding-left: 1.25rem;
}

.help-faq-a li {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0.2rem 0;
}

.help-modal__footer {
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.help-modal__footer-note {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .help-modal {
        max-height: 95vh;
    }
    .help-modal__tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .help-modal__tab {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
    .help-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ----------------------------------------------------------
   Proposal B Desktop Rewrite
   ---------------------------------------------------------- */
.proposal-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    background: #fafaf8;
    color: #1c1c1a;
    font-family: var(--font-family);
}

.proposal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0 1.25rem;
    min-height: 46px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(244, 236, 227, 0.72);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border-bottom: 1px solid rgba(196, 149, 106, 0.22);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 2px 12px rgba(0, 0, 0, 0.06);
}

.proposal-topbar__interview-context {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    z-index: 2;
}

.proposal-topbar__left,
.proposal-topbar__right,
.proposal-topbar__action-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.proposal-topbar__left {
    flex-wrap: wrap;
}

.proposal-topbar__actions {
    display: flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
    flex: 1;
    gap: 0.75rem;
}

.proposal-topbar__action-stack {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: center;
}

.proposal-topbar__generated-actions {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 0.75rem;
}

.proposal-logo {
    font-size: 0.84rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.proposal-logo span {
    color: var(--color-primary);
}

.proposal-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-family);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8a84;
}

.proposal-session-badge.recording {
    color: #c0392b;
}

.proposal-session-badge.active {
    color: var(--color-primary);
}

.proposal-session-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.proposal-session-badge.recording .proposal-session-badge__dot {
    animation: proposal-pulse-dot 1.4s ease-in-out infinite;
}

@keyframes proposal-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.proposal-waveform {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    min-height: 30px;
}

.proposal-waveform__bar {
    width: 3px;
    border-radius: 999px;
    background: var(--color-primary);
    opacity: 0.75;
    transform-origin: center;
    animation: proposal-wave 1.2s ease-in-out infinite;
}

.proposal-waveform--muted .proposal-waveform__bar,
.proposal-waveform--inactive .proposal-waveform__bar {
    animation-play-state: paused;
    opacity: 0.2;
}

.proposal-waveform--muted .proposal-waveform__bar {
    background: #A8393B;
}

@keyframes proposal-wave {
    0%, 100% { transform: scaleY(0.2); }
    50% { transform: scaleY(1); }
}

.proposal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    border: none;
    border-radius: 12px;
    padding: 0.58rem 0.92rem;
    font-family: var(--font-family);
    font-size: 0.79rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.proposal-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.proposal-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.proposal-btn--sm {
    padding: 0.34rem 0.7rem;
    font-size: 0.73rem;
    border-radius: 9px;
}

.proposal-btn--primary {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 6px oklch(68% 0.17 57 / 0.35);
}

.proposal-btn--primary:disabled {
    background: #C4B8AC;
    color: #f0ece8;
    opacity: 1;
    box-shadow: none;
}

.proposal-btn--primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    box-shadow: 0 3px 10px oklch(68% 0.17 57 / 0.45);
}

.proposal-btn--secondary {
    background: transparent;
    border: 1px solid #d8d8d2;
    color: #6b6b64;
}

.proposal-btn--secondary:hover:not(:disabled) {
    border-color: #8a8a84;
    color: #4a4a46;
}

.proposal-btn--danger {
    background: #fff2f2;
    border-color: #e6a1a1;
    color: #b42318;
}

.proposal-btn--danger:hover:not(:disabled) {
    background: #ffe5e5;
    border-color: #d26868;
    color: #912018;
}

.proposal-btn--important-action {
    background: #fff4de;
    border-color: #d89a35;
    color: #6a3d00;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(216, 154, 53, 0.2), 0 4px 12px rgba(176, 118, 43, 0.22);
}

.proposal-btn--important-action:hover:not(:disabled) {
    background: #ffe9c5;
    border-color: #bf7e18;
    color: #4f2d00;
    box-shadow: 0 0 0 1px rgba(191, 126, 24, 0.25), 0 6px 14px rgba(149, 91, 24, 0.28);
}

.proposal-btn--important-action:focus-visible {
    outline: 2px solid #bf7e18;
    outline-offset: 2px;
}

.proposal-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.proposal-btn--block {
    width: 100%;
    justify-content: center;
}

.sidebar-annex-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: auto;
    min-width: 2rem;
    height: 2rem;
    gap: 0.32rem;
    padding: 0 0.6rem;
    font-size: 0.74rem;
    border-radius: 10px;
    line-height: 1;
}

.sidebar-annex-btn .icon-sm {
    display: block;
    margin: 0;
}

.sidebar-annex-btn__label {
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 600;
}

.annex-counter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    border-radius: 999px;
    text-align: center;
    pointer-events: none;
}

.proposal-icon-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #8a8a84;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.proposal-icon-btn:hover {
    background: #f4f3f0;
    color: #4a4a46;
}

.proposal-icon-btn svg {
    width: 14px;
    height: 14px;
}

.proposal-profile {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.proposal-profile:hover {
    background: #f4f3f0;
}

.proposal-profile-wrap {
    position: relative;
}

.proposal-profile__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-family);
    font-size: 0.7rem;
    color: #6b6b64;
    line-height: 1.2;
}

.proposal-profile__chevron {
    width: 12px;
    height: 12px;
    color: #8a8a84;
    transition: transform 0.2s ease;
}

.proposal-profile-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #ebebe6;
    border-radius: 14px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    padding: 0.4rem;
    z-index: 10;
}

.proposal-profile-menu__item {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 0.8rem;
    color: #4a4a46;
    cursor: pointer;
    text-decoration: none;
}

.proposal-profile-menu__item:hover {
    background: #f4f3f0;
}

.proposal-profile-menu__item--danger {
    color: #c0392b;
}

.proposal-patient-chip {
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0.8rem;
    border-radius: 14px;
    background: #f4f3f0;
    font-family: var(--font-family);
    line-height: 1.1;
}

.proposal-patient-chip__label {
    font-size: 0.62rem;
    color: #8a8a84;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.proposal-patient-chip__name {
    font-size: 0.8rem;
    color: #1c1c1a;
}

.proposal-patient-chip__meta {
    font-size: 0.66rem;
    color: #7d7d76;
}

.proposal-patient-chip--interview {
    align-items: center;
    text-align: center;
}

.proposal-timer {
    min-width: 64px;
    text-align: center;
    padding: 0.32rem 0 0.32rem 0.62rem;
    border-radius: 0;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(184, 160, 130, 0.45);
    font-family: var(--font-family);
    font-size: 0.8rem;
    color: #3f3b34;
}

.proposal-layout {
    --proposal-controls-bar-height: 58px;
    /* Scroll/sidebar inset: must be ≥ real overlay height (padding + row height + wraps).
       Bar sits at top:46px; 58px underestimated footprint → perguntas chips overlapped. */
    --proposal-controls-bar-clearance: 76px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    flex: 1;
    min-height: 0;
    position: relative;
    transition: grid-template-columns 0.25s ease;
    margin-top: -46px; /* overlap behind topbar so backdrop-filter has content to blur */
}

.proposal-layout--sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) 0;
}

.proposal-main {
    padding: calc(46px + var(--proposal-controls-bar-clearance)) 2.5rem 0;
    overflow-y: clip;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

/* Shared scrollport for transcript + sticky controls bar so backdrop-filter
   samples scrolling content (same idea as sutile-query over the column). */
.proposal-main__scroller {
    flex: 1;
    min-height: 0;
    overflow-x: clip;
    overflow-y: auto;
}

.proposal-main__content {
    padding-bottom: 3.5rem;
}

.proposal-empty-state,
.proposal-config-card {
    max-width: 760px;
    margin: 2rem auto 0;
    background: #ffffff;
    border: 1px solid #ebebe6;
    border-radius: 20px;
    padding: 2rem;
}

.proposal-empty-state h1,
.proposal-patient-header h1,
.proposal-config-card__header h2 {
    font-size: 1.65rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.proposal-empty-state p,
.proposal-config-card__header p,
.proposal-patient-header__meta,
.proposal-sidebar-card__text,
.proposal-alert-card p,
.proposal-empty-copy,
.proposal-doc-row__meta,
.proposal-history-row__main span {
    font-family: var(--font-family);
    color: #6b6b64;
}

.proposal-config-card__grid {
    margin-top: 1.25rem;
}

.proposal-config-card__actions {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.proposal-config-card__cta {
    display: flex;
    gap: 0.75rem;
}

.proposal-field-hint {
    margin-top: 0.4rem;
    font-family: var(--font-family);
    font-size: 0.72rem;
    color: #8a8a84;
}

.proposal-patient-header {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    align-self: center;
}

.proposal-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    background: #EDEBE5;
    border: 1px solid #D6D1CB;
    border-radius: 999px;
}

.proposal-view-toggle--topbar {
    align-self: center;
}

.proposal-view-toggle-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: -0.35rem;
}

.proposal-view-toggle--section {
    margin-bottom: 0.65rem;
}

.proposal-view-toggle--compact {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: clamp(0.18rem, 1.2vw, 0.35rem);
    padding: clamp(0.16rem, 1vw, 0.25rem);
}

.proposal-view-toggle__btn {
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 0.38rem 0.8rem;
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    color: #5a564e;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, opacity 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.proposal-view-toggle__btn:not(.proposal-view-toggle__btn--active):not(:disabled) {
    opacity: 0.88;
    filter: saturate(0.92);
}

.proposal-view-toggle__btn:hover:not(:disabled) {
    color: #1c1c1a;
    opacity: 1;
    filter: none;
}

.proposal-view-toggle__btn--active {
    background: #ffffff;
    color: var(--color-primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    opacity: 1;
    filter: none;
}

.proposal-view-toggle__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.proposal-view-toggle__btn--compact {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: clamp(0.35rem, 1vw, 0.5rem) clamp(0.38rem, 1.4vw, 0.7rem);
    font-size: clamp(0.72rem, 2.8vw, 0.84rem);
    line-height: 1.15;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.proposal-transcript-section {
    width: 100%;
}

.proposal-perguntas-section,
.proposal-perguntas-section > div {
    width: 100%;
}

.proposal-perguntas-section .proposal-transcript-card {
    width: 100%;
    box-sizing: border-box;
}

.proposal-section-label,
.proposal-sidebar__section-label {
    font-family: var(--font-family);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #797367;
    margin-bottom: 0.85rem;
}

.proposal-section-label--top-spaced {
    padding-top: 1.75rem;
}

.proposal-transcript-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #ebebe6;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    overflow: hidden;
}

.proposal-transcript-card--generated {
    width: 100%;
}

/* "Perguntas geradas por IA" — um único card, tom marrom um pouco mais escuro que o roteiro */
.proposal-transcript-card--ia-off-script {
    margin-bottom: 1.25rem;
    background: #f4e7cd40;
    border-color: rgba(180, 141, 60, 0.28);
}

.proposal-transcript-card--ia-off-script::before {
    background: linear-gradient(to bottom, transparent, #a67c2e, transparent);
    opacity: 0.35;
}

.proposal-perguntas-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.proposal-perguntas-list__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 0.9rem;
    border: 1px solid #e3ddd1;
    border-radius: 14px;
    padding: 0.5rem 1.05rem;
    background: #f7f2e8;
}

.proposal-perguntas-list__item--question {
    border-top: 2px solid oklch(68% 0.17 57 / 0.4);
}

.proposal-perguntas-list__item--answered {
    background: oklch(96% 0.02 162);
    border-top: 2px solid oklch(52% 0.13 162 / 0.4);
}

.proposal-perguntas-list__item--gap {
    background: oklch(96% 0.025 65);
    border-top: 2px solid oklch(65% 0.12 65 / 0.4);
}

.proposal-transcript-card--ia-off-script .proposal-perguntas-list__item--question {
    background: oklch(93% 0.015 75);
    border-top-color: oklch(60% 0.12 57 / 0.5);
}

.proposal-transcript-card--ia-off-script .proposal-perguntas-list__index {
    background: #cfba86;
    border-color: #9a7a3a;
    color: #4a3a12;
}

.proposal-perguntas-list__index,
.proposal-perguntas-list__icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 700;
}

.proposal-perguntas-list__index {
    background: #ddc389;
    border: 1px solid #b48d3c;
    color: #5f4209;
}

.proposal-perguntas-list__icon {
    background: #fce7c2;
    color: #b45309;
}

.proposal-perguntas-list__index--answered {
    background: #caebd0;
    border: 1px solid #5d9f69;
    color: #14532d;
}

.proposal-perguntas-list__body {
    min-width: 0;
}

.proposal-perguntas-list__body strong {
    display: block;
    margin-bottom: 0.28rem;
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9384;
    line-height: 1.45;
}

.proposal-perguntas-list__item--answered .proposal-perguntas-list__body strong {
    color: #166534;
}

.proposal-perguntas-list__body p {
    margin: 0;
}

/* --- Clickable question items --- */
.proposal-perguntas-list__item--clickable {
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.proposal-perguntas-list__item--clickable:hover {
    background: rgba(0, 0, 0, 0.03);
}

.proposal-perguntas-list__item--expanded {
    background: rgba(0, 0, 0, 0.025);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* --- Manual response badge --- */
.proposal-perguntas-list__badge-manual {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 0.05em 0.4em;
    margin-left: 0.4em;
    vertical-align: middle;
    line-height: 1.4;
}

/* --- Manual response index color --- */
.proposal-perguntas-list__index--manual {
    background: #e0e7ff;
    color: #3730a3;
}

/* --- Manual response item left border --- */
.proposal-perguntas-list__item--manual {
    border-top: 2px solid oklch(55% 0.18 277 / 0.4);
}

/* --- Chevron indicator --- */
.proposal-perguntas-list__header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.proposal-perguntas-list__chevron {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--color-muted, #9ca3af);
    transition: transform 0.2s ease;
    margin-top: 0.15rem;
}

.proposal-perguntas-list__chevron--open {
    transform: rotate(90deg);
}

/* --- Edit indicator (mobile question tap-to-answer) --- */
.proposal-perguntas-list__edit-indicator {
    flex-shrink: 0;
    color: var(--color-text-muted);
    opacity: 0.5;
    display: flex;
    align-items: center;
    margin-top: 0.1rem;
    transition: color 0.15s, opacity 0.15s;
}

.proposal-perguntas-list__edit-indicator--selected {
    color: var(--color-primary);
    opacity: 1;
}

/* --- Resposta preview (collapsed) --- */
.proposal-perguntas-list__resposta-preview {
    margin-top: 0.2rem;
}

/* --- Textarea wrap --- */
.proposal-perguntas-list__textarea-wrap {
    margin-top: 0.5rem;
    overflow: hidden;
}

.proposal-perguntas-list__textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem 0.65rem;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--color-text, #080808);
    background: var(--color-bg-primary, #fff);
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-sm, 4px);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.proposal-perguntas-list__textarea:focus {
    border-color: var(--color-primary, #116dff);
    box-shadow: 0 0 0 2px rgba(17, 109, 255, 0.15);
}

.proposal-perguntas-list__textarea-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.proposal-perguntas-list__save-btn {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary, #116dff);
    border: none;
    border-radius: var(--radius-sm, 4px);
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.proposal-perguntas-list__save-btn:hover {
    opacity: 0.9;
}

/* --- Mobile compact question list overrides --- */
@media (max-width: 768px) {
    .proposal-perguntas-list {
        gap: 0.45rem;
    }

    .proposal-perguntas-list__item {
        gap: 0.55rem;
        padding: 0.35rem 0.6rem;
        border-radius: 10px;
    }

    .proposal-perguntas-list__index,
    .proposal-perguntas-list__icon {
        width: 1.65rem;
        height: 1.65rem;
        font-size: 0.7rem;
    }

    .proposal-perguntas-list__body strong {
        font-size: 0.72rem;
        margin-bottom: 0.12rem;
        letter-spacing: 0.05em;
    }

    .proposal-perguntas-list__resposta-preview {
        font-size: 0.72rem;
        margin-top: 0.15rem;
        color: var(--color-text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .proposal-perguntas-list__badge-manual {
        font-size: 0.58rem;
        padding: 0.02em 0.3em;
    }

    .proposal-section-label {
        font-size: 0.68rem;
        margin-bottom: 0.35rem;
    }

    .proposal-transcript-card {
        padding: 0.5rem 0.4rem;
        margin-bottom: 0.6rem;
    }

    .mobile-tab-panel__scroller {
        padding: 0.5rem 0.35rem;
    }
}

/* --- Expand/collapse transitions --- */
.proposal-transition--enter {
    transition:
        max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease-out,
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
}
.proposal-transition--enter-start {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
}
.proposal-transition--enter-end {
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
}
.proposal-transition--leave {
    transition:
        max-height 0.22s ease-in,
        opacity 0.16s ease-in,
        transform 0.22s ease-in;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
}
.proposal-transition--leave-start {
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
}
.proposal-transition--leave-end {
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
}

.proposal-perguntas-list__body p {
    font-size: var(--font-size-base);
    line-height: var(--lh-loose);
    color: var(--color-text);
}

.proposal-transcript-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(to bottom, transparent, var(--color-primary), transparent);
    opacity: 0.35;
}

.proposal-transcript-flow {
    font-size: var(--font-size-sm);
    line-height: var(--lh-loose);
    color: var(--color-text);
}

.proposal-transcript-flow p + p {
    margin-top: 1rem;
}

.proposal-transcript-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    background: var(--color-primary);
    animation: proposal-cursor 1s step-end infinite;
}

@keyframes proposal-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.proposal-transcript-toggle {
    border: 1px solid #e8e6df;
    background: #f4f3f0;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 34px;
    font-family: var(--font-family);
    font-size: 0.74rem;
    font-weight: 300;
    line-height: 1;
    white-space: nowrap;
    color: #000000;
    cursor: default;
    pointer-events: none;
}

.proposal-transcript-toggle span {
    color: #000000;
    line-height: 1;
}

.proposal-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
    max-width: 860px;
}

.proposal-record-editor-shell {
    max-width: 860px;
}

.proposal-record-editor {
    min-height: 420px;
    background: #ffffff;
    border: 1px solid #ebebe6;
    border-radius: 18px;
    overflow: hidden;
}

.proposal-record-editor .milkdown {
    min-height: 420px;
}

.proposal-record-editor .ProseMirror {
    min-height: 420px;
    padding: 1.6rem 1.75rem;
    font-size: var(--font-size-base);
    line-height: var(--lh-loose);
    color: var(--color-text);
    outline: none;
    max-width: 72ch;
}

.proposal-record-editor .ProseMirror h1,
.proposal-record-editor .ProseMirror h2,
.proposal-record-editor .ProseMirror h3,
.proposal-record-editor .ProseMirror p,
.proposal-record-editor .ProseMirror ul,
.proposal-record-editor .ProseMirror ol {
    margin-bottom: 0.9rem;
}

.proposal-record-editor .ProseMirror h1,
.proposal-record-editor .ProseMirror h2 {
    font-weight: 500;
}

.proposal-record-editor .ProseMirror ul,
.proposal-record-editor .ProseMirror ol {
    padding-left: 1.4rem;
}

.proposal-record-editor .ProseMirror--readonly {
    cursor: default;
}

.proposal-record-fallback {
    padding: 1.6rem 1.75rem;
    font-size: var(--font-size-base);
    line-height: var(--lh-loose);
    color: var(--color-text);
    max-width: 72ch;
}

.proposal-record-section {
    padding: 1.35rem 0;
    border-bottom: 1px solid #ebebe6;
}

.proposal-record-section--full {
    grid-column: 1 / -1;
}

.proposal-record-content {
    font-size: var(--font-size-base);
    line-height: var(--lh-loose);
    color: var(--color-text);
    max-width: 72ch;
}

.proposal-record-content ul {
    list-style: none;
    padding: 0;
}

.proposal-record-content li {
    position: relative;
    padding-left: 0.85rem;
}

.proposal-record-content li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.8rem;
    width: 5px;
    height: 1px;
    background: #b8b8b2;
}

.proposal-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.proposal-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8d8d2;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    background: #f4f3f0;
    font-family: var(--font-family);
    font-size: 0.72rem;
    color: #4a4a46;
}

.proposal-tag--secondary {
    background: #e6f4f3;
    color: var(--color-primary);
    border-color: #c6e5e2;
}

.proposal-tag--button {
    cursor: pointer;
}

.proposal-sidebar {
    border-left: 1px solid #ebebe6;
    background: #fafaf8;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
    transition: transform 0.25s ease, opacity 0.2s ease;
    padding-top: calc(46px + var(--proposal-controls-bar-clearance));
}

.proposal-sidebar--collapsed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.proposal-sidebar__collapse {
    position: absolute;
    top: 0.85rem;
    left: 0.75rem;
    z-index: 2;
    width: 30px;
    height: 30px;
    border: 1px solid #d8d8d2;
    border-radius: 999px;
    background: #ffffff;
    color: #6b6b64;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.proposal-sidebar__collapse svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.proposal-sidebar__resizer {
    position: absolute;
    left: -5px;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
    z-index: 3;
}

body.proposal-is-resizing-sidebar,
body.proposal-is-resizing-sidebar * {
    user-select: none;
    -webkit-user-select: none;
    cursor: col-resize !important;
}

.proposal-sidebar__resizer::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 48px;
    border-radius: 999px;
    background: #d8d8d2;
    transition: background 0.2s ease;
}

.proposal-sidebar__resizer:hover::before {
    background: var(--color-primary);
}

.proposal-sidebar-restore {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 3;
    border: 1px solid #d8d8d2;
    border-radius: 999px;
    background: #ffffff;
    color: #4a4a46;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    font-family: var(--font-family);
    font-size: 0.74rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.proposal-sidebar-restore svg {
    width: 14px;
    height: 14px;
}

.proposal-sidebar__debug {
    padding: 3.25rem 1.15rem 0.9rem;
    border-bottom: 1px solid #ebebe6;
}

.proposal-debug-input {
    margin-bottom: 0.65rem;
}

.proposal-sidebar__tabs {
    display: flex;
    padding: 0 0.25rem 0 3rem;
    border-bottom: 1px solid #ebebe6;
    overflow-x: auto;
}

.proposal-sidebar__tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.9rem 0.35rem 0.8rem;
    font-family: var(--font-family);
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8a84;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.proposal-sidebar__tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.proposal-sidebar__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.proposal-sidebar__body-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1.15rem 0.5rem;
}

/* Full-bleed viabilidade badge: spans sidebar content edge-to-edge, label centered */
.proposal-sidebar__viabilidade-badge-row {
    box-sizing: border-box;
    width: calc(100% + 2.3rem);
    margin-left: -1.15rem;
    margin-right: -1.15rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.proposal-sidebar__viabilidade-badge {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.proposal-sidebar__viabilidade-badge.badge--media {
    margin-top: 0.55rem;
}

.proposal-sidebar__body .sutile-query--composer {
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.proposal-sidebar__body .sutile-query--sidebar-composer {
    margin-top: -2rem;
    border-radius: 18px 18px 0 0;
}

.milkdown-editor-container--sidebar {
    flex: none;
    min-height: 200px;
}

.milkdown-editor-container--sidebar .milkdown {
    flex: none;
    overflow: visible;
}

.milkdown-editor-container--sidebar .ProseMirror {
    overflow: visible;
    min-height: 200px;
}

.sidebar-editor-float-actions {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    display: flex;
    gap: 0.25rem;
    z-index: 5;
}

.sidebar-editor-float-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 250, 248, 0.88);
    border: 1px solid #e0e0da;
    border-radius: 6px;
    cursor: pointer;
    color: #6b6b64;
    padding: 0;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sidebar-editor-float-btn:hover {
    background: #fff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.proposal-sidebar-card,
.proposal-coding-suggestion {
    background: #ffffff;
    border: 1px solid #ebebe6;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.75rem;
}

.proposal-sidebar-card__title,
.proposal-coding-row__title,
.proposal-doc-row__title {
    font-family: var(--font-family);
    font-size: 0.82rem;
    color: #1c1c1a;
}

.proposal-sidebar-card__meta {
    margin-top: 0.2rem;
    font-family: var(--font-family);
    font-size: 0.7rem;
    color: #8a8a84;
}

.proposal-sidebar-list {
    padding-left: 1rem;
    font-family: var(--font-family);
    color: #4a4a46;
    font-size: 0.8rem;
}

.proposal-sidebar-list li + li {
    margin-top: 0.45rem;
}

.proposal-alert-card {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.65rem;
    font-family: var(--font-family);
}

.proposal-alert-card strong {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.proposal-alert-card--critico {
    background: #fdecea;
    border-color: oklch(46% 0.16 22 / 0.3);
}

.proposal-alert-card--atencao {
    background: #fdf1e8;
    border-color: oklch(65% 0.12 65 / 0.35);
}

.proposal-alert-card--info,
.proposal-alert-card--undefined {
    background: #e6f4f3;
    border-color: oklch(50% 0.1 250 / 0.3);
}

.proposal-qa-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.proposal-qa-message {
    max-width: 95%;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 0.82rem;
    line-height: 1.6;
}

.proposal-qa-message--user {
    align-self: flex-end;
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.proposal-qa-message--ai {
    align-self: flex-start;
    background: #f4f3f0;
    color: #4a4a46;
    border-bottom-left-radius: 4px;
}

.proposal-qa-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.proposal-qa-input,
.proposal-lookup-input {
    width: 100%;
    border: 1px solid #d8d8d2;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.75rem 0.85rem;
    font-family: var(--font-family);
    font-size: 0.82rem;
    color: #1c1c1a;
    resize: vertical;
    outline: none;
}

.proposal-qa-input:focus,
.proposal-lookup-input:focus {
    border-color: var(--color-primary);
}

.proposal-coding-row {
    display: flex;
    gap: 0.8rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ebebe6;
}

.proposal-coding-row__code {
    min-width: 70px;
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    padding-top: 0.1rem;
}

.proposal-coding-row__body {
    flex: 1;
}

.proposal-coding-row__actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.proposal-inline-btn {
    border: 1px solid #d8d8d2;
    background: transparent;
    color: #6b6b64;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-family: var(--font-family);
    font-size: 0.68rem;
    cursor: pointer;
}

.proposal-inline-btn--danger:hover,
.proposal-inline-btn--danger {
    color: #c0392b;
}

.proposal-lookup-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.proposal-lookup-results {
    border: 1px solid #ebebe6;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.proposal-lookup-item,
.proposal-doc-row,
.proposal-history-row__main {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.proposal-lookup-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    font-family: var(--font-family);
    font-size: 0.78rem;
}

.proposal-lookup-item + .proposal-lookup-item {
    border-top: 1px solid #ebebe6;
}

.proposal-doc-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid #ebebe6;
}

.proposal-doc-list-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 0;
    border: none;
    border-bottom: 1px solid #ebebe6;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.proposal-doc-list-item:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.proposal-doc-list-item__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f4f3f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a8a84;
    flex-shrink: 0;
}

.proposal-doc-list-item__icon svg {
    width: 16px;
    height: 16px;
}

.proposal-doc-list-item__body {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    font-family: var(--font-family);
}

.proposal-doc-list-item__body strong {
    font-size: 0.82rem;
    color: #1c1c1a;
}

.proposal-doc-list-item__body span {
    font-size: 0.72rem;
    color: #8a8a84;
    line-height: 1.4;
}

.proposal-history-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid #ebebe6;
}

.proposal-history-row__main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    font-family: var(--font-family);
}

/* Modifier classes for desktopSessionBadgeClass getter */
.proposal-session-badge--recording {
    color: #c0392b;
}

.proposal-session-badge--recording .proposal-session-badge__dot {
    animation: proposal-pulse-dot 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.proposal-session-badge--paused {
    color: #e07a3b;
    opacity: 0.92;
}

.proposal-session-badge--processing {
    color: var(--color-primary);
}

.proposal-session-badge--processing .proposal-session-badge__dot {
    animation: proposal-processing-dot 1.25s linear infinite;
}

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

@keyframes query-feedback-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes proposal-processing-dot {
    0% {
        opacity: 0.45;
        transform: scale(0.88);
        box-shadow: 0 0 0 0 rgba(66, 77, 105, 0.2);
    }
    60% {
        opacity: 1;
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(66, 77, 105, 0);
    }
    100% {
        opacity: 0.55;
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(66, 77, 105, 0);
    }
}

@media (max-width: 768px) {
    .proposal-shell {
        display: none !important;
    }
}

/* ----------------------------------------------------------
   Logo block: title stacked with recording badge
   ---------------------------------------------------------- */
.proposal-logo-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    line-height: 1;
}

/* ----------------------------------------------------------
   Audio source selector wrapper (mic icon + select)
   ---------------------------------------------------------- */
.proposal-source-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0.2rem 0 0;
    transition: border-color 160ms ease;
}

.proposal-source-wrap:focus-within {
    box-shadow: none;
}

.proposal-source-wrap__mic {
    width: 14px;
    height: 14px;
    color: #5a564e;
    flex-shrink: 0;
}

.proposal-source-wrap .top-bar__source-select {
    border: none;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    min-width: 5.4rem;
    font-size: 0.68rem;
}

.proposal-source-wrap .top-bar__source-select:focus {
    border: none;
    box-shadow: none;
}

/* ----------------------------------------------------------
   Audio source cycle button (shared: mobile player + desktop top bar)
   Same visual language as .mobile-player__mic-btn
   ---------------------------------------------------------- */
.audio-src-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 6px;
    color: var(--color-text-muted);
    transition: color 160ms ease, background 160ms ease;
    flex-shrink: 0;
}

.audio-src-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.audio-src-btn__label {
    font-size: var(--font-size-2xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    line-height: 1;
    text-transform: uppercase;
    color: inherit;
}

.audio-src-btn--on {
    color: var(--color-primary);
}

.audio-src-btn--off {
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* ----------------------------------------------------------
   Session controls group (Pausar + Encerrar wrapped together)
   ---------------------------------------------------------- */
.proposal-session-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.18rem;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(192, 169, 139, 0.44);
    border-radius: 999px;
}

.proposal-active-call {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 251, 247, 0.42) 0%, rgba(245, 236, 226, 0.34) 100%);
    border: 1px solid rgba(191, 157, 123, 0.24);
    box-shadow: 0 4px 14px rgba(92, 62, 34, 0.035);
    opacity: 0.8;
}

.proposal-active-call__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.proposal-active-call__rail {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0 0.28rem 0 0.45rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(184, 160, 130, 0.45);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ----------------------------------------------------------
   Pause button — pill border style (amber shading)
   ---------------------------------------------------------- */
.proposal-btn--pause {
    background: #F5EDDF;
    color: #7A4A1A;
    border: 1.5px solid #C9A06A;
    border-radius: 999px;
    font-weight: 700;
}

.proposal-btn--pause:hover:not(:disabled) {
    background: #EBE0CE;
    border-color: #A8843E;
    color: #5E3512;
}

.proposal-btn--pause:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Stop button — pill border style (rose shading)
   ---------------------------------------------------------- */
.proposal-btn--stop {
    background: #F5E4E4;
    color: #7A2222;
    border: 1.5px solid #C47070;
    border-radius: 999px;
    font-weight: 700;
}

.proposal-btn--stop:hover:not(:disabled) {
    background: #EDD4D4;
    border-color: #A84444;
    color: #5E1818;
}

.proposal-btn--stop:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Controls bar — absolute overlay owned by .proposal-layout so it spans
   main + sidebar while main content still scrolls underneath.
   ---------------------------------------------------------- */
.proposal-controls-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    position: absolute;
    top: 46px;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 45;
    min-height: var(--proposal-controls-bar-height);
    padding: 0.75rem 2.5rem 0.35rem;
    border-radius: 0 0 18px 18px;
    border: none;
    border-bottom: 1px solid rgba(196, 175, 150, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 38%, rgba(255, 255, 255, 0.04) 100%),
        rgba(245, 243, 237, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 10px 28px rgba(68, 52, 37, 0.07);
    backdrop-filter: blur(22px) saturate(1.24);
    -webkit-backdrop-filter: blur(22px) saturate(1.24);
}

.proposal-controls-bar__left {
    display: none;
    pointer-events: none;
}

.proposal-controls-bar__toggles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    flex: none;
    min-width: 0;
}

.proposal-controls-bar__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
}

.proposal-controls-bar .proposal-btn--primary {
    padding: 0.45rem 0.82rem;
    font-size: 0.8rem;
}

.proposal-controls-bar .proposal-view-toggle {
    padding: 0.18rem;
}

.proposal-controls-bar .proposal-view-toggle__btn {
    padding: 0.28rem 0.68rem;
    font-size: 0.8rem;
}

.proposal-view-toggle--main-switch {
    position: relative;
}

/* ----------------------------------------------------------
   Sub-toggle: expands below the main toggle when in perguntas
   ---------------------------------------------------------- */
.proposal-subtoggle {
    position: relative;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.24s ease, opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    padding-top: 0;
    padding-left: 9.5rem;
    margin-top: 0;
    overflow: hidden;
}

.proposal-subtoggle--open {
    max-height: 52px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 0.18rem;
}

.proposal-subtoggle--open::before {
    content: "";
    position: absolute;
    left: 9rem;
    top: 0;
    width: 0.9rem;
    height: 0.9rem;
    border-left: 1.5px solid #d7d1c8;
    border-bottom: 1.5px solid #d7d1c8;
    border-bottom-left-radius: 10px;
    opacity: 1;
}

/* Sub-toggle: visual styling when expanded below the main toggle */
.proposal-controls-bar__toggles .proposal-subtoggle--open .proposal-view-toggle {
    border-radius: 999px;
    background: #f4f1eb;
    border-color: #dfd8ce;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.proposal-controls-bar__toggles .proposal-subtoggle--open .proposal-view-toggle__btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.68rem;
}

.proposal-controls-bar__toggles .proposal-subtoggle--open .proposal-view-toggle__btn:not(.proposal-view-toggle__btn--active) {
    filter: saturate(0.7) blur(0.8px);
}

.proposal-controls-bar__toggles .proposal-subtoggle--open .proposal-view-toggle--subsection {
    position: relative;
}

.proposal-controls-bar__toggles .proposal-subtoggle--open .proposal-view-toggle--subsection::before {
    content: "em Perguntas";
    position: absolute;
    left: 0.7rem;
    top: -0.9rem;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #8a8378;
    pointer-events: none;
}

/* ----------------------------------------------------------
   Perguntas placeholder card (when no perguntas generated yet)
   ---------------------------------------------------------- */
.proposal-perguntas-placeholder {
    margin-top: 0.5rem;
    background: #ffffff;
    border: 1px dashed #d8d8d2;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.proposal-perguntas-placeholder__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 360px;
    margin: 0 auto;
}

.proposal-perguntas-placeholder__icon {
    width: 40px;
    height: 40px;
    color: #c8c8c2;
}

.proposal-perguntas-placeholder__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b6b64;
    margin: 0;
}

.proposal-perguntas-placeholder__text {
    font-size: 0.82rem;
    color: #9a9a92;
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
   MÓDULOS GRID — aba Perguntas
   ============================================================ */

/* Paleta de cores dos módulos (índice 0–12) */
:root {
  --modulo-cor-0:  oklch(45% 0.09 250); /* Dados do contrato — azul */
  --modulo-cor-1:  oklch(45% 0.09 160); /* Funções — verde-teal */
  --modulo-cor-2:  oklch(45% 0.08 140); /* Remuneração — verde */
  --modulo-cor-3:  oklch(47% 0.09 42);  /* Jornada — laranja */
  --modulo-cor-4:  oklch(43% 0.09 24);  /* Adicionais legais — vermelho-laranja */
  --modulo-cor-5:  oklch(42% 0.08 12);  /* Saúde — vermelho */
  --modulo-cor-6:  oklch(44% 0.08 330); /* Estabilidades — rosa */
  --modulo-cor-7:  oklch(42% 0.08 300); /* Assédio — roxo */
  --modulo-cor-8:  oklch(47% 0.08 220); /* Benefícios — azul-claro */
  --modulo-cor-9:  oklch(45% 0.08 200); /* Provas — ciano */
  --modulo-cor-10: oklch(44% 0.08 270); /* Identificação — índigo */
  --modulo-cor-11: oklch(42% 0.08 280); /* Addon — roxo-escuro */
  --modulo-cor-12: oklch(50% 0.08 80);  /* Fora do Roteiro — âmbar */

  /* Ponto de origem da animação de expansão */
  --modulo-origin-x: 50vw;
  --modulo-origin-y: 50vh;
}

/* ── Grid container ───────────────────────────────────────── */
.proposal-modulos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.95rem;
  padding: 0.65rem 0 1.25rem;
}

@media (max-width: 899px) and (min-width: 600px) {
  .proposal-modulos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  .proposal-modulos-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

/* ── Card colapsado ───────────────────────────────────────── */
.proposal-modulo-card {
  position: relative;
  isolation: isolate;
  border: 1px solid color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 24%, var(--color-border) 76%);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    opacity 0.2s ease;
  background: var(--color-card);
  box-shadow:
    0 1px 1px rgba(40, 32, 24, 0.04),
    0 10px 24px rgba(40, 32, 24, 0.08);
  min-height: 144px;
  display: flex;
  flex-direction: column;
  outline: none;
}

.proposal-modulo-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 0.46rem;
  background:
    linear-gradient(180deg,
      color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 92%, white 8%),
      color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 72%, var(--color-accent) 28%));
  box-shadow: 0.34rem 0 1.3rem color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 20%, transparent);
}

.proposal-modulo-card::after {
  content: none;
}

.proposal-modulo-card:hover,
.proposal-modulo-card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 46%, var(--color-border) 54%);
  box-shadow:
    0 2px 2px rgba(40, 32, 24, 0.04),
    0 16px 34px rgba(40, 32, 24, 0.12),
    0 0 0 4px color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 16%, transparent);
}

/* Quando outro card está expandido: dim */
.proposal-modulos-grid--has-expanded .proposal-modulo-card {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
}

/* ── Header do card ───────────────────────────────────────── */
.proposal-modulo-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.95rem 1rem 0.45rem 1.25rem;
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 0.92rem;
  gap: 0.55rem;
  background: transparent;
  min-height: 62px;
}

.proposal-modulo-card__title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-family);
  font-size: 1.16rem;
  line-height: var(--lh-snug);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
  color: var(--color-primary-dark);
}

.proposal-modulo-card__chevron {
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin-top: 0.02rem;
  background: transparent;
  color: color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 70%, var(--color-primary-dark) 30%);
  font-size: 0.78rem;
  opacity: 0.78;
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.proposal-modulo-card:hover .proposal-modulo-card__chevron,
.proposal-modulo-card:focus-visible .proposal-modulo-card__chevron {
  transform: translateX(2px);
  opacity: 1;
}

/* Bullet de sugestão IA */
.proposal-modulo-card__ai-dot {
  width: 9px;
  height: 9px;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: color-mix(in oklch, var(--color-accent) 88%, white 12%);
  box-shadow:
    0 0 0 4px color-mix(in oklch, var(--color-accent) 18%, transparent),
    0 0 14px color-mix(in oklch, var(--color-accent) 42%, transparent);
  flex-shrink: 0;
  animation: ai-dot-pulse 2s ease-in-out 3;
}

@keyframes ai-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.62; transform: scale(0.76); }
}

/* ── Corpo do card ────────────────────────────────────────── */
.proposal-modulo-card__body {
  position: relative;
  padding: 0.6rem 1rem 0.95rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
}

.proposal-modulo-card__contador {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Barra de progresso */
.proposal-modulo-card__progress {
  position: relative;
  height: 0.38rem;
  background: color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 9%, var(--color-border-light) 91%);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(40, 32, 24, 0.08);
}

.proposal-modulo-card__progress-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 92%, var(--color-primary-dark) 8%),
      color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 76%, var(--color-accent) 24%));
  transition: width 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.proposal-modulo-card__progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-120%);
  transition: transform 0.62s ease;
}

.proposal-modulo-card:hover .proposal-modulo-card__progress-fill::after,
.proposal-modulo-card:focus-visible .proposal-modulo-card__progress-fill::after {
  transform: translateX(120%);
}

/* ── Estados do card ──────────────────────────────────────── */

/* Completo */
.proposal-modulo-card--complete .proposal-modulo-card__progress-fill {
  background: oklch(55% 0.15 155);
}
.proposal-modulo-card--complete {
  border-color: color-mix(in oklch, var(--color-success) 34%, var(--color-border) 66%);
  background: var(--color-card);
}

.proposal-modulo-card--complete::before {
  background:
    linear-gradient(180deg,
      color-mix(in oklch, var(--color-success) 88%, white 12%),
      color-mix(in oklch, var(--color-success) 62%, var(--color-accent) 38%));
}

/* Addon */
.proposal-modulo-card--addon {
  border-style: double;
  background: var(--color-card);
}

/* Fora do Roteiro */
.proposal-modulo-card--fora-roteiro {
  border-style: dashed;
  background: var(--color-card);
}

/* ── Accordion mobile (< 600px) ───────────────────────────── */
@media (max-width: 599px) {
  .proposal-modulo-card {
    min-height: auto;
    border-radius: 8px;
  }

  .proposal-modulo-card__header {
    padding: 0.72rem 0.82rem 0.35rem 1.08rem;
    font-size: 0.8rem;
    min-height: 48px;
  }

  .proposal-modulo-card__title {
    font-size: 1.08rem;
  }

  .proposal-modulo-card__body {
    padding: 0.35rem 0.82rem 0.72rem 1.08rem;
  }

  /* Corpo expandido mobile — inline */
  .proposal-modulo-card__accordion-body {
    padding: 0.6rem 0.82rem 0.85rem 1.08rem;
    border-top: 1px solid color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 16%, var(--color-border-light) 84%);
    background: color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 5%, transparent);
  }
}

/* ── Módulo expandido: variação do approval-modal de Documentos ─ */
.proposal-modulos-overlay {
  z-index: 270;
}

.proposal-modulo-expanded {
  border-left: 4px solid var(--modulo-cor, var(--color-primary));
}

.proposal-modulo-expanded--closing {
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* Header do card expandido */
.proposal-modulo-expanded__header {
  background: linear-gradient(
    180deg,
    color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 8%, var(--color-card) 92%) 0%,
    color-mix(in oklch, var(--modulo-cor, oklch(45% 0.08 250)) 3%, var(--color-card) 97%) 100%
  );
}

.proposal-modulo-expanded__title {
  font-size: 1rem;
}

.proposal-modulo-expanded__contador-detail {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Corpo scrollável do card expandido */
.proposal-modulo-expanded__body {
  min-height: 0;
}

/* Sub-seção dentro do card expandido */
.proposal-modulo-secao-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  padding: 0.75rem 0 0.35rem;
  border-bottom: 1px solid #e8e0d4;
  margin-bottom: 0.5rem;
  position: sticky;
  top: calc(-1 * var(--space-3));
  background: #f7f2e8;
  z-index: 1;
}

/* Sub-seção especial: sugeridas pela IA */
.proposal-modulo-secao--sugeridas {
  background: oklch(97% 0.06 80);
  border-radius: 8px;
  padding: 0.5rem 0.75rem 0.6rem;
  margin-bottom: 0.75rem;
  border: 1px solid oklch(88% 0.08 80);
}

.proposal-modulo-secao--sugeridas .proposal-modulo-secao-header {
  background: oklch(97% 0.06 80);
  color: oklch(45% 0.12 80);
  border-bottom-color: oklch(88% 0.08 80);
}

/* ── Bell de recomendações addon ──────────────────────────── */
.proposal-modulos-addon-bell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  background: oklch(95% 0.08 80);
  border: 1px solid oklch(82% 0.12 80);
  color: oklch(40% 0.12 80);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.75rem;
}

.proposal-modulos-addon-bell:hover {
  background: oklch(90% 0.1 80);
}

.proposal-addon-popover {
  background: #fff;
  border: 1px solid #e0d9ce;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-width: 320px;
  font-size: 0.82rem;
}

.proposal-addon-popover__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.proposal-addon-popover__accept {
  background: var(--modulo-cor-11);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.proposal-addon-popover__dismiss {
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #666;
}

/* ── Filtros da aba ───────────────────────────────────────── */
.proposal-modulos-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.proposal-modulos-filter-chip {
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  border: 1px solid #d0c9be;
  background: #f7f2e8;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: #555;
}

.proposal-modulos-filter-chip--active {
  background: oklch(30% 0.05 250);
  border-color: oklch(30% 0.05 250);
  color: #fff;
}

/* ── Chips de módulos concluídos (quando hideCompleted) ───── */
.proposal-modulos-completed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.proposal-modulo-chip-completo {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  background: oklch(93% 0.03 162);
  border: 1px solid oklch(80% 0.06 162);
  color: oklch(40% 0.1 162);
  cursor: pointer;
}

/* ── prefers-reduced-motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .proposal-modulo-card:hover { transform: none; }
  .proposal-modulo-card,
  .proposal-modulo-card::after,
  .proposal-modulo-card__chevron,
  .proposal-modulo-card__progress-fill,
  .proposal-modulo-card__progress-fill::after,
  .proposal-transition--enter,
  .proposal-transition--leave {
    transition: none;
  }
  .proposal-modulo-card__ai-dot { animation: none; }
  .proposal-modulo-card:hover .proposal-modulo-card__progress-fill::after,
  .proposal-modulo-card:focus-visible .proposal-modulo-card__progress-fill::after {
    transform: translateX(-120%);
  }
  .proposal-modulo-expanded { animation: none; opacity: 1; transform: scale(1); }
  .proposal-modulo-expanded--closing { animation: none; }
}
