/* ==========================================================================
   Design System & Variable Definition
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-workspace: hsl(150, 15%, 98%);
    --bg-header: rgba(255, 255, 255, 0.85);
    
    /* Green Glass Colors */
    --sun-bg-start: hsl(145, 60%, 95%);
    --sun-bg-end: hsl(145, 50%, 90%);
    --sun-border: hsl(145, 40%, 82%);
    --sun-glow: rgba(34, 197, 94, 0.12);
    --sun-glow-hover: rgba(34, 197, 94, 0.25);
    
    /* Thread Colors */
    --thread-color: hsl(145, 40%, 65%);
    
    /* Text Colors */
    --color-text-main: hsl(150, 25%, 20%);
    --color-text-muted: hsl(150, 10%, 45%);
    --color-text-light: hsl(0, 0%, 100%);
    
    /* UI States */
    --color-primary: hsl(145, 65%, 40%);
    --color-primary-hover: hsl(145, 75%, 35%);
    --color-primary-dark: hsl(145, 95%, 25%);
    --color-primary-light: hsl(145, 75%, 65%);
    --color-primary-lighter: hsl(145, 75%, 75%);
    
    --color-primary-alpha-10: rgba(40, 180, 100, 0.1);
    --color-primary-alpha-12: rgba(40, 180, 100, 0.12);
    --color-primary-alpha-20: rgba(40, 180, 100, 0.2);
    --color-primary-alpha-25: rgba(40, 180, 100, 0.25);
    
    --sun-border-glow: hsl(145, 60%, 75%);
    --sun-border-hover: hsl(145, 55%, 72%);
    --sun-border-dashed: rgba(40, 180, 100, 0.3);
    
    --btn-add-bg: rgba(40, 180, 100, 0.07);
    --btn-add-bg-hover: rgba(40, 180, 100, 0.16);
    --btn-add-border-hover: hsl(145, 65%, 65%);
    
    --color-border: hsl(150, 15%, 90%);
    --color-shadow: rgba(0, 0, 0, 0.06);
    
    /* Status Colors */
    --color-online: #22c55e;
    --color-offline: #ef4444;

    /* Zoom Configuration */
    --zoom-level: 1.0;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text-main);
    background-color: var(--bg-workspace);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    user-select: none; /* Prevent selection while dragging circles */
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Allow text editing fields to select text */
.bullet-input {
    user-select: text !important;
}

/* ==========================================================================
   Header & Controls
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px var(--color-shadow);
}

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

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

.logo-icon {
    font-size: 28px;
}

.logo-container h1 {
    font-size: 1.5rem;
    color: var(--color-text-main);
    margin: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.app-header h1 {
    font-size: 22px;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Header Session Meta Fields */
.session-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.meta-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-field input {
    border: 1px solid var(--color-border);
    background-color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: var(--color-text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.meta-field input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--sun-glow);
}

#meta-name {
    width: 130px;
}

#meta-subject {
    width: 150px;
}

#meta-participants {
    width: 180px;
}

/* Custom Tooltip in Header */
.has-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--color-text-muted);
}

.has-tooltip .tooltip-box {
    position: absolute;
    top: 145%; /* Display below the label instead of above */
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background-color: hsl(40, 25%, 15%);
    color: hsl(40, 20%, 93%);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    width: 220px;
    text-transform: none; /* Reset uppercase label styling */
    letter-spacing: normal;
    line-height: 1.35;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    text-align: center;
    pointer-events: none;
    font-weight: 500;
}

.has-tooltip .tooltip-box::after {
    content: '';
    position: absolute;
    bottom: 100%; /* Arrow at the top of the tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent hsl(40, 25%, 15%) transparent; /* Arrow points up */
}

.has-tooltip:hover .tooltip-box {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.print-header {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Inputs & Buttons */
.print-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.print-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.select-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background-color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text-main);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-input:focus {
    border-color: var(--color-primary);
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: hsl(0, 75%, 60%);
    color: var(--color-text-light);
}

.btn-danger:hover {
    background-color: hsl(0, 85%, 50%);
    transform: translateY(-1px);
}

/* ==========================================================================
   Workspace Layout (Desktop Interactive)
   ========================================================================== */
.workspace-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    min-height: 850px;
    padding: 40px;
    box-sizing: border-box;
}

