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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #e5e5e5;
    overflow: hidden;
    height: 100vh;
    color: #1d1d1f;
    position: relative;
}

body.counters-view-active {
    background: linear-gradient(135deg, 
        #ffffff 0%,
        #e8f9ff 15%,
        #c1f5ff 30%,
        #c1f5ff 50%,
        #c1f5ff 70%,
        #e8d5ff 85%,
        #ffffff 100%) !important;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 20%,
        rgba(255, 255, 255, 0.9) 40%,
        rgba(255, 255, 255, 0.9) 60%,
        rgba(255, 255, 255, 0.5) 80%,
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 0;
}

body.counters-view-active::before {
    display: none;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#calendar-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    position: relative;
    z-index: 2;
}

#calendar-canvas:active {
    cursor: grabbing;
}

#center-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 10%,
        rgba(255,255,255,0.7) 30%,
        rgba(255,255,255,0.7) 70%,
        rgba(255,255,255,0.4) 90%,
        rgba(255,255,255,0) 100%);
    backdrop-filter: blur(20px);
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 0 20px rgba(255,255,255,0.5),
                inset 0 0 8px rgba(255,255,255,0.6);
}

.glass {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08),
                0 2px 6px rgba(0,0,0,0.04),
                inset 0 1px 0 rgba(255,255,255,0.6);
    color: rgba(0,0,0,0.7);
}

.glass:hover {
    background: rgba(255,255,255,0.7);
    box-shadow: 0 10px 32px rgba(0,0,0,0.12),
                0 3px 8px rgba(0,0,0,0.06),
                inset 0 1px 0 rgba(255,255,255,0.7);
}

.glass:active {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08),
                0 2px 6px rgba(0,0,0,0.04),
                inset 0 1px 0 rgba(255,255,255,0.6);
}

#date-controls {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    z-index: 100;
}

#current-date {
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    cursor: pointer;
    letter-spacing: 0;
}

#chat-btn {
    position: absolute;
    top: 30px;
    right: 110px;
    padding: 14px 18px;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.3s ease;
}

#chat-btn img {
    width: 28px;
    height: 28px;
    display: block;
}

#chat-btn:hover img {
    opacity: 0.7;
}

#menu-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    padding: 14px 18px;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#menu-btn img {
    width: 28px;
    height: 28px;
    display: block;
}

#toggle-months-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(30px + 130px + 30px + 20px + 10px);
    right: 30px;
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    z-index: 51;
    transition: bottom 0.3s ease, transform 0.3s ease;
    transform: rotate(90deg);
}

#toggle-months-btn.hidden-months {
    bottom: 30px;
    transform: rotate(-90deg);
}

#add-event-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(30px + 130px + 30px + 20px + 10px);
    width: 58px;
    height: 58px;
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(0,0,0,0.5);
    z-index: 100;
    transition: bottom 0.3s ease;
}

#add-event-btn img {
    width: 28px;
    height: 28px;
    display: block;
}

#add-event-btn.hidden-months {
    bottom: 30px;
}

#controls {
    position: absolute;
    top: 30px;
    left: 30px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    z-index: 100;
    align-items: center;
}

#view-toggle-btn {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#view-toggle-btn img {
    width: 28px;
    height: 28px;
    display: block;
}

.menu-dropdown {
    position: absolute;
    top: 90px;
    right: 30px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15),
                0 2px 6px rgba(0,0,0,0.08);
    padding: 8px;
    min-width: 180px;
    z-index: 1000;
}

.menu-dropdown button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(0,0,0,0.8);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.menu-dropdown button:hover {
    background: rgba(0,0,0,0.05);
}

.menu-dropdown button:active {
    background: rgba(0,0,0,0.1);
}

.auth-error {
    color: #ff3b30;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.btn-secondary {
    margin-top: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.7;
}

.settings-value {
    font-size: 15px;
    font-weight: 500;
    padding: 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    margin-top: 8px;
}

