/* =======================================
   OneShotPlan Extended Styles
   Clean Architecture UI Components
   ======================================= */

/* ---- Variables (remapped to design system) ---- */
:root {
    --osp-primary: var(--ph-purple, #8B6FA8);
    --osp-primary-hover: var(--ph-purple-light, #A080C4);
    --osp-secondary: var(--ph-mint, #5CC6C3);
    --osp-accent: var(--ph-purple-light, #A080C4);
    --osp-success: #10b981;
    --osp-warning: #f59e0b;
    --osp-danger: #ef4444;
    --osp-danger-hover: #dc2626;

    --osp-surface: rgba(255, 255, 255, 0.03);
    --osp-surface-2: rgba(255, 255, 255, 0.06);
    --osp-surface-3: rgba(255, 255, 255, 0.09);
    --osp-border: rgba(255, 255, 255, 0.08);
    --osp-border-hover: rgba(255, 255, 255, 0.15);
    --osp-text: #ffffff;
    --osp-text-muted: rgba(255, 255, 255, 0.5);
    --osp-text-subtle: rgba(255, 255, 255, 0.35);

    --osp-radius: 12px;
    --osp-radius-lg: 16px;
    --osp-radius-xl: 24px;
    --osp-transition: 0.2s ease;
}

/* ---- Utility Classes ---- */
.hidden { display: none !important; }
.required { color: var(--osp-danger); }

/* ---- App Layout ---- */
.osp-app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.osp-app-layout.editor-open .osp-setup-section { display: none; }
.osp-app-layout.editor-open .osp-editor-section { display: flex; }

.osp-setup-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.osp-editor-section {
    display: none;
    flex: 1;
    flex-direction: column;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--osp-text);
    background: var(--osp-surface-2);
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius);
    cursor: pointer;
    transition: all var(--osp-transition);
    white-space: nowrap;
}

.btn:hover {
    background: var(--osp-surface-3);
    border-color: var(--osp-border-hover);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--osp-primary), var(--osp-accent));
    border: none;
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -4px var(--osp-primary);
}

.btn-secondary {
    background: var(--osp-surface-2);
    border: 1px solid var(--osp-border);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--osp-danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--osp-text-muted);
    cursor: pointer;
    transition: all var(--osp-transition);
}

.btn-icon:hover {
    background: var(--osp-surface-2);
    color: var(--osp-text);
}

/* ---- Form Controls ---- */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--osp-text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius);
    transition: all var(--osp-transition);
}

.form-control:hover {
    border-color: var(--osp-border-hover);
}

.form-control:focus {
    outline: none;
    border-color: var(--osp-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control option {
    background: #1a1a24;
    color: var(--osp-text);
}

select.form-control {
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--osp-text-subtle);
}

/* ---- Project Form ---- */
.osp-project-form {
    background: var(--osp-surface);
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.osp-project-form::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--osp-radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent 50%, rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.form-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--osp-text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--osp-text-muted);
}

.form-info {
    background: var(--osp-surface-2);
    border-radius: var(--osp-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.info-label { color: var(--osp-text-muted); font-size: 0.85rem; }
.info-value { font-weight: 600; color: var(--osp-secondary); }

.form-actions {
    margin-top: 1.5rem;
}

.form-actions .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Project List ---- */
.osp-project-list {
    margin-top: 2rem;
}

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

.list-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.project-count {
    font-size: 0.85rem;
    color: var(--osp-text-muted);
    background: var(--osp-surface-2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--osp-text-muted);
}

.empty-state .hint {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--osp-text-subtle);
}

.project-card {
    background: var(--osp-surface);
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: all var(--osp-transition);
}

.project-card:hover {
    background: var(--osp-surface-2);
    border-color: var(--osp-border-hover);
}

.project-card.status-urgent {
    border-left: 3px solid var(--osp-danger);
}

.project-card.status-soon {
    border-left: 3px solid var(--osp-warning);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.project-name {
    font-size: 1rem;
    font-weight: 600;
}

.shared-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--osp-primary);
    border-radius: 20px;
}

.project-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--osp-text-muted);
    margin-bottom: 0.5rem;
}

.d-day {
    font-weight: 700;
    color: var(--osp-secondary);
}

.project-details {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.detail-item {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--osp-surface-2);
    border-radius: 6px;
    color: var(--osp-text-muted);
}

