.time-plans-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

.time-plan-topline {
    display: flex;
    align-items: center;
}

.time-plan-back-btn,
.time-plan-ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    font-weight: 700;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.time-plan-back-btn:hover,
.time-plan-ghost-btn:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.time-plan-hero,
.time-plan-toolbar,
.time-plan-selection-banner,
.time-plan-panel,
.time-plan-empty-card,
.time-block-card,
.time-plan-day-header,
.time-plan-override-banner {
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88));
    border-radius: 22px;
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.28);
}

.time-plan-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.6rem;
    position: relative;
    overflow: hidden;
}

.time-plan-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(249, 115, 22, 0.08), transparent 26%);
    pointer-events: none;
}

.time-plan-hero-copy,
.time-plan-hero-actions {
    position: relative;
    z-index: 1;
}

.time-plan-hero-copy {
    max-width: 780px;
}

.time-plan-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.time-plan-hero h2 {
    margin: 0 0 0.9rem;
    font-size: clamp(1.9rem, 2vw + 1rem, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.time-plan-recommendation {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid rgba(59, 130, 246, 0.14);
    color: #e2e8f0;
    font-weight: 600;
}

.time-plan-subtle {
    margin: 0;
    max-width: 64ch;
    color: var(--text-muted);
    line-height: 1.65;
}

.time-plan-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    min-width: 230px;
}

.time-plan-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.time-plan-toolbar-group,
.time-plan-toolbar-right,
.time-plan-mode-switch,
.time-plan-week-tabs,
.time-plan-day-actions,
.time-plan-card-actions,
.time-plan-item-badges,
.time-plan-modal-footer,
.time-plan-inline-picker,
.time-plan-choice-list,
.time-plan-checkbox-grid {
    display: flex;
    gap: 0.7rem;
}

.time-plan-mode-switch {
    padding: 0.35rem;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.44);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.time-plan-mode-switch .btn {
    min-height: 2.7rem;
    min-width: 6.5rem;
    justify-content: center;
}

.time-plan-week-tabs {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.time-plan-week-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 5.25rem;
    min-height: 3.4rem;
    padding: 0.6rem 0.85rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.66);
    color: #cbd5e1;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.time-plan-week-tab span {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
}

.time-plan-week-tab small {
    margin-top: 0.2rem;
    font-size: 0.68rem;
    color: #94a3b8;
}

.time-plan-week-tab:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(59, 130, 246, 0.26);
    transform: translateY(-1px);
}

.time-plan-week-tab.active {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(37, 99, 235, 0.18));
    color: #eff6ff;
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.time-plan-week-tab.active small {
    color: #dbeafe;
}

.time-plan-date-picker input,
.time-plan-inline-picker select,
.time-plan-form input,
.time-plan-form textarea,
.time-plan-form select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.56);
    color: var(--text);
    padding: 0.85rem 1rem;
}

.time-plan-date-picker input {
    min-width: 13rem;
}

.time-plan-override-banner,
.time-plan-selection-banner,
.time-plan-day-header,
.time-plan-empty-card,
.time-plan-panel,
.time-block-card {
    padding: 1.1rem 1.2rem;
}

.time-plan-override-banner {
    color: #cbd5e1;
    line-height: 1.5;
}

.time-plan-override-banner.is-override {
    border-color: rgba(96, 165, 250, 0.42);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.88));
}

.time-plan-selection-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-color: rgba(96, 165, 250, 0.3);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.94));
}

.time-plan-selection-copy strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #f8fafc;
}

.time-plan-selection-copy p {
    margin: 0;
    color: var(--text-muted);
}

.time-plan-selection-kicker,
.time-plan-card-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #93c5fd;
}

.time-plan-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.time-plan-day-header h3 {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    color: #f8fafc;
}

.time-plan-day-header .text-sm,
.time-plan-panel .text-sm {
    margin: 0;
}

.time-plan-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.72fr) minmax(320px, 0.95fr);
    gap: 1.1rem;
    align-items: start;
}

.time-plan-main,
.time-plan-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-block-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.time-block-card.is-dragging,
.time-plan-item-card.is-dragging,
.time-plan-todo-card.is-dragging {
    opacity: 0.55;
}

.time-block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.time-block-heading {
    min-width: 0;
}

.time-block-time {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 0.7rem;
}

.time-block-header h4 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.2;
    color: #f8fafc;
}

.time-block-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.48);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.time-block-meta p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #dbe3ee;
    line-height: 1.55;
}

.time-block-meta strong {
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.time-block-item-list,
.time-plan-unplanned-list,
.time-plan-todo-pool {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.time-plan-item-card,
.time-plan-todo-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.44);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.time-plan-item-card:hover,
.time-plan-todo-card:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.34);
    background: rgba(15, 23, 42, 0.76);
}

.time-plan-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    width: 100%;
}

.time-plan-item-copy,
.time-plan-todo-copy {
    flex: 1;
    min-width: 0;
}

.time-plan-item-copy {
    cursor: default;
}

.time-plan-item-copy[onclick] {
    cursor: pointer;
}

.time-plan-todo-copy {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.time-plan-item-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.time-plan-item-copy strong,
.time-plan-todo-title {
    display: block;
    color: #f8fafc;
    line-height: 1.45;
    word-break: break-word;
}

.time-plan-item-copy p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

.time-plan-item-badges {
    flex-wrap: wrap;
    margin-top: 0.7rem;
}

.time-plan-item-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.1rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(30, 41, 59, 0.86);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 700;
}

.time-plan-item-badge.is-todo {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
}

.time-plan-item-badge.is-export {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.24);
    color: #a7f3d0;
}

