/* console.272.kr — 화이트 중심 + 파스텔 핑크 포인트, 다크모드 없음 */

:root {
    --c-bg: #ffffff;
    --c-surface: #ffffff;
    --c-surface-muted: #faf7f8;
    --c-border: #ececec;
    --c-border-strong: #e0d9db;
    --c-text: #262223;
    --c-text-muted: #7a7274;
    --c-pink: #F7AFC4;
    --c-pink-strong: #df7896;
    --c-pink-soft: #fff0f4;
    --c-danger: #e0405c;
    --c-danger-soft: #fdecef;
    --c-focus: rgba(247, 175, 196, 0.34);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 2px 10px rgba(38, 34, 35, 0.06);
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn-primary {
    background: var(--c-pink);
    color: #fff;
}

.btn-primary:hover {
    background: var(--c-pink-strong);
}

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

.btn-ghost {
    background: transparent;
    border-color: var(--c-border-strong);
    color: var(--c-text);
}

.btn-ghost:hover {
    background: var(--c-surface-muted);
}

.btn-danger {
    background: #fff;
    border-color: var(--c-danger);
    color: var(--c-danger);
}

.btn-danger:hover {
    background: var(--c-danger-soft);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-muted);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="url"] {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--c-text);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus {
    border-color: var(--c-pink);
    box-shadow: 0 0 0 3px var(--c-focus);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #fff 0%, var(--c-surface-muted) 100%);
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 36px 32px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 18px;
}

.auth-brand .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c-pink);
}

.auth-subtitle {
    color: var(--c-text-muted);
    font-size: 13px;
    margin-bottom: 28px;
}

.auth-error {
    display: none;
    background: var(--c-danger-soft);
    color: var(--c-danger);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-error.visible {
    display: block;
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

.auth-meta {
    margin-top: 20px;
    font-size: 12px;
    color: var(--c-text-muted);
    text-align: center;
}

/* ==========================================================================
   File manager shell
   ========================================================================== */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px;
    flex: 0 0 auto;
    padding: 0 18px;
    border-bottom: 1px solid var(--c-border);
    background: #fff;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

.topbar-brand .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-pink);
}

.topbar-search {
    flex: 1 1 auto;
    max-width: 420px;
}

.topbar-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--c-surface-muted);
}

.topbar-search input:focus {
    border-color: var(--c-pink);
    background: #fff;
    box-shadow: 0 0 0 3px var(--c-focus);
}

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

.topbar-actions .btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-strong);
    background: #fff;
    cursor: pointer;
    color: var(--c-text-muted);
}

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

.icon-btn.active {
    background: var(--c-pink-soft);
    border-color: var(--c-pink);
    color: var(--c-pink-strong);
}

.app-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 220px 1fr 300px;
    min-height: 0;
}

@media (max-width: 1000px) {
    .app-body {
        grid-template-columns: 1fr;
    }

    .tree-panel,
    .detail-panel {
        display: none;
    }

    /* The mobile-only-bar below the topbar already exposes folder access,
       so the icon duplicate up here just wastes space. */
    #mobile-tree-toggle {
        display: none;
    }

    .topbar-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 55vw;
        -webkit-overflow-scrolling: touch;
    }

    .topbar-actions .btn,
    .topbar-actions .icon-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .topbar-search {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        row-gap: 10px;
    }

    .topbar-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .topbar-actions {
        max-width: 100%;
    }
}

.tree-panel {
    border-right: 1px solid var(--c-border);
    overflow-y: auto;
    padding: 14px 10px;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node:hover {
    background: var(--c-surface-muted);
}

.tree-node.active {
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
    font-weight: 600;
}

.tree-children {
    margin-left: 14px;
}

.tree-toggle {
    width: 14px;
    flex: 0 0 auto;
    text-align: center;
    color: var(--c-text-muted);
}

.main-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--c-border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--c-text-muted);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.sort-controls select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: #fff;
    color: var(--c-text);
    outline: none;
}

.sort-controls select:focus {
    border-color: var(--c-pink);
}

.sort-controls .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.breadcrumb .crumb {
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
}