/* SVG Connection Lines */
.connections-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.thread-line {
    fill: none;
    stroke: var(--thread-color);
    stroke-width: 3.5px;
    stroke-dasharray: 6 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

.thread-line-pulse {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

/* ==========================================================================
   Sun Wrappers and Circles (Representing Suns)
   ========================================================================== */
.sun-wrapper {
    position: absolute;
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.sun-wrapper.dragging {
    transition: none !important;
    transform: scale(1.03) !important;
    z-index: 1000 !important;
}

/* Concentric Light-Waves background container */
.sun-rays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sun-wave {
    position: absolute;
    border: 1.5px solid hsl(45, 75%, 82%);
    border-radius: 50%;
    opacity: 0;
    animation: pulse-wave 4s infinite linear;
    pointer-events: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.sun-wave-1 {
    animation-delay: 0s;
}

.sun-wave-2 {
    animation-delay: 2s;
}

@keyframes pulse-wave {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.18);
        opacity: 0.3;
        border-color: var(--sun-border-glow);
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* Sun Circle Main Card */
.sun-circle {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--sun-bg-start) 0%, var(--sun-bg-end) 100%);
    border: 2px solid var(--sun-border);
    
    /* Configured to start as a PERFECT circle.
       As it grows, it will dynamically become an oval/ellipse. */
    border-radius: 50%;
    box-shadow: 0 10px 30px var(--sun-glow), inset 0 2px 4px rgba(255,255,255,0.7);
    padding: 12%;
    width: calc(280px * var(--zoom-level));
    height: calc(280px * var(--zoom-level));
    
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.sun-wrapper:hover {
    transform: translateY(-4px);
    z-index: 50;
}

.sun-wrapper:hover .sun-circle {
    box-shadow: 0 16px 40px var(--sun-glow-hover);
    border-color: var(--sun-border-hover);
}

.sun-wrapper:hover .sun-wave {
    border-color: var(--sun-border-hover);
    animation-duration: 2.8s;
}

/* Circle Header - Drag Handle */
.circle-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(4px * var(--zoom-level));
    margin-bottom: calc(16px * var(--zoom-level));
    text-align: center;
    border-bottom: 1px dashed var(--sun-border-dashed);
    padding-bottom: calc(12px * var(--zoom-level));
    cursor: grab;
    width: 100%;
}

.circle-header:active {
    cursor: grabbing;
}

.circle-number {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    width: calc(24px * var(--zoom-level));
    height: calc(24px * var(--zoom-level));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: max(11px, calc(13px * var(--zoom-level)));
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 2px 6px var(--color-primary-alpha-20);
}

.circle-header h2 {
    font-size: max(14px, calc(18px * var(--zoom-level)));
    color: var(--color-text-main);
    font-weight: 700;
    letter-spacing: -0.2px;
}

.circle-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}

/* Bullet points list */
.bullet-list {
    list-style: none;
    margin-bottom: calc(14px * var(--zoom-level));
    display: flex;
    flex-direction: column;
    gap: calc(10px * var(--zoom-level));
}

/* Individual bullet item */
.bullet-item {
    display: flex;
    align-items: flex-start;
    gap: calc(8px * var(--zoom-level));
    position: relative;
    padding-right: calc(24px * var(--zoom-level));
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin-top: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.bullet-item:hover .drag-handle {
    opacity: 0.5;
}

.drag-handle:hover {
    opacity: 1 !important;
    color: var(--color-primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Dragging visual states */
.dragging-item {
    opacity: 0.4;
    background-color: rgba(0,0,0,0.02);
}

.drag-over-top {
    border-top: 2px solid var(--color-primary) !important;
}

.drag-over-bottom {
    border-bottom: 2px solid var(--color-primary) !important;
}

/* Custom list marker (author dropdown selector badge) */
.bullet-author-select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: calc(11px * var(--zoom-level));
    font-weight: 700;
    color: hsl(28, 85%, 45%);
    cursor: pointer;
    outline: none;
    margin-top: 2px;
    margin-right: 2px;
    padding: calc(2px * var(--zoom-level)) calc(5px * var(--zoom-level));
    border-radius: calc(5px * var(--zoom-level));
    background-color: var(--color-primary-alpha-12);
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
    min-width: calc(38px * var(--zoom-level));
    flex-shrink: 0;
    display: inline-block;
    transition: background-color 0.2s, color 0.2s, opacity 0.2s;
    user-select: none;
}

.bullet-author-select:hover {
    background-color: var(--color-primary-alpha-25);
    color: var(--color-primary-dark);
}

.bullet-author-select.empty {
    color: hsl(40, 15%, 60%);
    background-color: rgba(0, 0, 0, 0.05);
    min-width: calc(26px * var(--zoom-level));
}

.bullet-author-select.empty:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.print-author-badge {
    display: none; /* Hidden on screen */
}

/* Bullet Editable Content */
.bullet-input {
    flex-grow: 1;
    font-size: calc(14px * var(--zoom-level));
    line-height: 1.5;
    color: var(--color-text-main);
    border: none;
    background: transparent;
    outline: none;
    word-break: break-word;
    min-height: calc(21px * var(--zoom-level));
    cursor: text;
    padding: 1px 0;
}

.bullet-input[contenteditable="true"]:empty::before {
    content: attr(placeholder);
    color: hsl(40, 12%, 60%);
    font-style: italic;
    cursor: text;
}

/* Delete item button */
.delete-bullet-btn {
    position: absolute;
    right: 0;
    top: 2px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
}

.delete-bullet-btn:hover {
    color: var(--color-offline);
    background-color: rgba(239, 68, 68, 0.08);
}

.bullet-item:hover .delete-bullet-btn {
    opacity: 1;
}

/* Add Item Button */
.add-bullet-btn {
    background-color: var(--btn-add-bg);
    border: 1px dashed var(--sun-border);
    color: var(--color-primary);
    padding: calc(8px * var(--zoom-level)) calc(12px * var(--zoom-level));
    border-radius: calc(20px * var(--zoom-level));
    font-family: inherit;
    font-size: calc(13px * var(--zoom-level));
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    margin-top: auto;
    transition: all 0.2s ease;
}

.add-bullet-btn svg {
    width: calc(14px * var(--zoom-level));
    height: calc(14px * var(--zoom-level));
}

.add-bullet-btn:hover {
    background-color: var(--btn-add-bg-hover);
    border-color: var(--btn-add-border-hover);
    color: var(--color-primary-hover);
}

/* ==========================================================================
   Tooltips (LUDO rules)
   ========================================================================== */
.sun-tooltip {
    position: absolute;
    bottom: 106%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 250px;
    background-color: hsl(40, 25%, 15%);
    color: hsl(40, 20%, 93%);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    border: 1px solid rgba(255,255,255,0.08);
}

.sun-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: hsl(40, 25%, 15%) transparent transparent transparent;
}

.sun-circle:hover .sun-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sun-circle.hide-tooltip .sun-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Dynamic Tooltip Adjustments to prevent off-screen clipping */
.sun-circle.tooltip-below .sun-tooltip {
    bottom: auto;
    top: 106%;
    transform: translateX(-50%) translateY(-8px);
}

.sun-circle.tooltip-below .sun-tooltip::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent hsl(40, 25%, 15%) transparent;
}

.sun-circle.tooltip-below:hover .sun-tooltip {
    transform: translateX(-50%) translateY(0);
}

/* Left edge alignment */
.sun-circle.tooltip-left-align .sun-tooltip {
    left: 0;
    transform: translateY(8px);
}

.sun-circle.tooltip-left-align .sun-tooltip::after {
    left: 20px;
    transform: none;
}

.sun-circle.tooltip-left-align:hover .sun-tooltip {
    transform: translateY(0);
}

.sun-circle.tooltip-left-align.tooltip-below .sun-tooltip {
    transform: translateY(-8px);
}

.sun-circle.tooltip-left-align.tooltip-below:hover .sun-tooltip {
    transform: translateY(0);
}

/* Right edge alignment */
.sun-circle.tooltip-right-align .sun-tooltip {
    left: auto;
    right: 0;
    transform: translateY(8px);
}

.sun-circle.tooltip-right-align .sun-tooltip::after {
    left: auto;
    right: 20px;
    transform: none;
}

.sun-circle.tooltip-right-align:hover .sun-tooltip {
    transform: translateY(0);
}

.sun-circle.tooltip-right-align.tooltip-below .sun-tooltip {
    transform: translateY(-8px);
}

.sun-circle.tooltip-right-align.tooltip-below:hover .sun-tooltip {
    transform: translateY(0);
}

.sun-tooltip strong {
    color: var(--color-primary-light);
    font-family: 'Outfit', sans-serif;
    display: inline-block;
    margin-bottom: 4px;
}

.sun-tooltip em {
    color: var(--color-primary-lighter);
    font-style: normal;
    font-weight: 600;
}

/* ==========================================================================
   Print Layout Styles
   ========================================================================== */
@media print {
    .no-print,
    .app-header,
    .add-bullet-btn,
    .delete-bullet-btn,
    .sun-tooltip,
    .bullet-author-select {
        display: none !important;
    }

    /* Print-friendly author initials badge */
    .print-author-badge {
        display: inline-block !important;
        font-family: inherit;
        font-size: 8.5pt;
        font-weight: 700;
        color: #111111;
        border: 1px solid #666666;
        padding: 1px 4px;
        border-radius: 3px;
        margin-right: 5px;
        line-height: 1;
        vertical-align: middle;
        text-transform: uppercase;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html, body {
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        overflow: visible !important;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .workspace-container {
        padding: 0 !important;
        background-color: #ffffff !important;
    }

    .print-header {
        display: block !important;
        width: 100% !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 12px !important;
        margin-bottom: 24px !important;
    }

    .print-meta {
        display: flex !important;
        gap: 40px !important;
        font-size: 13pt !important;
        margin-top: 8px !important;
    }

    .sun-circle {
        background: #ffffff !important;
        border: 2px solid #000000 !important;
        box-shadow: none !important;
        color: #000000 !important;
    }

    .circle-number {
        background-color: #000000 !important;
        color: #ffffff !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .circle-header {
        border-bottom: 1px dashed #000000 !important;
        cursor: default !important;
    }

    .bullet-marker {
        display: none !important; /* Replaced by print initials badge where selected */
    }

    .bullet-item {
        padding-right: 0 !important;
    }

    .bullet-input {
        color: #000000 !important;
    }

    .sun-wave {
        display: none !important;
    }

    /* Print Mode 1: Combined Layout (All 5 on one landscape sheet) */
    body.print-layout-combined {
        size: A4 landscape;
    }

    body.print-layout-combined .workspace-container {
        width: 100% !important;
        height: 95vh !important;
        position: relative;
        overflow: hidden;
        transform: none !important;
        zoom: 1 !important;
    }

    /* Scale circles down natively to fit the A4 page without relying on buggy browser zoom */
    body.print-layout-combined .sun-circle {
        width: 17vw !important;
        min-height: 17vw !important;
        padding: 1.5vw !important;
        border-width: 0.15vw !important;
    }

    body.print-layout-combined .circle-header h2 {
        font-size: 1.5vw !important;
    }

    body.print-layout-combined .bullet-input {
        font-size: 1vw !important;
        line-height: 1.2 !important;
    }

    body.print-layout-combined .circle-number {
        width: 2vw !important;
        height: 2vw !important;
        font-size: 1vw !important;
        top: -1vw !important;
    }

    body.print-layout-combined .print-header {
        margin-bottom: 1vw !important;
        padding-bottom: 0.5vw !important;
    }

    body.print-layout-combined .print-header h2 {
        font-size: 2.5vw !important;
    }

    body.print-layout-combined .print-meta {
        font-size: 1.2vw !important;
        gap: 2vw !important;
        margin-top: 0.5vw !important;
    }

    body.print-layout-combined .connections-canvas {
        display: block !important;
    }

    body.print-layout-combined .thread-line {
        stroke: #333333 !important;
        opacity: 0.8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Print Mode 2: Split Layout (1 circle per A4 portrait sheet) */
    body.print-layout-split {
        size: A4 portrait;
    }

    body.print-layout-split .connections-canvas {
        display: none !important;
    }

    body.print-layout-split .workspace-container {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
    }

    body.print-layout-split .sun-wrapper {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        min-height: auto !important; /* Let height be natural to prevent page overflow */
        margin: 0 !important;
        padding: 10mm 0 !important; /* Safe padding for centering without page overflow */
        page-break-inside: avoid !important;
        page-break-after: always !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    body.print-layout-split .sun-wrapper:last-child {
        page-break-after: avoid !important;
    }

    body.print-layout-split .sun-circle {
        width: 80% !important;
        max-width: 600px !important;
        padding: 50px !important;
        height: auto !important;
        min-height: 400px !important;
        border-radius: 30px !important;
    }

    body.print-layout-split .bullet-input {
        font-size: 16pt !important;
        line-height: 1.6;
    }
    
    body.print-layout-split .circle-header h2 {
        font-size: 24pt !important;
    }

    /* Force Zoom level to 100% on PDF print */
    :root {
        --zoom-level: 1.0 !important;
    }
}

/* ==========================================================================
   Zoom Controls
   ========================================================================== */
.zoom-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    padding: 8px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 200;
}

.circle-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 4px;
    justify-content: center;
    align-items: center;
}

.circle-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 180, 100, 0.08);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    margin: 0;
    transition: transform 0.2s, color 0.2s, background 0.2s;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
}

.circle-actions button svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 2px;
    transform-origin: center center;
}

