:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: #0f1219;
  --panel-2: #151922;
  --line: #252a36;
  --muted: #8e96a8;
  --text: #f4f6fb;
  --accent: #6f7cff;
  --accent-soft: rgba(111, 124, 255, .14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
body { overflow: hidden; }
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; background: #0a0d13; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; padding: 0 8px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #3b4256; border-radius: 9px; font-size: 12px; letter-spacing: -.5px; }
.new-button { height: 42px; border: 1px solid #343a49; background: var(--panel-2); border-radius: 10px; text-align: left; padding: 0 14px; cursor: pointer; }
.new-button:hover { border-color: #4a5267; background: #1a1f29; }
.nav-list { display: grid; gap: 4px; }
.nav-item { border: 0; background: transparent; color: #a8afbd; border-radius: 8px; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 11px; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-item.active { background: #171b24; color: var(--text); }
.nav-item.active { box-shadow: inset 2px 0 0 var(--accent); }
.nav-item span { width: 18px; color: #7f8798; }
.storage-card { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 8px 0; }
.storage-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #b8bfcc; }
.storage-bar { height: 4px; margin-top: 10px; border-radius: 999px; background: #242935; overflow: hidden; }
.storage-bar span { display: block; height: 100%; background: #7a85ff; }
.storage-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.main { min-width: 0; min-height: 100vh; overflow: auto; }
.topbar { height: 72px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; gap: 20px; position: sticky; top: 0; background: rgba(8, 10, 15, .92); backdrop-filter: blur(16px); z-index: 4; }
.mobile-brand { display: none; font-weight: 700; }
.search { width: min(560px, 55vw); margin: 0 auto 0 0; display: flex; align-items: center; gap: 8px; height: 40px; border: 1px solid var(--line); background: #0d1016; border-radius: 10px; padding: 0 12px; color: #70798c; }
.search:focus-within { border-color: #4b5570; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.top-actions { display: flex; gap: 8px; }
.icon-button, .avatar { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; cursor: pointer; }
.avatar { border-radius: 50%; background: #23283a; }
.avatar:disabled { opacity: .6; cursor: default; }
.content { padding: 30px 32px 80px; max-width: 1420px; margin: 0 auto; }
.content-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.content h1 { font-size: clamp(24px, 3vw, 32px); margin: 8px 0 0; letter-spacing: -.04em; }
.breadcrumb { display: flex; gap: 6px; color: var(--muted); font-size: 12px; max-width: min(70vw, 760px); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.breadcrumb button { padding: 0; background: none; border: 0; color: inherit; cursor: pointer; }
.breadcrumb button:hover { color: #d8dce7; }
.breadcrumb .current { color: #c7ccd8; }
.view-actions { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.segmented { width: 38px; height: 34px; border: 0; background: var(--panel); color: #858da0; cursor: pointer; }
.segmented + .segmented { border-left: 1px solid var(--line); }
.segmented.active { background: #1b202a; color: #fff; }
.trash-empty-button { border: 0; border-left: 1px solid var(--line); background: #171b24; color: #ffb0b0; padding: 0 12px; font-size: 11px; cursor: pointer; }
.trash-empty-button:hover { background: #21171b; }
.provider-strip { display: flex; gap: 8px; margin: 26px 0 16px; overflow-x: auto; scrollbar-width: none; }
.provider-chip { white-space: nowrap; border: 1px solid var(--line); background: transparent; color: #a7afbe; border-radius: 999px; padding: 7px 11px; cursor: pointer; font-size: 12px; }
.provider-chip.active { color: #fff; background: var(--accent-soft); border-color: rgba(111, 124, 255, .45); }
.provider-chip b { margin-left: 5px; font-size: 10px; font-weight: 500; color: #7d8596; }
.provider-chip.disabled { opacity: .55; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0e14; }
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table th { height: 42px; text-align: left; color: #727b8e; font-size: 11px; font-weight: 600; padding: 0 16px; border-bottom: 1px solid var(--line); }
.file-table th:first-child { width: 47%; }
.file-table th:nth-child(2) { width: 18%; }
.file-table th:nth-child(3) { width: 18%; }
.file-table th:nth-child(4) { width: 12%; }
.file-table th:last-child { width: 5%; }
.file-row { border-bottom: 1px solid #1c2029; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #11151c; }
.file-row:focus { outline: 1px solid #4c5876; outline-offset: -1px; background: #11151c; }
.file-row td { padding: 12px 16px; font-size: 13px; color: #aeb5c2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name { display: flex; align-items: center; gap: 11px; color: #eef0f6 !important; font-weight: 520; }
.file-icon { width: 30px; height: 30px; border: 1px solid #2b3140; border-radius: 7px; display: grid; place-items: center; color: #8d96aa; font-size: 12px; flex: 0 0 auto; }
.provider-badge { display: inline-flex; align-items: center; gap: 6px; }
.provider-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7289da; }
.provider-badge.google::before { background: #8e96a8; }
.row-action { min-width: 44px; min-height: 44px; border: 0; background: transparent; cursor: pointer; color: #767f91; font-size: 18px; display: inline-grid; place-items: center; border-radius: 8px; }
.row-action:hover { background: #1a1f29; color: #c4cad6; }
.row-menu { width: 188px; left: auto; top: auto; z-index: 30; }
.row-menu button.danger { color: #ffb0b0; }
.row-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.file-grid { padding: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.file-grid:not([hidden]) { display: grid; }
.file-card { min-width: 0; min-height: 132px; border: 1px solid var(--line); border-radius: 11px; background: #0e1219; padding: 14px; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; cursor: default; }
.file-card:hover, .file-card:focus { border-color: #384155; background: #121720; outline: 0; }
.file-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.file-card-icon { width: 38px; height: 38px; border: 1px solid #2b3140; border-radius: 9px; display: grid; place-items: center; color: #8d96aa; font-size: 11px; }
.file-card-name { min-width: 0; color: #eef0f6; font-size: 13px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: end; }
.file-card-meta { display: flex; justify-content: space-between; gap: 8px; color: #7f8797; font-size: 10px; }
.empty-state { padding: 70px 20px; display: grid; place-items: center; gap: 8px; color: var(--muted); }
.empty-state strong { color: #e9ecf4; }
.dropzone { border: 1px dashed #536078; background: rgba(83, 96, 120, .08); border-radius: 12px; padding: 28px; margin: 16px 0; text-align: center; }
.dropzone strong, .dropzone span { display: block; }
.dropzone span { color: var(--muted); font-size: 12px; margin-top: 5px; }
.menu { position: fixed; left: 16px; top: 88px; width: 220px; background: #151922; border: 1px solid #303644; border-radius: 10px; padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.45); z-index: 10; }
.menu button { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px; border-radius: 7px; cursor: pointer; }
.menu button:hover { background: #202530; }
dialog { border: 0; padding: 0; background: transparent; color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
.dialog-card { width: min(520px, calc(100vw - 28px)); padding: 22px; background: #11151c; border: 1px solid #303644; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.dialog-head small { color: #697286; letter-spacing: .13em; font-size: 9px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 22px; }
.provider-option { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 8px; }
.provider-option.selected { border-color: #4a5269; }
.provider-option.muted { opacity: .62; }
.provider-logo { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; background: #262c3b; }
.provider-logo.discord { color: #aebcff; }
.provider-logo.google { color: #d0d3da; }
.provider-option strong { font-size: 13px; }
.provider-option p { color: var(--muted); margin: 3px 0 0; font-size: 11px; }
.status-dot { color: #8f98aa; font-size: 10px; }
.provider-control { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.provider-connect { border: 1px solid #343b4b; background: #1a1f29; color: #e9ecf4; border-radius: 7px; padding: 6px 9px; cursor: pointer; font-size: 10px; white-space: nowrap; }
.provider-connect:hover { border-color: #4a5267; background: #202632; }
.provider-connect:disabled { opacity: .55; cursor: default; }
.status-dot.connected { color: #b9c1ff; }
.status-dot.error { color: #ffb0b0; }
.dialog-note { color: #858e9f; line-height: 1.6; font-size: 11px; margin: 16px 2px 0; }
.compact-dialog { width: min(430px, calc(100vw - 28px)); }
.field { display: grid; gap: 7px; margin-top: 12px; color: #9da5b6; font-size: 11px; }
.field input, .field select { width: 100%; border: 1px solid #303644; background: #0d1118; color: #eef1f7; border-radius: 8px; padding: 10px 11px; outline: 0; }
.field input:focus, .field select:focus { border-color: #58617a; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.primary-action { border: 1px solid #5c68db; background: #6672ee; color: #fff; border-radius: 7px; padding: 7px 12px; cursor: pointer; font-size: 11px; }
.primary-action:hover { background: #7380ff; }
.toast { position: fixed; right: 24px; bottom: 24px; min-width: 240px; max-width: 360px; background: #1b2029; border: 1px solid #343b4b; border-radius: 10px; padding: 12px 14px; color: #e9ebf1; font-size: 12px; transform: translateY(18px); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 20; }
.toast.show { transform: translateY(0); opacity: 1; }
.operation-status { position: fixed; right: 24px; bottom: 78px; width: min(360px, calc(100vw - 32px)); padding: 12px 14px; background: #11161e; border: 1px solid #343b4b; border-radius: 10px; box-shadow: 0 14px 45px rgba(0,0,0,.35); z-index: 21; }
.operation-status-head { display: flex; justify-content: space-between; gap: 12px; color: #cbd0dc; font-size: 11px; }
.operation-status-side { display: flex; align-items: center; gap: 8px; }
.operation-status-side button { border: 0; background: transparent; color: #ffb0b0; padding: 0; cursor: pointer; font-size: 10px; }
.operation-status-side button:disabled { opacity: .55; cursor: default; }
.operation-progress { height: 4px; margin-top: 9px; background: #252b37; border-radius: 999px; overflow: hidden; }
.operation-progress span { display: block; height: 100%; width: 0; background: #7a85ff; transition: width .15s ease; }
.mobile-bottom-nav { display: none; }
@media (max-width: 820px) {
  body { overflow: auto; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { min-height: 100vh; }
  .topbar { height: auto; min-height: 68px; padding: 12px 16px; flex-wrap: wrap; }
  .mobile-brand { display: block; margin-right: auto; }
  .search { order: 2; width: 100%; margin: 0; }
  .content { padding: 24px 16px 90px; }
  .file-table th:nth-child(2), .file-table td:nth-child(2), .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
  .file-table th:first-child { width: 68%; }
  .file-table th:nth-child(4) { width: 24%; }
  .file-table th:last-child { width: 8%; }
  .menu { left: 16px; top: 70px; }
  .view-actions { margin-left: auto; }
  .trash-empty-button { padding: 0 9px; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 9px; }
  .file-card { min-height: 118px; padding: 11px; }
  .mobile-bottom-nav { position: fixed; display: grid; grid-template-columns: repeat(2, 1fr) 58px repeat(2, 1fr); align-items: end; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 64px; padding: 6px 9px; background: rgba(15,18,25,.96); border: 1px solid #2b3140; border-radius: 17px; backdrop-filter: blur(18px); z-index: 12; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
  .mobile-nav-item { border: 0; background: transparent; color: #828b9d; height: 48px; border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; }
  .mobile-nav-item span { font-size: 16px; line-height: 1; }
  .mobile-nav-item small { font-size: 9px; }
  .mobile-nav-item.active { color: #eef1f7; background: #1b202a; }
  .mobile-new-button { width: 50px; height: 50px; align-self: start; justify-self: center; margin-top: -13px; border-radius: 15px; border: 1px solid #5662d2; background: #6672ee; color: #fff; font-size: 24px; cursor: pointer; box-shadow: 0 8px 24px rgba(60,72,180,.3); }
  .operation-status { left: 16px; right: 16px; bottom: 88px; width: auto; }
}
@media (max-width: 430px) {
  .file-grid { grid-template-columns: 1fr; }
  .content-head { align-items: center; }
  .view-actions .segmented { width: 34px; }
}
