:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #fbfbfd;
    --surface-muted: #f1f4f9;
    --surface-hover: #eef5ff;
    --line: #e2e7f0;
    --line-strong: #d2d9e4;
    --text: #1e2430;
    --muted: #7a8597;
    --muted-soft: #9aa5b5;
    --brand: #2ac67b;
    --brand-strong: #149255;
    --brand-deep: #1fab67;
    --brand-soft: #e7fbf1;
    --brand-tint: #f1fdf7;
    --brand-tint-strong: #d8f7e6;
    --brand-outline: #93e3b8;
    --brand-contrast: #ffffff;
    --blue: #52a9ff;
    --yellow: #ffbd2e;
    --pink: #ff7eb3;
    --danger: #ff6f75;
    --shadow: 0 10px 30px rgba(30, 36, 48, 0.08);
    --shadow-soft: 0 4px 14px rgba(30, 36, 48, 0.06);
    --radius: 14px;
    --panel-pad: 14px;
    --panel-gap: 12px;
    --dark-custom: #0f141d;
    --workspace-custom: #f7f8fb;
    --day-cell-bg: #ffffff;
    --day-cell-outside-bg: #fafbfd;
    --day-today-bg: #222a36;
    --day-today-text: #ffffff;
    --day-saturday-text: #7a8597;
    --day-sunday-text: #e35a5a;
}

body[data-theme="dark"] {
    --bg: var(--workspace-custom);
    --surface: color-mix(in srgb, var(--dark-custom) 76%, white 4%);
    --surface-soft: color-mix(in srgb, var(--dark-custom) 82%, white 8%);
    --surface-muted: color-mix(in srgb, var(--dark-custom) 72%, white 12%);
    --surface-hover: color-mix(in srgb, var(--dark-custom) 64%, white 18%);
    --line: color-mix(in srgb, var(--dark-custom) 58%, white 24%);
    --line-strong: color-mix(in srgb, var(--dark-custom) 48%, white 34%);
    --text: #e7ecf4;
    --muted: #9aa7bc;
    --muted-soft: #7f8ca1;
    --yellow: #ffcb54;
    --pink: #ff93bc;
    --danger: #ff7a82;
    --shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.22);
}

body[data-theme="light"] {
    --bg: var(--workspace-custom);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    height: 100%;
    font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

.landing-shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.hero-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 40px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
}

.hero-copy h1 {
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    margin: 14px 0 16px;
}

.hero-copy p,
.feature-row p {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: 0.92rem;
    font-weight: 600;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.primary-button,
.ghost-button {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.primary-button {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-contrast);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 22%, transparent);
}

.ghost-button {
    background: var(--surface);
    color: var(--text);
    border-color: color-mix(in srgb, var(--brand-outline) 32%, var(--line));
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.preview-window {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.preview-header {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.preview-header span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--brand);
    opacity: 0.8;
}

.preview-grid {
    display: grid;
    gap: 12px;
}

.preview-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}

