/* ============================================
   DM SCREEN - PREMIUM DARK MODE DESIGN
   Optimized & Cleaned
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #1f1f2e;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-danger: #ef4444;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --text-muted: #475569;

    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-medium: rgba(148, 163, 184, 0.2);
    --border-strong: rgba(148, 163, 184, 0.3);

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* Toolbar */
.app-toolbar {
    height: 64px;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    z-index: 100;
}

.app-toolbar .divider {
    width: 1px;
    height: 24px;
    background: var(--border-medium);
}

.toolbar-actions {
    display: flex;
    gap: var(--space-sm);
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    border-left: 1px solid var(--border-medium);
}

.logo-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    padding: 0;
    outline: none;
    cursor: text;
    transition: all var(--transition-fast);
    padding-left: var(--space-md);
    padding-top: var(--space-xs);
}

.logo-input:hover,
.logo-input:focus {
    color: var(--accent-primary);
}

/* Buttons */
button {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-base);
}

button:hover {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

button.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    color: var(--accent-danger);
    border-color: transparent;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
}

.btn-mini {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    justify-content: center;
}

/* Main Grid */
main {
    flex: 1;
    overflow-x: hidden;
    padding: var(--space-xs);
    background: var(--bg-primary);
}

.grid-stack-item-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
}

.grid-stack>.grid-stack-item>.grid-stack-item-content {
    overflow-y: hidden;
}

/* Edit Mode */
body.edit-mode .grid-stack-item-content {
    border: 2px dashed var(--accent-primary);
    background: var(--bg-tertiary);
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    cursor: grab;
    background: rgba(99, 102, 241, 0.05);
    display: none;
}

body.edit-mode .drag-overlay {
    display: block;
}

.widget-controls {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    padding-left: var(--space-md);
}

.widget-delete-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 101;
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.widget-delete-btn:hover {
    background: var(--accent-danger);
    color: white;
    transform: scale(1.1);
}

body.edit-mode .widget-delete-btn {
    display: flex;
}

.hidden {
    display: none !important;
}

.widget-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

/* Note Widget */
.notepad-wrapper {
    height: 100%;
}

.TinyMDE {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    height: 100% !important;
    overflow: auto;
}

.TinyMDE textarea,
.TinyMDE .CodeMirror {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-family: var(--font-mono) !important;
    font-size: 0.875rem !important;
    padding: var(--space-md) !important;
}

/* Counter Widget */
.counter-wrapper {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    height: 100%;
}

.counter-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
    overflow-y: auto;
}

.counter-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.counter-card:hover {
    border-color: var(--border-medium);
    background: var(--bg-elevated);
}

.counter-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
}

.counter-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.counter-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    min-width: 80px;
}

.counter-delete {
    opacity: 0;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.75rem;
    margin-left: var(--space-sm);
}

.counter-card:hover .counter-delete {
    opacity: 1;
}

.counter-delete:hover {
    color: var(--accent-danger);
}

.counter-body {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.counter-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
    padding: 0;
}

.counter-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

.counter-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.counter-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 24px;
    text-align: right;
    outline: none;
}

.counter-max-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.counter-max {
    outline: none;
    min-width: 24px;
    text-align: left;
}

.counter-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    opacity: 0.4;
}

.btn-add-counter {
    width: 100%;
    border-style: dashed;
    opacity: 0.6;
    padding: var(--space-sm);
    font-size: 0.75rem;
}

.btn-add-counter:hover {
    opacity: 1;
}

.counter-delete-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    cursor: pointer;
    z-index: 2;
}

.counter-card:hover .counter-delete-overlay {
    opacity: 1;
}

.counter-delete-overlay i {
    color: #ef4444;
    font-size: 0.9rem;
}

.counter-delete-overlay:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Converter Widget */
.converter-wrapper {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    justify-content: center;
    height: 100%;
}

.converter-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.converter-item:hover {
    border-color: var(--border-medium);
}

.converter-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.converter-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.converter-inputs input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    transition: all var(--transition-base);
    min-width: 0;
}

.converter-inputs input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.converter-unit {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* Stats Widget */
.stats-wrapper {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    height: 100%;
    overflow-y: auto;
}

.stats-header {
    display: flex;
    gap: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.stat-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-tertiary);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.stat-meta-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.stat-meta-val {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-primary);
    outline: none;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.stat-row:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

.stat-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.stat-val {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
}

.stat-mod-badge {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    border: 1px solid var(--border-subtle);
    min-width: 32px;
    text-align: center;
}

.stat-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-save-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.save-checkbox,
.skill-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    user-select: none;
}

