* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Format toggle buttons */
.format-toggle {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.format-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.format-btn:hover {
    border-color: #bbb;
    background: #f5f5f5;
}

.format-btn.active {
    border-color: #4a5fc1;
    background: #4a5fc1;
    color: white;
}

/* A4 mode styles */
body.a4-mode .planner-a2 {
    display: none !important;
}

body.a4-mode .planner-a4 {
    display: grid !important;
}

/* A4 Planner Layout */
.planner-a4 {
    width: 210mm;
    height: 297mm;
    margin: 0 auto;
    padding: 6mm 8mm;
    box-sizing: border-box;
    background: white;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0;
}

/* A4 New Header */
.a4-header-new {
    display: flex;
    align-items: center;
    margin-bottom: 5mm;
    padding-bottom: 3mm;
    border-bottom: 2px solid #000;
}

.a4-month-title-large {
    font-size: 56px;
    font-weight: 700;
    line-height: 0.9;
    text-transform: capitalize;
    color: var(--primary-color, #000);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
}

.a4-month-name {
    flex: 0 0 auto;
}

.a4-year-number {
    font-size: 24px;
    font-weight: 400;
    color: #999;
    margin-left: auto;
    text-align: right;
}

.a4-goals-grid {
    display: none;
}

/* A4 Content - Two Columns */
.a4-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10mm;
    min-height: 0;
}

.a4-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.a4-day-row {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: stretch;
    flex: 1;
    border-bottom: 1px solid #e5e5e5;
    padding-top: 2mm;
}

.a4-day-row:first-child {
    padding-top: 0;
}

.a4-day-row:last-child {
    border-bottom: none;
}

.a4-day-row-empty {
    border-bottom: 1px solid #e5e5e5;
    padding-top: 2mm;
}

.a4-day-row-empty:last-child {
    border-bottom: none;
}

.a4-day-number-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2px;
}

.a4-day-number {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #000;
    line-height: 1;
}

.a4-day-week {
    font-size: 10px;
    font-weight: 400;
    text-align: center;
    color: #999;
    line-height: 1.2;
    margin-top: 2px;
}