.breadcrumb .crumb:hover {
    background: var(--c-surface-muted);
    color: var(--c-text);
}

.breadcrumb .crumb.current {
    color: var(--c-text);
    font-weight: 600;
    cursor: default;
}

.selection-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--c-pink-soft);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-pink-strong);
}

.selection-bar.visible {
    display: flex;
}

.selection-bar .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

.file-area {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 18px 80px;
    position: relative;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.file-card {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    user-select: none;
}

.file-card {
    position: relative;
}

.file-card.is-thumbnail {
    background: #fffafd;
    border-color: #f3d8e3;
}

.image-role-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #f3c8d8;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #c5547d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -.01em;
    box-shadow: 0 3px 12px rgba(95,45,67,.08);
}

.file-card:hover {
    box-shadow: var(--shadow-card);
}

.file-card.selected {
    border-color: var(--c-pink);
    box-shadow: 0 0 0 2px var(--c-focus);
}

.file-card .thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--c-surface-muted);
    display: block;
}

.file-card .caption {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list {
    display: none;
    flex-direction: column;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.file-list.active {
    display: flex;
}

.file-list-row.is-thumbnail {
    background: #fffafd;
}

.file-list-row .meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.list-role-badge,
.detail-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff0f5;
    color: #bd4d75;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.folder-html-btn {
    min-height: 34px;
    white-space: nowrap;
}

.file-grid.hidden {
    display: none;
}

.file-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
    cursor: pointer;
}

.file-list-row:last-child {
    border-bottom: none;
}

.file-list-row:hover {
    background: var(--c-surface-muted);
}

.file-list-row.selected {
    background: var(--c-pink-soft);
}

.file-list-row .name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-row .meta {
    color: var(--c-text-muted);
    font-size: 12px;
    flex: 0 0 auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
    font-size: 13px;
    gap: 8px;
}

.dropzone-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 231, 238, 0.9);
    border: 3px dashed var(--c-pink);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--c-pink-strong);
    z-index: 20;
    pointer-events: none;
}

.dropzone-overlay.visible {
    display: flex;
}

.upload-progress {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 300px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 14px 16px;
    display: none;
    z-index: 30;
}

.upload-progress.visible {
    display: block;
}

.upload-progress-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.upload-progress-item {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 8px;
}

.upload-progress-bar-track {
    height: 5px;
    border-radius: 3px;
    background: var(--c-surface-muted);
    overflow: hidden;
    margin-top: 4px;
}

.upload-progress-bar-fill {
    height: 100%;
    background: var(--c-pink);
    width: 0%;
    transition: width .2s ease;
}

.detail-panel {
    border-left: 1px solid var(--c-border);
    padding: 18px;
    overflow-y: auto;
}

.detail-panel .thumb-large {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: var(--c-surface-muted);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 12px;
}

.detail-row .k {
    color: var(--c-text-muted);
    flex: 0 0 auto;
}

.detail-row .v {
    text-align: right;
    overflow-wrap: anywhere;
}

.detail-empty {
    color: var(--c-text-muted);
    font-size: 13px;
    text-align: center;
    padding: 40px 10px;
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
}

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(38, 34, 35, 0.35);
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}

.modal-backdrop.visible {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal h3 {
    margin: 0 0 16px;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.picker-tree {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-bottom: 16px;
}

/* Mobile drawer / bottom sheet */
.mobile-only-bar {
    display: none;
}

@media (max-width: 1000px) {
    .mobile-only-bar {
        display: flex;
        gap: 8px;
        padding: 10px 18px;
        border-bottom: 1px solid var(--c-border);
    }
}

.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(38, 34, 35, 0.35);
    z-index: 60;
}

.drawer-backdrop.visible {
    display: block;
}

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 78vw;
    max-width: 300px;
    background: #fff;
    z-index: 61;
    overflow-y: auto;
    padding: 14px 10px;
    transform: translateX(-100%);
    transition: transform .2s ease;
}

.drawer.visible {
    transform: translateX(0);
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    z-index: 61;
    max-height: 80vh;
    overflow-y: auto;
    padding: 18px;
    transform: translateY(100%);
    transition: transform .2s ease;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
}