.save-checkbox input[type="checkbox"],
.skill-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    position: relative;
    width: 14px;
    height: 14px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-medium);
    border-radius: 3px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.save-checkbox:hover .checkbox-custom,
.skill-checkbox:hover .checkbox-custom {
    border-color: var(--accent-primary);
}

.save-checkbox input:checked~.checkbox-custom,
.skill-checkbox input:checked~.checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.save-checkbox input:checked~.checkbox-custom::after,
.skill-checkbox input:checked~.checkbox-custom::after {
    display: block;
}

.save-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.save-mod {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 24px;
    text-align: right;
}

.stat-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.skill-tag.proficient {
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
}

.skill-tag input {
    display: none;
}

.skill-val {
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Iframe Widget */
.iframe-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.iframe-controls {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.iframe-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.iframe-content {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

/* Initiative Widget */
.init-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-md);
}

.init-header {
    display: grid;
    grid-template-columns: 1fr 60px 60px 40px;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.init-list {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.init-row {
    display: grid;
    grid-template-columns: 1fr 60px 60px 40px;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
}

.init-row:last-child {
    border-bottom: none;
}

.init-row input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    width: 100%;
}

.init-row input:focus {
    outline: none;
    background: var(--bg-tertiary);
}

.init-name {
    font-weight: 600;
    font-family: var(--font-primary) !important;
}

.init-controls {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
}

/* Coin Widget */
.coin-wrapper {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    height: 100%;
    justify-content: center;
}

.coin-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-xs);
}

.coin-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.coin-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-tertiary);
}

.coin-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 4px;
    text-align: center;
    font-family: var(--font-mono);
}

.coin-total {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
}

.coin-total-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
    /* Gold color */
    font-family: var(--font-mono);
}

.coin-total-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Dice Widget */
.dice-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: var(--space-md);
    padding: var(--space-sm);
}

.dice-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.dice-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
}

.dice-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.dice-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.dice-history-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    border-top: 1px solid var(--border-medium);
    padding-top: var(--space-sm);
}

.dice-history {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.dice-history-item {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Timer Widget */
.timer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: var(--space-md);
}

.timer-display {
    font-size: 3rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text-primary);
}

.timer-controls {
    display: flex;
    gap: var(--space-md);
}

/* GridStack Resize Handles */
.ui-resizable-handle {
    position: absolute;
    font-size: 0.1px;
    display: block;
    touch-action: none;
}

.ui-resizable-e {
    cursor: e-resize;
    width: 7px;
    right: -5px;
    top: 0;
    height: 100%;
}

.ui-resizable-s {
    cursor: s-resize;
    height: 7px;
    width: 100%;
    bottom: -5px;
    left: 0;
}

.ui-resizable-se {
    cursor: se-resize;
    width: 12px;
    height: 12px;
    right: 1px;
    bottom: 1px;
}

.ui-resizable-sw {
    cursor: sw-resize;
    width: 12px;
    height: 12px;
    left: 1px;
    bottom: 1px;
}

.ui-resizable-nw {
    cursor: nw-resize;
    width: 12px;
    height: 12px;
    left: 1px;
    top: 1px;
}

.ui-resizable-ne {
    cursor: ne-resize;
    width: 12px;
    height: 12px;
    right: 1px;
    top: 1px;
}

.ui-resizable-w {
    cursor: w-resize;
    width: 7px;
    left: -5px;
    top: 0;
    height: 100%;
}

.ui-resizable-n {
    cursor: n-resize;
    height: 7px;
    width: 100%;
    top: -5px;
    left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .app-toolbar {
        padding: 0 var(--space-md);
        height: 56px;
    }

    main {
        padding: var(--space-md);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landing Page */
.landing-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-base);
}

.landing-page.hidden {
    opacity: 0;
    pointer-events: none;
}

.landing-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-height: 80vh;
}

.landing-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.notebook-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.notebook-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.notebook-item:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.notebook-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notebook-name {
    font-weight: 600;
    color: var(--text-primary);
}

.notebook-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.notebook-delete {
    opacity: 0;
    color: var(--text-tertiary);
    padding: var(--space-sm);
    transition: all var(--transition-fast);
}

.notebook-item:hover .notebook-delete {
    opacity: 1;
}

.notebook-delete:hover {
    color: var(--accent-danger);
}

.landing-actions {
    display: flex;
    justify-content: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transform: scale(1);
    transition: transform var(--transition-fast);
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-message {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.modal-input-container {
    display: flex;
    flex-direction: column;
}

.modal-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    outline: none;
    width: 100%;
}

.modal-input:focus {
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}