/*
 * Console V4.
 * A dense, product-first multi-drive console with restrained motion,
 * neutral application surfaces and a single cobalt brand accent.
 */

:root {
  --ink: #152033;
  --muted: #5f6e84;
  --text-soft: #35445c;
  --text-faint: #7c899c;
  --line: #dfe5ed;
  --line-strong: #cbd5e1;
  --canvas: #f3f6fa;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-muted: #edf1f6;
  --surface-hover: #f1f5fb;
  --field: #ffffff;
  --topbar: rgba(255, 255, 255, .94);
  --blue: #1769e8;
  --blue-dark: #0e56c8;
  --accent-soft: #e9f1ff;
  --accent-border: #a9c8fb;
  --green: #07875f;
  --success-soft: #e8f7f1;
  --danger: #d73f58;
  --danger-soft: #fff0f2;
  --warning: #b76b00;
  --warning-soft: #fff5dc;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(25, 43, 73, .07);
  --shadow-raised: 0 22px 54px rgba(25, 43, 73, .13);
  --glass-highlight: transparent;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #f1f5fb;
  --muted: #a7b4c6;
  --text-soft: #d1dae7;
  --text-faint: #8796aa;
  --line: #29384b;
  --line-strong: #3b4d64;
  --canvas: #0c1420;
  --card: #111c2b;
  --surface: #111c2b;
  --surface-raised: #162235;
  --surface-soft: #152132;
  --surface-muted: #202e41;
  --surface-hover: #1a2940;
  --field: #0f1a29;
  --topbar: rgba(15, 26, 41, .95);
  --blue: #69a5ff;
  --blue-dark: #8bb9ff;
  --accent-soft: rgba(65, 139, 255, .16);
  --accent-border: #3d6fae;
  --green: #44d6a5;
  --success-soft: rgba(44, 190, 140, .14);
  --danger: #ff7a90;
  --danger-soft: rgba(255, 93, 118, .13);
  --warning: #f5b84c;
  --warning-soft: rgba(245, 184, 76, .13);
  --shadow: 0 14px 34px rgba(0, 0, 0, .22);
  --shadow-raised: 0 28px 70px rgba(0, 0, 0, .36);
  color-scheme: dark;
}

html {
  background: var(--canvas);
}

body {
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
}

body::before,
body::after {
  display: none;
}

/* Application shell */

.app-shell {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 3%, var(--canvas)) 0, var(--canvas) 240px);
}

.sidebar {
  inset: 0 auto 0 0;
  width: 248px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar .brand {
  height: 84px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #2788ff, #155dd8 58%, #194bb6);
  box-shadow: 0 10px 24px rgba(23, 105, 232, .24);
}

.brand-mark::after {
  display: none;
}

.brand strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 820;
}

.brand small {
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: .08em;
}

.nav {
  padding: 14px 12px 152px;
}

.nav-item {
  min-height: 46px;
  margin: 3px 0;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 680;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item:hover {
  color: var(--ink);
  border-color: transparent;
  background: var(--surface-hover);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--blue);
  border: 0;
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

:root[data-theme="dark"] .nav-item.active {
  color: #a6c9ff;
}

.nav-item.active svg {
  filter: none;
}

.nav-separator {
  height: 1px;
  margin: 14px 12px;
  background: var(--line);
}

.sidebar-foot {
  left: 16px;
  right: 16px;
  bottom: 16px;
}

.mode-toggle,
.server-state {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: none;
}

.main {
  min-width: 0;
  margin-left: 248px;
  padding-top: 0;
}

.topbar {
  top: 0;
  height: 76px;
  margin: 0;
  padding: 0 28px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--topbar);
  box-shadow: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-title h1,
.topbar h1 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 820;
  letter-spacing: -.02em;
}

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

.date-chip,
.user-name {
  color: var(--muted);
  font-size: 14px;
}

.theme-toggle-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

.avatar {
  border-radius: 10px;
  background: var(--blue);
  box-shadow: none;
}

.content {
  width: min(1480px, 100%);
  padding: 28px 32px 64px;
}

.page-section {
  animation: none;
}

/* Shared hierarchy */

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  color: var(--ink);
  font-size: 25px;
  font-weight: 830;
  letter-spacing: -.025em;
}

