/* ==========================================================================
   Predictive Privacy: Interactive Components & Demonstration Styles
   ========================================================================== */

/* ==========================================================================
   Interactive Elements from presentation.html & Social Sharing Previews
   ========================================================================== */

/* 1. Dynamic Typewriter Ransom-Note Title */
#tw-text {
    display: inline-block;
    min-height: 1.2em;
    vertical-align: middle;
}

.tw-char {
    display: inline-block;
    padding: 0.05em 0.18em;
    margin: 0 0.06em;
    border-radius: 2px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    line-height: 1.1;
    font-weight: 700;
}

/* 2. Interactive 3D WebGL Demonstration Containers */
.interactive-3d-demo {
    margin: 2.5rem 0;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: color-mix(in srgb, var(--code-bg) 50%, var(--paper));
    padding: 1.25rem;
    overflow: hidden;
}

.interactive-3d-demo .demo-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.interactive-3d-demo .demo-desc {
    font-size: 0.9375rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.canvas-3d-viewport {
    width: 100%;
    height: 420px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: #0b111e;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    touch-action: none;
}

.canvas-3d-viewport canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.viewport-badge-container {
    position: absolute;
    inset: 12px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
}

.viewport-badge {
    background: rgba(11, 17, 30, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.viewport-badge .badge-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.viewport-badge .badge-val {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f8fafc;
}

.badge-panda {
    color: #38bdf8 !important;
}

.badge-gibbon {
    color: #f43f5e !important;
}

.badge-fhe-client {
    color: #38bdf8 !important;
}

.badge-fhe-cloud {
    color: #f43f5e !important;
}

.graph-legend-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
    margin-top: 0.85rem;
    padding: 0.65rem 0.95rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.3;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.dot-cyan { background: #00d4ff; }
.dot-orange { background: #fe640b; }
.dot-magenta { background: #ff007f; }
.dot-green { background: #40a02b; }
.dot-pink { background: #f43f5e; }
.dot-blue { background: #38bdf8; }
.dot-target { background: #ffd700; }
.dot-surface { background: linear-gradient(135deg, #00d4ff, #ff007f); }
.dot-manifold { background: linear-gradient(135deg, #40a02b, #00d4ff); }
.dot-blue-plane { background: #38bdf8; border-radius: 2px; }
.dot-perturbed { background: #ffffff; box-shadow: 0 0 6px #ffffff; }

.sim-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.sim-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sim-btn {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sim-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sim-btn.active {
    background: var(--accent);
    color: var(--paper);
    border-color: var(--accent);
}

.sim-slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sim-slider-container input[type="range"] {
    accent-color: var(--accent);
    cursor: pointer;
}

/* 3. 4-Quadrant ML Manifold Pipeline Grid */
.ml-quad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
}

.ml-quad-card {
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--paper);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ml-quad-header {
    padding: 8px 12px;
    background: color-mix(in srgb, var(--code-bg) 50%, var(--paper));
    border-bottom: 1px solid var(--rule);
}

.ml-quad-header h4 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}

.ml-quad-sub {
    font-size: 0.6875rem;
    color: var(--muted);
    display: block;
    margin-top: 1px;
}

.ml-quad-canvas-wrap {
    width: 100%;
    height: 190px;
    background: #0b111e;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    touch-action: none;
}

.ml-quad-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* White space under the plot for legends */
.ml-quad-space-legend {
    padding: 7px 10px;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    min-height: 34px;
}

.quad-leg-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
    font-weight: 500;
}

@media (max-width: 640px) {
    .ml-quad-grid {
        grid-template-columns: 1fr;
    }
}

/* 4. Presentation 3-Phone Chat & Linguistic Inference Stage */
.chat-demo-container {
    margin: 2.5rem 0;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: color-mix(in srgb, var(--code-bg) 40%, var(--paper));
    padding: 1.5rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    overflow: visible;
    overflow-x: clip;
}

.chat-trio-stage {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    padding: 1.75rem 0.75rem;
    position: relative;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0 0.75rem;
    box-sizing: border-box;
    width: 100%;
    /* Prevent bleeding into page-level horizontal scroll */
    max-width: 100%;
}

.chat-trio-phone:first-child {
    margin-left: 0.5rem;
}

.chat-trio-phone:last-child {
    margin-right: 2.5rem;
}

.chat-trio-stage::-webkit-scrollbar {
    display: none;
}

.chat-trio-stage {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Base Phone Card Chassis */
.chat-trio-phone {
    background: #1a1a24;
    border: 8px solid #1a1a24;
    border-radius: 40px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    flex-shrink: 0;
    scroll-snap-align: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    isolation: isolate;
    box-sizing: border-box;
}

[data-theme="dark"] .chat-trio-phone {
    background: #11111b;
    border-color: #11111b;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
}

/* The Screen Frame with prominent rounded corners */
.chat-phone-screen {
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    isolation: isolate;
}

[data-theme="dark"] .chat-phone-screen {
    background: #181825;
}

/* Center Orwell Main Phone (Slide 15 & 16) */
.chat-trio-phone.main-phone {
    width: 268px;
    min-height: 530px;
    z-index: 10;
    border: 10px solid #1a1a24;
    border-radius: 42px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    isolation: isolate;
}

.chat-trio-phone.main-phone .chat-phone-screen {
    border-radius: 30px;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    isolation: isolate;
}

[data-theme="dark"] .chat-trio-phone.main-phone {
    border-color: #11111b;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6);
}

.chat-trio-phone.main-phone .chat-header {
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
}

.chat-trio-phone.main-phone .chat-input-area {
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

/* Side Phones: Bob & Alice screen corners */
.chat-trio-phone.side-phone .chat-phone-screen {
    border-radius: 28px;
}

.chat-trio-phone.side-phone .chat-header {
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
}

.chat-trio-phone.side-phone .chat-area {
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

/* Side Phones: Bob & Alice */
.chat-trio-phone.side-phone {
    width: 225px;
    min-height: 450px;
    z-index: 5;
    opacity: 0.96;
    transform: scale(0.96);
    transform-origin: center center;
}

.chat-trio-phone.side-phone.left-phone {
    transform: scale(0.96);
    transform-origin: center center;
}

.chat-trio-phone.side-phone.right-phone {
    transform: scale(0.96);
    transform-origin: center center;
}

@media (min-width: 860px) {
    .chat-trio-phone.side-phone.left-phone {
        transform: scale(0.96) rotate(-2deg);
    }
    .chat-trio-phone.side-phone.right-phone {
        transform: scale(0.96) rotate(2deg);
    }
}

.chat-trio-phone.active-focus {
    transform: scale(1.04) rotate(0deg) !important;
    z-index: 15 !important;
    box-shadow: 0 0 0 2px var(--accent), 0 20px 40px rgba(0, 0, 0, 0.28) !important;
}

/* Notch */
.chat-trio-phone .notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95px;
    height: 18px;
    background: #1a1a24;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 20;
}

[data-theme="dark"] .chat-trio-phone .notch {
    background: #11111b;
}

/* Phone Header */
.chat-trio-phone .chat-header {
    background: rgba(244, 244, 246, 0.95);
    backdrop-filter: blur(8px);
    padding: 26px 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e2e4ea;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
}

[data-theme="dark"] .chat-trio-phone .chat-header {
    background: rgba(24, 24, 37, 0.95);
    border-color: #313244;
}

/* Profile / Avatar Bubble Photos */
.chat-header-avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 4px;
    border: 1.5px solid var(--rule);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .chat-header-avatar-wrap {
    border-color: #45475a;
    background: #1e1e2e;
}

.chat-header-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    border-radius: 50%;
}

.chat-header-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}

.chat-header-status {
    font-size: 0.6875rem;
    color: var(--muted);
}

/* Chat Message Area */
.chat-trio-phone .chat-area {
    flex: 1;
    padding: 12px 10px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

[data-theme="dark"] .chat-trio-phone .chat-area {
    background: #1e1e2e;
}

.chat-trio-phone .msg {
    max-width: 84%;
    padding: 7px 11px;
    border-radius: 15px;
    font-size: 0.78125rem;
    line-height: 1.35;
    word-break: break-word;
}

.chat-trio-phone .msg.rcv {
    background: #e5e5ea;
    color: #000000;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

[data-theme="dark"] .chat-trio-phone .msg.rcv {
    background: #313244;
    color: #cdd6f4;
}

.chat-trio-phone .msg.sent {
    background: #007aff;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

/* Chat Message Photo Bubble */
.chat-trio-phone .msg.msg-photo-bubble {
    padding: 5px;
    background: #e5e5ea;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 86%;
    margin-top: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .chat-trio-phone .msg.msg-photo-bubble {
    background: #313244;
    border-color: #45475a;
}

.chat-photo-img {
    width: 100%;
    height: auto;
    max-height: 125px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

/* Typing Dots Indicator */
.chat-trio-phone .typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 6px 10px;
    width: fit-content;
    background: #e5e5ea;
    border-radius: 12px;
    border-bottom-left-radius: 3px;
}

[data-theme="dark"] .chat-trio-phone .typing {
    background: #313244;
}

.chat-trio-phone .tdot {
    width: 5px;
    height: 5px;
    background: #8e8e93;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-trio-phone .tdot:nth-child(1) { animation-delay: -0.32s; }
.chat-trio-phone .tdot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Drop Notifications on Side Phones */
.drop-notif {
    padding: 5px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.notif-age {
    background: #d20f39;
    color: #ffffff;
}

.notif-city {
    background: #1e66f5;
    color: #ffffff;
}

/* Input Area & Presentation Mock Keyboard */
.chat-input-area {
    background: #f4f4f6;
    padding: 6px 6px 6px;
    border-top: 1px solid #e2e4ea;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .chat-input-area {
    background: #181825;
    border-color: #313244;
}

.chat-input-bar {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 4px 10px;
    color: #007aff;
    font-size: 0.75rem;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .chat-input-bar {
    background: #11111b;
    border-color: #313244;
    color: #89b4fa;
}

.mock-kb {
    background: #d1d4d9;
    padding: 5px 3px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 0 2px;
    border-radius: 8px 8px 16px 16px;
}

[data-theme="dark"] .mock-kb {
    background: #11111b;
}

.kb-row {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.kb-key {
    background: #fefefe;
    border-radius: 4px;
    padding: 4px 0;
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    color: #000000;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
    max-width: 22px;
}

[data-theme="dark"] .kb-key {
    background: #313244;
    color: #cdd6f4;
}

.kb-key.wide {
    max-width: 32px;
    background: #b4b8c1;
}

[data-theme="dark"] .kb-key.wide {
    background: #45475a;
}

.kb-key.space {
    max-width: 100px;
}

.home-indicator-bar {
    width: 84px;
    height: 4px;
    background: #1a1a24;
    border-radius: 2px;
    margin: 6px auto 2px;
    opacity: 0.85;
}

[data-theme="dark"] .home-indicator-bar {
    background: #a6adc8;
}

/* Interactive Preset Buttons Row & Readout Card */
.chat-interactive-tester {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}

.tester-presets-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-test-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.preset-icon {
    margin-right: 2px;
}

/* 5. COMPAS Recidivism Cascade Styles */
.compas-cascade-section {
    margin: 2.5rem 0;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: color-mix(in srgb, var(--code-bg) 40%, var(--paper));
    padding: 1.25rem;
}

.compas-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.compas-card {
    border: 1px solid var(--rule);
    background: var(--paper);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compas-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.compas-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compas-card-photo {
    width: 64px;
    height: 78px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--rule);
    background: #ffffff;
    flex-shrink: 0;
}

.compas-card-meta h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.compas-card-meta .meta-race {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.compas-stat-item {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink);
}

.compas-stat-item strong {
    color: var(--text-bold);
}

.compas-risk-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    width: fit-content;
}

.compas-risk-tag.high {
    background: var(--accent-red);
}

.compas-risk-tag.med {
    background: #fe640b;
}

.compas-risk-tag.low {
    background: var(--accent-green);
}

/* 6. Social Share & Link Preview Widget */
.share-section-widget {
    margin: 3.5rem 0 2rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: color-mix(in srgb, var(--code-bg) 40%, var(--paper));
    padding: 1.5rem;
}

.share-widget-title {
    font-family: var(--font-mono);
    font-size: 0.78125rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.share-widget-title-sep {
    opacity: 0.6;
}

.share-preview-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 0.875rem;
    margin-bottom: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.share-preview-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.share-card-thumb {
    width: 140px;
    height: 78px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--rule);
    flex-shrink: 0;
}

.share-card-info {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.share-card-domain {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.share-card-heading {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 6px;
    color: var(--ink);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: break-word;
    word-break: break-word;
}

.share-card-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.4;
    margin: 0;
    white-space: normal;
    overflow: visible;
    display: block;
    overflow-wrap: break-word;
    word-break: break-word;
}

.share-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.share-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.share-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}

.share-toast {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-green);
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-toast.show {
    opacity: 1;
}

@media (max-width: 580px) {
    .share-section-widget {
        padding: 1rem;
    }
    .share-widget-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    .share-widget-title-sep {
        display: none;
    }
    .share-preview-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .share-card-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 180px;
    }
}

/* -------------------------------------------------------------------------- */
/* KaTeX LaTeX Math Styling                                                   */
/* -------------------------------------------------------------------------- */
.katex {
    font-size: 1.05em;
    text-rendering: auto;
}

.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    margin: 1rem 0;
}
