:root {
    --bg: #f4efe6;
    --bg-alt: #fbf8f2;
    --panel: rgba(255, 252, 247, 0.84);
    --line: rgba(44, 51, 44, 0.12);
    --text: #203028;
    --muted: #677569;
    --brand: #1f5a4d;
    --brand-soft: #dcebe4;
    --danger: #b53f39;
    --shadow: 0 18px 50px rgba(43, 52, 46, 0.11);
    --red: #d94b45;
    --blue: #2f6fed;
    --green: #2d8a61;
    --orange: #d8882c;
    --invite-preview-width: 5.0800cm;
    --invite-preview-height: 4.66725cm;
}

.mini-admin-shell {
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 18px;
}

.mini-admin-sidebar {
    background: linear-gradient(180deg, #00152c, #001326);
    border-radius: 18px;
    padding: 14px 12px;
    color: #d7e3f6;
    min-height: 720px;
}

.mini-admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 8px 6px;
    color: #f0f6ff;
}

.mini-admin-logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #dbe6f8, #ffffff);
    color: #10223d;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.mini-admin-nav {
    display: grid;
    gap: 10px;
}

.mini-admin-nav-item {
    border-radius: 10px;
    padding: 11px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d4e0f1;
    background: rgba(255, 255, 255, 0.03);
}

.mini-admin-nav-item.is-active {
    background: rgba(22, 101, 216, 0.24);
    border-color: rgba(98, 166, 255, 0.5);
    color: #ffffff;
}

.mini-admin-main {
    display: grid;
    gap: 14px;
}

.mini-admin-header {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 252, 247, 0.88);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.mini-admin-header h1 {
    margin: 0;
    font-size: 28px;
}

.mini-admin-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mini-admin-panel {
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.mini-admin-filter-grid {
    display: grid;
    grid-template-columns: 1fr 150px 150px 1.2fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.mini-admin-filter-grid label {
    display: grid;
    gap: 6px;
}

.mini-admin-color-fieldset {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    min-height: 44px;
}

.mini-admin-color-fieldset legend {
    margin: 0;
    padding: 0 6px;
    font-size: 12px;
    color: var(--muted);
}

.mini-admin-color-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-admin-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    background: #ffffff;
    font-size: 13px;
}

.mini-admin-color-chip input {
    margin: 0;
}

.mini-admin-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mini-admin-quick-ranges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-admin-range-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--muted);
    background: #ffffff;
    font-size: 13px;
}

.mini-admin-range-chip.is-active {
    color: #ffffff;
    background: var(--brand);
    border-color: var(--brand);
}

.mini-admin-import-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mini-admin-file-label {
    display: grid;
    gap: 6px;
}

.mini-admin-summary {
    display: flex;
    gap: 14px;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
}

.mini-admin-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.mini-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.mini-admin-table th,
.mini-admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
}

.mini-admin-table th {
    font-weight: 600;
    color: var(--muted);
    background: #f9f4ec;
}

.mini-admin-title-link {
    color: #193457;
    font-weight: 600;
}

.mini-admin-color-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1;
    padding: 6px 9px;
    color: #ffffff;
}

.mini-admin-color-badge.tone-orange {
    color: #1c1306;
}

.mini-admin-empty {
    text-align: center;
    color: var(--muted);
    white-space: normal;
}

.mini-upload-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.mini-upload-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.mini-upload-card h2 {
    margin: 0;
    font-size: 16px;
}

.mini-upload-preview {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: #f6f1e8;
    min-height: 180px;
    display: grid;
    place-items: center;
}

.mini-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mini-upload-preview span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0662d6;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.mini-upload-preview input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 1140px) {
    .mini-admin-shell {
        grid-template-columns: 1fr;
    }

    .mini-admin-sidebar {
        min-height: 0;
    }

    .mini-admin-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-admin-color-fieldset,
    .mini-admin-filter-actions {
        grid-column: 1 / -1;
    }

    .mini-upload-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .mini-admin-header {
        flex-direction: column;
    }

    .mini-admin-filter-grid {
        grid-template-columns: 1fr;
    }

    .mini-upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1366px) {
    .is-iphone-dashboard .iphone-calendar-shell {
        max-width: 980px;
        margin: 0 auto;
    }

    .is-iphone-dashboard .iphone-reference-toolbar {
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-reference-actions {
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-reference-button {
        min-width: 50px;
        height: 44px;
        padding: 0 14px;
    }

    .is-iphone-dashboard .iphone-weekday-pill {
        min-width: 76px;
        min-height: 74px;
        padding: 10px 8px;
    }

    .is-iphone-dashboard .iphone-day-scroller {
        max-height: calc(100vh - 320px);
    }

    .is-iphone-dashboard .iphone-event-block {
        border-radius: 12px;
        padding: 6px 8px;
    }

    .is-iphone-dashboard .iphone-week-agenda {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        display: grid;
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-month-grid .day-card {
        min-height: 102px;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(217, 136, 44, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(47, 111, 237, 0.12), transparent 22%),
        linear-gradient(180deg, #f8f3ea 0%, #f3eee5 100%);
}

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

button[hidden] {
    display: none !important;
}

code {
    display: block;
    overflow-wrap: anywhere;
    padding: 14px 16px;
    border-radius: 16px;
    background: #faf5ee;
    border: 1px solid var(--line);
}

.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 251, 245, 0.74);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand strong,
.section-head h1,
.panel h2,
.hero-copy h1,
.invite-content h1 {
    font-family: "Avenir Next", "Noto Serif SC", serif;
    letter-spacing: 0.02em;
}

.brand small {
    display: block;
    color: var(--muted);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #225c50, #173d33);
    color: #fff8f2;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-user {
    color: var(--muted);
}

.page {
    display: grid;
    gap: 24px;
}

.install-note,
.fine-print,
.install-copy {
    color: var(--muted);
}

.install-note {
    margin: 0;
    padding: 0 6px;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
    color: var(--muted);
}

.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.hero-card,
.panel,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.hero-copy {
    padding: 42px;
    background:
        linear-gradient(135deg, rgba(31, 90, 77, 0.08), rgba(255, 255, 255, 0.46)),
        var(--panel);
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
}

.hero-text {
    max-width: 36rem;
    font-size: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.hero-card {
    padding: 32px;
}

.install-grid {
    display: grid;
}

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

.install-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.install-panel.compact {
    padding-top: 20px;
    padding-bottom: 20px;
}

.install-step-card {
    display: grid;
    gap: 16px;
    align-content: start;
}

.install-steps {
    display: grid;
    gap: 12px;
}

.install-steps p {
    margin: 0;
}

.build-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.build-meta div {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.56);
}

.build-meta span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.build-meta strong {
    font-size: 20px;
}

.check-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #225c50, #173d33);
    color: #fff8f2;
    font-weight: 600;
    cursor: pointer;
}

.button-ghost {
    background: rgba(255, 255, 255, 0.52);
    color: var(--text);
    border: 1px solid var(--line);
}

.button-danger {
    background: linear-gradient(135deg, #b53f39, #7f2b27);
}

.hero-actions,
.actions-inline,
.month-nav,
.row-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

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

.section-head h1,
.panel h2,
.calendar-header h2 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    padding: 24px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 32px;
}

.view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 16px;
}

.day-view-panel,
.week-view-panel {
    display: grid;
    gap: 18px;
    align-content: start;
}

.view-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.view-panel-head h2 {
    margin: 0;
}

.view-panel-copy {
    margin: 8px 0 0;
    color: var(--muted);
}

.all-day-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.all-day-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.all-day-chip strong,
.all-day-chip small {
    margin: 0;
}

.all-day-chip small {
    color: var(--muted);
}

.all-day-chip .shared-title-row {
    flex: 1 1 auto;
}

.day-timeline-list {
    display: grid;
    gap: 14px;
}

.day-timeline-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.day-timeline-axis {
    position: relative;
    display: grid;
    gap: 4px;
    justify-items: end;
    min-height: 100%;
    padding-right: 14px;
}

.day-timeline-axis::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: -14px;
    width: 1px;
    background: rgba(44, 51, 44, 0.12);
}

.day-timeline-row:last-child .day-timeline-axis::after {
    bottom: 0;
}

.day-timeline-axis strong {
    font-size: 18px;
}

.day-timeline-axis small {
    color: var(--muted);
}

.day-timeline-row.is-current .day-timeline-axis strong {
    color: var(--danger);
}

.day-timeline-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
    border-radius: 24px;
    color: #fffaf3;
    box-shadow: 0 16px 36px rgba(31, 42, 37, 0.14);
}

