:root {
  --ink: #18202a;
  --ink-2: #26313d;
  --muted: #737a80;
  --line: #dedbd3;
  --canvas: #f3f0e9;
  --panel: #fffdf8;
  --soft: #ebe7de;
  --accent: #e9673f;
  --accent-dark: #b64225;
  --accent-soft: #ffded2;
  --nav: #141a21;
  --nav-soft: #222a34;
  --gold: #e5b657;
  --danger: #c0443a;
  --shadow: 0 18px 45px rgba(26, 29, 32, .11);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(233, 103, 63, .28); outline-offset: 2px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 19px; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 2px; color: #9099a4; font-size: 10px; }
.brand-mark { position: relative; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 12px; background: var(--accent); box-shadow: 0 10px 25px rgba(233, 103, 63, .26); }
.brand-mark::before { content: ""; position: absolute; left: 9px; top: 9px; width: 15px; height: 18px; border: 2px solid #fff; border-radius: 2px; }
.brand-mark::after { content: ""; position: absolute; left: 14px; top: 14px; width: 12px; height: 16px; border-right: 2px solid rgba(255,255,255,.7); border-bottom: 2px solid rgba(255,255,255,.7); }

.login-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 80% 15%, rgba(233,103,63,.18), transparent 27%), linear-gradient(135deg, #111820, #202b35); }
.login-shell { width: min(440px, 100%); }
.login-card { padding: 38px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: var(--panel); box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.login-brand { margin-bottom: 42px; }
.login-brand small { color: var(--muted); }
.login-kicker { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.login-card h1 { margin: 0; font: 700 31px/1.05 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.login-copy { margin: 10px 0 26px; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 7px; color: #59616a; font-size: 11px; font-weight: 750; }
.login-form input { width: 100%; height: 47px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.login-form input:focus { border-color: var(--accent); outline: 3px solid rgba(233,103,63,.13); }
.login-error { margin: 0 0 16px; padding: 12px 14px; border-radius: 9px; background: #ffe8e4; color: var(--danger); font-size: 11px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 0; color: var(--muted); font-size: 10px; }
.button { min-height: 43px; padding: 0 16px; border-radius: 9px; cursor: pointer; font-weight: 760; }
.button.primary { border: 0; background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { border: 1px solid var(--line); background: #fff; }
.button.wide { width: 100%; margin-top: 4px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px 20px; background: var(--nav); color: #e9edf1; overflow-y: auto; }
.sidebar > .brand { padding: 0 8px 29px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand strong { color: #fff; }
.nav-label { margin: 22px 10px 8px; color: #68727e; font-size: 9px; font-weight: 820; letter-spacing: .14em; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; border: 0; border-radius: 9px; background: transparent; color: #aeb7c1; text-align: left; cursor: pointer; transition: .16s ease; }
.nav-item > span { width: 21px; display: inline-grid; place-items: center; color: #78838f; font-size: 15px; }
.nav-item em { margin-left: auto; min-width: 24px; padding: 3px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: #8f99a4; text-align: center; font-size: 9px; font-style: normal; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.nav-item.active > span, .nav-item.active em { color: #fff; }
.tag-navigation { max-height: 200px; margin-bottom: 13px; overflow-y: auto; scrollbar-width: thin; }
.tag-nav-item { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.tag-nav-item > .tag-nav-dot { width: 8px; height: 8px; margin: 0 6px; border-radius: 3px; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.tag-nav-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.tag-nav-empty { padding: 8px 11px; color: #707b86; font-size: 10px; line-height: 1.4; }
.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; padding-top: 20px; }
.sync-mini { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.035); }
.sync-mini strong, .sync-mini small { display: block; }
.sync-mini strong { max-width: 164px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dbe1e7; font-size: 10px; }
.sync-mini small { margin-top: 3px; color: #77828e; font-size: 9px; }
.online-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #45ca8d; box-shadow: 0 0 0 4px rgba(69,202,141,.14); }
.online-dot.error { background: #ed6a60; box-shadow: 0 0 0 4px rgba(237,106,96,.14); }
.logout-button { min-height: 35px; border: 0; border-radius: 9px; background: transparent; color: #7d8792; cursor: pointer; font-size: 10px; }
.logout-button:hover { background: rgba(255,255,255,.05); color: #fff; }

.main { min-width: 0; padding: 34px clamp(24px, 3.2vw, 52px) 54px; background: linear-gradient(180deg, #f7f4ed 0, var(--canvas) 410px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.title-wrap { display: flex; align-items: flex-start; gap: 12px; }
.title-wrap p { margin: 0 0 6px; color: var(--accent); font-size: 10px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.title-wrap h1 { margin: 0; font: 700 clamp(28px, 3vw, 42px)/1 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.sync-button { height: 39px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(233,103,63,.22); cursor: pointer; font-size: 10px; }
.sync-button b { font-weight: 760; }
.sync-button:hover { background: var(--accent-dark); }
.sync-button:disabled { cursor: wait; opacity: .7; }
.sync-button.running span { animation: spin .8s linear infinite; }
.connection-pill { height: 39px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,253,248,.72); color: #4f5c61; font-size: 10px; font-weight: 690; }
.avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--nav); color: #fff; font-size: 11px; font-weight: 800; }
.mobile-menu { display: none; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; }

.search-section { margin-top: 32px; }
.search-box { position: relative; display: block; }
.search-box > span { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 24px; }
.search-box input { width: 100%; height: 62px; padding: 0 70px 0 57px; border: 1px solid #d8d4ca; border-radius: 12px; background: var(--panel); box-shadow: 0 14px 35px rgba(46,42,34,.08); color: var(--ink); font-size: 15px; }
.search-box input:focus { border-color: var(--accent); outline: none; box-shadow: 0 16px 40px rgba(233,103,63,.12); }
.search-box input::placeholder { color: #969992; }
.search-box kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #efebe3; color: #7d807c; font: 9px ui-monospace, monospace; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.chip { min-height: 32px; padding: 6px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #71766f; cursor: pointer; font-size: 10px; font-weight: 700; }
.chip:hover { background: #eae5dc; color: var(--ink); }
.chip.active { border-color: #f2bea9; background: var(--accent-soft); color: var(--accent-dark); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.metrics article { min-height: 82px; display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.65); }
.metric-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; font-size: 15px; }
.metric-icon.blue { background: #dfe8f0; color: #3f6680; }
.metric-icon.amber { background: #f4e3bd; color: #8d651d; }
.metric-icon.green { background: #dcecdf; color: #367450; }
.metrics strong, .metrics small { display: block; }
.metrics strong { font: 700 20px/1 Georgia, "Times New Roman", serif; }
.metrics small { margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .02em; }

.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-height: 28px; margin-top: 29px; color: var(--muted); font-size: 10px; }
.breadcrumbs button { padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.breadcrumbs button:hover { background: #e7e2d9; color: var(--ink); }
.breadcrumbs button:last-child { color: var(--accent-dark); font-weight: 760; }
.breadcrumbs i { color: #aba9a2; font-style: normal; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 9px 0 14px; }
.section-head h2 { margin: 0; font: 700 22px/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.view-toggle { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.view-toggle button { width: 31px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #93958f; cursor: pointer; }
.view-toggle button.active { background: var(--nav); color: #fff; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 190px; color: var(--muted); }
.loading span { width: 19px; height: 19px; border: 2px solid #d5d0c8; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.file-grid.list { grid-template-columns: 1fr; gap: 7px; }
.file-card { min-width: 0; overflow: hidden; border: 1px solid #ddd9d0; border-radius: 12px; background: var(--panel); cursor: pointer; transition: transform .17s ease, box-shadow .17s ease, border-color .17s ease; }
.file-card:hover { transform: translateY(-3px); border-color: #d4a58f; box-shadow: 0 16px 32px rgba(44,39,31,.1); }
.file-preview { position: relative; height: 146px; display: grid; place-items: center; overflow: hidden; background: #e9e5dd; }
.file-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.type-glyph { width: 64px; height: 82px; display: grid; place-items: center; border: 1px solid #ddd8ce; border-radius: 5px; background: #fffdf8; box-shadow: 0 10px 22px rgba(35,37,39,.12); color: #65707b; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.file-preview[data-kind="ordner"] { background: #eee2c9; }
.file-preview[data-kind="ordner"] .type-glyph { width: 104px; height: 68px; border: 0; border-radius: 7px 12px 10px 10px; background: var(--gold); box-shadow: 0 12px 25px rgba(128,89,20,.2); color: #61420e; }
.file-preview[data-kind="video"] { background: linear-gradient(145deg, #202a35, #3d4a57); }
.file-preview[data-kind="video"] .type-glyph { width: 46px; height: 46px; border-color: rgba(255,255,255,.26); border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
.favorite-star { position: absolute; z-index: 2; top: 9px; right: 9px; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(24,32,42,.08); border-radius: 50%; background: rgba(255,253,248,.92); color: #838982; cursor: pointer; }
.favorite-star.active { color: #d98a16; background: #fff3ce; }
.folder-arrow { position: absolute; right: 10px; bottom: 9px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(20,26,33,.88); color: #fff; font-size: 13px; }
.file-info { padding: 13px 13px 14px; }
.file-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 760; }
.file-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 19px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 0; border-radius: 5px; background: #eeeae2; color: #696c68; font-size: 8px; font-weight: 720; }
.file-grid.list .file-card { display: grid; grid-template-columns: 86px minmax(0, 1fr); border-radius: 9px; }
.file-grid.list .file-preview { height: 76px; }
.file-grid.list .type-glyph { transform: scale(.54); }
.file-grid.list .file-info { display: grid; grid-template-columns: minmax(180px, 1fr) 150px 180px; align-items: center; gap: 15px; }
.file-grid.list .tag-row { margin: 0; }
.empty-state { padding: 48px 20px; border: 1px dashed #c7c1b7; border-radius: 12px; background: rgba(255,253,248,.56); text-align: center; }
.empty-state strong { font: 700 18px Georgia, "Times New Roman", serif; }
.empty-state p { margin: 7px 0 0; color: var(--muted); }

.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15,20,25,.35); }
.drawer { position: fixed; z-index: 21; top: 12px; right: 12px; bottom: 12px; width: min(390px, calc(100vw - 24px)); display: flex; flex-direction: column; padding: 18px; border-radius: 15px; background: var(--panel); box-shadow: var(--shadow); transform: translateX(calc(100% + 26px)); transition: transform .25s ease; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.drawer-head button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.drawer-preview { min-height: 210px; display: grid; place-items: center; margin: 17px 0; border-radius: 10px; background: var(--soft); overflow: hidden; }
.drawer-preview img { width: 100%; height: 210px; object-fit: contain; }
.drawer-preview .type-glyph { transform: scale(1.25); }
.drawer h2 { margin: 0; font: 700 20px Georgia, "Times New Roman", serif; word-break: break-word; }
.drawer-path { margin: 7px 0 18px; color: var(--muted); font-size: 10px; word-break: break-all; }
.details { display: grid; grid-template-columns: 95px 1fr; gap: 10px; padding: 15px 0; border-block: 1px solid var(--line); font-size: 10px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; }
.tag-editor { margin-top: 17px; }
.tag-editor > strong { display: block; margin-bottom: 9px; font-size: 10px; }
.drawer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-tags .tag { cursor: pointer; }
.drawer-tags .tag::after { content: "×"; }
#tagForm { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 10px; }
#tagForm input { height: 37px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
#tagForm button { padding: 0 11px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-size: 10px; font-weight: 720; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 19px; }
.button:disabled { cursor: wait; opacity: .68; }
.favorite-text-button { min-height: 34px; margin-top: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }

.viewer-open { overflow: hidden; }
.viewer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(8,12,16,.78); backdrop-filter: blur(6px); }
.file-viewer { position: fixed; z-index: 51; inset: 18px; max-width: 1580px; display: flex; flex-direction: column; margin: auto; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: #f4f1eb; box-shadow: 0 35px 100px rgba(0,0,0,.48); }
.viewer-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 13px 10px 20px; background: var(--nav); color: #fff; }
.viewer-head > div:first-child { min-width: 0; }
.viewer-head small, .viewer-head strong { display: block; }
.viewer-head small { margin-bottom: 3px; color: #85919c; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.viewer-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.viewer-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.viewer-actions a { min-height: 35px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; font-size: 9px; font-weight: 760; }
.viewer-actions button { width: 35px; height: 35px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; font-size: 19px; }
.viewer-toolbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 13px 8px 20px; border-bottom: 1px solid var(--line); background: #f7f4ee; }
.viewer-tag-list { min-width: 0; display: flex; align-items: center; gap: 9px; }
.viewer-tag-list > span { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 780; text-transform: uppercase; }
.viewer-tag-list > div { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.viewer-tag-list small { color: #989992; white-space: nowrap; }
.viewer-tag-list .tag { flex: 0 0 auto; cursor: pointer; }
.viewer-tag-list .tag::after { content: "×"; margin-left: 2px; }
#viewerTagForm { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#viewerTagForm label { color: var(--muted); font-size: 8px; font-weight: 750; }
#viewerTagForm input { width: 150px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 9px; }
#viewerTagForm button { height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: var(--nav); color: #fff; cursor: pointer; font-size: 9px; font-weight: 730; }
.viewer-search-hits { flex: 0 0 auto; display: grid; gap: 7px; padding: 10px 14px; border-bottom: 1px solid #dfcf91; background: #fff6ce; }
.viewer-search-hits[hidden] { display: none; }
.viewer-search-hits > strong { color: #6c5414; font-size: 9px; }
.viewer-search-hits > div { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.viewer-search-hits button { width: min(390px, 78vw); flex: 0 0 auto; display: grid; gap: 4px; padding: 8px 10px; border: 1px solid #e1cd77; border-radius: 7px; background: #fffdf8; color: var(--ink); text-align: left; cursor: pointer; }
.viewer-search-hits button:hover { border-color: #b9961f; }
.viewer-search-hits button b { color: #735918; font-size: 8px; text-transform: uppercase; }
.viewer-search-hits button span { overflow: hidden; color: #59616a; font-size: 9px; line-height: 1.45; white-space: nowrap; text-overflow: ellipsis; }
.viewer-search-hits mark { padding: 0 2px; border-radius: 2px; background: #ffd93e; color: #211b08; }
.viewer-content { min-height: 0; flex: 1; display: grid; place-items: center; overflow: hidden; }
.viewer-loading, .viewer-error { padding: 30px; background: #ebe7df; text-align: center; }
.viewer-loading-state span { width: 30px; height: 30px; display: block; margin: 0 auto 16px; border: 3px solid #d0cbc1; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.viewer-loading-state strong, .viewer-loading-state small { display: block; }
.viewer-loading-state strong { font: 700 18px Georgia, "Times New Roman", serif; }
.viewer-loading-state small { margin-top: 7px; color: var(--muted); }
.viewer-error-state strong { font: 700 18px Georgia, "Times New Roman", serif; }
.viewer-error-state p { margin: 7px 0 0; color: var(--muted); }
.image-viewer { padding: 18px; background: #111820; }
.image-viewer img { width: 100%; height: 100%; display: block; object-fit: contain; }
.document-viewer { background: #d8d5ce; }
.document-viewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.media-viewer { padding: 20px; background: #0d1319; }
.media-viewer video { width: 100%; height: 100%; object-fit: contain; }
.audio-viewer { padding: 28px; background: #ebe7df; }
.audio-viewer audio { width: min(680px, 100%); }
.unsupported-viewer { padding: 30px; background: #ebe7df; text-align: center; }
.viewer-unsupported span { width: 70px; height: 90px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 5px; background: #fffdf8; box-shadow: 0 12px 28px rgba(35,37,39,.12); color: var(--muted); font-size: 10px; font-weight: 850; }
.viewer-unsupported strong { display: block; font: 700 18px Georgia, "Times New Roman", serif; }
.viewer-unsupported p { margin: 7px 0 0; color: var(--muted); }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; max-width: calc(100vw - 36px); padding: 12px 16px; border-radius: 8px; background: var(--nav); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .2s ease; font-size: 10px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) { .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; width: 272px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 24px 18px 42px; }
  .mobile-menu { display: grid; place-items: center; }
  .connection-pill { width: 39px; justify-content: center; padding: 0; font-size: 0; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .login-card { padding: 27px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { min-height: 66px; }
  .file-grid { grid-template-columns: 1fr; }
  .file-grid.list .file-info { grid-template-columns: 1fr; gap: 4px; }
  .file-grid.list .tag-row { display: none; }
  .avatar { display: none; }
  .sync-button { width: 39px; justify-content: center; padding: 0; }
  .sync-button b { display: none; }
  .file-viewer { inset: 0; border: 0; border-radius: 0; }
  .viewer-head { min-height: 58px; padding-left: 14px; }
  .viewer-actions a { padding: 0 10px; }
  .viewer-toolbar { align-items: stretch; flex-direction: column; gap: 7px; padding: 9px 12px; }
  .viewer-tag-list { min-height: 27px; }
  #viewerTagForm { width: 100%; }
  #viewerTagForm label { display: none; }
  #viewerTagForm input { min-width: 0; width: auto; flex: 1; }
  .image-viewer { padding: 8px; }
}