.preview-panel h3 {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.soft-pink { background: #fff6fb; }
.soft-gold { background: #fffaf1; }
.soft-mint { background: #f3fff8; }

.feature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.feature-row article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
}

.workspace {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr) 372px;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.workspace:has(.sidebar.is-collapsed) {
    grid-template-columns: 76px minmax(0, 1fr) 372px;
}

.workspace:has(.inspector.is-collapsed) {
    grid-template-columns: 272px minmax(0, 1fr) 58px;
}

.workspace:has(.sidebar.is-collapsed):has(.inspector.is-collapsed) {
    grid-template-columns: 76px minmax(0, 1fr) 58px;
}

.sidebar,
.workspace-main,
.inspector {
    min-width: 0;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: var(--panel-gap);
    transition: width 0.22s ease, padding 0.22s ease;
    overflow: auto;
}

.sidebar.is-collapsed {
    width: 76px;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar.is-collapsed .sidebar-expandable,
.sidebar.is-collapsed .brand-wordmark,
.sidebar.is-collapsed .calendar-identity-copy {
    display: none;
}

.sidebar.is-collapsed .sidebar-header {
    justify-content: center;
}

.sidebar.is-collapsed .calendar-identity {
    grid-template-columns: 1fr;
    justify-items: center;
}

.sidebar.is-collapsed .calendar-cover {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.sidebar.is-collapsed .add-calendar-button {
    justify-content: center;
    padding: 10px;
}

.sidebar.is-collapsed .add-calendar-button span:last-child {
    display: none;
}

.sidebar.is-collapsed .calendar-list-head {
    justify-content: center;
}

.sidebar.is-collapsed .mini-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
}

.sidebar-header,
.workspace-toolbar {
    display: flex;
    align-items: center;
}

.sidebar-header {
    gap: 12px;
    min-height: 46px;
}

.icon-only,
.mini-button,
.today-button,
.utility-button,
.nav-button {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.icon-only:hover,
.mini-button:hover,
.today-button:hover,
.utility-button:hover,
.nav-button:hover,
.rail-button:hover,
.view-button:hover {
    background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface-hover) 100%);
    border-color: color-mix(in srgb, var(--brand-outline) 38%, var(--line-strong));
    color: var(--text);
}

.icon-only {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
}

.muted-button {
    border: 0;
    width: 34px;
    height: 34px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.brand-leaf {
    color: var(--brand);
    display: inline-grid;
    place-items: center;
}

.brand-wordmark {
    color: var(--brand);
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.calendar-list-card {
    display: grid;
    gap: 12px;
}

.calendar-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.mini-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
}

.mini-icon {
    width: 14px;
    height: 14px;
}

.calendar-identity {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: start;
}

.calendar-cover {
    width: 72px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f1f4fa, #e9edf5);
}

.calendar-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.calendar-check {
    position: absolute;
    inset: auto auto 8px 8px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(30, 36, 48, 0.82);
    color: #fff;
    display: inline-grid;
    place-items: center;
}

.tiny-icon {
    width: 15px;
    height: 15px;
}

.calendar-identity-copy strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.calendar-identity-copy p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.calendar-member-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
}

.member-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line);
}

.add-calendar-button {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.add-calendar-button:hover {
    background: var(--surface-hover);
    border-color: var(--line-strong);
}

.add-calendar-plus {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    background: var(--surface-muted);
    color: var(--text);
}

.sidebar-summary {
    display: grid;
    gap: 12px;
}

.summary-chip {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    background: var(--surface-soft);
}

.summary-title {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.workspace-main {
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--surface);
    overflow: hidden;
}

.workspace-toolbar {
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.today-button {
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text);
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-button {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
}

.month-title {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-left: 4px;
}

.view-switcher {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 3px;
    background: var(--surface);
}

.view-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 600;
}

.view-button.active {
    background: var(--brand);
    color: var(--brand-contrast);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-strong) 55%, transparent);
}

.toolbar-avatar {
    display: inline-flex;
}

.toolbar-member-avatars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 2px;
}

.toolbar-member-avatar,
.toolbar-avatar {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.toolbar-avatar-image {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}

.profile-hover-tooltip {
    position: fixed;
    min-width: 220px;
    max-width: 280px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, white 6%), color-mix(in srgb, var(--brand-tint) 42%, var(--surface-soft)));
    border: 1px solid color-mix(in srgb, var(--brand-outline) 34%, var(--line));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    color: var(--text);
    z-index: 80;
    pointer-events: none;
    backdrop-filter: blur(14px);
}

.profile-hover-tooltip.hidden {
    display: none;
}

.profile-hover-tooltip-name {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--brand-strong);
}

.profile-hover-tooltip-line {
    font-size: 0.83rem;
    line-height: 1.45;
    color: var(--muted);
}

.profile-hover-tooltip-line + .profile-hover-tooltip-line {
    margin-top: 4px;
}

.calendar-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: calc(100vh - 63px);
    height: calc(100vh - 63px);
    overflow: hidden;
}

.album-workspace {
    height: calc(100vh - 63px);
    overflow: auto;
    padding: 16px;
    background: var(--surface);
}

.album-workspace-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.album-workspace-head h2 {
    margin: 4px 0 0;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.album-workspace-toolbar,
.album-create-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.small-button {
    padding: 10px 14px;
    font-size: 0.92rem;
}

.album-workspace-content {
    display: grid;
    gap: 18px;
}

.memory-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.memory-gallery-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 16px;
    align-items: start;
}

.album-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.album-wall {
    display: grid;
    gap: 14px;
}

.album-wall h4 {
    margin: 0;
    font-size: 1.05rem;
}

.album-wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: var(--surface);
}

.gallery-thumb {
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    aspect-ratio: 1 / 1;
    width: 100%;
    min-width: 0;
}

.gallery-thumb .memory-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.gallery-thumb .memory-card-expand {
    top: 8px;
    right: 8px;
}