.project-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--osp-surface-3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--osp-primary), var(--osp-secondary));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--osp-text-muted);
    white-space: nowrap;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ---- Roadmap Editor ---- */
.roadmap-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--osp-border);
    background: var(--osp-surface);
    flex-wrap: wrap;
    gap: 1rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--osp-surface);
    border-bottom: 1px solid var(--osp-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

.view-toggle {
    display: flex;
    background: var(--osp-surface-2);
    border-radius: 8px;
    padding: 2px;
}

.view-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--osp-text-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--osp-transition);
}

.view-btn.active {
    background: var(--osp-primary);
    color: #fff;
}

.filter-select {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    font-size: 0.8rem;
    background-size: 12px;
}

.search-box {
    position: relative;
}

.search-input {
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    font-size: 0.8rem;
    width: 200px;
}

.search-box .icon-search {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--osp-text-subtle);
}

.progress-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--osp-text-muted);
}

.mini-progress {
    width: 60px;
    height: 4px;
    background: var(--osp-surface-3);
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: var(--osp-success);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* ---- Week View ---- */
.week-view {
    margin-bottom: 1.5rem;
    background: var(--osp-surface);
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius-lg);
    overflow: hidden;
}

.week-view.current-week {
    border-color: var(--osp-primary);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.week-view.past-week { opacity: 0.7; }

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background var(--osp-transition);
    user-select: none;
}

.week-header:hover {
    background: var(--osp-surface-2);
}

.week-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.week-number {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--osp-secondary);
}

.week-dates {
    font-size: 0.8rem;
    color: var(--osp-text-muted);
}

.current-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--osp-primary);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.week-summary {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--osp-text-muted);
}

.completed-count {
    color: var(--osp-success);
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--osp-text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem;
}

.icon-chevron::before { content: '\25BC'; }
.icon-chevron.expanded::before { content: '\25B2'; }

.week-content {
    border-top: 1px solid var(--osp-border);
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.week-content.collapsed {
    display: none;
}

/* ---- Task List & Rows ---- */
.task-list {
    padding: 0.5rem;
}

.empty-tasks {
    text-align: center;
    padding: 1.5rem;
    color: var(--osp-text-subtle);
    font-size: 0.85rem;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 2px;
    background: var(--osp-surface-2);
    border-radius: var(--osp-radius);
    transition: all var(--osp-transition);
}

.task-row:hover {
    background: var(--osp-surface-3);
}

.task-row.status-completed .task-name {
    text-decoration: line-through;
    color: var(--osp-text-subtle);
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: var(--osp-text-subtle);
    font-size: 0.75rem;
    padding: 0.25rem;
}

.drag-handle:active { cursor: grabbing; }

.icon-grip::before { content: '\2630'; }

.task-row.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.1);
}

.drop-zone.drop-active {
    min-height: 40px;
}

.drop-zone.drop-hover {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--osp-radius);
}

/* Task checkbox */
.task-checkbox {
    flex-shrink: 0;
}

.task-checkbox input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--osp-border-hover);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--osp-transition);
    position: relative;
}

.task-checkbox input[type="checkbox"]:checked {
    background: var(--osp-success);
    border-color: var(--osp-success);
}

.task-checkbox input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Task content */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--osp-text);
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background var(--osp-transition);
}

.task-name[contenteditable="true"]:hover {
    background: rgba(255, 255, 255, 0.05);
}

.task-name[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.task-description {
    font-size: 0.8rem;
    color: var(--osp-text-muted);
    margin-top: 0.25rem;
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
}

.task-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.task-category {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: var(--osp-surface);
    border-radius: 20px;
    color: var(--osp-text-muted);
}

.task-assignee {
    font-size: 0.75rem;
    color: var(--osp-text-muted);
}

.task-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--osp-transition);
}

.task-row:hover .task-actions {
    opacity: 1;
}

.add-task-btn {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--osp-text-subtle);
    background: transparent;
    border: 1px dashed var(--osp-border);
    border-radius: var(--osp-radius);
    cursor: pointer;
    transition: all var(--osp-transition);
}

.add-task-btn:hover {
    color: var(--osp-primary);
    border-color: var(--osp-primary);
    background: rgba(99, 102, 241, 0.05);
}

