:root {
    --bg: #10131a;
    --panel: #161a23;
    --elevated: #1f2430;
    --elevated-2: #262c3a;
    --border: #262c39;
    --border-soft: #1d222c;
    --text: #e9ecf3;
    --text-muted: #8b93a8;
    --text-faint: #565f74;
    --accent: #3ed6c4;
    --accent-strong: #2bb8a8;
    --accent-soft: rgba(62, 214, 196, 0.13);
    --accent-text: #0d1712;
    --warm: #f5a623;
    --warm-soft: rgba(245, 166, 35, 0.14);
    --danger: #f0665f;
    --danger-soft: rgba(240, 102, 95, 0.13);
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 18px;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
    --shadow-deep: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea {
    font-family: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent-soft);
    color: var(--accent);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--elevated-2);
    border-radius: 10px;
    border: 2px solid var(--panel);
}

::-webkit-scrollbar-track {
    background: transparent;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- App shell ---------- */

.app {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
}

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.brand-mark, .login-mark {
    position: relative;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.brand-ring, .login-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0.55;
    animation: pulseRing 2.6s ease-out infinite;
}

.brand-dot, .login-dot {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(62, 214, 196, 0.7);
}

@keyframes pulseRing {
    0% { transform: scale(0.55); opacity: 0.7; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.2px;
}

.new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 11px 16px;
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 6px 18px rgba(62, 214, 196, 0.22);
}

.new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(62, 214, 196, 0.3);
}

.new-menu {
    display: none;
    flex-direction: column;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 6px;
    margin-top: -12px;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 20;
}

.new-menu.open {
    display: flex;
}

.new-menu button {
    background: none;
    border: none;
    text-align: left;
    padding: 9px 10px;
    border-radius: var(--radius-s);
    font-size: 13.5px;
    color: var(--text);
}

.new-menu button:hover {
    background: var(--elevated-2);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 9px 10px;
    border-radius: var(--radius-s);
    color: var(--text-muted);
    font-size: 13.8px;
    font-weight: 500;
    text-align: left;
}

.side-nav-item svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.side-nav-item:hover {
    background: var(--elevated);
    color: var(--text);
}

.side-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.side-nav-item.active svg {
    opacity: 1;
}

.storage-meter {
    margin-top: auto;
    padding: 12px 10px;
    background: var(--elevated);
    border-radius: var(--radius-m);
    border: 1px solid var(--border-soft);
}

.storage-meter-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

#storageAmount {
    font-family: var(--font-mono);
    color: var(--text);
}

.storage-bar {
    height: 5px;
    background: var(--elevated-2);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    width: 4%;
    background: linear-gradient(90deg, var(--accent-strong), var(--accent));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.logout-link {
    text-decoration: none;
    font-size: 13px;
    color: var(--text-faint);
    padding: 4px 10px;
    transition: color 0.15s ease;
}

.logout-link:hover {
    color: var(--danger);
}

/* ---------- Main ---------- */

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
    display: none;
}

.breadcrumbs .crumb {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.breadcrumbs .crumb:hover {
    background: var(--elevated);
    color: var(--text);
}

.breadcrumbs .crumb.current {
    color: var(--text);
    font-weight: 500;
}

.breadcrumbs .sep {
    color: var(--text-faint);
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-m);
    padding: 8px 12px;
    color: var(--text-faint);
    width: 220px;
    transition: border-color 0.15s ease;
}

.search-box:focus-within {
    border-color: var(--accent);
    color: var(--accent);
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    font-size: 13.5px;
    color: var(--text);
    width: 100%;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-m);
    color: var(--text-muted);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.selection-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 28px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
    flex-shrink: 0;
}

.selection-bar.visible {
    display: flex;
}

#selectionCount {
    color: var(--accent);
    font-weight: 600;
}

.selection-actions {
    display: flex;
    gap: 8px;
}

.selection-actions button {
    background: var(--elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 13px;
    border-radius: var(--radius-s);
    font-size: 13px;
}

.selection-actions button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.selection-actions button[data-action="sel-delete"]:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.content {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding: 22px 28px 60px;
}

/* ---------- Drop overlay ---------- */

.drop-overlay {
    display: none;
    position: absolute;
    inset: 10px;
    z-index: 30;
    align-items: center;
    justify-content: center;
    background: rgba(16, 19, 26, 0.85);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-l);
    backdrop-filter: blur(4px);
}

.drop-overlay.visible {
    display: flex;
}

.drop-overlay-inner {
    text-align: center;
    color: var(--accent);
}

.drop-ring {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: pulseRing 1.6s ease-out infinite;
}

.drop-overlay-inner p {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}

/* ---------- Grid view ---------- */

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.file-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-m);
    padding: 16px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
    user-select: none;
}

.file-card:hover {
    border-color: var(--border);
    background: var(--elevated);
}

.file-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.file-card-icon-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.file-card .card-menu-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.1s ease;
}

.file-card:hover .card-menu-btn, .file-card.selected .card-menu-btn {
    opacity: 1;
}