.bottom-sheet.visible {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .file-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Toast notifications (operation results) */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 80;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: var(--c-text);
    color: #fff;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: var(--shadow-card);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

.toast.error {
    background: var(--c-danger);
}

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

.tree-node.selected-target {
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
    font-weight: 600;
}

.detail-content-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-all;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}

.detail-actions .btn {
    flex: 1 1 auto;
    height: 38px;
    font-size: 12px;
    padding: 0 8px;
}


/* ========================================================================== 
   2026-09 image-console polish
   ========================================================================== */

.topbar {
    height: 70px;
    padding: 0 20px;
    gap: 20px;
    box-shadow: 0 1px 0 rgba(38, 34, 35, 0.02);
}

.topbar-brand {
    min-width: 205px;
    gap: 10px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
    border: 1px solid rgba(223, 120, 150, 0.18);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 15px;
    letter-spacing: -.02em;
}

.brand-copy small {
    color: var(--c-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.topbar-search {
    max-width: 520px;
}

.topbar-search input {
    height: 42px;
    border-radius: 12px;
    background: #fbf9fa;
    padding: 0 16px;
}

.app-body {
    grid-template-columns: 240px minmax(0, 1fr) 320px;
}

.tree-panel {
    padding: 18px 12px;
    background: #fffdfd;
}

.tree-node {
    padding: 9px 10px;
    border-radius: 10px;
}

.main-panel {
    background: #fff;
}

.library-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px;
    margin: 16px 18px 4px;
    border: 1px solid #f1e8eb;
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(247, 175, 196, 0.22), transparent 34%),
        linear-gradient(135deg, #fff 0%, #fff9fb 100%);
    box-shadow: 0 10px 28px rgba(79, 53, 61, 0.05);
}

.library-overview.hidden {
    display: none;
}

.library-overview-copy {
    min-width: 0;
}

.library-overview .eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--c-pink-strong);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}

.library-overview h1 {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: -.04em;
}

.library-overview p {
    margin: 7px 0 0;
    color: var(--c-text-muted);
    font-size: 13px;
}

.library-overview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 8px;
    flex: 0 0 auto;
}

.overview-stat {
    min-width: 98px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(236, 220, 225, .88);
    border-radius: 14px;
}

.overview-stat span {
    display: block;
    color: var(--c-text-muted);
    font-size: 10px;
    margin-bottom: 5px;
}

.overview-stat strong {
    display: block;
    font-size: 17px;
    letter-spacing: -.03em;
}

.breadcrumb-bar {
    padding: 12px 20px;
}

.file-area {
    padding: 18px 20px 84px;
}

.file-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.file-card {
    border-color: #eee7e9;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(38, 34, 35, 0.025);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.file-card:hover {
    transform: translateY(-2px);
    border-color: #ead7dd;
    box-shadow: 0 10px 24px rgba(75, 45, 54, .08);
}

.folder-thumb {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.root-folder-card {
    min-height: 178px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #fff 0%, #fffafb 100%);
}

.root-folder-visual {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.root-folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 17px;
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
    font-size: 24px;
    font-weight: 800;
}

.root-folder-type {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    color: #b3a7ab;
}

.root-folder-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.root-folder-copy strong {
    font-size: 15px;
    letter-spacing: -.02em;
}

.root-folder-copy span {
    color: var(--c-text-muted);
    font-size: 11px;
}

.detail-panel {
    background: #fffdfd;
    padding: 20px;
}

.detail-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 18px;
    border: 1px dashed #eadfe2;
    border-radius: 16px;
    background: rgba(255, 250, 251, .8);
}

.detail-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 16px;
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
    font-size: 19px;
}

.detail-empty strong {
    color: var(--c-text);
    font-size: 13px;
}

.detail-empty span {
    max-width: 210px;
    line-height: 1.6;
    font-size: 11px;
}

.upload-progress {
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(53, 35, 41, .14);
}

@media (max-width: 1180px) {
    .app-body {
        grid-template-columns: 210px minmax(0, 1fr) 280px;
    }

    .library-overview {
        align-items: flex-start;
        flex-direction: column;
    }

    .library-overview-stats {
        width: 100%;
    }
}