.toggle-view-btn svg {
    transform: scale(1.2);
}

.circle-actions button:hover {
    transform: scale(1.1);
    background: rgba(40, 180, 100, 0.2);
    color: var(--color-primary);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    outline: none;
}

.zoom-btn:hover {
    background: var(--color-primary);
    color: var(--color-text-light);
    transform: scale(1.08);
}

.zoom-btn i {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}

/* Focus Mode additions */
.focus-circle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    transition: transform 0.2s, color 0.2s;
}

.focus-circle-btn:hover {
    transform: scale(1.1);
    color: var(--color-primary);
}

body.focus-mode {
    overflow: hidden !important;
}

body.focus-mode .connections-canvas {
    opacity: 0;
    pointer-events: none;
}

body.focus-mode .sun-wrapper:not(.focused) {
    display: none !important;
}

body.focus-mode .sun-wrapper.focused {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    z-index: 2000 !important;
    margin: 0 !important;
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}

#zoom-level-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    font-family: 'Outfit', sans-serif;
    user-select: none;
    padding: 2px 0;
    min-width: 34px;
    text-align: center;
}

/* ==========================================================================
   Responsive Layout (Mobile & Tablet Portrait)
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .app-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding: 16px 20px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
    }

    .session-meta {
        flex-wrap: wrap;
    }

    .connections-canvas {
        display: none !important; /* Hide threads on mobile */
    }

    .workspace-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 40px;
        padding: 20px 10px 100px 10px; /* Extra bottom padding for zoom controls */
        min-height: auto;
    }

    .sun-wrapper {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* Disable dragging of the circle itself on mobile */
    .circle-header {
        cursor: default;
    }
    
    .circle-header:active {
        cursor: default;
    }

    .zoom-controls {
        bottom: 10px;
        right: 10px;
        flex-direction: row;
        border-radius: 20px;
        padding: 4px 12px;
    }
}