.memory-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.memory-gallery-header h3 {
    margin: 4px 0 0;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.memory-card,
.album-workspace-tile,
.album-create-callout {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.memory-card-image,
.album-workspace-cover {
    width: 100%;
    height: 196px;
    object-fit: cover;
    display: block;
}

.memory-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.memory-card:hover,
.album-workspace-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.memory-card.active {
    border-color: var(--brand);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 18%, transparent);
}

.memory-card-expand {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(17, 24, 39, 0.52);
    color: #fff;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.memory-card-copy,
.album-workspace-copy {
    padding: 12px;
    display: grid;
    gap: 4px;
}

.memory-card-copy span,
.album-workspace-copy span {
    color: var(--muted);
    font-size: 0.84rem;
}

.album-create-callout {
    padding: 18px;
}

.album-create-copy {
    display: grid;
    gap: 8px;
}

.album-create-copy h3,
.album-create-copy p {
    margin: 0;
}

.album-detail-card {
    position: sticky;
    top: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.album-detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.album-detail-copy {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.album-detail-copy h3,
.album-detail-copy p {
    margin: 0;
}

.album-detail-actions {
    display: flex;
}

.calendar-topline {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
}

.weekday-row span {
    padding: 14px 6px;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.calendar-grid.monthly-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(112px, 1fr);
    min-height: 0;
}

.day-cell {
    background: var(--day-cell-bg);
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 8px 6px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: background 0.18s ease;
    min-width: 0;
}

.day-cell:hover {
    background: #fcfdff;
}

.day-cell.is-selected {
    background: #f7fbff;
}

.day-cell.is-outside {
    background: var(--day-cell-outside-bg);
}

.day-cell.is-today .day-number {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--day-today-bg);
    color: var(--day-today-text);
    display: inline-grid;
    place-items: center;
}

.day-cell.is-outside .day-number {
    color: #c2c9d4;
}

.day-cell.is-saturday .day-number {
    color: var(--day-saturday-text);
}

.day-cell.is-sunday .day-number {
    color: var(--day-sunday-text);
}

.day-number {
    font-size: 0.95rem;
    line-height: 1;
}

.day-events {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.event-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.76rem;
    line-height: 1.2;
    white-space: nowrap;
}

.event-chip-button {
    width: 100%;
    border-width: 1px;
    border-color: transparent;
    border-style: solid;
    cursor: pointer;
    background: transparent;
    text-align: left;
}

.event-chip.block {
    background: var(--event-bg, var(--surface-muted));
    border-radius: 4px;
    padding: 3px 6px;
    font-weight: 600;
}

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--dot-color, var(--brand));
    flex: 0 0 8px;
}

.event-time {
    color: var(--muted);
    font-size: 0.74rem;
    margin-left: auto;
}

.event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-pill {
    color: var(--muted);
    font-size: 0.8rem;
}

.weekly-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    align-content: start;
    overflow: auto;
    background: var(--surface-soft);
}

.weekly-day-header {
    background: var(--surface);
    padding: 10px 8px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
}

.weekly-day-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.weekly-day-card.active .weekly-day-header {
    color: var(--text);
    background: #f7fbff;
}

.weekly-day-body {
    padding: 8px;
    min-height: 340px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.weekly-empty {
    color: var(--muted);
    font-size: 0.86rem;
}

.weekly-event {
    appearance: none;
    border: 0;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    padding: 9px 10px;
    color: #17324b;
    font-size: 0.82rem;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.weekly-event strong {
    display: block;
    margin-bottom: 4px;
}

.weekly-event span {
    color: rgba(23, 50, 75, 0.7);
}

.inspector {
    display: grid;
    grid-template-columns: 58px 1fr;
    border-left: 1px solid var(--line);
    background: var(--surface);
    min-height: 100vh;
    transition: grid-template-columns 0.22s ease, width 0.22s ease;
}

.inspector-rail {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.rail-collapse-button {
    margin-top: auto;
}

.inspector.is-collapsed {
    grid-template-columns: 58px 0fr;
}

.inspector.is-collapsed .inspector-panel-stack {
    opacity: 0;
    pointer-events: none;
}

.inspector.is-collapsed .event-detail-drawer {
    opacity: 0;
    pointer-events: none;
}

.inspector.is-collapsed .rail-collapse-button .icon {
    transform: rotate(180deg);
}

.rail-button {
    appearance: none;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 12px;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
}

.rail-button.active {
    background: linear-gradient(180deg, var(--brand-tint-strong), var(--brand-soft));
    color: var(--brand-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-outline) 55%, transparent);
}

.inspector-panel-stack {
    position: relative;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.18s ease;
}

.inspector-panel {
    display: none;
    padding: 16px 14px 18px;
    height: 100vh;
    overflow: auto;
}

.inspector-panel.active {
    display: block;
}

.panel-head {
    margin-bottom: 12px;
}

.panel-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: -0.03em;
}

.selected-events,
.members-list,
.comment-thread {
    display: grid;
    gap: 8px;
}

.event-card,
.member-item,
.comment-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 10px;
}