.icon-plus::before { content: '\002B'; }
.icon-edit::before { content: '\270E'; }
.icon-trash::before { content: '\2716'; }
.icon-close::before { content: '\00D7'; font-size: 1.25rem; }
.icon-clock::before { content: '\1F551'; }
.icon-remove::before { content: '\2716'; }

/* Category colors (NCS 8대 분류) */
.category-general .task-category { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.category-ceremony .task-category { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.category-program .task-category { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.category-side_event .task-category { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.category-registration .task-category { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.category-protocol .task-category { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.category-promotion .task-category { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.category-operation .task-category { background: rgba(100, 116, 139, 0.15); color: #64748b; }

/* ---- Member Panel (Side Panel) ---- */
.member-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    z-index: 500;
    transition: right 0.3s ease;
}

.member-panel.open {
    right: 0;
}

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.member-panel.open .panel-overlay {
    opacity: 1;
    pointer-events: auto;
}

.panel-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0d0d14;
    border-left: 1px solid var(--osp-border);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--osp-border);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--osp-text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Invite section */
.invite-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--osp-border);
}

.invite-section h4, .members-section h4, .pending-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--osp-text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invite-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invite-hint {
    font-size: 0.75rem;
    color: var(--osp-text-subtle);
    margin-top: 0.5rem;
}

/* Member list */
.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--osp-surface);
    border-radius: var(--osp-radius);
    transition: background var(--osp-transition);
}

.member-item:hover {
    background: var(--osp-surface-2);
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--osp-primary), var(--osp-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.member-avatar.pending {
    background: var(--osp-surface-3);
    color: var(--osp-text-subtle);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.you-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: var(--osp-surface-3);
    border-radius: 20px;
    color: var(--osp-text-muted);
}

.member-email {
    font-size: 0.75rem;
    color: var(--osp-text-subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-status {
    font-size: 0.75rem;
    color: var(--osp-warning);
}

.role-select {
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
    font-size: 0.75rem;
    background-size: 10px;
}

.role-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 500;
}

.role-owner { background: rgba(245, 158, 11, 0.15); color: var(--osp-warning); }
.role-editor { background: rgba(99, 102, 241, 0.15); color: var(--osp-primary); }
.role-viewer { background: var(--osp-surface-3); color: var(--osp-text-muted); }

.remove-member-btn, .cancel-invite-btn {
    color: var(--osp-text-subtle);
}

.remove-member-btn:hover, .cancel-invite-btn:hover {
    color: var(--osp-danger);
}

/* Invite Modal */
.invite-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.invite-modal.hidden { display: none; }

.invite-modal .modal-content {
    background: #0d0d14;
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius-lg);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
}

.invite-link-box {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.invite-link-box input {
    flex: 1;
    font-size: 0.8rem;
}

.invite-expiry {
    font-size: 0.75rem;
    color: var(--osp-text-subtle);
    margin-bottom: 1rem;
}

/* ---- Task Modal ---- */
.task-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: none;
    align-items: center;
    justify-content: center;
}

.task-modal.open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: #0d0d14;
    border: 1px solid var(--osp-border);
    border-radius: var(--osp-radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--osp-border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--osp-border);
}

body.modal-open {
    overflow: hidden;
}

/* ---- Auth States ---- */
.unauthenticated .osp-project-list,
.unauthenticated .form-actions .btn {
    opacity: 0.5;
    pointer-events: none;
}

.unauthenticated .osp-project-form::after {
    content: '로그인 후 프로젝트를 생성할 수 있습니다.';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(4px);
    border-radius: var(--osp-radius-xl);
    font-size: 0.95rem;
    color: var(--osp-text-muted);
    z-index: 10;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .editor-header {
        padding: 1rem 1.25rem;
    }

    .editor-toolbar {
        padding: 0.5rem 1.25rem;
    }

    .editor-content {
        padding: 1rem;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .editor-actions {
        width: 100%;
    }

    .member-panel {
        width: 100%;
        right: -100%;
    }

    .search-input {
        width: 140px;
    }
}

@media (max-width: 480px) {
    .toolbar-left, .toolbar-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .editor-actions {
        flex-wrap: wrap;
    }

    .editor-actions .btn span {
        display: none;
    }

    .week-info {
        flex-wrap: wrap;
    }

    .task-meta {
        display: none;
    }
}
