body {
    overflow: auto;
    min-height: 100vh;
    background: var(--bg);
}

.dashboard-app {
    width: 100%;
}

.account-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}

#accountAuthenticatedView {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.account-notion-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-notion-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--sidebar-border, #e9e9e7);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
}



.account-notion-row-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.account-notion-status-pill {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--sidebar-border, #e9e9e7);
    color: var(--sidebar-text-muted, #6b6b6b);
}

.account-notion-status-pill--connected {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.account-notion-status-pill--connected {
    color: #4ade80;
}

.account-notion-row-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.account-notion-row-action .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
}

.account-notion-add {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--sidebar-border, #e9e9e7);
}

.account-notion-add-hint {
    margin-top: 8px;
    margin-bottom: 0;
}

.workspace-meta {
    font-size: 14px;
    opacity: 0.75;
}

.revoked-banner {
    background: #3d3200;
    border-color: #665500;
    color: #ffe69c;
}

.workspace-switcher {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.workspace-switcher select {
    flex: 1;
    max-width: 280px;
}

.fetch-meta {
    font-size: 12px;
    opacity: 0.65;
}

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

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-card h2 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.section-hint,
.empty-hint {
    font-size: 14px;
    opacity: 0.75;
    margin-bottom: 16px;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-header-row h2 {
    margin-bottom: 0;
}

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

.form-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.field-hint {
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
    opacity: 0.72;
    margin: 0 0 8px;
    max-width: 52rem;
}

.field-hint code {
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}

.field-hint code {
    background: rgba(255, 255, 255, 0.08);
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text);
    font-family: var(--font-sans);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.mapping-fields {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.mapping-fields {
    border-top-color: #333;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 14px;
    width: auto;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1.5px solid rgba(220, 38, 38, 0.35);
    margin: 0;
    box-shadow: none;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background: rgba(220, 38, 38, 0.14);
    color: #991b1b;
    border-color: rgba(185, 28, 28, 0.5);
    transform: none;
    box-shadow: none;
}

.btn-danger:active {
    background: rgba(220, 38, 38, 0.2);
    transform: none;
}

.btn-danger.btn-sm {
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.5);
    transform: none;
    box-shadow: none;
}

.btn-danger:active {
    background: rgba(248, 113, 113, 0.24);
}

.account-notion-row-action .btn-danger:hover,
.account-notion-row-action .btn-danger:focus-visible,
.account-notion-row-action .btn-danger:active {
    transform: none;
}

.inline-error {
    background: #2d1b1b;
    color: #fc8181;
}

.feeds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: var(--font-sans);
}

.feed-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.feed-card-intro {
    flex: 1;
    min-width: 0;
}

.feed-card-title {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 4px;
    color: var(--text);
}

.feed-meta {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text);
    opacity: 0.72;
    margin: 0 0 4px;
}

.feed-meta--secondary {
    margin-bottom: 0;
}

.feed-sync-status {
    flex-shrink: 0;
    max-width: 46%;
    margin: 0;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: right;
    color: var(--text);
    opacity: 0.72;
    word-break: break-word;
}

.feed-sync-status--ok {
    color: var(--text);
    opacity: 1;
    background: var(--bg-elevated);
    border-color: var(--border);
}

.feed-sync-status--error {
    color: var(--error);
    opacity: 1;
    background: var(--error-bg);
    border-color: rgba(255, 59, 48, 0.35);
}

.feed-sync-status--never {
    color: var(--text);
    opacity: 0.72;
}

.feed-url-block {
    margin-bottom: 16px;
}

.feed-url-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.feed-url-field {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    overflow: hidden;
}

.feed-url-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    word-break: break-all;
    color: var(--text);
    background: transparent;
    border: none;
}

.feed-url-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.feed-url-copy:hover {
    background: var(--bg-surface);
    color: var(--text);
}

.feed-url-copy:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent-soft);
    color: var(--text);
}

.feed-url-copy svg {
    display: block;
    flex-shrink: 0;
}

.feed-card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.feed-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.feed-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.85;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.feed-toolbar-btn span {
    color: inherit;
}

.feed-toolbar-btn svg {
    display: block;
    flex-shrink: 0;
}

.feed-toolbar-btn:hover {
    border-color: var(--border-strong);
    background: var(--bg);
    color: var(--text);
    opacity: 1;
}

