* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition-delay: 0;
    transition-duration: 0.1s;
    transition-property: all;
    transition-timing-function: ease;
}
html, body {
    height: 100%;
    font-family: 'Colfax Regular', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #0d0d0d;
    color: #e0e0e0;
    min-height: 100vh;
}
body {
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    height: 60px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
header .logo {
    font-size: 1rem;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: -0.25px;
}
header .nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}
header .nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
header .nav-links a:hover {
    color: #6cb8e0;
}

/* Main content */
main[ceots__calendar="main"] {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* Toolbar */
.cal__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cal__toolbar-left, .cal__toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cal__toolbar h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0.75rem;
    min-width: 200px;
    text-align: center;
    color: #e0e0e0;
    letter-spacing: -0.5px;
}

/* Buttons — CTS offset box-shadow style */
.cal__btn {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    box-shadow: 2px 2px 0px 0px #1a3a4e;
    position: relative;
}
.cal__btn:hover {
    box-shadow: 4px 4px 0px 0px #3a5a6e;
    transform: translateY(-1px);
}
.cal__btn--primary {
    background-color: #e0e0e0;
    color: #0d0d0d;
    border-color: #e0e0e0;
    box-shadow: 2px 2px 0px 0px #3a5a6e;
}
.cal__btn--primary:hover {
    box-shadow: 4px 4px 0px 0px #2a4a5e;
}
.cal__btn--danger {
    background-color: #1a1a1a;
    color: #ff6b6b;
    border-color: #3a3a3a;
    box-shadow: 2px 2px 0px 0px #4e1a1a;
}
.cal__btn--danger:hover {
    box-shadow: 4px 4px 0px 0px #6e3a3a;
    transform: translateY(-1px);
}

/* Calendar grid — container pattern */
.cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 4px 4px 0px 0px #1a3a4e;
    position: relative;
}
.cal__grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2a4a5e 0%, #3a5a6e 50%, #1a3a4e 100%);
    z-index: 1;
}
.cal__day-header {
    padding: 8px 4px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    background: #151515;
    border-bottom: 1px solid #2a2a2a;
}
.cal__day {
    min-height: 100px;
    padding: 4px;
    border-right: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    position: relative;
    background: #1a1a1a;
}
.cal__day:nth-child(7n) { border-right: none; }
.cal__day:hover {
    background: rgba(40, 40, 40, 0.5);
}
.cal__day--today {
    background: rgba(58, 90, 110, 0.15);
}
.cal__day--today .cal__day-number {
    color: #6cb8e0;
    font-weight: 700;
}
.cal__day--outside {
    color: #555;
    background: #111;
}
.cal__day-number {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 2px 4px;
    color: #e0e0e0;
}
.cal__day-events { margin-top: 2px; }
.cal__event-chip {
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 2px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #e0e0e0;
    cursor: pointer;
    font-weight: 500;
}
.cal__event-chip:hover { opacity: 0.85; }

/* Modal — container style with offset shadow */
.cal__modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 13, 13, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.cal__modal {
    background: #1a1a1a;
    border: 2px solid #3a3a3a;
    border-radius: 4px;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 6px 6px 0px 0px #3a5a6e;
    position: relative;
}
.cal__modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2a4a5e 0%, #3a5a6e 50%, #1a3a4e 100%);
    border-radius: 4px 4px 0 0;
}
.cal__modal h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: -0.25px;
}
.cal__modal label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}
.cal__modal input, .cal__modal textarea, .cal__modal select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 0.75rem;
    background: #0d0d0d;
    color: #e0e0e0;
}
.cal__modal input:focus, .cal__modal textarea:focus, .cal__modal select:focus {
    outline: none;
    border-color: #3a5a6e;
    box-shadow: 0 0 0 1px #3a5a6e;
}
.cal__modal textarea { min-height: 80px; resize: vertical; }
.cal__modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

/* Calendar selector chips */
.cal__sidebar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.cal__calendar-chip {
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    font-size: 0.75rem;
    cursor: pointer;
    border: 1px solid #3a3a3a;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 2px 2px 0px 0px #1a3a4e;
}
.cal__calendar-chip:hover {
    box-shadow: 3px 3px 0px 0px #3a5a6e;
}
.cal__calendar-chip--active {
    font-weight: 600;
    box-shadow: 2px 2px 0px 0px #3a5a6e;
}

/* Tabs */
.cal__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #2a2a2a;
}
.cal__tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid transparent;
    color: #888;
}
.cal__tab:hover {
    color: #e0e0e0;
}
.cal__tab--active {
    color: #6cb8e0;
    border-bottom-color: #6cb8e0;
    font-weight: 600;
}

/* List views (todos, journals) — container style */
.cal__list {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    box-shadow: 4px 4px 0px 0px #1a3a4e;
}
.cal__list-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.cal__list-item:last-child { border-bottom: none; }
.cal__list-item:hover {
    background: rgba(40, 40, 40, 0.5);
}
.cal__list-item-title {
    font-weight: 500;
    color: #e0e0e0;
}
.cal__list-item-meta {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Empty and loading states */
.cal__empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #888;
    font-size: 0.9rem;
}

.cal__loading {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 0.9rem;
}
.cal__loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #3a3a3a;
    border-top-color: #6cb8e0;
    border-radius: 50%;
    animation: cal-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes cal-spin { to { transform: rotate(360deg); } }

/* Mobile */
@media screen and (max-width: 767px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 0.5rem;
    }
    main[ceots__calendar="main"] { padding: 1rem; }
    .cal__day { min-height: 60px; }
    .cal__toolbar h2 { font-size: 1rem; min-width: auto; }
    .cal__modal { width: 95%; padding: 1rem; }
    .cal__toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .cal__toolbar-left, .cal__toolbar-right {
        justify-content: center;
    }
}