@media (max-width: 1000px) {
    .topbar-brand {
        min-width: auto;
    }

    .library-overview {
        margin: 14px 14px 4px;
        padding: 20px;
    }

    .file-area {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 640px) {
    .brand-copy small {
        display: none;
    }

    .library-overview {
        gap: 16px;
    }

    .library-overview h1 {
        font-size: 20px;
    }

    .library-overview-stats {
        grid-template-columns: 1fr 1fr;
    }

    .overview-stat:last-child {
        grid-column: 1 / -1;
    }

    .file-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .root-folder-card {
        min-height: 150px;
        padding: 14px;
    }

    .root-folder-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 20px;
    }
}

/* ========================================================================== 
   Public landing + hidden entry surface
   ========================================================================== */

.public-landing-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% 18%, rgba(247, 175, 196, .18), transparent 29%),
        linear-gradient(180deg, #fff 0%, #fbf9fa 100%);
}

.public-landing {
    width: min(1180px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.public-header {
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
}

.public-brand-mark {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: #262223;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .05em;
}

.public-brand > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.public-brand strong {
    font-size: 15px;
    letter-spacing: -.02em;
}

.public-brand small {
    color: var(--c-text-muted);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.service-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    color: #655e60;
    font-size: 11px;
    font-weight: 650;
}

.service-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #63b37c;
    box-shadow: 0 0 0 4px rgba(99,179,124,.12);
}

.public-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr);
    align-items: center;
    gap: 72px;
    padding: 80px 0 64px;
}

.public-kicker {
    margin-bottom: 18px;
    color: var(--c-pink-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
}

.public-hero h1 {
    margin: 0;
    font-size: clamp(42px, 5.6vw, 74px);
    line-height: 1.06;
    letter-spacing: -.06em;
    font-weight: 800;
}

.public-hero > p {
    max-width: 650px;
    margin: 28px 0 0;
    color: var(--c-text-muted);
    font-size: 16px;
    line-height: 1.8;
    word-break: keep-all;
}

.public-feature-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 42px;
}

.public-feature {
    min-height: 118px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid #ebe6e8;
    border-radius: 18px;
    background: rgba(255,255,255,.78);
}

.public-feature span {
    margin-bottom: auto;
    color: #bbb1b4;
    font-size: 10px;
    font-weight: 800;
}

.public-feature strong {
    font-size: 13px;
}

.public-feature small {
    margin-top: 4px;
    color: var(--c-text-muted);
    font-size: 11px;
}

.public-status-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border: 1px solid #e9e1e4;
    border-radius: 28px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 26px 70px rgba(58, 43, 48, .10);
}

.public-status-card::before {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    top: -72px;
    right: -68px;
    border-radius: 50%;
    background: rgba(247, 175, 196, .20);
    filter: blur(2px);
}

.status-card-head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--c-text-muted);
    font-size: 11px;
}

.status-card-head b {
    color: #4f9b67;
    font-size: 10px;
    letter-spacing: .08em;
}

.status-orb {
    width: 154px;
    height: 154px;
    margin: 44px auto 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff3f6, #fff);
    border: 1px solid #f0dce2;
    box-shadow: inset 0 0 0 14px rgba(247,175,196,.08), 0 18px 36px rgba(118,80,92,.08);
}

.status-orb span {
    font-size: 33px;
    font-weight: 850;
    letter-spacing: -.06em;
}

.public-status-card dl {
    position: relative;
    margin: 0;
}

.public-status-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 0;
    border-top: 1px solid var(--c-border);
    font-size: 12px;
}

.public-status-card dt { color: var(--c-text-muted); }
.public-status-card dd { margin: 0; font-weight: 650; }

.public-note {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
    padding: 18px 20px;
    border: 1px solid #eee8ea;
    border-radius: 18px;
    background: rgba(255,255,255,.7);
}

.public-note-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
}

.public-note strong { font-size: 12px; }
.public-note p { margin: 3px 0 0; color: var(--c-text-muted); font-size: 11px; }

.public-footer {
    min-height: 66px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--c-border);
    color: #9c9396;
    font-size: 10px;
    letter-spacing: .03em;
}

