* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f0f;
    color: #e4e4e4;
    min-height: 100vh;
}

.main-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    background: #0f0f0f;
    padding-top: env(safe-area-inset-top);
}

.content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: #050505;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 8px;
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.content-inner {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-section {
    margin-bottom: 8px;
}

.input-form {
    display: flex;
    flex-direction: column;
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.input-actions.visible {
    max-height: 100px;
    opacity: 1;
    margin-top: 8px;
}

/* 입력 중 어두워지는 오버레이 */
.input-focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.input-focus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 입력 폼과 버튼이 오버레이 위에 표시되도록 */
.input-section {
    position: relative;
    z-index: 2;
}

.mode-selector {
    display: flex;
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mode-btn:hover {
    background: #222;
    color: #aaa;
}

.mode-btn.active {
    background: #fff;
    color: #000;
}

.task-textarea {
    flex: 1;
    background: #181818;
    border: 1px solid #333;
    color: #e4e4e4;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: auto;
    line-height: 1.5;
    width: 100%;
    border-radius: 8px;
}

.task-textarea:focus {
    border-color: #444;
}

.task-textarea::placeholder {
    color: #666;
}

.btn-add {
    background: #fff;
    color: #000;
    border: none;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
    align-self: stretch;
}

.btn-add:hover {
    background: #e8e8e8;
}

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

.btn-add:disabled:hover {
    background: #fff;
}

.todo-card {
    position: relative;
}

.card-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.todo-card.loading .card-loading {
    display: flex;
}

.card-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.tasks-container {
    min-height: 300px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: #acacac;
    margin: 0 auto;
    width: 100%;
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    filter: invert(1);
    opacity: 0.6;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}
.empty-state span {
    font-size: 13px;
    margin-bottom: 24px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
    max-width: 500px;
}

.suggestion-chip {
    background: #1a1a1a;
    color: #e4e4e4;
    border: 1px solid #333;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
    cursor: pointer;
}

.suggestion-chip:hover {
    background: #242424;
    border-color: #444;
    color: #fff;
}

.todo-card {
    background: #161616;
    border: 1px solid #272727;
    border-radius: 8px;
    padding: 20px;
}

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

.todo-text {
    flex: 1;
    font-size: 15px;
    color: #e4e4e4;
    line-height: 1.5;
}

.todo-title-section {
    flex: 1;
}

.todo-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.todo-original-text {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-top: 6px;
}

.todo-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-primary {
    background: #fff;
    color: #000;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
}

.btn-primary:hover {
    background: #e8e8e8;
}

.btn-secondary {
    background: #1a1a1a;
    color: #aaa;
    border: 1px solid #333;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
}

.btn-secondary:hover {
    background: #222;
    border-color: #444;
}

.btn-danger {
    background: transparent;
    color: #ff4444;
    border: 1px solid #ff4444;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.dropdown {
    position: relative;
}

.btn-menu {
    background: transparent;
    color: #888;
    border: none;
    padding: 8px 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1;
}

.btn-menu:hover {
    background: #1a1a1a;
    color: #ccc;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 140px;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu button {
    width: 100%;
    background: transparent;
    color: #ccc;
    border: none;
    padding: 10px 14px;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
}

.dropdown-menu button:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-menu button:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-menu button:hover {
    background: #222;
}

.dropdown-menu button.danger {
    color: #ff4444;
}

.dropdown-menu button.danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

.checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtasks {
    margin-left: 32px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subtasks .checklist-item {
    padding: 8px 10px;
    background: #050505;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #fff;
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: #e4e4e4;
    line-height: 1.4;
}

.checklist-item.checked label {
    text-decoration: line-through;
    color: #666;
}

.todo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #1a1a1a;
}

.todo-date {
    font-size: 11px;
    color: #555;
}

.completed-badge {
    background: #1a1a1a;
    color: #aaa;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #2a2a2a;
}

.todo-footer .todo-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
    사이드바
   ======================================== */
.sidebar {
    width: 280px;
    background: #181818;
    border-right: 1px solid #272727;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding-top: env(safe-area-inset-top);
}

.sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

.sidebar.modal-open::before {
    background: rgba(0, 0, 0, 0.5);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #181818;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 8px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.sidebar-brand {
    padding: 18px 20px;
    border-bottom: 1px solid #272727;
}

.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.sidebar-user {
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid #272727;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    position: relative;
}

.user-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: invert(1);
    opacity: 0.6;
}

.username {
    font-size: 14px;
    color: #e4e4e4;
    font-weight: 500;
    flex: 1;
}

.user-dropdown {
    position: relative;
}

.user-menu-btn {
    background: transparent;
    color: #888;
    border: none;
    padding: 8px 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1;
}

.user-menu-btn:hover {
    background: #1a1a1a;
    color: #ccc;
}

.user-dropdown-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 180px;
    padding: 4px;
    margin-bottom: 4px;
    z-index: 1100;
    display: none;
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu button {
    width: 100%;
    background: transparent;
    color: #ccc;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-dropdown-menu button:hover {
    background: #222;
}

.language-menu-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.language-menu-item span {
    color: #ccc;
    font-size: 14px;
}

.language-select {
    background: none;
    border: none;
    color: #e4e4e4;
    font-size: 13px;
    cursor: pointer;
}

.language-select:focus {
    outline: none;
    border-color: #444;
}

.language-submenu {
    position: relative;
}

.language-submenu-items {
    position: absolute;
    left: 0;
    top: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 120px;
    z-index: 1000;
    display: none;
    margin-left: -130px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-submenu-items.show {
    display: block;
}

.language-submenu-items button {
    width: 100%;
    background: transparent;
    color: #ccc;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
    justify-content: flex-start;
}

.language-submenu-items button:hover {
    background: #222;
}

.language-submenu-items button.active {
    background: #fff;
    color: #000;
}

.language-submenu-items button.active:hover {
    background: #e8e8e8;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: auto;
    flex: 1;
}

.section-header {
    padding: 10px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    padding-bottom: 2px;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.btn-add-category,
.btn-manage-icon {
    background: transparent;
    border: 0;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: -10px;
}

.btn-manage-icon img,
.btn-add-category img {
    width: 16px;
    height: 16px;
    filter: invert(1);
    opacity: 0.6;
}

.btn-add-category:hover,
.btn-manage-icon:hover {
    border-color: #494949;
}

.btn-add-category:hover img,
.btn-manage-icon:hover img {
    opacity: 1;
}

.category-filters {
    -webkit-overflow-scrolling: auto;
    max-height: calc(100vh - 400px);
}

.move-to-top-zone {
    margin: 8px;
    padding: 12px;
    border: 2px dashed #444;
    border-radius: 8px;
    text-align: center;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
}

.move-to-top-zone.drag-over {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
    color: #4ecdc4;
}

.category-filters::-webkit-scrollbar {
    width: 4px;
}

.category-filters::-webkit-scrollbar-track {
    background: transparent;
}

.category-filters::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 8px;
}

.category-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    position: relative;
}

.category-filter-item:hover {
    background: #161616;
}

.category-filter-item:hover .category-menu-btn {
    opacity: 1;
}

.category-filter-item.active {
    background: #242424;
}

.category-filter-item.drag-over {
    background: #2a2a2a;
    border-left-color: #4ecdc4;
}

.category-filter-item.dragging {
    opacity: 0.5;
}

#category-filters-list > div:first-child {
    padding-left: 12px !important;
}

.category-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.filter-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-name {
    flex: 1;
    font-size: 14px;
    color: #e4e4e4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-count {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.category-filter-item.active .filter-name {
    font-weight: 500;
}

.category-filter-item.active .filter-count {
    color: #888;
}

.category-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.category-menu-btn:hover {
    background: #2a2a2a;
}

.category-menu-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.category-dropdown {
    position: absolute;
    right: 8px;
    top: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 160px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-top: 4px;
}

.category-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #e4e4e4;
}