.event-card {
    display: grid;
    grid-template-columns: 6px 1fr;
    gap: 10px;
    cursor: pointer;
}

.event-card.active {
    border-color: #b9d7ff;
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.themed-border {
    position: relative;
    overflow: hidden;
}

.themed-border::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 22px;
    background-repeat: repeat-x;
    background-size: 32px 22px;
    opacity: 0.95;
    pointer-events: none;
}

.emoji-border::before {
    content: attr(data-emoji-pattern);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.65));
}

.event-chip.themed-border,
.event-card.themed-border,
.detail-event-card.themed-border,
.event-style-preview.themed-border,
.weekly-event.themed-border {
    padding-top: 24px;
}

.event-chip.themed-border {
    min-height: 28px;
}

.heart-border::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='22' viewBox='0 0 32 22'%3E%3Crect width='32' height='22' rx='11' fill='%23fff0f6'/%3E%3Cpath d='M9.8 7.3c1.6-1.6 4.2-1.6 5.8 0l.4.4.4-.4c1.6-1.6 4.2-1.6 5.8 0s1.6 4.2 0 5.8L16 19 9.8 13.1c-1.6-1.6-1.6-4.2 0-5.8Z' fill='%23ff6b9e'/%3E%3C/svg%3E");
}

.rose-border::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='22' viewBox='0 0 32 22'%3E%3Crect width='32' height='22' rx='11' fill='%23fff4f5'/%3E%3Cpath d='M16 5c3.2 0 5.5 2.2 5.5 4.7 0 2.6-2.2 4.8-5.5 7.3-3.3-2.5-5.5-4.7-5.5-7.3C10.5 7.2 12.8 5 16 5Z' fill='%23df4d6f'/%3E%3Cpath d='M16 13.8v4.2M16 18c-1.7 0-2.9.7-3.7 2' stroke='%233d8b56' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.money-border::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='22' viewBox='0 0 32 22'%3E%3Crect width='32' height='22' rx='11' fill='%23eefcf2'/%3E%3Crect x='6' y='5' width='20' height='12' rx='4' fill='%2337b26c'/%3E%3Cpath d='M16 8v6M14 10.2c0-.8.9-1.2 2-1.2 1.1 0 2 .5 2 1.2 0 1.7-4 1-4 2.8 0 .8.9 1.2 2 1.2 1.1 0 2-.5 2-1.2' stroke='white' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.wrench-border::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='22' viewBox='0 0 32 22'%3E%3Crect width='32' height='22' rx='11' fill='%23f4f8fb'/%3E%3Cpath d='m11 14 4.5-4.5a3.2 3.2 0 1 1 3 3L14 17l-3-3Z' fill='%236a87a5'/%3E%3Ccircle cx='11' cy='14' r='1.6' fill='%2390a8bf'/%3E%3C/svg%3E");
}

.meeting-border::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='22' viewBox='0 0 32 22'%3E%3Crect width='32' height='22' rx='11' fill='%23eef6ff'/%3E%3Crect x='7' y='6' width='18' height='10' rx='3' fill='%234d9cff'/%3E%3Cpath d='M13 10h6M16 8v4' stroke='white' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.event-accent {
    border-radius: 999px;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-meta span,
.member-item p,
.member-item span,
.comment-topline span,
.muted-line,
.empty-state {
    color: var(--muted);
    font-size: 0.9rem;
}

.member-item,
.comment-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
}

.comment-thread {
    align-content: start;
    gap: 10px;
}

.comment-bubble {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 0;
}

.comment-bubble.is-reply,
.detail-stream-item.is-reply {
    margin-left: 18px;
}

.comment-bubble-body,
.detail-stream-copy {
    min-width: 0;
    background: var(--surface-soft);
    border: 1px solid color-mix(in srgb, var(--brand-outline) 16%, var(--line));
    border-radius: 16px;
    padding: 12px 14px;
}

.comment-bubble-body p,
.detail-stream-copy p {
    margin: 6px 0 0;
    line-height: 1.45;
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.comment-action-button {
    appearance: none;
    border: 1px solid color-mix(in srgb, var(--brand-outline) 14%, var(--line));
    background: var(--surface);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.comment-action-button.active {
    color: var(--brand-deep);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand-outline) 50%, var(--line));
}

.comment-replies,
.detail-comment-replies {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.discordish-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px;
    overflow: hidden;
    background: var(--surface);
}

