:root {
  --ink: #17231d;
  --muted: #748078;
  --cream: #f7f4ec;
  --paper: #fffdf8;
  --sage: #dde8d9;
  --green: #264c3a;
  --green-soft: #e9f0e7;
  --line: #e7e5dc;
  --gold: #d8bb74;
  --danger: #a33c35;
  --shadow: 0 24px 60px rgba(38, 76, 58, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #a9c5ad; outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 10px; color: #78867c; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.muted { color: var(--muted); }

/* Login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #e8efe2 0, transparent 30%), radial-gradient(circle at 90% 85%, #eadfca 0, transparent 35%), var(--cream); }
.login-card { width: min(100%, 440px); padding: 44px 46px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,253,248,.9); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 30px; overflow: hidden; border-radius: 18px; background: var(--green); box-shadow: 0 10px 24px rgba(38,76,58,.22); }
.mark img { display: block; width: 100%; height: 100%; }
.mark.small { width: 38px; height: 38px; margin: 0; border-radius: 11px; }
.login-card h1, .content h2, .welcome h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.login-card h1 { margin: 0 0 8px; font-size: 42px; letter-spacing: -.03em; }
.login-card form { margin-top: 32px; }
.login-card label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.password-row { position: relative; }
.password-row input { width: 100%; padding: 14px 64px 14px 16px; border: 1px solid #dfe2da; border-radius: 12px; background: white; outline: none; }
.password-row input:focus { border-color: #78927f; box-shadow: 0 0 0 3px #dfe8df; }
.password-row button { position: absolute; top: 8px; right: 8px; padding: 7px; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.primary { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 14px; padding: 14px 17px; border: 0; border-radius: 12px; background: var(--green); color: white; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary:hover { background: #1e3e2f; }
.primary.compact { width: auto; min-width: 135px; margin: 0; gap: 22px; }
.error { min-height: 19px; color: var(--danger); font-size: 13px; }
.private-note { display: flex; gap: 12px; padding-top: 22px; margin-top: 14px; border-top: 1px solid var(--line); color: #8b928c; font-size: 12px; }
.private-note span { color: #809680; }
.private-note p { margin: 0; line-height: 1.5; }
.private-note strong { color: #536158; }

/* Shell */
.app { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 22px; background: #1f4031; color: white; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 42px; font-family: Georgia, serif; font-size: 21px; }
.main-nav { display: grid; gap: 6px; }
.nav-item, .signout { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: transparent; color: #d5e1d9; text-align: left; cursor: pointer; }
.nav-item { display: flex; align-items: center; gap: 10px; }
.nav-item > span { width: 20px; font-size: 18px; text-align: center; }
.nav-item em { min-width: 22px; padding: 2px 6px; margin-left: auto; border-radius: 20px; background: rgba(255,255,255,.1); color: #c7d7cd; font-size: 10px; font-style: normal; text-align: center; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: white; }
.aside-bottom { margin-top: auto; }
.secure { display: flex; align-items: center; gap: 10px; padding: 12px; }
.secure > span { width: 8px; height: 8px; border-radius: 50%; background: #9aca9d; box-shadow: 0 0 0 4px rgba(154,202,157,.12); }
.secure strong, .secure small { display: block; font-size: 11px; }
.secure small { margin-top: 2px; color: #9fb3a7; }
.signout { margin-top: 8px; color: #a9bcb0; font-size: 12px; }
.build-version { display: block; padding: 0 12px; color: #789184; font-size: 9px; letter-spacing: .05em; }
.content { width: 100%; max-width: 1500px; padding: 34px clamp(24px,5vw,70px) 70px; }
.topbar { display: grid; grid-template-columns: 1fr minmax(260px, 420px) auto; align-items: center; gap: 24px; margin-bottom: 34px; }
.content h2 { margin: 0; font-size: 34px; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #ddcfb5; color: #675b46; font-size: 11px; font-weight: 800; }
.search { height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); transition: .2s; }
.search:focus-within { border-color: #a9bbaa; box-shadow: 0 0 0 3px rgba(169,187,170,.18); }
.search > span { color: #758079; font-size: 22px; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #edf0ea; color: #68736b; cursor: pointer; }

/* Home */
.welcome { min-height: 245px; display: flex; align-items: center; justify-content: space-between; padding: 42px 50px; overflow: hidden; border-radius: 24px; background: linear-gradient(125deg,#dce8d8,#edf0df); }
.welcome h3 { margin: 0 0 14px; font-size: 38px; line-height: 1.08; letter-spacing: -.03em; }
.welcome p:not(.eyebrow) { margin: 0; color: var(--muted); }
.soft-button { display: inline-flex; align-items: center; gap: 24px; margin-top: 24px; padding: 10px 14px; border: 1px solid rgba(38,76,58,.16); border-radius: 10px; background: rgba(255,255,255,.45); color: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.orb { width: 170px; height: 170px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.42); box-shadow: inset 0 0 0 30px rgba(255,255,255,.17); transform: rotate(-8deg); }
.orb img { width: 92px; height: 92px; border-radius: 25px; filter: drop-shadow(0 13px 16px rgba(38,76,58,.16)); }
.section-title { display: flex; justify-content: space-between; margin: 36px 0 17px; }
.section-title h3, .dashboard-card h3, .card-heading h3 { margin: 0 0 4px; font: 500 23px Georgia, serif; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; }
.share-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.share { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: inherit; text-align: left; cursor: pointer; transition: .2s; }
.share:hover { border-color: #cbd8cd; box-shadow: 0 12px 30px rgba(38,76,58,.08); transform: translateY(-3px); }
.share strong, .share small { display: block; }
.share small { margin-top: 6px; color: var(--muted); }
.share.offline { opacity: .5; cursor: not-allowed; }
.folder-icon { position: relative; width: 44px; height: 38px; margin-bottom: 24px; border-radius: 5px 9px 9px 9px; background: #d9c38f; }
.folder-icon::before { content: ""; position: absolute; top: -6px; left: 0; width: 19px; height: 8px; border-radius: 5px 5px 0 0; background: #d9c38f; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.dashboard-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.75); }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.card-heading button { border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.mini-list { display: grid; gap: 4px; }
.mini-item { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 7px; border: 0; border-radius: 10px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.mini-item:hover { background: #f0f2eb; }
.mini-item strong, .mini-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item strong { font-size: 12px; }
.mini-item small, .mini-item time { color: var(--muted); font-size: 10px; }
.mini-empty { padding: 18px 8px; color: var(--muted); font-size: 12px; }

/* Browser and collections */
.back { padding: 0; margin-bottom: 28px; border: 0; background: transparent; color: var(--green); font-weight: 700; cursor: pointer; }
.browser-head, .collection-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.browser-head h3, .collection-head h3 { margin: 0; font: 500 32px Georgia, serif; }
.collection-head p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.result-count { flex: none; padding: 6px 10px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.crumbs { min-height: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 14px; color: var(--muted); font-size: 13px; }
.crumbs button { padding: 3px 0; border: 0; background: transparent; color: var(--green); cursor: pointer; }
.list-toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 0; color: var(--muted); font-size: 12px; }
.sort-controls { display: flex; align-items: center; gap: 8px; }
.sort-controls label { color: #8a918c; font-size: 11px; }
.sort-select, .direction { height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.sort-select { padding: 0 30px 0 10px; }
.direction { width: 34px; cursor: pointer; }
.file-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.file-header, .file-row { display: grid; grid-template-columns: minmax(260px,1fr) 150px 95px 112px; gap: 16px; align-items: center; padding: 12px 18px; }
.file-header { background: #faf9f4; color: #8a918c; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.file-header button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; text-transform: inherit; cursor: pointer; }
.file-row { min-height: 62px; border-top: 1px solid var(--line); font-size: 13px; }
.file-row:first-child { border-top: 0; }
.file-row:hover { background: #fdfcf7; }
.file-main { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.file-name { min-width: 0; }
.file-name strong, .file-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name strong { font-size: 13px; font-weight: 650; }
.file-name small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.file-icon { position: relative; flex: none; width: 36px; height: 38px; display: grid; place-items: end center; padding-bottom: 5px; border-radius: 7px; background: #edf0eb; color: #607367; font-size: 8px; font-weight: 900; letter-spacing: .04em; }
.file-icon::before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 0 9px 9px; border-style: solid; border-color: transparent transparent rgba(255,255,255,.9) transparent; }
.file-icon[data-kind="folder"] { height: 30px; margin-top: 4px; border-radius: 4px 7px 7px 7px; background: #ddc98f; color: #715f36; }
.file-icon[data-kind="folder"]::before { top: -5px; right: auto; left: 0; width: 15px; height: 6px; border: 0; border-radius: 4px 4px 0 0; background: #ddc98f; }
.file-icon[data-kind="image"] { background: #dce9d9; color: #3f6d4a; }
.file-icon[data-kind="pdf"] { background: #f2ded9; color: #a3493d; }
.file-icon[data-kind="audio"], .file-icon[data-kind="video"] { background: #e1e2ee; color: #555e86; }
.file-icon[data-kind="document"], .file-icon[data-kind="text"] { background: #dce7ed; color: #42697b; }
.file-icon[data-kind="spreadsheet"] { background: #dceadd; color: #3b7148; }
.file-icon[data-kind="archive"] { background: #eee5d5; color: #846b3d; }
.date, .size { color: var(--muted); font-size: 12px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.action-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #7a847d; font-size: 17px; text-decoration: none; cursor: pointer; }
.action-button:hover { background: #ebeee7; color: var(--green); }
.action-button.starred { color: #aa7b19; }
.empty-state, .loading-state, .error-state { padding: 58px 24px; text-align: center; color: var(--muted); }
.empty-state strong, .error-state strong { display: block; margin-bottom: 6px; color: var(--ink); font: 500 21px Georgia, serif; }
.retry-button { margin-top: 14px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--green); font-weight: 700; cursor: pointer; }
.skeleton { position: relative; overflow: hidden; background: #e9e8e1; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
.card-skeleton { height: 132px; border-radius: 16px; }
.row-skeleton { height: 62px; border-top: 1px solid white; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Preview */
.preview-dialog { width: min(920px, calc(100vw - 40px)); max-width: none; height: min(760px, calc(100vh - 40px)); padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: var(--paper); box-shadow: 0 28px 90px rgba(18,34,26,.35); }
.preview-dialog::backdrop { background: rgba(18,30,24,.62); backdrop-filter: blur(5px); }
.preview-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.preview-shell > header, .preview-shell > footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; }
.preview-shell > header { border-bottom: 1px solid var(--line); }
.preview-shell > header h3 { max-width: 650px; margin: 0; overflow: hidden; font: 500 24px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.preview-shell > header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.preview-shell > footer { border-top: 1px solid var(--line); }
.icon-button { flex: none; width: 38px; height: 38px; border: 0; border-radius: 10px; background: #edf0ea; color: var(--ink); font-size: 22px; cursor: pointer; }
.secondary-button { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--green); font-weight: 700; cursor: pointer; }
.preview-body { min-height: 0; display: grid; place-items: center; overflow: auto; background: #eeeee8; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: white; }
.preview-body audio { width: min(560px, 85%); }
.preview-body video { max-width: 100%; max-height: 100%; }
.text-preview { width: 100%; min-height: 100%; padding: 26px; margin: 0; overflow: auto; background: #202722; color: #e5ebe5; font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.preview-message { max-width: 420px; padding: 35px; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 12px 16px; border-radius: 11px; background: #173528; color: white; box-shadow: 0 14px 35px rgba(0,0,0,.2); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.back-to-top { position: fixed; right: 24px; bottom: 78px; z-index: 40; min-width: 58px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--green); color: white; box-shadow: 0 10px 26px rgba(31,64,49,.28); font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s; }
.back-to-top span { font-size: 18px; line-height: 1; }
.back-to-top:hover { background: #1e3e2f; box-shadow: 0 13px 30px rgba(31,64,49,.34); transform: translateY(-2px); }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .share-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .file-header, .file-row { grid-template-columns: minmax(220px,1fr) 120px 80px 82px; gap: 10px; }
}

@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .app { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 30; width: auto; height: 70px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.12); }
  .sidebar .brand, .aside-bottom { display: none; }
  .main-nav { height: 100%; display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
  .nav-item { min-height: 52px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px; text-align: center; font-size: 10px; }
  .nav-item > span { height: 20px; font-size: 18px; }
  .nav-item em { position: absolute; margin: -23px 0 0 34px; }
  .content { padding: 22px 16px 38px; }
  .topbar { grid-template-columns: 1fr auto; gap: 14px; margin-bottom: 24px; }
  .content h2 { font-size: 29px; }
  .avatar { width: 38px; height: 38px; }
  .search { height: 44px; }
  .welcome { min-height: 250px; padding: 31px 26px; }
  .welcome h3 { font-size: 31px; }
  .orb { display: none; }
  .share-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid { margin-top: 24px; }
  .browser-head, .collection-head { align-items: flex-start; }
  .list-toolbar { align-items: flex-start; flex-direction: column; }
  .sort-controls { width: 100%; }
  .sort-select { flex: 1; }
  .file-header { display: none; }
  .file-row { grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 13px; }
  .file-row .date, .file-row .size { display: none; }
  .row-actions { gap: 1px; }
  .preview-dialog { width: 100vw; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .preview-shell > header, .preview-shell > footer { padding: 14px 15px; }
  .preview-shell > footer { flex-wrap: wrap; }
  .preview-shell > footer > * { flex: 1; }
  .primary.compact { min-width: 120px; }
  .toast { right: 14px; bottom: 86px; left: 14px; text-align: center; }
  .back-to-top { right: 16px; bottom: 88px; min-width: 48px; width: 48px; padding: 0; font-size: 0; }
  .back-to-top span { font-size: 20px; }
}

@media (max-width: 470px) {
  .login-card { padding: 34px 28px; }
  .login-card h1 { font-size: 37px; }
  .share-grid { grid-template-columns: 1fr; }
  .file-main { gap: 9px; }
  .file-icon { width: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* FroggyTech 3.0 */
.otp-field { margin-top: 16px; }
.otp-field input { width: 100%; padding: 14px 16px; border: 1px solid #dfe2da; border-radius: 12px; background: white; letter-spacing: .35em; }
.filter-button { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; cursor: pointer; }
.search-filters { position: fixed; z-index: 45; top: 92px; right: 76px; width: min(390px, calc(100vw - 32px)); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.search-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.search-filters select { width: 100%; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.search-filters .check-label { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.search-filters > div { grid-column: 1 / -1; }
.search-history { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.search-history button { padding: 6px 9px; border: 0; border-radius: 8px; background: #eff1eb; color: var(--green); font-size: 10px; cursor: pointer; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.compact-control { padding: 8px 11px; font-size: 11px; cursor: pointer; }
.view-toggle { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.view-toggle button { width: 30px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.view-toggle button.active { background: var(--green-soft); color: var(--green); }
.file-header, .file-row { grid-template-columns: minmax(240px,1fr) 140px 90px minmax(112px,190px); }
.danger-action { color: #a4554d; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 15px; }
.gallery-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); transition: .2s; }
.gallery-card:hover { border-color: #c9d5ca; box-shadow: 0 12px 28px rgba(38,76,58,.09); transform: translateY(-2px); }
.gallery-open { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.gallery-visual { position: relative; height: 135px; display: grid; place-items: center; overflow: hidden; background: #eceee8; }
.gallery-visual img { display: block; width: 100%; height: 100%; padding: 7px; object-fit: contain; background: #e8ebe5; }
.gallery-visual.video-visual { height: 135px; }
.video-badge { position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; display: grid; place-items: center; padding-left: 2px; border-radius: 50%; background: rgba(23,35,29,.72); color: white; box-shadow: 0 5px 16px rgba(0,0,0,.2); transform: translate(-50%,-50%); }
.gallery-symbol.file-icon { width: 54px; height: 58px; font-size: 10px; }
.gallery-name { display: block; padding: 12px 38px 13px 13px; }
.gallery-name strong, .gallery-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-name strong { font-size: 12px; }
.gallery-name small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.gallery-star { position: absolute; right: 8px; bottom: 9px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f2f2ec; color: #7d857f; font-size: 16px; cursor: pointer; }
.gallery-star.starred { color: #aa7b19; }
.load-more-sentinel { min-height: 42px; display: grid; place-items: center; margin-top: 12px; color: var(--muted); font-size: 11px; }
.storage-panel { margin-top: 34px; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); }
.storage-panel h3 { margin: 0; font: 500 23px Georgia, serif; }
.storage-panel h4 { margin: 20px 0 12px; font-size: 12px; }
.storage-locations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.storage-location { display: grid; grid-template-columns: 1fr auto; gap: 4px 15px; padding: 15px; border-radius: 13px; background: #f4f5ef; }
.storage-location strong, .storage-location small { display: block; }
.storage-location small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.storage-location > span { color: var(--green); font-size: 12px; font-weight: 800; }
.storage-track { grid-column: 1 / -1; height: 7px; margin-top: 6px; overflow: hidden; border-radius: 9px; background: #dfe4dc; }
.storage-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#71937b,#315b44); }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.type-chart { display: grid; gap: 8px; }
.type-chart > div { display: grid; grid-template-columns: 9px 35px 1fr 25px; align-items: center; gap: 7px; font-size: 9px; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; background: #78957d; }
.type-chart i { height: 6px; overflow: hidden; border-radius: 6px; background: #e5e8e1; }
.type-chart b { display: block; height: 100%; background: #78957d; }
.type-chart small { color: var(--muted); text-align: right; }
.rank-list { display: grid; gap: 7px; }
.rank-list > div { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; }
.rank-list em { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--green-soft); color: var(--green); font-size: 9px; font-style: normal; }
.rank-list span strong, .rank-list span small { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list span strong, .rank-list > div > b { font-size: 10px; }
.rank-list span small { color: var(--muted); font-size: 9px; }
.analytics-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.library-overview { margin-top: 34px; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(135deg,#fffdf8,#f0f4ea); }
.library-status { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 9px 12px; margin-bottom: 14px; border-radius: 10px; background: rgba(38,76,58,.07); color: var(--green); font-size: 11px; font-weight: 750; }
.library-status::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #70a579; box-shadow: 0 0 0 4px rgba(112,165,121,.12); }
.catalogue-unavailable .library-status { background: rgba(212,156,77,.09); color: #795d31; }
.catalogue-unavailable .library-status::before { background: #d49c4d; box-shadow: 0 0 0 4px rgba(212,156,77,.12); }
.discover-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.discover-cards > button { min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr); grid-template-rows: auto auto; gap: 4px 11px; align-items: center; padding: 15px; border: 1px solid #e1e6dc; border-radius: 14px; background: rgba(255,255,255,.75); color: var(--ink); text-align: left; cursor: pointer; transition: .2s; }
.discover-cards > button:hover { border-color: #bfcfc1; box-shadow: 0 9px 20px rgba(38,76,58,.08); transform: translateY(-2px); }
.discover-icon { grid-row: 1 / 3; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.discover-cards strong, .discover-cards small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-cards strong { font-size: 12px; }.discover-cards small { color: var(--muted); font-size: 9px; }
.library-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.discover-head { margin-bottom: 20px; }
.discover-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,248,.65); }
.discover-tabs button { flex: 1; min-width: 140px; padding: 10px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.discover-tabs button.active { background: var(--green); color: white; box-shadow: 0 5px 14px rgba(38,76,58,.17); }
.duplicate-groups { display: grid; gap: 14px; }
.duplicate-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.duplicate-group > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; background: #f6f5ef; }
.duplicate-group > header > div { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 10px; }
.duplicate-group > header strong, .duplicate-group > header small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duplicate-group > header strong { font-size: 12px; }.duplicate-group > header small, .duplicate-group > header > span { color: var(--muted); font-size: 9px; }
.duplicate-mark { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #ece3d0; color: #7a6337; font-size: 9px; font-weight: 900; }
.duplicate-item { width: 100%; display: grid; grid-template-columns: 36px minmax(220px,1fr) 110px 85px; align-items: center; gap: 12px; padding: 11px 17px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.duplicate-item:hover { background: #fdfcf7; }
.duplicate-item > span:nth-child(2), .duplicate-item strong, .duplicate-item small { min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duplicate-item strong { font-size: 12px; }.duplicate-item small, .duplicate-item time { margin-top: 3px; color: var(--muted); font-size: 9px; }.duplicate-item b { color: var(--muted); font-size: 10px; text-align: right; }
.security-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 28px; }
.security-grid article { display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.security-grid strong, .security-grid small { display: block; }
.security-grid small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.security-status { width: 11px; height: 11px; border-radius: 50%; background: #aeb6af; box-shadow: 0 0 0 5px rgba(120,130,123,.1); }
.security-status.good { background: #69a372; }.security-status.warn { background: #d49c4d; }
.security-events { margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.health-panel { margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.health-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.health-grid article { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 11px; background: #f5f5ef; }
.health-grid strong, .health-grid small { display: block; }.health-grid strong { font-size: 11px; }.health-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.health-light { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #d49c4d; box-shadow: 0 0 0 4px rgba(212,156,77,.12); }.health-light.good { background: #69a372; box-shadow: 0 0 0 4px rgba(105,163,114,.12); }
.health-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.health-actions button:disabled { opacity: .5; cursor: not-allowed; }
.recycle-row .restore-action { color: #37734b; }
.recycle-header { grid-template-columns: minmax(240px,1fr) 140px 90px minmax(112px,190px); }
.security-event { display: flex; align-items: center; gap: 12px; padding: 11px 5px; border-top: 1px solid var(--line); }
.security-event:first-child { border-top: 0; }
.security-event > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-weight: 900; }
.security-event strong, .security-event small { display: block; }.security-event strong { font-size: 11px; }.security-event small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.danger-button { padding: 10px 13px; border: 0; border-radius: 9px; background: #9d443c !important; color: white !important; font-size: 11px; font-weight: 800; cursor: pointer; }
.preview-shell { position: relative; }
.preview-nav { position: absolute; z-index: 2; top: 50%; width: 42px; height: 54px; border: 0; border-radius: 12px; background: rgba(22,35,29,.72); color: white; font-size: 34px; cursor: pointer; transform: translateY(-50%); }
.preview-nav.previous { left: 14px; }.preview-nav.next { right: 14px; }.preview-nav:disabled { opacity: .2; cursor: default; }
.manage-dialog { width: min(480px,calc(100vw - 32px)); padding: 0; border: 0; border-radius: 19px; background: var(--paper); box-shadow: var(--shadow); }
.manage-dialog::backdrop { background: rgba(18,30,24,.62); backdrop-filter: blur(5px); }
.manage-dialog form > header, .manage-dialog form > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.manage-dialog form > header { border-bottom: 1px solid var(--line); }.manage-dialog form > footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.manage-dialog h3 { margin: 0; font: 500 24px Georgia,serif; }
.manage-dialog form > label { display: grid; gap: 8px; margin: 18px 20px; color: var(--muted); font-size: 11px; font-weight: 700; }
.manage-dialog input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.manage-warning { margin: 0 20px 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }

@media (max-width: 760px) {
  .main-nav { grid-template-columns: repeat(6,1fr); }
  .nav-item { font-size: 9px; }
  .search-filters { top: 138px; right: 16px; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .sort-controls { order: 3; }
  .gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .gallery-visual { height: 120px; }
  .gallery-visual.video-visual { height: 120px; }
  .storage-locations, .analytics-grid, .security-grid, .health-grid, .discover-cards { grid-template-columns: 1fr; }
  .library-overview { padding: 19px; }
  .discover-tabs { display: grid; grid-template-columns: 1fr; }
  .discover-tabs button { min-width: 0; }
  .duplicate-item { grid-template-columns: 32px minmax(0,1fr); padding: 11px 13px; }
  .duplicate-item time, .duplicate-item b { display: none; }
  .preview-nav { width: 36px; height: 48px; }
}