.dropdown-item:hover {
    background: #242424;
}

.dropdown-item.delete {
    color: #ff4444;
}

.dropdown-item.delete:hover {
    background: rgba(255, 68, 68, 0.1);
}

.dropdown-item img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.todo-category {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #000;
    flex-shrink: 0;
}

/* ========================================
    모달
======================================== */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    align-items: center;
    justify-content: flex-start;
    pointer-events: none;
    display: flex;
}

.modal.show {
    pointer-events: auto;
}

.modal-center {
    justify-content: center;
    align-items: center;
}

.modal-center .modal-content {
    border-radius: 8px;
    width: 90%;
    max-width: 350px;
    height: auto;
    max-height: 80vh;
    transform: scale(0.9) translateX(0);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.modal-center.show .modal-content {
    transform: scale(1) translateX(0);
    opacity: 1;
}

.modal-content {
    background: #181818;
    border-right: 1px solid #272727;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    will-change: transform;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.modal.show .modal-content {
    transform: translateX(0);
    pointer-events: auto;
}

.modal-small .modal-content {
    width: 100%;
}

.modal-header {
    padding: calc(18px + env(safe-area-inset-top)) 20px 18px;
    border-bottom: 1px solid #272727;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close img {
    width: 20px;
    height: 20px;
    filter: invert(1);
    opacity: 0.6;
}

.modal-close:hover {
    background: #1f1f1f;
}

.modal-close:hover img {
    opacity: 1;
}

.modal-body {
    padding: 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: auto;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

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

.color-option {
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.active {
    border-color: #fff;
}

.category-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.category-input input[type="text"] {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid #2f2f2f;
    color: #e4e4e4;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 8px;
    outline: none;
}

.category-input input[type="text"]:focus {
    border-color: #494949;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #1e1e1e;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
}

.category-color {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 14px;
    color: #e4e4e4;
    transition: color 0.2s ease;
}

.category-name:hover {
    color: #fff;
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.btn-icon-add {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-icon-add:hover {
    background: #2a2a2a;
    color: #4ecdc4;
}

.btn-icon-delete {
    background: transparent;
    border: none;
    color: #ff4444;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.btn-icon-delete:hover {
    background: rgba(255, 68, 68, 0.1);
}

.empty-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 40px 20px;
}

.category-suggestion {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.category-select-list {
    display: grid;
    gap: 4px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: auto;
}

.category-select-list::-webkit-scrollbar {
    width: 6px;
}

.category-select-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-select-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 8px;
}

.category-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #0f0f0f;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
    cursor: pointer;
}

.category-select-item:hover {
    background: #1a1a1a;
    border-color: #494949;
}

.category-select-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.category-select-item.disabled:hover {
    background: #0f0f0f;
    border-color: #2f2f2f;
}

.category-select-name {
    font-size: 14px;
    color: #e4e4e4;
    flex: 1;
}

/* 모바일 헤더 */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-top));
    background: #181818;
    border-bottom: 1px solid #272727;
    z-index: 998;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    gap: 12px;
}