.member-profile-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 0;
    align-items: center;
}

.member-avatar {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    box-shadow: none;
}

.self-pill {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 0.72rem;
    font-weight: 700;
}

.discordish-card .presence-detail {
    margin: 8px 0 0;
    padding: 8px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.discordish-card.is-self {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    box-shadow: none;
}

.presence-detail {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.presence-label {
    color: var(--muted-soft);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.avatar-small,
.avatar-tiny {
    object-fit: cover;
    border-radius: 999px;
}

.avatar-small {
    width: 42px;
    height: 42px;
}

.avatar-tiny {
    width: 32px;
    height: 32px;
}

.member-topline,
.comment-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.member-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.presence-state-text {
    font-size: 0.78rem;
    text-transform: capitalize;
}

.presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

.presence-dot.online { background: var(--brand); }
.presence-dot.away { background: var(--yellow); }
.presence-dot.offline { background: #c3cad7; }

.device-icon-wrap {
    display: inline-grid;
    place-items: center;
}

.device-icon {
    width: 16px;
    height: 16px;
}

.device-icon-wrap.online { color: var(--brand); }
.device-icon-wrap.away { color: var(--yellow); }
.device-icon-wrap.offline { color: #c3cad7; }

.segment-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: var(--surface-muted);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 10px;
}

.segment-button {
    appearance: none;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--muted);
    font-weight: 600;
}

.segment-button.active {
    background: linear-gradient(180deg, var(--brand-tint), var(--surface));
    color: var(--brand-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-outline) 55%, transparent), var(--shadow-soft);
}

.activity-feed,
.album-grid {
    display: grid;
    gap: 10px;
}

.activity-group-card,
.activity-card,
.album-tile {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    padding: 12px;
    max-width: 100%;
    min-width: 0;
}

.activity-group-card.is-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.activity-group-card.is-clickable:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand-outline) 48%, var(--line));
    box-shadow: var(--shadow-soft);
}

.activity-group-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
    position: relative;
    padding-left: 12px;
}

.activity-group-head::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 25%, #ffd15a));
}

.appearance-studio {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 45%, var(--line));
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface) 56%, var(--surface-soft) 100%);
    display: grid;
    gap: 14px;
}

.appearance-studio-head h3,
.appearance-studio-head p {
    margin: 0;
}

.appearance-studio-head p {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.55;
}

.accent-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.accent-preset {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: var(--preset);
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 1px color-mix(in srgb, var(--preset) 60%, var(--line));
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.accent-preset:hover,
.accent-preset.active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.96), 0 0 0 3px color-mix(in srgb, var(--preset) 32%, white);
}

.appearance-preview-card {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 48%, var(--line));
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--surface) 0%, var(--brand-tint) 100%);
    box-shadow: var(--shadow-soft);
}

.appearance-preview-card,
.appearance-studio {
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-token-studio {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 32%, var(--line));
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--brand-tint) 100%);
    display: grid;
    gap: 14px;
}

.theme-token-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.theme-token-card {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 28%, var(--line));
    border-radius: 16px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
    padding: 12px;
    display: grid;
    gap: 10px;
    box-shadow: var(--shadow-soft);
}

.theme-token-card.compact {
    gap: 8px;
}

.theme-token-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-strong);
    letter-spacing: 0.03em;
}

.theme-token-picker-row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    align-items: center;
}

.theme-token-card input[type="color"] {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

.theme-token-card input[type="range"] {
    accent-color: var(--brand);
}

.theme-token-text-input {
    width: 100%;
}

.appearance-preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--brand-outline) 36%, var(--line));
}

.preview-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.appearance-preview-button {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--brand);
    color: var(--brand-contrast);
    font-weight: 700;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 22%, transparent);
}

.appearance-preview-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

.appearance-preview-surface {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 24%, var(--line));
    border-radius: 16px;
    background: var(--surface);
    padding: 14px;
    display: grid;
    gap: 8px;
}

.appearance-preview-surface.accent {
    background: linear-gradient(180deg, var(--brand-tint) 0%, var(--brand-soft) 100%);
}

.appearance-preview-input {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 62%, white 8%);
    border-radius: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--brand-tint) 100%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
    color: var(--muted);
}

.activity-group-head strong,
.album-meta strong {
    font-size: 1.02rem;
}

.activity-group-head p,
.album-meta p,
.activity-card p {
    margin: 4px 0;
    color: var(--muted);
}

.activity-group-head span,
.activity-card span,
.album-meta span {
    color: var(--muted);
    font-size: 0.84rem;
}

