:root {
    --background: #ffffff;
    --surface: #ffffff;
    --surface-secondary: #f7f8fa;
    --text-primary: #17191d;
    --text-secondary: #7c838e;
    --border: #eceef1;
    --primary: #2864e8;
    --primary-soft: #edf3ff;
    --feed-bg: #f0f2f5;
    --danger: #c43d4c;
    --success: #23805c;
    --shadow: 0 12px 35px rgba(23, 30, 45, .09);
    --bottom-nav-height: 60px;
    font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-primary);
    background: var(--background);
}

* { box-sizing: border-box; }
/* Mantener el desplazamiento con rueda, teclado y gestos sin mostrar barras. */
html, body, .app-shell, .desktop-sidebar, .feed, .reminders-view,
.feed-filter-bar, .profile-dialog, .transcribe-text-box, .modal-dialog-form, textarea {
    scrollbar-width: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar,
.app-shell::-webkit-scrollbar, .desktop-sidebar::-webkit-scrollbar,
.feed::-webkit-scrollbar, .reminders-view::-webkit-scrollbar,
.feed-filter-bar::-webkit-scrollbar, .profile-dialog::-webkit-scrollbar,
.transcribe-text-box::-webkit-scrollbar, .modal-dialog-form::-webkit-scrollbar,
textarea::-webkit-scrollbar { display: none; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--feed-bg); touch-action: manipulation; }
body { margin: 0; min-height: 100dvh; background: var(--feed-bg); touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, textarea, input, select, a { font: inherit; touch-action: manipulation; }
input, textarea { font-size: 16px !important; }
button { border: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid rgba(40, 100, 232, .22); outline-offset: 2px; }

.app-shell {
    height: 100dvh;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.app-top-bar {
    position: sticky;
    top: 0;
    z-index: 25;
    flex-shrink: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: max(12px, calc(6px + env(safe-area-inset-top)));
    padding-bottom: 10px;
    padding-left: 16px;
    padding-right: 16px;
    background: #ffffff;
}
.brand-lockup { display: flex; flex-direction: column; gap: 1px; }
.brand-lockup h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-family: "Plus Jakarta Sans", -apple-system-rounded, "SF Pro Rounded", system-ui, sans-serif;
    color: var(--text-primary);
}
.brand-lockup .header-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.eyebrow { margin: 0 0 5px; color: var(--text-secondary); font-size: 10px; font-weight: 750; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text-secondary); background: transparent; border-radius: 50%; }
.icon-button:hover { color: var(--text-primary); background: var(--surface-secondary); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-button.small { width: 32px; height: 32px; font-size: 25px; font-weight: 300; line-height: 1; }
#search-toggle { background: var(--surface-secondary); color: var(--text-primary); }
#search-toggle:hover { background: #eceef2; }
.avatar { width: 32px; height: 32px; color: #fff; background: var(--text-primary); background-size: cover; background-position: center; border-radius: 50%; font-size: 12px; font-weight: 700; }
.avatar.has-picture { color: transparent; box-shadow: inset 0 0 0 1px rgba(15, 20, 32, .08); }

.search-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 20px 12px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(23, 25, 29, .05);
    animation: search-in .2s ease-out both;
}
@keyframes search-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.search-bar > svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: var(--text-secondary);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.search-bar input {
    width: 100%;
    min-width: 0;
    padding: 3px 0;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
}
.search-bar input::placeholder {
    color: #9aa0aa;
}
.search-filters-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.search-filters-wrap::-webkit-scrollbar {
    display: none;
}
.search-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--surface-secondary);
    border-radius: 999px;
}
.filter-pill {
    padding: 6px 15px;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 550;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: all .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.filter-pill:hover {
    color: var(--text-primary);
}
.filter-pill.active {
    color: var(--text-primary);
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.feed {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 20px calc(76px + var(--bottom-nav-height) + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    background-color: var(--feed-bg);
}

.feed-watermark {
    position: fixed;
    top: calc(50% - 25px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(230px, 52vw);
    height: min(230px, 52vw);
    background-image: url('superyo-logo.png?v=4');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.10;
    pointer-events: none;
    z-index: 0;
}

#feed-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.empty-state {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-height: min(44vh, 320px);
    padding: 36px 20px;
    margin: 20px 0;
    text-align: center;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .04);
}
.empty-logo-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(23, 25, 29, .06);
}
.empty-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.empty-state h2 { margin-bottom: 8px; font-size: 19px; font-weight: 750; letter-spacing: -.025em; color: var(--text-primary); }
.empty-state p { margin-bottom: 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.4; }

.date-label {
    display: inline-flex;
    align-self: center;
    align-items: center;
    gap: 6px;
    margin: 16px auto 10px;
    padding: 4px 14px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 999px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.date-label::after { display: none; }
.pinned-label {
    background: rgba(40, 100, 232, .12);
    color: var(--primary);
}

/* Item swipe wrapper and action cards */
.item-wrapper {
    position: relative;
    margin-bottom: 10px;
    border-radius: 16px;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.item-wrapper.swiping-right {
    background: #2563eb !important;
}

.item-wrapper.swiping-left {
    background: #e11d48 !important;
}

.item-wrapper.is-dragging,
.item-wrapper.swiping-right,
.item-wrapper.swiping-left {
    overflow: hidden !important;
}

.item-wrapper.menu-open {
    overflow: visible !important;
    z-index: 40 !important;
}

.swipe-action-card {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #ffffff;
    font-weight: 800;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-sizing: border-box;
    z-index: 1;
    pointer-events: none;
    padding: 6px;
    opacity: 0;
    transform: scale(0.92);
    will-change: opacity, transform, background-color;
    transition: opacity .12s ease, transform .15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color .15s ease;
}

.swipe-action-card svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.swipe-action-pin {
    left: 0;
    background: #2563eb;
    border-radius: 16px 0 0 16px;
}

.swipe-action-delete {
    right: 0;
    background: #e11d48;
    border-radius: 0 16px 16px 0;
}

.item-wrapper.swiping-right .swipe-action-pin {
    opacity: 1;
    transform: scale(1);
}

.item-wrapper.swiping-left .swipe-action-delete {
    opacity: 1;
    transform: scale(1);
}

.item-wrapper.threshold-reached .swipe-action-pin {
    background: #1d4ed8;
}

.item-wrapper.threshold-reached .swipe-action-delete {
    background: #be123c;
}

.item-wrapper.is-dragging .swipe-action-card {
    transition: none !important;
}

.item img,
.item-media,
.item-media-btn,
.event-image-thumb {
    -webkit-user-drag: none;
    user-drag: none;
}

.item {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: 16px;
    padding: 13px 15px 9px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(15, 45, 90, .07);
    touch-action: pan-y;
    will-change: transform;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .28s cubic-bezier(0.2, 0.9, 0.3, 1), border-color .15s ease, box-shadow .15s ease;
}
.item-wrapper.is-dragging .item {
    transition: none !important;
    cursor: grabbing !important;
}
.item:hover {
    box-shadow: 0 4px 14px rgba(15, 45, 90, .10);
}
.item.pinned {
    border: 2px solid var(--primary);
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(40, 100, 232, .15);
}
.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.pin-badge svg {
    flex: none;
}
.item-body {
    min-width: 0;
}
.item-text {
    margin: 0;
    color: var(--text-primary);
    font-size: 15.5px;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding-right: 24px;
}

.item-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 5px;
}
.item-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.item-status { color: var(--success); }
.item-status.failed { color: var(--danger); }
.item-status.sending { color: var(--text-secondary); }

.item-tools {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 25;
}
.item-menu {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #9aa0aa;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    transition: color .15s ease, background-color .15s ease;
}
.item-menu:hover {
    color: var(--text-primary);
    background: var(--surface-secondary);
}
.item-actions {
    position: absolute;
    z-index: 50;
    top: 32px;
    right: 0;
    display: grid;
    min-width: 145px;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 45, 90, .16), 0 2px 8px rgba(0, 0, 0, .08);
}
.item-actions button,
.item-actions a {
    display: block;
    width: 100%;
    padding: 9px 11px;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 550;
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color .12s ease;
}
.item-actions button:hover,
.item-actions a:hover {
    background: var(--surface-secondary);
}
.item-actions .delete-action {
    color: var(--danger);
}

.item-media {
    margin-bottom: 7px;
    border-radius: 14px;
    overflow: hidden;
    width: fit-content;
    max-width: 100%;
    position: relative;
    cursor: pointer;
}
.item-media-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    position: relative;
    overflow: hidden;
}
.item-image {
    display: block;
    width: 100%;
    max-width: 520px;
    max-height: 420px;
    height: auto;
    object-fit: contain;
    border-radius: 13px;
    transition: transform .2s ease, opacity .15s ease;
}
.item-media-btn:hover .item-image {
    transform: scale(1.03);
    opacity: .95;
}
.item-media-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .2);
    opacity: 0;
    transition: opacity .15s ease;
    color: #fff;
    pointer-events: none;
}
.item-media-btn:hover .item-media-overlay {
    opacity: 1;
}
.item-media-overlay svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .5));
}

