/* AI 드라이브 (/drive) */
.drive { max-width: 1280px; }
.drive-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.drive-head-actions { display: flex; gap: 8px; }
.drive-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }
.drive-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.drive-nav { display: flex; flex-direction: column; gap: 2px; }
.drive-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.drive-nav a:hover { background: var(--surface-2); color: var(--text); }
.drive-nav a.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.drive-storage { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.drive-storage-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-2); }
.drive-storage-label svg.lucide { width: 15px; height: 15px; }
.drive-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.drive-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.drive-bar span.is-full { background: var(--danger); }

.drive-main { position: relative; min-height: 420px; }
.drive-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.drive-crumbs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 180px; font-size: 16px; flex-wrap: wrap; }
.drive-crumbs a { color: var(--text-2); padding: 2px 6px; border-radius: 8px; }
.drive-crumbs a:hover { background: var(--surface-2); color: var(--text); }
.drive-crumbs b { padding: 2px 6px; }
.drive-crumbs svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.drive-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drive-tools select { width: auto; height: 38px; font-size: 13px; }
.drive-search { height: 38px; max-width: 240px; }
.drive-search input { height: 34px; }

.drive-selbar, .drive-trashbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px 8px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.drive-selbar [data-sel-actions] { display: flex; gap: 6px; flex-wrap: wrap; }
.drive-trashbar { background: var(--surface-2); border-color: var(--border); justify-content: space-between; }
.drive-trashbar .muted { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.drive-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.drive-group { font-size: 13px; color: var(--muted); font-weight: 600; margin: 4px 0 10px; }
.drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.drive-grid.is-folders { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.drive-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s; outline: none; }
.drive-card:hover, .drive-card:focus-visible { border-color: var(--border-2); box-shadow: var(--shadow); }
.drive-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100); }
.drive-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.drive-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drive-ai { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; }
.drive-card-foot { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 12px; }
.drive-card.is-folder .drive-card-foot { padding: 12px 6px 12px 12px; }
.drive-card-text { flex: 1; min-width: 0; }
.drive-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-check { position: absolute; top: 8px; left: 8px; z-index: 2; width: 24px; height: 24px; border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.drive-card.is-folder .drive-check { top: 50%; transform: translateY(-50%); left: auto; right: 44px; box-shadow: none; }
.drive-card:hover .drive-check, .drive-card.is-selected .drive-check, .drive-list:has(.is-selected) .drive-check { opacity: 1; }
.drive-check input, .drive-row input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.drive-star { position: absolute; top: 8px; right: 8px; z-index: 2; color: #E8A317; display: flex; }
.drive-card.is-folder .drive-star { display: none; }
.drive-star svg.lucide { width: 18px; height: 18px; fill: #F5C542; }
.drive-star-inline { width: 14px !important; height: 14px !important; color: #E8A317; fill: #F5C542; flex: none; }

.drive-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface); color: var(--muted); }
.drive-ico svg.lucide { width: 28px; height: 28px; }
.drive-ico-sm { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--muted); flex: none; }
.drive-ico-sm svg.lucide { width: 16px; height: 16px; }
.c-folder { color: #D99A1E; }
.drive-ico-sm.c-folder { background: #FFF5DF; }
.c-image { color: #3B7BE8; }
.c-doc { color: var(--brand); }
.c-media { color: #8B5CF6; }
.c-other { color: var(--muted); }

.drive-list.is-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.drive-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 90px 110px 44px; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); cursor: pointer; outline: none; }
.drive-row:last-child { border-bottom: 0; }
.drive-row:hover, .drive-row:focus-visible { background: var(--surface-2); }
.drive-row.is-selected { background: var(--brand-50); }
.drive-row-head { cursor: default; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.drive-row-head:hover { background: var(--surface-2); }
.drive-row .c-check { display: flex; justify-content: center; }
.drive-row .c-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drive-row .c-name .badge { flex: none; }
.drive-row .c-size, .drive-row .c-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.drive-row .c-act { display: flex; justify-content: flex-end; }

.drive-main.is-dragover, .drive.is-dragover .drive-main { outline: 2px dashed var(--brand); outline-offset: 6px; border-radius: var(--radius); }
.drive-drop-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--brand-50) 88%, transparent); border-radius: var(--radius); color: var(--brand-700); z-index: 5; pointer-events: none; }
.drive-drop-hint svg.lucide { width: 40px; height: 40px; }

.drive-uploads { position: fixed; right: 18px; bottom: 18px; width: 340px; max-width: calc(100vw - 36px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.drive-up-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
.drive-up-list { max-height: 260px; overflow: auto; }
.drive-up { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.drive-up:last-child { border-bottom: 0; }
.drive-up small { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-up-ico { display: inline-flex; color: var(--brand); }
.drive-up-ico svg.lucide { width: 16px; height: 16px; animation: drive-spin 1s linear infinite; }
.drive-up.is-done .drive-up-ico, .drive-up.is-error .drive-up-ico { color: var(--ok); }
.drive-up.is-error .drive-up-ico { color: var(--danger); }
.drive-up.is-done .drive-up-ico svg.lucide, .drive-up.is-error .drive-up-ico svg.lucide { animation: none; }
@keyframes drive-spin { to { transform: rotate(360deg); } }

.drive-menu { position: absolute; z-index: 95; min-width: 190px; }
.drive-picker { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.drive-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px calc(10px + var(--d, 0) * 18px); border: 0; background: none; border-radius: 9px; text-align: left; cursor: pointer; color: var(--text); }
.drive-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-pick:hover { background: var(--surface-2); }
.drive-pick.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.drive-pick:disabled { opacity: .4; cursor: not-allowed; }

.drive-preview { display: flex; align-items: center; justify-content: center; min-height: 200px; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.drive-pv-img { max-width: 100%; max-height: 70vh; display: block; }
.drive-pv-media { width: 100%; max-height: 70vh; background: #000; display: block; }
.drive-pv-audio { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 20px; width: 100%; }
.drive-pv-audio svg.lucide { width: 44px; height: 44px; color: #8B5CF6; }
.drive-pv-audio audio { width: 100%; max-width: 520px; }
.drive-pv-frame { width: 100%; height: 70vh; border: 0; background: #fff; display: block; }
.drive-pv-text { width: 100%; max-height: 70vh; overflow: auto; padding: 16px 18px; background: var(--surface); align-self: stretch; }
.drive-pv-text pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.drive-pv-meta { margin-top: 10px; }
.drive-pv-meta a { color: var(--info); }
.drive-ask-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.drive-ask-input { width: 100%; }

@media (max-width: 860px) {
  .drive-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .drive-side { position: static; min-width: 0; }
  .drive-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .drive-nav a { white-space: nowrap; padding: 7px 10px; font-size: 14px; }
  .drive-storage { padding: 10px; }
  .drive-search { max-width: none; flex: 1; }
  .drive-tools { width: 100%; }
  .drive-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .drive-row { grid-template-columns: 30px minmax(0, 1fr) 70px 40px; }
  .drive-row .c-date { display: none; }
  .drive-check { opacity: 1; }
  .drive-head-actions .btn span { display: none; }
}