.language-select {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.language-select:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.language-select:focus {
    border-color: #667eea;
}

.openai-key-input {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: white;
    outline: none;
    transition: border-color 0.2s;
    font-family: monospace;
}

.openai-key-input:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.openai-key-input:focus {
    border-color: #667eea;
}

#chat-popup .popup-content {
    position: relative;
    width: 90vw;
    max-width: 500px;
    height: 80vh;
    max-height: 700px;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
}

.chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.chat-popup-close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(0,0,0,0.8);
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.chat-popup-close:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease;
}

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

.chat-message.user {
    align-self: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 15px;
}

.chat-message.user .chat-message-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.chat-message.assistant .chat-message-content {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(0,0,0,0.85);
}

.chat-message-content h1,
.chat-message-content h2,
.chat-message-content h3 {
    margin: 8px 0 6px 0;
    font-weight: 700;
    line-height: 1.3;
}

.chat-message-content h1 {
    font-size: 16px;
    color: rgba(102, 126, 234, 0.95);
}

.chat-message-content h2 {
    font-size: 15px;
    color: rgba(102, 126, 234, 0.9);
}

.chat-message-content h3 {
    font-size: 14px;
    color: rgba(102, 126, 234, 0.85);
}

.chat-message-content p {
    margin: 4px 0;
    line-height: 1.5;
}

.chat-message-content strong {
    font-weight: 700;
    color: rgba(102, 126, 234, 0.95);
}

.chat-message-content em {
    font-style: italic;
    opacity: 0.9;
}

.chat-message-content code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.chat-message-content ul {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

.chat-message-content li {
    margin: 4px 0;
    padding-left: 20px;
    position: relative;
}

.chat-message-content li:before {
    content: "•";
    position: absolute;
    left: 8px;
    color: rgba(102, 126, 234, 0.7);
    font-weight: bold;
}

.chat-message.user .chat-message-content h1,
.chat-message.user .chat-message-content h2,
.chat-message.user .chat-message-content h3 {
    color: white;
}

.chat-message.user .chat-message-content strong {
    color: white;
    font-weight: 700;
}

.chat-message.user .chat-message-content code {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-message.user .chat-message-content li:before {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input-container {
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: none;
    flex-shrink: 0;
    background: transparent;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    outline: none;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.chat-input:focus {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.15);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.chat-send-btn:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.chat-send-btn svg {
    color: white;
}

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

.chat-unauthorized {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.chat-unauthorized-content {
    text-align: center;
    max-width: 400px;
}

.chat-unauthorized-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.chat-unauthorized-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: rgba(0,0,0,0.85);
    margin-bottom: 12px;
}

.chat-unauthorized-content p {
    font-size: 15px;
    color: rgba(0,0,0,0.65);
    line-height: 1.6;
    margin-bottom: 20px;
}

.chat-link {
    display: inline-block;
    color: rgba(102, 126, 234, 0.95);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.chat-link:hover {
    color: rgba(102, 126, 234, 1);
    text-decoration: underline;
}

.chat-login-btn,
.chat-settings-btn {
    margin-top: 8px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
}

.chat-send-btn svg {
    stroke: rgba(102, 126, 234, 0.8);
}

.chat-message.thinking .chat-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-thinking-dots {
    display: flex;
    gap: 4px;
}

.chat-thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.6);
    animation: thinkingBounce 1.4s infinite ease-in-out both;
}

.chat-thinking-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-thinking-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes thinkingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

#month-cards {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    gap: 20px;
    z-index: 50;
    overflow-x: auto;
    overflow-y: visible;
    padding: 20px 5% 30px 5%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#month-cards::-webkit-scrollbar {
    display: none;
}

#month-cards.hidden-months {
    transform: translateY(200px);
    opacity: 0;
    pointer-events: none;
}

.month-card {
    padding: 20px 18px;
    height: 130px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: auto;
    min-width: max-content;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.month-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25),
                0 4px 16px rgba(0, 0, 0, 0.1);
}

.month-card.current-month {
    border: 2px solid rgba(72, 163, 181, 0.5);
}