.activity-log-list {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.activity-log-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    font-size: 0.92rem;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    min-width: 0;
}

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

.activity-log-actor {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.activity-log-actor span {
    color: var(--text);
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.activity-log-row time {
    color: var(--muted);
    white-space: nowrap;
    font-size: 0.82rem;
    flex: 0 0 auto;
    padding-top: 2px;
}

.activity-date-splitter {
    margin: 4px 0 2px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.album-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
}

.album-photo-preview,
.album-cover {
    width: 100%;
    height: 76px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--surface-muted);
}

.empty-cover {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.album-tile {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
}

.compact-form {
    margin-bottom: 16px;
}

.checkbox-setting {
    margin-bottom: 0;
}

.editor-form,
.comment-form {
    margin-top: 10px;
}

.editor-form label,
.comment-form {
    display: grid;
    gap: 10px;
}

.select-shell {
    position: relative;
}

.styled-select {
    appearance: none;
    padding-right: 44px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--brand-tint) 100%);
    border-color: color-mix(in srgb, var(--brand-outline) 22%, var(--line));
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    color: var(--muted);
    pointer-events: none;
}

.file-upload-shell input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.file-upload-button {
    border: 1px dashed color-mix(in srgb, var(--line) 80%, var(--brand) 20%);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.file-upload-button:hover {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    background: var(--surface-hover);
}

.file-upload-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    background: color-mix(in srgb, var(--brand) 12%, var(--surface));
    color: var(--brand-deep);
}

.file-upload-copy strong,
.file-upload-copy small {
    display: block;
}

.file-upload-copy small {
    margin-top: 4px;
    color: var(--muted);
}

input[type="text"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="file"],
textarea,
select {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, white 8%) 0%, var(--surface) 100%);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    border-color: color-mix(in srgb, var(--brand) 62%, white 10%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent), 0 8px 18px rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, white 10%) 0%, var(--surface) 100%);
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: color-mix(in srgb, var(--muted) 86%, transparent);
}

.send-button,
.save-button,
.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    padding: 10px 12px;
}

.send-button,
.save-button {
    border: 0;
    background: var(--brand);
    color: var(--brand-contrast);
    cursor: pointer;
    box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 20%, transparent);
}

.logout-link {
    border: 1px solid var(--line);
    background: var(--surface);
    margin-top: 16px;
}

.comment-form {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.detail-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 48%);
    border-left: 1px solid var(--line);
    background: var(--surface);
    transform: translateX(102%);
    transition: transform 0.24s ease;
    z-index: 10;
    box-shadow: -16px 0 30px rgba(16, 24, 40, 0.12);
}

.detail-drawer.open {
    transform: translateX(0);
}

.detail-drawer-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 100%, transparent) 0%, color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 100%, transparent) 100%);
}

.detail-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--event-detail-border, var(--line)) 28%, var(--line));
    background: linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 88%, white 12%), color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 92%, white 8%));
}

.detail-drawer-content {
    overflow: auto;
    padding: 14px;
    display: grid;
    gap: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 96%, transparent), color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 96%, transparent));
}

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.detail-drawer .utility-button,
.detail-drawer .icon-only {
    background: linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 84%, white 16%), color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 90%, white 10%));
    border-color: color-mix(in srgb, var(--event-detail-border, var(--line)) 28%, var(--line));
    color: color-mix(in srgb, var(--event-detail-text, var(--muted)) 70%, var(--surface));
}

.detail-edit-grid {
    display: grid;
    gap: 10px;
}

.detail-edit-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: stretch;
}

.detail-row-menu {
    position: relative;
}

.detail-menu-trigger {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
}

.detail-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    z-index: 12;
}

.detail-menu button {
    border: 0;
    background: transparent;
    text-align: left;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text);
}

.detail-menu button:hover {
    background: var(--surface-hover);
}

.detail-event-card,
.event-detail-frame,
.event-detail-hero,
.detail-note-card,
.detail-meta-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.detail-drawer-head h2:empty {
    display: none;
}

.event-detail-frame {
    display: grid;
    gap: 12px;
    padding: 14px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 100%, transparent) 0%, color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 100%, transparent) 100%);
    box-shadow: 0 18px 36px color-mix(in srgb, var(--event-detail-border, var(--line)) 14%, transparent);
}

.event-detail-hero {
    border: 0;
    background: transparent;
    overflow: visible;
}

.event-detail-topline {
    position: relative;
    min-height: 34px;
    margin: 0 0 14px;
    border: 1px solid color-mix(in srgb, var(--event-detail-border, var(--line)) 48%, transparent);
    border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 92%, white 8%), color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 94%, white 6%));
}