/* ==========================================================================
   Collaboration UI & Privacy Banner
   ========================================================================== */

/* Privacy Warning Banner */
.privacy-banner {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-text-muted);
    padding: 12px 24px;
    margin: 16px 40px 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.privacy-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-main);
    font-size: 13px;
    line-height: 1.5;
}

.privacy-banner .banner-content i {
    color: var(--color-text-muted);
    width: 20px;
    height: 20px;
}

.privacy-banner .close-banner {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.privacy-banner .close-banner:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--color-text-main);
}

.privacy-banner.hidden {
    display: none;
}

/* Collab Button specific */
.btn-collab {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    position: relative;
    padding-right: 28px;
}

.btn-collab:hover {
    border-color: var(--color-primary);
    background-color: rgba(34, 197, 94, 0.05);
    transform: translateY(-1px);
}

.btn-collab.active-session {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.status-dot {
    position: absolute;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s;
}

.status-dot.offline {
    background-color: var(--color-text-muted);
}

.status-dot.online {
    background-color: var(--color-online);
    box-shadow: 0 0 8px var(--color-online);
}

/* Collaboration Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 16px;
    width: calc(100% - 32px);
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--color-text-main);
}

.close-modal {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
}

.close-modal:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--color-text-main);
}

.modal-body {
    padding: 24px;
}

.collab-tabs {
    display: flex;
    background-color: rgba(0,0,0,0.03);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: #ffffff;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fade-in 0.2s ease;
}

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

.panel-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.full-width {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.info-area {
    margin-top: 20px;
    background-color: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.info-group {
    margin-bottom: 16px;
}

.info-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.copy-box {
    display: flex;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.copy-box code {
    flex: 1;
    padding: 10px 12px;
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.icon-btn {
    background: none;
    border: none;
    border-left: 1px solid var(--color-border);
    padding: 0 12px;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: rgba(0,0,0,0.03);
    color: var(--color-primary);
}

.help-text {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.host-status, .join-status {
    margin-top: 12px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
    color: var(--color-text-muted);
}

.active-session-info {
    text-align: center;
    padding: 20px 0;
}

.pulse-ring {
    width: 60px;
    height: 60px;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(34, 197, 94, 0.2);
    animation: modal-pulse 2s infinite;
}

@keyframes modal-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.active-session-info h3 {
    margin: 0 0 8px 0;
    color: var(--color-text-main);
}

.active-session-info p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0 0 20px 0;
}

.connected-peers {
    background-color: rgba(0,0,0,0.03);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 24px;
    color: var(--color-text-main);
}

.connected-peers strong {
    color: var(--color-primary);
    font-size: 16px;
}

/* ==========================================================================
   Atom Model Layout Styles
   ========================================================================== */
.view-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}