.section-head p,
.panel-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel-head {
  min-height: 70px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.data-panel,
.form-panel,
.accounts-panel,
.provider-card,
.workspace-toolbar,
.directory-tree,
.quick-start-panel,
.operations-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.data-panel,
.form-panel,
.provider-card,
.dashboard-stat,
.plan-card {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.provider-card:hover,
.plan-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 760;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.button.primary {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(23, 105, 232, .18);
}

.button.primary:hover:not(:disabled) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  box-shadow: 0 10px 22px rgba(23, 105, 232, .24);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: scale(.985);
}

.button.subtle,
.icon-button,
.theme-toggle-button {
  color: var(--text-soft);
  border-color: var(--line);
  background: var(--surface);
}

.button.subtle:hover,
.icon-button:hover,
.theme-toggle-button:hover {
  color: var(--blue);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.button.mini {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--field);
  box-shadow: none;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: none;
}

.field span,
.login-form label span,
.remark-field span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 760;
}

.secure-badge,
.status-pill,
.task-status,
.type-chip {
  font-size: 12px;
  font-weight: 780;
}

/* Dashboard */

.quick-start-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  color: #fff;
  border: 0;
  background:
    linear-gradient(112deg, #0e56c8 0%, #1769e8 54%, #2487ee 100%);
  box-shadow: 0 18px 42px rgba(23, 105, 232, .2);
}

.quick-start-panel::before {
  width: 260px;
  height: 260px;
  top: -178px;
  right: 9%;
  border-color: rgba(255, 255, 255, .26);
  box-shadow: 0 0 0 50px rgba(255, 255, 255, .055);
}

.quick-start-copy .eyebrow,
.quick-start-copy p {
  color: rgba(255, 255, 255, .76);
}

.quick-start-copy h2 {
  color: #fff;
  font-size: 24px;
}

.quick-start-copy p {
  font-size: 13px;
}

.quick-start-actions {
  gap: 10px;
}

.quick-start-actions button {
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, .11);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.quick-start-actions button:hover {
  border-color: rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .18);
  box-shadow: none;
  transform: translateY(-2px);
}

.quick-start-actions strong {
  font-size: 14px;
}

.quick-start-actions small {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.dashboard-stats {
  gap: 12px;
}

.dashboard-stat {
  min-height: 112px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  background: var(--card);
  box-shadow: none;
}

.dashboard-stat:nth-child(2) {
  border-left-color: #13a37b;
}

.dashboard-stat:nth-child(3) {
  border-left-color: #e08a16;
}

.dashboard-stat:nth-child(4) {
  border-left-color: #7b61d9;
}

.dashboard-stat::after {
  display: none;
}

.dashboard-stat > span,
.dashboard-stat > small {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-stat > strong {
  color: var(--ink);
  font-size: 25px;
}

.reliability-grid .dashboard-stat > strong {
  font-size: clamp(22px, 1.7vw, 28px);
  line-height: 1.12;
  white-space: nowrap;
}

.feed-item {
  border-color: var(--line);
  background: transparent;
}

.operations-strip {
  box-shadow: none;
}

/* Accounts, files and data */

.provider-grid {
  gap: 12px;
}

.provider-card {
  min-height: 178px;
  padding: 18px;
}

.provider-card h3 {
  margin-top: 12px;
  font-size: 18px;
}

.provider-card p {
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
}

.provider-logo {
  width: 42px;
  height: 42px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff !important;
  box-shadow: 0 6px 16px rgba(19, 39, 73, .1);
}

.provider-state {
  color: var(--muted);
  font-size: 12px;
}

.account-row,
.api-key-row,
.admin-user-card,
.admin-drive-row,
.admin-batch-row {
  border-color: var(--line);
  transition: background .18s ease;
}

.account-row:hover,
.api-key-row:hover,
.admin-user-card:hover,
.admin-drive-row:hover,
.admin-batch-row:hover {
  background: var(--surface-hover);
}

.account-name strong,
.account-stat strong {
  color: var(--ink);
  font-size: 16px;
}

.account-name span,
.account-stat span {
  color: var(--muted);
  font-size: 13px;
}

.workspace-toolbar {
  padding: 14px 16px;
}

.pathbar {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 13px;
}

.pathbar strong,
.pathbar button {
  font-size: 14px;
  font-weight: 730;
}

.directory-tree {
  overflow: hidden;
}

.tree-title,
.data-table thead,
.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
}

.tree-title,
.tree-row,
.data-table th {
  font-size: 13px;
}

.tree-row {
  min-height: 42px;
  color: var(--text-soft);
}

.data-table {
  color: var(--text-soft);
}

.data-table th {
  height: 46px;
  font-weight: 760;
}

.data-table td {
  min-height: 54px;
  padding: 12px 14px;
  color: var(--text-soft);
  border-color: var(--line);
  font-size: 14px;
}

.data-table td > small,
.task-account,
.path-cell {
  color: var(--muted) !important;
  font-size: 12px;
}

.data-table tbody tr:hover td {
  background: var(--surface-hover);
}

#page-shares .table-wrap {
  overflow-x: auto;
}