.public-footer-trigger {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.entry-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(31, 27, 29, .28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.entry-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.entry-dialog {
    position: relative;
    width: min(430px, 100%);
    transform: translateY(10px) scale(.985);
    transition: transform .18s ease;
}

.entry-backdrop.visible .entry-dialog {
    transform: translateY(0) scale(1);
}

.entry-close {
    position: absolute;
    z-index: 4;
    right: 13px;
    top: 13px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8b8285;
    font-size: 22px;
    cursor: pointer;
}

.entry-close:hover { background: var(--c-surface-muted); }

.auth-card-embedded {
    max-width: none;
    padding: 34px 32px 30px;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(40, 28, 32, .20);
}

.auth-help {
    margin: 0 0 14px;
    color: var(--c-text-muted);
    font-size: 12px;
    line-height: 1.65;
}

.totp-qr {
    min-height: 176px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
    color: var(--c-text-muted);
    font-size: 12px;
    text-align: center;
}

.mono-input { letter-spacing: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.recovery-codes-list {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--c-surface-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    line-height: 1.9;
}

.html-code-modal { max-width: 720px; }
.modal-help { margin: -5px 0 14px; color: var(--c-text-muted); font-size: 12px; line-height: 1.6; }
.html-code-output {
    width: 100%;
    min-height: 230px;
    resize: vertical;
    padding: 14px;
    border: 1px solid var(--c-border-strong);
    border-radius: 12px;
    background: #fbfafb;
    color: #332d2f;
    font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    outline: none;
}
.html-code-output:focus { border-color: var(--c-pink); box-shadow: 0 0 0 3px var(--c-focus); }

@media (max-width: 860px) {
    .public-landing { width: min(100% - 30px, 720px); }
    .public-header { height: 78px; }
    .public-main { grid-template-columns: 1fr; gap: 34px; padding: 54px 0 42px; }
    .public-status-card { max-width: 520px; width: 100%; }
}

@media (max-width: 580px) {
    .service-state { display: none; }
    .public-hero h1 { font-size: 39px; }
    .public-hero > p { font-size: 14px; }
    .public-feature-row { grid-template-columns: 1fr; gap: 9px; margin-top: 30px; }
    .public-feature { min-height: 88px; }
    .public-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
    .public-note { align-items: flex-start; }
    .entry-backdrop { padding: 12px; align-items: flex-end; }
    .auth-card-embedded { border-radius: 24px 24px 14px 14px; padding: 30px 22px 24px; max-height: 88vh; overflow-y: auto; }
}

.detail-actions { flex-wrap: wrap; }
.detail-actions .btn { flex: 1 1 120px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ========================================================================== 
   Console usability + reliability pass (v4)
   ========================================================================== */

.operation-notice {
    display: none;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #eadfe2;
    background: #fffafc;
    color: var(--c-text);
}

.operation-notice.visible { display: flex; }
.operation-notice.error {
    background: #fff5f7;
    border-bottom-color: #f3ccd6;
}

.operation-notice-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.operation-notice-copy strong {
    flex: 0 0 auto;
    font-size: 12px;
    color: #b94464;
}

.operation-notice-copy span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #645b5e;
}

.operation-notice-close {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    font-size: 18px;
}

.folder-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 14px;
    min-height: 42px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--c-border);
    background: #fffdfd;
    color: var(--c-text-muted);
    font-size: 11px;
}

.folder-summary > span:not(.folder-summary-label) {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.folder-summary b {
    color: var(--c-text);
    font-size: 12px;
}

.folder-summary-label {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--c-pink-soft);
    color: var(--c-pink-strong);
    font-weight: 750;
}

.folder-summary-size { margin-left: auto; }

.selection-bar {
    flex-wrap: wrap;
    min-height: 50px;
}

.file-card-copy {
    padding: 10px 11px 11px;
    min-width: 0;
}

.file-card-copy .caption {
    padding: 0;
    margin-bottom: 7px;
    color: var(--c-text);
    font-size: 12px;
    font-weight: 650;
}

.file-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.file-meta-text {
    margin-left: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c-text-muted);
    font-size: 9px;
}