.atom-wrapper {
    position: absolute;
    z-index: 15;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.atom-wrapper.dragging {
    transition: none !important;
    transform: translate(-50%, -50%) scale(1.05) !important;
    z-index: 1000 !important;
}

.atom-circle {
    background: linear-gradient(135deg, var(--sun-bg-start) 0%, var(--sun-bg-end) 100%);
    border: 2px solid var(--sun-border);
    border-radius: 50%;
    box-shadow: 0 4px 15px var(--sun-glow), inset 0 2px 4px rgba(255,255,255,0.7);
    width: calc(160px * var(--zoom-level));
    height: calc(160px * var(--zoom-level));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10%;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.atom-wrapper:hover .atom-circle {
    box-shadow: 0 8px 25px var(--sun-glow-hover);
    border-color: hsl(145, 55%, 72%);
}

.atom-bond {
    fill: none;
    stroke: var(--thread-color);
    stroke-width: 2.5px;
    opacity: 0.6;
}

/* Hide bullet list inside circle when in atom mode */
.sun-circle[data-view-mode="atom"] .bullet-list {
    display: none;
}

/* ==========================================================================
   Guide Sidebar
   ========================================================================== */
.guide-edge-toggle {
    position: fixed;
    right: 0;
    top: 30%;
    transform: translateY(-50%);
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 16px 8px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 2999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: right 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Focus Mode Navigation Buttons */
.focus-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    color: white;
    border: none;
    width: 48px;
    height: 64px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

body.focus-mode .focus-nav-btn {
    opacity: 1;
    pointer-events: auto;
}

.focus-nav-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-50%) scale(1.05);
}

.focus-nav-btn.left {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.focus-nav-btn.right {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.guide-edge-toggle:hover {
    background: var(--color-primary-hover);
}

.guide-edge-toggle span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
}

.guide-edge-toggle.hidden {
    right: -50px; /* Slide off screen when sidebar is open */
}

.guide-sidebar {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.guide-sidebar.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

.guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
}

.guide-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--color-text-main);
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    display: flex;
}

.close-btn:hover {
    color: var(--color-danger);
}

.guide-content {
    padding: 20px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.guide-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: rgba(40, 180, 100, 0.1);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-icon svg {
    width: 20px;
    height: 20px;
}

.guide-text strong {
    display: block;
    margin-bottom: 4px;
    color: var(--color-text-main);
    font-size: 14px;
}

.guide-text p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.4;
}