.mobile-header-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.mobile-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* 모바일 메뉴 토글 버튼 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: calc(env(safe-area-inset-top) + 8px);
    left: calc(16px + env(safe-area-inset-left));
    z-index: 1001;
    background: #181818;
    border: 1px solid #333;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle img {
    width: 24px;
    height: 24px;
    filter: invert(1);
    opacity: 0.8;
}

.mobile-menu-toggle:hover {
    background: #1f1f1f;
    border-color: #444;
}

.mobile-menu-toggle:hover img {
    opacity: 1;
}

/* 모바일 오버레이 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.mobile-overlay.show {
    display: block;
}

/* ========================================
   반응형
   ======================================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.shifted {
        transform: translateX(calc(80vw - 8px));
    }

    .dropdown-menu {
        right: 0;
    }

    .main-container {
        flex-direction: row;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 320px;
        height: 100dvh;
        border-right: 1px solid #272727;
        border-bottom: none;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidebar.show {
        transform: translateX(calc(env(safe-area-inset-left)));
    }

    .sidebar-brand {
        padding-top: calc(18px + env(safe-area-inset-top));
    }

    .sidebar-section {
        flex: 1;
    }

    .category-filters {
        display: flex;
        flex-direction: column;
    }

    .category-filter-item {
        flex-shrink: 0;
        border-left: 3px solid transparent;
        border-bottom: none;
        padding: 10px 20px;
    }

    .mobile-header {
        display: block;
    }

    .content-inner {
        padding: calc(env(safe-area-inset-top) + 60px + 18px) calc(16px + env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom));
        max-width: 100%;
    }
}

@media (min-width: 400px) and (max-width: 768px) {
    .mobile-menu-toggle.shifted {
        transform: translateX(304px);
    }
}

/* ========================================
   체크리스트 항목 편집/삭제/추가 스타일
   ======================================== */