.day-timeline-row.is-current .day-timeline-entry {
    outline: 2px solid rgba(181, 63, 57, 0.3);
}

.day-timeline-entry-copy {
    min-width: 0;
}

.day-timeline-entry-copy h3,
.day-timeline-entry-copy p {
    margin: 0;
}

.day-timeline-entry-copy h3 {
    margin-bottom: 6px;
}

.day-timeline-entry-copy p {
    color: rgba(255, 250, 243, 0.86);
}

.day-timeline-entry-copy .shared-title-row {
    margin-bottom: 6px;
}

.day-timeline-duration {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    font-weight: 700;
}

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

.week-day-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(44, 51, 44, 0.09);
    background: #fffdf9;
}

.week-day-card.is-today {
    outline: 2px solid rgba(31, 90, 77, 0.24);
    transform: translateY(-2px);
}

.week-day-card.is-selected {
    border-color: rgba(31, 90, 77, 0.22);
    background: linear-gradient(180deg, rgba(242, 248, 246, 0.98), #fffdf9);
    box-shadow: 0 16px 34px rgba(31, 90, 77, 0.08);
}

.week-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.week-day-head-link {
    color: inherit;
}

.week-day-head-link:focus-visible {
    outline: 2px solid rgba(31, 90, 77, 0.28);
    outline-offset: 4px;
    border-radius: 14px;
}

.week-day-head small,
.week-day-empty,
.week-day-more {
    color: var(--muted);
}

.week-day-head strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.week-day-head em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(31, 90, 77, 0.1);
    color: var(--brand);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.week-day-events {
    display: grid;
    gap: 8px;
}

.week-event-chip {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 16px;
    color: #fffaf3;
}

.week-event-chip span {
    font-size: 11px;
    opacity: 0.9;
}

.week-event-chip strong {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-day-empty,
.week-day-more {
    margin: 0;
}

.calendar-shell {
    display: grid;
    gap: 16px;
}

.panel,
.calendar-header {
    padding: 24px;
}

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

.dashboard-month-grid {
    padding: 0;
    gap: 8px;
}

.dashboard-month-grid .weekday {
    padding: 6px 8px 2px;
}

.weekday {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.day-card {
    min-height: 160px;
    padding: 12px;
    border-radius: 20px;
    background: #fffdf9;
    border: 1px solid rgba(44, 51, 44, 0.08);
    display: grid;
    align-content: start;
    gap: 10px;
}

.day-card.is-muted {
    opacity: 0.48;
}

.day-card.is-today {
    outline: 2px solid rgba(31, 90, 77, 0.35);
    transform: translateY(-2px);
}

.day-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 700;
}

.day-card-head small {
    color: var(--brand);
}

.day-events {
    display: grid;
    gap: 8px;
}

.event-pill {
    display: grid;
    gap: 3px;
    padding: 10px;
    border-radius: 14px;
    color: white;
}

.event-pill strong {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-pill small,
.more-label {
    font-size: 12px;
    opacity: 0.92;
}

.schedule-list {
    display: grid;
    gap: 14px;
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.schedule-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.schedule-row-stacked {
    align-items: stretch;
}

.schedule-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.schedule-main-stacked {
    align-items: flex-start;
}

.admin-build-stack {
    display: grid;
    gap: 12px;
}

.admin-build-file {
    margin-top: 8px;
}

.admin-build-file code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    line-height: 1.2;
    word-break: break-word;
}

.admin-build-actions {
    align-self: flex-start;
}

.admin-build-disclosure {
    width: 100%;
    margin-top: 4px;
}

.admin-build-url {
    font-size: 0.8rem;
    line-height: 1.35;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.schedule-main h3 {
    margin: 0 0 6px;
}

.schedule-main p {
    margin: 0;
    color: var(--muted);
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    flex: none;
}

.form-shell {
    display: grid;
    gap: 18px;
}

.form-shell.narrow {
    max-width: 520px;
}

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

.form-grid label,
.form-grid fieldset {
    display: grid;
    gap: 8px;
}

.form-grid span,
.form-grid legend {
    font-weight: 600;
}

.span-2 {
    grid-column: 1 / -1;
}

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

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

.admin-form {
    grid-template-columns: 1fr;
}

.admin-reset-form {
    margin-top: 6px;
}

.admin-reset-actions {
    justify-content: flex-start;
}

input,
select,
textarea,
fieldset {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(44, 51, 44, 0.15);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

select {
    appearance: none;
}

fieldset {
    padding: 16px;
}

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

.color-choice {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 10px 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdf9;
}

.color-choice input {
    width: auto;
    padding: 0;
    margin: 0;
}

.color-choice small {
    grid-column: 3;
    color: var(--muted);
}

.swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 999px;
}

.share-box p,
.empty-state {
    color: var(--muted);
}

.share-box {
    display: grid;
    gap: 16px;
}

.background-preview {
    min-height: 0;
    border-radius: 24px;
    background-position: center;
    background-size: cover;
}

.template-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 20px;
    align-items: flex-start;
}

.template-preview-card {
    display: grid;
    gap: 10px;
    width: var(--invite-preview-width);
    flex: 0 0 auto;
}

.template-preview-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
}

.background-preview-full {
    width: var(--invite-preview-width);
    height: var(--invite-preview-height);
    overflow: hidden;
    background: #f7f1e8;
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(43, 52, 46, 0.08);
}

.background-preview-physical {
    width: var(--invite-preview-width);
    max-width: none;
}

.background-preview-full img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    background: #f7f1e8;
}

.background-preview-empty {
    display: grid;
    place-items: center;
    padding: 16px;
    text-align: center;
}

.qr-login-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.login-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.qr-login-card {
    display: grid;
    gap: 14px;
    justify-items: start;
}

.qr-login-status {
    min-height: 2.8em;
}

.qr-login-image {
    width: 280px;
    height: 280px;
    padding: 14px;
    border-radius: 28px;
    background: #fffdf9;
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(43, 52, 46, 0.08);
}

.qr-login-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-qr-disclosure {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    overflow: hidden;
}

.download-qr-disclosure summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--text);
    user-select: none;
}