/* Image Viewer Modal Fullscreen */
body.viewer-open {
    overflow: hidden !important;
}

.image-viewer-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: viewer-fade-in .2s ease-out both;
}

@keyframes viewer-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, .94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.image-viewer-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    pointer-events: none;
}

.image-viewer-content > * {
    pointer-events: auto;
}

.image-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent);
}

.image-viewer-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, transform .12s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-viewer-btn:hover {
    background: rgba(255, 255, 255, .28);
    transform: scale(1.05);
}

.image-viewer-btn:active {
    transform: scale(.93);
}

.image-viewer-btn.danger:hover {
    background: rgba(196, 61, 76, .85);
    border-color: rgba(196, 61, 76, .9);
}

.image-viewer-btn svg {
    width: 20px;
    height: 20px;
}

.image-viewer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-viewer-body {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
}

.viewer-image {
    max-width: 96vw;
    max-height: calc(100vh - 165px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 14px 50px rgba(0, 0, 0, .6);
    animation: viewer-scale-in .22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes viewer-scale-in {
    from { transform: scale(.93); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.viewer-info-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    width: min(calc(100vw - 32px), 320px);
    padding: 16px 18px;
    color: #ffffff;
    background: rgba(24, 27, 34, .94);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: panel-in .2s ease-out both;
    z-index: 10;
}

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

.viewer-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    padding-bottom: 8px;
}

.viewer-info-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.viewer-info-header button {
    color: rgba(255, 255, 255, .7);
    background: transparent;
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.viewer-info-header button:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.viewer-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.viewer-info-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, .7);
}

.viewer-info-list li strong {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.image-viewer-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
    text-align: center;
}

.viewer-caption {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 650px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.viewer-time {
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.file-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-secondary);
    border-radius: 12px;
    margin-bottom: 6px;
}
.file-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 46px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.file-info {
    min-width: 0;
    flex: 1;
}
.file-name {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 650;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-size {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}
.file-download {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    text-decoration: none;
    flex-shrink: 0;
    transition: background .15s ease, transform .15s ease;
}
.file-download:hover {
    background: var(--primary-soft);
    transform: scale(1.05);
}

/* Document Preview Card (shows top half of page 1 + info) */
.doc-preview-card {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
    margin-bottom: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.doc-preview-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
}
.doc-preview-viewport {
    position: relative;
    width: 100%;
    height: 240px;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    cursor: pointer;
}
.doc-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    background: #ffffff;
    transition: transform 0.2s ease;
}
.doc-preview-viewport:hover .doc-preview-img {
    transform: scale(1.02);
}
.doc-page-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.02em;
    z-index: 2;
}
.doc-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}
.doc-fade-overlay::after {
    content: "Página 1";
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 10px;
    border-radius: 99px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.doc-text-viewport {
    background: #fafaf9;
    padding: 14px;
    height: 200px;
    box-sizing: border-box;
    display: block;
}
.doc-text-content {
    margin: 0;
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11.5px;
    line-height: 1.5;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    overflow: hidden;
}

/* Realistic A4 Document Sheet Preview (Fallback & Office Docs) */
.doc-sheet-mockup {
    width: 88%;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border-radius: 4px 4px 0 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    padding: 18px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.doc-sheet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 9px;
}
.doc-sheet-type-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.doc-sheet-type-pill.pdf { background: #fee2e2; color: #dc2626; }
.doc-sheet-type-pill.doc,
.doc-sheet-type-pill.docx { background: #dbeafe; color: #1d4ed8; }
.doc-sheet-type-pill.xls,
.doc-sheet-type-pill.xlsx { background: #dcfce7; color: #15803d; }
.doc-sheet-type-pill.ppt,
.doc-sheet-type-pill.pptx { background: #ffedd5; color: #c2410c; }
.doc-sheet-type-pill.file { background: #f1f5f9; color: #475569; }
.doc-sheet-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.doc-sheet-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0.65;
}
.doc-sheet-line {
    height: 7px;
    border-radius: 4px;
    background: #e2e8f0;
}
.doc-sheet-line.title-line {
    height: 12px;
    width: 60%;
    background: #cbd5e1;
    margin-bottom: 4px;
}
.doc-sheet-line.full { width: 100%; }
.doc-sheet-line.medium { width: 75%; }
.doc-sheet-line.short { width: 45%; }
.doc-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.doc-icon-badge {
    display: grid;
    place-items: center;
    width: 38px;
    height: 42px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    flex-shrink: 0;
}
.doc-icon-badge.pdf {
    background: #fee2e2;
    color: #dc2626;
}
.doc-icon-badge.txt,
.doc-icon-badge.doc,
.doc-icon-badge.docx {
    background: #e0e7ff;
    color: #4338ca;
}
.doc-icon-badge.xls,
.doc-icon-badge.xlsx,
.doc-icon-badge.csv {
    background: #dcfce7;
    color: #15803d;
}
.doc-icon-badge.ppt,
.doc-icon-badge.pptx {
    background: #ffedd5;
    color: #c2410c;
}
.doc-icon-badge.file {
    background: var(--primary-soft);
    color: var(--primary);
}
.doc-info-text {
    flex: 1;
    min-width: 0;
}
.doc-info-text .file-name {
    margin: 0 0 2px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-info-text .file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* File Preview Card (Media preview + filename + download) */
.file-preview-card {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
    margin-bottom: 6px;
}
.file-media-preview {
    position: relative;
    width: 100%;
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.file-image-preview {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}
.file-video-preview video {
    width: 100%;
    max-height: 280px;
    display: block;
    background: #000;
}
.file-preview-card .file-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.link-card {
    display: block;
    margin-bottom: 6px;
    padding: 11px 13px;
    color: inherit;
    text-decoration: none;
    background: var(--surface-secondary);
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background .15s ease, border-color .15s ease;
}
.link-card:hover {
    background: #f0f2f5;
    border-color: var(--border);
}
.link-title {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 650;
}
.link-url {
    color: var(--primary);
    font-size: 12.5px;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.offline-banner { position: fixed; z-index: 5; right: 20px; bottom: calc(128px + var(--bottom-nav-height) + env(safe-area-inset-bottom)); left: 20px; max-width: 1040px; margin: auto; padding: 9px 12px; color: #72530c; background: #fff9e8; border: 1px solid #f5e4ac; border-radius: 10px; font-size: 12px; text-align: center; box-shadow: var(--shadow); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: #d89e17; border-radius: 50%; }
.composer-wrap { position: fixed; z-index: 4; right: 0; bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); left: 0; padding: 9px 16px 10px; background: rgba(255, 255, 255, .96); border-top: 1px solid rgba(236, 238, 241, .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.composer-wrap > * { width: min(100%, 1040px); margin-right: auto; margin-left: auto; }

.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.composer-icon-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--text-secondary);
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}

.composer-icon-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(40, 100, 232, .25);
}

.composer-icon-btn:active {
    transform: scale(.93);
}

.composer-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.composer-icon-btn.attach-btn {
    color: var(--primary);
    background: var(--surface-secondary);
}

.composer-icon-btn.attach-btn:hover {
    background: var(--primary-soft);
}

.composer-icon-btn.attach-btn svg {
    stroke-width: 2.2;
}

.composer-input-box {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 22px;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
}

.composer-input-box:focus-within {
    border-color: rgba(40, 100, 232, .35);
    box-shadow: 0 0 0 3px rgba(40, 100, 232, .08);
}

#message-input {
    display: block;
    width: 100%;
    flex: 1;
    min-width: 0;
    max-height: 120px;
    height: 24px;
    padding: 0;
    margin: 0;
    resize: none;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 16px !important;
    line-height: 24px;
    box-sizing: border-box;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

#message-input::placeholder {
    color: #9aa0aa;
    line-height: 24px;
}

.composer-side-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.send-button {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    padding: 0;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity .15s, transform .15s, background-color .15s;
}

.send-button:disabled {
    opacity: .35;
    cursor: default;
}

.send-button:not(:disabled):hover {
    background: #1f54cb;
    transform: translateY(-1px);
}

.send-button:active {
    transform: scale(.93);
}

.send-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* Grabación de Audio */
.audio-recording-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 3px 6px 3px 14px;
    background: var(--surface-secondary);
    border: 1px solid rgba(196, 61, 76, .35);
    border-radius: 22px;
    box-shadow: 0 0 0 3px rgba(196, 61, 76, .08);
    animation: record-in .2s ease-out both;
}

@keyframes record-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

@keyframes recording-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.85); }
}

.recording-timer {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--danger);
}

.recording-label {
    flex: 1;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recording-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-cancel-btn {
    width: 38px;
    height: 38px;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
}

.record-cancel-btn:hover {
    color: var(--danger);
    background: #fdebee;
}

.record-send-btn {
    width: 38px;
    height: 38px;
}

/* Mensajes de Audio en el Feed */
.item-audio {
    margin-bottom: 6px;
    padding: 10px 14px;
    background: var(--surface-secondary);
    border-radius: 14px;
    border: 1px solid var(--border);
    min-width: 0;
    max-width: 380px;
    box-sizing: border-box;
    margin-right: 24px;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-play-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    transition: transform .12s ease, background-color .15s ease;
}

.audio-play-btn:hover {
    background: #1f54cb;
    transform: scale(1.05);
}

.audio-play-btn:active {
    transform: scale(.93);
}

.audio-play-btn svg {
    width: 18px;
    height: 18px;
}

.audio-play-btn svg[hidden] { display: none; }
.audio-element { display: none; }
.audio-speed-btn {
    flex: 0 0 48px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.audio-speed-btn:hover { background: #dce8ff; }
.audio-play-btn:focus-visible,
.audio-speed-btn:focus-visible,
.audio-slider:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}
.audio-play-btn:disabled { opacity: .5; cursor: wait; }

.audio-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audio-timeline {
    width: 100%;
    display: flex;
    align-items: center;
}

.audio-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) var(--audio-progress, 0%), #dfe3ea var(--audio-progress, 0%));
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 0;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.audio-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.audio-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.audio-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}


.attachment-preview { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; padding: 7px 10px; background: var(--primary-soft); border-radius: 10px; font-size: 12px; }
.attachment-preview img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.attachment-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview button { color: var(--text-secondary); background: transparent; font-size: 18px; }

.sheet-backdrop { position: fixed; z-index: 30; inset: 0; background: rgba(15, 18, 24, .38); backdrop-filter: blur(2px); }
.bottom-sheet { position: fixed; z-index: 31; right: 0; bottom: 0; left: 0; max-width: 540px; margin: auto; padding: 12px 18px calc(24px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 45px rgba(15, 20, 32, .18); animation: sheet-in .22s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; margin: 2px auto 18px; background: #dce0e6; border-radius: 99px; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; }
.sheet-heading h2 { margin-bottom: 0; font-size: 19px; font-weight: 750; letter-spacing: -.025em; }

.sheet-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 10px;
    padding: 6px 2px 8px;
}
.sheet-grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 10px 4px;
    background: transparent;
    border: 0;
    border-radius: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color .15s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.sheet-grid-btn:hover {
    background: var(--surface-secondary);
}
.sheet-grid-btn:active {
    transform: scale(0.93);
}
.sheet-grid-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    transition: transform .15s ease;
}
.sheet-grid-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sheet-grid-label {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1.2;
}

/* Colores de los íconos de la grilla */
.sheet-grid-icon.peach { color: #d95b32; background: #fff0eb; }
.sheet-grid-icon.blue { color: #2563eb; background: #eff6ff; }
.sheet-grid-icon.lilac { color: #7c3aed; background: #f5f3ff; }
.sheet-grid-icon.emerald { color: #059669; background: #ecfdf5; }
.sheet-grid-icon.amber { color: #d97706; background: #fffbeb; }
.sheet-grid-icon.teal { color: #0d9488; background: #f0fdfa; }
.sheet-grid-icon.rose { color: #e11d48; background: #fff1f2; }
.sheet-grid-icon.indigo { color: #4f46e5; background: #eef2ff; }
.sheet-grid-icon.cyan { color: #0891b2; background: #ecfeff; }

.app-dialog { width: min(calc(100% - 32px), 430px); padding: 22px; color: var(--text-primary); background: var(--surface); border: 0; border-radius: 20px; box-shadow: 0 20px 70px rgba(15, 20, 32, .22); }
.app-dialog::backdrop { background: rgba(15, 18, 24, .38); backdrop-filter: blur(2px); }

.profile-dialog { position: relative; max-height: min(720px, calc(100dvh - 32px)); overflow-y: auto; }
.profile-close { position: absolute; top: 12px; right: 12px; display: grid; width: 32px; height: 32px; place-items: center; color: var(--text-secondary); background: var(--surface-secondary); border-radius: 50%; font-size: 21px; line-height: 1; }
.profile-security-icon { display: grid; width: 48px; height: 48px; margin-bottom: 18px; place-items: center; color: #2563eb; background: #eff6ff; border-radius: 15px; }
.profile-security-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-dialog .dialog-copy { margin: 0 0 20px; line-height: 1.55; }
.google-login-button { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; gap: 10px; color: #1f2937; background: #fff; border: 1px solid #d7dce3; border-radius: 12px; font-size: 14px; font-weight: 700; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.google-login-button:disabled { cursor: not-allowed; opacity: .5; }
.google-g { display: grid; width: 22px; height: 22px; place-items: center; color: #4285f4; font-size: 17px; font-weight: 800; }
.profile-muted { margin: 8px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.profile-user-row { display: flex; align-items: center; gap: 12px; padding-right: 35px; }
.profile-user-row img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.profile-user-row h2 { margin: 1px 0 0; }
.profile-user-row .profile-muted { margin-top: -7px; }
.security-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 14px; background: var(--surface-secondary); border: 1px solid var(--border); border-radius: 14px; }
.security-card strong { font-size: 13px; }
.security-card p { margin: 3px 0 0; color: var(--text-secondary); font-size: 11.5px; }
.security-badge { flex: none; padding: 5px 8px; color: #166534; background: #dcfce7; border-radius: 999px; font-size: 10px; font-weight: 800; }
.security-badge[data-status="pending"] { color: #92400e; background: #fef3c7; }
.security-badge[data-status="locked"], .security-badge[data-status="unsupported"] { color: #991b1b; background: #fee2e2; }
.pairing-code-wrap { margin-top: 14px; padding: 16px; text-align: center; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 14px; }
.pairing-code-wrap p { margin: 4px 0 12px; color: var(--text-secondary); font-size: 12px; }
.pairing-code { display: block; margin: 6px 0; color: var(--text-primary); font-size: 30px; letter-spacing: .18em; }
.pairing-code-wrap small { display: block; color: var(--text-secondary); font-size: 10px; }
.profile-action { margin-top: 12px; padding: 8px 12px; border-radius: 9px; font-size: 12px; }
.device-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.device-section-title { display: flex; align-items: center; justify-content: space-between; }
.device-section-title h3 { margin: 2px 0 0; font-size: 14px; }
.pending-device { display: grid; gap: 10px; margin-top: 10px; padding: 12px; background: var(--surface-secondary); border-radius: 12px; }
.pending-device strong, .pending-device small { display: block; }
.pending-device small { margin-top: 2px; color: var(--text-secondary); font-size: 10px; }
.pending-device-actions { display: flex; gap: 7px; }
.pending-device-actions input { min-width: 0; flex: 1; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font: inherit; letter-spacing: .15em; }
.pending-device-actions button { padding: 8px 11px; color: #fff; background: #2563eb; border-radius: 8px; font-size: 11px; font-weight: 700; }
.profile-notice { margin: 12px 0 0; padding: 10px 12px; color: #1e40af; background: #eff6ff; border-radius: 10px; font-size: 12px; }
.logout-button { width: 100%; margin-top: 18px; padding: 10px; color: #b91c1c; background: transparent; border: 1px solid #fecaca; border-radius: 10px; font-size: 12px; font-weight: 700; }
.legal-links { margin: 12px 0 0; text-align: center; color: var(--text-secondary); font-size: 11px; }
.legal-links a, .legal-back a { color: #2563eb; text-decoration: none; }
.legal-page { min-height: 100vh; margin: 0; padding: 24px 16px; color: var(--text-primary); background: var(--surface-secondary); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.legal-card { width: min(720px, 100%); margin: 0 auto; padding: clamp(22px, 5vw, 48px); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 16px 50px rgba(15, 23, 42, .08); }
.legal-card h1 { margin: 4px 0 4px; font-size: clamp(26px, 5vw, 38px); letter-spacing: -.04em; }
.legal-card h2 { margin: 28px 0 8px; font-size: 17px; }
.legal-card p { color: var(--text-secondary); line-height: 1.7; }
.legal-card .legal-updated { margin-top: 0; font-size: 12px; }
.legal-back { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }

.login-page { display: grid; min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); place-items: center; background: radial-gradient(circle at top left, rgba(68, 125, 255, .12), transparent 34%), radial-gradient(circle at bottom right, rgba(139, 92, 246, .1), transparent 30%), #f7f8fb; }
.login-card { width: min(100%, 430px); padding: 38px 32px 30px; background: rgba(255, 255, 255, .96); border: 1px solid rgba(15, 23, 42, .08); border-radius: 28px; box-shadow: 0 24px 80px rgba(15, 23, 42, .12); }
.login-brand { display: flex; align-items: center; gap: 13px; color: var(--text-primary); font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.login-brand img { width: 52px; height: 52px; object-fit: contain; }
.login-copy { margin: 34px 0 26px; }
.login-copy .eyebrow { margin-bottom: 10px; color: #2563eb; }
.login-copy h1 { max-width: 340px; margin-bottom: 14px; font-size: clamp(31px, 8vw, 42px); line-height: 1.04; letter-spacing: -.055em; }
.login-copy > p:last-child { margin-bottom: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.65; }
.login-google-button { min-height: 54px; text-decoration: none; }
.login-google-button svg { width: 22px; height: 22px; flex: 0 0 auto; }
.login-alert, .login-setup-message { margin: 0 0 15px; padding: 11px 13px; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.login-alert { color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; }
.login-setup-message { margin-top: 12px; margin-bottom: 0; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; text-align: center; }
.login-security { display: flex; align-items: flex-start; gap: 11px; margin-top: 24px; padding-top: 22px; color: var(--text-secondary); border-top: 1px solid var(--border); }
.login-security svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: #2563eb; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-security p { margin: 0; font-size: 11px; line-height: 1.55; }
.login-security strong { color: var(--text-primary); }

@media (max-width: 480px) {
    .login-page { place-items: stretch; padding-right: 0; padding-left: 0; background: #fff; }
    .login-card { align-self: center; padding: 28px 24px; border: 0; border-radius: 0; box-shadow: none; }
}
.app-dialog h2 { margin-bottom: 12px; font-size: 20px; letter-spacing: -.03em; }
.app-dialog textarea { width: 100%; padding: 11px; resize: vertical; color: var(--text-primary); background: var(--surface-secondary); border: 1px solid var(--border); border-radius: 12px; outline: 0; line-height: 1.4; }
.app-dialog textarea:focus { border-color: rgba(40, 100, 232, .5); }
.dialog-copy { color: var(--text-secondary); font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-actions button { padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 650; }
.secondary-button { color: var(--text-secondary); background: var(--surface-secondary); }
.secondary-button:hover { background: #e5e7eb; color: var(--text-primary); }
.primary-button { color: #fff; background: var(--primary); }
.primary-button:hover { background: #1f54cb; }
.danger-button { color: #fff; background: var(--danger); }

/* Modales con formularios */
.modal-dialog-form {
    max-height: 88vh;
    overflow-y: auto;
}
.modal-dialog-form .dialog-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: -6px 0 14px;
}
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: 10px;
}
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: 12px;
    font-weight: 650;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 10px 13px;
    font-size: 15px !important;
    color: var(--text-primary);
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: 0;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(40, 100, 232, .5);
    box-shadow: 0 0 0 3px rgba(40, 100, 232, .1);
}
.input-with-action {
    display: flex;
    align-items: center;
    position: relative;
}
.input-with-action input {
    padding-right: 42px;
}
.input-inline-btn {
    position: absolute;
    right: 6px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--primary);
    border: 0;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
}
.input-inline-btn:hover {
    background: var(--primary-soft);
}
.input-inline-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.timing-selector {
    display: flex;
    gap: 8px;
}
.timing-pill {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s ease;
}
.timing-pill.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(40, 100, 232, .3);
    font-weight: 700;
}
.icon-selector-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.icon-choice {
    display: grid;
    place-items: center;
    height: 42px;
    border-radius: 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s ease;
}
.icon-choice svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
}
.icon-choice.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(40, 100, 232, .2);
}
.color-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
}
.color-choice {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--c-accent);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #d1d5db;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.color-choice.active {
    transform: scale(1.18);
    box-shadow: 0 0 0 2.5px var(--c-accent);
}
.file-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.file-picker-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.event-photo-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    position: relative;
}
.event-photo-preview img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.event-photo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #17191d;
    color: #fff;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    cursor: pointer;
}

/* Feed cards para Contacto con botones inferiores */
.item-contact {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
    margin-bottom: 6px;
    gap: 12px;
}
.contact-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    display: grid;
    place-items: center;
    font-size: 17px;
    font-weight: 800;
    flex-shrink: 0;
}
.contact-details {
    flex: 1;
    min-width: 0;
}
.contact-name {
    font-size: 15px;
    font-weight: 750;
    margin: 0 0 3px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.contact-phone-sub,
.contact-email-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.contact-phone-sub svg,
.contact-email-sub svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}
.contact-notes-sub {
    font-size: 11.5px;
    color: #64748b;
    margin: 2px 0 0;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.contact-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 10px;
}
.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.contact-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}
.contact-btn:active {
    transform: translateY(0);
}
.contact-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.contact-btn-call {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}
.contact-btn-call:hover {
    background: #dbeafe;
}
.contact-btn-wa {
    background: #ecfdf5;
    color: #15803d;
    border-color: #d1fae5;
}
.contact-btn-wa:hover {
    background: #dcfce7;
}
.contact-btn-mail {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ede9fe;
}
.contact-btn-mail:hover {
    background: #ede9fe;
}
.contact-btn-save {
    background: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
}
.contact-btn-save:hover {
    background: #f1f5f9;
}
.contact-action-grid:has(> :nth-child(3):last-child) > :last-child {
    grid-column: span 2;
}

.item-event {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.event-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #be123c;
    background: #fff1f2;
    padding: 3px 10px;
    border-radius: 999px;
    align-self: flex-start;
}
.event-date-chip svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
}
.event-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.event-location-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #4b5563;
}
.event-location-row svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    stroke: #e11d48;
    fill: none;
}
.event-image-thumb {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 4px;
}

/* Location Card with Embedded Map & Real Address */
.location-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
    margin-bottom: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.location-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
}
.location-map-wrap {
    position: relative;
    width: 100%;
    height: 185px;
    background: #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    display: block;
    text-decoration: none;
}
.location-map-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 56px);
    border: 0;
    display: block;
    pointer-events: none !important;
}
.location-map-overlay-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #1e293b;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 99px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease, transform 0.15s ease;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.location-map-overlay-btn:hover {
    background: #ffffff;
    transform: scale(1.04);
}
.location-content-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: #ffffff;
}

.item-location {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 2px;
}
.location-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fee2e2;
    color: #ef4444;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.location-icon-badge svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
}
.location-details {
    flex: 1;
    min-width: 0;
}
.location-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.location-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.location-link-btn {
    font-size: 12px;
    font-weight: 650;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 12px;
    background: var(--primary-soft);
    border-radius: 99px;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}
.location-link-btn:hover {
    transform: scale(1.04);
}

/* Vista de Recordatorios (Fiel a la captura) */
.reminders-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--feed-bg);
    padding: 16px 16px calc(80px + var(--bottom-nav-height) + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}
.reminders-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.reminders-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 6px;
    scrollbar-width: none;
}
.reminders-filter-bar::-webkit-scrollbar { display: none; }
.reminder-filter-tab {
    padding: 7px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}
.reminder-filter-tab:hover {
    background: #f8fafc;
}
.reminder-filter-tab.active {
    background: #dbeafe;
    color: #2563eb;
    border-color: #bfdbfe;
    font-weight: 700;
}
.reminders-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.reminders-group-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #64748b;
    margin: 8px 4px 2px;
}
.reminders-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reminder-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(15, 30, 60, .04);
    transition: transform .12s ease, box-shadow .15s ease;
}
.reminder-card:hover {
    box-shadow: 0 4px 14px rgba(15, 30, 60, .08);
}
.reminder-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.reminder-badge svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.reminder-badge.purple { background: #f3e8ff; color: #8b5cf6; }
.reminder-badge.green { background: #ecfdf5; color: #10b981; }
.reminder-badge.blue { background: #eff6ff; color: #3b82f6; }
.reminder-badge.orange { background: #fff7ed; color: #f97316; }
.reminder-badge.rose { background: #fdf2f8; color: #ec4899; }
.reminder-badge.teal { background: #f0fdfa; color: #14b8a6; }

.reminder-details {
    flex: 1;
    min-width: 0;
}
.reminder-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 3px;
    line-height: 1.25;
}
.reminder-card.completed .reminder-title {
    text-decoration: line-through;
    color: #94a3b8;
}
.reminder-category {
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
    margin: 0;
}
.reminder-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}
.reminder-time-tag {
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.reminder-menu-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    border: 0;
    cursor: pointer;
    font-size: 17px;
    padding: 0;
}
.reminder-menu-btn:hover {
    color: var(--text-primary);
    background: var(--surface-secondary);
}

/* Botón flotante para nuevo recordatorio (FAB) */
.reminders-fab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--bottom-nav-height) + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .38);
    border: 0;
    cursor: pointer;
    z-index: 12;
    transition: transform .15s ease, background-color .15s ease;
}
.reminders-fab:hover {
    background: #1d4ed8;
    transform: scale(1.06);
}
.reminders-fab:active {
    transform: scale(0.92);
}
.reminders-fab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reminders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.reminders-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}
.reminders-empty-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.reminders-empty h2 {
    font-size: 18px;
    font-weight: 750;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.reminders-empty p {
    font-size: 14px;
    margin: 0;
}

/* Barra inferior de navegación */
.bottom-nav { position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.bottom-nav-inner { max-width: 1080px; height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-around; padding: 0 10px; }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; max-width: 120px; padding: 4px; color: var(--text-secondary); text-decoration: none; background: transparent; border: 0; border-radius: 12px; transition: color .15s ease, background-color .15s ease; -webkit-tap-highlight-color: transparent; }
.bottom-nav-item:hover { color: var(--text-primary); }
.bottom-nav-item.active { color: var(--primary); }

.bottom-nav-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 30px;
    border-radius: 18px;
    transition: background-color .18s ease;
}
.bottom-nav-item.active .bottom-nav-icon-wrap {
    background: #dbeafe;
    color: #2563eb;
}

.bottom-nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform .15s ease; }
.bottom-nav-item:active svg { transform: scale(.92); }
.bottom-nav-label { font-size: 11px; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.bottom-nav-item.active .bottom-nav-label { font-weight: 750; }
.bottom-nav-logo-frame { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; overflow: hidden; }
.bottom-nav-logo { width: 34px; height: 34px; max-width: none; flex: none; object-fit: contain; filter: grayscale(100%); opacity: .72; transition: filter .15s ease, opacity .15s ease, transform .15s ease; }
.bottom-nav-item:hover .bottom-nav-logo { opacity: .95; }
.bottom-nav-item.active .bottom-nav-logo { filter: none; opacity: 1; }
.bottom-nav-item:active .bottom-nav-logo { transform: scale(.92); }

/* Modal de Transcripción en Vivo */
.transcribe-modal {
    width: min(calc(100% - 32px), 440px);
    padding: 22px 20px;
}
.transcribe-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}
.transcribe-header h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.03em;
}
.transcribe-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.transcribe-mic-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0 6px;
    text-align: center;
}
.transcribe-mic-toggle {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    border: 2px solid rgba(37, 99, 235, .2);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all .2s ease;
    margin-bottom: 10px;
}
.transcribe-mic-toggle:hover {
    transform: scale(1.05);
}
.transcribe-mic-toggle:active {
    transform: scale(0.94);
}
.transcribe-mic-toggle.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 6px 22px rgba(37, 99, 235, .4);
}
.transcribe-mic-toggle.active .mic-pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, .5);
    animation: mic-wave 1.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    pointer-events: none;
}
.transcribe-mic-toggle.active .mic-pulse-ring.ring-2 {
    inset: -14px;
    animation-delay: .55s;
    border-color: rgba(37, 99, 235, .3);
}
@keyframes mic-wave {
    0% { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}
.transcribe-mic-toggle.paused {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
    box-shadow: none;
}
.transcribe-mic-toggle.paused .mic-pulse-ring {
    display: none;
}
.transcribe-mic-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
}
.transcribe-status {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin: 0;
    transition: color .2s ease;
}
.transcribe-status.active {
    color: #2563eb;
}
.transcribe-text-box {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    min-height: 120px;
    max-height: 210px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .02);
}
.transcribe-display {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
    min-height: 80px;
}
.transcribe-display:empty::before {
    content: "El texto aparecerá aquí mientras hablás...";
    color: #94a3b8;
    pointer-events: none;
    font-style: normal;
}
.interim-transcript {
    color: #94a3b8;
    font-style: italic;
}
.transcribe-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.transcribe-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
}
.transcribe-tool-btn:hover {
    color: var(--text-primary);
    background: #e2e8f0;
}
.transcribe-tool-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
}

