:root {
  color-scheme: light;
  --bg: #fff; --subtle: #f6f8fa; --text: #1f2328; --muted: #636c76;
  --border: #d1d9e0; --soft: #e8ecf0; --link: #0969da; --accent: #fd8c73;
  --danger: #cf222e; --success: #1a7f37; --selection: #ddf4ff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117; --subtle: #151b23; --text: #f0f6fc; --muted: #9198a1;
  --border: #3d444d; --soft: #262c36; --link: #4493f8;
  --danger: #ff7b72; --success: #3fb950; --selection: #112c45;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
::selection { background: var(--selection); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.icon { width: 16px; height: 16px; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
input, select { width: 100%; min-width: 0; min-height: 34px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; }
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus { outline: 2px solid var(--link); outline-offset: -1px; }
label { display: block; margin: 16px 0 6px; font-weight: 500; font-size: 13px; }
.button, .small-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--subtle); color: var(--text); padding: 5px 13px; min-height: 34px; font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: 0 1px 0 #1f23280a; }
.button:hover:not(:disabled), .small-button:hover:not(:disabled) { background: var(--soft); }
.primary { font-weight: 600; }
.danger, .danger-text { color: var(--danger); }
.danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.text-button { display: inline-flex; align-items: center; gap: 6px; background: none; padding: 0; border: 0; color: var(--muted); font-size: 13px; }
.text-button:hover { color: var(--link); }
.icon-button, .theme { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid transparent; padding: 0; border-radius: 6px; color: var(--muted); background: transparent; }
.icon-button:hover, .theme:hover { background: var(--soft); color: var(--text); text-decoration: none; }
.icon-button.danger-quiet:hover { color: var(--danger); }
.theme, .refresh-button { border-color: var(--border); }
.theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: block; }
.topbar { background: var(--subtle); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1280px; margin: auto; padding: 18px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.identity { display: flex; align-items: center; gap: 13px; color: var(--text); white-space: nowrap; }
.identity:hover { text-decoration: none; }
.mark { display: block; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--border); background: #fff; }
.identity-name { font-size: 15px; font-weight: 600; }
.slash { color: var(--muted); padding: 0 10px; font-weight: 400; }
.identity-page { font-size: 14px; color: var(--muted); font-weight: 400; }
.header-actions, .account-actions { display: flex; align-items: center; gap: 18px; }
.connection-status { border-top: 1px solid var(--soft); font-size: 12px; }
.connection-inner { max-width: 1280px; margin: auto; padding: 7px 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.connection-inner > span { color: var(--muted); }
.connection-inner > span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--success); vertical-align: 1px; }
.download-screen { width: min(440px, calc(100% - 40px)); margin: 80px auto; text-align: center; }
.download-screen h1 { font-size: 22px; font-weight: 500; }
.download-screen p { margin: 14px 0 22px; color: var(--muted); }
.download-fallback { display: block; margin-top: 18px; font-size: 13px; }
.loading-screen { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--muted); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-screen { width: min(340px, calc(100% - 40px)); margin: 80px auto; }
.login-screen h1 { text-align: center; font-size: 22px; font-weight: 500; margin-bottom: 22px; }
.login-card { padding: 20px; border: 1px solid var(--border); border-radius: 7px; background: var(--subtle); }
.login-card label { margin-top: 0; }
.login-card input { height: 36px; }
.login-submit { width: 100%; margin-top: 20px; }
.form-error { color: var(--danger); margin-top: 12px; font-size: 13px; overflow-wrap: anywhere; }
.workspace { width: 100%; max-width: 1216px; margin: 0 auto; padding: 30px 32px; }
.main-nav { display: flex; gap: 5px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.nav-button { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 14px 15px; color: var(--text); border: 0; background: transparent; white-space: nowrap; font-size: 13px; }
.nav-button .icon { color: var(--muted); }
.nav-button:hover { background: var(--subtle); }
.nav-button.active { font-weight: 600; }
.nav-button.active::after { content: ""; position: absolute; bottom: -1px; left: 7px; right: 7px; height: 3px; background: var(--accent); border-radius: 2px 2px 0 0; }
.nav-count, .count-pill { border-radius: 20px; background: var(--soft); color: var(--muted); padding: 0 7px; font-size: 12px; font-weight: 400; }
.files-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.search-field { display: flex; position: relative; width: 300px; max-width: 100%; margin: 0; }
.search-field .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 33px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.refreshing .icon { animation: spin .8s linear infinite; }
.files-panel { position: relative; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.files-panel.drag-over { outline: 2px solid var(--link); outline-offset: 3px; }
.files-panel.drag-over::after { content: "Drop to upload"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--link); background: var(--bg); opacity: .94; font-size: 18px; font-weight: 500; pointer-events: none; }
.files-error { padding: 10px 16px; color: var(--danger); border-bottom: 1px solid var(--border); font-size: 13px; }
.table-scroll { overflow-x: auto; }
.files-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
.files-table th { padding: 10px 16px; background: var(--subtle); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--muted); }
.files-table th:nth-child(2) { width: 100px; }
.files-table th:nth-child(3) { width: 130px; }
.files-table th:nth-child(4) { width: 100px; }
.files-table th:last-child { width: 126px; }
.files-table th.actions-heading { text-align: right; padding-right: 25px; }
.files-table td { padding: 10px 16px; border-bottom: 1px solid var(--soft); color: var(--muted); font-size: 13px; }
.files-table tr:last-child td { border-bottom: 0; }
.files-table tbody tr:hover { background: var(--subtle); }
.file-name-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--muted); width: 18px; height: 22px; }
.file-name-content { min-width: 0; }
.file-name { display: block; color: var(--text); font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-mobile-meta { display: none; }
.share-badge { display: inline-flex; gap: 5px; align-items: center; border: 0; background: none; padding: 3px 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.share-badge.has-links { color: var(--link); }
.share-badge:hover { text-decoration: underline; }
.share-badge .icon { width: 13px; height: 13px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.files-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 240px; gap: 10px; padding: 32px; color: var(--muted); }
.empty-state > .icon { width: 28px; height: 28px; margin-bottom: 3px; }
.empty-state h2 { font-size: 14px; font-weight: 400; }
.empty-state .text-button { color: var(--link); }
.uploads-panel { margin-bottom: 16px; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--subtle); border-bottom: 1px solid var(--border); gap: 12px; }
.panel-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; }
.panel-heading .text-button { font-size: 12px; }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--soft); }
.upload-row:last-child { border-bottom: 0; }
.upload-content { min-width: 0; flex: 1; }
.upload-row-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.upload-name { color: var(--text); font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.upload-row.error .upload-status, .upload-error { color: var(--danger); }
.upload-row.done .upload-status { color: var(--success); }
.upload-progress { appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; background: var(--soft); }
.upload-progress::-webkit-progress-bar { background: var(--soft); border-radius: 4px; }
.upload-progress::-webkit-progress-value { background: var(--link); border-radius: 4px; }
.upload-progress::-moz-progress-bar { background: var(--link); border-radius: 4px; }
.done .upload-progress::-webkit-progress-value { background: var(--success); }
.done .upload-progress::-moz-progress-bar { background: var(--success); }
.upload-detail { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.upload-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 112px; }
.upload-actions .small-button { padding: 3px 9px; min-height: 28px; font-size: 12px; }
.upload-done-mark { color: var(--success); padding: 0 8px; }
.upload-error { font-size: 12px; margin-top: 5px; overflow-wrap: anywhere; }
.modal { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; margin: auto; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); overflow: auto; box-shadow: 0 8px 28px #0002; }
.modal::backdrop { background: #1f232866; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--subtle); }
.modal h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }
.share-file-summary { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; }
.share-file-summary > div { min-width: 0; }
.share-file-summary strong { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-file-summary div > span { display: block; font-size: 12px; color: var(--muted); }
.share-links { max-height: 310px; overflow: auto; }
.links-empty { padding: 24px 0; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--soft); }
.link-card { padding: 14px 0; border-top: 1px solid var(--soft); }
.link-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.link-card-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.link-state { color: var(--success); font-size: 11px; white-space: nowrap; }
.link-state.is-expired { color: var(--muted); }
.link-url { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; background: var(--subtle); }
.link-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.link-meta, .link-actions { display: flex; gap: 12px; align-items: center; }
.link-meta { flex-wrap: wrap; font-size: 11px; color: var(--muted); gap: 3px 12px; }
.link-actions { gap: 6px; }
.link-actions .small-button { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.link-actions .icon { width: 13px; height: 13px; }
.share-form { border-top: 1px solid var(--border); }
.link-slug-field { position: relative; }
.link-slug-field > span { position: absolute; left: 10px; top: 6px; color: var(--muted); font: 13px/22px ui-monospace, SFMono-Regular, Consolas, monospace; pointer-events: none; }
.link-slug-field input { padding-left: 38px; }
.form-columns { display: grid; grid-template-columns: 1fr 150px; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.password-modal { max-width: 380px; }
.password-modal label:first-child { margin-top: 0; }
.confirm-modal { max-width: 400px; }
.confirm-modal p { color: var(--muted); font-size: 13px; margin-top: 12px; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; background: var(--bg); color: var(--text); box-shadow: 0 3px 14px #0002; font-size: 13px; overflow-wrap: anywhere; }
.toast .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
@media (max-width: 760px) {
  .top-inner { padding: 15px 20px; }
  .connection-inner { padding-left: 20px; padding-right: 20px; }
  .workspace { padding: 20px; }
  .files-table th:nth-child(3), .files-table .date-cell { display: none; }
  .files-table th:nth-child(2) { width: 85px; }
  .files-table th:nth-child(4) { width: 85px; }
  .files-table th:last-child { width: 114px; }
  .files-table th, .files-table td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 540px) {
  input, select, .search-field input, .link-url { font-size: 16px; }
  .top-inner { padding: 13px 16px; gap: 10px; flex-wrap: wrap; }
  .connection-inner { padding-left: 16px; padding-right: 16px; }
  .identity { gap: 9px; }
  .identity-name { font-size: 14px; }
  .identity-page { font-size: 13px; }
  .slash { padding: 0 7px; }
  .header-actions { gap: 12px; margin-left: auto; }
  .account-actions { gap: 12px; }
  .account-actions .text-button { font-size: 12px; }
  .mark { width: 28px; height: 28px; }
  .workspace { padding: 18px 16px; }
  .files-toolbar { gap: 8px; }
  .search-field { flex: 1; width: auto; min-width: 0; }
  .toolbar-actions { gap: 8px; }
  .refresh-button { display: none; }
  .nav-button { padding-left: 10px; padding-right: 10px; }
  .files-table th:nth-child(2), .files-table .size-cell { display: none; }
  .files-table th:nth-child(4), .files-table .share-cell { display: none; }
  .files-table th:last-child { width: 112px; }
  .files-table th.actions-heading { padding-right: 21px; }
  .file-name-wrap { gap: 8px; }
  .file-mobile-meta { display: block; font-size: 11px; margin-top: 2px; color: var(--muted); }
  .file-name { font-size: 13px; }
  .empty-state { min-height: 210px; }
  .files-footer { font-size: 11px; gap: 10px; }
  .upload-row { padding: 12px; gap: 8px; }
  .upload-row > .file-icon { display: none; }
  .upload-actions { min-width: auto; gap: 4px; }
  .upload-status { display: none; }
  .upload-actions .small-button { font-size: 11px; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 10px 16px; }
  .form-columns { grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
  .link-card-footer { flex-wrap: wrap; }
  .toasts { right: 16px; bottom: 16px; }
  .login-screen { margin-top: 54px; }
}
@media (prefers-reduced-motion: reduce) { .spinner, .refreshing .icon { animation: none; } }
