/* ==============================================================================
   📜 THE COMMON PLACE — TACTILE JOURNAL & SCRAPBOOK DESIGN SYSTEM
   Inspired by Kinfolk, ReadCV, and editorial tactile notebooks
   ============================================================================== */

:root {
    /* Warm Tactile Palette */
    --paper-bg: #fbf8f2;             /* Warm cream / natural book paper */
    --paper-surface: #f5f0e6;        /* Deeper warm parchment */
    --paper-card: #ffffff;           /* Clean ivory polaroid paper */
    --paper-card-subtle: #f7f3eb;    /* Tinted paper card */
    --paper-dock: rgba(251, 248, 242, 0.94);
    
    /* Warm Ink Tiers */
    --ink-primary: #282522;          /* Deep warm charcoal/sumi ink */
    --ink-secondary: #635d55;        /* Softened graphite text */
    --ink-tertiary: #968e83;         /* Faded pencil / metadata */
    --ink-faint: #d5cebf;            /* Delicate ruled lines */

    /* Vintage Warm Accents */
    --terracotta: #c86545;           /* Warm burnt sienna accent */
    --terracotta-hover: #b25437;
    --terracotta-soft: rgba(200, 101, 69, 0.12);
    --sage: #758673;                 /* Dried sage herb */
    --honey: #c59146;                /* Amber wax seal */
    --vinyl-plum: #38282e;           /* Deep vinyl groove plum */

    /* Borders & Shadows */
    --border-paper: rgba(60, 50, 40, 0.08);
    --border-paper-strong: rgba(60, 50, 40, 0.15);
    --shadow-polaroid: 0 12px 28px rgba(45, 35, 25, 0.10), 0 3px 8px rgba(45, 35, 25, 0.05);
    --shadow-card: 0 4px 14px rgba(45, 35, 25, 0.06), 0 1px 3px rgba(45, 35, 25, 0.04);
    --shadow-floating: 0 16px 36px rgba(40, 30, 20, 0.14), 0 4px 12px rgba(40, 30, 20, 0.06);

    /* Typography */
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
}

/* Global Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--paper-bg);
    color: var(--ink-primary);
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle organic paper grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.6;
    z-index: 1;
}

/* Material Symbols Adjustments */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 380, 'GRAD' 0, 'opsz' 22;
    vertical-align: middle;
    user-select: none;
}

.hidden {
    display: none !important;
}

/* Root Layout */
.journal-root {
    position: relative;
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
}

/* ==============================================================================
   1. TACTILE HEADER
   ============================================================================== */
.journal-header {
    width: 100%;
    background: var(--paper-dock);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-paper);
    z-index: 30;
    flex-shrink: 0;
}

.header-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.journal-sigil {
    font-size: 17px;
    color: var(--terracotta);
    animation: gentle-pulse 3s infinite ease-in-out;
}

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

.journal-title-box {
    display: flex;
    flex-direction: column;
}

.journal-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.02em;
    color: var(--ink-primary);
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-tertiary);
    transition: background-color 0.3s ease;
}

.status-pip.online {
    background: var(--sage);
    box-shadow: 0 0 6px rgba(117, 134, 115, 0.4);
}

.status-pip.offline {
    background: #c25953;
}

/* Header Right: Google Login / User Chip */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-paper-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--paper-card);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-primary);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.btn-paper-login:hover {
    background: #fff;
    border-color: var(--terracotta);
    transform: translateY(-1px);
    box-shadow: var(--shadow-polaroid);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 5px;
    background: var(--paper-card);
    border: 1px solid var(--border-paper);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-card);
}

.chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-paper);
}

.chip-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip-name {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-primary);
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-logout {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-tertiary);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.chip-logout:hover {
    color: var(--terracotta);
}

/* ==============================================================================
   2. FEED VIEWPORT (EDITORIAL JOURNAL)
   ============================================================================== */
.journal-feed {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px 140px 20px;
}

.feed-inner {
    max-width: 660px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Custom Scrollbar */
.journal-feed::-webkit-scrollbar {
    width: 5px;
}

.journal-feed::-webkit-scrollbar-thumb {
    background: rgba(60, 50, 40, 0.12);
    border-radius: 4px;
}

/* Feed Spinner */
.feed-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
    color: var(--ink-tertiary);
    font-family: var(--font-serif);
    font-style: italic;
}