.time-plan-item-link-row {
    margin-top: 0.75rem;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background: transparent;
    padding: 0;
    color: #93c5fd;
    font-weight: 700;
}

.btn-link:hover {
    color: #dbeafe;
}

.time-plan-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.time-plan-panel-header h4 {
    margin: 0 0 0.3rem;
    font-size: 1.06rem;
    color: #f8fafc;
}

.time-plan-empty-card,
.time-plan-empty-inline {
    color: var(--text-muted);
}

.time-plan-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}

.time-plan-empty-card strong {
    margin-bottom: 0.45rem;
    color: #f8fafc;
}

.time-plan-empty-card p,
.time-plan-empty-inline {
    margin: 0;
    line-height: 1.55;
}

.time-plan-dropzone {
    border: 1px dashed rgba(96, 165, 250, 0.22);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.time-plan-dropzone.is-hover {
    border-color: rgba(96, 165, 250, 0.78);
    background: rgba(30, 41, 59, 0.86);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
}

.time-plan-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    min-width: 1rem;
    color: #64748b;
    cursor: grab;
}

.time-plan-drag-handle svg {
    width: 0.95rem;
    height: 0.95rem;
}

.time-plans-shell .btn,
.time-plan-icon-btn,
.time-plan-ghost-btn,
.time-plan-back-btn {
    font-size: 0.95rem;
}

.time-plan-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.55rem;
    height: 2.55rem;
    min-width: 2.55rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.78);
    color: #cbd5e1;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.time-plan-icon-btn:hover {
    transform: translateY(-1px);
    background: rgba(51, 65, 85, 0.92);
    border-color: rgba(96, 165, 250, 0.34);
    color: #f8fafc;
}

.time-plan-icon-btn[disabled],
.time-plan-back-btn[disabled],
.time-plan-ghost-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.time-plan-icon-btn-accent {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
    border-color: rgba(96, 165, 250, 0.42);
}

.time-plan-icon-btn svg,
.time-plan-back-btn svg,
.time-plan-ghost-btn svg,
.time-plans-shell .btn svg {
    width: 1.05rem;
    height: 1.05rem;
}

.time-plan-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(10px);
}

.time-plan-modal-box {
    width: min(880px, calc(100vw - 2rem));
    max-height: min(88vh, 980px);
    overflow: auto;
    padding: 1.4rem;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    box-shadow: 0 32px 60px rgba(2, 6, 23, 0.45);
}

.time-plan-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.time-plan-modal-header h3 {
    margin: 0;
    color: #f8fafc;
}

.time-plan-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-plan-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-plan-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.time-plan-form label {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    color: #dbeafe;
    font-weight: 600;
}

.time-plan-form textarea {
    resize: vertical;
    min-height: 7.5rem;
}

.time-plan-choice-list {
    flex-direction: column;
}

.time-plan-inline-picker {
    align-items: center;
    flex-wrap: wrap;
}

.time-plan-inline-picker select {
    flex: 1;
    min-width: 220px;
}

.time-plan-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.time-plan-checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.46);
}

.time-plan-modal-hint {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.time-plan-modal-footer {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

@media (max-width: 1180px) {
    .time-plan-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .time-plan-hero,
    .time-plan-selection-banner,
    .time-plan-day-header,
    .time-plan-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .time-plan-hero-actions,
    .time-plan-day-actions,
    .time-plan-toolbar-right {
        justify-content: flex-start;
    }

    .time-plan-week-tabs {
        justify-content: flex-start;
    }

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

@media (max-width: 640px) {
    .time-plans-shell {
        gap: 0.85rem;
    }

    .time-plan-hero,
    .time-plan-toolbar,
    .time-plan-selection-banner,
    .time-plan-day-header,
    .time-plan-panel,
    .time-plan-empty-card,
    .time-block-card,
    .time-plan-override-banner {
        padding: 1rem;
        border-radius: 18px;
    }

    .time-plan-week-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.1rem;
    }

    .time-plan-week-tab {
        min-width: 4.5rem;
    }

    .time-plan-item-card,
    .time-plan-todo-card,
    .time-plan-item-top,
    .time-block-header,
    .time-plan-panel-header {
        flex-direction: column;
    }

    .time-plan-card-actions,
    .time-plan-day-actions,
    .time-plan-modal-footer {
        flex-wrap: wrap;
    }

    .time-plan-date-picker input {
        min-width: 0;
    }
}

@media print {
    .time-plans-shell {
        max-width: none;
        gap: 0.5rem;
        padding: 0;
    }

    .time-plan-topline,
    .time-plan-toolbar,
    .time-plan-hero-actions,
    .time-plan-day-actions,
    .time-plan-selection-banner,
    .time-plan-sidebar,
    .time-plan-icon-btn,
    .time-plan-back-btn,
    .time-plan-ghost-btn,
    .btn {
        display: none !important;
    }

    .time-plan-hero,
    .time-plan-day-header,
    .time-plan-override-banner,
    .time-block-card {
        background: #fff !important;
        border: 1px solid #d4d4d8 !important;
        box-shadow: none !important;
        color: #111827 !important;
    }

    .time-plan-hero h2,
    .time-plan-day-header h3,
    .time-block-header h4,
    .time-block-time,
    .time-block-meta strong,
    .time-plan-item-copy strong,
    .time-plan-item-copy p,
    .time-plan-subtle,
    .time-plan-recommendation,
    .time-plan-override-banner,
    .time-plan-item-badge {
        color: #111827 !important;
        background: transparent !important;
    }

    .time-plan-main {
        gap: 0.5rem;
    }

    .time-block-card {
        break-inside: avoid;
    }
}