.download-qr-disclosure summary::-webkit-details-marker {
    display: none;
}

.download-qr-disclosure[open] summary {
    border-bottom: 1px solid var(--line);
}

.download-qr-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 16px 18px 18px;
}

.download-qr-image {
    width: 150px;
    height: 150px;
    padding: 10px;
    border-radius: 24px;
    background: #fffdf9;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(43, 52, 46, 0.06);
}

.download-qr-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-qr-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.download-qr-copy code {
    display: block;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    word-break: break-all;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.filter-grid label {
    display: grid;
    gap: 8px;
}

.filter-color-fieldset,
.filter-actions {
    grid-column: 1 / -1;
}

.filter-color-fieldset legend {
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0 2px;
}

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

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.flash-success {
    background: #e6f4ed;
}

.flash-danger {
    background: #f9e7e6;
}

.flash-warning {
    background: #f8f0df;
}

.flash-info {
    background: #e8f1f4;
}

.danger-form {
    display: inline-flex;
}

.tone-red {
    background: var(--red);
}

.tone-blue {
    background: var(--blue);
}

.tone-green {
    background: var(--green);
}

.tone-orange {
    background: var(--orange);
}

.invite-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(31, 90, 77, 0.24), transparent 28%),
        radial-gradient(circle at bottom right, rgba(216, 136, 44, 0.22), transparent 24%),
        linear-gradient(180deg, #16362e 0%, #0f221d 100%);
}

.invite-page {
    width: min(1080px, 100%);
}

.invite-card {
    position: relative;
    overflow: hidden;
    min-height: 680px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(248, 241, 227, 0.94), rgba(241, 233, 214, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.3);
}

.invite-card.has-image {
    background-position: center;
    background-size: cover;
}

.invite-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 23, 20, 0.12), rgba(14, 23, 20, 0.55));
}

.invite-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 24px;
    align-content: end;
    min-height: 680px;
    padding: 52px;
    color: #fffaf3;
}

.invite-tag {
    margin: 0;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.invite-content h1 {
    margin: 0;
    font-size: clamp(38px, 5.4vw, 78px);
    line-height: 0.98;
}

.invite-recipient {
    margin: 0;
    font-size: 24px;
}

.invite-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.invite-meta div {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 250, 243, 0.15);
    backdrop-filter: blur(8px);
}

.invite-meta span {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 250, 243, 0.76);
}

.invite-meta strong {
    font-size: 18px;
}

.invite-message {
    max-width: 42rem;
    font-size: 18px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.invite-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.invite-footer {
    color: rgba(255, 250, 243, 0.8);
}

body {
    min-height: 100svh;
}

html.device-ios {
    -webkit-text-size-adjust: 100%;
}

html.device-ios input,
html.device-ios select,
html.device-ios textarea {
    font-size: 16px;
}

.nav form {
    margin: 0;
}

.nav-desktop-only {
    display: inline-flex;
}

.nav-keep-mobile {
    display: inline-flex;
}

.mobile-only {
    display: none !important;
}

.mobile-tabbar {
    display: none;
}

.dashboard-head {
    align-items: flex-end;
}

.mobile-dashboard-switcher {
    display: grid;
    gap: 16px;
}

.mobile-dashboard-switcher-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.mobile-dashboard-switcher-copy {
    margin: 0;
    color: var(--muted);
}

.is-iphone-dashboard {
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.14), transparent 24%),
        linear-gradient(180deg, #f5f6fb 0%, #eceff6 100%);
}

.is-iphone-dashboard .shell {
    max-width: none;
    padding: 0;
}

.is-iphone-dashboard .topbar,
.is-iphone-dashboard .mobile-tabbar,
.is-iphone-dashboard .install-note {
    display: none !important;
}

.is-iphone-dashboard .page {
    gap: 0;
}

.is-iphone-dashboard .flash-stack {
    margin: 0;
    padding: 16px 16px 0;
}

.is-iphone-standalone {
    margin: 0;
    min-height: 100svh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.14), transparent 24%),
        linear-gradient(180deg, #f5f6fb 0%, #eceff6 100%);
}

.is-iphone-standalone .iphone-standalone-page {
    min-height: 100svh;
    min-height: 100dvh;
    display: grid;
    align-content: start;
    gap: 0;
}

.is-iphone-standalone .flash-stack {
    margin: 0;
    padding: 10px 12px 0;
}

.is-iphone-standalone .flash {
    border-radius: 14px;
}

.mobile-lite-page {
    padding: calc(8px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
}

.mobile-auth-shell,
.mobile-lite-shell {
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    gap: 10px;
}

.mobile-auth-brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.mobile-auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(160deg, #1f5a4d, #163d33);
    color: #fffaf3;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 12px 26px rgba(31, 90, 77, 0.16);
}

.mobile-auth-head,
.mobile-lite-head {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 14px 12px;
    border: 1px solid rgba(30, 36, 32, 0.06);
}

.mobile-auth-head h1,
.mobile-lite-title-wrap h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
}

.mobile-auth-head p,
.mobile-lite-title-wrap p {
    margin: 6px 0 0;
    color: #6b747a;
    font-size: 13px;
}

.mobile-auth-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(30, 36, 32, 0.06);
    padding: 14px;
    display: grid;
    gap: 10px;
}

.mobile-auth-card label {
    display: grid;
    gap: 6px;
}

.mobile-auth-hint {
    margin: 2px 2px 0;
    color: #7d888f;
    font-size: 12px;
}

.mobile-pwa-banner {
    display: grid;
    gap: 10px;
    padding: 14px 14px 12px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(31, 90, 77, 0.11), rgba(255, 255, 255, 0.96)),
        #ffffff;
    border: 1px solid rgba(31, 90, 77, 0.12);
    box-shadow: 0 14px 32px rgba(27, 41, 36, 0.06);
}

.mobile-pwa-banner[hidden] {
    display: none !important;
}

.mobile-pwa-copy strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.mobile-pwa-copy p,
.mobile-pwa-ios-note {
    margin: 4px 0 0;
    color: #697279;
    font-size: 12px;
    line-height: 1.5;
}

.mobile-pwa-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mobile-pwa-actions .button {
    min-height: 40px;
    padding: 0 16px;
}