.month-card-title {
    font-size: 17px;
    font-weight: 600;
    color: rgba(0,0,0,0.7);
    margin-bottom: 16px;
    letter-spacing: -0.4px;
}

.month-card-events {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 4px;
    align-items: center;
    flex: 1;
    min-height: 0;
    min-width: 70px;
}

.event-circle {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 10px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 1.5px solid transparent;
    box-shadow: 0 6px 12px rgba(31, 38, 135, 0.2),
                0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    overflow: visible;
    position: relative;
    padding: 1px;
}

.event-circle::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 10px;
    padding: 1.5px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.8) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.event-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    pointer-events: none;
    z-index: 3;
}

.event-circle img {
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    object-fit: cover;
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 0;
}

.popup.hidden {
    display: none;
}

#event-tooltip {
    position: absolute;
    padding: 10px 16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15),
                0 2px 6px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.8);
    color: rgba(0,0,0,0.85);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#event-tooltip.hidden {
    display: none;
}

.popup-content {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    border: 1.5px solid rgba(255,255,255,0.9);
    border-radius: 32px;
    padding: 22px;
    max-width: 540px;
    width: 90%;
    box-shadow: 0 24px 70px rgba(0,0,0,0.18),
                inset 0 2px 0 rgba(255,255,255,1);
    position: relative;
    margin: auto;
}

.popup-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    color: rgba(0,0,0,0.92);
    letter-spacing: -0.8px;
    line-height: 1.2;
    text-align: center;
}

.popup::-webkit-scrollbar {
    width: 8px;
}

.popup::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.popup::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.popup::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    font-size: 24px;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: rgba(0,0,0,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.9);
}

.popup-close:hover {
    background: rgba(255,255,255,0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12),
                inset 0 1px 0 rgba(255,255,255,0.9);
}

.popup-back {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0,0,0,0.5);
    transition: all 0.2s ease;
    font-weight: 600;
    line-height: 1;
}

.popup-image {
    width: 260px;
    height: 260px;
    max-width: 100%;
    background: linear-gradient(135deg, rgba(102,126,234,0.15) 0%, rgba(118,75,162,0.15) 100%);
    backdrop-filter: blur(30px);
    border-radius: 10px;
    margin: 0 auto 28px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 1.5px solid rgba(255,255,255,0.6);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08),
                inset 0 2px 0 rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 18px;
    color: rgba(0,0,0,0.92);
    letter-spacing: -0.8px;
    line-height: 1.2;
}

.popup-description {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(0,0,0,0.75);
    margin-bottom: 20px;
}

.popup-info-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.popup-info {
    font-size: 16px;
    color: rgba(0,0,0,0.55);
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    display: inline-block;
}

.popup-age {
    margin-top: 0;
}

.add-event-form {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
}

.add-event-form h3 {
    margin: 0 0 28px 0;
    font-size: 26px;
    font-weight: 600;
    color: rgba(0,0,0,0.9);
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0,0,0,0.8);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: 14px;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    font-size: 15px;
    font-family: inherit;
    color: rgba(0,0,0,0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05),
                inset 0 1px 0 rgba(255,255,255,0.6);
}

.form-group input[type="file"]::file-selector-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(102,126,234,0.15);
    color: rgba(0,0,0,0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: rgba(102,126,234,0.25);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="month"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(102,126,234,0.5);
    background: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1),
                0 4px 12px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.7);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: rgba(0,0,0,0.8);
}

.radio-group label:hover {
    color: rgba(102,126,234,0.9);
}

.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid rgba(102,126,234,0.3);
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
}

.radio-group input[type="radio"]:hover {
    background: rgba(255,255,255,0.7);
    border-color: rgba(102,126,234,0.5);
}

.radio-group input[type="radio"]:checked {
    border-color: rgba(102,126,234,0.8);
    background: rgba(102,126,234,0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 12px rgba(102,126,234,0.3),
                inset 0 1px 0 rgba(255,255,255,0.9);
}

.radio-group input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(102,126,234,1);
    box-shadow: 0 0 4px rgba(102,126,234,0.5);
}

