:root {
  --bg: #0e0f13;
  --bg-2: #14161c;
  --panel: #181a21;
  --panel-2: #1f222b;
  --line: #2a2e39;
  --line-2: #353a47;
  --text: #e9ebf1;
  --muted: #9aa1b2;
  --faint: #6b7183;
  --accent: #5865f2;
  --accent-2: #7984ff;
  --accent-soft: rgba(88, 101, 242, .14);
  --ok: #3ba55d;
  --warn: #faa61a;
  --danger: #ed4245;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: "Inter", "Pretendard", system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #262a35; border-color: #444a5a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4752c4; }
.btn.danger { background: transparent; border-color: rgba(237,66,69,.5); color: #ff6b6e; }
.btn.danger:hover { background: rgba(237,66,69,.12); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 30px; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; height: 46px; padding: 0 22px; font-weight: 600; font-size: 15px; }
.input, select.input, textarea.input { height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); outline: none; width: 100%; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 22px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #5865f2, #8b5cf6); display: grid; place-items: center; }
.brand .logo svg { width: 18px; height: 18px; stroke: #fff; }
.new-btn { margin: 0 4px 14px; height: 42px; justify-content: center; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: #fff; }
.nav a.active svg { stroke: var(--accent-2); }
.nav .sect { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 10px 6px; font-weight: 600; }
.nav a img { width: 20px; height: 20px; border-radius: 6px; }
.nav a .gi { width: 20px; height: 20px; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.nav a .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-storage { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); }
.side-storage .bar { margin: 8px 0 6px; }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); flex: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search svg { position: absolute; left: 12px; top: 9px; color: var(--faint); }
.search input { padding-left: 38px; background: var(--panel); border-color: var(--line); height: 38px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 30px; cursor: pointer; border: 1px solid transparent; background: none; }
.user-chip:hover { background: var(--panel); border-color: var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); object-fit: cover; flex: none; }
.avatar.sm { width: 24px; height: 24px; }
.content { flex: 1; overflow-y: auto; padding: 24px 28px 60px; position: relative; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.page-sub { color: var(--muted); margin: 0 0 22px; }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-toggle { display: inline-flex; }
  .content { padding: 18px 14px 60px; }
  .topbar { padding: 0 12px; }
  .user-chip .name { display: none; }
}

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h3 .spacer + * { font-weight: 400; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .hint { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.bar { height: 8px; background: var(--panel-2); border-radius: 8px; overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #8b5cf6); border-radius: 8px; transition: width .3s; }
.bar.warn > div { background: var(--warn); }
.bar.full > div { background: var(--danger); }
.section { margin-top: 22px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: none; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; stroke: var(--faint); margin-bottom: 8px; }
.empty .t { font-weight: 600; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.banner { background: var(--accent-soft); border: 1px solid rgba(88,101,242,.4); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; white-space: pre-wrap; }
.banner.warn { background: rgba(250,166,26,.1); border-color: rgba(250,166,26,.4); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); }
.badge.ok { color: #6fdc8c; border-color: rgba(59,165,93,.4); background: rgba(59,165,93,.1); }
.badge.warn { color: #ffc35a; border-color: rgba(250,166,26,.4); background: rgba(250,166,26,.1); }
.badge.danger { color: #ff7b7d; border-color: rgba(237,66,69,.4); background: rgba(237,66,69,.1); }
.badge.accent { color: #aab1ff; border-color: rgba(88,101,242,.45); background: var(--accent-soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- drive ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 700; flex-wrap: wrap; min-width: 0; letter-spacing: -.01em; }
.crumbs a { color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.crumbs a:last-child { color: var(--text); }
.crumbs .sep { color: var(--faint); font-weight: 400; }
.selbar { position: sticky; top: -24px; z-index: 5; display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 8px; margin-bottom: 12px; box-shadow: var(--shadow); flex-wrap: wrap; }
.files-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.frow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 130px 150px 40px; align-items: center; padding: 0 10px; height: 48px; border-bottom: 1px solid var(--line); cursor: default; user-select: none; }
.frow:last-child { border-bottom: none; }
.frow:hover { background: #1c1f27; }
.frow.sel { background: var(--accent-soft); }
.frow.head { height: 38px; background: var(--bg-2); color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; cursor: default; }
.frow.head:hover { background: var(--bg-2); }
.frow.head span[data-sort] { cursor: pointer; }
.frow .nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
.frow .nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .sz, .frow .dt { color: var(--muted); font-size: 13px; }
.frow.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
@media (max-width: 760px) { .frow { grid-template-columns: 32px minmax(0,1fr) 40px; } .frow .sz, .frow .dt { display: none; } }
.ftype { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--panel-2); }
.ftype svg { width: 17px; height: 17px; }
.ftype.folder { background: rgba(88,101,242,.16); color: var(--accent-2); }
.ftype.image { background: rgba(59,165,93,.14); color: #6fdc8c; }
.ftype.video { background: rgba(237,66,69,.14); color: #ff7b7d; }
.ftype.audio { background: rgba(235,69,158,.14); color: #f47fc1; }
.ftype.doc { background: rgba(250,166,26,.14); color: #ffc35a; }
.ftype.archive { background: rgba(139,92,246,.16); color: #b69cff; }
.ftype.code { background: rgba(32,201,201,.14); color: #5fe0e0; }
.ftile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ftile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: default; user-select: none; position: relative; }
.ftile:hover { border-color: var(--line-2); background: #1c1f27; }
.ftile.sel { border-color: var(--accent); background: var(--accent-soft); }
.ftile .thumb { height: 110px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; margin-bottom: 10px; }
.ftile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ftile .thumb .ftype { width: 52px; height: 52px; border-radius: 14px; }
.ftile .thumb .ftype svg { width: 26px; height: 26px; }
.ftile .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftile .s { font-size: 12px; color: var(--faint); }
.ftile .cb { position: absolute; top: 14px; left: 14px; }
.tag-st { display: inline-flex; width: 14px; height: 14px; color: var(--warn); }
.tag-st svg { width: 14px; height: 14px; fill: var(--warn); stroke: var(--warn); }
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); transition: .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drag-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(14,15,19,.82); display: grid; place-items: center; pointer-events: none; }
.drag-overlay div { border: 2px dashed var(--accent); border-radius: 20px; padding: 50px 70px; font-size: 18px; font-weight: 600; background: var(--accent-soft); }

/* ---------- menus, modals, toasts ---------- */
.menu { position: fixed; z-index: 80; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 5px; min-width: 210px; box-shadow: var(--shadow); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: none; border-radius: 7px; cursor: pointer; text-align: left; }
.menu button:hover { background: #2b2f3b; }
.menu button.danger { color: #ff7b7d; }
.menu hr { border: none; border-top: 1px solid var(--line-2); margin: 5px 2px; }
.menu .colors { display: flex; gap: 6px; padding: 6px 10px; flex-wrap: wrap; }
.menu .colors i { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.menu .colors i:hover { border-color: #fff; }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 760px; }
.modal.preview { max-width: min(1200px, 96vw); height: calc(100vh - 40px); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .body { padding: 18px; overflow-y: auto; flex: 1; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.preview-stage { flex: 1; display: grid; place-items: center; background: #0a0b0e; overflow: auto; min-height: 0; }
.preview-stage img, .preview-stage video { max-width: 100%; max-height: 100%; }
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-stage pre { align-self: stretch; justify-self: stretch; margin: 0; padding: 18px; white-space: pre-wrap; word-break: break-word; font: 13px/1.6 var(--mono); color: #d7dae3; overflow: auto; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); max-width: 380px; animation: tin .18s ease-out; }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.uploads { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 360px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.uploads header { display: flex; align-items: center; padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line-2); gap: 8px; }
.uploads .items { max-height: 260px; overflow-y: auto; }
.uploads .it { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.uploads .it .row { font-size: 13px; }
.uploads .it .bar { height: 5px; margin-top: 6px; }
.tree { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--bg-2); }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.tree .node:hover { background: var(--panel); }
.tree .node.sel { background: var(--accent-soft); color: #fff; }
.tree .node.dis { opacity: .4; pointer-events: none; }
.copy-box { display: flex; gap: 8px; }
.copy-box input { font-family: var(--mono); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 200px; }
.type-bars .tb { margin-bottom: 12px; }
.type-bars .tb .row { font-size: 13px; margin-bottom: 5px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px; }
.chart > div { flex: 1; max-width: 36px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; position: relative; }
.chart > div:hover { opacity: 1; }

/* ---------- landing / login ---------- */
.landing { min-height: 100vh; background: radial-gradient(1200px 600px at 70% -10%, rgba(88,101,242,.22), transparent 60%), radial-gradient(800px 500px at 0% 100%, rgba(139,92,246,.12), transparent 60%), var(--bg); }
.landing nav { display: flex; align-items: center; padding: 22px 40px; max-width: 1200px; margin: 0 auto; }
.hero { max-width: 1200px; margin: 0 auto; padding: 70px 40px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.hero h1 { font-size: 52px; line-height: 1.08; letter-spacing: -.035em; margin: 0 0 18px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #7984ff, #b69cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17px; color: var(--muted); margin: 0 0 30px; max-width: 520px; }
.hero-visual { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.features { max-width: 1200px; margin: 0 auto; padding: 40px 40px 80px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: rgba(24,26,33,.7); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.feature .fi { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; margin-bottom: 14px; }
.feature h4 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 40px 20px; } .hero h1 { font-size: 38px; } .features { grid-template-columns: 1fr; padding: 20px; } .landing nav { padding: 18px 20px; } }
.login-card { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login-card .card { padding: 34px 30px; }
.plan-card { display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card .q { font-size: 30px; font-weight: 700; margin: 8px 0 14px; letter-spacing: -.02em; }
.plan-card ul { padding-left: 18px; margin: 0 0 16px; color: var(--muted); }
.plan-card ul li { margin-bottom: 6px; }

/* ---------- public share page ---------- */
.share-page { max-width: 980px; margin: 0 auto; padding: 30px 20px 60px; }
.share-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.share-preview { background: #0a0b0e; border: 1px solid var(--line); border-radius: var(--radius); min-height: 300px; display: grid; place-items: center; overflow: hidden; margin-bottom: 16px; }
.share-preview img, .share-preview video { max-width: 100%; max-height: 72vh; }
.share-preview iframe { width: 100%; height: 72vh; border: 0; background: #fff; }
.share-preview pre { justify-self: stretch; align-self: stretch; margin: 0; padding: 18px; white-space: pre-wrap; font: 13px/1.6 var(--mono); max-height: 72vh; overflow: auto; }