.loading-quill {
    font-size: 24px;
    color: var(--terracotta);
    animation: quill-write 1.4s infinite ease-in-out alternate;
}

@keyframes quill-write {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-4px) rotate(-10deg); }
}

.empty-stream {
    text-align: center;
    padding: 60px 20px;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--ink-tertiary);
    font-size: 16px;
}

/* ==============================================================================
   3. DATE DIVIDERS (──────── FRIDAY ────────)
   ============================================================================== */
.feed-date-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
    width: 100%;
}

.feed-date-divider::before,
.feed-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ink-faint);
}

.feed-date-divider span {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-tertiary);
    font-weight: 500;
}

/* ==============================================================================
   4. JOURNAL ENTRY ROW (TACTILE INK ENTRY)
   ============================================================================== */
.journal-entry {
    position: relative;
    display: flex;
    gap: 14px;
    width: 100%;
    animation: fadeInEntry 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.journal-entry.deleting {
    transition: all 0.25s ease;
    opacity: 0;
    transform: scale(0.95);
}

/* Author Seal / Initial */
.entry-seal {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper-surface);
    border: 1px solid var(--border-paper-strong);
    color: var(--ink-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
}

.entry-seal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Entry Body Wrap */
.entry-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

/* Author & Time Metadata Header */
.entry-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.entry-author {
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-secondary);
    letter-spacing: 0.01em;
}

.entry-author.is-mine {
    color: var(--terracotta);
}

.entry-timestamp {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-tertiary);
    letter-spacing: 0.04em;
}

/* Entry Body (Natural Editorial Type) */
.entry-body {
    font-family: var(--font-serif);
    font-size: 16.5px;
    line-height: 1.68;
    color: var(--ink-primary);
    word-break: break-word;
}

/* Markdown formatting inside entry */
.entry-body h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 6px 0 4px 0;
    line-height: 1.3;
}

.entry-body h2 {
    font-size: 18.5px;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 5px 0 3px 0;
    line-height: 1.35;
}

.entry-body ul {
    margin: 4px 0 4px 20px;
    list-style-type: '— ';
}

.entry-body li {
    padding-left: 4px;
    margin-bottom: 3px;
}

/* Quote Block (Inspired by reference image 1) */
.entry-quote {
    position: relative;
    margin: 6px 0;
    padding: 4px 0 4px 14px;
    border-left: 2.5px solid var(--terracotta);
    font-style: italic;
    color: var(--ink-secondary);
}

.entry-quote .quote-author {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--terracotta);
    margin-bottom: 2px;
}

/* Code Block with One-Click Copy */
.entry-code-block {
    position: relative;
    margin: 8px 0;
    background: #201e1c;
    color: #ede7dc;
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: var(--font-mono);
    box-shadow: var(--shadow-card);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11px;
    color: #a49e95;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-copy-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    color: #ede7dc;
    font-family: var(--font-mono);
    font-size: 10.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy-code:hover {
    background: var(--terracotta);
    color: #fff;
}

.btn-copy-code.copied {
    background: var(--sage);
    color: #fff;
}

.entry-code-block pre {
    padding: 12px 14px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.55;
}

.entry-code-block code {
    font-family: inherit;
}

/* Inline code tag */
.entry-body code:not(pre code) {
    background: var(--paper-surface);
    border: 1px solid var(--border-paper);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--terracotta);
}