input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid rgba(102,126,234,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    margin-right: 12px;
    transition: all 0.2s ease;
}

input[type="checkbox"]:hover {
    background: rgba(255,255,255,0.7);
    border-color: rgba(102,126,234,0.5);
}

input[type="checkbox"]:checked {
    border-color: rgba(102,126,234,0.8);
    background: rgba(102,126,234,0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 12px rgba(102,126,234,0.3),
                inset 0 1px 0 rgba(255,255,255,0.9);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid rgba(102,126,234,1);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.form-group label input[type="checkbox"] {
    margin-right: 12px;
    vertical-align: middle;
}

.form-group label span {
    vertical-align: middle;
}

#daily-age-group,
#daily-counter-group,
#edit-daily-age-group,
#edit-daily-counter-group {
    margin-top: 8px;
}

.color-presets {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

#custom-colors-container {
    display: inline-flex;
    gap: 12px;
    align-items: center;
}

.color-preset {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-preset:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.color-preset.active {
    border-color: rgba(0,0,0,0.5);
    border-width: 3px;
}

.custom-color-btn {
    background: rgba(255,255,255,0.5) !important;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-color-btn .color-icon {
    font-size: 24px;
}

.icon-type-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: rgba(102,126,234,0.12);
    padding: 5px;
    border-radius: 14px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(102,126,234,0.15);
    box-shadow: inset 0 2px 4px rgba(102,126,234,0.2),
                inset 0 -1px 2px rgba(255,255,255,0.3);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0,0,0,0.5);
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:active {
    background: transparent;
}

.tab-btn.active {
    background: rgba(255,255,255,0.9);
    color: rgba(0,0,0,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12),
                0 1px 3px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.tab-btn.active:active {
    background: rgba(255,255,255,0.9);
}

#emoji-tab,
#image-tab {
    margin-top: 12px;
    height: 60px;
    display: flex;
    align-items: center;
}

#emoji-tab.hidden,
#image-tab.hidden {
    display: none;
}

.paste-hint {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(0,0,0,0.5);
    text-align: center;
}

.form-group.hidden {
    display: none;
}

.btn-primary {
    width: 100%;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    border-radius: 20px;
    background: rgba(102,126,234,0.45);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(102,126,234,0.6);
    box-shadow: 0 8px 24px rgba(102,126,234,0.3),
                0 2px 6px rgba(102,126,234,0.2),
                inset 0 1px 0 rgba(255,255,255,0.7);
    color: rgb(76 89 149);
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
    background: rgba(102,126,234,0.55);
    box-shadow: 0 10px 32px rgba(102,126,234,0.4),
                0 3px 8px rgba(102,126,234,0.25),
                inset 0 1px 0 rgba(255,255,255,0.8);
}

.btn-primary:active {
    box-shadow: 0 4px 16px rgba(102,126,234,0.3),
                0 2px 6px rgba(102,126,234,0.2),
                inset 0 1px 0 rgba(255,255,255,0.7);
}

.popup-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    justify-content: flex-end;
}