.event-detail-topline.themed-border {
    overflow: hidden;
}

.event-detail-topline.themed-border::before {
    height: 34px;
    background-size: 32px 34px;
    border-radius: 14px;
}

.event-detail-topline.emoji-border::before {
    justify-content: flex-start;
    gap: 8px;
    padding: 0 12px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
}

.event-detail-hero-body {
    padding: 0;
    display: grid;
    gap: 12px;
    text-align: center;
}

.event-detail-hero-avatar {
    display: flex;
    justify-content: center;
}

.event-detail-avatar-image {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid color-mix(in srgb, var(--surface) 82%, white 18%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.event-detail-hero-title {
    font-size: 1.48rem;
    line-height: 1.14;
    letter-spacing: -0.03em;
    word-break: break-word;
}

.event-detail-hero-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding-top: 4px;
}

.event-detail-hero-block {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.event-detail-hero-date,
.detail-meta-item span,
.detail-stream-item span {
    color: color-mix(in srgb, var(--event-detail-text, var(--muted)) 54%, var(--surface));
    font-size: 0.86rem;
}

.event-detail-hero-time,
.detail-meta-item strong {
    display: block;
    margin-top: 4px;
    font-size: 1.35rem;
    line-height: 1.1;
    word-break: break-word;
}

.event-detail-all-day {
    justify-self: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--event-detail-border, var(--brand)) 16%, white 84%);
    color: var(--event-detail-text, var(--text));
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.event-detail-hero-arrow {
    font-size: 2.1rem;
    color: var(--event-detail-border, var(--brand));
    font-weight: 700;
}

@media (max-width: 520px) {
    .event-detail-hero-range {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .event-detail-hero-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }
}

.detail-meta-list,
.detail-stream {
    display: grid;
    gap: 12px;
}

.detail-edit-grid {
    display: grid;
    gap: 8px;
}

.detail-meta-item {
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    border-color: color-mix(in srgb, var(--event-detail-border, var(--line)) 28%, var(--line));
    background: linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 75%, white 25%), color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 85%, white 15%));
    color: var(--event-detail-text, var(--text));
}

.detail-meta-item strong {
    color: var(--event-detail-text, var(--text));
}

.detail-row-menu {
    position: relative;
    align-self: stretch;
}

.detail-like-button {
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.detail-like-button.active {
    border-color: color-mix(in srgb, var(--brand) 46%, var(--line));
    background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface));
}

.detail-stream-section {
    display: grid;
    gap: 10px;
}

.detail-pill-stream {
    display: grid;
    gap: 8px;
    max-width: 100%;
}

.detail-pill-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 16px;
    background: var(--surface-muted);
    color: var(--muted);
    min-width: 0;
}

.detail-pill-item strong {
    font-size: 0.92rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.detail-note-card {
    padding: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    border-color: color-mix(in srgb, var(--event-detail-border, var(--line)) 24%, var(--line));
    background: linear-gradient(180deg, color-mix(in srgb, var(--event-detail-bg, var(--surface)) 72%, white 28%), color-mix(in srgb, var(--event-detail-bg-soft, var(--surface-soft)) 84%, white 16%));
    color: var(--event-detail-text, var(--text));
}

.detail-stream-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--event-detail-border, var(--line)) 18%, var(--line));
}

.detail-stream-item:last-child {
    border-bottom: 0;
}

.detail-stream-item p {
    margin: 6px 0;
}

.detail-comment-thread {
    display: grid;
    gap: 8px;
}

.detail-comment-form {
    display: block;
}

.detail-reaction-row {
    display: flex;
    gap: 10px;
}

.detail-round-action {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
}

.comment-composer-shell {
    display: grid;
    gap: 8px;
}

.replying-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--brand-tint);
    color: var(--brand-deep);
    font-size: 0.82rem;
    font-weight: 600;
}

.replying-clear {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
}

.message-composer {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--brand-outline) 22%, var(--line));
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 90%, var(--brand-tint) 10%);
    padding: 6px;
}

.message-composer input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 10px 14px;
    padding-right: 96px;
}

.message-composer input:focus {
    box-shadow: none;
}

.composer-send-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 78px;
    border-radius: 14px;
    padding: 9px 14px;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 18, 0.82);
    backdrop-filter: blur(12px);
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 60;
    padding: 30px;
}

.lightbox.open {
    opacity: 1;
}

.lightbox-image {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

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

.inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.inline-grid.tri {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 45, 0.2);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 39;
}

.drawer-backdrop.open {
    opacity: 1;
}