.card-menu-btn:hover {
    background: var(--elevated-2);
    color: var(--text);
}

.file-card-name {
    font-size: 13.3px;
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-card-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

/* ---------- File / folder icon glyph ---------- */

.file-icon {
    width: 42px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 9.5px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.list-view .file-icon {
    width: 32px;
    height: 26px;
    border-radius: 6px;
}

.file-icon.kind-folder {
    background: transparent;
    position: relative;
    width: 40px;
    height: 32px;
}

.file-icon.kind-folder svg {
    width: 100%;
    height: 100%;
}

.kind-image { background: rgba(139, 124, 246, 0.16); color: #a79bfa; }
.kind-video { background: rgba(242, 120, 159, 0.16); color: #f78bab; }
.kind-audio { background: rgba(245, 166, 35, 0.16); color: #f7b955; }
.kind-pdf { background: rgba(225, 75, 75, 0.16); color: #ea6f6f; }
.kind-archive { background: rgba(201, 138, 59, 0.16); color: #d9a35f; }
.kind-doc { background: rgba(76, 141, 246, 0.16); color: #7ba6f8; }
.kind-sheet { background: rgba(53, 179, 126, 0.16); color: #5fcb98; }
.kind-slide { background: rgba(242, 153, 74, 0.16); color: #f5ac6c; }
.kind-text { background: rgba(154, 165, 184, 0.16); color: #b6bfd1; }
.kind-code { background: rgba(62, 214, 196, 0.16); color: #5fe0d0; }
.kind-file { background: rgba(107, 115, 134, 0.18); color: #9aa2b5; }

/* ---------- List view ---------- */

.list-view {
    display: flex;
    flex-direction: column;
}

.list-head {
    display: grid;
    grid-template-columns: 1fr 110px 130px 40px;
    padding: 0 14px 10px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border-soft);
}

.list-body {
    display: flex;
    flex-direction: column;
}

.file-row {
    display: grid;
    grid-template-columns: 1fr 110px 130px 40px;
    align-items: center;
    padding: 9px 14px;
    border-radius: var(--radius-s);
    font-size: 13.3px;
    user-select: none;
}

.file-row:hover {
    background: var(--elevated);
}

.file-row.selected {
    background: var(--accent-soft);
}

.file-row-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.file-row-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row .file-size, .file-row .file-modified {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
}

.file-row .card-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-row .card-menu-btn:hover {
    background: var(--elevated-2);
    color: var(--text);
}

/* ---------- Empty state ---------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 90px 20px;
    color: var(--text-muted);
}

.empty-mark {
    width: 54px;
    height: 44px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: var(--elevated);
    border: 1px dashed var(--border);
    position: relative;
}

.empty-mark::after {
    content: '';
    position: absolute;
    inset: 12px 16px;
    border-top: 2px solid var(--border);
    border-radius: 2px;
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--text);
    margin: 0 0 6px;
}

.empty-state p {
    margin: 0;
    font-size: 13.5px;
}

/* ---------- Shared links view ---------- */

.shared-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shared-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-m);
    padding: 14px 16px;
}

.shared-row-info {
    flex: 1;
    min-width: 0;
}

.shared-row-name {
    font-weight: 500;
    font-size: 13.6px;
    margin-bottom: 3px;
}

.shared-row-link {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-row button {
    background: var(--elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 13px;
    border-radius: var(--radius-s);
    font-size: 12.5px;
    flex-shrink: 0;
}

.shared-row button:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.shared-empty {
    padding: 60px 0;
    text-align: center;
    color: var(--text-muted);
}

/* ---------- Context menu ---------- */

.context-menu {
    display: none;
    position: fixed;
    z-index: 200;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 6px;
    min-width: 190px;
    box-shadow: var(--shadow-deep);
}

.context-menu.open {
    display: block;
}

.context-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 9px 10px;
    border-radius: var(--radius-s);
    font-size: 13.3px;
    color: var(--text);
}

.context-menu button:hover {
    background: var(--elevated-2);
}

.context-menu button.danger {
    color: var(--danger);
}

.context-menu hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 5px 2px;
}

/* ---------- Modals ---------- */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(8, 10, 14, 0.6);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    display: none;
    width: 360px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: 22px;
    box-shadow: var(--shadow-deep);
    animation: modalIn 0.18s ease;
}

.modal-wide {
    width: 420px;
}

.modal.open {
    display: block;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
    font-family: var(--font-display);
    margin: 0 0 14px;
    font-size: 16px;
}

.modal-sub {
    margin: -8px 0 14px;
    font-size: 12.8px;
    color: var(--text-muted);
}

.modal input[type="text"] {
    width: 100%;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 10px 12px;
    font-size: 13.8px;
    outline: none;
    transition: border-color 0.15s ease;
}

.modal input[type="text"]:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.btn-ghost, .btn-solid, .btn-danger {
    padding: 9px 16px;
    border-radius: var(--radius-s);
    font-size: 13.3px;
    font-weight: 500;
    border: 1px solid transparent;
}

.btn-ghost {
    background: none;
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-faint);
}

.btn-solid {
    background: var(--accent);
    color: var(--accent-text);
}

.btn-solid:hover {
    background: var(--accent-strong);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #1a0d0c;
}

.share-link-row {
    display: flex;
    gap: 8px;
}

.share-link-row input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12.5px;
}

/* ---------- Editor overlay ---------- */

.editor-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: var(--bg);
}

.editor-overlay.open {
    display: flex;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.editor-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border-soft);
}

.editor-filename {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--text-muted);
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-status {
    font-size: 12px;
    color: var(--text-faint);
}

.editor-textarea, #editorTextarea {
    flex: 1;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: none;
    outline: none;
    resize: none;
    padding: 22px 28px;
    font-family: var(--font-mono);
    font-size: 13.6px;
    line-height: 1.6;
    tab-size: 4;
}

/* ---------- Toasts ---------- */

.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 12px 16px;
    font-size: 13.3px;
    box-shadow: var(--shadow-soft);
    animation: toastIn 0.2s ease;
    max-width: 320px;
}

.toast.error {
    border-color: rgba(240, 102, 95, 0.4);
    color: #f5b3af;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Login page ---------- */

.login-body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-atmosphere {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(38% 30% at 22% 28%, rgba(62, 214, 196, 0.16), transparent 60%),
        radial-gradient(30% 26% at 78% 68%, rgba(245, 166, 35, 0.09), transparent 60%),
        radial-gradient(45% 40% at 85% 12%, rgba(139, 124, 246, 0.08), transparent 60%);
    animation: driftAtmosphere 26s ease-in-out infinite alternate;
}

@keyframes driftAtmosphere {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-2%, 2%) scale(1.05); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 340px;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-l);
    padding: 36px 32px;
    box-shadow: var(--shadow-deep);
    text-align: center;
}

.login-mark {
    margin: 0 auto 16px;
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 21px;
    margin: 0 0 4px;
}

.login-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 22px;
}

.login-error {
    background: var(--danger-soft);
    color: #f5b3af;
    font-size: 12.8px;
    padding: 9px 12px;
    border-radius: var(--radius-s);
    margin-bottom: 16px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.login-card input {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 10px 12px;
    font-size: 13.8px;
    color: var(--text);
    outline: none;
}

.login-card input:focus {
    border-color: var(--accent);
}

.login-card button {
    margin-top: 6px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 11px;
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 14px;
}

.login-card button:hover {
    background: var(--accent-strong);
}

/* ---------- Share page ---------- */

.share-body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.share-card {
    width: 100%;
    max-width: 560px;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-l);
    padding: 26px;
    box-shadow: var(--shadow-deep);
}

.share-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.share-kind-badge {
    width: 42px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}

.share-card-head h1 {
    font-family: var(--font-display);
    font-size: 16px;
    margin: 0 0 3px;
    word-break: break-word;
}

.share-card-head p {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.share-preview {
    background: var(--elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-m);
    min-height: 160px;
    max-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    margin-bottom: 18px;
}

.share-preview img {
    max-width: 100%;
    max-height: 400px;
    display: block;
}

.share-preview video, .share-preview audio {
    width: 100%;
}

.share-preview iframe {
    width: 100%;
    height: 400px;
    border: none;
}

.share-preview pre {
    width: 100%;
    max-height: 400px;
    overflow: auto;
    margin: 0;
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 12.6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.share-nopreview {
    color: var(--text-faint);
    font-size: 13.5px;
    padding: 40px;
}

.share-download-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    background: var(--accent);
    color: var(--accent-text);
    padding: 12px;
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 14px;
}

.share-download-btn:hover {
    background: var(--accent-strong);
}

.share-error {
    max-width: 420px;
    text-align: center;
    color: var(--text-muted);
}

.share-error-mark {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-faint);
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.share-error h1 {
    font-family: var(--font-display);
    color: var(--text);
    font-size: 19px;
    margin: 0 0 8px;
}

.share-error p {
    margin: 0;
    font-size: 13.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        flex-direction: row;
        align-items: center;
        padding: 12px 14px;
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
        gap: 12px;
        overflow-x: auto;
    }

    .brand-name {
        display: none;
    }

    .new-btn {
        width: auto;
        padding: 9px 14px;
    }

    .new-menu {
        position: fixed;
        top: 64px;
        left: 14px;
        margin-top: 0;
    }

    .side-nav {
        flex-direction: row;
    }

    .side-nav-item span {
        display: none;
    }

    .storage-meter {
        display: none;
    }

    .logout-link {
        margin-left: auto;
    }

    .topbar {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-box {
        width: 140px;
    }

    .content {
        padding: 16px 16px 50px;
    }

    .list-head, .file-row {
        grid-template-columns: 1fr 80px 40px;
    }

    .list-head span:nth-child(3), .file-row .file-modified {
        display: none;
    }
}