.btn-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    margin: 0;
    font-size: 0;
    line-height: 0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-icon svg {
    pointer-events: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

.btn-icon.btn-secondary {
    background: rgba(150,150,150,0.25);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    box-shadow: 0 6px 24px rgba(0,0,0,0.1),
                inset 0 1px 0 rgba(255,255,255,0.6);
    color: rgba(0,0,0,0.7);
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-icon.btn-secondary:hover {
    background: rgba(150,150,150,0.35);
    transform: translateY(-1px);
}

.btn-icon.btn-primary {
    background: rgba(102,126,234,0.45);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    box-shadow: 0 8px 28px rgba(102,126,234,0.3),
                inset 0 1px 0 rgba(255,255,255,0.7);
    color: rgb(76 89 149);
    border: 1px solid rgba(102,126,234,0.3);
}

.btn-icon.btn-primary:hover {
    background: rgba(102,126,234,0.55);
    transform: translateY(-1px);
}

.btn-icon.btn-delete {
    background: rgba(220,38,38,0.3);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(220,38,38,0.4);
    box-shadow: 0 6px 20px rgba(220,38,38,0.15),
                0 2px 6px rgba(220,38,38,0.1),
                inset 0 1px 0 rgba(255,255,255,0.6);
    color: rgba(185,28,28,0.9);
    transition: all 0.2s ease;
}

.btn-icon.btn-delete:hover {
    background: rgba(220,38,38,0.45);
    box-shadow: 0 8px 28px rgba(220,38,38,0.25),
                0 3px 8px rgba(220,38,38,0.15),
                inset 0 1px 0 rgba(255,255,255,0.7);
    transform: translateY(-1px);
}

.btn-icon:active {
    transform: translateY(0);
}

.popup-edit-mode {
    margin-top: 20px;
}

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


.emoji-picker-btn {
    width: 100%;
    height: 80px;
    padding: 0;
    margin-top: 16px;
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: 14px;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    font-size: 40px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05),
                inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-picker-btn:hover {
    background: rgba(255,255,255,0.6);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.9);
}

.emoji-picker-btn:active {
    transform: scale(0.98);
}

.emoji-picker-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.emoji-picker-title {
    font-size: 28px;
    font-weight: 700;
    color: rgba(0,0,0,0.85);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: -0.5px;
}

.emoji-grid-fullscreen {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 400px;
}


.emoji-item {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1.5px solid rgba(255,255,255,0.6);
}

.emoji-item:hover {
    background: rgba(255,255,255,0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.emoji-item:active {
    transform: scale(0.95);
}

#calendar-view {
    width: 100%;
    height: 100vh;
    position: relative;
}

#counters-view {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow-y: auto;
    padding: 100px 30px 30px 30px;
}

#counters-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.counter-item {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08),
                0 2px 6px rgba(0,0,0,0.04),
                inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.3s ease;
    cursor: pointer;
}

.counter-item:hover {
    background: rgba(255,255,255,0.7);
    box-shadow: 0 10px 32px rgba(0,0,0,0.12),
                0 3px 8px rgba(0,0,0,0.06),
                inset 0 1px 0 rgba(255,255,255,0.7);
    transform: translateY(-2px);
}

.counter-item-icon {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 10px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 1.5px solid transparent;
    box-shadow: 0 6px 12px rgba(31, 38, 135, 0.2),
                0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.counter-item-icon::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 10px;
    padding: 1.5px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.8) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.counter-item-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    pointer-events: none;
    z-index: 3;
}

.counter-item-icon img {
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    object-fit: cover;
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.counter-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.counter-item-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(0,0,0,0.85);
    letter-spacing: -0.3px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.counter-item-date {
    font-size: 13px;
    color: rgba(0,0,0,0.5);
    font-weight: 500;
}

.counter-progress {
    position: relative;
    height: 6px;
    background: rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.counter-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(102,126,234,0.85) 0%, 
        rgba(118,75,162,0.85) 50%,
        rgba(102,126,234,0.85) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(102,126,234,0.5),
                inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.counter-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, 
        rgba(255,255,255,0.4) 0%, 
        rgba(255,255,255,0) 100%);
    border-radius: 10px 10px 0 0;
}