.a4-day-cell {
    padding: 2px 6px;
    outline: none;
    font-size: 10px;
    line-height: 1.4;
    overflow: hidden;
    word-wrap: break-word;
    white-space: normal;
    cursor: text;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.a4-day-line {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: flex-start;
    min-height: 16px;
}

.a4-day-line-icon-slot {
    width: 0;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    margin-right: 0;
    transition: width 0.2s ease, margin-right 0.2s ease, opacity 0.2s ease, background 0.15s ease;
    user-select: none;
    opacity: 0;
    overflow: hidden;
}

/* Empty slot - invisible and no width by default */
.a4-day-line-icon-slot:empty {
    opacity: 0;
    width: 0;
    margin-right: 0;
}

.a4-day-line-icon-slot:empty:before {
    content: '⊕';
    font-size: 16px;
    color: #999;
}

/* Show icon slot when it has an icon */
.a4-day-line-icon-slot:not(:empty) {
    opacity: 1;
    width: 16px;
    margin-right: 4px;
}

/* Show icon slot on hover or focus */
.a4-day-line:hover .a4-day-line-icon-slot:empty,
.a4-day-line:focus-within .a4-day-line-icon-slot:empty {
    opacity: 0.3;
    width: 16px;
    margin-right: 4px;
}

.a4-day-line:hover .a4-day-line-icon-slot:empty:hover,
.a4-day-line:focus-within .a4-day-line-icon-slot:empty:hover {
    background: #f0f0f0;
    opacity: 1;
}

.a4-day-line-icon-slot svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.a4-day-line-text {
    flex: 1;
    outline: none;
    min-width: 0;
    cursor: text;
    font-size: 12px;
    line-height: 1.4;
    transition: margin-left 0.2s ease;
}

.a4-day-line-text:empty:before {
    content: attr(data-placeholder);
    color: #ddd;
}

.a4-day-line-text:focus:empty:before {
    content: '';
}

.a4-day-cell:focus-within {
    background: #f9f9f9;
}

.a4-day-cell-icon-slot {
    width: 0;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    margin-right: 0;
    transition: width 0.2s ease, margin-right 0.2s ease, opacity 0.2s ease, background 0.15s ease;
    user-select: none;
    opacity: 0;
    overflow: hidden;
}

/* Empty slot - invisible and no width by default */
.a4-day-cell-icon-slot:empty {
    opacity: 0;
    width: 0;
    margin-right: 0;
}

.a4-day-cell-icon-slot:empty:before {
    content: '⊕';
    font-size: 16px;
    color: #999;
}

/* Show empty slot on hover or focus */
.a4-day-cell:hover .a4-day-cell-icon-slot:empty,
.a4-day-cell:focus-within .a4-day-cell-icon-slot:empty {
    opacity: 0.3;
    width: 16px;
    margin-right: 4px;
}

.a4-day-cell:hover .a4-day-cell-icon-slot:empty:hover,
.a4-day-cell:focus-within .a4-day-cell-icon-slot:empty:hover {
    background: #f0f0f0;
    opacity: 1;
}

/* Filled slot - always visible with full width */
.a4-day-cell-icon-slot:not(:empty) {
    opacity: 1;
    width: 16px;
    margin-right: 4px;
}

.a4-day-cell-icon-slot svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.a4-day-cell-text {
    flex: 1;
    outline: none;
    min-width: 0;
    cursor: text;
    font-size: 14px;
    line-height: 1.4;
    transition: margin-left 0.2s ease;
}

.a4-day-cell > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.a4-day-cell-text:empty:before {
    content: attr(data-placeholder);
    color: #ddd;
}

/* Print styles */
@media print {
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    /* Hide UI elements */
    .controls,
    .emoji-quick-picker,
    .icon-quick-picker {
        display: none !important;
    }
    
    /* Hide ALL icon slots in print (empty or not) */
    .day-cell-icon-slot:empty,
    .day-line-icon-slot:empty,
    .a4-day-cell-icon-slot:empty,
    .a4-day-line-icon-slot:empty,
    .goal-line-icon-slot:empty {
        display: none !important;
        width: 0 !important;
        margin: 0 !important;
    }

    /* Hide icon slot placeholder and hover effects */
    .day-cell-icon-slot:empty:before,
    .day-line-icon-slot:empty:before,
    .a4-day-cell-icon-slot:empty:before,
    .a4-day-line-icon-slot:empty:before,
    .goal-line-icon-slot:empty:before,
    .day-cell-icon-slot:before,
    .day-line-icon-slot:before,
    .a4-day-cell-icon-slot:before,
    .a4-day-line-icon-slot:before,
    .goal-line-icon-slot:before {
        content: '' !important;
        display: none !important;
    }

    /* Hide all placeholders in print */
    [contenteditable]:before,
    [contenteditable]:empty:before,
    .day-cell:empty:before,
    .day-cell-text:before,
    .day-cell-text:empty:before,
    .day-line-text:before,
    .day-line-text:empty:before,
    .a4-day-cell:empty:before,
    .a4-day-cell-text:before,
    .a4-day-cell-text:empty:before,
    .a4-goal-line:empty:before,
    .goal-line-text:before,
    .goal-line-text:empty:before {
        content: '' !important;
        display: none !important;
    }

    /* A2 Print Mode */
    body:not(.a4-mode):not(.printing-a4-multi) .planner-a2 {
        width: 420mm;
        height: 594mm;
        margin: 0;
        padding: 0;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    body:not(.a4-mode):not(.printing-a4-multi) .planner-a4,
    body:not(.a4-mode):not(.printing-a4-multi) #print-a4-container {
        display: none !important;
    }

    /* A4 Single Month Print Mode (when viewing one month) */
    body.a4-mode:not(.printing-a4-multi) .planner-a2,
    body.a4-mode:not(.printing-a4-multi) #print-a4-container {
        display: none !important;
    }

    body.a4-mode:not(.printing-a4-multi) .planner-a4 {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 6mm 8mm;
        page-break-after: avoid;
        page-break-inside: avoid;
        box-sizing: border-box;
        display: grid !important;
    }

    /* A4 Multi-Month Print Mode (all 12 months) */
    body.printing-a4-multi .planner-a2,
    body.printing-a4-multi .planner-a4:not(.print-month-page) {
        display: none !important;
    }

    body.printing-a4-multi #print-a4-container {
        display: block !important;
    }

    body.printing-a4-multi .print-month-page {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 6mm 8mm;
        page-break-after: always;
        page-break-inside: avoid;
        box-sizing: border-box;
        display: grid !important;
        grid-template-rows: auto 1fr;
    }

    body.printing-a4-multi .print-month-page:last-child {
        page-break-after: avoid;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #ffffff;
    padding: 0;
}