/* Inline text links */
.entry-body a.inline-link {
    color: var(--terracotta);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.entry-body a.inline-link:hover {
    color: var(--terracotta-hover);
}

/* ==============================================================================
   5. POLAROID PHOTO FRAME (REFERENCE IMAGE 2 & 4)
   ============================================================================== */
.polaroid-card {
    position: relative;
    display: inline-block;
    max-width: 320px;
    margin: 8px 0;
    padding: 10px 10px 32px 10px;
    background: var(--paper-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    box-shadow: var(--shadow-polaroid);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    transform-origin: center center;
}

.polaroid-card:hover {
    transform: rotate(0deg) scale(1.02) translateY(-2px);
    box-shadow: var(--shadow-floating);
    z-index: 5;
}

.polaroid-card.tilt-left {
    transform: rotate(-1.5deg);
}

.polaroid-card.tilt-right {
    transform: rotate(1.2deg);
}

.polaroid-img {
    display: block;
    width: 100%;
    min-height: 180px;
    aspect-ratio: 1 / 1;
    max-height: 380px;
    object-fit: cover;
    border-radius: 1px;
    background: var(--paper-surface);
}

.polaroid-caption {
    position: absolute;
    bottom: 8px;
    left: 12px;
    right: 12px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-secondary);
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================================================================
   5B. TACTILE POLAROID PHOTO ALBUM (STACKED CARDS - REFERENCE USER IMAGE)
   ============================================================================== */
.polaroid-album-stack {
    position: relative;
    display: inline-block;
    max-width: 320px;
    margin: 12px 8px 14px 4px;
    cursor: pointer;
    transform-origin: center center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.polaroid-album-stack:hover {
    transform: translateY(-3px);
}

/* Layered Paper Edges Beneath Main Photo */
.stack-layer {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    transform-origin: center center;
}

.stack-layer-1 {
    z-index: 1;
    background: #f4ede2;
    transform: rotate(-3.8deg) translate(-3px, 4px);
    box-shadow: 0 4px 10px rgba(45, 35, 25, 0.06);
}

.stack-layer-2 {
    z-index: 2;
    background: #fcf9f2;
    transform: rotate(3.2deg) translate(3px, 3px);
    box-shadow: 0 6px 14px rgba(45, 35, 25, 0.07);
}

/* Playful Tactile Fan-Out on Hover */
.polaroid-album-stack:hover .stack-layer-1 {
    transform: rotate(-6.5deg) translate(-6px, 5px);
    box-shadow: 0 8px 16px rgba(45, 35, 25, 0.09);
}

.polaroid-album-stack:hover .stack-layer-2 {
    transform: rotate(5.8deg) translate(6px, 4px);
    box-shadow: 0 8px 18px rgba(45, 35, 25, 0.10);
}

.stack-main-card {
    position: relative;
    z-index: 3;
    padding: 10px 10px 32px 10px;
    background: #ffffff;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: var(--shadow-polaroid);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.polaroid-album-stack:hover .stack-main-card {
    transform: scale(1.015);
    box-shadow: var(--shadow-floating);
}

/* Tactile Pill Badge in Bottom Right Corner ("4 photos") */
.album-pill-badge {
    position: absolute;
    bottom: 8px;
    right: 10px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(254, 252, 248, 0.94);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(175, 155, 135, 0.35);
    border-radius: 999px;
    padding: 3px 10px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    color: #55483a;
    box-shadow: 0 2px 6px rgba(45, 35, 25, 0.08);
    pointer-events: none;
    letter-spacing: 0.02em;
}

.album-pill-badge .material-symbols-outlined {
    font-size: 13px;
    color: var(--terracotta);
}

/* ==============================================================================
   6. RICH MEDIA CARDS (YOUTUBE, MUSIC, DRIVE, PDF) - REFERENCE IMAGE 5
   ============================================================================== */
/* Generic Media Card Container */
.tactile-media-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--paper-card);
    border: 1px solid var(--border-paper);
    box-shadow: var(--shadow-card);
    margin: 8px 0;
    max-width: 420px;
    transition: all 0.2s ease;
}

.tactile-media-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-polaroid);
    border-color: var(--border-paper-strong);
}

/* 6A. YouTube Card */
.yt-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.yt-thumb-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: #181818;
    overflow: hidden;
}

.yt-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yt-card:hover .yt-thumb {
    transform: scale(1.03);
}

.yt-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 36px;
    background: #ff0000;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.yt-card:hover .yt-play-badge {
    transform: translate(-50%, -50%) scale(1.1);
}

.yt-duration-pill {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10.5px;
    border-radius: 4px;
}

.yt-info-pane {
    padding: 12px 14px;
}

.yt-tag-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-tertiary);
    text-transform: lowercase;
    margin-bottom: 4px;
}

.yt-tag-icon {
    color: #ff0000;
    font-size: 14px;
}

.yt-title {
    font-family: var(--font-serif);
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink-primary);
    margin-bottom: 2px;
}