.mobile-pwa-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(32, 37, 34, 0.06);
    color: #475057;
    font-size: 13px;
    font-weight: 700;
}

.mobile-pwa-banner.is-compact {
    padding: 12px 14px;
}

.mobile-lite-head {
    display: grid;
    gap: 8px;
}

.mobile-lite-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f3f2ef;
    color: #232529;
    font-size: 14px;
    font-weight: 700;
}

.mobile-lite-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(30, 36, 32, 0.06);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.mobile-lite-filter-grid {
    display: grid;
    gap: 10px;
}

.mobile-lite-filter-grid label {
    display: grid;
    gap: 6px;
}

.mobile-lite-color-row {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
}

.mobile-lite-color-row legend {
    padding: 0 6px;
    font-size: 12px;
    color: var(--muted);
}

.mobile-lite-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-lite-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    background: #ffffff;
    font-size: 13px;
}

.mobile-lite-color-chip input {
    margin: 0;
}

.mobile-lite-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mobile-lite-range-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.mobile-lite-range-row::-webkit-scrollbar {
    display: none;
}

.mobile-lite-range-chip {
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 5px 11px;
    background: #ffffff;
    color: #5f676d;
    font-size: 13px;
}

.mobile-lite-range-chip.is-active {
    background: #232529;
    color: #ffffff;
    border-color: #232529;
}

.mobile-lite-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #646f76;
    font-size: 13px;
}

.mobile-lite-list {
    display: grid;
    gap: 8px;
}

.mobile-lite-row {
    color: #ffffff;
    border-radius: 14px;
    padding: 9px 10px;
    display: grid;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.mobile-lite-row strong {
    font-size: 16px;
    line-height: 1.2;
}

.mobile-lite-row small {
    font-size: 12px;
    opacity: 0.95;
}

.mobile-lite-row span {
    font-size: 12px;
    opacity: 0.92;
}

.is-iphone-event-form {
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.14), transparent 24%),
        linear-gradient(180deg, #f5f6fb 0%, #eceff6 100%);
}

.is-iphone-event-form .shell {
    max-width: none;
    padding: 0;
}

.is-iphone-event-form .topbar,
.is-iphone-event-form .mobile-tabbar,
.is-iphone-event-form .install-note {
    display: none !important;
}

.is-iphone-event-form .page {
    gap: 10px;
    padding: 0 12px calc(14px + env(safe-area-inset-bottom));
}

.is-iphone-event-form .flash-stack {
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top)) 0 0;
}

.is-iphone-event-form .form-shell.is-iphone-event-form-shell {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
    gap: 12px;
}

.iphone-event-editor-head {
    display: grid;
    gap: 8px;
    padding: 4px 6px 6px;
}

.iphone-event-editor-head h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.14;
}

.iphone-event-editor-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.56;
}

.is-iphone-event-form .event-form.is-iphone-quick-form {
    grid-template-columns: 1fr;
    gap: 16px;
}

.is-iphone-event-form .event-form.is-iphone-quick-form .form-section-card {
    gap: 16px;
    padding: 20px 18px;
    border-radius: 24px;
}

.is-iphone-event-form .event-form.is-iphone-quick-form .form-section-head h2 {
    margin: 0;
    line-height: 1.18;
}

.is-iphone-event-form .event-form.is-iphone-quick-form .form-section-head .eyebrow,
.is-iphone-event-form .event-form.is-iphone-quick-form .form-section-copy {
    display: none;
}

.is-iphone-event-form .event-form.is-iphone-quick-form .form-section-body {
    grid-template-columns: 1fr;
    gap: 16px;
}

.is-iphone-event-form .event-form.is-iphone-quick-form label,
.is-iphone-event-form .event-form.is-iphone-quick-form fieldset {
    gap: 8px;
}

.is-iphone-event-form .event-form.is-iphone-quick-form span,
.is-iphone-event-form .event-form.is-iphone-quick-form legend {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.is-iphone-event-form .event-form.is-iphone-quick-form input,
.is-iphone-event-form .event-form.is-iphone-quick-form select,
.is-iphone-event-form .event-form.is-iphone-quick-form textarea {
    min-height: 56px;
    padding: 17px 16px;
    border-radius: 16px;
    line-height: 1.55;
}

.is-iphone-event-form .event-form.is-iphone-quick-form textarea {
    min-height: 132px;
}

.is-iphone-event-form .event-form.is-iphone-quick-form small {
    line-height: 1.58;
}

.is-iphone-event-form .form-action-bar.is-iphone-action-bar {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 22;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
}

.is-iphone-event-form .form-action-bar.is-iphone-action-bar .button {
    width: 100%;
    min-height: 46px;
}

.is-iphone-event-form .danger-form.is-iphone-danger-form {
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.is-mobile-invitation-form {
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.14), transparent 24%),
        linear-gradient(180deg, #f5f6fb 0%, #eceff6 100%);
}

.is-mobile-invitation-form .shell {
    max-width: none;
    padding: 0;
}

.is-mobile-invitation-form .topbar,
.is-mobile-invitation-form .mobile-tabbar,
.is-mobile-invitation-form .install-note {
    display: none !important;
}

.is-mobile-invitation-form .page {
    gap: 10px;
    padding: 0 12px calc(14px + env(safe-area-inset-bottom));
}

.is-mobile-invitation-form .flash-stack {
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top)) 0 0;
}

.is-mobile-invitation-form .form-shell.is-mobile-invitation-shell {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
    gap: 12px;
}

.invitation-editor-head {
    display: grid;
    gap: 6px;
    padding: 2px 4px 4px;
}

.invitation-editor-head h1 {
    margin: 0;
    font-size: 24px;
}

.invitation-editor-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.mobile-invitation-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
}

.mobile-invitation-toolbar .button {
    width: 100%;
    min-height: 42px;
}

.mobile-invitation-form {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(30, 36, 32, 0.08);
    background: #ffffff;
    box-shadow: none;
    backdrop-filter: none;
}

.mobile-invitation-form label {
    display: grid;
    gap: 6px;
}

.is-mobile-invitation-form .share-box,
.is-mobile-invitation-form .preview-panel {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(30, 36, 32, 0.08);
    background: #ffffff;
    box-shadow: none;
    backdrop-filter: none;
}

.is-mobile-invitation-form .actions-inline {
    flex-wrap: wrap;
    gap: 10px;
}

.is-mobile-invitation-form .actions-inline .button {
    min-height: 42px;
}

.is-mobile-invitation-form .template-preview-grid {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
}

.iphone-calendar-shell {
    display: grid;
    gap: 10px;
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
    padding: calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));
}

.iphone-calendar-shell.is-reference-day-shell {
    min-height: 100svh;
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
}

.iphone-native-header,
.iphone-native-panel {
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
}

.iphone-native-header {
    position: sticky;
    top: env(safe-area-inset-top);
    z-index: 26;
    display: grid;
    gap: 10px;
    padding: 8px 4px 0;
}

.iphone-native-header.is-reference-layout {
    gap: 8px;
    padding-top: 0;
}

