.account-plan-panel {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
}

.account-plan-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.account-plan-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.45rem;
    min-width: 0;
}

.account-plan-actions .account-tool {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 0.55rem 0.6rem;
    gap: 0.45rem;
}

.account-plan-actions .account-tool-icon {
    width: 26px;
    height: 26px;
}

.account-plan-actions .account-tool-label {
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: normal;
}

.account-plan-actions .account-tool-sub,
.account-plan-actions .account-tool-chevron {
    display: none;
}

.account-plan-icon {
    color: inherit;
}

.account-plan-icon svg {
    width: 13px;
    height: 13px;
}

.account-plan-icon--plans {
    background-color: var(--accent-soft);
    color: var(--accent);
}

.account-plan-icon--manage {
    background-color: var(--warning-soft);
    color: #eab308;
}

.current-plan-badge {
    font-weight: 700;
}

.current-plan-badge--plus,
.current-plan-badge--pro {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.current-plan-badge--plus {
    background-color: var(--accent-soft);
    color: var(--accent);
}

.current-plan-badge--pro {
    background: linear-gradient(135deg, #f59e0b, #eab308);
    color: #04121c;
}

.pricing-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.45);
}

.pricing-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.pricing-modal-inner {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    max-width: 960px;
    width: 100%;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
}

.dialog-card {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    max-width: 420px;
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    box-sizing: border-box;
}

.dialog-card h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.dialog-card .account-form {
    text-align: start;
}

.schedule-prompt-card {
    max-width: 380px;
}

.schedule-prompt-hint {
    margin: -0.4rem 0 1.1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.schedule-prompt-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.3rem;
}

.schedule-prompt-fields > * {
    min-width: 0;
}

.schedule-prompt-fields .account-field:nth-child(3) {
    grid-column: 1 / -1;
}

.schedule-prompt-fields input,
.schedule-prompt-fields select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.schedule-prompt-fields:has(#schedulePromptTimeField[hidden]) {
    grid-template-columns: 1fr;
}

/* .account-field's own `display` would otherwise beat the `hidden` attribute
   - author rules always win over the UA stylesheet regardless of specificity.
   Same reason each panel/field below needs its own [hidden] rule. */
#schedulePromptTimeField[hidden],
#schedulePromptPlaceLabel[hidden],
.schedule-prompt-fields[hidden],
.schedule-prompt-direction[hidden],
.schedule-mode-toggle[hidden] {
    display: none;
}

/* Segmented "At a time / At a place" switch. */
.schedule-mode-toggle {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.schedule-mode-btn {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.7rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.schedule-mode-btn:hover:not(:disabled) {
    color: var(--text-main);
}

.schedule-mode-btn.is-active {
    background-color: var(--accent);
    color: #04121c;
}

.schedule-mode-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Place panel is a single column - the 2-up time grid would leave the
   direction radios stranded in a half-width column. */
#schedulePromptPlacePanel {
    grid-template-columns: 1fr;
}

.schedule-prompt-direction {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.schedule-direction-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.schedule-direction-option:hover {
    border-color: var(--accent);
}

/* :has lets the whole row read as selected, not just the radio dot. */
.schedule-direction-option:has(input:checked) {
    border-color: var(--accent);
    background-color: var(--accent-soft);
}

.schedule-direction-option input {
    accent-color: var(--accent);
    margin: 0;
}

.schedule-new-place-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.schedule-new-place-link:hover {
    text-decoration: underline;
}

.schedule-geo-unsupported {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0 0 0.8rem;
}

.schedule-prompt-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.85rem 1.1rem;
}

.pricing-modal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.pricing-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    flex: 1;
    min-width: 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

@media (max-width: 520px) {
    .pricing-modal {
        padding: 0.7rem;
        padding-bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
    }

    .dialog-card {
        padding: 1.15rem 0.95rem 1rem;
    }

    .schedule-prompt-fields {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .schedule-prompt-fields .account-field:nth-child(3) {
        grid-column: auto;
    }

    .schedule-prompt-actions .btn {
        white-space: normal;
    }

    .schedule-mode-toggle {
        flex-wrap: wrap;
        border-radius: 14px;
    }
}

.pricing-card {
    position: relative;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.pricing-card--popular {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.pricing-card--current {
    border-color: var(--success);
    box-shadow: 0 0 0 1px var(--success);
}

.pricing-badge {
    position: absolute;
    top: -0.65rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent);
    color: #04121c;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pricing-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pricing-card h3 {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
}

.pricing-blurb {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--text-muted);
}

.pricing-price {
    font-size: 1.3rem;
    font-weight: 700;
}

.pricing-price--yearly {
    font-size: 1.05rem;
}

.pricing-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pricing-divider-or {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pricing-divider-or::before,
.pricing-divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-soft);
}

.pricing-strike {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: line-through;
}

.pricing-save-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    background-color: var(--success-soft);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.pricing-rows {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-soft);
    padding-top: 0.8rem;
}

.pricing-card[data-plan="plus"] .pricing-row--ads span:last-child,
.pricing-card[data-plan="pro"] .pricing-row--ads span:last-child {
    color: var(--success);
    font-weight: 600;
}

.pricing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-muted);
}

.pricing-row > span:last-child {
    color: var(--text-main);
    font-weight: 600;
    text-align: end;
}

.unlimited-mark {
    color: #f59e0b;
    font-weight: 700;
}

.pricing-cta {
    margin-top: auto;
    width: 100%;
}

.pricing-footnote {
    margin: 1.2rem 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.toast-container {
    position: fixed;
    bottom: calc(1.2rem + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    width: min(360px, 92vw);
    pointer-events: none;
}

.toast {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    font-size: 0.85rem;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    /* Quick in, quick out: a confirmation that lingers reads as a warning. */
    transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1);
    cursor: default;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast--tappable {
    cursor: pointer;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toast-text {
    font-weight: 600;
}

.toast-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.toast--actions {
    text-align: start;
}

.toast-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.toast-action-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.toast-action-btn:hover {
    background-color: var(--accent-soft);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--undo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    text-align: start;
    cursor: default;
}

.toast-undo-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.toast-undo-btn:hover {
    text-decoration: underline;
}