.yt-submeta {
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--ink-secondary);
}

/* 6B. Music Card (Spotify & YT Music Vinyl Groove) */
.music-card {
    display: flex;
    align-items: center;
    background: var(--paper-card);
    overflow: hidden;
}

.vinyl-groove {
    width: 86px;
    height: 86px;
    background: radial-gradient(circle, #1a1718 20%, #3e3236 40%, #1a1718 60%, #3e3236 80%, #1a1718 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.vinyl-center {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--terracotta);
    border: 3px solid #fff;
}

.music-card:hover .vinyl-groove {
    animation: vinyl-spin 4s linear infinite;
}

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.music-details {
    padding: 10px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.music-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ink-tertiary);
    letter-spacing: 0.05em;
}

.music-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-primary);
    line-height: 1.3;
}

.music-artist {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-secondary);
}

/* Animated Equalizer Waves */
.equalizer-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
    margin-top: 4px;
}

.eq-bar {
    width: 2.5px;
    background: var(--terracotta);
    border-radius: 2px;
    animation: eqBounce 1.2s infinite ease-in-out alternate;
}

.eq-bar:nth-child(1) { height: 35%; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 85%; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { height: 100%; animation-delay: 0.4s; }
.eq-bar:nth-child(5) { height: 45%; animation-delay: 0.15s; }
.eq-bar:nth-child(6) { height: 75%; animation-delay: 0.35s; }

@keyframes eqBounce {
    0% { height: 25%; }
    100% { height: 100%; }
}

/* 6C. Google Drive & Docs Card */
.drive-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--paper-card);
}

.drive-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eef2f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4285F4;
    flex-shrink: 0;
}

.drive-meta {
    flex: 1;
    overflow: hidden;
}

.drive-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ink-tertiary);
}

.drive-title {
    font-family: var(--font-serif);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 6D. PDF & Document Paper Card */
.pdf-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--paper-card);
}

.pdf-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--terracotta-soft);
    color: var(--terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdf-meta {
    flex: 1;
    overflow: hidden;
}

.pdf-name {
    font-family: var(--font-serif);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-subinfo {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Entry Hover Action: Delete Trigger */
.entry-actions-float {
    opacity: 0.35;
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.journal-entry:hover .entry-actions-float,
.journal-entry:focus-within .entry-actions-float {
    opacity: 1;
}

.btn-entry-delete {
    background: var(--paper-card);
    border: 1px solid var(--border-paper);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-tertiary);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.15s ease;
}

.btn-entry-delete:hover {
    color: #c25953;
    border-color: #c25953;
    transform: scale(1.1);
}

/* Touch hold animation */
.journal-entry.holding .entry-wrap {
    transform: scale(0.98);
    transition: transform 0.2s ease;
}

/* ==============================================================================
   7. FLOATING FOOTER & NOTION SLASH MENU
   ============================================================================== */
.journal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, var(--paper-bg) 85%, transparent);
    padding: 0 16px 16px 16px;
    z-index: 40;
    pointer-events: none;
}

.footer-wrap {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 7A. Notion-Style Slash Popup Menu */
.slash-command-popup {
    position: absolute;
    bottom: 100%;
    left: 12px;
    margin-bottom: 10px;
    width: 280px;
    background: var(--paper-card);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-floating);
    overflow: hidden;
    animation: popupSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
}

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

.slash-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--paper-surface);
    border-bottom: 1px solid var(--border-paper);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--ink-tertiary);
    letter-spacing: 0.08em;
}

.slash-head-icon {
    font-size: 14px;
    color: var(--terracotta);
}

.slash-options {
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
}

.slash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background 0.12s ease;
}

.slash-item:hover, .slash-item.active {
    background: var(--paper-surface);
}

.slash-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--terracotta);
}

.slash-text {
    display: flex;
    flex-direction: column;
}

.slash-text strong {
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-primary);
}

.slash-text small {
    font-family: var(--font-sans);
    font-size: 10.5px;
    color: var(--ink-tertiary);
}

/* 7B. Attached File Envelope Preview (Single & Multi-File / Multi-Photo Album) */
.preview-envelope {
    margin-bottom: 8px;
    background: var(--paper-card);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    box-shadow: var(--shadow-card);
    animation: fadeIn 0.2s ease;
}