.iphone-reference-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.iphone-month-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #f3f2ef;
    color: #232529;
    font-size: 17px;
    font-weight: 700;
}

.iphone-reference-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.iphone-reference-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    border-radius: 999px;
    background: #f3f2ef;
    color: #232529;
    font-size: 16px;
    font-weight: 700;
}

.iphone-reference-button.is-current {
    background: rgba(255, 106, 87, 0.12);
    color: #ff6a57;
}

.iphone-reference-button.is-primary {
    min-width: 48px;
    background: #232529;
    color: #fff;
    font-size: 24px;
}

.iphone-reference-date {
    padding: 2px 0 4px;
    text-align: center;
}

.iphone-reference-date strong {
    display: inline-block;
    color: #17191c;
    font-size: 17px;
    font-weight: 800;
}

.iphone-native-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.iphone-native-year {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--muted);
}

.iphone-native-header h1,
.iphone-native-panel h2 {
    margin: 0;
}

.iphone-native-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

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

.iphone-toolbar-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.iphone-toolbar-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.iphone-toolbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(103, 117, 105, 0.14);
    background: rgba(255, 255, 255, 0.84);
    color: var(--brand);
    font-weight: 700;
}

.iphone-toolbar-button.is-icon {
    min-width: 38px;
    width: 38px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.iphone-toolbar-button.is-primary {
    background: linear-gradient(135deg, #2f6fed, #1d54bb);
    border-color: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

.iphone-week-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 2px;
    scrollbar-width: none;
}

.iphone-week-strip::-webkit-scrollbar {
    display: none;
}

.iphone-week-strip.is-reference-week-strip {
    gap: 2px;
    justify-content: space-between;
}

.iphone-weekday-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 54px;
    padding: 4px 4px 2px;
    border-radius: 16px;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    box-shadow: none;
}

.iphone-weekday-pill small {
    margin-bottom: 2px;
    font-size: 11px;
    color: #96918a;
}

.iphone-weekday-pill strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 19px;
    line-height: 1;
}

.iphone-weekday-pill.is-selected {
    background: transparent;
    box-shadow: none;
}

.iphone-weekday-pill.is-selected strong {
    background: #ff6a57;
    color: #fff;
}

.iphone-weekday-pill.is-today:not(.is-selected) strong {
    color: #ff6a57;
    background: rgba(255, 106, 87, 0.12);
}

.iphone-weekday-meta {
    margin-top: 2px;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(35, 37, 41, 0.08);
    color: #7d776f;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.shared-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.shared-title-row.is-tight {
    gap: 4px;
}

.shared-title-row > strong,
.shared-title-row > h3 {
    flex: 1 1 auto;
    min-width: 0;
}

.shared-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
}

.shared-badge.is-compact {
    min-height: 14px;
    padding: 0 5px;
    font-size: 8.5px;
}

.shared-badge.is-on-color {
    background: rgba(255, 255, 255, 0.92);
    color: #2853a5;
}

.shared-badge.is-muted {
    background: rgba(35, 37, 41, 0.08);
    color: #5b6471;
}

.iphone-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(227, 231, 241, 0.8);
}

.iphone-segmented-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 700;
}

.iphone-segmented-item.is-active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 6px 18px rgba(79, 91, 118, 0.12);
}

.iphone-native-panel {
    display: grid;
    gap: 12px;
    padding: 0 0 8px;
}

.iphone-native-panel.is-day-panel {
    position: relative;
    gap: 10px;
}

.iphone-native-panel[data-iphone-swipe-panel] {
    position: relative;
    overflow: clip;
    touch-action: pan-y;
}

.iphone-swipe-content {
    transition: transform 210ms cubic-bezier(0.22, 0.86, 0.28, 1);
    will-change: transform;
}

.iphone-native-panel.is-swipe-active .iphone-swipe-content {
    transition: none;
}

.iphone-native-panel.is-reference-day-panel {
    padding-top: 2px;
    padding-bottom: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iphone-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.iphone-inline-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(47, 111, 237, 0.1);
    color: var(--blue);
    font-weight: 700;
}

.iphone-day-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.iphone-swipe-preview {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    min-height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(34, 46, 68, 0.9);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.iphone-swipe-preview.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.iphone-native-panel.is-day-panel .iphone-swipe-preview {
    top: 74px;
}

.iphone-month-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.iphone-all-day-lane {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 0 2px;
}

.iphone-all-day-label {
    padding-top: 8px;
    color: #989289;
    font-size: 12px;
    text-align: right;
}

.iphone-all-day-events {
    display: grid;
    gap: 6px;
}

.iphone-all-day-event {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #fff;
    overflow: hidden;
    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.76),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.iphone-all-day-event strong,
.iphone-all-day-event span {
    margin: 0;
}

.iphone-all-day-event span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.iphone-day-timeline {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    min-height: var(--iphone-day-height);
}

.iphone-day-hours {
    position: relative;
    height: var(--iphone-day-height);
    transition: transform 180ms ease;
}

.iphone-day-hour-label {
    position: absolute;
    right: 0;
    transform: translateY(-8px);
    color: #a7a19a;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.iphone-day-track {
    position: relative;
    height: var(--iphone-day-height);
    border-radius: 0;
    background: #fff;
    overflow: hidden;
    transition: transform 180ms ease;
    cursor: pointer;
}

.iphone-day-track.is-gesture-active,
.iphone-day-hours.is-gesture-active {
    transition: none;
}

.iphone-day-track.is-event-dragging {
    cursor: grabbing;
}

.iphone-day-scroller {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
    touch-action: pan-y;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.iphone-day-scroller::-webkit-scrollbar {
    display: none;
}

.iphone-day-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #ece8e1;
}

.iphone-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ff6a57;
    z-index: 4;
}

.iphone-now-line small {
    position: absolute;
    top: -10px;
    left: 18px;
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 246, 251, 0.96);
    padding: 0 4px;
    border-radius: 999px;
}

.iphone-now-dot {
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ff6a57;
}

.iphone-event-block {
    position: absolute;
    display: grid;
    gap: 3px;
    align-content: start;
    padding: 7px 9px;
    border-radius: 12px;
    color: #fff;
    overflow: hidden;
    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.78),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    z-index: 3;
    touch-action: pan-y;
    transform-origin: center top;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

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

.iphone-event-block.is-current {
    outline: 2px solid rgba(181, 63, 57, 0.34);
}

