:root {
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-2: #f0f3ef;
  --ink: #10212b;
  --text: var(--ink);
  --panel: var(--surface);
  --muted: #55717f;
  --line: #d8e1df;
  --brand: #146c73;
  --brand-strong: #0f4f59;
  --accent: #ef9f3f;
  --accent-2: #f6bf72;
  --danger: #b03a2e;
  --radius: 16px;
  --shadow: 0 14px 32px rgba(16, 33, 43, 0.1);
  --motion-fast: 160ms;
  --motion-base: 260ms;
  --motion-slow: 420ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

body[data-theme='dark'] {
  --bg: #0d1216;
  --surface: #141b21;
  --surface-2: #1b252d;
  --ink: #e7eef3;
  --text: var(--ink);
  --panel: var(--surface);
  --muted: #99afbb;
  --line: #273641;
  --brand: #2ea7a4;
  --brand-strong: #8ed9d7;
  --accent: #f2b35b;
  --accent-2: #2b8c8a;
  --danger: #f1786b;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

body[data-theme='light'] {
  --ink: #0f2230;
  --muted: #3f5e6d;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20,108,115,0.18), transparent 55%),
    radial-gradient(900px 450px at 110% 10%, rgba(239,159,63,0.18), transparent 55%),
    var(--bg);
  min-height: 100vh;
  transition:
    background-color var(--motion-base) var(--ease-standard),
    background-image var(--motion-slow) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

body.is-ready .panel,
body.is-ready .dashboard-sidebar,
body.is-ready .metric,
body.is-ready .bar-item,
body.is-ready .features article,
body.is-ready .plan-card,
body.is-ready .popup-body,
body.is-ready .upload-panel,
body.is-ready .panel-user-list-nav,
body.is-ready .bug-report-panel.is-open {
  animation: surface-enter var(--motion-slow) var(--ease-emphasized) both;
}

body.is-ready .metric:nth-of-type(2),
body.is-ready .bar-item:nth-of-type(2),
body.is-ready .features article:nth-of-type(2),
body.is-ready .plan-card:nth-of-type(2) {
  animation-delay: 80ms;
}

body.is-ready .metric:nth-of-type(3),
body.is-ready .bar-item:nth-of-type(3),
body.is-ready .features article:nth-of-type(3),
body.is-ready .plan-card:nth-of-type(3) {
  animation-delay: 140ms;
}

body.is-ready .metric:nth-of-type(4),
body.is-ready .bar-item:nth-of-type(4),
body.is-ready .features article:nth-of-type(4),
body.is-ready .plan-card:nth-of-type(4) {
  animation-delay: 200ms;
}

.panel,
.dashboard-sidebar,
.item,
.context-menu,
.popup-body,
.share-card,
.drive-mock,
.features article,
.plan-card,
.viewer,
.storage-toolbar,
.upload-panel,
.mobile-item-actions,
.metric,
.bar-item,
.bug-report-fab,
.bug-report-panel,
.panel-user-list-page {
  transition:
    transform var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    opacity var(--motion-fast) var(--ease-standard);
}

.panel:hover,
.dashboard-sidebar:hover,
.features article:hover,
.plan-card:hover,
.metric:hover,
.bar-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(16, 33, 43, 0.12);
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body[data-theme='dark'] .site-header {
  background: rgba(13, 18, 22, 0.9);
}

body[data-theme='dark'] .panel,
body[data-theme='dark'] .dashboard-sidebar,
body[data-theme='dark'] .item,
body[data-theme='dark'] .context-menu,
body[data-theme='dark'] .popup-body,
body[data-theme='dark'] .share-card,
body[data-theme='dark'] .drive-mock,
body[data-theme='dark'] .features article,
body[data-theme='dark'] .plan-card,
body[data-theme='dark'] .viewer,
body[data-theme='dark'] .storage-toolbar,
body[data-theme='dark'] .upload-panel,
body[data-theme='dark'] .mobile-item-actions {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .dash-link:hover,
body[data-theme='dark'] .dash-link-toggle:hover {
  background: rgba(96, 163, 176, 0.12);
}

body[data-theme='dark'] .dash-submenu {
  border-left-color: var(--line);
}

body[data-theme='dark'] .storage-grid,
body[data-theme='dark'] .trash-grid {
  background: var(--surface);
  border-color: var(--line);
}

body[data-theme='dark'] .legal,
body[data-theme='dark'] .not-found,
body[data-theme='dark'] .maintenance-card,
body[data-theme='dark'] .ad-slot,
body[data-theme='dark'] .metric,
body[data-theme='dark'] .bar-item,
body[data-theme='dark'] .captcha-widget,
body[data-theme='dark'] .finance-edit-card,
body[data-theme='dark'] .finance-modal,
body[data-theme='dark'] .finance-breakdown > div,
body[data-theme='dark'] .finance-provider-wrap,
body[data-theme='dark'] .finance-provider-option,
body[data-theme='dark'] .verify-modal,
body[data-theme='dark'] .toast,
body[data-theme='dark'] .legal-modal-form,
body[data-theme='dark'] .legal-check-item,
body[data-theme='dark'] .legal-doc-link,
body[data-theme='dark'] .context-menu button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .site-footer,
body[data-theme='dark'] .mobile-item-actions,
body[data-theme='dark'] .upload-panel {
  background: rgba(20, 27, 33, 0.92);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .table th,
body[data-theme='dark'] .table td,
body[data-theme='dark'] .finance-plan-delete,
body[data-theme='dark'] .dash-link-alert,
body[data-theme='dark'] .upload-overall-track,
body[data-theme='dark'] .upload-task-track {
  border-color: var(--line);
}

body[data-theme='dark'] .captcha-widget,
body[data-theme='dark'] .finance-breakdown > div,
body[data-theme='dark'] .finance-provider-wrap,
body[data-theme='dark'] .bar-item,
body[data-theme='dark'] .legal-doc-link,
body[data-theme='dark'] .legal-check-item,
body[data-theme='dark'] .verify-code,
body[data-theme='dark'] .upload-overall-track,
body[data-theme='dark'] .upload-task-track {
  background: var(--surface-2);
}

body[data-theme='dark'] .verify-code {
  color: var(--brand-strong);
  border-color: rgba(142, 217, 215, 0.35);
}

body[data-theme='dark'] .finance-modal-close,
body[data-theme='dark'] .verify-close-x,
body[data-theme='dark'] .mobile-item-actions-head button,
body[data-theme='dark'] .move-picker-actions button,
body[data-theme='dark'] .upload-task-cancel {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .finance-modal-close:hover,
body[data-theme='dark'] .verify-close-x:hover,
body[data-theme='dark'] .mobile-item-actions-head button:hover,
body[data-theme='dark'] .move-picker-actions button:hover {
  background: rgba(96, 163, 176, 0.16);
}

body[data-theme='dark'] .legal-modal-icon {
  background: linear-gradient(145deg, rgba(46, 167, 164, 0.18), rgba(142, 217, 215, 0.08));
  border-color: rgba(142, 217, 215, 0.3);
  color: var(--brand-strong);
}

body[data-theme='dark'] .legal-doc-link:hover,
body[data-theme='dark'] .context-menu button:hover {
  background: rgba(96, 163, 176, 0.14);
}

body[data-theme='dark'] .captcha-widget legend,
body[data-theme='dark'] .captcha-prompt,
body[data-theme='dark'] .finance-breakdown span,
body[data-theme='dark'] .footer-grid a,
body[data-theme='dark'] .footer-grid span,
body[data-theme='dark'] .footer-grid p {
  color: var(--muted);
}

body[data-theme='dark'] .captcha-option,
body[data-theme='dark'] .finance-method-select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .finance-balance {
  background: linear-gradient(135deg, rgba(46, 167, 164, 0.14), rgba(35, 53, 66, 0.92));
  border-color: #2d4b56;
}

body[data-theme='dark'] .finance-amount,
body[data-theme='dark'] .finance-feature-list li strong {
  color: #eef7fb;
}

body[data-theme='dark'] .finance-card,
body[data-theme='dark'] .finance-plan-toggle-grid label,
body[data-theme='dark'] .usage-chip,
body[data-theme='dark'] .path-bar button,
body[data-theme='dark'] .empty-placeholder,
body[data-theme='dark'] .item,
body[data-theme='dark'] .audio-player-card,
body[data-theme='dark'] .share-download-inline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .finance-feature-list,
body[data-theme='dark'] .finance-plan-manage summary small,
body[data-theme='dark'] .empty-placeholder,
body[data-theme='dark'] .usage-chip,
body[data-theme='dark'] .path-bar button {
  color: var(--muted);
}

body[data-theme='dark'] .active-view,
body[data-theme='dark'] .selection-mode-on {
  background: rgba(46, 167, 164, 0.18) !important;
  border-color: rgba(46, 167, 164, 0.34) !important;
  color: var(--ink);
}

body[data-theme='dark'] .storage-grid.dragging,
body[data-theme='dark'] .item.drop-target {
  background: rgba(46, 167, 164, 0.12);
}

body[data-theme='dark'] .item .thumb,
body[data-theme='dark'] .item.file .thumb,
body[data-theme='dark'] .item.folder .thumb {
  background: #21303a;
}

body[data-theme='dark'] .thumb-tag {
  background: #1b2a33;
  border-color: #35515f;
  color: #d9edf6;
}

body[data-theme='dark'] .path-bar button:hover,
body[data-theme='dark'] .share-download-inline:hover {
  background: rgba(46, 167, 164, 0.14);
}

body[data-theme='dark'] .captcha-shape-text {
  color: var(--ink);
}

body[data-theme='dark'] input,
body[data-theme='dark'] select,
body[data-theme='dark'] textarea {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .field-error,
body[data-theme='dark'] .field-error-inline {
  color: #f2a39b;
}

body[data-theme='dark'] .error-box {
  background: #2a1b1b;
  border-color: #5b2a2a;
  color: #f4c7c2;
}

body[data-theme='dark'] .shared-outgoing-group,
body[data-theme='dark'] .shared-outgoing-target,
body[data-theme='dark'] .move-picker-list,
body[data-theme='dark'] .move-picker-row,
body[data-theme='dark'] .move-picker-path button,
body[data-theme='dark'] .share-viewer,
body[data-theme='dark'] .share-viewer-close,
body[data-theme='dark'] .share-viewer-download,
body[data-theme='dark'] .share-viewer-nav {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='dark'] .shared-outgoing-target {
  background: var(--surface-2);
}

body[data-theme='dark'] .shared-outgoing-head,
body[data-theme='dark'] .shared-outgoing-target small,
body[data-theme='dark'] .share-card-meta,
body[data-theme='dark'] .share-viewer-meta {
  color: var(--muted);
}

body[data-theme='dark'] .move-picker-row.active {
  border-color: rgba(46, 167, 164, 0.45);
  box-shadow: 0 0 0 2px rgba(46, 167, 164, 0.22);
}

body[data-theme='dark'] .move-picker-path button:hover,
body[data-theme='dark'] .share-viewer-close:hover,
body[data-theme='dark'] .share-viewer-download:hover,
body[data-theme='dark'] .share-viewer-nav:hover {
  background: rgba(46, 167, 164, 0.18);
}

body[data-theme='light'] input,
body[data-theme='light'] select,
body[data-theme='light'] textarea {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme='light'] .panel,
body[data-theme='light'] .dashboard-sidebar,
body[data-theme='light'] .popup-body,
body[data-theme='light'] .table th,
body[data-theme='light'] .table td,
body[data-theme='light'] .item,
body[data-theme='light'] .context-menu button {
  color: var(--ink);
}

body[data-theme='dark'] .btn.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}

body[data-theme='dark'] .upload-task-cancel {
  background: var(--surface-2);
  border-color: var(--line);
  color: #9bb3bf;
}

body[data-theme='dark'] .upload-task-cancel:hover {
  background: rgba(241, 120, 107, 0.18);
  border-color: rgba(241, 120, 107, 0.55);
  color: #ffb0a8;
}

body[data-theme='dark'] .badge {
  background: rgba(46, 167, 164, 0.2);
  border-color: rgba(46, 167, 164, 0.5);
  color: #c5eeed;
}

body.modal-open {
  overflow: hidden;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { width: min(1160px, 92%); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(246, 247, 243, 0.82);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-nav > a,
.site-nav > .btn,
.site-nav .inline-form .link-button {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-strong);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.site-nav > a:hover,
.site-nav > .btn:hover,
.site-nav .inline-form .link-button:hover {
  text-decoration: none;
  background: #edf6f4;
  border-color: #cfe0db;
  color: #0f5a64;
}

.site-nav > a:active,
.site-nav > .btn:active,
.site-nav .inline-form .link-button:active {
  transform: translateY(1px);
}

body[data-theme='dark'] .site-nav > a,
body[data-theme='dark'] .site-nav > .btn,
body[data-theme='dark'] .site-nav .inline-form .link-button {
  color: #9edee0;
}

body[data-theme='dark'] .site-nav > a:hover,
body[data-theme='dark'] .site-nav > .btn:hover,
body[data-theme='dark'] .site-nav .inline-form .link-button:hover {
  background: rgba(33, 61, 73, 0.72);
  border-color: rgba(94, 147, 157, 0.35);
  color: #c7f6f5;
}

body[data-theme='dark'] .site-nav > a.is-current,
body[data-theme='dark'] .site-nav > .btn.is-current,
body[data-theme='dark'] .site-nav .inline-form .link-button.is-current {
  background: linear-gradient(135deg, #1b8b90, #136772);
  border-color: #1c7f86;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(17, 81, 90, 0.38);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.link-button:hover {
  text-decoration: underline;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(135deg, var(--brand), #0b5662);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(20, 108, 115, 0.26);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(20, 108, 115, 0.34); text-decoration: none; }
.btn.btn-ghost { background: #fff; color: var(--brand-strong); border: 1px solid var(--line); box-shadow: none; }
.btn.btn-xs { padding: 8px 12px; font-size: 13px; }
.btn:disabled,
.btn-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
}

.badge {
  display: inline-block;
  border: 1px solid rgba(20, 108, 115, 0.3);
  color: var(--brand-strong);
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: rgba(20, 108, 115, 0.08);
}

.badge.warning {
  color: #996311;
  border-color: rgba(153, 99, 17, 0.4);
  background: rgba(239, 159, 63, 0.2);
}

.hero {
  padding: 56px 0 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 30px;
  align-items: center;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.08;
}

.hero p { font-size: 17px; color: var(--muted); max-width: 58ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.drive-mock {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: appearUp 0.8s ease;
}

@keyframes appearUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.mock-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #eef5f4, #f7f5ef);
}
.mock-toolbar span {
  width: 10px; height: 10px; border-radius: 50%; background: #d0dbd7;
}
.mock-toolbar strong { margin-left: auto; font-size: 12px; color: #43606e; letter-spacing: 0.04em; }

.mock-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mock-card {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fcfdfc;
  font-size: 13px;
}
.mock-card.folder::before { content: '[DIR] '; }
.mock-card.image::before { content: '[IMG] '; }
.mock-card.video::before { content: '[VID] '; }
.mock-card.doc::before { content: '[DOC] '; }
.mock-card.file::before { content: '[FILE] '; }

.features {
  margin: 22px auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.features article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(16,33,43,0.05);
}
.features h3 { margin: 0 0 8px; font-size: 17px; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tariffs { margin: 26px auto; }
.tariff-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.plan-card h3 { margin: 0 0 10px; }
.plan-card p { margin: 0 0 6px; color: var(--muted); }

.trust {
  margin: 24px auto 34px;
  background: linear-gradient(120deg, rgba(20,108,115,0.08), rgba(239,159,63,0.08));
  border: 1px solid rgba(20,108,115,0.2);
  border-radius: 16px;
  padding: 18px;
}
.trust ul { margin: 10px 0 0; padding-left: 18px; }
.trust li { margin-bottom: 6px; }

.ad-slot {
  margin: 18px auto;
  border: 1px dashed #b8c8c3;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-height: 64px;
}
.ad-slot img { max-width: 100%; border-radius: 12px; }

.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(8px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
  padding: 20px 0;
}
.footer-grid a, .footer-grid span { display: block; color: var(--muted); margin-bottom: 6px; }
.footer-grid p { color: var(--muted); margin: 6px 0 0; }

.flash {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.flash-success { border-color: #8dc4b5; background: #eef9f5; }
.flash-error { border-color: #d8a7a0; background: #fff3f1; }
.flash-info { border-color: #95b8ce; background: #f0f7fd; }

body[data-theme='dark'] .flash {
  background: #141f27;
  border-color: #2c4a5d;
  color: #d8e9f7;
}

body[data-theme='dark'] .flash-success {
  background: #13261f;
  border-color: #2d6d57;
  color: #cff4e7;
}

body[data-theme='dark'] .flash-error {
  background: #2b1b1b;
  border-color: #7f3f38;
  color: #ffd9d4;
}

body[data-theme='dark'] .flash-info {
  background: #152634;
  border-color: #3b6482;
  color: #daeeff;
}

.auth-page {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.auth-card {
  width: min(520px, 95%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.auth-card.wide { width: min(760px, 95%); }
.auth-card h1 { margin: 0 0 8px; font-size: 30px; }
.auth-card h2 { margin: 22px 0 8px; font-size: 20px; }
.muted { color: var(--muted); }

.auth-card form,
.grid-form {
  display: grid;
  gap: 10px;
}

label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea {
  border: 1px solid #c7d4d0;
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 100px; resize: vertical; }

.input-invalid {
  border-color: #d07b73 !important;
  box-shadow: 0 0 0 3px rgba(208, 123, 115, 0.18);
}

.field-error {
  color: #a33f36;
  font-size: 12px;
  line-height: 1.35;
}

.field-error-inline {
  margin-top: 2px;
  display: block;
  text-align: right;
}

.error-box {
  margin: 10px 0;
  border: 1px solid #d8a7a0;
  background: #fff3f1;
  color: #7f2f29;
  padding: 10px;
  border-radius: 10px;
}

.step-form .step {
  display: none;
  animation: stepIn 0.35s ease;
}
.step-form .step.active { display: grid; gap: 10px; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.captcha-widget {
  margin: 2px 0 4px;
  border: 1px solid #d5e3df;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fcfb;
}

.captcha-widget legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #2d5a67;
}

.captcha-prompt {
  margin: 0 0 10px;
  font-size: 14px;
  color: #274753;
}

.captcha-options {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.captcha-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid #cfe0db;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.captcha-option:hover {
  border-color: #9ec6bc;
  transform: translateY(-1px);
}

.captcha-radio {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.captcha-radio:focus-visible + .captcha-shape {
  outline: 2px solid #3c87d5;
  outline-offset: 6px;
}

.captcha-radio:checked ~ .captcha-shape,
.captcha-option:has(.captcha-radio:checked) .captcha-shape {
  transform: scale(1.06);
}

.captcha-option:has(.captcha-radio:checked) {
  border-color: #4b9a86;
  box-shadow: 0 0 0 2px rgba(75, 154, 134, 0.18);
}

.captcha-shape {
  width: 24px;
  height: 24px;
  display: inline-block;
  background: var(--captcha-color, #177f93);
}

.captcha-shape-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  font-size: 22px;
  font-weight: 800;
  color: #1f4955;
}

.captcha-shape.shape-circle {
  border-radius: 50%;
}

.captcha-shape.shape-square {
  border-radius: 6px;
}

.captcha-shape.shape-triangle {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid var(--captcha-color, #177f93);
  background: transparent;
}

.captcha-shape.shape-diamond {
  border-radius: 4px;
  transform: rotate(45deg);
}

.captcha-shape.shape-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 35%);
}

.captcha-shape.shape-hexagon {
  clip-path: polygon(25% 4%, 75% 4%, 96% 50%, 75% 96%, 25% 96%, 4% 50%);
}

.form-row.between {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.auth-links, .oauth-line {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 18px;
  padding-top: 20px;
}

.dashboard.shell {
  width: min(1160px, 92%);
  margin: 0 auto;
}

.dashboard-storage {
  min-height: calc(100vh - 86px);
}

.dashboard-storage.shell {
  width: calc(100% - 12px);
  max-width: none;
  margin-left: 6px;
  margin-right: 6px;
}

.dashboard-sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.dashboard-storage .dashboard-sidebar {
  max-height: calc(100vh - 94px);
  overflow: auto;
}

.dash-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink);
}
.dash-link:hover { background: #edf4f3; text-decoration: none; }
.dash-accordion {
  display: grid;
  gap: 8px;
}
.dash-link-toggle {
  width: 100%;
  cursor: pointer;
  list-style: none;
  border: 0;
  background: transparent;
}
.dash-link-toggle::-webkit-details-marker {
  display: none;
}
.dash-link-toggle::marker {
  display: none;
}
.dash-accordion-arrow {
  font-size: 15px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.dash-accordion[open] .dash-accordion-arrow {
  transform: rotate(180deg);
}
.dash-submenu {
  display: grid;
  gap: 6px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  transform-origin: top;
}
.dash-accordion[open] .dash-submenu {
  animation: dash-submenu-enter var(--motion-base) var(--ease-emphasized) both;
}
.dash-sublink {
  min-height: 40px;
  font-size: 14px;
}
.dash-link-alert {
  background: #fff2f2;
  border: 1px solid #f4c6c6;
}
.dash-link-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d32f2f;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.18);
  flex: 0 0 auto;
}

@keyframes dash-submenu-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.dash-warning-note {
  margin-top: -3px;
  margin-bottom: 4px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.3;
  color: #9d2e2e;
}

.dashboard-content {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.storage-page {
  min-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trash-page {
  min-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trash-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #d1e0dc;
  border-radius: 12px;
  background: #f9fcfb;
  padding: 10px 12px;
}

.trash-actions-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trash-grid {
  min-height: clamp(420px, calc(100vh - 250px), 1200px);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.trash-card {
  cursor: pointer;
}

.item-shared-users {
  display: block;
  margin-top: 0.15rem;
  line-height: 1.35;
  word-break: break-word;
}

.item-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trash-card .thumb {
  height: 64px;
}

.storage-grid.trash-grid[data-mode='list'] .trash-card {
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
}

.storage-grid.trash-grid[data-mode='list'] .trash-card .thumb {
  width: 64px;
  height: 64px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finance-balance {
  display: grid;
  gap: 8px;
  background: linear-gradient(135deg, #eef9f7, #f6fbff);
  border-color: #cfe1dc;
}

.finance-amount {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  color: #0f515c;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.finance-card {
  border: 1px solid #d7e6e1;
  border-radius: 12px;
  background: #fbfdfd;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.finance-plan-recommended {
  border-color: #7db6a8;
  box-shadow: 0 10px 20px rgba(26, 120, 110, 0.14);
}

.finance-feature-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #304f5f;
}

.finance-feature-list li strong {
  color: #112833;
}

.finance-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.finance-edit-card {
  border: 1px solid #d5e3df;
  border-radius: 12px;
  background: #fbfdfd;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.finance-plan-create {
  margin-bottom: 12px;
}

.finance-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.finance-plan-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
}

.finance-plan-toggle-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d6e4e0;
  border-radius: 10px;
  background: #f9fcfb;
  padding: 8px 9px;
  font-size: 13px;
}

.finance-plan-manage summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.finance-plan-manage summary::-webkit-details-marker {
  display: none;
}

.finance-plan-manage[open] summary {
  margin-bottom: 8px;
}

.finance-plan-fields {
  gap: 8px;
}

.finance-plan-delete {
  margin-top: 6px;
  border-top: 1px dashed #d0dfda;
  padding-top: 8px;
  display: grid;
  gap: 8px;
}

.finance-edit-card textarea {
  min-height: 80px;
}

.finance-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 20, 28, 0.56);
}

.finance-modal-overlay[hidden] {
  display: none !important;
}

.finance-modal {
  width: min(560px, calc(100vw - 22px));
  border-radius: 16px;
  border: 1px solid #cdded9;
  background: #fff;
  box-shadow: 0 22px 40px rgba(15, 37, 46, 0.26);
  padding: 16px;
  display: grid;
  gap: 12px;
  position: relative;
}

.finance-modal h3 {
  margin: 0;
  padding-right: 34px;
}

.finance-modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #c8d9d4;
  background: #f4f8f7;
  color: #3b5965;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.finance-modal-close:hover {
  background: #e7f1ef;
}

.finance-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.finance-breakdown > div {
  border: 1px solid #d6e5e0;
  border-radius: 12px;
  background: #f8fcfb;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.finance-breakdown span {
  font-size: 12px;
  color: #4f6f7c;
}

.finance-breakdown strong {
  font-size: 20px;
  line-height: 1.15;
}

.finance-provider-wrap {
  border: 1px solid #d8e6e2;
  border-radius: 12px;
  background: #fbfdfc;
  padding: 10px;
}

.finance-provider-grid {
  display: grid;
  gap: 8px;
}

.finance-provider-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d3e2de;
  background: #fff;
  cursor: pointer;
}

.finance-provider-option:has(input:checked) {
  border-color: #63ab95;
  box-shadow: 0 0 0 2px rgba(99, 171, 149, 0.16);
}

.finance-provider-option input {
  margin: 0;
}

.finance-method-select {
  width: 100%;
  border: 1px solid #c7d8d3;
  border-radius: 10px;
  background: #fff;
  color: #14232b;
  padding: 10px 12px;
}

.finance-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.profile-head {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.profile-head-card {
  background:
    radial-gradient(circle at 88% 10%, rgba(16, 117, 126, 0.12), transparent 42%),
    linear-gradient(135deg, var(--surface), var(--surface-2));
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.profile-avatar-shell {
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f6d7a, #7fb38f);
}

.profile-head-main {
  display: grid;
  gap: 8px;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-title-row h2 {
  margin: 0;
}

.profile-handle {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.profile-account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.user-account-badges-inline {
  display: inline-flex;
  align-items: center;
}

.user-account-badges-inline .profile-account-badges {
  margin-top: 6px;
}

.account-badge-pill {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfdce2;
  background: linear-gradient(180deg, #f8fbfd, #eef4f7);
  box-shadow: 0 8px 18px rgba(20, 35, 43, 0.08);
}

.account-badge-pill svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.account-badge-pill svg .account-badge-fill,
.account-badge-pill svg .account-badge-fill * {
  fill: currentColor;
  stroke: none;
}

.account-badge-pill-bot {
  color: #2689c8;
}

.account-badge-pill-government {
  color: #2f63d8;
}

.account-badge-pill-official {
  color: #1f9f63;
}

.account-badge-pill-automated_app {
  color: #2678ff;
}

.profile-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-meta-chips .badge {
  margin: 0;
}

.profile-logout-panel {
  display: grid;
  gap: 8px;
}

.avatar {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.owner-maintenance-panel {
  display: grid;
  gap: 16px;
}

.owner-maintenance-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.owner-maintenance-form {
  display: grid;
  gap: 16px;
}

.owner-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.owner-maintenance-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.owner-maintenance-switch input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.owner-maintenance-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.owner-maintenance-mode-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.owner-maintenance-mode-card.is-active {
  border-color: rgba(20, 108, 115, 0.35);
  box-shadow: inset 0 0 0 1px rgba(20, 108, 115, 0.18);
}

.owner-maintenance-mode-card p {
  margin: 8px 0 0;
}

.owner-maintenance-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.owner-maintenance-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
}

.owner-maintenance-form textarea,
.owner-maintenance-form select[multiple] {
  min-height: 132px;
}

.owner-account-badges-form {
  display: grid;
  gap: 16px;
}

.owner-account-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.owner-account-badge-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
}

.owner-account-badge-card.is-selected {
  border-color: rgba(20, 108, 115, 0.35);
  box-shadow: inset 0 0 0 1px rgba(20, 108, 115, 0.18);
}

.owner-account-badge-card input {
  margin: 2px 0 0;
}

.owner-account-badge-card strong,
.owner-account-badge-card small {
  display: block;
}

.owner-account-badge-card small {
  margin-top: 4px;
  line-height: 1.45;
}

.profile-password-form .btn {
  justify-self: start;
  min-width: 220px;
}

.login-confirm-form {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  justify-content: space-between;
}

.login-confirm-form > label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.login-confirm-form > label input[type='checkbox'] {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  border-bottom: 1px solid #e3ece9;
  text-align: left;
  padding: 8px;
  vertical-align: top;
}

.audit-controls {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 10px;
  margin-bottom: 10px;
}

.user-manage-modal {
  gap: 14px;
}

.user-manage-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-manage-head h3 {
  margin: 0 0 4px;
}

.user-manage-head p {
  margin: 0;
}

.user-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-manage-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}

.user-manage-field strong {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.user-manage-field span {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-row-hidden-editors[hidden] {
  display: none !important;
}

.user-manage-edit-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.user-manage-edit-block h4 {
  margin: 0;
}

.user-manage-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.user-manage-edit-field {
  display: grid;
  gap: 6px;
}

.user-manage-edit-field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.user-manage-edit-field input,
.user-manage-edit-field select {
  width: 100%;
}

@media (max-width: 900px) {
  .user-manage-edit-grid {
    grid-template-columns: 1fr;
  }
}

.danger-action {
  background: linear-gradient(135deg, #b65448, #a43e33) !important;
  color: #fff !important;
  border: 0 !important;
}

.storage-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.usage-chip {
  border: 1px solid #bad0ca;
  border-radius: 999px;
  padding: 8px 12px;
  background: #f4fbf9;
}

.storage-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.storage-toolbar input[type='text'] {
  flex: 1 1 220px;
  min-width: 180px;
}

.active-view {
  background: #e8f4f2 !important;
  border-color: #9ec7be !important;
}

.view-mode-btn {
  width: 38px;
  min-width: 38px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.view-mode-btn span {
  transform: translateY(-1px);
}

.selection-mode-on {
  background: #e8f4f2 !important;
  border-color: #86b9ad !important;
}

.path-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.path-bar button {
  border: 1px solid #c6d7d2;
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}

.storage-grid {
  min-height: clamp(520px, calc(100vh - 280px), 1400px);
  height: 100%;
  flex: 1 1 auto;
  background: #fff;
  border: 1px dashed #bdd1cb;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  align-content: start;
}

.storage-grid[data-mode='list'] {
  grid-template-columns: 1fr;
}

.storage-grid[data-mode='list'] .item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: none;
}

.storage-grid[data-mode='list'] .item .thumb {
  width: 56px;
  height: 56px;
}

.storage-grid[data-mode='list'] .item .item-name {
  margin-right: auto;
}

.empty-placeholder {
  width: 100%;
  border: 1px dashed #d4e2de;
  border-radius: 12px;
  padding: 14px;
  background: #fbfdfd;
}

.storage-grid.dragging {
  background: #edf8f6;
  border-color: var(--brand);
}

.item {
  border: 1px solid #dbe7e3;
  border-radius: 12px;
  background: #fbfdfc;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  display: grid;
  gap: 6px;
  transition: transform 0.12s ease;
  width: 100%;
  max-width: none;
}
.item:hover { transform: translateY(-1px); }
.item.active {
  border-color: #8eb7ae;
  box-shadow: 0 8px 18px rgba(20, 108, 115, 0.12);
}
.item.drop-target {
  border-color: #3d8e7d;
  box-shadow: 0 0 0 2px rgba(61, 142, 125, 0.22);
  background: #f3fbf8;
}
.item .thumb {
  height: 72px;
  border-radius: 8px;
  background: #e8f1ee;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.item-share-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(13, 108, 111, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  z-index: 2;
}
.item-access-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(24, 133, 92, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  z-index: 2;
}
.thumb-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #274f5b;
  border: 1px solid #b5ccc6;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f0f8f6;
}
.item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item .thumb video.thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  border-radius: 0;
  background: #dce6eb;
}
.item .item-name {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.item.folder .thumb { background: #eef2dd; }
.item.file .thumb { background: #e8edf1; }
.item video { width: 100%; max-height: 60vh; border-radius: 10px; }

.context-menu {
  position: fixed;
  z-index: 100;
  display: grid;
  gap: 2px;
  min-width: 180px;
  background: #fff;
  border: 1px solid #cddbd6;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(16,33,43,0.15);
  overflow: hidden;
}
.context-menu[hidden] {
  display: none !important;
}
.context-menu button {
  border: 0;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}
.context-menu button:hover { background: #eef6f4; }
.context-menu button.danger { color: var(--danger); }

.mobile-item-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 175;
  border-top: 1px solid #c9d8d3;
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(6px);
  box-shadow: 0 -16px 30px rgba(12, 24, 34, 0.18);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}

.mobile-item-actions[hidden] {
  display: none !important;
}

.mobile-item-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-item-actions-head strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-actions-head button {
  border: 1px solid #d2dfda;
  background: #f5faf8;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.mobile-item-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mobile-item-actions-grid button {
  border: 1px solid #d6e2de;
  border-radius: 11px;
  background: #f8fcfb;
  color: #1f4450;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 6px;
  cursor: pointer;
}

.mobile-item-actions-grid button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mobile-item-actions-grid button.danger {
  color: #9d3127;
  background: #fff2f0;
  border-color: #ebc1bb;
}

.item-access-dialog {
  width: min(760px, 94vw);
}

.item-access-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.item-access-form {
  display: grid;
  grid-template-columns: 1fr 230px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.item-access-form label {
  margin: 0;
}

.item-access-list {
  max-height: min(52vh, 460px);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.item-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e4df;
  border-radius: 12px;
  background: #f8fcfb;
  padding: 10px 12px;
}

.item-access-row.empty {
  display: grid;
  justify-content: start;
  background: #fbfdfd;
}

.item-access-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.item-access-main strong,
.item-access-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-outgoing-dialog {
  width: min(880px, 96vw);
}

.shared-outgoing-list {
  max-height: min(60vh, 520px);
}

.shared-outgoing-group {
  border: 1px solid #d8e4df;
  border-radius: 12px;
  background: #f8fcfb;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.shared-outgoing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.shared-outgoing-targets {
  display: grid;
  gap: 6px;
}

.shared-outgoing-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d6e2de;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}

@media (min-width: 901px) {
  .mobile-item-actions {
    display: none !important;
  }
}

.viewer {
  width: min(1000px, 95vw);
  border: 1px solid #d0ddd9;
  border-radius: 12px;
  padding: 12px;
}
.viewer::backdrop { background: rgba(3, 15, 25, 0.7); }
.viewer iframe {
  border: 1px solid #d9e4e1;
  border-radius: 8px;
}
.viewer .close {
  float: right;
  border: 0;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}
.viewer .viewer-download {
  float: right;
  width: 36px;
  height: 36px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1px solid #cddbd7;
  display: grid;
  place-items: center;
  color: #244956;
  background: #f4faf8;
  font-size: 22px;
  text-decoration: none;
}
.viewer .viewer-download:hover {
  background: #e7f2ef;
  text-decoration: none;
}
.viewer img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  margin: 18px auto;
}
.viewer video {
  max-width: 100%;
  width: 100%;
  max-height: 78vh;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
  margin: 18px auto;
  border-radius: 10px;
  background: #000;
}

.audio-player-card {
  width: min(860px, 100%);
  margin: 18px auto;
  border: 1px solid #c6dbd4;
  border-radius: 16px;
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(20, 108, 115, 0.22), transparent 62%),
    radial-gradient(120% 100% at 100% 10%, rgba(239, 159, 63, 0.16), transparent 58%),
    linear-gradient(160deg, #f6fcfb, #ebf4f8);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.audio-player-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.audio-player-cover {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid #bad1cb;
  background:
    radial-gradient(circle at 30% 25%, rgba(239, 159, 63, 0.66), transparent 35%),
    linear-gradient(145deg, #185f6e, #0f4450);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(16, 65, 78, 0.25);
}

.audio-player-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.audio-player-title {
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.audio-player-subtitle {
  font-size: 13px;
}

.audio-player-bars {
  height: 58px;
  border: 1px solid #d2e3de;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  padding: 8px 10px;
}

.audio-player-bars span {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a95a4, #1b5a66);
  animation: audioBars 1.35s ease-in-out infinite alternate;
  animation-delay: var(--bar-delay, 0s);
}

.audio-player-bars.is-paused span {
  animation-play-state: paused;
  opacity: 0.4;
}

.audio-player-progress {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #486877;
}

.audio-player-control {
  width: 100%;
}

.archive-preview-card {
  width: min(960px, 100%);
  margin: 18px auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.archive-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.archive-preview-title-group {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.archive-preview-title {
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.archive-preview-subtitle,
.archive-preview-hint {
  font-size: 13px;
}

.archive-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.archive-preview-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.archive-entry-list {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.archive-entry-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 12px;
  padding-left: calc(12px + (var(--archive-depth, 0) * 14px));
}

.archive-entry-icon {
  min-width: 42px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(20, 108, 115, 0.2);
  background: rgba(20, 108, 115, 0.08);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.archive-entry-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.archive-entry-name {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.archive-entry-meta,
.archive-entry-empty {
  font-size: 12px;
}

@keyframes audioBars {
  from { height: 22%; opacity: 0.68; }
  to { height: 96%; opacity: 1; }
}

.selection-box {
  position: fixed;
  z-index: 145;
  pointer-events: none;
  border: 1px solid #2f85cc;
  background: rgba(47, 133, 204, 0.15);
  border-radius: 6px;
}

.popup-dialog {
  width: min(520px, 94vw);
  border: 1px solid #cddcd7;
  border-radius: 14px;
  padding: 0;
}

.popup-dialog::backdrop {
  background: rgba(3, 15, 25, 0.55);
}

.popup-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.popup-body h3 {
  margin: 0;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn.btn-danger {
  background: linear-gradient(135deg, #b03a2e, #8f251b);
  color: #fff;
  box-shadow: 0 8px 18px rgba(143, 37, 27, 0.24);
}

.ui-dialog {
  width: min(520px, 94vw);
}

.ui-dialog-body {
  gap: 10px;
}

.ui-dialog-content {
  display: grid;
  gap: 8px;
}

.ui-dialog-input-wrap {
  display: grid;
  gap: 6px;
}

.ui-dialog-input {
  width: 100%;
}

.ui-dialog-input[type='text'],
.ui-dialog-input[type='number'],
.ui-dialog-input[type='email'],
.ui-dialog-input[type='password'],
.ui-dialog-input[type='search'],
.ui-dialog-input select,
.ui-dialog-input textarea {
  border: 1px solid #c8d9d4;
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

.ui-dialog-error {
  margin: 0;
}

.move-dialog {
  width: min(620px, 96vw);
}

.convert-dialog {
  width: min(860px, 96vw);
}

.convert-dialog-current {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.convert-options {
  display: grid;
  gap: 14px;
}

.convert-progress {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.convert-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.convert-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, #8fbfc3 24%);
}

.convert-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 28%, transparent);
  transition: width 0.35s ease;
}

.convert-options-empty {
  margin: 0;
}

.convert-group {
  display: grid;
  gap: 10px;
}

.convert-group-title {
  margin: 0;
  font-size: 15px;
}

.convert-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.convert-option {
  display: grid;
  gap: 4px;
  align-content: start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 13px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.convert-option:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 108, 115, 0.42);
  box-shadow: 0 10px 20px rgba(16, 33, 43, 0.08);
}

.convert-option.is-active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent);
}

.convert-option strong,
.convert-option small {
  pointer-events: none;
}

.move-picker-path {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.move-picker-path button {
  border: 1px solid #c8d9d4;
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}

.move-picker-list {
  border: 1px solid #d4e2de;
  border-radius: 12px;
  background: #fbfdfc;
  display: grid;
  gap: 6px;
  padding: 8px;
  max-height: 320px;
  overflow: auto;
}

.move-picker-row {
  border: 1px solid #d6e3df;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.move-picker-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-picker-row.active {
  border-color: #87b8ae;
  box-shadow: 0 0 0 2px rgba(20, 108, 115, 0.16);
}

.move-picker-actions {
  display: flex;
  gap: 6px;
}

.move-picker-actions button {
  border: 1px solid #d0ded9;
  border-radius: 8px;
  background: #f7fbfa;
  font-size: 12px;
  font-weight: 700;
  color: #1f4854;
  padding: 6px 8px;
  cursor: pointer;
}

.legal-dialog {
  width: min(700px, 95vw);
  border: 1px solid #c3d6d1;
  border-radius: 20px;
  overflow: hidden;
}

.legal-modal-form {
  gap: 14px;
  padding: 22px;
  background:
    radial-gradient(650px 220px at 0% -30%, rgba(20, 108, 115, 0.12), transparent 60%),
    radial-gradient(500px 200px at 110% -20%, rgba(239, 159, 63, 0.13), transparent 58%),
    #ffffff;
}

.legal-modal-head {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
}

.legal-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #b8d2ca;
  background: linear-gradient(140deg, #e8f6f2, #f7fbf9);
  color: #0f5a64;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
}

.legal-modal-head h3 {
  margin: 0 0 4px;
}

.legal-modal-head p {
  margin: 0;
}

.legal-doc-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-doc-link {
  border: 1px solid #c8dbd6;
  border-radius: 999px;
  background: #f8fcfb;
  color: #125a66;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.legal-doc-link:hover {
  background: #ebf6f3;
  text-decoration: none;
}

.legal-checklist {
  display: grid;
  gap: 10px;
}

.legal-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8e5e1;
  border-radius: 12px;
  background: #fbfdfd;
  padding: 11px 12px;
  font-weight: 700;
}

.legal-check-item input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.legal-check-item span {
  line-height: 1.35;
}

.legal-actions .btn {
  min-width: 180px;
}

.upload-panel {
  position: fixed;
  right: 16px;
  bottom: 118px;
  z-index: 150;
  width: min(420px, calc(100vw - 20px));
  display: grid;
  gap: 10px;
  border: 1px solid #c8dad5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  box-shadow: 0 16px 28px rgba(16, 33, 43, 0.16);
  padding: 12px;
}

.upload-panel[hidden] {
  display: none !important;
}

.upload-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.upload-overall-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #d5e3df;
  background: #edf5f3;
}

.upload-overall-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a8f7a, #35b39a);
  transition: width 0.15s linear;
}

.upload-task-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.upload-task {
  display: grid;
  gap: 6px;
  border: 1px solid #dbe8e4;
  border-radius: 10px;
  background: #fcfdfd;
  padding: 8px;
}

.upload-task-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.upload-task-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upload-task-top strong {
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-task-top span {
  font-size: 12px;
  color: #486877;
  flex-shrink: 0;
}

.upload-task-cancel {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d8e5e1;
  background: #ffffff;
  color: #6f8793;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.upload-task-cancel:hover {
  background: #fff1ef;
  color: #b95348;
  border-color: #e0b5b0;
}

.upload-task-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8f2ef;
}

.upload-task-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3c88d2, #66a4de);
  transition: width 0.14s linear;
}

.upload-task.upload-uploading .upload-task-bar {
  background: linear-gradient(90deg, #2e82c8, #63b0de);
}

.upload-task.upload-done .upload-task-bar {
  background: linear-gradient(90deg, #2e8d65, #53bb8b);
}

.upload-task.upload-error .upload-task-bar {
  background: linear-gradient(90deg, #b95348, #d37b71);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 160;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 20px));
}

.global-toast-stack {
  z-index: 210;
}

.toast {
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 1px solid;
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px;
  box-shadow: 0 14px 24px rgba(16, 33, 43, 0.13);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast p {
  margin: 0;
  font-size: 13px;
}

.toast-success {
  border-color: #7fc3a4;
  background: #effaf4;
}

.toast-info {
  border-color: #86b6d4;
  background: #eef7ff;
}

.toast-error {
  border-color: #d7a39d;
  background: #fff2f0;
}

.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 20, 28, 0.66);
}

.verify-modal {
  width: min(520px, 96vw);
  border-radius: 16px;
  border: 1px solid #c9dad5;
  background: #ffffff;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.22);
  padding: 16px;
  display: grid;
  gap: 10px;
  position: relative;
}

.verify-modal h3 {
  margin: 0;
}

.verify-code {
  font-size: 38px;
  letter-spacing: 0.2em;
  font-weight: 800;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed #9fc6bc;
  background: #f0faf7;
  padding: 10px 8px;
  color: #0b5262;
}

.verify-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.verify-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #c6d6d1;
  background: #f5f9f8;
  color: #385560;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.verify-close-x:hover {
  background: #e9f3f1;
}

.verify-timer {
  margin: 0;
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.metric span { color: var(--muted); font-size: 12px; display: block; }
.metric strong { font-size: 24px; }

.bars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.bar-item {
  border: 1px solid #dbe8e4;
  border-radius: 10px;
  padding: 8px;
  background: #fbfdfd;
}

.bar-item span,
.bar-item strong,
.bar-item small {
  display: block;
}

.bar-item strong {
  margin-top: 4px;
  font-size: 22px;
}

.share-page {
  margin: 28px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.share-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.share-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-download-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #c4d5d0;
  background: #f0f8f5;
  color: #1f4450;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
}

.share-download-icon:hover {
  background: #e2f2ed;
  text-decoration: none;
}

.share-preview,
.share-preview-video {
  width: min(920px, 100%);
  max-height: 78vh;
  display: block;
  margin: 12px 0;
  border-radius: 12px;
  border: 1px solid #dbe7e3;
  background: #0c1218;
}

.share-preview {
  object-fit: contain;
  background: #f8fcfb;
}

.share-preview-video {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.share-audio-wrap {
  width: min(920px, 100%);
  margin: 12px 0;
  border: 1px solid #d8e6e1;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7fcfb, #ecf4f7);
  padding: 12px;
}

.share-preview-audio {
  width: 100%;
}

.share-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.share-card {
  border: 1px solid #dbe8e4;
  border-radius: 12px;
  background: #fbfdfd;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.share-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dbe8e4;
}

.share-media-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.share-file-tag {
  width: 100%;
  height: 130px;
  border-radius: 8px;
  border: 1px dashed #c9d8d3;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #2c5662;
  background: #eef6f3;
}

.share-card-body {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.share-card-body strong {
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.share-card-meta {
  display: block;
  font-size: 12px;
}

.share-download-inline {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid #cbdad5;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  background: #f2f8f6;
}

.share-download-inline:hover {
  background: #e6f2ee;
  text-decoration: none;
}

.share-viewer {
  width: min(1200px, 97vw);
  border: 1px solid #ccdcd7;
  border-radius: 14px;
  padding: 14px;
}

.share-viewer::backdrop {
  background: rgba(3, 15, 25, 0.72);
}

.share-viewer-close,
.share-viewer-download,
.share-viewer-nav {
  position: absolute;
  border: 1px solid #cad9d4;
  background: #f2f8f6;
  color: #1f4653;
  border-radius: 50%;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.share-viewer-close {
  top: 12px;
  right: 12px;
  font-size: 28px;
}

.share-viewer-download {
  top: 12px;
  right: 58px;
  font-size: 24px;
  text-decoration: none;
}

.share-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
}

.share-viewer-nav.prev {
  left: 12px;
}

.share-viewer-nav.next {
  right: 12px;
}

.share-viewer-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.share-viewer-stage {
  width: 100%;
  min-height: 62vh;
  display: grid;
  place-items: center;
  padding: 26px 56px 10px;
}

.share-viewer-stage img,
.share-viewer-stage video {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
}

.share-viewer-stage video {
  background: #000;
}

.share-viewer-meta {
  display: grid;
  gap: 4px;
  padding: 4px 56px 0;
}

.legal {
  margin: 22px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.not-found {
  text-align: center;
  margin: 48px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}

.maintenance-page {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.maintenance-card {
  width: min(640px, 95%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.error-illustration {
  margin: 0 auto 12px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px dashed #b5c9c3;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(239,159,63,0.2), rgba(20,108,115,0.08));
}

@media (max-width: 900px) {
  .owner-maintenance-head,
  .owner-maintenance-grid,
  .owner-maintenance-modes,
  .owner-maintenance-features {
    grid-template-columns: 1fr;
  }

  .owner-maintenance-head {
    display: grid;
  }
}
.error-illustration span { font-size: 42px; font-weight: 800; color: #1a434b; }

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-cols-full {
  grid-column: 1 / -1;
}

@media (max-width: 1040px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tariff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
  .dashboard { grid-template-columns: 1fr; }
  .dashboard-storage.shell {
    width: min(1200px, 96%);
    margin-left: auto;
    margin-right: auto;
  }
  .dashboard-sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .grid-two { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .features,
  .tariff-grid,
  .two-cols,
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .site-nav { gap: 8px; font-size: 14px; }
  .auth-card { padding: 16px; }
  .mock-grid { grid-template-columns: 1fr; }
  .finance-breakdown {
    grid-template-columns: 1fr;
  }
  .finance-modal-actions {
    flex-direction: column-reverse;
  }
  .finance-modal-actions .btn {
    width: 100%;
  }
  .dashboard {
    gap: 10px;
    padding-top: 10px;
  }
  .dashboard-sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 8px;
    border-radius: 12px;
    scrollbar-width: thin;
  }
  .dash-accordion {
    flex: 0 0 auto;
    min-width: 220px;
  }
  .dash-submenu {
    margin-left: 0;
    padding-left: 0;
    padding-top: 6px;
    border-left: 0;
  }
  .dash-link {
    flex: 0 0 auto;
    border: 1px solid #dce9e6;
    background: #f7fbfa;
    border-radius: 10px;
    padding: 9px 11px;
  }
  .dashboard-content {
    gap: 10px;
    padding-bottom: 12px;
  }
  .audit-controls {
    grid-template-columns: 1fr;
  }
  .user-manage-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 12px;
    border-radius: 12px;
  }
  .legal-dialog {
    width: min(95vw, 560px);
    border-radius: 16px;
  }
  .legal-modal-form {
    padding: 16px;
  }
  .legal-modal-head {
    grid-template-columns: 1fr;
  }
  .legal-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 18px;
  }
  .legal-actions .btn {
    width: 100%;
  }
  .profile-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .profile-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.2;
  }
  .inline-form,
  .login-confirm-form {
    align-items: stretch;
  }
  .login-confirm-form {
    gap: 10px;
  }
  .login-confirm-form > label {
    align-items: center;
    justify-content: flex-start;
  }
  .toast-stack {
    right: 10px;
    left: 10px;
    width: auto;
  }
  .upload-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 94px;
  }
  .storage-grid[data-mode='list'] .item {
    grid-template-columns: 1fr;
  }
  .storage-grid[data-mode='list'] .item .thumb {
    width: 100%;
    height: 72px;
  }
  .storage-grid {
    min-height: 360px;
    grid-template-columns: 1fr;
  }
  .trash-grid {
    min-height: 320px;
    grid-template-columns: 1fr;
  }
  .storage-page {
    min-height: auto;
    padding-bottom: calc(140px + env(safe-area-inset-bottom));
  }
  .trash-page {
    min-height: auto;
    padding-bottom: 12px;
  }
  .item {
    max-width: none;
  }
  .mobile-item-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .item-access-form {
    grid-template-columns: 1fr;
  }
  .shared-outgoing-head,
  .shared-outgoing-target {
    flex-direction: column;
    align-items: flex-start;
  }
  .share-viewer-stage {
    min-height: 46vh;
    padding: 18px 8px 8px;
  }
  .share-viewer-meta {
    padding: 4px 8px 0;
  }
  .share-viewer-nav {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }
  .share-viewer-nav.prev {
    left: 6px;
  }
  .share-viewer-nav.next {
    right: 6px;
  }
  .share-viewer-close {
    right: 8px;
    width: 34px;
    height: 34px;
    font-size: 24px;
  }
  .share-viewer-download {
    right: 46px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .login-confirm-form {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  .shell {
    width: min(100%, 96%);
  }

  input,
  select,
  textarea,
  button,
  .btn {
    font-size: 16px;
  }

  .nav-wrap {
    min-height: 56px;
    gap: 8px;
    padding: 8px 0;
    flex-wrap: wrap;
  }

  .site-nav {
    width: 100%;
  }

  .dashboard-content h1 {
    margin: 0;
    font-size: clamp(28px, 7vw, 34px);
    line-height: 1.1;
  }

  .panel {
    box-shadow: 0 8px 20px rgba(13, 33, 43, 0.07);
  }
}

@media (max-width: 680px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 35;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .site-nav > a,
  .site-nav > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid #d7e5e0;
    background: #fff;
    font-size: 13px;
    padding: 7px 8px;
    text-align: center;
  }

  .site-nav .inline-form {
    margin: 0;
    width: 100%;
    display: block;
  }

  .site-nav .inline-form .link-button {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d7e5e0;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dashboard {
    padding-top: 8px;
    gap: 8px;
  }

  .dashboard-sidebar {
    position: sticky;
    top: 64px;
    z-index: 25;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 16px rgba(12, 34, 44, 0.08);
    border-radius: 12px;
    padding: 8px;
  }

  .dash-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .storage-top {
    align-items: flex-start;
    gap: 8px;
  }

  .usage-chip {
    width: fit-content;
    max-width: 100%;
    font-size: 14px;
    padding: 7px 10px;
  }

  .storage-toolbar {
    position: sticky;
    top: 122px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .storage-toolbar .btn,
  .storage-toolbar label.btn {
    grid-column: span 2;
    width: 100%;
    min-height: 40px;
    justify-content: center;
    margin: 0;
  }

  #btnListMode,
  #btnGridMode {
    grid-column: span 1;
    min-height: 40px;
    width: 100%;
  }

  #btnRefresh {
    grid-column: span 2;
    min-height: 40px;
    width: 100%;
  }

  #btnSharedOutgoing {
    grid-column: span 2;
    min-height: 40px;
    width: 100%;
  }

  .storage-toolbar input[type='text'] {
    grid-column: 1 / -1;
    min-width: 0;
    min-height: 42px;
  }

  .path-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .path-bar button {
    white-space: nowrap;
    min-height: 34px;
    padding: 6px 11px;
  }

  .storage-grid {
    min-height: calc(100vh - 340px);
    border-radius: 14px;
    padding: 8px;
    gap: 8px;
  }

  .item {
    padding: 10px;
    border-radius: 11px;
  }

  .item .thumb {
    height: 84px;
  }

  .item .item-name {
    font-size: 15px;
    line-height: 1.3;
  }

  .mobile-item-actions {
    border-radius: 18px 18px 0 0;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .mobile-item-actions-grid button {
    min-height: 42px;
    font-size: 13px;
  }

  .popup-dialog,
  .move-dialog,
  .viewer,
  .finance-modal {
    width: calc(100vw - 10px);
    max-width: none;
    border-radius: 14px;
  }

  .item-access-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .popup-actions {
    width: 100%;
    justify-content: stretch;
  }

  .popup-actions .btn {
    width: 100%;
  }

  .viewer {
    padding: 10px 8px;
  }

  .viewer img {
    max-height: 62vh;
    margin: 12px auto;
  }

  .viewer video {
    max-height: 62vh;
    margin: 12px auto;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .site-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storage-toolbar {
    top: 132px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storage-toolbar .btn,
  .storage-toolbar label.btn,
  #btnRefresh {
    grid-column: span 1;
  }

  #btnListMode,
  #btnGridMode {
    grid-column: span 1;
  }

  .storage-grid {
    min-height: calc(100vh - 330px);
  }

  .mobile-item-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-link.is-current {
  background: linear-gradient(135deg, #146c73, #0f5965);
  border: 1px solid #0f5965;
  color: #ffffff;
}

.site-nav > a.is-current,
.site-nav > .btn.is-current,
.site-nav .inline-form .link-button.is-current {
  border-radius: 999px;
  background: linear-gradient(135deg, #146c73, #0f5965);
  color: #ffffff;
  border: 1px solid #0f5965;
  box-shadow: 0 8px 16px rgba(16, 90, 100, 0.22);
  text-decoration: none;
}

.site-nav > a.is-current:hover,
.site-nav > .btn.is-current:hover,
.site-nav .inline-form .link-button.is-current:hover {
  background: linear-gradient(135deg, #15737a, #11616d);
  color: #ffffff;
  border-color: #0f5965;
}

@media (max-width: 900px) {
  .shell {
    width: min(100%, 96%);
  }

  .dashboard {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 10px;
  }

  .dashboard-sidebar {
    position: sticky;
    top: 64px;
    z-index: 28;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding: 8px;
    border-radius: 14px;
    border-color: #cfe0db;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(9px);
    box-shadow: 0 10px 18px rgba(10, 34, 43, 0.08);
  }

  .dash-accordion {
    min-width: 220px;
  }

  .dashboard-sidebar .dash-warning-note {
    display: none;
  }

  .dash-submenu {
    margin-left: 0;
    padding-left: 0;
    padding-top: 6px;
    border-left: 0;
  }

  .dash-link {
    white-space: nowrap;
    border: 1px solid #d6e5e1;
    border-radius: 999px;
    background: #f7fbfa;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .dashboard-content {
    gap: 12px;
    padding-bottom: 14px;
  }

  .dashboard-content > h1 {
    font-size: clamp(26px, 7.2vw, 34px);
    line-height: 1.08;
  }

  .panel {
    border-radius: 16px;
    padding: 13px;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }

  .profile-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .profile-meta-chips .badge {
    margin-bottom: 0;
    font-size: 11px;
  }

  .finance-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storage-top {
    align-items: flex-start;
    gap: 8px;
  }

  .usage-chip {
    font-size: 13px;
    padding: 7px 10px;
  }

  .storage-toolbar {
    position: sticky;
    top: 116px;
    z-index: 24;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    box-shadow: 0 9px 16px rgba(10, 34, 43, 0.08);
  }

  .storage-toolbar .btn,
  .storage-toolbar label.btn {
    grid-column: span 2;
    width: 100%;
    min-height: 40px;
    justify-content: center;
    margin: 0;
  }

  .storage-toolbar .view-mode-btn {
    grid-column: span 1;
    width: 100%;
    min-height: 40px;
  }

  .storage-toolbar input[type='text'] {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
    min-width: 0;
    margin: 0;
  }

  .path-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .path-bar button {
    white-space: nowrap;
  }

  .storage-grid {
    min-height: calc(100dvh - 340px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-radius: 15px;
    padding: 9px;
  }

  .storage-grid[data-mode='list'] {
    grid-template-columns: 1fr;
  }

  .item {
    border-radius: 13px;
    padding: 9px;
    gap: 7px;
  }

  .item .thumb {
    height: 94px;
  }

  .item .item-name {
    font-size: 13px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .trash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 340px;
  }

  .upload-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: calc(72px + env(safe-area-inset-bottom));
    border-radius: 14px;
  }

  .upload-task-list {
    max-height: min(36dvh, 270px);
  }

  .toast-stack {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .toast {
    border-radius: 12px;
    padding: 10px 11px;
  }

  .site-footer {
    margin-top: 20px;
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 28px 0 18px;
  }

  .hero p {
    font-size: 15px;
  }

  .auth-page {
    padding: 14px 0 20px;
  }

  .auth-card {
    border-radius: 16px;
    padding: 16px;
  }

  .auth-card h1 {
    font-size: 25px;
  }

  .nav-wrap {
    min-height: 56px;
    gap: 7px;
    padding: 7px 0;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 18px;
  }

  .site-nav {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 6px 6px;
    border: 1px solid #d6e4e0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav > a,
  .site-nav > .btn,
  .site-nav .inline-form .link-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #d4e4df;
    background: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    scroll-snap-align: start;
  }

  .site-nav .inline-form {
    margin: 0;
    display: inline-flex;
    flex: 0 0 auto;
  }

  .site-nav .inline-form .link-button {
    margin: 0;
  }

  .finance-grid,
  .stats-grid,
  .finance-edit-grid {
    grid-template-columns: 1fr;
  }

  .finance-create-grid,
  .finance-plan-toggle-grid {
    grid-template-columns: 1fr;
  }

  .finance-breakdown {
    grid-template-columns: 1fr;
  }

  .finance-modal-actions {
    flex-direction: column-reverse;
  }

  .finance-modal-actions .btn {
    width: 100%;
  }

  .inline-form {
    align-items: stretch;
  }

  .inline-form .btn,
  .inline-form .btn-ghost,
  .inline-form select,
  .inline-form input {
    width: 100%;
  }

  .audit-controls {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .popup-dialog[open],
  .move-dialog[open],
  .item-access-dialog[open],
  .shared-outgoing-dialog[open],
  .legal-dialog[open],
  .ui-dialog[open],
  .viewer[open],
  .finance-modal {
    width: 100vw;
    max-width: none;
    max-height: 100dvh;
    margin: 0;
    position: fixed;
    inset: auto 0 0 0;
    border-radius: 18px 18px 0 0;
  }

  .popup-body,
  .legal-modal-form,
  .ui-dialog-body {
    max-height: calc(100dvh - 16px);
    overflow: auto;
    padding: 14px;
    overscroll-behavior: contain;
  }

  .viewer {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  }

  .viewer img,
  .viewer video {
    max-height: 66dvh;
    margin: 12px auto;
  }

  .mobile-item-actions {
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 560px) {
  .dashboard-sidebar {
    top: 58px;
  }

  .storage-toolbar {
    top: 108px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storage-toolbar .btn,
  .storage-toolbar label.btn,
  #btnRefresh,
  #btnSharedOutgoing {
    grid-column: span 1;
  }

  .storage-grid,
  .trash-grid {
    grid-template-columns: 1fr;
  }

  .storage-grid {
    min-height: calc(100dvh - 320px);
  }

  .item .thumb {
    height: 110px;
  }

  .profile-head h2 {
    font-size: 25px;
    margin: 0;
    line-height: 1.15;
  }

  .profile-handle {
    font-size: 14px;
  }

  .user-manage-grid {
    grid-template-columns: 1fr;
  }

  .mobile-item-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .brand span {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .storage-toolbar {
    top: 102px;
  }

  .usage-chip {
    font-size: 12px;
    padding: 6px 9px;
  }
}

.profile-dashboard {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-dashboard .dashboard-content {
  gap: 16px;
  align-content: start;
}

.profile-dashboard .dashboard-content > h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.04;
}

.profile-dashboard .dashboard-sidebar {
  top: 84px;
  border-radius: 16px;
  padding: 14px;
}

.profile-dashboard .profile-head {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 170px at 6% -18%, rgba(20, 108, 115, 0.14), transparent 62%),
    radial-gradient(460px 170px at 104% -20%, rgba(239, 159, 63, 0.14), transparent 58%),
    linear-gradient(155deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 18px;
  align-items: flex-start;
  gap: 14px;
}

.profile-dashboard .profile-avatar-shell {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.profile-dashboard .avatar {
  width: 94px;
  height: 94px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: block;
}

.profile-dashboard .profile-head-main {
  gap: 10px;
}

.profile-dashboard .profile-head-main h2 {
  margin: 0;
  line-height: 1.1;
  font-size: clamp(26px, 3.2vw, 40px);
}

.profile-dashboard .profile-head-main > p {
  margin: 0;
  color: var(--ink);
}

.profile-dashboard .profile-handle {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.profile-dashboard .profile-meta-chips .badge {
  margin: 0;
  padding: 6px 11px;
}

body[data-theme='dark'] .profile-dashboard .profile-head {
  border-color: #28414c;
  background:
    radial-gradient(520px 180px at 6% -18%, rgba(46, 167, 164, 0.24), transparent 60%),
    radial-gradient(470px 180px at 104% -20%, rgba(242, 179, 91, 0.18), transparent 58%),
    linear-gradient(155deg, #162029, #111920);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.45);
}

body[data-theme='dark'] .profile-dashboard .profile-head-main h2 {
  color: #f2f8fc;
}

body[data-theme='dark'] .profile-dashboard .profile-handle {
  color: #9ec8d8;
}

body[data-theme='dark'] .profile-dashboard .profile-avatar-shell {
  background: linear-gradient(135deg, #1d8f99, #4f8f76);
}

body[data-theme='dark'] .profile-dashboard .avatar {
  border-color: #2f4a58;
  background: #18242d;
}

body[data-theme='dark'] .profile-dashboard .profile-meta-chips .badge {
  background: rgba(46, 167, 164, 0.22);
  border-color: rgba(46, 167, 164, 0.58);
  color: #d4f5f4;
}

body[data-theme='dark'] .profile-dashboard .profile-head-main > p {
  color: #d1e5ee;
}

body[data-theme='dark'] .account-badge-pill {
  border-color: #315060;
  background: linear-gradient(180deg, #16232c, #0f1b23);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

body[data-theme='dark'] .profile-dashboard .panel {
  background: linear-gradient(160deg, #121c24, #0f1820);
  border-color: #263a46;
}

body[data-theme='dark'] .profile-dashboard .panel h3 {
  color: #eef7fb;
}

body[data-theme='dark'] .profile-dashboard .muted {
  color: #9ab4c2;
}

body[data-theme='dark'] .profile-dashboard .login-confirm-form {
  background: #17242d;
  border-color: #2d434f;
}

body[data-theme='dark'] .profile-dashboard .login-confirm-form > label {
  color: #d8e8ef;
}

body[data-theme='dark'] .profile-dashboard .login-confirm-form .btn {
  box-shadow: none;
}

body[data-theme='dark'] .flash,
body[data-theme='dark'] .flash-success,
body[data-theme='dark'] .flash-error,
body[data-theme='dark'] .flash-info {
  background: #14202a !important;
  border-color: #2e4d61 !important;
  color: #dceaf4 !important;
}

.profile-dashboard .profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.profile-dashboard .profile-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.profile-dashboard .profile-grid .panel {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.profile-dashboard .profile-grid .panel h3 {
  margin-top: 0;
}

.profile-view-actions {
  justify-content: flex-end;
}

.profile-dashboard .profile-column-side .panel {
  min-height: unset;
}

@media (max-width: 1080px) {
  .profile-dashboard {
    grid-template-columns: 1fr;
  }

  .profile-dashboard .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-dashboard .profile-column {
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .profile-dashboard .dashboard-content > h1 {
    font-size: clamp(28px, 9vw, 34px);
  }

  .profile-dashboard .profile-head {
    padding: 14px;
    gap: 12px;
  }

  .profile-dashboard .profile-avatar-shell {
    width: 86px;
    height: 86px;
    border-radius: 18px;
  }

  .profile-dashboard .avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .profile-dashboard .profile-head-main h2 {
    font-size: clamp(23px, 8vw, 30px);
  }

  .profile-dashboard .profile-handle {
    font-size: 15px;
  }

  .profile-dashboard .profile-meta-chips {
    gap: 6px;
  }

  .profile-dashboard .profile-meta-chips .badge {
    font-size: 11px;
    padding: 5px 9px;
  }

  .profile-title-row {
    align-items: flex-start;
  }

  .owner-account-badges-grid {
    grid-template-columns: 1fr;
  }

  .profile-dashboard .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .profile-dashboard .inline-form .btn,
  .profile-dashboard .inline-form .btn-ghost,
  .profile-dashboard .inline-form select,
  .profile-dashboard .inline-form input {
    width: 100%;
  }

  .profile-view-actions {
    width: 100%;
    justify-content: stretch;
  }
}

.text-right {
  text-align: right;
}

.bug-report-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 205;
}

.bug-report-fab {
  border: 1px solid #0f8c8c;
  background: linear-gradient(135deg, #0b7f88, #0f6980);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(6, 44, 58, 0.28);
}

.bug-report-fab:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 20px 30px rgba(6, 44, 58, 0.32);
}

.bug-report-panel {
  position: fixed;
  right: 16px;
  bottom: 64px;
  width: min(480px, calc(100vw - 24px));
  border-radius: 14px;
  border: 1px solid #a7c8c8;
  background: rgba(248, 252, 251, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 48px rgba(8, 31, 42, 0.28);
  padding: 14px;
  display: grid;
  gap: 10px;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  pointer-events: none;
}

.bug-report-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.bug-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bug-report-header h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.bug-report-form {
  display: grid;
  gap: 10px;
}

.bug-report-form textarea {
  min-height: 110px;
  resize: vertical;
}

.bug-report-severity {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 0;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.bug-report-severity legend {
  font-weight: 700;
  padding: 0 4px;
}

.bug-severity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.bug-severity-item strong {
  display: block;
}

.bug-severity-item small {
  color: var(--muted);
  display: block;
}

.bug-severity-item input {
  accent-color: var(--brand);
}

.bug-report-files {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.45);
}

.bug-report-file-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}

.bug-report-file-row span {
  color: var(--muted);
}

.bug-report-manage {
  width: min(920px, 96vw);
}

.bug-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.bug-attachment-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.bug-attachment-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(16, 33, 43, 0.12);
}

.bug-attachment-item img,
.bug-attachment-item video {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  background: #dde8ea;
}

.bug-attachment-meta {
  padding: 8px 10px 10px;
  display: grid;
  gap: 4px;
}

.bug-attachment-meta strong {
  font-size: 13px;
  word-break: break-word;
}

.bug-attachment-meta span {
  color: var(--muted);
  font-size: 12px;
}

body[data-theme='dark'] .bug-report-panel {
  background: rgba(17, 26, 34, 0.92);
  border-color: #2a4651;
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.38);
}

body[data-theme='dark'] .bug-report-header,
body[data-theme='dark'] .bug-report-header h3,
body[data-theme='dark'] .bug-report-file-row,
body[data-theme='dark'] .bug-attachment-meta strong {
  color: var(--ink);
}

body[data-theme='dark'] .bug-report-fab {
  border-color: rgba(46, 167, 164, 0.72);
  background: linear-gradient(135deg, #11818a, #0b5965);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
}

body[data-theme='dark'] .bug-report-fab:hover {
  box-shadow: 0 24px 36px rgba(0, 0, 0, 0.4);
}

body[data-theme='dark'] .bug-report-severity {
  background: rgba(18, 30, 39, 0.88);
  border-color: #2a4651;
}

body[data-theme='dark'] .bug-severity-item small,
body[data-theme='dark'] .bug-report-file-row span,
body[data-theme='dark'] .bug-attachment-meta span {
  color: #9bb0bb;
}

body[data-theme='dark'] .bug-report-files,
body[data-theme='dark'] .bug-attachment-item {
  background: rgba(18, 30, 39, 0.75);
  border-color: #2a4651;
}

@media (max-width: 900px) {
  .bug-report-widget {
    right: 12px;
    bottom: 12px;
  }

  .bug-report-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 64px;
    max-height: calc(100vh - 90px);
    overflow: auto;
  }

  .bug-report-fab {
    padding: 10px 14px;
  }

  .bug-attachment-grid {
    grid-template-columns: 1fr;
  }
}


.panel-user-list-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.panel-user-list-nav__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  flex-wrap: wrap;
}

.panel-user-list-nav__summary strong {
  color: var(--text);
}

.panel-user-list-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-user-list-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-user-list-page,
.panel-user-list-gap {
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel-user-list-page {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.panel-user-list-page:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.panel-user-list-page.is-current {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.panel-user-list-gap {
  color: var(--muted);
}

body[data-theme='dark'] .panel-user-list-nav {
  border-top-color: rgba(92, 118, 128, 0.35);
}

body[data-theme='dark'] .panel-user-list-nav__summary {
  color: #9bb0bb;
}

body[data-theme='dark'] .panel-user-list-nav__summary strong {
  color: var(--ink);
}

body[data-theme='dark'] .panel-user-list-page {
  background: rgba(18, 30, 39, 0.88);
  border-color: #2a4651;
  color: var(--ink);
}

body[data-theme='dark'] .panel-user-list-page:hover {
  border-color: var(--brand);
  background: rgba(26, 43, 54, 0.96);
}

body[data-theme='dark'] .panel-user-list-gap {
  color: #86a0ad;
}

@media (max-width: 720px) {
  .panel-user-list-nav,
  .panel-user-list-nav__actions {
    align-items: stretch;
  }

  .panel-user-list-nav__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