.preview-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-secondary);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-paper);
}

.btn-clear-all {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--terracotta);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.btn-clear-all:hover {
    background: rgba(194, 89, 83, 0.08);
}

.preview-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 140px;
    overflow-y: auto;
}

.preview-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--paper-surface);
    border: 1px solid var(--border-paper);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chip-thumb-box {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chip-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chip-thumb-icon {
    font-size: 16px;
    color: var(--terracotta);
}

.chip-meta {
    display: flex;
    flex-direction: column;
    max-width: 130px;
}

.chip-filename {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-filesize {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ink-tertiary);
}

.btn-chip-remove {
    background: none;
    border: none;
    color: var(--ink-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    transition: color 0.15s ease, transform 0.15s ease;
}

.btn-chip-remove:hover {
    color: #c25953;
    transform: scale(1.15);
}

/* 7C. Realtime Upload Progress Bar (0-100%) */
.journal-progress {
    background: var(--paper-card);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    box-shadow: var(--shadow-card);
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-secondary);
    margin-bottom: 6px;
}

.progress-track {
    width: 100%;
    height: 4px;
    background: var(--paper-surface);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--terracotta);
    border-radius: 2px;
    transition: width 0.15s ease;
}

/* 7D. Primary Tactile Composer (write back...) */
.journal-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--paper-card);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-lg);
    padding: 6px 8px 6px 10px;
    box-shadow: var(--shadow-floating);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.journal-composer:focus-within {
    border-color: var(--terracotta);
    box-shadow: 0 16px 40px rgba(200, 101, 69, 0.12), 0 4px 12px rgba(45, 35, 25, 0.08);
}

.hidden-file-input {
    display: none;
}

.btn-composer-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--paper-surface);
    color: var(--ink-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-composer-action:hover {
    background: var(--terracotta-soft);
    color: var(--terracotta);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

.composer-textarea {
    width: 100%;
    min-height: 36px;
    max-height: 84px; /* Exactly 3 lines max expansion */
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-serif);
    font-size: 16px; /* 16px prevents mobile browser auto-zoom on focus */
    line-height: 1.45;
    color: var(--ink-primary);
    padding: 6px 4px;
    box-sizing: border-box;
    overflow-y: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.composer-textarea::placeholder {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--ink-tertiary);
}

.btn-composer-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--terracotta);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(200, 101, 69, 0.3);
    transition: all 0.15s ease;
}

.btn-composer-send:hover:not(:disabled) {
    background: var(--terracotta-hover);
    transform: translateY(-1px);
}

.btn-composer-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--ink-tertiary);
    box-shadow: none;
}

/* Floating Jump to Latest Button */
.btn-scroll-bottom {
    align-self: center;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: rgba(254, 252, 248, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-paper-strong);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(45, 35, 25, 0.12);
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeIn 0.2s ease;
    z-index: 45;
}

.btn-scroll-bottom:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(45, 35, 25, 0.18);
    color: var(--terracotta);
}

.btn-scroll-bottom .material-symbols-outlined {
    font-size: 15px;
    color: var(--terracotta);
    transition: transform 0.15s ease;
}

.btn-scroll-bottom:hover .material-symbols-outlined {
    transform: translateY(1px);
}

/* ==============================================================================
   8. MODALS: DELETE CONFIRMATION & POLAROID LIGHTBOX
   ============================================================================== */
/* Delete Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(40, 32, 24, 0.45);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.journal-dialog {
    width: 100%;
    max-width: 340px;
    background: var(--paper-bg);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-floating);
    padding: 24px;
    text-align: center;
    animation: dialogPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.dialog-feather {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.dialog-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-primary);
    margin-bottom: 6px;
}

.dialog-desc {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 13.5px;
    color: var(--ink-secondary);
    line-height: 1.45;
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    gap: 10px;
}

.btn-dialog {
    flex: 1;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-dialog-cancel {
    background: var(--paper-surface);
    border: 1px solid var(--border-paper-strong);
    color: var(--ink-secondary);
}

.btn-dialog-cancel:hover {
    background: #eae3d5;
}

.btn-dialog-delete {
    background: #c25953;
    border: none;
    color: #fff;
    box-shadow: 0 2px 6px rgba(194, 89, 83, 0.3);
}

.btn-dialog-delete:hover {
    background: #ad4741;
}

/* ==============================================================================
   10. INTERACTIVE POLAROID ALBUM & PHOTO LIGHTBOX (CLICK & SCROLL GALLERY)
   ============================================================================== */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 22, 18, 0.90);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 24px 20px;
    z-index: 150;
    animation: fadeIn 0.2s ease;
}