.iphone-event-block.is-dragging {
    z-index: 28;
    opacity: 0.98;
    transition:
        box-shadow 180ms ease,
        opacity 180ms ease;
    box-shadow:
        0 18px 34px rgba(26, 34, 30, 0.22),
        inset 0 -1px 0 rgba(255, 255, 255, 0.82),
        inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.iphone-event-block.is-drag-saving {
    opacity: 0.72;
}

.iphone-event-block strong,
.iphone-event-block span,
.iphone-event-block small {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iphone-event-block .shared-title-row > strong {
    flex: 1 1 auto;
    min-width: 0;
}

.iphone-event-block strong {
    font-size: 12px;
    line-height: 1.2;
}

.iphone-event-block span,
.iphone-event-block small {
    font-size: 10px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.84);
}

.iphone-week-agenda {
    display: grid;
    gap: 12px;
}

.iphone-week-agenda-day {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(246, 248, 253, 0.98);
    box-shadow: inset 0 0 0 1px rgba(103, 117, 105, 0.08);
}

.iphone-week-agenda-day.is-selected {
    background: linear-gradient(180deg, rgba(47, 111, 237, 0.12), rgba(246, 248, 253, 0.98));
    box-shadow: inset 0 0 0 1px rgba(47, 111, 237, 0.16);
}

.iphone-week-agenda-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.iphone-week-agenda-head small,
.iphone-week-agenda-empty {
    color: var(--muted);
}

.iphone-week-agenda-head strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.iphone-week-agenda-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(47, 111, 237, 0.1);
    color: var(--blue);
    font-weight: 700;
}

.iphone-week-agenda-events {
    display: grid;
    gap: 8px;
}

.iphone-week-agenda-event {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 16px;
    color: #fff;
    overflow: hidden;
    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.76),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.iphone-week-agenda-event strong,
.iphone-week-agenda-event span {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iphone-week-agenda-event .shared-title-row {
    flex: 1 1 auto;
    min-width: 0;
}

.iphone-week-agenda-event span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.84);
}

.iphone-event-block::after,
.iphone-all-day-event::after,
.iphone-week-agenda-event::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 7px;
    height: 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    pointer-events: none;
}

.iphone-month-grid {
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.iphone-drag-scope-sheet {
    position: fixed;
    inset: 0;
    z-index: 48;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px 12px calc(14px + env(safe-area-inset-bottom));
    background: rgba(20, 24, 30, 0.18);
    backdrop-filter: blur(8px);
}

.iphone-drag-scope-sheet[hidden] {
    display: none !important;
}

.iphone-drag-scope-card {
    width: min(100%, 460px);
    display: grid;
    gap: 10px;
    padding: 18px 18px 16px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(20, 24, 30, 0.18);
}

.iphone-drag-scope-card h3,
.iphone-drag-scope-card p {
    margin: 0;
}

.iphone-drag-scope-card p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.45;
}

.iphone-drag-scope-actions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.mobile-view-tabs,
.day-quick-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mobile-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--text);
    font-weight: 700;
}

.mobile-view-tab.is-active {
    background: linear-gradient(135deg, #225c50, #173d33);
    border-color: transparent;
    color: #fff8f2;
    box-shadow: 0 12px 28px rgba(31, 42, 37, 0.16);
}

.mobile-day-focus-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.mobile-day-focus-copy,
.form-section-copy {
    margin: 0;
    color: var(--muted);
}

.today-timeline {
    display: grid;
    gap: 12px;
}

.timeline-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    color: #fffaf3;
    box-shadow: 0 14px 32px rgba(31, 42, 37, 0.16);
}

.timeline-time {
    display: grid;
    gap: 4px;
    align-content: start;
    padding: 10px 8px;
    border-radius: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.16);
}

.timeline-time strong,
.timeline-copy h3 {
    margin: 0;
}

.timeline-time small,
.timeline-copy p {
    margin: 0;
    color: rgba(255, 250, 243, 0.84);
}

.timeline-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.timeline-copy h3,
.day-card-head > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-copy .shared-title-row h3,
.day-timeline-entry-copy .shared-title-row h3 {
    margin: 0;
}

.day-head-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(31, 90, 77, 0.1);
    color: var(--brand);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.calendar-day-link {
    color: inherit;
    text-decoration: none;
}

.day-card.is-selected {
    background: linear-gradient(180deg, rgba(34, 92, 80, 0.12), rgba(255, 253, 249, 0.98));
    outline: 2px solid rgba(34, 92, 80, 0.45);
    transform: translateY(-2px);
}

.day-card.is-selected .day-card-count {
    background: rgba(34, 92, 80, 0.16);
}

.calendar-shell .day-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.calendar-shell .day-card.is-today,
.calendar-shell .day-card.is-selected {
    outline: 0;
    transform: none;
    background: transparent;
}

.calendar-shell .day-card.is-selected .day-card-count {
    background: rgba(34, 92, 80, 0.08);
}

.day-events-mobile {
    display: none;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

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

.day-dot-count {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
}

.event-form.panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.form-section-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.form-section-head {
    display: grid;
    gap: 8px;
}

.form-section-head .eyebrow {
    margin-bottom: 0;
}

.form-section-head h2 {
    margin: 0;
}

.form-section-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-fieldset {
    padding: 0;
    border: 0;
    background: transparent;
}

.form-action-bar {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 251, 245, 0.9);
    box-shadow: 0 12px 28px rgba(43, 52, 46, 0.09);
    backdrop-filter: blur(10px);
}

.mobile-tab {
    display: grid;
    gap: 2px;
    justify-items: center;
    padding: 10px 8px;
    border-radius: 18px;
    color: var(--text);
}

