* {
    box-sizing: border-box;
}

:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-soft: #f1f1ef;
    --text: #111111;
    --muted: #777777;
    --border: #d9d9d5;
    --border-strong: #bdbdb7;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(247, 247, 245, .94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.app-header-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 18px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-size: 19px;
    font-weight: 760;
    letter-spacing: -.04em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav a {
    position: relative;
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 550;
    padding: 6px 0;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -19px;
    height: 2px;
    background: var(--text);
}

.page {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 54px 34px 90px;
}

.hero {
    margin-bottom: 34px;
}

.hero-kicker {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.hero h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 72px);
    line-height: .98;
    letter-spacing: -.06em;
    font-weight: 760;
}

.section-head {
    margin-bottom: 16px;
}

.section-head-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.section-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.035em;
}

.calendar-shell {
    padding: 18px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: 18px;
}

.calendar-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 18px;
}

.calendar-top h3 {
    min-width: 220px;
    margin: 0;
    text-align: center;
    font-size: 40px;
    line-height: 1;
    font-weight: 730;
    letter-spacing: -.045em;
}

.calendar-arrow {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 22px;
}

.weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
}

.weekdays {
    margin-bottom: 7px;
}

.weekdays div {
    padding: 5px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.calendar-day {
    min-height: 104px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.calendar-day.muted {
    opacity: .32;
}

.day-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 650;
}

.day-number.today {
    background: var(--text);
    color: #fff;
}

.event-strip {
    display: block;
    margin-top: 4px;
    padding: 5px 6px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}

.event-strip:hover {
    transform: translateY(-1px);
}

.event-strip .time {
    display: block;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.event-strip .title {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.event-google {
    background: #f1f1ef;
}

.event-ts {
    background: #111;
    color: #fff;
}

.event-ts .time {
    color: rgba(255,255,255,.65);
}

.calendar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.google-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #d5d5d0;
    border-radius: 999px;
    background: #fff;
    color: #111;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.google-button.connected {
    color: #666;
}

.event-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 34px 90px;
}

.event-back {
    display: inline-flex;
    margin-bottom: 28px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.event-type {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.event-header h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 66px);
    line-height: 1;
    letter-spacing: -.06em;
    font-weight: 760;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
}

.event-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    margin-top: 36px;
}

.event-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-section,
.side-panel {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.event-section h2,
.side-panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
    letter-spacing: -.03em;
}

.section-content {
    color: #666;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.section-empty {
    color: #aaa;
}

.side-row {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.side-row:last-child {
    border-bottom: 0;
}

.side-label {
    margin-bottom: 4px;
    color: #999;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.side-value {
    color: #222;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .app-header-inner {
        padding: 16px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .main-nav {
        width: 100%;
        gap: 18px;
        overflow-x: auto;
    }

    .main-nav a.active::after {
        bottom: -8px;
    }

    .page,
    .event-page {
        padding: 36px 16px 70px;
    }

    .calendar-shell {
        overflow-x: auto;
    }

    .calendar-inner {
        min-width: 830px;
    }

    .event-main {
        grid-template-columns: 1fr;
    }
}