/* Lightbox Topbar: Counter & Controls */
.album-lightbox-topbar {
    width: 100%;
    max-width: 840px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.album-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 4px 12px;
    color: #f3efe6;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.album-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-album-top {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-album-top:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.08);
}

/* Album Stage & Floating Navigation Arrows */
.album-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 860px;
    flex: 1;
    min-height: 0;
    gap: 16px;
}

.album-polaroid-frame {
    padding: 12px 12px 34px 12px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
    max-width: min(85vw, 620px);
    max-height: 64vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.2s ease;
}

.album-polaroid-frame img {
    max-width: 100%;
    max-height: calc(64vh - 46px);
    object-fit: contain;
    border-radius: 2px;
    background: #fbf9f4;
}

.album-polaroid-frame .lightbox-caption {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-secondary);
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.album-nav-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #33281e;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 10;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.album-nav-arrow:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.album-nav-arrow:active {
    transform: scale(0.95);
}

.album-nav-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Filmstrip Reel at Bottom for Click & Scroll Through Album */
.album-filmstrip-tray {
    width: 100%;
    max-width: 640px;
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.album-thumbs-reel {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 12px;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    scrollbar-width: thin;
}

.album-thumbs-reel::-webkit-scrollbar {
    height: 4px;
}

.album-thumbs-reel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

.album-reel-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.55;
    cursor: pointer;
    flex-shrink: 0;
    background: #fff;
    transition: all 0.2s ease;
}

.album-reel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-reel-thumb:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.album-reel-thumb.active {
    opacity: 1;
    border-color: var(--terracotta);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    .header-content {
        padding: 10px 14px;
    }

    .journal-feed {
        padding: 16px 14px 130px 14px;
    }

    .journal-footer {
        padding: 0 10px max(10px, env(safe-area-inset-bottom, 10px)) 10px;
    }

    .journal-composer {
        padding: 5px 6px 5px 8px;
        gap: 6px;
    }

    .composer-textarea {
        font-size: 16px !important; /* Critical: prevents iOS auto-zoom which blurs and dismisses keyboard */
        padding: 7px 4px;
        min-height: 36px;
        max-height: 84px;
    }

    .btn-composer-send,
    .btn-composer-action {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .journal-entry {
        gap: 10px;
    }

    .entry-actions-float {
        opacity: 0.85;
    }

    .btn-entry-delete {
        width: 30px;
        height: 30px;
    }

    .entry-body {
        font-size: 15.5px;
    }

    .polaroid-card {
        max-width: 260px;
    }

    .yt-thumb-wrap {
        height: 150px;
    }
}

/* ==============================================================================
   9. CODE SNIPPET MODAL & ENHANCED TACTILE CONTROLS
   ============================================================================== */
.code-dialog {
    width: 100%;
    max-width: 580px;
    background: var(--paper-bg);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-floating);
    overflow: hidden;
    animation: dialogPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.code-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--paper-surface);
    border-bottom: 1px solid var(--border-paper);
}

.code-dialog-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-primary);
}

.code-lang-picker {
    background: var(--paper-card);
    border: 1px solid var(--border-paper-strong);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-primary);
    cursor: pointer;
    outline: none;
}

.code-dialog-body {
    padding: 14px 18px;
    background: #181614;
}

.code-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    color: #ede7dc;
    tab-size: 4;
}

.code-textarea::placeholder {
    color: #635d55;
}

.code-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    background: var(--paper-surface);
    border-top: 1px solid var(--border-paper);
}

.btn-dialog-insert {
    background: var(--terracotta);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-dialog-insert:hover {
    background: var(--terracotta-hover);
}

/* Slash item active & filtered states */
.slash-item.active {
    background: var(--terracotta-soft);
}

.slash-item.filtered-out {
    display: none !important;
}

.slash-empty-msg {
    padding: 14px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-tertiary);
}