/* Componentes de Layout Base (Mobile First - Intactos para Mobile) */
.desktop-layout { display: contents; }
.desktop-sidebar { display: none; }
.desktop-quick-panel { display: none; }
.desktop-header-container { display: none; }
.feed-filter-bar { display: none; }
.header-action-btn.primary-action-btn { display: none; }
.reminders-group-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.reminders-group-date { font-size: 12px; color: #94a3b8; font-weight: 500; }
.reminders-col-empty { display: none; }
.sidebar-brand-lockup { display: flex; align-items: center; gap: 10px; }
.sidebar-brand-logo { width: 34px; height: 34px; object-fit: contain; }

@media (min-width: 700px) and (max-width: 899px) {
    .app-header { padding: max(16px, calc(10px + env(safe-area-inset-top))) 40px 12px; }
    .search-panel { margin-right: 40px; margin-left: 40px; }
    .feed { padding-right: 40px; padding-left: 40px; }
    .composer-wrap { padding-right: 40px; padding-left: 40px; }
    .composer-wrap > * { max-width: 1000px; }
    .empty-state { min-height: 58vh; }
    .bottom-sheet { bottom: 20px; border-radius: 24px; }
}

/* ==========================================================================
   ADAPTACIÓN A DESKTOP (>= 900px)
   1. Sidebar flotante izquierda (con logo y marca).
   2. Columna central: Header & filtros en card flotante compacta,
      feed con fondo gris para máximo contraste de mensajes, y composer flotante.
   3. Panel derecho: 9 atajos de captura directa sin depender de modal.
   4. Recordatorios en 3 columnas.
   ========================================================================== */
@media (min-width: 900px) {
    html, body {
        height: 100vh;
        overflow: hidden;
        background-color: #f0f2f5;
    }

    .desktop-layout {
        display: flex;
        height: 100vh;
        max-width: 1480px;
        margin: 0 auto;
        padding: 20px 24px;
        gap: 18px;
        box-sizing: border-box;
        align-items: stretch;
    }

    /* 1. Sidebar Flotante a la Izquierda */
    .desktop-sidebar {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 230px;
        flex-shrink: 0;
        background: #ffffff;
        border-radius: 22px;
        padding: 24px 16px 20px;
        box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }

    .sidebar-brand {
        padding: 0 6px 22px;
    }
    .sidebar-brand-lockup {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sidebar-brand-logo {
        width: 34px;
        height: 34px;
        object-fit: contain;
        flex-shrink: 0;
    }
    .sidebar-brand-texts {
        display: flex;
        flex-direction: column;
    }
    .sidebar-brand-title {
        font-size: 20px;
        font-weight: 800;
        letter-spacing: -0.035em;
        color: var(--text-primary);
        margin: 0;
        line-height: 1.15;
        font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
    }
    .sidebar-brand-subtitle {
        font-size: 11.5px;
        font-weight: 500;
        color: var(--text-secondary);
        margin: 2px 0 0;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sidebar-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 10px 14px;
        background: transparent;
        border-radius: 12px;
        color: #555e6d;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.15s ease;
        text-align: left;
        cursor: pointer;
        border: 0;
    }
    .sidebar-nav-item:hover {
        background: #f4f6f9;
        color: var(--text-primary);
    }
    .sidebar-nav-item.active {
        background: #edf3ff;
        color: #2563eb;
        font-weight: 700;
    }
    .sidebar-nav-icon {
        display: grid;
        place-items: center;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .sidebar-nav-icon svg {
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.85;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .sidebar-nav-item.active .sidebar-nav-icon svg {
        stroke-width: 2.1;
    }

    .desktop-sidebar-footer {
        padding: 0 8px;
    }
    .sidebar-footer-divider {
        display: block;
        width: 28px;
        height: 2px;
        background: #e2e8f0;
        border-radius: 2px;
        margin-bottom: 12px;
    }
    .sidebar-footer-text {
        font-size: 11px;
        line-height: 1.45;
        color: #94a3b8;
        margin: 0;
        font-weight: 500;
    }

    /* 2. Columna Central (App Shell) */
    .app-shell {
        flex: 1;
        min-width: 0;
        height: 100%;
        max-width: none;
        margin: 0;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        border: 0;
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        gap: 12px;
    }

    /* Ocultar barra de navegación inferior móvil en Desktop */
    .bottom-nav {
        display: none !important;
    }

    /* 3. Cabecera Desktop (Dos Cards y Filtros) */
    .app-top-bar {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
        flex-shrink: 0;
    }
    .app-header-mobile,
    .search-panel {
        display: none !important;
    }
    .desktop-header-container {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }
    .desktop-header-row {
        display: flex;
        gap: 14px;
        align-items: stretch;
    }

    /* Card Izquierda: Título y Buscador */
    .desktop-header-card {
        flex: 1;
        min-width: 0;
        background: #ffffff;
        border-radius: 20px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        padding: 16px 24px;
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }
    .desktop-header-info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .desktop-view-title {
        font-size: 24px;
        font-weight: 800;
        letter-spacing: -0.03em;
        margin: 0;
        color: var(--text-primary);
        line-height: 1.15;
    }
    .desktop-view-subtitle {
        font-size: 13px;
        color: #64748b;
        margin: 3px 0 0;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .desktop-header-search {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 8px 14px;
        min-width: 250px;
        max-width: 320px;
        flex-shrink: 0;
    }
    .desktop-header-search svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: #94a3b8;
        stroke-width: 2;
        flex-shrink: 0;
    }
    .desktop-header-search input {
        border: 0;
        background: transparent;
        outline: 0;
        font-size: 13.5px;
        width: 100%;
        color: var(--text-primary);
    }
    .search-kbd {
        font-size: 11px;
        font-weight: 600;
        color: #94a3b8;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        padding: 2px 6px;
        flex-shrink: 0;
    }

    /* Card Derecha: Atajos con desplegable hacia abajo */
    .desktop-quick-card {
        position: relative;
        background: #ffffff;
        border-radius: 20px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        padding: 10px 16px;
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .desktop-quick-row {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .header-reminder-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 10px 16px;
        border-radius: 12px;
        background: var(--primary);
        color: #fff;
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }
    .header-reminder-btn:hover { background: #1f54cb; }
    .header-reminder-btn svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }
    .quick-mini-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        border: 0;
        background: transparent;
        cursor: pointer;
        padding: 4px 6px;
        border-radius: 12px;
        transition: all 0.15s ease;
    }
    .quick-mini-btn:hover {
        background: #f1f5f9;
        transform: translateY(-1px);
    }
    .quick-mini-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        display: grid;
        place-items: center;
    }
    .quick-mini-icon svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.85;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .quick-mini-icon.peach { color: #ea580c; background: #fff7ed; }
    .quick-mini-icon.blue { color: #2563eb; background: #eff6ff; }
    .quick-mini-icon.lilac { color: #7c3aed; background: #f5f3ff; }
    .quick-mini-icon.emerald { color: #059669; background: #ecfdf5; }
    .quick-mini-icon.more { color: #64748b; background: #f1f5f9; }
    .quick-mini-label {
        font-size: 10.5px;
        font-weight: 600;
        color: #475569;
    }

    /* Menú flotante desplegable hacia abajo (No afecta al resto de componentes) */
    .quick-dropdown-panel {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        width: 310px;
        background: #ffffff;
        border-radius: 20px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
        padding: 16px 14px;
        z-index: 60;
        animation: dropdown-in 0.18s ease-out both;
    }
    @keyframes dropdown-in {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .quick-dropdown-header {
        margin-bottom: 6px;
        padding: 0 4px;
    }
    .quick-dropdown-header h4 {
        margin: 0;
        font-size: 14px;
        font-weight: 750;
        color: #1e293b;
    }
    .quick-dropdown-panel .sheet-grid-3col {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px 4px;
        padding: 6px 0;
    }
    .quick-dropdown-panel .sheet-grid-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }
    .quick-dropdown-panel .sheet-grid-btn {
        padding: 6px 4px;
        border-radius: 12px;
        border: 0;
        background: transparent;
        cursor: pointer;
        transition: all 0.15s ease;
    }
    .quick-dropdown-panel .sheet-grid-btn:hover {
        background: #f4f6f9;
        transform: translateY(-1px);
    }
    .quick-dropdown-panel .sheet-grid-label {
        font-size: 11px;
        font-weight: 650;
        color: #475569;
    }

    /* Fila de Filtros y Ordenamiento */
    .desktop-filter-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 4px;
    }
    .feed-filter-bar {
        display: flex !important;
        align-items: center;
        gap: 8px;
        background: transparent;
        padding: 0;
        overflow-x: auto;
    }
    .feed-filter-bar .filter-pill {
        padding: 6px 16px;
        font-size: 13px;
        font-weight: 600;
        color: #5f6b7c;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
        border-radius: 999px;
        cursor: pointer;
        transition: all 0.15s ease;
    }
    .feed-filter-bar .filter-pill:hover {
        background: #f8fafc;
        color: var(--text-primary);
    }
    .feed-filter-bar .filter-pill.active {
        background: #edf3ff;
        color: #2563eb;
        border-color: #bfdbfe;
        font-weight: 700;
    }
    .desktop-sort-indicator {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12.5px;
        font-weight: 600;
        color: #64748b;
        padding: 6px 14px;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
        border-radius: 999px;
        cursor: pointer;
        flex-shrink: 0;
    }
    .desktop-sort-indicator svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
    }

    /* 4. Feed de Mensajes a Ancho Completo */
    .feed {
        flex: 1;
        min-height: 0;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 20px 24px;
        background: #f4f6f8;
        border-radius: 20px;
        border: 1px solid rgba(0, 0, 0, 0.04);
        overflow-y: auto;
    }
    #feed-content {
        width: 100% !important;
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    /* Tarjetas de mensajes a ancho completo con estilo limpio */
    .item-card,
    .item-bubble,
    .file-preview-card,
    .doc-preview-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        background: #ffffff;
        border-radius: 18px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    }
    .empty-state {
        min-height: 40vh;
    }

    /* 5. Composer a Ancho Completo */
    .composer-wrap {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        padding: 0 !important;
        background: transparent !important;
        border-top: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 0;
        z-index: 10;
    }
    .composer-row {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 0 auto;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
        border-radius: 28px;
        padding: 6px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .composer-input-box {
        background: transparent;
    }
    .composer-input-box textarea {
        background: transparent;
        font-size: 14.5px !important;
    }

    .sidebar-account-card {
        display: grid;
        gap: 10px;
        padding: 12px 10px 10px;
        border-top: 1px solid #edf0f5;
    }
    .sidebar-profile-trigger {
        display: flex;
        width: 100%;
        min-width: 0;
        align-items: center;
        gap: 10px;
        padding: 0;
        color: var(--text-primary);
        background: transparent;
        text-align: left;
    }
    .sidebar-profile-trigger:hover .sidebar-account-copy strong,
    .sidebar-profile-trigger:focus-visible .sidebar-account-copy strong { color: #2563eb; }
    .sidebar-account-avatar {
        display: grid;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        place-items: center;
        object-fit: cover;
        color: #fff;
        background: #1f2937;
        border-radius: 50%;
        font-size: 13px;
        font-weight: 800;
    }
    .sidebar-account-copy {
        display: grid;
        min-width: 0;
        line-height: 1.2;
    }
    .sidebar-account-greeting,
    .sidebar-account-copy small {
        color: #94a3b8;
        font-size: 10px;
        font-weight: 600;
    }
    .sidebar-account-copy strong {
        overflow: hidden;
        color: var(--text-primary);
        font-size: 12px;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
        transition: color .15s ease;
    }
    .sidebar-account-copy small {
        overflow: hidden;
        margin-top: 2px;
        font-size: 9px;
        font-weight: 500;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .sidebar-logout-button {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 7px 2px;
        color: #94a3b8;
        background: transparent;
        font-size: 11px;
        font-weight: 700;
        text-align: left;
        transition: color .15s ease;
    }
    .sidebar-logout-button:hover,
    .sidebar-logout-button:focus-visible { color: #b91c1c; }
    .sidebar-logout-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
    .sidebar-counter {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        font-size: 11px;
        font-weight: 750;
        color: #ffffff;
        background: #2563eb;
        border-radius: 999px;
        margin-left: auto;
    }

    /* 7. Recordatorios en 3 Columnas */
    .reminders-view {
        flex: 1;
        min-height: 0;
        padding: 18px 22px 28px;
        background: #f0f2f5;
        border-radius: 20px;
        border: 1px solid rgba(0, 0, 0, 0.04);
        overflow-y: auto;
    }
    .reminders-container {
        max-width: 100%;
        gap: 14px;
    }
    .reminders-filter-bar {
        padding: 0 0 10px;
    }
    .reminders-content {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        align-items: start;
    }
    .reminders-content.filtered-single {
        grid-template-columns: minmax(0, 580px);
    }
    .reminders-group {
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
        border-radius: 18px;
        padding: 16px;
        min-height: 160px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 0;
    }
    .reminders-group-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        padding-bottom: 8px;
        border-bottom: 1px solid #edf2f7;
    }
    .reminders-group-title {
        font-size: 15px;
        font-weight: 800;
        color: #1e293b;
        margin: 0;
    }
    .reminders-group-date {
        font-size: 12px;
        font-weight: 500;
        color: #94a3b8;
    }
    .reminders-group-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .reminder-card {
        background: #f8fafc;
        border: 1px solid #edf2f7;
        box-shadow: none;
        padding: 12px 14px;
        border-radius: 16px;
    }
    .reminder-card:hover {
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    }
    .reminders-col-empty {
        display: block;
        padding: 36px 12px;
        text-align: center;
        color: #94a3b8;
        font-size: 13px;
        font-weight: 500;
    }
    .reminders-fab {
        display: none !important;
    }

    /* 8. Bottom Sheet como Modal Centrado en Desktop */
    .sheet-backdrop {
        background: rgba(15, 23, 42, 0.35);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    .bottom-sheet {
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        max-width: 480px;
        width: 90%;
        border-radius: 24px;
        box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
        padding: 24px 28px;
    }
    .sheet-handle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Toast Notifications */
.app-toast-alert {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 99px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 90vw;
    text-align: center;
}
.app-toast-alert.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