/* 체크리스트 항목 레이아웃 */
.checklist-item {
    position: relative;
    min-height: 32px;
}

.checklist-item .item-view {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 4px 0;
}

.checklist-item .item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    min-height: 24px;
}

.checklist-item input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
    min-width: 0;
    word-break: break-word;
    line-height: 1.5;
    padding: 2px 0;
}

.checklist-item .item-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-left: 8px;
}

/* 날짜 및 시간 표시 */
.item-due-date {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #222;
    color: #aaa;
}

.item-due-date.overdue {
    background: #3d1515;
    color: #ff6b6b;
}

.item-due-date.today {
    background: #1a2a1a;
    color: #96ceb4;
}

.item-time {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #222;
    color: #aaa;
}

/* 항목 액션 버튼 */
.checklist-item .item-actions {
    display: none;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.checklist-item:hover .item-actions {
    display: flex;
}

.btn-item-action {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    width: 24px;
    height: 24px;
}

.btn-item-action:hover {
    background: #222;
    opacity: 1;
}

.btn-item-action img {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

/* 항목 추가 버튼 */
.btn-add-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #333;
    color: #999;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 8px;
    width: 100%;
}

.btn-add-item:hover {
    background: #181818;
    border-color: #444;
    color: #e4e4e4;
}

.btn-add-item img {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.6;
}

.btn-add-item:hover img {
    opacity: 1;
}

/* 항목 편집 폼 */
.item-edit-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-edit-form label {
    font-size: 13px;
    color: #999;
    margin-bottom: -8px;
}

.item-edit-form input[type="text"],
.item-edit-form input[type="date"],
.item-edit-form input[type="number"] {
    background: #181818;
    border: 1px solid #333;
    color: #e4e4e4;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
    outline: none;
}

.item-edit-form input[type="text"]:focus,
.item-edit-form input[type="date"]:focus,
.item-edit-form input[type="number"]:focus {
    border-color: #444;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-group input[type="number"] {
    width: 70px;
}

.time-input-group span {
    color: #999;
    font-size: 14px;
}

.item-edit-form .btn-primary {
    margin-top: 8px;
}

/* 인라인 편집 폼 - 한 줄로 표시 */
.item-edit-inline {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 4px 0;
}

.item-edit-inline input[type="checkbox"] {
    flex-shrink: 0;
    cursor: not-allowed;
    margin: 0;
}

.item-edit-inline .inline-text-input {
    flex: 1;
    background: #181818;
    border: 1px solid #444;
    color: #e4e4e4;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    min-width: 150px;
    height: 24px;
    line-height: 1.5;
}

.item-edit-inline .inline-text-input:focus {
    border-color: #666;
    background: #1f1f1f;
}

.item-edit-inline .inline-date-input {
    background: #181818;
    border: 1px solid #444;
    color: #e4e4e4;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 140px;
    flex-shrink: 0;
}

.item-edit-inline .inline-date-input:focus {
    border-color: #666;
    background: #1f1f1f;
}

.item-edit-inline .inline-time-input {
    background: #181818;
    border: 1px solid #444;
    color: #e4e4e4;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 80px;
    flex-shrink: 0;
}

.item-edit-inline .inline-time-input:focus {
    border-color: #666;
    background: #1f1f1f;
}

.btn-inline-save,
.btn-inline-cancel {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    height: 24px;
    line-height: 1;
}

.btn-inline-save {
    background: #fff;
    color: #000;
}

.btn-inline-save:hover {
    background: #e4e4e4;
}

.btn-inline-cancel {
    background: transparent;
    color: #999;
    border: 1px solid #444;
}

.btn-inline-cancel:hover {
    background: #222;
    color: #e4e4e4;
    border-color: #555;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .checklist-item .item-view {
        flex-wrap: wrap;
    }

    .checklist-item .item-main {
        width: 100%;
    }

    .checklist-item .item-meta {
        margin-left: 28px;
        width: calc(100% - 28px);
    }

    .checklist-item .item-actions {
        display: flex;
        margin-left: 28px;
        width: calc(100% - 28px);
    }

    .item-edit-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .item-edit-inline input[type="checkbox"] {
        align-self: flex-start;
    }

    .item-edit-inline .inline-text-input {
        width: 100%;
        min-width: 100%;
    }

    .item-edit-inline .inline-date-input {
        width: 100%;
    }

    .item-edit-inline .inline-time-input {
        width: 100%;
    }

    .item-edit-inline .btn-inline-save,
    .item-edit-inline .btn-inline-cancel {
        width: 100%;
    }
}