/* Ordered List */
.entry-body ol {
    margin: 4px 0 4px 22px;
}

.entry-body ol li {
    padding-left: 4px;
    margin-bottom: 3px;
}

/* Embedded Click-to-Play YouTube Player */
.yt-player-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    background: #000;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
}

.yt-player-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==============================================================================
   10. EXTENDED RICH FORMATTING: HEADINGS, TABLES, HIGHLIGHTS, DIVIDERS
   ============================================================================== */
.entry-body h3 {
    font-size: 16.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 5px 0 2px 0;
    line-height: 1.4;
    color: var(--ink-primary);
}

.entry-body h4 {
    font-size: 14.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 4px 0 2px 0;
    color: var(--ink-secondary);
}

.entry-body h5,
.entry-body h6 {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 3px 0 1px 0;
    color: var(--ink-tertiary);
}

/* Tactile Tables */
.tactile-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-paper-strong);
    background: var(--paper-card);
    box-shadow: var(--shadow-card);
}

table.tactile-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-serif);
    font-size: 14px;
    text-align: left;
}

table.tactile-table th {
    padding: 8px 12px;
    background: var(--paper-surface);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-paper-strong);
    white-space: nowrap;
}

table.tactile-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-paper);
    color: var(--ink-primary);
    line-height: 1.4;
}

table.tactile-table tr:last-child td {
    border-bottom: none;
}

table.tactile-table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.015);
}

/* Highlighter stroke */
mark.tactile-highlight {
    background: linear-gradient(104deg, rgba(254, 222, 105, 0.5) 0.9%, rgba(254, 225, 115, 0.8) 2.4%, rgba(254, 220, 95, 0.45) 5.8%, rgba(254, 225, 115, 0.7) 93%, rgba(254, 222, 105, 0.4) 96%);
    color: inherit;
    padding: 1px 4px;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Strikethrough */
.entry-body del {
    color: var(--ink-tertiary);
    text-decoration: line-through;
}

/* Tactile Ruled Line Divider */
hr.tactile-divider {
    border: none;
    height: 1px;
    background: var(--ink-faint);
    margin: 14px 0;
}

/* ==============================================================================
   11. DEDICATED DOCUMENT BADGES (OFFICE, LIBREOFFICE, PDF, ARCHIVES)
   ============================================================================== */
.doc-card-link {
    cursor: pointer;
}

.doc-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tactile-media-card:hover .doc-badge-icon {
    transform: scale(1.06);
}

/* Type Specific Palettes */
.doc-pdf {
    background: rgba(194, 89, 83, 0.12);
    color: #c25953;
}

.doc-word {
    background: rgba(43, 87, 154, 0.12);
    color: #2b579a;
}

.doc-excel {
    background: rgba(33, 115, 70, 0.12);
    color: #217346;
}

.doc-powerpoint {
    background: rgba(210, 71, 38, 0.12);
    color: #d24726;
}

.doc-archive {
    background: rgba(197, 145, 70, 0.12);
    color: #c59146;
}

.doc-audio {
    background: rgba(120, 66, 108, 0.12);
    color: #78426c;
}

.doc-video {
    background: rgba(63, 81, 181, 0.12);
    color: #3f51b5;
}

.doc-code {
    background: rgba(56, 52, 49, 0.12);
    color: #383431;
}

.doc-generic {
    background: rgba(117, 134, 115, 0.12);
    color: #758673;
}

/* Download Modal Badge & Action */
.download-preview-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
}

.btn-dialog-confirm {
    background: var(--terracotta);
    border: none;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(200, 101, 69, 0.3);
}

.btn-dialog-confirm:hover {
    background: var(--terracotta-hover);
    color: #fff;
}

/* ==============================================================================
   12. INFINITE SCROLL & OLDER MESSAGES LOADERS
   ============================================================================== */
.loading-older-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 0 6px 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 13.5px;
    color: var(--ink-tertiary);
    animation: fadeInEntry 0.2s ease;
}

.notebook-start-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0 8px 0;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-tertiary);
    opacity: 0.85;
}