.feed-toolbar-btn:focus-visible {
    outline: none;
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.feed-toolbar-btn--icon {
    width: 36px;
    padding: 0;
}

.feed-toolbar-btn--danger:hover {
    color: var(--error);
    border-color: rgba(255, 59, 48, 0.45);
    background: var(--error-bg);
}

@media (max-width: 560px) {
    .feed-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .feed-sync-status {
        max-width: 100%;
        text-align: left;
        align-self: stretch;
    }
}

.setup-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 0 32px;
    overflow-x: auto;
}

.setup-journey-track {
    --setup-phone-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: min(100%, calc(var(--setup-phone-width) * 3 + 7rem));
    margin: 0 auto;
    padding: 4px 0;
}

.setup-phone {
    flex: 0 0 auto;
    width: var(--setup-phone-width);
}

.setup-phone-device {
    box-sizing: border-box;
    width: 100%;
    padding: calc(var(--setup-phone-width) * 0.056);
    border-radius: calc(var(--setup-phone-width) * 0.244);
    background: #0a0a0a;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-md);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.setup-phone-bezel {
    position: relative;
    width: 100%;
    aspect-ratio: 390 / 844;
    border-radius: calc(var(--setup-phone-width) * 0.163);
    overflow: hidden;
    border: 1px solid #2c2c2e;
    background: #000;
}

.setup-phone-screen {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    padding: 11% 7% 6%;
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
}

.setup-phone-screen::before {
    content: "";
    position: absolute;
    top: 4.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 32%;
    height: 3.2%;
    min-height: 4px;
    max-height: 8px;
    border-radius: 999px;
    background: #1d1d1f;
    z-index: 1;
}

.setup-phone-content {
    position: relative;
    z-index: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    font-family: var(--font-sans);
}

.setup-phone-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    text-align: center;
}

.setup-phone-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-bottom: 10px;
    border-radius: 50%;
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg);
}

.setup-phone-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

.setup-phone-desc {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
    max-width: 88%;
}

.setup-phone-status {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
}

.setup-phone-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 0;
    padding-top: 0;
}

.setup-phone-actions .btn {
    width: 100%;
    font-size: 13px;
}

.setup-phone-link {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.setup-phone-link:hover {
    color: var(--text);
}

.setup-calendar-apps {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.setup-calendar-apps li {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.setup-phone-done {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.82);
    color: var(--text);
}

.setup-phone-done-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--setup-phone-width) * 0.29);
    height: calc(var(--setup-phone-width) * 0.29);
    border-radius: 50%;
    border: 2px solid var(--text);
    background: var(--bg-elevated);
}

.setup-phone-done-icon svg {
    width: 55%;
    height: 55%;
}

.setup-phone-done-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.setup-journey-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    color: var(--text-muted);
    opacity: 0.7;
}

.setup-journey-arrow svg {
    display: block;
}

.setup-phone--pending .setup-phone-device {
    opacity: 0.55;
}

.setup-phone--pending .setup-phone-copy {
    opacity: 0.75;
}

.setup-phone--active .setup-phone-device {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-lg);
    opacity: 1;
}

.setup-phone--active .setup-phone-step-num {
    border-color: var(--text);
    color: var(--text);
    background: var(--accent-soft);
}

.setup-phone--active .setup-phone-title {
    color: var(--text);
}

.setup-phone--complete .setup-phone-device {
    border-color: var(--border-strong);
    opacity: 1;
}

.setup-phone--complete .setup-phone-done:not(.hidden) {
    display: flex;
}

.setup-phone--complete .setup-phone-actions {
    visibility: hidden;
}

.setup-journey-arrow--complete {
    color: var(--text);
    opacity: 1;
}

@media (max-width: 720px) {
    .setup-journey-track {
        --setup-phone-width: min(250px, 90vw);
        flex-direction: column;
        align-items: center;
        min-width: 0;
        gap: 10px;
    }

    .setup-journey-arrow {
        transform: rotate(90deg);
    }
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.toast.success {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.toast.error {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.modal-content {
    position: relative;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
}

.billing-plan-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.billing-plan-btn {
    width: 100%;
    justify-content: center;
}

.account-billing-actions {
    margin-top: 12px;
}

.account-upgrade-actions + .account-billing-actions {
    margin-top: 8px;
}

.preview-list {
    list-style: none;
    padding: 0;
}

.preview-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.preview-list li {
    border-bottom-color: #333;
}

.preview-list li:last-child {
    border-bottom: none;
}

.preview-event-title {
    font-weight: 600;
}

.preview-event-date {
    font-size: 13px;
    opacity: 0.75;
}

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

    .url-row {
        flex-direction: column;
        align-items: stretch;
    }

    .url-row label {
        min-width: unset;
    }
}