#page-shares .data-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

#page-shares .data-table th:nth-child(1) {
  width: 44px;
}

#page-shares .data-table th:nth-child(2) {
  width: 86px;
}

#page-shares .data-table th:nth-child(3) {
  width: 132px;
}

#page-shares .data-table th:nth-child(4) {
  width: 176px;
}

#page-shares .data-table th:nth-child(6) {
  width: 154px;
}

#page-shares .data-table th:nth-child(7) {
  width: 188px;
}

#page-shares .data-table td:nth-child(3),
#page-shares .data-table td:nth-child(4),
#page-shares .data-table td:nth-child(5) {
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: anywhere;
}

#page-shares .data-table td:nth-child(7) {
  white-space: nowrap;
}

#page-shares .share-link-cell .text-link {
  font-size: 12px;
  line-height: 1.45;
}

#page-shares .data-table td:nth-child(6) > small {
  max-width: none;
  overflow: visible;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

#page-shares .task-actions {
  flex-wrap: nowrap;
}

.file-name-button,
.result-name {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 720;
}

.empty-state {
  color: var(--muted);
  background: transparent;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state p,
.helper-text {
  color: var(--muted);
  font-size: 13px;
}

/* Transfer and search */

.search-console,
.transfer-console {
  overflow: hidden;
}

.search-console-head,
.transfer-console-head {
  padding-bottom: 12px;
}

.search-bar {
  gap: 10px;
  padding: 8px 20px 18px;
}

.search-bar input,
.search-bar select,
.transfer-link-field textarea {
  border-width: 1px;
  box-shadow: none;
}

.search-bar input {
  min-height: 52px;
  font-size: 16px;
  font-weight: 600;
}

.search-submit {
  min-height: 52px;
}

.search-filter-panel {
  margin: 0 20px 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.search-filter-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.search-filter-heading div > span,
.search-filter-heading > span,
.search-tools label {
  color: var(--muted);
  font-size: 13px;
}

.search-duplicate-check {
  border-color: var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.search-index-badge,
.transfer-steps b {
  color: var(--blue);
  background: var(--accent-soft);
  box-shadow: none;
}

.transfer-form {
  gap: 14px;
}

.transfer-link-field textarea {
  font-size: 15px;
}

.transfer-account-choice {
  border-color: var(--line-strong);
  background: var(--field);
}

.transfer-default-note,
.transfer-action-note,
.transfer-link-hint,
.transfer-account-field > small {
  color: var(--muted);
  font-size: 13px;
}

/* Membership and settings */

.settings-tabs {
  border-color: var(--line);
  background: var(--card);
}

.settings-tab {
  color: var(--muted);
  font-size: 14px;
}

.settings-tab.active {
  color: var(--blue);
  background: var(--accent-soft);
}

.plan-comparison {
  gap: 12px;
}

.plan-card {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.plan-card.current {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  box-shadow: none;
}

.plan-price strong {
  color: var(--blue);
}

.profile-summary > div,
.membership-limit-grid > div {
  border-color: var(--line);
  background: var(--surface-soft);
}

.audit-panel .table-wrap {
  max-height: 520px;
  overflow: auto;
}

/* Login and registration */

.login-shell {
  grid-template-columns: minmax(520px, 44%) 1fr;
  background: var(--canvas);
}

.login-panel {
  width: min(590px, 100%);
  padding: 42px 60px;
  background: var(--card);
  box-shadow: 24px 0 64px rgba(16, 33, 62, .08);
}

.login-panel:has(#registerForm:not(.hidden)) {
  width: min(660px, 100%);
}

.brand-login {
  margin-bottom: 30px;
}

.auth-mode-switch {
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-mode-switch button {
  min-height: 42px;
  border-radius: 9px;
  font-size: 14px;
}

.auth-mode-switch button.active {
  color: var(--blue);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 4px 12px rgba(21, 32, 51, .08);
}

.login-copy h1 {
  color: var(--ink);
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -.035em;
}

.login-copy p {
  color: var(--muted);
  font-size: 15px;
}

.login-form label span {
  font-size: 14px;
}

.login-form input {
  min-height: 50px;
}

.login-art {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 14%, rgba(97, 210, 255, .34), transparent 27rem),
    radial-gradient(circle at 12% 86%, rgba(78, 88, 218, .3), transparent 30rem),
    linear-gradient(145deg, #0a3d92 0%, #1268dd 50%, #0f8bc3 100%);
}

.login-art::after {
  position: absolute;
  inset: 12% 10%;
  content: "";
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 42px;
  transform: rotate(-6deg);
}

.art-grid {
  opacity: .22;
  background-size: 56px 56px;
}

.art-card {
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 20px;
  background: rgba(7, 42, 103, .48);
  box-shadow: 0 26px 70px rgba(0, 28, 84, .28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.art-main {
  width: min(520px, 72%);
  padding: 38px;
}

.art-main strong {
  font-size: clamp(30px, 3vw, 46px);
}

.modal-card,
.danger-auth-card,
.recovery-codes-card,
.detail-drawer {
  border: 1px solid var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-backdrop {
  background: rgba(3, 10, 22, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.toast {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Tablet: navigation becomes a drawer before the content gets squeezed. */

@media (max-width: 1360px) {
  .sidebar {
    inset: 0 auto 0 0;
    width: min(288px, calc(100vw - 32px));
    transform: translateX(-104%);
    box-shadow: var(--shadow-raised);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    display: block;
  }

  body:not(.mobile-nav-open) .mobile-nav-backdrop {
    pointer-events: none;
    opacity: 0;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
  }

  .icon-button.mobile-menu-button,
  .mobile-nav-close {
    display: grid;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding-inline: 22px;
  }

  .content {
    padding: 24px;
  }

  .search-bar,
  .search-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-query-field,
  .search-duplicate-check,
  .search-tool-actions {
    grid-column: 1 / -1;
  }

  .search-submit {
    width: 100%;
  }

  .search-tool-actions {
    justify-content: flex-end;
  }

  .transfer-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    overflow-x: clip;
  }

  .login-panel,
  .login-panel:has(#registerForm:not(.hidden)) {
    width: 100%;
    min-height: 100dvh;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    padding: 28px 20px 34px;
  }

  .brand-login {
    margin-bottom: 28px;
    padding-inline: 0;
  }

  .auth-mode-switch,
  .login-copy,
  .login-form,
  .security-note {
    width: 100%;
    margin-inline: 0;
  }

  .login-copy h1 {
    font-size: 30px;
    overflow-wrap: anywhere;
  }

  .login-copy p {
    font-size: 14px;
  }

  .register-form {
    min-width: 0;
  }

  .register-consent {
    padding: 12px;
  }

  .topbar {
    height: 68px;
    padding-inline: 14px;
  }

  .topbar-title h1,
  .topbar h1 {
    font-size: 20px;
  }

  .date-chip,
  .user-name,
  .theme-toggle-button span {
    display: none;
  }

  .theme-toggle-button {
    width: 40px;
    padding: 0;
  }

  .content {
    padding: 18px 14px 50px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
  }

  .section-head > .inline-actions,
  .section-head > .share-filters {
    width: 100%;
  }

  .section-head h2 {
    font-size: 22px;
  }

  .panel-head {
    min-height: 0;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 15px;
  }

  .quick-start-panel {
    padding: 18px;
  }

  .quick-start-actions {
    grid-template-columns: 1fr;
  }

  .quick-start-actions button {
    min-height: 66px;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-grid {
    grid-template-columns: 1fr;
  }

  .provider-card {
    min-height: 0;
  }

  .workspace-toolbar {
    gap: 8px;
  }

  .workspace-toolbar .field {
    width: 100%;
  }

  .file-workspace {
    grid-template-columns: 1fr;
  }

  .directory-tree {
    max-height: 230px;
  }

  .search-bar,
  .search-tools {
    grid-template-columns: 1fr;
  }

  .search-query-field,
  .search-duplicate-check,
  .search-tool-actions {
    grid-column: auto;
  }

  .search-filter-panel {
    margin-inline: 14px;
  }

  .search-filter-heading {
    display: grid;
  }

  .search-filter-heading > span {
    text-align: left;
  }

  .search-tool-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .transfer-form {
    padding: 15px;
  }

  .transfer-link-field textarea {
    min-height: 122px;
  }

  .share-filters {
    grid-template-columns: 1fr 1fr;
  }

  .share-filters > * {
    width: 100%;
  }

  .plan-comparison {
    grid-template-columns: 1fr;
  }

  /* Dense desktop tables become readable information cards. */
  #page-shares .table-wrap,
  #page-tasks .table-wrap,
  .audit-panel .table-wrap {
    overflow: visible;
  }

  #page-shares .data-table,
  #page-tasks .data-table,
  .audit-panel .data-table {
    display: block;
    min-width: 0;
  }

  #page-shares .data-table thead,
  #page-tasks .data-table thead,
  .audit-panel .data-table thead {
    display: none;
  }

  #page-shares .data-table tbody,
  #page-tasks .data-table tbody,
  .audit-panel .data-table tbody {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  #page-shares .data-table tr,
  #page-tasks .data-table tr,
  .audit-panel .data-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  #page-shares .data-table td,
  #page-tasks .data-table td,
  .audit-panel .data-table td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  #page-shares .data-table td::before,
  #page-tasks .data-table td::before,
  .audit-panel .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
  }

  #page-shares .data-table td:first-child {
    grid-template-columns: 90px auto;
  }

  #page-shares .share-link-cell,
  #page-tasks .task-actions {
    min-width: 0;
  }

  #page-shares .share-link-cell .text-link {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  #page-shares td[data-label="链接 / 提取码"] > *,
  #page-shares td[data-label="状态"] > *,
  #page-tasks td[data-label="类型 / 账号"] > *,
  #page-tasks td[data-label="任务与进度"] > * {
    grid-column: 2;
    min-width: 0;
  }

  #page-shares td[data-label="状态"] small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  #page-shares .task-actions,
  #page-tasks .task-actions {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
  }

  #page-shares .task-actions > button,
  #page-tasks .task-actions > button {
    grid-column: 2;
    width: fit-content;
  }

  .audit-pagination {
    padding-inline: 12px;
  }
}

@media (max-width: 460px) {
  .login-panel,
  .login-panel:has(#registerForm:not(.hidden)) {
    padding: 24px 16px 30px;
  }

  .login-copy h1 {
    font-size: 28px;
    line-height: 1.22;
  }

  .content {
    padding-inline: 10px;
  }

  .topbar {
    padding-inline: 10px;
  }

  .top-actions {
    gap: 7px;
  }

  .user-menu {
    gap: 6px;
  }

  .dashboard-stats,
  .share-filters {
    grid-template-columns: 1fr;
  }

  .dashboard-stat {
    min-height: 98px;
  }

  .search-tool-actions {
    grid-template-columns: 1fr;
  }

  #page-shares .data-table td,
  #page-tasks .data-table td,
  .audit-panel .data-table td {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  #page-shares .task-actions,
  #page-tasks .task-actions {
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

@media (hover: none) {
  .provider-card:hover,
  .plan-card:hover,
  .quick-start-actions button:hover {
    transform: none;
  }
}

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

/*
 * Compact console layer.
 * Navigation remains visible at every width. Large screens use a labeled rail;
 * phones use a narrow icon rail so page content remains usable.
 */

:root {
  --ink: #172237;
  --muted: #617087;
  --text-soft: #38475f;
  --text-faint: #7e8b9f;
  --line: #d8e1eb;
  --line-strong: #c5d1df;
  --canvas: #eef3f8;
  --card: #fcfdff;
  --surface: #fcfdff;
  --surface-raised: #ffffff;
  --surface-soft: #f5f8fb;
  --surface-muted: #e9eff5;
  --surface-hover: #edf3fa;
  --field: #ffffff;
  --topbar: rgba(252, 253, 255, .96);
  --blue: #2563d9;
  --blue-dark: #194fb9;
  --accent-soft: #e6eefc;
  --accent-border: #9ebbea;
}

:root[data-theme="dark"] {
  --ink: #e9eff8;
  --muted: #9faec2;
  --text-soft: #cbd6e4;
  --text-faint: #8190a5;
  --line: #26364a;
  --line-strong: #3a4c63;
  --canvas: #0a1320;
  --card: #101c2b;
  --surface: #101c2b;
  --surface-raised: #152337;
  --surface-soft: #142133;
  --surface-muted: #1c2b3f;
  --surface-hover: #19283c;
  --field: #0e1928;
  --topbar: rgba(14, 25, 40, .97);
  --blue: #76a9f7;
  --blue-dark: #94bdff;
  --accent-soft: rgba(79, 139, 226, .17);
  --accent-border: #426fae;
}

body {
  font-size: 12px;
}

.sidebar {
  width: 210px;
  transform: none !important;
}

.sidebar .brand {
  height: 66px;
  padding-inline: 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 7px 16px rgba(37, 99, 217, .2);
}

.brand strong {
  font-size: 14px;
}

.brand small,
.breadcrumb {
  font-size: 9px;
}

.nav {
  padding: 9px 8px 116px;
}

.nav-item {
  min-height: 38px;
  margin: 1px 0;
  padding-inline: 10px;
  border-radius: 8px;
  font-size: 11px;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.nav-separator {
  margin: 9px 10px;
}

.sidebar-foot {
  left: 10px;
  right: 10px;
  bottom: 10px;
}

.mode-toggle,
.server-state {
  min-height: 38px;
  font-size: 9px;
}

.main {
  margin-left: 210px;
}

.topbar {
  height: 58px;
  padding-inline: 20px;
}

.topbar-title h1,
.topbar h1 {
  font-size: 16px;
}

.date-chip,
.user-name {
  font-size: 10px;
}

.avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.theme-toggle-button {
  min-height: 34px;
  font-size: 10px;
}

.content {
  padding: 20px 22px 48px;
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 17px;
}

.panel-head {
  min-height: 54px;
  padding: 12px 15px;
}

.panel-head h2 {
  font-size: 13px;
}

.section-head p,
.panel-head p {
  font-size: 10px;
  line-height: 1.5;
}

.button {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 8px;
  font-size: 11px;
}

.button.mini {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 10px;
}

input,
select,
textarea,
.search-bar input,
.search-bar select,
.transfer-link-field textarea,
.login-form input {
  min-height: 38px;
  border-radius: 8px;
  font-size: 11px !important;
}

.field span,
.login-form label span,
.remark-field span {
  font-size: 11px;
}

.secure-badge,
.status-pill,
.task-status,
.type-chip,
.provider-state {
  font-size: 9px;
}

.quick-start-panel {
  padding: 16px;
  background: linear-gradient(112deg, #174b9b 0%, #2563d9 58%, #347bd7 100%);
  box-shadow: 0 12px 28px rgba(28, 72, 143, .17);
}

.quick-start-copy h2 {
  font-size: 16px;
}

.quick-start-copy p,
.quick-start-actions small {
  font-size: 9px;
}

.quick-start-actions strong {
  font-size: 11px;
}

.quick-start-actions button {
  min-height: 56px;
}

.dashboard-stat {
  min-height: 82px;
  padding: 12px;
}

.dashboard-stat > span,
.dashboard-stat > small {
  font-size: 9px;
}

.dashboard-stat > strong,
.reliability-grid .dashboard-stat > strong {
  font-size: 17px;
}

.provider-card {
  min-height: 138px;
  padding: 14px;
}

.provider-card h3 {
  font-size: 12px;
}

.provider-card p,
.account-name span,
.account-stat span {
  font-size: 9px;
}

.account-name strong,
.account-stat strong {
  font-size: 12px;
}

.pathbar,
.pathbar strong,
.pathbar button,
.tree-title,
.tree-row,
.data-table th {
  font-size: 10px;
}

.data-table th {
  height: 38px;
}

.data-table td {
  min-height: 44px;
  padding: 9px 11px;
  font-size: 10px;
}

.data-table td > small,
.task-account,
.path-cell,
.text-link,
.share-link-cell .text-link {
  font-size: 9px !important;
}

.file-name-button,
.result-name {
  font-size: 10px;
}

.empty-state strong {
  font-size: 12px;
}

.empty-state p,
.helper-text,
.search-filter-heading div > span,
.search-filter-heading > span,
.search-tools label,
.transfer-default-note,
.transfer-action-note,
.transfer-link-hint,
.transfer-account-field > small,
.settings-tab,
.profile-summary span,
.membership-limit-grid span,
.membership-title span,
.admin-user-card span,
.admin-drive-row span,
.admin-batch-row span {
  font-size: 10px;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.search-filter-heading strong,
.transfer-account-choice > strong,
.profile-summary strong,
.membership-limit-grid strong,
.admin-user-card strong,
.admin-drive-row strong,
.admin-batch-row strong {
  font-size: 11px;
}

.search-bar input,
.search-submit {
  min-height: 40px;
}

.plan-card-heading strong,
.membership-title strong {
  font-size: 13px;
}

.plan-card-heading span,
.plan-price span,
.plan-price small,
.plan-card li {
  font-size: 9px;
}

.plan-price strong {
  font-size: 19px;
}

.wechat-binding-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.wechat-binding-copy strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.wechat-binding-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.wechat-binding-warning,
.wechat-identity-notice {
  margin: 9px 14px 14px;
  padding: 9px 11px;
  border-left: 3px solid var(--warning);
  border-radius: 7px;
  color: var(--text-soft);
  background: var(--warning-soft);
  font-size: 9px;
  line-height: 1.5;
}

.wechat-identity-notice {
  margin: 10px 0;
}

.login-copy h1 {
  font-size: clamp(20px, 2.2vw, 28px);
}

.login-copy p,
.wechat-auth-head p {
  font-size: 10px;
}

.auth-mode-switch button,
.wechat-auth-head h1,
.danger-auth-card h2,
.recovery-codes-card h2 {
  font-size: 13px;
}

.login-panel {
  padding: 30px 44px;
}

.mobile-nav-backdrop,
.icon-button.mobile-menu-button,
.mobile-nav-close {
  display: none !important;
}

@media (max-width: 1360px) {
  .sidebar {
    inset: 0 auto 0 0;
    width: 210px;
    box-shadow: none;
    transition: none;
  }

  .main {
    margin-left: 210px;
  }

  .content {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    width: 76px;
  }

  .detail-drawer {
    width: min(380px, calc(100vw - 76px));
  }

  .sidebar .brand {
    height: 56px;
    justify-content: center;
    padding: 0;
  }

  .sidebar .brand-text {
    display: none;
  }

  .nav {
    padding: 6px 5px 70px;
  }

  .nav-item {
    min-height: 47px;
    height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    text-align: center;
    font-size: 9px;
    line-height: 1.15;
  }

  .nav-item span {
    max-width: 66px;
    white-space: normal;
  }

  .nav-item.active {
    box-shadow: inset 2px 0 0 var(--blue);
  }

  .nav-separator {
    margin: 6px;
  }

  .sidebar-foot {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .mode-toggle {
    display: none;
  }

  .server-state {
    justify-content: center;
    min-height: 32px;
    padding: 0;
  }

  .server-state span {
    display: none;
  }

  .main {
    margin-left: 76px;
  }

  .topbar {
    height: 54px;
    padding-inline: 10px;
  }

  .topbar-title h1,
  .topbar h1 {
    font-size: 14px;
  }

  .content {
    padding: 12px 10px 36px;
  }

  .section-head h2 {
    font-size: 15px;
  }

  .panel-head h2 {
    font-size: 12px;
  }

  .wechat-binding-box {
    align-items: stretch;
    flex-direction: column;
  }

  #page-shares .data-table td::before,
  #page-tasks .data-table td::before,
  .audit-panel .data-table td::before {
    font-size: 9px;
  }
}

@media (max-width: 460px) {
  .sidebar {
    width: 70px;
  }

  .detail-drawer {
    width: calc(100vw - 70px);
  }

  .main {
    margin-left: 70px;
  }

  .nav-item {
    min-height: 44px;
    font-size: 9px;
  }

  .login-panel,
  .login-panel:has(#registerForm:not(.hidden)) {
    padding: 22px 14px 28px;
  }

  .login-copy h1 {
    font-size: 19px;
  }
}