.thumb-wrap {
    position: relative;
    overflow: hidden;
    background: #faf7f8;
}

.thumb-fallback {
    object-fit: contain !important;
    padding: 18px;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 21px;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.role-chip.detail {
    color: #5f6874;
    background: #f4f6f8;
    border-color: #e6e9ed;
}

.role-chip.thumbnail {
    color: #b94e73;
    background: #fff0f5;
    border-color: #f3ccda;
}

.role-chip.folder {
    color: #6d625e;
    background: #f8f4ef;
    border-color: #eee5da;
}

.role-chip.published {
    color: #4f7c5e;
    background: #f0f8f2;
    border-color: #d7e8dc;
}

.file-card.is-published::after {
    content: '';
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #70a67f;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(39, 74, 49, .16);
    z-index: 4;
}

.file-card.folder-card {
    background: linear-gradient(180deg, #fff 0%, #fffdfa 100%);
}

.folder-thumb {
    position: relative;
    background: #fbf8f4 !important;
}

.folder-glyph { font-size: 38px; }
.folder-open-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: #8a7e78;
    font-size: 9px;
    font-weight: 700;
    border: 1px solid #eee4dc;
}

.entry-select-toggle {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 5;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(198, 188, 191, .9);
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: transparent;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, border-color .15s ease, background .15s ease;
}

.file-card:hover .entry-select-toggle,
.file-card.selected .entry-select-toggle,
.file-list-row:hover .entry-select-toggle,
.file-list-row.selected .entry-select-toggle {
    opacity: 1;
}

.file-card.selected .entry-select-toggle,
.file-list-row.selected .entry-select-toggle {
    color: #fff;
    background: var(--c-pink-strong);
    border-color: var(--c-pink-strong);
}

.file-list-row {
    position: relative;
    min-height: 48px;
}

.file-list-row .entry-select-toggle {
    position: static;
    flex: 0 0 auto;
    opacity: .35;
}

.file-list-row .list-icon { flex: 0 0 auto; }
.file-list-row .meta { gap: 6px; }
.list-file-meta,
.list-open-hint {
    color: var(--c-text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.tree-error {
    margin: 7px 4px;
    padding: 8px 9px;
    border-radius: 8px;
    background: var(--c-danger-soft);
    color: var(--c-danger);
    font-size: 10px;
    line-height: 1.45;
}

.upload-progress {
    width: 360px;
    max-height: min(60vh, 520px);
    overflow-y: auto;
}

.upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.upload-progress-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-state {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 700;
}

.upload-progress-item.success .upload-progress-state { color: #4f8d62; }
.upload-progress-item.failed .upload-progress-state { color: var(--c-danger); }
.upload-progress-item.failed .upload-progress-bar-fill { background: var(--c-danger); }
.upload-progress-item.success .upload-progress-bar-fill { width: 100% !important; }

.btn:disabled,
.icon-btn:disabled {
    cursor: not-allowed;
    opacity: .52;
}

@media (max-width: 760px) {
    .folder-summary {
        padding-left: 14px;
        padding-right: 14px;
        gap: 6px 10px;
    }

    .folder-summary-size { margin-left: 0; }
    .operation-notice-copy { flex-direction: column; gap: 2px; }
    .entry-select-toggle { opacity: .42; }
    .file-meta-text { display: none; }
    .list-file-meta { display: none; }
    .file-list-row .meta { flex-wrap: wrap; justify-content: flex-end; }
}

/* Multi-folder upload modal */
.folder-upload-modal {
    max-width: 620px;
}

.folder-upload-drop-target {
    min-height: 190px;
    border: 2px dashed #efb6c8;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffafb 0%, #fff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    text-align: center;
    color: var(--c-text-muted);
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.folder-upload-drop-target strong {
    color: var(--c-text);
    font-size: 16px;
}

.folder-upload-drop-target span {
    font-size: 12px;
    line-height: 1.6;
}

.folder-upload-drop-target.is-dragover {
    border-color: var(--c-pink-strong);
    background: #fff0f5;
    box-shadow: 0 0 0 4px rgba(247,175,196,.12);
    transform: translateY(-1px);
}