.counter-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.3) 100%);
    border-radius: 10px;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.counter-timer {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.counter-timer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.counter-timer-value {
    font-size: 20px;
    font-weight: 700;
    color: rgba(0,0,0,0.85);
    line-height: 1;
}

.counter-timer-label {
    font-size: 11px;
    color: rgba(0,0,0,0.5);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    #controls {
        top: 15px;
        left: 15px;
        align-items: center;
    }

    #view-toggle-btn {
        padding: 10px 15px;
    }

    #view-toggle-btn img {
        width: 24px;
        height: 24px;
    }

    #counters-view {
        padding: 90px 15px 20px 15px;
    }

    .counter-item {
        padding: 12px;
        gap: 12px;
    }

    .counter-item-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 32px;
    }

    .counter-item-title {
        font-size: 16px;
    }

    .counter-timer {
        gap: 12px;
    }

    .counter-timer-value {
        font-size: 18px;
    }
    
    #chat-btn {
        top: 15px;
        right: 81px;
        padding: 10px 15px;
        font-size: 24px;
    }

    #chat-btn img {
        width: 24px;
        height: 24px;
    }

    #menu-btn {
        top: 15px;
        right: 15px;
        padding: 10px 15px;
        font-size: 24px;
    }

    #menu-btn img {
        width: 24px;
        height: 24px;
    }
    
    .menu-dropdown {
        top: 70px;
        right: 15px;
    }

    #chat-popup .popup-content {
        width: 95vw;
        height: 85vh;
        max-height: none;
    }

    .chat-header {
        padding: 15px;
    }

    .chat-header h3 {
        font-size: 18px;
    }

    .chat-messages {
        padding: 15px;
        gap: 12px;
    }

    .chat-message {
        max-width: 85%;
    }

    .chat-message-content {
        font-size: 14px;
        padding: 10px 14px;
    }

    .chat-input-container {
        padding: 10px 12px;
    }

    .chat-input {
        font-size: 14px;
        padding: 10px 14px;
    }

    .chat-send-btn {
        width: 40px;
        height: 40px;
    }

    #date-controls {
        top: 15px;
        gap: 10px;
        justify-content: flex-start;
    }

    #current-date {
        font-size: 14px;
        padding: 10px 20px;
    }

    #add-event-btn {
        bottom: calc(20px + 120px + 20px + 20px + 10px);
        width: 63px;
        height: 63px;
        font-size: 53px;
    }

    #add-event-btn img {
        width: 24px;
        height: 24px;
    }

    #month-cards {
        bottom: 20px;
        gap: 12px;
        padding: 20px 2.5% 30px 2.5%;
    }

    .month-card {
        height: 120px;
    }

    .popup-content {
        padding: 28px;
        max-width: 90%;
        border-radius: 24px;
    }
    
    .popup-content h3 {
        font-size: 24px;
        margin-bottom: 18px;
    }

    .popup-image {
        width: 200px;
        height: 200px;
        margin: 0 auto 20px;
    }

    .popup-title {
        font-size: 24px;
        margin-bottom: 14px;
    }

    .popup-description {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .popup-info {
        font-size: 14px;
        padding: 6px 12px;
    }

    .popup-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .popup-back {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 12px;
        left: 12px;
    }
    
    .popup-content {
        padding: 28px;
        max-width: 90%;
        border-radius: 24px;
    }
    
    .emoji-picker-container {
        padding: 28px;
    }
    
    
    .emoji-grid-fullscreen {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
        min-height: 300px;
    }
    
    .emoji-item {
        font-size: 24px;
        padding: 0;
    }
    
    .emoji-picker-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    #date-controls {
        top: 10px;
        gap: 8px;
        justify-content: flex-start;
    }

    #current-date {
        font-size: 13px;
        padding: 8px 16px;
    }

    #add-event-btn {
        bottom: calc(20px + 115px + 20px + 20px + 10px);
        width: 57px;
        height: 57px;
        font-size: 48px;
    }

    #add-event-btn img {
        width: 22px;
        height: 22px;
    }

    #view-toggle-btn {
        padding: 8px 13px;
    }

    #view-toggle-btn img {
        width: 22px;
        height: 22px;
    }

    #counters-view {
        padding: 80px 10px 20px 10px;
    }

    .counter-item {
        padding: 10px;
        gap: 10px;
    }

    .counter-item-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 28px;
    }

    .counter-item-title {
        font-size: 15px;
    }

    .counter-item-date {
        font-size: 12px;
    }

    .counter-timer {
        gap: 8px;
    }

    .counter-timer-value {
        font-size: 16px;
    }

    .counter-timer-label {
        font-size: 10px;
    }
    
    #chat-btn {
        top: 10px;
        right: 68px;
        padding: 8px 13px;
        font-size: 22px;
    }

    #chat-btn img {
        width: 22px;
        height: 22px;
    }
    
    #menu-btn {
        top: 10px;
        right: 10px;
        padding: 8px 13px;
        font-size: 22px;
    }

    #menu-btn img {
        width: 22px;
        height: 22px;
    }
    
    .menu-dropdown {
        top: 60px;
        right: 10px;
    }

    .month-card {
        padding: 16px 16px;
        height: 115px;
    }

    .event-circle {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 32px;
    }

    .month-card-title {
        font-size: 16px;
    }

    .popup-content {
        padding: 20px;
    }
    
    .popup-content h3 {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .popup-image {
        width: 160px;
        height: 160px;
        margin: 0 auto 16px;
        border-radius: 10px;
    }

    .popup-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .popup-description {
        font-size: 15px;
        margin-bottom: 14px;
    }
    
    
    .emoji-picker-container {
        padding: 20px;
    }
    
    .emoji-grid-fullscreen {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        min-height: 250px;
    }
    
    .emoji-item {
        font-size: 26px;
        padding: 0;
        border-radius: 8px;
    }
    
    .emoji-picker-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .popup-back {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: 10px;
        left: 10px;
    }

    .chat-popup-close {
        top: -12px;
        right: -12px;
        width: 38px;
        height: 38px;
        font-size: 26px;
    }
}

