@charset "UTF-8";
/*
 * YG Cloud — one token set for light and dark, one type scale, one spacing scale.
 * Desktop (>=900px): sidebar + list, details as a side panel (>=1200px inline, otherwise a side sheet).
 * Mobile (<900px): list first, bottom navigation, sheets for details, upload and folders.
 */
:root {
  color-scheme: light dark;
  --bg: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --surface-3: #e7e7ef;
  --ink: #1c1d25;
  --ink-2: #474a59;
  --muted: #626677;
  --line: #e3e4eb;
  --line-strong: #c9cbd6;
  --accent: #5652c9;
  --accent-hover: #4541b3;
  --accent-ink: #4844bb;
  --accent-soft: #ecebfb;
  --accent-select: #dddcf8;
  --on-accent: #ffffff;
  --danger: #be3448;
  --danger-soft: #fdecef;
  --success: #1f7a5c;
  --warning-soft: #fff4e0;
  --warning-ink: #7a4a00;
  --focus: #6a66e0;
  --scrim: rgb(14 14 28 / .42);
  --shadow-sm: 0 1px 2px rgb(20 20 45 / .06);
  --shadow-lg: 0 18px 50px rgb(20 20 45 / .2);
  --glyph-image: #2f7d61; --glyph-image-bg: #e5f3ec;
  --glyph-video: #7046b5; --glyph-video-bg: #efe8fb;
  --glyph-audio: #a35a12; --glyph-audio-bg: #fbeedf;
  --glyph-doc: #3a5fb5; --glyph-doc-bg: #e6edfb;
  --glyph-pdf: #b23a3a; --glyph-pdf-bg: #fbe8e8;
  --glyph-archive: #6b5a2e; --glyph-archive-bg: #f2eddc;
  --glyph-folder: #5652c9; --glyph-folder-bg: #ecebfb;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar-w: 256px;
  --details-w: 380px;
  --topbar-h: 64px;
  --bottom-h: 64px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "D2Coding", Consolas, "SFMono-Regular", monospace;
  font-family: var(--font);
  font-size: 100%;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121318;
    --surface: #18191f;
    --surface-2: #22232b;
    --surface-3: #2c2d37;
    --ink: #ececf2;
    --ink-2: #c8cad5;
    --muted: #a4a7b6;
    --line: #2b2d37;
    --line-strong: #40434f;
    --accent: #8d89f3;
    --accent-hover: #a4a1f7;
    --accent-ink: #aeabf9;
    --accent-soft: #272650;
    --accent-select: #312f63;
    --on-accent: #14132b;
    --danger: #f27b8c;
    --danger-soft: #3b1d25;
    --success: #5fcda8;
    --warning-soft: #3a2c12;
    --warning-ink: #f4c77a;
    --focus: #aeabf9;
    --scrim: rgb(0 0 0 / .6);
    --shadow-lg: 0 18px 50px rgb(0 0 0 / .55);
    --glyph-image: #6fd3aa; --glyph-image-bg: #1d3329;
    --glyph-video: #c3a2f5; --glyph-video-bg: #2d2342;
    --glyph-audio: #f0b375; --glyph-audio-bg: #3a2a18;
    --glyph-doc: #8fb0f5; --glyph-doc-bg: #1f2a44;
    --glyph-pdf: #f19b9b; --glyph-pdf-bg: #3d2020;
    --glyph-archive: #d8c48e; --glyph-archive-bg: #33301f;
    --glyph-folder: #aeabf9; --glyph-folder-bg: #272650;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: .9375rem; caret-color: var(--accent); }
::selection { background: var(--accent-select); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px); scrollbar-color: var(--line-strong) transparent; }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[data-icon] { display: inline-flex; flex: none; }
.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; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 500; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.skip-link:focus { top: 12px; }

/* Controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius); font-size: .9375rem; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.button.small { min-height: 36px; padding: 0 12px; font-size: .875rem; gap: 6px; }
.button.small svg.icon { width: 18px; height: 18px; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: var(--surface-2); }
.button.quiet { color: var(--ink-2); }
.button.quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.danger:hover:not(:disabled) { filter: brightness(.94); }
@media (prefers-color-scheme: dark) { .button.danger { color: #2a0d13; } }
.danger-text { color: var(--danger) !important; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius); color: var(--muted); flex: none; transition: background-color .15s ease, color .15s ease; }
.icon-button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-button.small { width: 32px; height: 32px; }
.icon-button.small svg.icon { width: 18px; height: 18px; }
.icon-button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent-ink); }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; color: var(--accent-ink); font-weight: 600; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 1rem; }
.form-input::placeholder { color: var(--muted); }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.form-input { cursor: pointer; }
.field-label { display: block; margin: 16px 0 6px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.field-label:first-child { margin-top: 0; }
.field-note { margin-top: 8px; font-size: .8125rem; color: var(--muted); line-height: 1.55; }
.form-error { margin: 12px 20px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: .875rem; line-height: 1.55; overflow-wrap: anywhere; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.125rem; letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 1rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; padding-bottom: 2px; }

/* Shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.app-shell.with-details { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--details-w); }
.main-shell { min-width: 0; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 12px; background: var(--bg); border-right: 1px solid var(--line); z-index: 60; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 6px; }
.drawer-close { display: none; }
.create-button { justify-content: flex-start; margin: 10px 4px 12px; min-height: 48px; padding: 0 18px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.primary-nav, .folder-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--radius); color: var(--ink-2); font-size: .9375rem; text-align: left; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item[aria-current], .nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.nav-item .count-pill { margin-left: auto; }
.nav-section-title { display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 4px 12px; }
.nav-section-title h2 { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.folder-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.folder-nav .nav-item svg.icon { color: var(--glyph-folder); }
.folder-nav-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-nav-note { padding: 6px 12px; font-size: .875rem; color: var(--muted); line-height: 1.6; }
.folder-nav-error .text-button { padding-left: 12px; }
.sidebar-bottom { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.install-button { justify-content: flex-start; }
.account-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 8px; border-radius: var(--radius); text-align: left; }
.account-button:hover { background: var(--surface-3); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: .8125rem; font-weight: 700; flex: none; }
.account-text { min-width: 0; display: grid; }
.account-text strong { font-size: .9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { font-size: .8125rem; color: var(--muted); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-brand { display: none; }
.search-field { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; max-width: 640px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; color: var(--muted); cursor: text; }
.search-field:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-field input { flex: 1; min-width: 0; height: 42px; border: 0; background: none; outline: none; font-size: .9375rem; color: var(--ink); }
.search-field input::placeholder { color: var(--muted); }
.search-field kbd { display: grid; place-items: center; min-width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; font: 600 .75rem var(--font); color: var(--muted); }
.queue-button { margin-left: auto; }

/* Location and toolbar */
main#workspace { padding: 20px 28px 40px; outline: none; max-width: 1480px; }
.location { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 12px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 28px; font-size: .875rem; color: var(--muted); }
.breadcrumbs button { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; min-height: 28px; padding: 0 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.breadcrumbs button:hover { background: var(--surface-2); color: var(--ink); }
.breadcrumbs button[aria-current] { color: var(--ink-2); font-weight: 600; }
.breadcrumbs svg.icon { width: 16px; height: 16px; }
.breadcrumb-separator { color: var(--line-strong); }
.location-row { display: flex; align-items: center; gap: 8px; }
.location-row h1 { min-width: 0; font-size: 1.625rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.type-filters { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.type-filters::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed=true] { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 650; }
.view-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.sort-select select { min-height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626677' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; appearance: none; font-size: .875rem; color: var(--ink-2); cursor: pointer; }
.view-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.view-switch .icon-button { width: 34px; height: 30px; border-radius: 7px; }
.view-switch svg.icon { width: 18px; height: 18px; }

/* Banners and selection */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--warning-soft); color: var(--warning-ink); font-size: .875rem; line-height: 1.5; }
.banner .button { flex: none; }
.selection-bar { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 4px 4px 4px 16px; min-height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .9375rem; box-shadow: var(--shadow-sm); }
.selection-actions { display: flex; align-items: center; gap: 2px; }
.selection-actions .button.quiet { color: var(--accent-ink); }
.selection-actions .button.quiet:hover { background: var(--accent-select); }

/* File list */
.file-content { min-height: 240px; }
.file-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.file-table th { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 500; text-align: left; white-space: nowrap; }
.file-table td { height: 56px; padding: 4px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .875rem; }
.file-table .check-column { width: 52px; padding: 0 0 0 6px; }
.file-table .check-cell { padding: 0 0 0 6px; }
.file-table .date-column { width: 132px; }
.file-table .size-column { width: 100px; }
.file-table .actions-column { width: 168px; }
.file-table .date-cell, .file-table .size-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-table tbody tr { transition: background-color .12s ease; }
.file-table tbody tr:hover { background: var(--surface-2); }
.file-table tbody tr.selected { background: var(--accent-soft); }
.file-table tbody tr.active td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.file-card.active { border-color: var(--accent); }
.check { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; cursor: pointer; }
.file-name-button { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 48px; text-align: left; border-radius: 8px; }
.file-name-text { display: grid; min-width: 0; }
.file-name-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; font-weight: 500; color: var(--ink); }
.file-name-button:hover .file-name-text strong { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.file-name-text small { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-name-text small.path { display: block; }
.file-glyph { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; flex: none; background: var(--surface-3); color: var(--muted); }
.file-glyph svg.icon { width: 20px; height: 20px; }
.file-glyph.folder { background: var(--glyph-folder-bg); color: var(--glyph-folder); }
.file-glyph.folder svg.icon { fill: currentColor; fill-opacity: .18; }
.file-glyph.image { background: var(--glyph-image-bg); color: var(--glyph-image); }
.file-glyph.video { background: var(--glyph-video-bg); color: var(--glyph-video); }
.file-glyph.audio { background: var(--glyph-audio-bg); color: var(--glyph-audio); }
.file-glyph.document { background: var(--glyph-doc-bg); color: var(--glyph-doc); }
.file-glyph.pdf { background: var(--glyph-pdf-bg); color: var(--glyph-pdf); }
.file-glyph.archive { background: var(--glyph-archive-bg); color: var(--glyph-archive); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-actions .icon-button { width: 36px; height: 36px; }
.row-actions .icon-button svg.icon { width: 19px; height: 19px; }
.row-actions .favorited { color: #c9930a; }
@media (prefers-color-scheme: dark) { .row-actions .favorited, .card-tools .favorited { color: #f2c94c; } }
@media (hover: hover) and (pointer: fine) {
  .file-table .row-actions .hover-only { opacity: 0; transition: opacity .12s ease; }
  .file-table tr:hover .hover-only, .file-table tr:focus-within .hover-only, .file-table tr.selected .hover-only, .file-table .hover-only.favorited { opacity: 1; }
}

/* Grid */
.select-all-row { display: flex; align-items: center; gap: 4px; min-height: 44px; font-size: .875rem; color: var(--muted); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; padding: 4px 0 8px; }
.file-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .15s ease, background-color .15s ease; }
.file-card:hover { border-color: var(--line-strong); }
.file-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.card-open { display: flex; flex-direction: column; width: 100%; min-width: 0; text-align: left; }
.card-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .file-glyph { width: 56px; height: 56px; border-radius: 14px; }
.card-thumb .file-glyph svg.icon { width: 28px; height: 28px; }
.card-body { display: grid; gap: 2px; padding: 10px 12px 12px; min-width: 0; }
.card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; font-weight: 500; }
.card-body small { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-check { position: absolute; top: 4px; left: 4px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.card-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.card-tools .icon-button { width: 36px; height: 36px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .file-card .card-check, .file-card .card-tools .hover-only { opacity: 0; transition: opacity .12s ease; }
  .file-card:hover .card-check, .file-card:focus-within .card-check, .file-card.selected .card-check,
  .file-card:hover .hover-only, .file-card:focus-within .hover-only, .file-card .hover-only.favorited, .selecting .card-check { opacity: 1; }
}

/* States */
.empty-state, .error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 280px; padding: 32px 16px; text-align: center; }
.state-symbol { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 16px; background: var(--surface-2); color: var(--muted); }
.state-symbol svg.icon { width: 28px; height: 28px; }
.error-state .state-symbol { background: var(--danger-soft); color: var(--danger); }
.empty-state h2, .error-state h2 { font-size: 1.0625rem; font-weight: 650; }
.empty-state p, .error-state p { max-width: 360px; color: var(--muted); font-size: .9375rem; line-height: 1.6; overflow-wrap: anywhere; }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.loading-state { display: grid; }
.skeleton-row { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.skeleton { border-radius: 6px; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
.skeleton-icon { width: 36px; height: 36px; border-radius: 9px; }
.skeleton-name { width: min(46%, 320px); height: 12px; }
.skeleton-meta { width: 64px; height: 10px; margin-left: auto; }
.list-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.drop-hint { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.drop-hint strong { font-weight: 600; color: var(--ink-2); }
@media (hover: none) { .drop-hint { display: none; } }

/* Details (inline panel and sheet share the same content) */
.details-panel { position: sticky; top: 0; height: 100dvh; overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface); }
.details { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 24px; }
.details-head { display: flex; align-items: flex-start; gap: 8px; }
.details-head h2 { flex: 1; min-width: 0; padding-top: 7px; font-size: 1.0625rem; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.details-head .file-glyph { margin-top: 2px; }
.preview { display: grid; place-items: center; min-height: 180px; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.preview img { display: block; max-width: 100%; max-height: 380px; object-fit: contain; }
.preview video { display: block; width: 100%; max-height: 380px; background: #000; }
.preview audio { width: calc(100% - 24px); }
.preview iframe { width: 100%; height: min(42dvh, 340px); border: 0; background: #fff; }
.preview pre { align-self: stretch; justify-self: stretch; max-height: min(42dvh, 340px); margin: 0; padding: 14px 16px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font: .8125rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; text-align: left; color: var(--ink); }
.preview.has-text { place-items: stretch; background: none; min-height: 0; }
.preview-message { display: grid; justify-items: center; gap: 10px; padding: 24px 16px; text-align: center; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.preview-message .file-glyph { width: 56px; height: 56px; border-radius: 14px; }
.preview-message .file-glyph svg.icon { width: 28px; height: 28px; }
.preview-note { font-size: .8125rem; color: var(--muted); }
.detail-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-primary .button { min-height: 44px; }
.detail-primary .button:only-child { grid-column: 1 / -1; }
.detail-menu { display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 0; }
.detail-menu button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px; border-radius: 8px; color: var(--ink-2); font-size: .9375rem; text-align: left; }
.detail-menu button:hover { background: var(--surface-2); color: var(--ink); }
.detail-menu button svg.icon { color: var(--muted); }
.detail-menu button.danger-text svg.icon { color: var(--danger); }
.detail-meta { display: grid; gap: 10px; margin: 0; font-size: .875rem; }
.detail-meta div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-footnote { font-size: .8125rem; color: var(--muted); line-height: 1.6; }

/* Dialogs and sheets */
dialog.sheet { width: min(480px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: var(--scrim); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { padding-top: 6px; font-size: 1.0625rem; font-weight: 700; }
.dialog-heading p { margin-top: 4px; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.action-body { padding: 16px 20px 4px; font-size: .9375rem; color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.action-body p + p, .action-body p + .field-label { margin-top: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 20px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.delete-list { max-height: 160px; margin: 10px 0 0; padding-left: 20px; overflow: auto; color: var(--ink-2); font-size: .875rem; line-height: 1.8; }
.account-meta { display: grid; gap: 8px; margin: 12px 0 4px; font-size: .875rem; }
.account-meta div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.account-meta dt { color: var(--muted); }
.account-meta dd { margin: 0; overflow-wrap: anywhere; }

dialog.create-dialog { padding: 6px; }
.menu-list { display: grid; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; border-radius: 10px; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item > [data-icon] { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.menu-item span:last-child { display: grid; min-width: 0; }
.menu-item strong { font-weight: 600; font-size: .9375rem; }
.menu-item small { color: var(--muted); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.upload-dialog { width: min(600px, calc(100vw - 32px)); }
.queue-list { max-height: min(60dvh, 560px); overflow: auto; padding: 4px 20px; }
.queue-empty { padding: 48px 12px; text-align: center; color: var(--muted); }
.queue-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.queue-row:last-child { border-bottom: 0; }
.queue-body { flex: 1; min-width: 0; }
.queue-name { display: flex; justify-content: space-between; gap: 8px; font-size: .9375rem; }
.queue-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.queue-name span { flex: none; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.queue-path { display: block; margin-top: 2px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.queue-progress { display: block; width: 100%; height: 6px; margin: 8px 0 6px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-3); color: var(--accent); appearance: none; -webkit-appearance: none; }
.queue-progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.queue-progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.queue-progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.queue-row[data-status=done] .queue-progress::-webkit-progress-value { background: var(--success); }
.queue-row[data-status=done] .queue-progress::-moz-progress-bar { background: var(--success); }
.queue-status { display: flex; justify-content: space-between; gap: 8px; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.queue-status.success { color: var(--success); }
.queue-status.error { color: var(--danger); }
.queue-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.queue-control .done-mark { display: grid; place-items: center; width: 40px; height: 40px; color: var(--success); }

.share-input { display: flex; gap: 8px; }
.share-input .form-input { font-size: .875rem; }
.share-input .button { min-height: 44px; }
.share-native { width: 100%; margin: 12px 0 16px; min-height: 44px; }
.share-dialog .action-body { padding-bottom: 16px; }

/* Toasts and drag overlay */
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 300; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; border-radius: 12px; background: #24252f; color: #fff; font-size: .9375rem; line-height: 1.5; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in .2s cubic-bezier(.2, .8, .2, 1); }
.toast.error { background: #8d2636; }
.toast .toast-action { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.toast .toast-action:hover { background: rgb(255 255 255 / .12); }
.toast .icon-button { width: 32px; height: 32px; color: rgb(255 255 255 / .8); }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
.toast .icon-button:hover { background: rgb(255 255 255 / .12); color: #fff; }
@media (prefers-color-scheme: dark) { .toast { background: #ececf2; color: #18191f; } .toast .icon-button { color: #3a3c48; } .toast .icon-button:hover { background: rgb(0 0 0 / .08); color: #18191f; } .toast.error { background: #f6c0c8; color: #3b0c16; } }
.drag-overlay { position: fixed; inset: 12px; z-index: 250; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 20px; background: color-mix(in srgb, var(--accent-soft) 94%, transparent); color: var(--accent-ink); pointer-events: none; text-align: center; }
.drag-overlay [data-icon] svg.icon { width: 48px; height: 48px; stroke-width: 1.5; }
.drag-overlay strong { display: block; margin-top: 12px; font-size: 1.375rem; }
.drag-overlay p { margin-top: 6px; color: var(--ink-2); overflow-wrap: anywhere; }

/* Bottom navigation (mobile only) */
.bottom-nav { display: none; }
.scrim { display: none; }

@keyframes pulse { 50% { opacity: .5; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-up { from { transform: translateY(32px); } }
@keyframes side-in { from { transform: translateX(32px); } }

/* Desktop side sheet for details and a menu anchored under "새로 만들기". */
@media (min-width: 900px) {
  dialog.create-dialog { position: fixed; inset: 128px auto auto 16px; width: 300px; margin: 0; }
  dialog.create-dialog::backdrop { background: transparent; }
  dialog.details-dialog { position: fixed; inset: 0 0 0 auto; width: min(420px, 92vw); height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog.details-dialog[open] { animation: side-in .2s cubic-bezier(.2, .8, .2, 1); }
}

@media (max-width: 1279px) and (min-width: 900px) {
  :root { --sidebar-w: 232px; }
  main#workspace { padding-left: 24px; padding-right: 24px; }
  .file-table .date-column { width: 112px; }
  .file-table .size-column { width: 88px; }
}

/* Mobile and small tablets */
@media (max-width: 899px) {
  body { font-size: 1rem; }
  .app-shell, .app-shell.with-details { display: block; }
  .details-panel { display: none !important; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); height: 100dvh; padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-100%); visibility: hidden; transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .22s; box-shadow: var(--shadow-lg); z-index: 90; }
  .sidebar.open { transform: none; visibility: visible; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
  .drawer-close { display: inline-flex; }
  .create-button { display: none; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 85; background: var(--scrim); }
  .topbar { gap: 10px; height: 60px; padding: 0 12px 0 16px; padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .topbar-brand { display: inline-flex; }
  .search-field { max-width: none; }
  .search-field input { font-size: 1rem; }
  .search-field kbd { display: none; }
  main#workspace { padding: 12px 16px calc(var(--bottom-h) + 32px + env(safe-area-inset-bottom)); }
  .location-row h1 { font-size: 1.375rem; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .type-filters { margin: -2px -16px; padding: 2px 16px; scroll-padding-inline: 16px; }
  .chip { min-height: 40px; }
  .view-controls { justify-content: space-between; }
  .sort-select select { min-height: 40px; font-size: .9375rem; }
  .view-switch .icon-button { width: 40px; height: 34px; }
  .file-table { table-layout: auto; }
  .file-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .file-table td.name-cell { width: 100%; max-width: 0; }
  .file-table td.actions-cell { width: 52px; }
  .file-table .date-column, .file-table .date-cell, .file-table .size-column, .file-table .size-cell { display: none; }
  .file-table .check-column, .file-table .check-cell { width: 44px; padding: 0; }
  .file-table .actions-column { width: 52px; }
  .file-table td { height: 64px; padding: 4px 6px; }
  .file-table td:nth-child(2) { padding-left: 2px; }
  .check { width: 44px; height: 56px; }
  .file-name-text small { display: block; }
  .file-name-text strong { font-size: 1rem; }
  .file-glyph { width: 40px; height: 40px; }
  .desktop-only { display: none !important; }
  .row-actions .icon-button { width: 44px; height: 44px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .list-footer { flex-wrap: wrap; }
  .selection-bar { top: calc(60px + env(safe-area-inset-top) + 8px); padding-left: 14px; }
  .selection-actions .button.small { min-height: 44px; }
  .selection-actions .icon-button.small { width: 44px; height: 44px; }
  .toast-stack { left: 16px; right: 16px; bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); align-items: center; max-width: none; }

  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .bottom-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; min-height: 56px; color: var(--muted); font-size: .75rem; font-weight: 600; }
  .bottom-item[aria-current], .bottom-item.active { color: var(--accent-ink); }
  .bottom-item svg.icon { width: 22px; height: 22px; }
  .bottom-icon { position: relative; display: inline-flex; }
  .bottom-icon .count-pill { position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; font-size: .6875rem; }
  .bottom-create { justify-self: center; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
  .bottom-create svg.icon { width: 26px; height: 26px; stroke-width: 2; }

  dialog.sheet { width: 100%; max-width: 100%; max-height: 90dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.sheet[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1); }
  dialog.sheet::before { content: ""; display: block; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: var(--line-strong); }
  dialog.create-dialog { padding: 0 8px 8px; }
  .create-dialog .menu-list { padding-top: 8px; }
  .details-dialog .details { padding-top: 8px; }
  .dialog-actions .button { flex: 1; min-height: 48px; }
  .dialog-footer { flex-wrap: wrap; }
  .drag-overlay { inset: 8px; }
}

@media (max-width: 380px) {
  .type-filters .chip { padding: 0 12px; }
  .detail-primary { grid-template-columns: 1fr; }
}

@media (pointer: coarse) {
  .icon-button { width: 44px; height: 44px; }
  .icon-button.small { width: 44px; height: 44px; }
  .button.small { min-height: 44px; }
  .chip { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; opacity: .7; }
}

@media (forced-colors: active) {
  .button.primary, .bottom-create, .brand-mark, .count-pill { border: 1px solid ButtonText; }
  .file-table tbody tr.selected, .file-card.selected { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* Sign-in page */
.login-page { background: var(--bg); }
.login { display: grid; place-items: center; gap: 24px; min-height: 100dvh; padding: 32px 16px calc(24px + env(safe-area-inset-bottom)); }
.login-card { width: min(100%, 420px); padding: 32px 28px 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; }
.login-subtitle { margin-top: 8px; color: var(--muted); font-size: .9375rem; line-height: 1.6; overflow-wrap: anywhere; }
.login-card form { margin-top: 24px; }
.registration-note { margin-top: 8px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.login-submit { width: 100%; min-height: 48px; margin-top: 20px; font-size: 1rem; }
.login-card .registration-code { font-size: 1.375rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; }
.registration-restart { display: flex; margin: 8px auto 0; }
.login-error { margin: 16px 0 0; }
.registration-install { display: flex; margin: 16px auto 0; }
.login-footer { color: var(--muted); font-size: .8125rem; }
@media (max-width: 480px) {
  .login { place-items: start center; padding-top: max(40px, env(safe-area-inset-top)); }
  .login-card { padding: 28px 20px 24px; border: 0; background: none; box-shadow: none; }
}