/* 라이선스 관련 스타일 */
.license-info {
    padding: 16px;
    background: #181818;
    border-radius: 8px;
    margin-top: 16px;
    border: 1px solid #2a2a2a;
}

.license-status {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usage-info {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #999;
}

.usage-info span {
    padding: 4px 8px;
    background: #222;
    border-radius: 4px;
    border: 1px solid #333;
}

.upgrade-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
}

.upgrade-button:hover {
    opacity: 0.9;
}

/* ============================================
   업그레이드 모달 (사이드바 모달과 완전 분리)
   ============================================ */

.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.upgrade-modal-box {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 24px;
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    max-width: 350px;
    width: 90%;
    position: relative;
}

.upgrade-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.upgrade-close-btn:hover {
    background: #222;
    color: #e4e4e4;
}

.upgrade-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.upgrade-plans {
    display: flex;
    flex-direction: column;
}

.upgrade-plan-item {
    margin-bottom: 10px;
}

.upgrade-plan-item h3 {
    font-size: 16px;
    color: #e4e4e4;
    width: 80px;
}

.upgrade-plan-item:first-child h3 {
    margin-top: 10px;
}

.upgrade-plan-pro h3 {
    color: rgb(100, 200, 255);
    margin-top: 10px;
}

.upgrade-plan-item ul {
    list-style: none;
    padding: 0;
    margin-top: 5px;
    margin-bottom: 10px;
}

.upgrade-plan-item ul li {
    padding: 8px 0;
    font-size: 14px;
    color: #999;
}

.upgrade-plan-pro ul li {
    color: rgb(50, 150, 205);
}

.upgrade-subscribe-btn {
    background: dodgerblue;
    color: #fff;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    margin-top: 20px;
}

.upgrade-subscribe-btn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .upgrade-modal-box {
        padding: 20px;
        max-width: 90%;
    }
}

/* ========================================
   로딩 화면
   ======================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.loading-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

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

/* Slack 연동 섹션 */
.slack-section {
    padding: 15px 0;
    border-top: 1px solid #333;
}

.workspace-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #222;
}

.workspace-item:last-child {
    border-bottom: none;
}

.workspace-info strong {
    color: #fff;
    font-size: 0.9em;
}

.workspace-info small {
    color: #666;
    font-size: 0.8em;
    display: block;
    margin-top: 2px;
}

.workspace-item .delete-btn {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.workspace-item .delete-btn:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* ========================================
   Slack 연동 모달 (독립적 팝업)
   ======================================== */

.slack-integration-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.slack-integration-modal.show {
    display: flex;
}

.slack-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.slack-modal-box {
    position: relative;
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 5001;
}

.slack-modal-header {
    padding: 20px;
    border-bottom: 1px solid #272727;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slack-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.slack-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.slack-modal-close img {
    width: 20px;
    height: 20px;
    filter: invert(1);
    opacity: 0.6;
}

.slack-modal-close:hover {
    background: #1f1f1f;
}

.slack-modal-close:hover img {
    opacity: 1;
}

.slack-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: auto;
}

.slack-modal-content::-webkit-scrollbar {
    width: 6px;
}

.slack-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.slack-modal-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 8px;
}

.slack-modal-footer {
    padding: 20px;
    border-top: 1px solid #272727;
}

.slack-modal-footer .btn-primary {
    width: 100%;
}

.slack-workspaces-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slack-workspace-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #0f0f0f;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
}

.slack-workspace-item:hover {
    background: #1a1a1a;
    border-color: #494949;
}

.workspace-info {
    flex: 1;
}

.workspace-name {
    font-size: 14px;
    font-weight: 500;
    color: #e4e4e4;
}

.workspace-date {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.btn-unlink {
    background: transparent;
    color: #ff4444;
    border: 1px solid #ff4444;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
}

.btn-unlink:hover {
    background: rgba(255, 68, 68, 0.1);
}

.slack-empty-state {
    text-align: center;
    padding: 32px 20px;
    color: #666;
    font-size: 14px;
}