@media (hover: none) and (pointer: coarse) {
    #calendar-canvas {
        cursor: default;
    }

    #calendar-canvas:active {
        cursor: default;
    }
}

@media (max-height: 500px) {
    #toggle-months-btn {
        bottom: calc(10px + 75px + 10px + 10px);
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #toggle-months-btn.hidden-months {
        bottom: 15px;
    }

    #month-cards {
        bottom: 10px;
        gap: 8px;
        padding: 10px 2% 15px 2%;
    }

    #month-cards.hidden-months {
        transform: translateY(120px);
    }

    .month-card {
        padding: 10px 12px;
        height: 75px;
    }

    .month-card-title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .event-circle {
        width: 45px;
        height: 45px;
        min-width: 45px;
        font-size: 24px;
    }

    .month-card-events {
        gap: 6px;
        padding: 2px;
    }

    #add-event-btn {
        bottom: calc(10px + 75px + 25px);
    }

    #add-event-btn.hidden-months {
        bottom: 15px;
    }
}

.sync-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sync-loader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255,255,255,0.2);
    border-top-color: rgba(102,126,234,1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 4px 24px rgba(102,126,234,0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#sync-btn {
    margin-top: 20px;
    width: 100%;
}

#clear-cache-btn {
    margin-top: 12px;
    width: 100%;
}

.cropper-container {
    max-width: 500px !important;
    padding: 32px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cropper-title {
    font-size: 24px !important;
    font-weight: 600;
    margin-bottom: 20px !important;
    text-align: center;
}

#cropper-canvas {
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    cursor: move;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#cropper-canvas:active {
    cursor: grabbing;
}

.cropper-controls {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
}

.cropper-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0,0,0,0.7);
    margin-bottom: 10px;
}

#cropper-zoom {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(102,126,234,0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#cropper-zoom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(102,126,234,0.9);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

#cropper-zoom::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(102,126,234,0.9);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.cropper-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.cropper-buttons button {
    flex: 1;
}

@media (max-width: 768px) {
    .cropper-container {
        padding: 24px !important;
        max-width: 95% !important;
    }
    
    .cropper-title {
        font-size: 20px !important;
        margin-bottom: 16px !important;
    }
}

@media (max-width: 480px) {
    .cropper-container {
        padding: 20px !important;
    }
    
    .cropper-title {
        font-size: 18px !important;
        margin-bottom: 14px !important;
    }
}