.event-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(540px, 96vw);
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -16px 0 40px rgba(30, 36, 48, 0.12);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 40;
}

.event-drawer.open {
    transform: translateX(0);
}

.event-drawer-card {
    height: 100%;
    overflow: auto;
    padding: 16px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.event-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
}

.event-drawer-head h2 {
    margin: 4px 0 0;
    font-size: 1.6rem;
    letter-spacing: -0.04em;
}

.title-stack small {
    color: var(--muted);
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toggle-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
}

.toggle-pill input {
    width: 16px;
    height: 16px;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.time-grid.disabled {
    opacity: 0.55;
}

.style-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
    padding: 14px;
    display: grid;
    gap: 16px;
}

.style-panel-head h3 {
    margin: 4px 0 0;
    font-size: 1.05rem;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.color-control {
    gap: 8px;
}

.color-field {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-field input[type="color"] {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-field input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 12px;
}

.hex-input {
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 8px 10px;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.hex-input:hover {
    background: color-mix(in srgb, var(--surface-hover) 72%, transparent);
}

.hex-input:focus {
    border-color: color-mix(in srgb, var(--brand-outline) 65%, var(--line));
    background: color-mix(in srgb, var(--surface-hover) 88%, white 12%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 60%, transparent);
}

.event-style-preview {
    border: 2px solid #f39db0;
    border-radius: 12px;
    background: rgba(243, 157, 176, 0.15);
    padding: 16px;
    display: grid;
    gap: 6px;
}

.event-style-preview-title {
    font-size: 1rem;
}

.event-style-preview-meta {
    color: inherit;
    opacity: 0.8;
    font-size: 0.88rem;
}

.drawer-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.compact-color-field {
    border: 1px solid color-mix(in srgb, var(--brand-outline) 32%, var(--line));
    border-radius: 10px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--brand-tint) 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.compact-color-field input[type="color"] {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
}

.compact-color-field .hex-input {
    color: var(--brand-strong);
    padding: 6px 8px;
}

.toggle-pill:has(input:checked) {
    border-color: color-mix(in srgb, var(--brand-outline) 54%, var(--line));
    background: linear-gradient(180deg, var(--brand-tint), var(--brand-soft));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-outline) 28%, transparent);
}

.toggle-pill:has(input:checked) span {
    color: var(--brand-strong);
}

@media (max-width: 1380px) {
    .workspace {
        grid-template-columns: 248px minmax(0, 1fr) 300px;
    }

    .workspace:has(.sidebar.is-collapsed) {
        grid-template-columns: 76px minmax(0, 1fr) 300px;
    }
}

@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 248px minmax(0, 1fr);
    }

    .inspector {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(412px, 94vw);
        z-index: 30;
        box-shadow: -8px 0 24px rgba(30, 36, 48, 0.12);
    }

    .sidebar.is-collapsed {
        width: 270px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .sidebar.is-collapsed .sidebar-expandable,
    .sidebar.is-collapsed .brand-wordmark,
    .sidebar.is-collapsed .calendar-identity-copy,
    .sidebar.is-collapsed .add-calendar-button span:last-child {
        display: revert;
    }
}

@media (max-width: 980px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .workspace-toolbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .toolbar-center {
        order: 3;
        width: 100%;
    }

    .calendar-shell {
        min-height: calc(100vh - 108px);
    }
}

@media (max-width: 760px) {
    .landing-shell {
        width: min(100% - 24px, 1240px);
    }

    .hero-card,
    .feature-row {
        grid-template-columns: 1fr;
    }

    .workspace-toolbar {
        padding: 10px 12px;
    }

    .toolbar-left,
    .toolbar-right {
        flex-wrap: wrap;
    }

    .month-title {
        font-size: 1.4rem;
    }

    .calendar-grid.monthly-grid {
        grid-auto-rows: minmax(110px, 1fr);
    }

    .weekly-board {
        grid-template-columns: 1fr;
    }

    .weekday-row span {
        padding: 14px 4px;
        font-size: 0.83rem;
    }

    .comment-form,
    .inline-grid,
    .inline-grid.tri,
    .time-grid,
    .style-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .event-drawer {
        width: 100vw;
    }

    .album-workspace-head,
    .album-workspace-toolbar {
        grid-template-columns: 1fr;
        display: grid;
    }

    .memory-gallery {
        grid-template-columns: 1fr;
    }

    .memory-gallery-layout {
        grid-template-columns: 1fr;
    }

    .theme-token-grid,
    .appearance-preview-body {
        grid-template-columns: 1fr;
    }
}
