.column-view {
    --column-count: 4;
    min-height: min(68vh, 720px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.column-view .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.column-view[hidden] { display: none !important; }

.column-operations-toggle {
    display: none;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 9px;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.app.column-mode .column-operations-toggle { display: inline-flex; }
.column-operations-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.column-operations-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.column-operations-toggle i {
    position: relative;
    width: 28px;
    height: 16px;
    background: var(--bg-sunken);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    transition: background .16s ease, border-color .16s ease;
}

.column-operations-toggle i::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    content: "";
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform .16s ease, background .16s ease;
}

.column-operations-toggle[aria-checked="true"] { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 38%, var(--border)); }
.column-operations-toggle[aria-checked="true"] i { background: var(--brand-soft); border-color: var(--brand); }
.column-operations-toggle[aria-checked="true"] i::after { background: var(--brand); transform: translateX(12px); }

.column-view.operations-hidden .column-item-actions { display: none; }

.column-view-toolbar {
    display: none;
    align-items: center;
    gap: var(--sp-3);
    min-height: 48px;
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
}

.column-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 var(--sp-3);
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font: inherit;
    cursor: pointer;
}

.column-back:disabled { opacity: .45; cursor: default; }
.column-back > span:first-child { font-size: 24px; line-height: 1; }

.column-location {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-track {
    display: grid;
    grid-template-columns: repeat(var(--column-count), minmax(0, 1fr));
    height: min(68vh, 720px);
    min-height: 420px;
}

.finder-column {
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elevated) 96%, var(--brand) 4%);
}

.finder-column:last-child { border-right: 0; }
.finder-column.is-active { background: var(--bg-elevated); }
.finder-column.is-placeholder {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--bg-sunken) 72%, transparent), transparent 55%),
        var(--bg-elevated);
}

.finder-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    height: 40px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
}

.finder-column-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finder-column-count {
    flex: none;
    color: var(--text-muted);
    font-size: 12px;
}

.finder-column-list {
    height: calc(100% - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 5px 6px;
    scrollbar-gutter: stable;
}

.column-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    margin-bottom: 1px;
    border-radius: var(--r-md);
}

.column-entry.is-selected {
    background: var(--brand-soft);
    box-shadow: inset 3px 0 0 var(--brand);
}

.column-item-main {
    display: grid;
    grid-template-columns: 19px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 7px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: var(--r-md);
    font: inherit;
    font-size: 16px;
    font-weight: 520;
    text-align: left;
    cursor: default;
}

.column-item-main:hover { background: var(--surface-hover); }
.column-item-main:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.column-item-icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    color: var(--brand);
}

.column-item-icon svg { width: 100%; height: 100%; }

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

.column-item-arrow {
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
}

.column-item-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    width: 34px;
    height: 34px;
    margin-right: 1px;
}

.column-more-button {
    position: relative;
    isolation: isolate;
    width: 34px;
    height: 34px;
    flex: none;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    border-radius: var(--r-md);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .14s ease;
}

.column-more-button::before {
    position: absolute;
    z-index: -1;
    inset: 3px;
    content: "";
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: calc(var(--r-md) - 1px);
}

.column-entry:hover .column-more-button,
.column-entry.is-selected .column-more-button,
.column-entry:focus-within .column-more-button {
    opacity: 1;
}

.column-more-button:hover,
.column-more-button:focus-visible {
    color: var(--text);
}

.column-more-button:hover::before,
.column-more-button:focus-visible::before {
    background: var(--surface-hover);
    border-color: color-mix(in srgb, var(--brand) 52%, var(--border));
}

.column-more-button:focus-visible {
    opacity: 1;
    outline: 2px solid var(--brand);
    outline-offset: -1px;
}

.column-operation-menu {
    position: fixed;
    z-index: 360;
    display: grid;
    width: 164px;
    min-width: 150px;
    max-width: min(180px, calc(100vw - 24px));
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
}

.column-operation-item {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: var(--r-md);
    font: inherit;
    font-size: 13px;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
}

.column-operation-item:hover,
.column-operation-item:focus-visible {
    color: var(--brand);
    background: var(--surface-hover);
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.column-operation-item.is-danger { color: var(--danger); }
.column-operation-item.is-danger:hover,
.column-operation-item.is-danger:focus-visible {
    color: #fff;
    background: var(--danger);
    outline-color: var(--danger);
}

.column-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: var(--sp-5);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.column-state button {
    margin-top: var(--sp-3);
}

.column-view.is-loading .finder-column.is-active .finder-column-list {
    opacity: .72;
}

@media (max-width: 860px) {
    .app.column-mode .page-head-text { display: none; }
    .app.column-mode .page-head { align-items: center; }
    .app.column-mode #selectModeBtn { display: none; }
    .column-view-toolbar { display: flex; }
    .column-operations-toggle { min-height: 44px; }
    .column-back { min-height: 44px; }
    .column-track { grid-template-columns: 1fr; min-height: 52vh; height: 60vh; }
    .finder-column { display: none; border-right: 0; }
    .finder-column.is-active { display: block; }
    .column-entry { min-height: 46px; }
    .column-item-main { min-height: 46px; font-size: 16px; }
    .column-item-actions { width: 44px; height: 44px; margin-right: 0; }
    .column-more-button { width: 44px; height: 44px; opacity: 1; }
    .column-more-button::before { inset: 7px; }
    .column-operation-item { min-height: 44px; padding-block: 12px; }
}

@media (hover: none), (pointer: coarse) {
    .column-item-actions { width: 44px; height: 44px; margin-right: 0; }
    .column-more-button { width: 44px; height: 44px; opacity: 1; }
    .column-more-button::before { inset: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    .column-view * { scroll-behavior: auto !important; transition: none !important; }
}

@media (forced-colors: active) {
    .column-entry.is-selected { border-left: 3px solid Highlight; box-shadow: none; }
    .column-item-main:focus-visible { outline-color: Highlight; }
}

.column-item-icon.has-video-thumbnail { position: relative; width: 28px; height: 28px; }
.column-item-icon.has-video-thumbnail svg { width: 17px; height: 17px; margin: auto; }
.column-item-icon.has-video-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); background: var(--bg-sunken); }

.column-item-main.has-video-thumbnail { grid-template-columns: 28px minmax(0, 1fr) auto; }

.column-item-icon.thumbnail-failed > img[hidden] { display: none; }