.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    border-radius: 16px;
    z-index: 1000;
    width: 280px;
    opacity: 0.5;
    transition: opacity 0.3s ease, width 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.controls:hover {
    opacity: 1;
}

.controls.collapsed {
    width: 48px;
}

.controls-header {
    padding: 16px 20px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls.collapsed .controls-header {
    padding: 12px;
    justify-content: center;
}

.controls h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.controls.collapsed h3,
.controls.collapsed p,
.controls.collapsed .controls-body {
    display: none;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: transform 0.3s ease;
}

.controls.collapsed .toggle-btn {
    transform: none;
}

.controls-body {
    padding: 0 20px 20px 20px;
}

.controls p {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 16px;
}

.control-group {
    margin-bottom: 14px;
}

.control-group select {
    margin-top: 8px;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.control-label {
    font-size: 11px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.control-input-small {
    width: 50px;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    transition: all 0.2s;
    text-align: center;
}

.controls select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    transition: all 0.2s;
}

.controls input:focus,
.controls select:focus {
    outline: none;
    border-color: #000;
    background: white;
}

.color-picker {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #000;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #000;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 12px;
    color: #333;
    cursor: pointer;
}

.secondary-lang {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.controls button.print-btn {
    width: 100%;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls button.print-btn:hover {
    background: #333;
}

.icon-quick-picker {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none;
    z-index: 10000;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
}

.icon-quick-picker.active {
    display: flex;
}

.icon-categories {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f5f5f5;
    border-radius: 8px;
}

.icon-category {
    flex: 1;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-category svg {
    width: 18px;
    height: 18px;
    stroke: #666;
}

.icon-category:hover {
    background: #e5e5e5;
}

.icon-category:hover svg {
    stroke: #000;
}

.icon-category.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.icon-category.active svg {
    stroke: #000;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.quick-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    transition: all 0.15s;
}

.quick-icon svg {
    width: 16px;
    height: 16px;
    stroke: #333;
}

.quick-icon:hover {
    transform: scale(1.15);
    background: #e5e5e5;
}

.quick-icon:hover svg {
    stroke: #000;
}

.planner-page {
    width: 420mm;
    height: 594mm;
    padding: 15mm;
    padding-bottom: 20mm;
    margin: 0 auto;
    background: white;
    position: relative;
}

.pdf-footer {
    position: absolute;
    bottom: 3mm;
    right: 3mm;
    font-size: 6pt;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    display: none; /* Скрыт по умолчанию на экране */
}

.planner-a4 .pdf-footer {
    bottom: 2mm;
    right: 2mm;
    font-size: 5pt;
}

/* Показываем только при печати в PDF */
@media print {
    .pdf-footer {
        display: block !important;
    }
}

.header-section {
    display: flex;
    gap: 15mm;
    margin-bottom: 10mm;
    align-items: flex-start;
}

.year-column {
    flex-shrink: 0;
}

.year-number {
    font-size: 84pt;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -3px;
    outline: none;
    cursor: text;
    min-width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.year-number[data-empty="true"]:before {
    content: attr(data-placeholder);
    color: var(--primary-color);
    opacity: 0.3;
}

.goals-columns {
    display: flex;
    gap: 15mm;
    flex: 1;
}

.goals-column {
    flex: 1;
}

.goal-line {
    border-bottom: 0.75pt solid #c0c0c0;
    min-height: 7mm;
    margin-bottom: 4mm;
    outline: none;
    cursor: text;
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: flex-end;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 12pt;
}

.goal-line-icon-slot {
    width: 0;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    margin-right: 0;
    transition: width 0.2s ease, margin-right 0.2s ease, opacity 0.2s ease, background 0.15s ease;
    user-select: none;
    opacity: 0;
    overflow: hidden;
}

/* Empty slot - invisible and no width by default */
.goal-line-icon-slot:empty {
    opacity: 0;
    width: 0;
    margin-right: 0;
}

/* Show icon slot when it has an icon */
.goal-line-icon-slot:not(:empty) {
    opacity: 1;
    width: 18px;
    margin-right: 4px;
}

/* Show icon slot on hover or focus */
.goal-line:hover .goal-line-icon-slot:empty,
.goal-line:focus-within .goal-line-icon-slot:empty {
    opacity: 0.3;
    width: 18px;
    margin-right: 4px;
}

.goal-line-icon-slot:empty:before {
    content: '⊕';
    font-size: 18px;
    color: #999;
}

.goal-line:hover .goal-line-icon-slot:hover,
.goal-line:focus-within .goal-line-icon-slot:hover {
    background: #f0f0f0;
    opacity: 1;
}

.goal-line-icon-slot svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.goal-line-text {
    flex: 1;
    outline: none;
    min-width: 0;
    cursor: text;
    font-size: inherit;
    line-height: inherit;
    transition: margin-left 0.2s ease;
}

.goal-line:focus-within {
    background: #f9f9f9;
}

.months-header {
    display: grid;
    grid-template-columns: 20px repeat(12, minmax(0, 1fr)) 20px;
    column-gap: 0;
    padding-top: 5mm;
    padding-bottom: 3mm;
    margin-bottom: 1.5mm;
}

.months-header-line {
    border-top: 3pt solid var(--primary-color);
}

.month-spacer {
    grid-column: 1;
}

.month-spacer-right {
    grid-column: 14;
}

.month-name {
    text-align: left;
    margin-right: 6px;
    overflow: hidden;
}

.month-name:last-of-type {
    margin-right: 0;
}

.month-primary {
    font-size: 11pt;
    font-weight: 400;
    color: var(--primary-color);
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.month-secondary {
    font-size: 9pt;
    font-weight: 400;
    color: #999;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.day-row {
    display: grid;
    grid-template-columns: 20px repeat(12, minmax(0, 1fr)) 20px;
    column-gap: 0;
    align-items: stretch;
}

.day-number {
    font-size: 9pt;
    font-weight: 400;
    color: var(--primary-color);
    text-align: center;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    align-self: start;
}

.day-number-right {
    font-size: 9pt;
    font-weight: 400;
    color: #ccc;
    text-align: center;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    align-self: start;
    padding-top: 2px;
}

.day-number.star {
    font-size: 20pt;
    font-weight: 700;
    padding-bottom: 3mm;
}

.day-number-right.star {
    font-size: 20pt;
    font-weight: 700;
    padding-bottom: 3mm;
}

.day-cell-wrapper {
    margin-right: 6px;
    border-bottom: 0.75pt solid #c0c0c0;
    min-height: 13.5mm;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.day-cell-wrapper:last-of-type {
    margin-right: 0;
}

/* Last day of month - remove bottom border (no day below) */
.day-cell-wrapper.last-day-of-month {
    border-bottom: none;
}

.day-row.special .day-cell-wrapper {
    border-bottom: 2pt solid var(--primary-color);
    margin-right: 0;
}

/* Add spacing between cells in special row to match regular rows */
.day-row.special .day-cell-wrapper:not(:last-of-type) {
    margin-right: 6px;
}

.day-cell {
    outline: none;
    cursor: text;
    font-size: 8pt;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.3;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 0 4px 2px 0px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.day-line {
    display: flex;
    flex-direction: row;
    gap: 3px;
    align-items: flex-start;
    min-height: 16px;
}

.day-line-icon-slot {
    width: 0;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    margin-right: 0;
    transition: width 0.2s ease, margin-right 0.2s ease, opacity 0.2s ease, background 0.15s ease;
    user-select: none;
    opacity: 0;
    overflow: hidden;
}

/* Empty slot - invisible and no width by default */
.day-line-icon-slot:empty {
    opacity: 0;
    width: 0;
    margin-right: 0;
}

.day-line-icon-slot:empty:before {
    content: '⊕';
    font-size: 16px;
    color: #999;
}

/* Show empty slot on hover or focus */
.day-line:hover .day-line-icon-slot:empty,
.day-line:focus-within .day-line-icon-slot:empty {
    opacity: 0.3;
    width: 16px;
    margin-right: 3px;
}

.day-line:hover .day-line-icon-slot:empty:hover,
.day-line:focus-within .day-line-icon-slot:empty:hover {
    background: #f0f0f0;
    opacity: 1;
}

/* Filled slot - always visible with full width */
.day-line-icon-slot:not(:empty) {
    opacity: 1;
    width: 16px;
    margin-right: 3px;
}

.day-line-icon-slot svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.day-line-text {
    flex: 1;
    outline: none;
    min-width: 0;
    cursor: text;
    font-size: 8pt;
    color: #333;
    line-height: 1.3;
    transition: margin-left 0.2s ease;
}

.day-line-text > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-line-text:empty:before {
    content: attr(data-placeholder);
    color: #ccc;
    font-style: italic;
    white-space: nowrap;
}

.day-line-text:focus:empty:before {
    content: '';
}

.day-cell:focus-within {
    background: #f9f9f9;
}

/* Legacy support for old class names during transition */
.day-cell-icon-slot {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
    user-select: none;
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.day-cell-icon-slot:not(:empty) {
    opacity: 1;
    width: 16px;
    margin-right: 3px;
}

.day-cell:hover .day-cell-icon-slot:empty,
.day-cell:focus-within .day-cell-icon-slot:empty {
    opacity: 0.3;
    width: 16px;
    margin-right: 3px;
}

.day-cell-icon-slot:empty:before {
    content: '⊕';
    font-size: 16px;
    color: #999;
}

.day-cell:hover .day-cell-icon-slot:hover,
.day-cell:focus-within .day-cell-icon-slot:hover {
    background: #f0f0f0;
    opacity: 1;
}

.day-cell-icon-slot svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.day-cell-text {
    flex: 1;
    outline: none;
    min-width: 0;
    cursor: text;
    font-size: 8pt;
    color: #333;
    line-height: 1.3;
}

@media print {
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    .controls, .emoji-quick-picker {
        display: none !important;
    }

    .day-cell:focus, .goal-line:focus {
        background: white;
    }

    .day-cell:empty:before {
        content: '';
    }

    @page {
        size: A2 portrait;
        margin: 0;
    }

    .planner-page {
        width: 420mm;
        height: 594mm;
        page-break-after: avoid;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.calendar-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.calendar-item:hover {
    background: #f5f5f5;
}

.calendar-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
}

.calendar-item label {
    flex: 1;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.calendar-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.month-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.month-checkbox-item:hover {
    background: #f5f5f5;
}

.month-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #000;
}

/* Modern Modal Buttons */
.modal-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.modal-btn-primary {
    background: #000;
    color: white;
}

.modal-btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.modal-btn-secondary:hover {
    background: #e5e5e5;
}

.modal-btn-danger {
    background: #fee;
    color: #c24747;
    border: 1px solid #fdd;
}

.modal-btn-danger:hover {
    background: #fdd;
    border-color: #fcc;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0;
}

/* Year Selector Pills */
.year-selector {
    display: flex;
    gap: 8px;
}

.year-pill {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: #f5f5f5;
    color: #666;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.year-pill:hover {
    background: #e5e5e5;
}

.year-pill.selected {
    background: #000;
    color: white;
    border-color: #000;
}

/* Google Button */
#calendarButtonContainer {
    position: relative;
}

.google-btn {
    width: 100%;
    padding: 0;
    height: 44px;
    font-size: 13px;
    font-weight: 500;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.google-btn svg {
    flex-shrink: 0;
    display: block;
}

.google-btn span {
    line-height: 1;
    display: block;
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #d2d3d4;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

/* Убрал position: absolute - кнопки теперь просто переключаются через display */

/* Calendars Grid */
.calendars-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

/* PDF Options Modal */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #4CAF50;
    background: #f9f9f9;
}

.radio-option:has(input:checked) {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.radio-option input[type="radio"] {
    margin-top: 2px;
    cursor: pointer;
}

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.warning-box strong {
    color: #856404;
}