.mobile-tab small {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.mobile-tab strong {
    font-size: 14px;
}

.mobile-tab.is-active {
    background: #fffdf9;
    box-shadow: 0 8px 20px rgba(43, 52, 46, 0.08);
}

.mobile-tab-primary {
    background: linear-gradient(135deg, #225c50, #173d33);
    color: #fff8f2;
}

.mobile-tab-primary small {
    color: rgba(255, 248, 242, 0.82);
}

@media (max-width: 980px) {
    .hero,
    .stats-grid,
    .install-guide-grid,
    .admin-grid,
    .view-grid {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weekday {
        display: none;
    }

    .form-grid,
    .color-picker,
    .invite-meta,
    .build-meta,
    .filter-grid,
    .filter-color-picker,
    .template-preview-grid,
    .download-qr-panel,
    .qr-login-grid,
    .login-grid {
        grid-template-columns: 1fr;
    }

    .schedule-row,
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .install-panel {
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 16px;
    }

    .hero-copy,
    .hero-card,
    .panel,
    .stat-card,
    .topbar {
        border-radius: 22px;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .invite-content {
        padding: 28px;
    }

    .invite-card {
        min-height: 560px;
    }

    .invite-content {
        min-height: 560px;
    }
}

@media (max-width: 980px) {
    .shell {
        padding-bottom: calc(116px + env(safe-area-inset-bottom));
    }

    .page {
        gap: 18px;
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    .topbar {
        position: sticky;
        top: calc(10px + env(safe-area-inset-top));
        z-index: 24;
        gap: 14px;
        padding: 16px 18px;
    }

    .brand small {
        display: none;
    }

    .nav {
        gap: 8px;
    }

    .nav-desktop-only {
        display: none;
    }

    .nav-keep-mobile {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }

    .nav form.nav-keep-mobile .button {
        width: 100%;
    }

    .nav-user {
        width: 100%;
        text-align: center;
        padding-top: 2px;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-tabbar {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 28px;
        background: rgba(255, 251, 245, 0.94);
        box-shadow: 0 18px 50px rgba(43, 52, 46, 0.18);
        backdrop-filter: blur(16px);
    }

    .dashboard-head {
        align-items: stretch;
    }

    .dashboard-head .actions-inline,
    .view-panel-head .actions-inline {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .dashboard-head .actions-inline::-webkit-scrollbar,
    .view-panel-head .actions-inline::-webkit-scrollbar {
        display: none;
    }

    .mobile-secondary-panel {
        display: none !important;
    }

    .mobile-pane,
    .mobile-pane-grid {
        display: none !important;
    }

    .mobile-pane.is-active {
        display: block !important;
    }

    .mobile-pane-grid.is-active {
        display: grid !important;
    }

    .dashboard-head .actions-inline .button,
    .filter-actions .button,
    .row-actions .button,
    .form-action-bar .button {
        flex: 1 1 calc(50% - 6px);
    }

    .mobile-day-focus {
        gap: 16px;
    }

    .dashboard-head .actions-inline .button,
    .view-panel-head .actions-inline .button {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .mobile-dashboard-switcher .button,
    .day-quick-nav .button {
        flex: 1 1 calc(50% - 5px);
    }

    .is-iphone-dashboard .iphone-calendar-shell {
        max-width: 100%;
        padding: calc(8px + env(safe-area-inset-top)) 10px calc(6px + env(safe-area-inset-bottom));
    }

    .is-iphone-dashboard .iphone-native-header,
    .is-iphone-dashboard .iphone-native-panel {
        border-radius: 24px;
    }

    .is-iphone-dashboard .iphone-native-header.is-reference-layout,
    .is-iphone-dashboard .iphone-native-panel.is-reference-day-panel {
        border-radius: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .is-iphone-dashboard .iphone-native-toolbar {
        width: 100%;
        justify-content: space-between;
    }

    .is-iphone-dashboard .iphone-toolbar-nav {
        flex: 1 1 auto;
        justify-content: center;
    }

    .is-iphone-dashboard .iphone-day-scroller {
        max-height: none;
    }

    .iphone-calendar-actions {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .iphone-calendar-actions::-webkit-scrollbar {
        display: none;
    }

    .iphone-calendar-actions .button {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .mobile-view-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .mobile-view-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-view-tab {
        flex: 0 0 auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .calendar-header {
        position: sticky;
        top: calc(104px + env(safe-area-inset-top));
        z-index: 18;
    }

    .month-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .month-nav::-webkit-scrollbar {
        display: none;
    }

    .month-nav .button {
        flex: 0 0 auto;
    }

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

    .weekday {
        display: block;
        padding: 2px 0 6px;
        text-align: center;
        font-size: 11px;
    }

    .day-card {
        min-height: 76px;
        padding: 8px 6px;
        border-radius: 16px;
        gap: 6px;
    }

    .day-card-head {
        align-items: flex-start;
    }

    .day-card-head small {
        font-size: 10px;
    }

    .day-events {
        display: none;
    }

    .day-events-mobile {
        display: flex;
    }

    .schedule-list {
        gap: 12px;
    }

    .day-timeline-row {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 10px;
    }

    .day-timeline-entry {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .day-timeline-duration {
        justify-self: start;
    }

    .week-board {
        grid-template-columns: repeat(7, minmax(148px, 1fr));
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .schedule-row {
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.62);
    }

    .schedule-row:first-child {
        padding-top: 16px;
        border-top: 1px solid var(--line);
    }

    .row-actions {
        width: 100%;
    }

    .form-section-card {
        padding: 20px;
        border-radius: 22px;
    }

    .form-section-body {
        grid-template-columns: 1fr;
    }

    .form-action-bar {
        position: sticky;
        bottom: calc(104px + env(safe-area-inset-bottom));
        margin-bottom: calc(18px + env(safe-area-inset-bottom));
        transform: translateY(-16px);
        z-index: 20;
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 14px;
        padding-bottom: calc(114px + env(safe-area-inset-bottom));
    }

    .topbar {
        top: calc(8px + env(safe-area-inset-top));
        border-radius: 20px;
        padding: 14px;
    }

    .brand {
        gap: 10px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .mobile-tabbar {
        left: 10px;
        right: 10px;
        gap: 8px;
        padding: 8px;
    }

    .mobile-tab {
        padding: 10px 4px;
    }

    .mobile-tab strong {
        font-size: 13px;
    }

    .timeline-card {
        grid-template-columns: 62px minmax(0, 1fr);
        padding: 12px;
        border-radius: 18px;
    }

    .mobile-dashboard-switcher {
        gap: 14px;
    }

    .mobile-view-tab {
        min-height: 40px;
        padding: 0 16px;
    }

    .is-iphone-dashboard .shell {
        padding: 0;
    }

    .is-iphone-dashboard .page {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .is-iphone-dashboard .iphone-calendar-shell {
        gap: 10px;
        padding: calc(6px + env(safe-area-inset-top)) 8px calc(4px + env(safe-area-inset-bottom));
    }

    .is-iphone-dashboard .iphone-native-header,
    .is-iphone-dashboard .iphone-native-panel {
        border-radius: 22px;
        padding: 14px;
    }

    .is-iphone-dashboard .iphone-native-header.is-reference-layout,
    .is-iphone-dashboard .iphone-native-panel.is-reference-day-panel {
        border-radius: 0;
        padding: 0;
    }

    .is-iphone-dashboard .iphone-native-header {
        top: calc(4px + env(safe-area-inset-top));
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-reference-toolbar {
        gap: 10px;
    }

    .is-iphone-dashboard .iphone-reference-actions {
        gap: 10px;
    }

    .is-iphone-dashboard .iphone-reference-button {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
    }

    .is-iphone-dashboard .iphone-native-header-top {
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-native-header h1 {
        font-size: 28px;
    }

    .is-iphone-dashboard .iphone-native-toolbar {
        gap: 8px;
    }

    .is-iphone-dashboard .iphone-toolbar-link {
        order: 2;
        width: 100%;
        text-align: center;
    }

    .is-iphone-dashboard .iphone-toolbar-nav {
        flex: 1 1 auto;
        justify-content: center;
    }

    .is-iphone-dashboard .iphone-weekday-pill {
        min-width: 44px;
        min-height: 60px;
        padding: 7px 6px;
    }

    .is-iphone-dashboard .iphone-weekday-pill strong {
        width: 32px;
        height: 32px;
        font-size: 17px;
    }

    .is-iphone-dashboard .iphone-day-scroller {
        max-height: none;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
    }

    .is-iphone-dashboard .iphone-swipe-preview {
        top: 12px;
        min-width: 134px;
    }

    .is-iphone-dashboard .iphone-native-panel.is-day-panel .iphone-swipe-preview {
        top: 66px;
    }

    .day-quick-nav {
        gap: 8px;
    }

    .all-day-strip {
        gap: 8px;
    }

    .all-day-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .calendar-header {
        top: calc(96px + env(safe-area-inset-top));
        padding: 18px;
    }

    .calendar-grid {
        gap: 4px;
        padding: 10px;
    }

    .day-card {
        min-height: 68px;
        padding: 6px 4px;
        border-radius: 14px;
    }

    .day-card-head > span {
        font-size: 13px;
    }

    .day-head-meta {
        gap: 4px;
    }

    .day-card-count {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .day-dot {
        width: 7px;
        height: 7px;
    }

    .form-section-card {
        padding: 18px;
    }

    .form-action-bar {
        bottom: calc(98px + env(safe-area-inset-bottom));
        margin-bottom: calc(14px + env(safe-area-inset-bottom));
        padding: 12px;
        transform: translateY(-12px);
    }

    .is-iphone-event-form .page {
        padding: 0 8px calc(12px + env(safe-area-inset-bottom));
    }

    .is-iphone-event-form .iphone-event-editor-head h1 {
        font-size: 22px;
    }

    .is-iphone-event-form .event-form.is-iphone-quick-form .form-section-card {
        padding: 18px 16px;
        border-radius: 22px;
    }

    .is-iphone-event-form .form-action-bar.is-iphone-action-bar {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 370px) {
    .mobile-lite-page {
        padding: calc(6px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
    }

    .mobile-auth-shell,
    .mobile-lite-shell {
        gap: 8px;
    }

    .mobile-auth-head,
    .mobile-lite-head,
    .mobile-auth-card,
    .mobile-lite-card,
    .mobile-pwa-banner {
        border-radius: 16px;
        padding: 12px;
    }

    .mobile-auth-mark {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 16px;
    }

    .mobile-auth-head h1,
    .mobile-lite-title-wrap h1 {
        font-size: 24px;
    }

    .mobile-pwa-actions {
        gap: 8px;
    }

    .mobile-pwa-actions .button,
    .mobile-pwa-dismiss {
        min-height: 38px;
    }

    .is-iphone-dashboard .iphone-calendar-shell {
        gap: 8px;
        padding: calc(4px + env(safe-area-inset-top)) 6px calc(4px + env(safe-area-inset-bottom));
    }

    .is-iphone-dashboard .iphone-native-header {
        gap: 10px;
        top: calc(2px + env(safe-area-inset-top));
    }

    .is-iphone-dashboard .iphone-reference-toolbar {
        gap: 6px;
    }

    .is-iphone-dashboard .iphone-month-pill {
        min-height: 36px;
        padding: 0 10px;
        font-size: 15px;
    }

    .is-iphone-dashboard .iphone-reference-actions {
        gap: 6px;
    }

    .is-iphone-dashboard .iphone-reference-button {
        min-width: 36px;
        height: 36px;
        padding: 0 9px;
        font-size: 14px;
    }

    .is-iphone-dashboard .iphone-reference-button.is-primary {
        min-width: 40px;
        font-size: 20px;
    }

    .is-iphone-dashboard .iphone-week-strip,
    .is-iphone-dashboard .iphone-week-strip.is-reference-week-strip {
        gap: 0;
    }

    .is-iphone-dashboard .iphone-weekday-pill {
        min-width: 40px;
        min-height: 54px;
        padding: 5px 3px 2px;
    }

    .is-iphone-dashboard .iphone-weekday-pill small {
        font-size: 10px;
        margin-bottom: 1px;
    }

    .is-iphone-dashboard .iphone-weekday-pill strong {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .is-iphone-dashboard .iphone-weekday-meta {
        min-width: 16px;
        height: 14px;
        padding: 0 4px;
        font-size: 9px;
        line-height: 14px;
    }

    .is-iphone-dashboard .iphone-reference-date {
        padding: 0 0 2px;
    }

    .is-iphone-dashboard .iphone-reference-date strong {
        font-size: 15px;
    }

    .is-iphone-dashboard .iphone-native-panel.is-reference-day-panel {
        gap: 6px;
    }

    .is-iphone-dashboard .iphone-all-day-lane {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 6px;
    }

    .is-iphone-dashboard .iphone-all-day-label {
        padding-top: 6px;
        font-size: 11px;
    }

    .is-iphone-dashboard .iphone-all-day-event {
        padding: 8px 10px;
        border-radius: 12px;
    }

    .is-iphone-dashboard .iphone-all-day-event strong {
        font-size: 11px;
    }

    .is-iphone-dashboard .iphone-all-day-event span {
        font-size: 10px;
    }

    .is-iphone-dashboard .iphone-day-timeline {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 6px;
    }

    .is-iphone-dashboard .iphone-day-hour-label {
        transform: translateY(-7px);
        font-size: 10px;
    }

    .is-iphone-dashboard .iphone-swipe-preview {
        min-width: 124px;
        min-height: 32px;
        padding: 0 12px;
        font-size: 12px;
    }

    .is-iphone-dashboard .iphone-native-panel.is-day-panel .iphone-swipe-preview {
        top: 60px;
    }

    .is-iphone-dashboard .iphone-event-block {
        padding: 6px 7px;
        border-radius: 10px;
    }

    .is-iphone-dashboard .iphone-event-block strong {
        font-size: 11px;
    }

    .is-iphone-dashboard .iphone-event-block span,
    .is-iphone-dashboard .iphone-event-block small {
        font-size: 9px;
    }

    .is-iphone-dashboard .shared-title-row {
        gap: 4px;
    }

    .is-iphone-dashboard .shared-badge {
        min-height: 16px;
        padding: 0 6px;
        font-size: 9px;
    }

    .is-iphone-dashboard .shared-badge.is-compact {
        min-height: 13px;
        padding: 0 4px;
        font-size: 8px;
    }
}

@media (min-width: 768px) and (max-width: 1366px) {
    .is-iphone-dashboard .iphone-calendar-shell {
        max-width: 1080px;
        margin: 0 auto;
        padding: calc(12px + env(safe-area-inset-top)) 16px calc(8px + env(safe-area-inset-bottom));
    }

    .is-iphone-dashboard .iphone-reference-toolbar {
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-reference-actions {
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-reference-button {
        min-width: 50px;
        height: 44px;
        padding: 0 14px;
    }

    .is-iphone-dashboard .iphone-weekday-pill {
        min-width: 76px;
        min-height: 74px;
        padding: 10px 8px;
    }

    .is-iphone-dashboard .iphone-day-scroller {
        max-height: calc(100vh - 256px);
    }

    .is-iphone-dashboard .iphone-event-block {
        border-radius: 12px;
        padding: 6px 8px;
    }

    .is-iphone-dashboard .iphone-week-agenda {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        display: grid;
        gap: 12px;
    }

    .is-iphone-dashboard .iphone-month-grid .day-card {
        min-height: 102px;
    }

    .is-iphone-dashboard .iphone-swipe-preview {
        top: 18px;
        min-width: 170px;
        min-height: 38px;
        font-size: 14px;
    }

    .is-iphone-dashboard .iphone-native-panel.is-day-panel .iphone-swipe-preview {
        top: 78px;
    }
}
