/* ==========================================================================
   NSP Client Portal — front-end stylesheet
   Enterprise document workspace: restrained navy navigation, accessible blue
   actions, crisp hierarchy, compact controls and durable responsive behaviour.
   ========================================================================== */

.nsp-app,
.nsp-login {
  --nsp-accent: #0969da;
  --nsp-accent-dark: #0758b8;
  --nsp-accent-2: #1f7ae0;
  --nsp-accent-soft: #eaf3ff;
  --nsp-accent-softer: #f5f9ff;
  --nsp-ring: 0 0 0 3px rgba(9, 105, 218, .24);

  --nsp-green: #059669;
  --nsp-green-soft: #e7f6f0;
  --nsp-red: #dc2626;
  --nsp-red-soft: #fdecec;
  --nsp-amber: #d97706;
  --nsp-amber-soft: #fdf1e3;
  --nsp-purple: #7c3aed;
  --nsp-purple-soft: #f2ecfe;

  --nsp-ink: #10233b;
  --nsp-ink-2: #34465c;
  --nsp-muted: #66778b;
  --nsp-subtle: #8a9aae;
  --nsp-line: #dce4ed;
  --nsp-line-2: #edf1f5;
  --nsp-bg: #ffffff;
  --nsp-page: #f4f7fa;
  --nsp-sidebar: #102a46;
  --nsp-wash: #f7f9fc;
  --nsp-paper: #ffffff;

  --nsp-r-sm: 8px;
  --nsp-r-md: 12px;
  --nsp-r-lg: 16px;
  --nsp-r-pill: 999px;

  --nsp-sh-sm: 0 1px 2px rgba(16, 35, 59, .06);
  --nsp-sh-card: 0 1px 2px rgba(16, 35, 59, .05), 0 8px 24px rgba(16, 35, 59, .035);
  --nsp-sh-pop: 0 20px 56px rgba(16, 35, 59, .20);

  color: var(--nsp-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.nsp-app *,
.nsp-login * { box-sizing: border-box; }
.nsp-app button,
.nsp-app input,
.nsp-app select,
.nsp-login button,
.nsp-login input { font: inherit; }
.nsp-app :focus-visible,
.nsp-login :focus-visible { outline: none; box-shadow: var(--nsp-ring); border-radius: 6px; }

.nsp-i { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.nsp-app [hidden], .nsp-login [hidden] { display: none !important; }

/* --- Shell -------------------------------------------------------------- */
.nsp-app { min-height: 100vh; background: var(--nsp-bg); }

.nsp-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(22px, 3vw, 36px);
  border-bottom: 1px solid var(--nsp-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
}
.nsp-brand { display: flex; align-items: center; gap: 11px; }
.nsp-brandmark {
  display: grid; place-items: center;
  width: 42px; height: 38px;
  flex: 0 0 auto;
}
.nsp-brandmark img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.nsp-brand__copy { display: flex; flex-direction: column; line-height: 1.1; }
.nsp-brand__copy strong { font-size: 15px; font-weight: 700; letter-spacing: .1em; color: var(--nsp-ink); }
.nsp-brand__copy small { margin-top: 3px; font-size: 11.5px; color: var(--nsp-muted); }

.nsp-topbar__tools { display: flex; align-items: center; gap: 16px; }
.nsp-security {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 9px;
  border: 1px solid #cdeadd;
  border-radius: var(--nsp-r-pill);
  background: var(--nsp-green-soft);
  color: var(--nsp-green);
  font-size: 12px; font-weight: 600;
}
.nsp-security .nsp-i { width: 16px; height: 16px; }
.nsp-account { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--nsp-line); }
.nsp-avatar {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--nsp-accent-soft);
  color: var(--nsp-accent-dark);
  font-weight: 700; font-size: 14px;
}
.nsp-account__name { display: flex; flex-direction: column; min-width: 92px; line-height: 1.25; }
.nsp-account__name strong { font-size: 13px; color: var(--nsp-ink); }
.nsp-account__name small { font-size: 11px; color: var(--nsp-muted); }
.nsp-signout {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 2px; padding: 8px 11px;
  border-radius: var(--nsp-r-sm);
  color: var(--nsp-muted); font-size: 12px; font-weight: 600; text-decoration: none;
  transition: background .15s, color .15s;
}
.nsp-signout .nsp-i { width: 17px; height: 17px; }
.nsp-signout:hover { background: var(--nsp-wash); color: var(--nsp-ink); }

/* --- Body / sidebar ----------------------------------------------------- */
.nsp-app__body { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - 76px); }

.nsp-sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  background: linear-gradient(180deg, #132f4c 0%, #0b243e 100%);
  border-right: 0;
}
.nsp-workspace-picker { padding: 0 4px 22px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.13); }
.nsp-workspace-picker label,
.nsp-navigation p {
  display: block; margin: 0 0 8px;
  color: #9fc6ee;
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.nsp-navigation { display: grid; gap: 3px; }
.nsp-navigation p { padding: 0 10px; margin-bottom: 6px; }
.nsp-nav {
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 48px; padding: 0 13px;
  border: 0; border-radius: var(--nsp-r-sm);
  background: transparent; color: #c9def3;
  font-size: 14px; font-weight: 550; text-align: left; cursor: pointer;
  transition: background .14s, color .14s;
}
.nsp-nav__icon { display: inline-flex; width: 20px; color: #7fb5e8; }
.nsp-nav__icon .nsp-i { width: 20px; height: 20px; }
.nsp-nav:hover:not(.is-active) { background: rgba(255,255,255,.08); color: #fff; }
.nsp-nav:hover:not(.is-active) .nsp-nav__icon { color: #fff; }
.nsp-nav.is-active { background: #fff; color: #102a46; font-weight: 700; box-shadow: 0 8px 22px rgba(3,16,31,.16); }
.nsp-nav.is-active .nsp-nav__icon { color: var(--nsp-accent); }
.nsp-sidebar__footer {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto; padding: 14px 8px 2px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: #9fc6ee;
}
.nsp-sidebar__footer .nsp-i { width: 20px; height: 20px; color: var(--nsp-accent); }
.nsp-sidebar__footer p { margin: 0; display: flex; flex-direction: column; }
.nsp-sidebar__footer strong { color: #fff; font-size: 12px; }
.nsp-sidebar__footer small { margin-top: 2px; font-size: 10px; color: #8fb2d4; }

/* Desktop application shell: navigation remains anchored while workspace scrolls. */
@media (min-width: 961px) {
  body.nsp-portal-page { overflow: hidden !important; }
  .nsp-app { height: 100dvh; min-height: 0; overflow: hidden; }
  .nsp-topbar { position: relative; top: auto; flex: 0 0 76px; }
  .nsp-app__body { height: calc(100% - 76px); min-height: 0; overflow: hidden; }
  .nsp-sidebar { position: relative; top: auto; align-self: stretch; height: 100%; overflow: hidden; }
  .nsp-main { height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  body.admin-bar .nsp-app { height: calc(100dvh - 32px); }
}

/* --- Selects (custom caret) -------------------------------------------- */
.nsp-select { position: relative; display: block; }
.nsp-select select {
  width: 100%; height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--nsp-line);
  border-radius: var(--nsp-r-sm);
  background: var(--nsp-paper);
  color: var(--nsp-ink);
  font-size: 13px;
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s;
}
.nsp-select select:hover { border-color: #dcdce2; }
.nsp-select__caret {
  position: absolute; top: 50%; right: 10px;
  width: 17px; height: 17px;
  transform: translateY(-50%) rotate(90deg);
  color: var(--nsp-subtle); pointer-events: none;
}
.nsp-workspace-control { position: relative; min-width: 0; }
.nsp-workspace-picker select { display: none; }
.nsp-workspace-trigger {
  width: 100%; height: 44px; padding: 0 34px 0 12px;
  border: 1px solid #3b5b79; border-radius: var(--nsp-r-sm);
  background: #193b59; color: #fff; box-shadow: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; text-align: left;
}
.nsp-workspace-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsp-workspace-trigger .nsp-i { position: absolute; right: 10px; width: 17px; height: 17px; transition: transform .15s; }
.nsp-workspace-trigger[aria-expanded="true"] .nsp-i { transform: rotate(180deg); }
.nsp-workspace-trigger:hover { border-color: #5a7d9d; background: #204462; }
.nsp-workspace-trigger:focus-visible { border-color: #71b5f5; box-shadow: 0 0 0 3px rgba(113,181,245,.18); }
.nsp-workspace-menu { position: absolute; z-index: 90; top: calc(100% + 7px); left: 0; width: 100%; min-width: 0; max-height: min(320px, 55vh); overflow-y: auto; padding: 6px; border: 1px solid #cad5e1; border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(5,21,38,.28); }
.nsp-workspace-menu[hidden] { display: none; }
.nsp-workspace-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: #23364d; font-size: 13px; font-weight: 550; text-align: left; cursor: pointer; }
.nsp-workspace-menu button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsp-workspace-menu button .nsp-i { width: 17px; height: 17px; flex: 0 0 auto; color: #0969da; }
.nsp-workspace-menu button:hover, .nsp-workspace-menu button:focus-visible { background: #eaf3ff; color: #0758b8; outline: 0; }
.nsp-workspace-menu button[aria-selected="true"] { background: #eaf3ff; color: #0758b8; font-weight: 700; }

/* --- Main --------------------------------------------------------------- */
.nsp-main { position: relative; min-width: 0; padding: 32px clamp(26px, 3.5vw, 54px) 60px; background: var(--nsp-page); }
.nsp-pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.nsp-eyebrow { margin: 0 0 8px; color: var(--nsp-accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nsp-pagehead h1 { margin: 0; color: var(--nsp-ink); font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -.03em; }
.nsp-pagehead__intro { margin: 8px 0 0; color: var(--nsp-muted); font-size: 14px; }

/* --- Buttons (flat) ----------------------------------------------------- */
.nsp-button,
.nsp-document__actions button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm);
  background: var(--nsp-paper); color: var(--nsp-ink-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--nsp-sh-sm);
  transition: background .14s, border-color .14s, box-shadow .14s, color .14s;
}
.nsp-button .nsp-i,
.nsp-document__actions button .nsp-i { width: 17px; height: 17px; }
.nsp-button:hover,
.nsp-document__actions button:hover { border-color: #dcdce2; background: var(--nsp-wash); color: var(--nsp-ink); }
.nsp-button--primary {
  min-height: 42px; padding: 0 18px;
  border-color: var(--nsp-accent);
  background: var(--nsp-accent);
  color: #fff;
  box-shadow: 0 7px 16px rgba(9, 105, 218, .20);
}
.nsp-button--primary:hover { background: var(--nsp-accent-dark); border-color: var(--nsp-accent-dark); color: #fff; }
.nsp-button--primary .nsp-i { color: #fff; }
.nsp-button--quiet { background: transparent; box-shadow: none; }
.nsp-button--quiet:hover { background: var(--nsp-wash); }
.nsp-button--danger { border-color: #f0bcbc; background: var(--nsp-paper); color: var(--nsp-red); }
.nsp-button--danger:hover { background: var(--nsp-red-soft); border-color: #e79b9b; color: var(--nsp-red); }
.nsp-button--block { width: 100%; }
.nsp-button:disabled:not(.is-busy), .nsp-document__actions button:disabled:not(.is-busy) { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

/* Busy state: hide label/icon, show a centered spinner, block further clicks. */
.nsp-button.is-busy, .nsp-document__actions button.is-busy { color: transparent !important; pointer-events: none; position: relative; }
.nsp-button.is-busy::after, .nsp-document__actions button.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; border: 2px solid rgba(24, 24, 27, .3); border-top-color: transparent; border-radius: 50%; animation: nsp-spin .6s linear infinite; }
.nsp-button--primary.is-busy::after { border-color: rgba(255, 255, 255, .75); border-top-color: transparent; }

/* --- Global loading bar + batch-operation progress -------------------- */
.nsp-top-progress { position: fixed; z-index: 100; top: 0; left: 0; right: 0; height: 3px; opacity: 0; transition: opacity .25s ease; pointer-events: none; overflow: hidden; }
.nsp-top-progress.is-active { opacity: 1; }
/* Two overlapping segments (Material-style indeterminate) read as a smooth, premium sweep. */
.nsp-top-progress::before, .nsp-top-progress::after { content: ""; position: absolute; top: 0; bottom: 0; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, var(--nsp-accent-2), var(--nsp-accent)); box-shadow: 0 0 9px 1px rgba(9, 105, 218, .5); will-change: left, right; }
.nsp-top-progress::before { animation: nsp-bar-a 2.1s cubic-bezier(.65, .815, .735, .395) infinite; }
.nsp-top-progress::after { left: -200%; animation: nsp-bar-b 2.1s cubic-bezier(.165, .84, .44, 1) 1.15s infinite; }
@keyframes nsp-bar-a { 0% { left: -35%; right: 100%; } 60% { left: 100%; right: -90%; } 100% { left: 100%; right: -90%; } }
@keyframes nsp-bar-b { 0% { left: -200%; right: 100%; } 60% { left: 107%; right: -8%; } 100% { left: 107%; right: -8%; } }
.nsp-top-progress > span { display: none; position: absolute; inset: 0; background: linear-gradient(90deg, var(--nsp-accent-2), var(--nsp-accent)); } /* reduced-motion fallback */
.nsp-op-progress { position: fixed; z-index: 56; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); width: min(340px, calc(100vw - 44px)); padding: 15px 17px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-md); background: var(--nsp-paper); box-shadow: var(--nsp-sh-pop); color: var(--nsp-ink); animation: nsp-op-in .24s cubic-bezier(.2, .7, .3, 1) both; }
.nsp-op-progress.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.nsp-op-progress__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.nsp-op-progress__head strong { font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.nsp-op-progress__pct { flex: 0 0 auto; color: var(--nsp-accent); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.nsp-op-progress progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; accent-color: var(--nsp-accent); background: var(--nsp-line-2); overflow: hidden; }
.nsp-op-progress progress::-webkit-progress-bar { background: var(--nsp-line-2); border-radius: 999px; }
.nsp-op-progress progress::-webkit-progress-value { background: linear-gradient(90deg, var(--nsp-accent-2), var(--nsp-accent)); border-radius: 999px; transition: width .2s ease; }
.nsp-op-progress progress::-moz-progress-bar { background: var(--nsp-accent); border-radius: 999px; }
.nsp-op-progress progress:not([value]) { background: linear-gradient(90deg, var(--nsp-line-2) 30%, var(--nsp-accent-soft) 50%, var(--nsp-line-2) 70%); background-size: 200% 100%; animation: nsp-shimmer 1.2s linear infinite; }
.nsp-op-progress progress:not([value])::-webkit-progress-bar { background: transparent; }
@keyframes nsp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes nsp-op-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 620px) { .nsp-op-progress { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; } }
@media (prefers-reduced-motion: reduce) { .nsp-top-progress::before, .nsp-top-progress::after { display: none; } .nsp-top-progress > span { display: block; opacity: .9; } }
@keyframes nsp-spin { to { transform: rotate(360deg); } }

/* --- Stat cards --------------------------------------------------------- */
.nsp-stats { display: grid; grid-template-columns: repeat(2, minmax(220px, 380px)); gap: 16px; margin: 26px 0 20px; }
.nsp-stats article {
  display: flex; align-items: center; gap: 15px;
  min-height: 92px; padding: 18px 20px;
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-md);
  background: var(--nsp-paper); box-shadow: var(--nsp-sh-card);
}
.nsp-stat-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; }
.nsp-stat-icon .nsp-i { width: 23px; height: 23px; }
.nsp-stat-icon--docs { background: var(--nsp-accent-soft); color: var(--nsp-accent); }
.nsp-stat-icon--storage { background: var(--nsp-green-soft); color: var(--nsp-green); }
.nsp-stats article > div { min-width: 0; }
.nsp-stats article > div > span { display: block; color: var(--nsp-muted); font-size: 12px; font-weight: 500; }
.nsp-stats strong { display: block; margin: 3px 0 1px; color: var(--nsp-ink); font-size: 26px; font-weight: 720; letter-spacing: -.02em; }
.nsp-stats small { display: block; color: var(--nsp-subtle); font-size: 11px; }

/* --- Panels ------------------------------------------------------------- */
.nsp-panel { overflow: hidden; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-md); background: var(--nsp-paper); box-shadow: var(--nsp-sh-card); }
.nsp-panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.nsp-panel__heading h2 { margin: 0; color: var(--nsp-ink); font-size: 16px; font-weight: 650; }
.nsp-panel__heading p { margin: 4px 0 0; color: var(--nsp-muted); font-size: 12px; }

.nsp-toolbar {
  display: grid; grid-template-columns: minmax(240px, 1fr) 210px auto; gap: 10px;
  padding: 14px 22px; background: var(--nsp-wash);
  border-top: 1px solid var(--nsp-line); border-bottom: 1px solid var(--nsp-line);
}
.nsp-search { position: relative; display: block; }
.nsp-search .nsp-i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); width: 17px; height: 17px; color: var(--nsp-subtle); pointer-events: none; }
.nsp-search > span[aria-hidden="true"] { position: absolute; z-index: 1; top: 50%; left: 13px; transform: translateY(-50%); color: var(--nsp-muted); pointer-events: none; }
.nsp-search input {
  width: 100%; height: 40px; padding: 0 34px 0 38px;
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm);
  background: var(--nsp-paper); color: var(--nsp-ink); font-size: 13px;
  transition: border-color .14s, box-shadow .14s;
}
.nsp-search input:hover { border-color: #dcdce2; }
.nsp-search input::placeholder { color: var(--nsp-subtle); }
.nsp-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.nsp-search__clear { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--nsp-subtle); cursor: pointer; }
.nsp-search__clear:hover { background: var(--nsp-wash); color: var(--nsp-ink); }
.nsp-search__clear .nsp-i { width: 16px; height: 16px; }
.nsp-filter { display: block; }
.nsp-filter select {
  width: 100%; height: 40px; padding: 0 34px 0 12px;
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm);
  background-color: var(--nsp-paper); color: var(--nsp-ink); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2366778b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
  appearance: none; -webkit-appearance: none;
}
.nsp-filter select:hover { border-color: #bdcad8; background-color: #fbfdff; }
.nsp-filter select:focus { border-color: var(--nsp-accent); box-shadow: var(--nsp-ring); }
.nsp-toolbar .nsp-button { justify-self: start; }

.nsp-list-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px 160px; gap: 14px;
  padding: 10px 22px; background: var(--nsp-wash);
  border-bottom: 1px solid var(--nsp-line);
  color: var(--nsp-subtle); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* --- Explorer (folders + files split) ----------------------------------- */
.nsp-explorer__body { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.nsp-explorer__folders { padding: 16px 12px; border-right: 1px solid var(--nsp-line); background: #f7f9fc; }
.nsp-explorer__label { margin: 0 0 10px; padding: 0 8px; color: var(--nsp-subtle); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nsp-folder-tree { display: grid; gap: 2px; }
.nsp-folder-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--nsp-r-sm);
  background: transparent; color: var(--nsp-ink-2);
  font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background .13s, color .13s;
}
.nsp-folder-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsp-folder-item__icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--nsp-subtle); }
.nsp-folder-item:hover { background: #e9f1fa; color: var(--nsp-ink); }
.nsp-folder-item:hover .nsp-folder-item__icon { color: var(--nsp-muted); }
.nsp-folder-item.is-active { background: #dcecff; color: var(--nsp-accent-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--nsp-accent); }
.nsp-folder-item.is-active .nsp-folder-item__icon { color: var(--nsp-accent); }

.nsp-explorer__main { min-width: 0; display: flex; flex-direction: column; }
.nsp-breadcrumb { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 9px 14px 9px 22px; border-bottom: 1px solid var(--nsp-line); background: #fff; }
.nsp-breadcrumb__trail { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; min-width: 0; }
.nsp-breadcrumb__actions { display: flex; gap: 6px; flex: 0 0 auto; }
.nsp-breadcrumb__actions .nsp-button { min-height: 32px; padding: 0 11px; font-size: 12px; }
.nsp-breadcrumb__actions .nsp-danger { color: var(--nsp-red); }
.nsp-breadcrumb__actions .nsp-danger:hover { background: var(--nsp-red-soft); }
.nsp-crumb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--nsp-muted);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background .13s, color .13s;
}
.nsp-crumb__icon { width: 15px; height: 15px; }
.nsp-crumb:hover { background: var(--nsp-wash); color: var(--nsp-ink); }
.nsp-crumb.is-current { color: var(--nsp-ink); font-weight: 650; cursor: default; }
.nsp-crumb__sep { display: inline-flex; color: var(--nsp-subtle); }
.nsp-crumb__sep .nsp-i { width: 14px; height: 14px; }
.nsp-explorer .nsp-list-head { background: var(--nsp-paper); }
.nsp-list-head--selectable { grid-template-columns: 26px minmax(0, 1fr) 220px 160px; }
.nsp-commandbar {
  display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 7px 14px 7px 22px;
  border-bottom: 1px solid var(--nsp-line); background: #fbfcfe;
}
.nsp-select-all { display: inline-flex; align-items: center; gap: 8px; color: var(--nsp-ink-2); font-size: 12px; font-weight: 650; cursor: pointer; }
.nsp-select-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--nsp-accent); }
.nsp-selection-summary { min-width: 112px; color: var(--nsp-muted); font-size: 12px; }
.nsp-commandbar .nsp-button { min-height: 34px; padding: 0 11px; font-size: 12px; }
.nsp-commandbar .nsp-button:disabled { opacity: .42; cursor: not-allowed; }
.nsp-commandbar .nsp-danger { color: var(--nsp-red); }
.nsp-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--nsp-muted); font-size: 12px; }
.nsp-sort select { height: 34px; min-width: 154px; padding: 0 32px 0 10px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background-color: #fff; color: var(--nsp-ink-2); font-size: 12px; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2366778b' stroke-width='1.8'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.nsp-sort select:focus { border-color: var(--nsp-accent); box-shadow: var(--nsp-ring); outline: 0; }
.nsp-view-control { display: flex; align-items: center; gap: 2px; margin-left: 4px; padding: 3px; border: 1px solid var(--nsp-line); border-radius: 9px; background: #fff; }
.nsp-view-control > span { margin: 0 5px 0 4px; color: var(--nsp-muted); font-size: 12px; }
.nsp-view-control button { display: grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--nsp-muted); cursor: pointer; }
.nsp-view-control button .nsp-i { width: 17px; height: 17px; }
.nsp-view-control button:hover { background: var(--nsp-wash); color: var(--nsp-ink); }
.nsp-view-control button[aria-pressed="true"] { background: var(--nsp-accent-soft); color: var(--nsp-accent); box-shadow: inset 0 0 0 1px #c5ddfa; }

/* --- Document rows ------------------------------------------------------ */
.nsp-document { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 22px; border-bottom: 1px solid var(--nsp-line-2); transition: background .12s; }
.nsp-document--selectable { grid-template-columns: 26px 44px minmax(0, 1fr) auto; }
.nsp-document:last-child { border-bottom: 0; }
.nsp-document:hover { background: var(--nsp-wash); }
.nsp-document.is-selected { background: var(--nsp-accent-soft); }
.nsp-document.is-selected:hover { background: var(--nsp-accent-soft); }
.nsp-check-cell { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nsp-doc-check { width: 16px; height: 16px; margin: 0; accent-color: var(--nsp-accent); cursor: pointer; }
.nsp-file-icon {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 48px; padding: 0; border-radius: var(--nsp-r-sm);
  background: var(--nsp-accent-soft); color: var(--nsp-accent);
  border: 1px solid rgba(79, 70, 229, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 2px 5px rgba(16,35,59,.06);
}
.nsp-file-icon .nsp-i { width: 25px; height: 25px; }
.nsp-format-mark {
  display: grid; place-items: center; align-content: center;
  width: 31px; height: 34px; padding-top: 1px; border-radius: 5px;
  background: #536579; color: #fff; box-shadow: 0 2px 5px rgba(16,35,59,.18);
  line-height: 1;
}
.nsp-format-mark strong { font-size: 15px; font-weight: 850; letter-spacing: -.04em; }
.nsp-format-mark small { margin-top: 3px; font-size: 5.5px; font-weight: 800; letter-spacing: .035em; }
.nsp-file-icon.is-pdf .nsp-format-mark { background: #e32636; }
.nsp-file-icon.is-pdf .nsp-format-mark strong { font-size: 9px; letter-spacing: -.015em; }
.nsp-file-icon.is-doc .nsp-format-mark,
.nsp-file-icon.is-docx .nsp-format-mark { background: #185abd; }
.nsp-file-icon.is-sheet .nsp-format-mark,
.nsp-file-icon.is-xlsx .nsp-format-mark,
.nsp-file-icon.is-csv .nsp-format-mark { background: #107c41; }
.nsp-file-icon.is-slide .nsp-format-mark,
.nsp-file-icon.is-pptx .nsp-format-mark { background: #c43e1c; }
.nsp-file-icon.is-pdf { background: var(--nsp-red-soft); color: var(--nsp-red); border-color: rgba(220, 38, 38, .16); }
.nsp-file-icon.is-doc { background: var(--nsp-accent-soft); color: var(--nsp-accent); border-color: rgba(79, 70, 229, .14); }
.nsp-file-icon.is-docx { background: #e8f1ff; color: #185abd; border-color: rgba(24, 90, 189, .18); }
.nsp-file-icon.is-sheet { background: var(--nsp-green-soft); color: var(--nsp-green); border-color: rgba(5, 150, 105, .16); }
.nsp-file-icon.is-xlsx { background: #e3f4eb; color: #107c41; border-color: rgba(16, 124, 65, .18); }
.nsp-file-icon.is-csv { background: #ebf7f0; color: #218c5a; border-color: rgba(33, 140, 90, .18); }
.nsp-file-icon.is-slide { background: var(--nsp-amber-soft); color: var(--nsp-amber); border-color: rgba(217, 119, 6, .16); }
.nsp-file-icon.is-pptx { background: #fff0e8; color: #c43e1c; border-color: rgba(196, 62, 28, .18); }
.nsp-file-icon.is-image { background: var(--nsp-purple-soft); color: var(--nsp-purple); border-color: rgba(124, 58, 237, .16); }
.nsp-file-icon.is-jpg { background: #f4ecff; color: #7c3aed; border-color: rgba(124, 58, 237, .18); }
.nsp-file-icon.is-png { background: #eaf5ff; color: #1769aa; border-color: rgba(23, 105, 170, .18); }
.nsp-file-icon.is-gif { background: #fff0fa; color: #b42378; border-color: rgba(180, 35, 120, .18); }
.nsp-file-icon.is-webp { background: #ecf9f7; color: #087f73; border-color: rgba(8, 127, 115, .18); }
.nsp-file-icon.is-archive,
.nsp-file-icon.is-text,
.nsp-file-icon.is-generic { background: #f1f1f4; color: #52525b; border-color: #e4e4e9; }
.nsp-file-icon.is-deleted { background: #f4f4f6; color: var(--nsp-muted); border-color: var(--nsp-line); }
.nsp-file-icon:not(.is-deleted) { background: transparent; border-color: transparent; box-shadow: none; }
.nsp-file-icon img { display: block; width: 43px; height: 43px; object-fit: contain; }
.nsp-file-icon--sm { width: 34px; height: 38px; padding: 0; }
.nsp-file-icon--sm .nsp-i { width: 17px; height: 17px; }

.nsp-document__meta { min-width: 0; }
.nsp-document__meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nsp-ink); font-size: 13.5px; font-weight: 600; }
.nsp-document__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; color: var(--nsp-muted); font-size: 11.5px; }
.nsp-document__sub time { color: var(--nsp-muted); }
.nsp-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: var(--nsp-r-pill); background: #f1f1f4; color: var(--nsp-ink-2); font-size: 10.5px; font-weight: 650; }
.nsp-badge--current { background: var(--nsp-green-soft); color: var(--nsp-green); margin-left: 8px; }
.nsp-badge--scanning { background: #fef3c7; color: #92400e; margin-left: 6px; }
.nsp-tags { display: inline-flex; gap: 5px; }
.nsp-tag { padding: 1px 8px; border-radius: var(--nsp-r-pill); background: var(--nsp-accent-soft); color: var(--nsp-accent-dark); font-size: 10.5px; font-weight: 600; }
.nsp-document__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.nsp-document__actions button { min-height: 32px; padding: 0 10px; font-size: 12px; }
.nsp-document__actions button span { display: inline; }
.nsp-document__actions .nsp-danger { color: var(--nsp-red); }
.nsp-document__actions .nsp-danger:hover { border-color: #f0bcbc; background: var(--nsp-red-soft); color: var(--nsp-red); }

.nsp-load-more { display: flex; justify-content: center; padding: 18px; }

.nsp-document-list[data-view="list"] .nsp-document { min-height: 48px; padding-top: 7px; padding-bottom: 7px; }
.nsp-document-list[data-view="list"] .nsp-file-icon { width: 34px; height: 36px; }
.nsp-document-list[data-view="list"] .nsp-file-icon img { width: 32px; height: 32px; }
.nsp-document-list[data-view="list"] .nsp-document__actions button:not([data-action="more"]) { display: none; }
.nsp-document-list[data-view="list"] .nsp-folder-row { min-height: 48px; }

.nsp-document-list[data-view="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px; align-content: start; }
.nsp-document-list[data-view="grid"] .nsp-folder-row { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 150px; padding: 18px 12px; border: 1px solid var(--nsp-line); border-radius: 11px; background: #fff; text-align: center; box-shadow: var(--nsp-sh-sm); }
.nsp-document-list[data-view="grid"] .nsp-folder-row__icon { width: 46px; height: 46px; color: #e2a72f; }
.nsp-document-list[data-view="grid"] .nsp-folder-row__name { width: 100%; flex: 0 0 auto; }
.nsp-document-list[data-view="grid"] .nsp-folder-row__meta, .nsp-document-list[data-view="grid"] .nsp-folder-row__chev { display: none; }
.nsp-document-list[data-view="grid"] .nsp-document { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 9px; min-width: 0; min-height: 150px; padding: 18px 12px; border: 1px solid var(--nsp-line); border-radius: 11px; background: #fff; text-align: center; box-shadow: var(--nsp-sh-sm); }
.nsp-document-list[data-view="grid"] .nsp-document:hover, .nsp-document-list[data-view="grid"] .nsp-folder-row:hover { border-color: #bfd5ee; box-shadow: 0 8px 20px rgba(16,35,59,.10); }
.nsp-document-list[data-view="grid"] .nsp-document.is-selected { border-color: #8cbae9; background: var(--nsp-accent-soft); box-shadow: inset 0 0 0 1px var(--nsp-accent); }
.nsp-document-list[data-view="grid"] .nsp-check-cell { position: absolute; top: 10px; left: 10px; }
.nsp-document-list[data-view="grid"] .nsp-file-icon { width: 58px; height: 62px; }
.nsp-document-list[data-view="grid"] .nsp-file-icon img { width: 56px; height: 56px; }
.nsp-document-list[data-view="grid"] .nsp-document__meta { width: 100%; }
.nsp-document-list[data-view="grid"] .nsp-document__meta strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.nsp-document-list[data-view="grid"] .nsp-document__meta span { margin-top: 4px; font-size: 10px; }
.nsp-document-list[data-view="grid"] .nsp-document__actions { position: absolute; top: 7px; right: 7px; }
.nsp-document-list[data-view="grid"] .nsp-document__actions button:not([data-action="more"]) { display: none; }
.nsp-document-list[data-view="grid"] .nsp-document__actions button[data-action="more"] { width: 30px; min-width: 30px; min-height: 30px; padding: 0; background: rgba(255,255,255,.88); }
.nsp-document-list[data-view="grid"] .nsp-empty, .nsp-document-list[data-view="grid"] .nsp-loading, .nsp-document-list[data-view="grid"] .nsp-load-more { grid-column: 1 / -1; }

/* --- Activity timeline ------------------------------------------------- */
.nsp-activity { display: grid; gap: 0; padding: 6px 22px 18px; }
.nsp-activity-card {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 13px; align-items: center;
  min-height: 72px; padding: 12px 4px; border-bottom: 1px solid var(--nsp-line-2);
}
.nsp-activity-card:last-child { border-bottom: 0; }
.nsp-activity-card__icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid #cfe2f8; border-radius: 10px; background: var(--nsp-accent-soft);
  color: var(--nsp-accent); font-size: 17px; font-weight: 750;
}
.nsp-activity-card__body { display: flex; flex-direction: column; min-width: 0; }
.nsp-activity-card__body strong { color: var(--nsp-ink); font-size: 13.5px; font-weight: 700; text-transform: capitalize; }
.nsp-activity-card__body span { margin-top: 3px; color: var(--nsp-muted); font-size: 11.5px; }
.nsp-activity-card time { color: var(--nsp-muted); font-size: 11.5px; white-space: nowrap; }
.nsp-activity-card time small { color: var(--nsp-subtle); font-size: 9.5px; font-weight: 700; }
.nsp-pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 12px 20px; border-top: 1px solid var(--nsp-line); background: #fff; color: var(--nsp-muted); font-size: 12px; }
.nsp-pager:empty { display: none; }
.nsp-pager > div { display: flex; align-items: center; gap: 5px; }
.nsp-pager button { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--nsp-line); border-radius: 9px; background: #fff; color: var(--nsp-ink); font: inherit; font-weight: 700; cursor: pointer; transition: border-color .16s, background .16s, color .16s, box-shadow .16s; }
.nsp-pager button:hover:not(:disabled) { border-color: var(--nsp-accent); color: var(--nsp-accent); box-shadow: 0 4px 12px rgba(19, 92, 202, .10); }
.nsp-pager button.is-current { border-color: var(--nsp-accent); background: var(--nsp-accent); color: #fff; }
.nsp-pager button:disabled { opacity: .42; cursor: not-allowed; }
.nsp-page-size { display: flex; align-items: center; gap: 8px; color: var(--nsp-muted); font-size: 12px; font-weight: 700; }
.nsp-page-size select { min-width: 74px; height: 38px; border: 1px solid var(--nsp-line); border-radius: 9px; background: #fff; color: var(--nsp-ink); padding: 0 28px 0 10px; }
.nsp-preview-dialog { width: min(1180px, calc(100vw - 40px)); height: min(820px, calc(100vh - 40px)); padding: 0; border: 0; border-radius: 18px; background: #fff; color: var(--nsp-ink); box-shadow: 0 28px 90px rgba(15, 28, 50, .28); overflow: hidden; }
.nsp-preview-dialog::backdrop { background: rgba(9, 19, 35, .72); backdrop-filter: blur(5px); }
body.nsp-preview-tab { margin: 0 !important; background: #eef2f7 !important; overflow: hidden; }
body.nsp-preview-tab .nsp-app > :not(.nsp-preview-dialog) { display: none !important; }
body.nsp-preview-tab .nsp-preview-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
body.nsp-preview-tab .nsp-preview-stage { height: calc(100dvh - 82px); }
.nsp-preview-dialog header { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; padding: 12px 18px 12px 20px; border-bottom: 1px solid #dce3ec; background: rgba(255,255,255,.98); box-shadow: 0 3px 14px rgba(20,35,58,.06); }
.nsp-preview-dialog h2 { max-width: 720px; margin: 2px 0 0; overflow: hidden; color: var(--nsp-ink); font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.nsp-preview-dialog header p { margin: 3px 0 0; color: var(--nsp-muted); font-size: 11px; }
.nsp-preview-actions { display: flex; align-items: center; gap: 9px; }
.nsp-preview-actions .nsp-dialog__close { position: static; }
.nsp-preview-file-info { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 12px; min-width: 0; }
.nsp-preview-file-info .nsp-eyebrow, .nsp-preview-file-info h2, .nsp-preview-file-info > p:last-child { grid-column: 2; }
.nsp-preview-filemark { grid-column: 1; grid-row: 1 / 4; display: grid; place-items: center; width: 42px; height: 48px; align-self: center; border: 1px solid #d8e2ee; border-radius: 10px; background: #f5f8fc; }
.nsp-preview-filemark img { display: block; width: 28px; height: 34px; object-fit: contain; }
.nsp-preview-close { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: #f2f5f9; color: #405168; font: 650 12px "Segoe UI", sans-serif; cursor: pointer; transition: background .15s, color .15s; }
.nsp-preview-close span { font-size: 20px; font-weight: 400; line-height: 1; }
.nsp-preview-close:hover { background: #e8edf4; color: #172033; }
.nsp-preview-stage { display: grid; place-items: center; height: calc(100% - 82px); background: #eef2f7; overflow: auto; }
.nsp-preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.nsp-preview-image { display: block; max-width: calc(100% - 40px); max-height: calc(100% - 40px); object-fit: contain; border-radius: 6px; box-shadow: 0 16px 48px rgba(20, 35, 58, .18); }
.nsp-pdf-toolbar { position: sticky; z-index: 5; top: 0; align-self: start; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: 100%; min-height: 52px; padding: 7px 18px; border-bottom: 1px solid var(--nsp-line); background: rgba(255, 255, 255, .96); box-shadow: 0 4px 14px rgba(20, 35, 58, .08); backdrop-filter: blur(8px); }
.nsp-pdf-toolbar span { margin-right: 10px; color: var(--nsp-muted); font-size: 12px; font-weight: 650; }
.nsp-pdf-toolbar > span { justify-self: start; }
.nsp-pdf-page-nav, .nsp-pdf-zoom { display: flex; align-items: center; gap: 7px; }
.nsp-pdf-page-nav { justify-self: center; }
.nsp-pdf-zoom { justify-self: end; }
.nsp-pdf-toolbar strong { min-width: 58px; color: var(--nsp-ink); font-size: 12px; text-align: center; }
.nsp-pdf-toolbar button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--nsp-line); border-radius: 8px; background: #fff; color: var(--nsp-ink); font-size: 18px; cursor: pointer; }
.nsp-pdf-toolbar [data-pdf-fit] { width: auto; padding: 0 10px; font-size: 11px; font-weight: 700; }
.nsp-pdf-toolbar button:hover { border-color: var(--nsp-accent); color: var(--nsp-accent); }
.nsp-pdf-pages { align-self: start; display: grid; justify-items: center; gap: 18px; width: 100%; min-height: calc(100% - 48px); padding: 22px; overflow: visible; }
.nsp-pdf-page { max-width: 100%; border: 1px solid #d5dce6; background: #fff; box-shadow: 0 12px 28px rgba(20, 35, 58, .14); overflow: auto; }
.nsp-pdf-page canvas { display: block; max-width: none; }
.nsp-ppt-preview { align-self: stretch; display: flex; flex-direction: column; width: 100%; min-height: 100%; padding: 0 28px 22px; background: #dfe5ed; overflow: hidden; }
.nsp-ppt-preview > div { max-width: 100%; margin-inline: auto; }
.nsp-ppt-preview .pptx-preview-wrapper { width: 100% !important; height: calc(100dvh - 156px) !important; max-height: calc(100dvh - 156px); padding: 22px 0; background: #0b0d10; scroll-behavior: smooth; scrollbar-gutter: stable; }
.nsp-ppt-toolbar { position: sticky; z-index: 4; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: calc(100% + 56px); min-height: 52px; margin: 0 -28px !important; padding: 7px 18px; border-bottom: 1px solid #cfd8e4; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(20,35,58,.08); backdrop-filter: blur(8px); }
.nsp-ppt-toolbar > span, .nsp-ppt-toolbar > small { color: var(--nsp-muted); font-size: 11px; font-weight: 650; }
.nsp-ppt-toolbar > small { justify-self: end; }
.nsp-ppt-toolbar > div { display: flex; align-items: center; gap: 8px; }
.nsp-ppt-toolbar button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--nsp-line); border-radius: 8px; background: #fff; color: var(--nsp-ink); font-size: 18px; }
.nsp-ppt-toolbar strong { min-width: 64px; color: var(--nsp-ink); font-size: 12px; text-align: center; }
.nsp-ppt-preview button { border-radius: 8px; font-family: "Segoe UI", sans-serif; cursor: pointer; }
.nsp-text-preview { align-self: stretch; justify-self: stretch; min-width: 100%; min-height: 100%; margin: 0; padding: 24px; background: #fff; color: #172033; font: 13px/1.65 Consolas, "Courier New", monospace; tab-size: 4; white-space: pre-wrap; overflow-wrap: anywhere; }
.nsp-preview-fallback { width: min(440px, calc(100% - 36px)); padding: 40px; border: 1px solid var(--nsp-line); border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 18px 50px rgba(20, 35, 58, .12); }
.nsp-preview-fallback .nsp-file-icon { width: 72px; height: 82px; margin: 0 auto 18px; }
.nsp-preview-fallback h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.nsp-preview-fallback p { margin: 10px 0 22px; color: var(--nsp-muted); line-height: 1.6; }
.nsp-preview-loading { color: var(--nsp-muted); text-align: center; }
.nsp-preview-loading span { display: block; width: 34px; height: 34px; margin: 0 auto 10px; border: 3px solid #d7e0ec; border-top-color: var(--nsp-accent); border-radius: 50%; animation: nsp-spin .7s linear infinite; }
.nsp-word-preview { align-self: start; width: min(850px, calc(100% - 48px)); min-height: calc(100% - 48px); margin: 24px; padding: clamp(30px, 6vw, 72px); border: 1px solid #dfe5ed; background: #fff; box-shadow: 0 12px 34px rgba(20, 35, 58, .12); color: #172033; font: 15px/1.65 Georgia, serif; overflow-wrap: anywhere; }
.nsp-word-preview h1, .nsp-word-preview h2, .nsp-word-preview h3 { color: #101828; font-family: "Segoe UI", sans-serif; line-height: 1.25; }
.nsp-word-preview img { max-width: 100%; height: auto; }
.nsp-word-preview table { width: 100%; border-collapse: collapse; font-family: "Segoe UI", sans-serif; }
.nsp-word-preview td, .nsp-word-preview th { padding: 8px; border: 1px solid #d7dee8; }
.nsp-sheet-preview { align-self: stretch; justify-self: stretch; display: flex; flex-direction: column; min-width: 0; min-height: 100%; background: #fff; }
.nsp-sheet-tabs { display: flex; flex: 0 0 auto; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--nsp-line); background: #f7f9fc; overflow-x: auto; }
.nsp-sheet-tabs button { min-width: 90px; padding: 10px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--nsp-muted); font: 650 12px "Segoe UI", sans-serif; cursor: pointer; white-space: nowrap; }
.nsp-sheet-tabs button.is-active { border-color: var(--nsp-line); background: #fff; color: var(--nsp-accent); }
.nsp-sheet-content { flex: 1; min-height: 0; padding: 16px; overflow: auto; }
.nsp-sheet-content table { min-width: 100%; border-collapse: separate; border-spacing: 0; font: 12px/1.4 "Segoe UI", sans-serif; }
.nsp-sheet-content th, .nsp-sheet-content td { min-width: 110px; max-width: 320px; padding: 8px 10px; border-right: 1px solid #e5e9f0; border-bottom: 1px solid #e5e9f0; background: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsp-sheet-content th { position: sticky; z-index: 2; top: 0; background: #edf3fb; color: #19324e; font-weight: 750; text-align: left; }
.nsp-sheet-content tr > :first-child { border-left: 1px solid #e5e9f0; }
.nsp-preview-warning { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #f3d28b; border-radius: 8px; background: #fff8e7; color: #704d00; font-size: 12px; }
.nsp-slide-deck { align-self: start; display: grid; gap: 22px; width: min(960px, calc(100% - 44px)); margin: 22px; }
.nsp-slide-card { position: relative; aspect-ratio: 16 / 9; padding: clamp(30px, 5vw, 64px); border: 1px solid #d9e0e9; border-radius: 8px; background: #fff; box-shadow: 0 12px 30px rgba(20, 35, 58, .13); overflow: auto; }
.nsp-slide-number { position: absolute; right: 14px; bottom: 11px; color: var(--nsp-subtle); font-size: 11px; font-weight: 700; }
.nsp-slide-copy { display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
.nsp-slide-copy p { margin: 5px 0; color: #172033; font-size: clamp(14px, 2vw, 24px); line-height: 1.3; }
.nsp-slide-copy p:first-child { color: #0f2742; font-size: clamp(20px, 3vw, 38px); font-weight: 750; }
.nsp-slide-copy .nsp-slide-empty { color: var(--nsp-muted); font-size: 14px; font-weight: 500; text-align: center; }
.nsp-archive-preview { align-self: start; width: min(860px, calc(100% - 44px)); margin: 22px; border: 1px solid var(--nsp-line); border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(20, 35, 58, .10); overflow: hidden; }
.nsp-archive-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--nsp-line); background: #f8fafc; }
.nsp-archive-heading span { color: var(--nsp-muted); font-size: 12px; }
.nsp-archive-list > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 44px; padding: 8px 18px; border-bottom: 1px solid var(--nsp-line-2); }
.nsp-archive-list > div:last-child { border-bottom: 0; }
.nsp-archive-list strong { min-width: 0; font-size: 12.5px; overflow-wrap: anywhere; }
.nsp-archive-kind { padding: 4px 7px; border-radius: 6px; background: var(--nsp-accent-soft); color: var(--nsp-accent); font-size: 10px; font-weight: 750; text-align: center; text-transform: uppercase; }
@media (max-width: 640px) {
  .nsp-preview-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .nsp-preview-dialog header { min-height: 72px; padding: 10px 12px 10px 16px; }
  .nsp-preview-dialog h2 { max-width: 52vw; font-size: 15px; }
  .nsp-preview-actions { gap: 5px; }
  .nsp-preview-file-info { grid-template-columns: 34px minmax(0, 1fr); column-gap: 9px; }
  .nsp-preview-filemark { width: 32px; height: 38px; border-radius: 8px; }
  .nsp-preview-filemark img { width: 23px; height: 28px; }
  .nsp-preview-close strong { display: none; }
  .nsp-preview-close { width: 38px; padding: 0; justify-content: center; }
  .nsp-preview-stage { height: calc(100% - 72px); }
  .nsp-word-preview { width: calc(100% - 20px); min-height: calc(100% - 20px); margin: 10px; padding: 24px 18px; }
  .nsp-pdf-pages { align-content: start; justify-content: start; padding: 10px; overflow-x: auto; }
  .nsp-pdf-toolbar { grid-template-columns: auto 1fr; gap: 8px; padding: 7px 10px; }
  .nsp-pdf-toolbar > span { display: none; }
  .nsp-pdf-page-nav { justify-self: start; }
  .nsp-pdf-zoom { justify-self: end; }
  .nsp-pdf-toolbar [data-pdf-fit] { display: none; }
  .nsp-ppt-preview { padding: 0 6px 10px; }
  .nsp-ppt-toolbar { width: calc(100% + 12px); margin: 0 -6px !important; grid-template-columns: 1fr auto; padding: 7px 10px; }
  .nsp-ppt-toolbar > small { display: none; }
  .nsp-slide-deck, .nsp-archive-preview { width: calc(100% - 20px); margin: 10px; }
  .nsp-slide-card { padding: 24px; }
}
.nsp-dropzone.is-uploading { opacity: .58; pointer-events: none; }

/* Sub-folder rows shown inside the file list while browsing */
.nsp-folder-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 220px 24px; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 22px; border: 0; border-bottom: 1px solid var(--nsp-line-2); background: transparent; color: var(--nsp-ink); font-size: 13.5px; font-weight: 650; text-align: left; cursor: pointer; transition: background .12s, box-shadow .12s; }
.nsp-folder-row:hover { background: var(--nsp-wash); }
.nsp-folder-row:focus-visible { position: relative; z-index: 1; box-shadow: inset 0 0 0 2px var(--nsp-accent); outline: 0; }
.nsp-folder-row__icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--nsp-accent); }
.nsp-folder-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsp-folder-row__meta { color: var(--nsp-muted); font-size: 11.5px; font-weight: 500; }
.nsp-folder-row__chev { width: 17px; height: 17px; flex: 0 0 auto; color: var(--nsp-subtle); }

@media (hover: hover) and (pointer: fine) {
  [data-document-row][draggable="true"], [data-drag-folder][draggable="true"] { cursor: grab; }
  [data-document-row][draggable="true"]:active, [data-drag-folder][draggable="true"]:active { cursor: grabbing; }
}
.nsp-document.is-dragging, .nsp-folder-row.is-dragging, .nsp-folder-item.is-dragging { opacity: .42; }
[data-drop-folder].is-drop-target { position: relative; z-index: 2; background: #dcecff !important; color: #0758b8 !important; box-shadow: inset 0 0 0 2px #0969da, 0 4px 14px rgba(9,105,218,.16) !important; }
.nsp-drag-preview { position: fixed; left: -1000px; top: -1000px; z-index: 2147483000; display: flex; align-items: center; gap: 9px; max-width: 240px; padding: 9px 13px; border: 1px solid #b9d5f5; border-radius: 9px; background: #fff; color: #17324f; box-shadow: 0 12px 28px rgba(15,35,59,.22); font: 650 12px/1.2 "Segoe UI", sans-serif; white-space: nowrap; }
.nsp-drag-preview .nsp-i { width: 19px; height: 19px; color: #0969da; }

/* --- Empty / loading states -------------------------------------------- */
.nsp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 320px; padding: 44px 20px; text-align: center;
  background: radial-gradient(circle at 50% 42%, var(--nsp-accent-softer) 0, #fff 46%);
  color: var(--nsp-muted);
}
.nsp-empty__art { position: relative; width: 90px; height: 70px; margin-bottom: 20px; }
.nsp-empty__art i { position: absolute; display: block; width: 52px; height: 60px; border: 1px solid #e2e2ea; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(24, 24, 27, .07); }
.nsp-empty__art i:nth-child(1) { left: 2px; top: 8px; transform: rotate(-9deg); background: var(--nsp-accent-softer); }
.nsp-empty__art i:nth-child(2) { right: 1px; top: 7px; transform: rotate(8deg); background: var(--nsp-green-soft); }
.nsp-empty__art i:nth-child(3) { left: 19px; top: 0; }
.nsp-empty__art i:nth-child(3)::before, .nsp-empty__art i:nth-child(3)::after { content: ""; position: absolute; left: 11px; right: 11px; height: 3px; border-radius: 3px; background: #e4e4ec; }
.nsp-empty__art i:nth-child(3)::before { top: 19px; }
.nsp-empty__art i:nth-child(3)::after { top: 29px; }
.nsp-empty strong { display: block; margin-bottom: 6px; color: var(--nsp-ink); font-size: 18px; font-weight: 650; }
.nsp-empty > span:not(.nsp-empty__art) { max-width: 420px; font-size: 13px; line-height: 1.55; }
.nsp-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }

.nsp-loading { min-height: 240px; padding: 22px; }
.nsp-loading span { display: block; height: 13px; margin: 14px 0; border-radius: 6px; background: linear-gradient(90deg, #f0f0f3 25%, #f8f8fa 50%, #f0f0f3 75%); background-size: 200% 100%; animation: nsp-shimmer 1.3s infinite; }
.nsp-loading span:nth-child(2) { width: 78%; }
.nsp-loading span:nth-child(3) { width: 62%; }
@keyframes nsp-shimmer { to { background-position: -200% 0; } }

/* --- Activity ----------------------------------------------------------- */
.nsp-activity { padding: 8px 22px 12px; }
.nsp-activity__row { display: flex; gap: 14px; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid var(--nsp-line-2); }
.nsp-activity__row:last-child { border-bottom: 0; }
.nsp-activity__icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; background: var(--nsp-accent-soft); color: var(--nsp-accent); }
.nsp-activity__icon .nsp-i { width: 19px; height: 19px; }
.nsp-activity__body { min-width: 0; padding-top: 2px; }
.nsp-activity__body p { margin: 0; color: var(--nsp-ink); font-size: 13px; }
.nsp-activity__body small { display: block; margin-top: 3px; color: var(--nsp-muted); font-size: 11.5px; }

/* --- Toasts ------------------------------------------------------------- */
.nsp-toasts { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.nsp-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px; border: 1px solid var(--nsp-line); border-left-width: 3px;
  border-radius: var(--nsp-r-sm); background: var(--nsp-paper);
  box-shadow: 0 12px 32px rgba(24, 24, 27, .14);
  color: var(--nsp-ink); font-size: 13px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s, transform .2s;
  pointer-events: auto;
}
.nsp-toast.is-in { opacity: 1; transform: translateY(0); }
.nsp-toast.is-out { opacity: 0; transform: translateY(10px); }
.nsp-toast__icon { width: 20px; height: 20px; margin-top: 1px; }
.nsp-toast__text { flex: 1; min-width: 0; }
.nsp-toast__close { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; margin: -3px -3px 0 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--nsp-subtle); cursor: pointer; }
.nsp-toast__close .nsp-i { width: 16px; height: 16px; }
.nsp-toast__close:hover { background: var(--nsp-wash); color: var(--nsp-ink); }
.nsp-toast--success { border-left-color: var(--nsp-green); }
.nsp-toast--success .nsp-toast__icon { color: var(--nsp-green); }
.nsp-toast--error { border-left-color: var(--nsp-red); }
.nsp-toast--error .nsp-toast__icon { color: var(--nsp-red); }
.nsp-toast--info { border-left-color: var(--nsp-accent); }
.nsp-toast--info .nsp-toast__icon { color: var(--nsp-accent); }

/* --- Right-click context menu ------------------------------------------- */
.nsp-menu {
  position: fixed; z-index: 2147483000; width: 238px; padding: 7px;
  border: 1px solid #dfe3e8; border-radius: 12px;
  background-color: #fff; color: #152235;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22), 0 3px 10px rgba(15, 23, 42, .10);
  opacity: 1; isolation: isolate; backdrop-filter: none;
  transform-origin: top left; animation: nsp-menu-in .12s ease;
}
.nsp-menu[hidden] { display: none; }
@keyframes nsp-menu-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.nsp-menu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 38px; padding: 8px 10px;
  border: 0; border-radius: 7px; background: transparent;
  color: #344358; font-family: inherit; font-size: 13px; font-weight: 550; line-height: 1.25; text-align: left; cursor: pointer;
}
.nsp-menu__item span { flex: 1; }
.nsp-menu__item .nsp-i { width: 18px; height: 18px; flex: 0 0 auto; color: #718096; }
.nsp-menu__item:hover, .nsp-menu__item:focus-visible { background: #eaf3ff; color: #0b5fc6; outline: none; }
.nsp-menu__item:hover .nsp-i, .nsp-menu__item:focus-visible .nsp-i { color: #126bd3; }
.nsp-menu__item.is-danger { color: #c62828; }
.nsp-menu__item.is-danger .nsp-i { color: #d23b3b; }
.nsp-menu__item.is-danger:hover, .nsp-menu__item.is-danger:focus-visible { background: #fff0f0; color: #b91c1c; }
.nsp-menu__item.is-danger:hover .nsp-i { color: #b91c1c; }
.nsp-menu__sep { height: 1px; margin: 6px 7px; background: #e7eaf0; }
.nsp-menu__title { overflow: hidden; margin: 1px 3px 6px; padding: 7px 8px 9px; border-bottom: 1px solid #edf0f4; color: #718096; font-size: 11px; font-weight: 700; letter-spacing: .015em; text-overflow: ellipsis; white-space: nowrap; }
/* Keep the menu usable on short/mobile screens, and give touch users a proper
   long-press: suppress the native callout and grow tap targets. */
.nsp-menu { max-height: min(70vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.nsp-document, .nsp-folder-row { -webkit-touch-callout: none; }
@media (pointer: coarse) {
  .nsp-menu__item { padding: 12px 12px; }
  .nsp-document, .nsp-folder-row { -webkit-user-select: none; user-select: none; }
  .nsp-document__actions button[data-action="more"] { width: 40px !important; min-width: 40px !important; min-height: 40px !important; }
}
/* iOS Safari zooms into any focused control whose font-size is < 16px. Force 16px
   on touch devices OR narrow viewports so tapping a field never zooms — unscoped on
   purpose so it also covers dialogs appended at <body> level (rename/confirm
   prompts). portal.css only loads on the portal + login pages. */
@media (pointer: coarse), (max-width: 820px) {
  input, select, textarea { font-size: 16px !important; }
}

/* --- Bulk selection bar ------------------------------------------------- */
.nsp-bulkbar {
  position: fixed; z-index: 55; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 16px;
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-pill);
  background: var(--nsp-paper); box-shadow: 0 16px 40px rgba(24, 24, 27, .22);
}
.nsp-bulkbar[hidden] { display: none; }
.nsp-bulkbar__count { font-size: 13px; font-weight: 650; color: var(--nsp-ink); white-space: nowrap; }
.nsp-bulkbar .nsp-button { min-height: 34px; }
@media (max-width: 620px) { .nsp-bulkbar { left: 12px; right: 12px; transform: none; justify-content: space-between; border-radius: var(--nsp-r-md); } }

/* --- Two-factor (Security view) ----------------------------------------- */
.nsp-2fa { padding: 22px; }
.nsp-2fa__panel { max-width: 560px; }
.nsp-2fa__badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--nsp-r-pill); background: #f1f1f4; color: var(--nsp-ink-2); font-size: 13px; font-weight: 650; }
.nsp-2fa__badge .nsp-i { width: 17px; height: 17px; }
.nsp-2fa__badge--on { background: var(--nsp-green-soft); color: var(--nsp-green); }
.nsp-2fa__lead { margin: 16px 0 10px; color: var(--nsp-ink-2); font-size: 14px; line-height: 1.6; }
.nsp-2fa__lead strong { color: var(--nsp-ink); }
.nsp-2fa__hint { margin: 8px 0 0; color: var(--nsp-muted); font-size: 12.5px; }
.nsp-2fa__req { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 4px; padding: 12px 14px; border-radius: var(--nsp-r-sm); background: var(--nsp-accent-soft); color: var(--nsp-accent-dark); font-size: 13.5px; }
.nsp-2fa__req .nsp-i { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.nsp-2fa__secret { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nsp-2fa__secret code { flex: 1; min-width: 220px; padding: 12px 15px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-wash); font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .12em; color: var(--nsp-ink); }
.nsp-2fa__confirm { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.nsp-2fa__confirm input { height: 44px; width: 160px; padding: 0 14px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-paper); color: var(--nsp-ink); font-size: 16px; letter-spacing: .14em; }
.nsp-2fa__confirm input:focus { border-color: var(--nsp-accent); outline: none; }
.nsp-2fa__codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin: 14px 0 18px; padding: 16px; list-style: none; border: 1px dashed var(--nsp-line); border-radius: var(--nsp-r-md); background: var(--nsp-wash); }
.nsp-2fa__codes li { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .06em; color: var(--nsp-ink); }
@media (max-width: 520px) { .nsp-2fa__codes { grid-template-columns: 1fr; } }

/* --- Personal account settings ---------------------------------------- */
.nsp-settings-layout { display: grid; grid-template-columns: 250px minmax(0, 620px); gap: 28px; padding: 26px; align-items: start; }
.nsp-profile-card { display: flex; flex-direction: column; align-items: center; padding: 28px 20px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-md); background: linear-gradient(145deg, #f8fbff, #fff); text-align: center; }
.nsp-profile-card__avatar { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 14px; border-radius: 50%; background: #dcecff; color: var(--nsp-accent-dark); font-size: 24px; font-weight: 750; box-shadow: inset 0 0 0 5px #eff6ff; }
.nsp-profile-card strong { color: var(--nsp-ink); font-size: 16px; }
.nsp-profile-card > span:not(.nsp-profile-card__avatar) { max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--nsp-muted); font-size: 12px; text-overflow: ellipsis; }
.nsp-profile-card small { margin-top: 13px; padding: 4px 9px; border-radius: var(--nsp-r-pill); background: var(--nsp-green-soft); color: var(--nsp-green); font-weight: 650; }
.nsp-password-card { padding: 24px 26px 26px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-md); background: #fff; box-shadow: 0 8px 24px rgba(16,35,59,.06); }
.nsp-password-card__heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--nsp-line-2); }
.nsp-password-card__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: var(--nsp-green-soft); color: var(--nsp-green); font-weight: 800; }
.nsp-password-card h3 { margin: 0 0 4px; color: var(--nsp-ink); font-size: 16px; }
.nsp-password-card p { margin: 0; color: var(--nsp-muted); font-size: 12.5px; line-height: 1.5; }
.nsp-password-card > label { display: block; margin: 15px 0 7px; color: var(--nsp-ink-2); font-size: 12px; font-weight: 650; }
.nsp-password-card > input { width: 100%; height: 43px; padding: 0 13px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: #fff; color: var(--nsp-ink); font-size: 14px; }
.nsp-password-card > input:focus { border-color: var(--nsp-accent); box-shadow: var(--nsp-ring); outline: 0; }
.nsp-password-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin-top: 12px; }
.nsp-password-rules span { position: relative; padding-left: 18px; color: var(--nsp-muted); font-size: 11.5px; }
.nsp-password-rules span::before { content: '○'; position: absolute; left: 0; color: var(--nsp-subtle); }
.nsp-password-rules span.is-valid { color: var(--nsp-green); }
.nsp-password-rules span.is-valid::before { content: '✓'; color: var(--nsp-green); font-weight: 800; }
.nsp-field-hint { min-height: 18px; margin-top: 7px !important; font-size: 11.5px !important; }
.nsp-field-hint.is-valid { color: var(--nsp-green); }
.nsp-field-hint.is-error { color: var(--nsp-red); }
.nsp-password-card .nsp-dialog__actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--nsp-line-2); }

/* --- Two-factor authentication card ------------------------------------ */
.nsp-account-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.nsp-twofa-card { padding: 24px 26px 26px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-md); background: #fff; box-shadow: 0 8px 24px rgba(16,35,59,.06); }
.nsp-twofa-card .nsp-password-card__heading { align-items: center; margin-bottom: 20px; }
.nsp-twofa-card .nsp-password-card__heading > div { flex: 1; min-width: 0; }
.nsp-twofa-card h3 { margin: 0 0 4px; color: var(--nsp-ink); font-size: 16px; }
.nsp-twofa-card p { margin: 0; color: var(--nsp-muted); font-size: 12.5px; line-height: 1.5; }
.nsp-twofa-mark { background: var(--nsp-accent-soft); color: var(--nsp-accent); }
.nsp-twofa-mark .nsp-i { width: 20px; height: 20px; }
.nsp-badge--on { background: var(--nsp-green-soft); color: var(--nsp-green); }
.nsp-badge--off { background: #f1f1f4; color: var(--nsp-muted); }
.nsp-twofa-lead { color: var(--nsp-ink-2) !important; font-size: 13.5px !important; font-weight: 600; }
.nsp-twofa-sub { margin-top: 6px !important; }
.nsp-twofa-warn { margin: 0 0 14px; padding: 11px 14px; border: 1px solid #f0d9a8; border-left: 3px solid var(--nsp-amber); border-radius: var(--nsp-r-sm); background: var(--nsp-amber-soft); color: #8a5a00 !important; font-size: 13px !important; }
.nsp-twofa-note { align-self: center; color: var(--nsp-muted); font-size: 12px; }
.nsp-twofa-steps { margin: 0 0 16px; padding-left: 20px; color: var(--nsp-ink-2); font-size: 13px; line-height: 1.7; }
.nsp-twofa-secret { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border: 1px dashed var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-accent-softer); }
.nsp-twofa-secret code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--nsp-ink); font-size: 15px; font-weight: 650; letter-spacing: .06em; }
.nsp-twofa-link { display: inline-block; margin-bottom: 18px; color: var(--nsp-accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.nsp-twofa-link:hover { text-decoration: underline; }
.nsp-twofa-label { display: block; margin: 4px 0 7px; color: var(--nsp-ink-2); font-size: 12px; font-weight: 650; }
.nsp-twofa-verify { display: flex; gap: 10px; }
.nsp-twofa-verify input { flex: 1; min-width: 0; height: 43px; padding: 0 13px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: #fff; color: var(--nsp-ink); font-size: 16px; letter-spacing: .25em; }
.nsp-twofa-verify input:focus { border-color: var(--nsp-accent); box-shadow: var(--nsp-ring); outline: 0; }
.nsp-twofa-verify .nsp-button { flex: 0 0 auto; }
.nsp-twofa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.nsp-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 4px; }
.nsp-code-grid code { padding: 10px 12px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-accent-softer); color: var(--nsp-ink); font-size: 14px; font-weight: 650; letter-spacing: .08em; text-align: center; }

/* --- Storage-not-configured banner ------------------------------------- */
.nsp-storage-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid #f0d9a8; border-left: 3px solid var(--nsp-amber); border-radius: var(--nsp-r-sm); background: var(--nsp-amber-soft); color: #8a5a00; font-size: 13.5px; }
.nsp-storage-notice .nsp-i { width: 18px; height: 18px; flex: 0 0 auto; color: var(--nsp-amber); }
.nsp-upload-block { margin: 0 0 14px; padding: 12px 15px; border: 1px solid #f0d9a8; border-left: 3px solid var(--nsp-amber); border-radius: var(--nsp-r-sm); background: var(--nsp-amber-soft); color: #8a5a00; }
.nsp-upload-block strong { display: block; font-size: 13px; margin-bottom: 4px; }
.nsp-upload-block p { margin: 0; font-size: 12.5px; line-height: 1.5; }

/* --- Inline notices (login page) --------------------------------------- */
.nsp-notice { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; padding: 11px 14px; border: 1px solid #c7ebdd; border-left: 3px solid var(--nsp-green); border-radius: var(--nsp-r-sm); background: var(--nsp-green-soft); color: #067a54; font-size: 13px; }
.nsp-notice .nsp-i { width: 18px; height: 18px; flex: 0 0 auto; }
.nsp-notice--error { border-color: #f4cccc; border-left-color: var(--nsp-red); background: var(--nsp-red-soft); color: #b91c1c; }

/* --- Dialogs ------------------------------------------------------------ */
.nsp-dialog {
  width: min(600px, calc(100% - 32px));
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-lg);
  padding: 30px 32px 32px; color: var(--nsp-ink);
  box-shadow: var(--nsp-sh-pop);
}
.nsp-dialog--small { width: min(440px, calc(100% - 32px)); }
.nsp-dialog::backdrop { background: rgba(24, 24, 27, .45); backdrop-filter: blur(3px); }
.nsp-dialog h2 { margin: 0 0 6px; color: var(--nsp-ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.nsp-dialog > p, .nsp-dialog form > p { margin: 0 0 18px; color: var(--nsp-muted); font-size: 13px; }
.nsp-dialog label { display: block; margin: 16px 0 7px; color: var(--nsp-ink-2); font-size: 12px; font-weight: 600; }
.nsp-dialog input:not([type=file]) { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-paper); color: var(--nsp-ink); font-size: 14px; }
.nsp-dialog input:not([type=file]):focus { border-color: var(--nsp-accent); box-shadow: var(--nsp-ring); outline: 0; }
.nsp-dialog select {
  width: 100%; height: 42px; padding: 0 38px 0 13px;
  border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm);
  background-color: var(--nsp-paper); color: var(--nsp-ink); font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2366778b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 18px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.nsp-dialog select:hover { border-color: #bdcad8; background-color: #fbfdff; }
.nsp-dialog select:focus { border-color: var(--nsp-accent); box-shadow: var(--nsp-ring); outline: 0; }
.nsp-dialog textarea { width: 100%; padding: 10px 13px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-paper); color: var(--nsp-ink); font-size: 14px; font-family: inherit; resize: vertical; min-height: 74px; }
.nsp-dialog textarea:focus { border-color: var(--nsp-accent); outline: none; }
.nsp-dialog .nsp-select { margin-top: 0; }
.nsp-dialog__close { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--nsp-r-sm); background: var(--nsp-wash); color: var(--nsp-muted); cursor: pointer; transition: background .14s, color .14s; }
.nsp-dialog__close:hover { background: #efeff2; color: var(--nsp-ink); }
.nsp-dialog__close .nsp-i { width: 18px; height: 18px; }
.nsp-dialog__actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }

.nsp-dropzone { display: grid; place-items: center; gap: 3px; min-height: 190px; margin-top: 14px; padding: 30px 20px; border: 2px dashed #d4d4dc; border-radius: var(--nsp-r-md); background: var(--nsp-wash); cursor: pointer; transition: border-color .14s, background .14s; text-align: center; }
.nsp-dropzone:hover, .nsp-dropzone.is-over { border-color: var(--nsp-accent); background: var(--nsp-accent-softer); }
.nsp-dropzone__icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 6px; border-radius: 50%; background: var(--nsp-accent-soft); color: var(--nsp-accent); }
.nsp-dropzone__icon .nsp-i { width: 25px; height: 25px; }
.nsp-dropzone strong { font-size: 14px; color: var(--nsp-ink); }
.nsp-dropzone > span:not(.nsp-dropzone__icon) { color: var(--nsp-muted); font-size: 12px; }
.nsp-dropzone small { margin-top: 8px; color: var(--nsp-subtle); font-size: 11px; }
.nsp-dropzone__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 14px; }
.nsp-dropzone__actions .nsp-button { min-width: 122px; }

#nsp-upload-queue { display: grid; gap: 4px; margin-top: 6px; }
.nsp-recycle-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 8px; border: 1px solid var(--nsp-line-2); border-radius: 10px; background: var(--nsp-surface); }
.nsp-recycle-toolbar .nsp-select-all { margin-right: auto; }
.nsp-operation-progress { flex: 1 0 100%; display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 10px; align-items: center; color: var(--nsp-muted); font-size: 12px; }
.nsp-operation-progress progress { width: 100%; height: 8px; accent-color: var(--nsp-accent); }
.nsp-document--selectable.is-selected { background: #f2f7ff; }
.nsp-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--nsp-line-2); font-size: 12px; }
.nsp-upload-row:last-child { border-bottom: 0; }
.nsp-upload-row__name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nsp-upload-row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nsp-ink); font-weight: 600; }
.nsp-upload-row progress { width: 100%; height: 8px; border: 0; border-radius: var(--nsp-r-pill); overflow: hidden; background: #edecf2; -webkit-appearance: none; appearance: none; }
.nsp-upload-row progress::-webkit-progress-bar { background: #edecf2; border-radius: var(--nsp-r-pill); }
.nsp-upload-row progress::-webkit-progress-value { background: var(--nsp-accent); border-radius: var(--nsp-r-pill); }
.nsp-upload-row progress::-moz-progress-bar { background: var(--nsp-accent); border-radius: var(--nsp-r-pill); }
.nsp-upload-row small { display: block; text-align: right; color: var(--nsp-muted); }
.nsp-upload-row.is-complete small { color: var(--nsp-green); font-weight: 600; }
.nsp-upload-row.is-complete progress::-webkit-progress-value { background: var(--nsp-green); }
.nsp-upload-row.is-complete progress::-moz-progress-bar { background: var(--nsp-green); }
.nsp-upload-row.is-scanning small { color: #92400e; font-weight: 600; }
.nsp-upload-row.is-scanning progress::-webkit-progress-value { background: #d97706; }
.nsp-upload-row.is-scanning progress::-moz-progress-bar { background: #d97706; }
.nsp-upload-row.is-error small { color: var(--nsp-red); }
.nsp-upload-row.is-error progress::-webkit-progress-value { background: var(--nsp-red); }

.nsp-version { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--nsp-line-2); }
.nsp-version:last-child { border-bottom: 0; }
.nsp-version__meta { display: flex; flex-direction: column; gap: 3px; }
.nsp-version__meta strong { font-size: 13px; color: var(--nsp-ink); }
.nsp-version__meta small { color: var(--nsp-muted); font-size: 11.5px; }
#nsp-version-list { margin-top: 6px; }

.nsp-confirm { text-align: center; }
.nsp-confirm__icon { display: inline-grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; background: var(--nsp-red-soft); color: var(--nsp-red); }
.nsp-confirm__icon .nsp-i { width: 26px; height: 26px; }
.nsp-confirm h2 { margin-bottom: 8px; }
.nsp-confirm p { margin: 0 auto; max-width: 340px; color: var(--nsp-muted); font-size: 13px; }
.nsp-confirm .nsp-dialog__actions { justify-content: center; margin-top: 22px; }

/* --- Login -------------------------------------------------------------- */
.nsp-login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; background: var(--nsp-paper); }
.nsp-login__aside {
  display: flex; flex-direction: column;
  padding: 40px clamp(28px, 4vw, 60px);
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(99, 102, 241, .16), transparent 60%),
    linear-gradient(160deg, var(--nsp-accent-softer) 0%, #ffffff 70%);
  border-right: 1px solid var(--nsp-line);
  color: var(--nsp-ink);
}
.nsp-login__brand { display: flex; align-items: center; gap: 11px; color: var(--nsp-ink); font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.nsp-login__brand .nsp-brandmark { width: 48px; height: 42px; }
.nsp-login__pitch { margin: auto 0; max-width: 420px; }
.nsp-login__pitch h2 { margin: 0 0 26px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; line-height: 1.25; letter-spacing: -.025em; color: var(--nsp-ink); }
.nsp-login__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.nsp-login__points li { display: flex; align-items: center; gap: 12px; color: var(--nsp-ink-2); font-size: 14px; }
.nsp-login__points .nsp-i { width: 22px; height: 22px; color: var(--nsp-accent); flex: 0 0 auto; }
.nsp-login__foot { margin: 26px 0 0; color: var(--nsp-subtle); font-size: 12px; }

.nsp-login__card { display: flex; flex-direction: column; justify-content: center; max-width: 420px; width: 100%; margin: 0 auto; padding: 48px clamp(26px, 4vw, 52px); }
.nsp-login__lock { display: inline-grid; place-items: center; width: 50px; height: 50px; margin-bottom: 22px; border-radius: 14px; background: var(--nsp-accent-soft); color: var(--nsp-accent); }
.nsp-login__lock .nsp-i { width: 25px; height: 25px; }
.nsp-login h1 { margin: 0 0 8px; color: var(--nsp-ink); font-size: clamp(26px, 3vw, 32px); font-weight: 720; letter-spacing: -.025em; }
.nsp-login__lede { margin: 0 0 8px; color: var(--nsp-muted); font-size: 14px; line-height: 1.55; }
.nsp-login form { display: grid; gap: 6px; margin: 22px 0 14px; }
.nsp-login form > label:not(.nsp-check) { margin-top: 10px; color: var(--nsp-ink-2); font-size: 12px; font-weight: 600; }
.nsp-login input[type=text], .nsp-login input[type=password] { height: 44px; padding: 0 14px; border: 1px solid var(--nsp-line); border-radius: var(--nsp-r-sm); background: var(--nsp-paper); color: var(--nsp-ink); font-size: 14px; transition: border-color .14s, box-shadow .14s; }
.nsp-login input[type=text]:focus, .nsp-login input[type=password]:focus { border-color: var(--nsp-accent); }
.nsp-password { position: relative; }
.nsp-password input { width: 100%; padding-right: 46px !important; }
.nsp-password__toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--nsp-subtle); cursor: pointer; }
.nsp-password__toggle:hover { color: var(--nsp-ink); background: var(--nsp-wash); }
.nsp-password__toggle .nsp-i { width: 20px; height: 20px; }
.nsp-password__toggle .nsp-i:last-child { display: none; }
.nsp-password__toggle.is-visible .nsp-i:first-child { display: none; }
.nsp-password__toggle.is-visible .nsp-i:last-child { display: block; }
.nsp-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: var(--nsp-muted); font-size: 13px; }
.nsp-check input { width: 16px; height: 16px; accent-color: var(--nsp-accent); }
.nsp-login .nsp-button--primary { margin-top: 6px; }
.nsp-help-link { color: var(--nsp-accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.nsp-help-link:hover { text-decoration: underline; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .nsp-app__body { grid-template-columns: 1fr; }
  .nsp-sidebar { position: sticky; top: 76px; z-index: 20; height: auto; display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); gap: 14px; padding: 10px 18px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); box-shadow: 0 7px 20px rgba(8,29,50,.14); }
  .nsp-workspace-picker { padding: 0; margin: 0; border: 0; }
  .nsp-workspace-picker label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .nsp-workspace-trigger { height: 42px; }
  .nsp-navigation { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .nsp-navigation p, .nsp-sidebar__footer { display: none; }
  .nsp-nav { min-height: 42px; justify-content: center; padding: 0 9px; }
  .nsp-toolbar { grid-template-columns: 1fr 1fr; }
  .nsp-toolbar .nsp-search { grid-column: 1 / -1; }
  .nsp-main { padding: 26px 20px 44px; }
  .nsp-pagehead { margin-bottom: 18px; }
  .nsp-stats { margin-bottom: 18px; }
  .nsp-login { grid-template-columns: 1fr; }
  .nsp-login__aside { display: none; }
  .nsp-login__card { min-height: 100vh; }
}
@media (max-width: 760px) {
  .nsp-explorer__body { grid-template-columns: 1fr; }
  .nsp-explorer__folders { border-right: 0; border-bottom: 1px solid var(--nsp-line); padding: 12px; }
  .nsp-folder-tree { display: flex; gap: 7px; overflow-x: auto; padding: 0 1px 5px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .nsp-folder-tree::-webkit-scrollbar { display: none; }
  .nsp-folder-item { min-height: 38px; width: auto; flex: 0 0 auto; padding-left: 11px !important; padding-right: 13px; white-space: nowrap; border: 1px solid var(--nsp-line); background: var(--nsp-paper); scroll-snap-align: start; }
  .nsp-folder-item.is-active { border-color: transparent; }
  .nsp-breadcrumb { align-items: flex-start; flex-direction: column; padding: 10px 12px; }
  .nsp-breadcrumb__trail { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nsp-breadcrumb__trail::-webkit-scrollbar { display: none; }
  .nsp-breadcrumb__actions { width: 100%; overflow-x: auto; padding-bottom: 1px; scrollbar-width: none; }
  .nsp-breadcrumb__actions .nsp-button { flex: 0 0 auto; }
  .nsp-folder-row { grid-template-columns: 22px minmax(0, 1fr) auto 18px; gap: 9px; min-height: 54px; padding: 10px 13px; }
  .nsp-folder-row__meta { font-size: 10.5px; }
}
@media (max-width: 620px) {
	.nsp-preview-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
	.nsp-preview-dialog header { min-height: 76px; padding: 12px 14px; }
	.nsp-preview-dialog h2 { max-width: 52vw; font-size: 15px; }
	.nsp-preview-stage { height: calc(100% - 76px); }
	.nsp-preview-actions .nsp-button { padding: 0 10px; }
	.nsp-pager { align-items: stretch; flex-direction: column; }
	.nsp-pager > div { width: 100%; justify-content: center; }
	.nsp-pager button { min-width: 34px; height: 34px; }
  .nsp-topbar { height: 60px; padding: 0 12px; }
  .nsp-brandmark { width: 34px; height: 34px; }
  .nsp-brand__copy strong { font-size: 13px; }
  .nsp-brand__copy small { font-size: 10px; }
  .nsp-security, .nsp-account__name { display: none; }
  .nsp-topbar__tools { gap: 7px; }
  .nsp-account { gap: 5px; padding-left: 8px; }
  .nsp-avatar { width: 32px; height: 32px; }
  .nsp-signout { margin: 0; padding: 7px 6px; font-size: 11px; }
  .nsp-sidebar { top: 60px; grid-template-columns: 1fr; gap: 8px; padding: 9px 10px 10px; }
  .nsp-workspace-trigger { height: 39px; }
  .nsp-workspace-menu { position: fixed; top: 109px; left: 10px; right: 10px; width: auto; max-height: min(300px, 48vh); }
  .nsp-navigation { gap: 4px; }
  .nsp-nav { min-height: 40px; padding: 0 4px; gap: 5px; flex-direction: column; }
  .nsp-nav__icon, .nsp-nav__icon .nsp-i { width: 17px; height: 17px; }
  .nsp-main { padding: 20px 10px 34px; }
  .nsp-pagehead { flex-direction: row; align-items: flex-end; gap: 12px; }
  .nsp-pagehead h1 { font-size: 24px; }
  .nsp-pagehead__intro { display: none; }
  .nsp-pagehead .nsp-button { min-height: 38px; padding: 0 12px; white-space: nowrap; }
  .nsp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .nsp-stats article { min-height: 82px; padding: 12px; gap: 10px; }
  .nsp-stat-icon { width: 38px; height: 38px; }
  .nsp-stat-icon .nsp-i { width: 19px; height: 19px; }
  .nsp-stats article strong { font-size: 20px; }
  .nsp-stats article small { display: none; }
  .nsp-panel { border-radius: 10px; }
  .nsp-panel__heading { min-height: 66px; padding: 13px; }
  .nsp-panel__heading .nsp-button { min-height: 36px; padding: 0 10px; }
  .nsp-toolbar { grid-template-columns: 1fr; }
  .nsp-toolbar { gap: 8px; padding: 10px 12px; }
  .nsp-toolbar .nsp-filter { display: none; }
  .nsp-toolbar #nsp-search-button { width: 100%; }
  .nsp-list-head { display: none; }
  .nsp-commandbar { flex-wrap: wrap; padding: 8px 12px; gap: 7px; }
  .nsp-selection-summary { min-width: 0; flex: 1; }
  .nsp-sort { width: 100%; margin-left: 0; }
  .nsp-sort select { flex: 1; }
  .nsp-view-control { margin-left: auto; }
  .nsp-view-control > span { display: none; }
  .nsp-settings-layout { grid-template-columns: 1fr; padding: 16px; }
  .nsp-profile-card { display: none; }
  .nsp-password-card { padding: 20px 16px; }
  .nsp-password-rules { grid-template-columns: 1fr; }
  .nsp-document { padding: 11px 12px; gap: 9px; }
  .nsp-document--selectable { grid-template-columns: 22px 40px minmax(0, 1fr) 34px; }
  .nsp-file-icon { width: 40px; height: 42px; }
  .nsp-file-icon img { width: 38px; height: 38px; }
  .nsp-document__meta strong { font-size: 12.5px; }
  .nsp-document__meta span { display: block; overflow: hidden; color: var(--nsp-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
  .nsp-document__actions { grid-column: auto; padding: 0; }
  .nsp-document__actions button:not([data-action="more"]) { display: none; }
  .nsp-document__actions button[data-action="more"] { width: 34px; min-width: 34px; padding: 0; }
  .nsp-navigation .nsp-nav span:last-child { font-size: 10px; line-height: 1; }
  .nsp-empty { min-height: 260px; padding: 34px 15px; }
  .nsp-document-list[data-view="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .nsp-document-list[data-view="grid"] .nsp-document, .nsp-document-list[data-view="grid"] .nsp-folder-row { min-height: 138px; }
  .nsp-toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .nsp-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 24px 18px; overflow-y: auto; border-radius: 14px; }
  .nsp-menu { width: min(238px, calc(100vw - 16px)); }
}
@media (max-width: 390px) {
  .nsp-brand__copy { display: none; }
  .nsp-pagehead .nsp-button span { display: none; }
  .nsp-stats article { padding: 10px; }
  .nsp-stat-icon { display: none; }
  .nsp-select-all span { display: none; }
  .nsp-selection-summary { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .nsp-app *, .nsp-login * { animation: none !important; transition: none !important; }
}

/* Responsive workspace refinement. */
.nsp-app { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
.nsp-main, .nsp-explorer__main { min-width: 0; }
.nsp-pagehead > div, .nsp-panel__heading > div { min-width: 0; }
.nsp-pagehead h1 { line-height: 1.2; }
.nsp-panel__heading h2 { line-height: 1.35; }
.nsp-document__meta > span { display: block; margin-top: 4px; color: var(--nsp-muted); font-size: 12px; overflow-wrap: anywhere; }
.nsp-document:focus-visible, .nsp-folder-row:focus-visible { outline: 2px solid var(--nsp-accent); outline-offset: -3px; }
.nsp-commandbar { flex-wrap: wrap; row-gap: 10px; }
.nsp-commandbar select { max-width: 100%; }
.nsp-explorer__folders { min-width: 0; }
.nsp-folder-tree { max-width: 100%; }
.nsp-folder-item span, .nsp-folder-row__name { overflow: hidden; text-overflow: ellipsis; }
.nsp-breadcrumb__trail .nsp-crumb { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.nsp-panel__heading { gap: 16px; }
.nsp-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nsp-empty { grid-column: 1 / -1; }
.nsp-activity-card__body, .nsp-version > span { min-width: 0; overflow-wrap: anywhere; }
.nsp-upload-row > span { min-width: 0; overflow-wrap: anywhere; }
.nsp-upload-row progress { width: 100%; accent-color: var(--nsp-accent); }
.nsp-upload-row small { overflow-wrap: anywhere; }
.nsp-upload-cancel { border: 0; background: transparent; color: var(--nsp-muted); cursor: pointer; font-size: 11px; }
.nsp-upload-cancel:hover { color: var(--nsp-red); }
.nsp-upload-row.is-error { border-color: #efb8b8; background: #fff6f6; }
.nsp-upload-row.is-complete { border-color: #b9dfd1; background: #f3fbf7; }
.nsp-dropzone[aria-busy="true"] { cursor: progress; opacity: .7; }
.nsp-dialog [hidden] { display: none !important; }
.nsp-dialog :focus-visible, .nsp-preview-dialog :focus-visible { outline: 2px solid #0969da; outline-offset: 3px; }
.nsp-workspace-menu { overscroll-behavior: contain; scrollbar-width: thin; }
.nsp-workspace-menu button { white-space: normal; }
.nsp-workspace-menu button span { white-space: normal; overflow-wrap: anywhere; }
.nsp-preview-dialog[open] { display: flex; flex-direction: column; padding: 0; background: #eef2f7; }
.nsp-preview-dialog header { flex: 0 0 auto; }
.nsp-preview-stage, body.nsp-preview-tab .nsp-preview-stage { flex: 1 1 auto; height: auto; min-height: 0; min-width: 0; overscroll-behavior: contain; }
.nsp-preview-actions { flex-shrink: 0; }
.nsp-pager > div { flex-wrap: wrap; }
.nsp-preview-dialog h2 { max-width: 100%; }
.nsp-preview-stage[data-loading="true"] { cursor: progress; }
.nsp-sheet-tabs button { flex-shrink: 0; }
.nsp-pdf-toolbar button:disabled, .nsp-ppt-toolbar button:disabled { opacity: .4; cursor: default; }
.nsp-preview-fallback { margin: 20px auto; }
@media (min-width: 961px) {
  .nsp-main { padding: 28px clamp(24px, 2.6vw, 44px) 36px; }
  .nsp-explorer__folders { max-height: 65dvh; overflow-y: auto; overscroll-behavior: contain; }
  .nsp-sidebar { display: flex; flex-direction: column; }
  .nsp-navigation { overflow-y: auto; min-height: 0; }
}
@media (min-width: 621px) and (max-width: 1200px) {
  .nsp-document__actions button[data-action="replace"],
  .nsp-document__actions button[data-action="versions"] { display: none; }
  .nsp-explorer__body { grid-template-columns: 180px minmax(0, 1fr); }
  .nsp-commandbar .nsp-sort { margin-left: 0; }
}
@media (max-width: 960px) {
  .nsp-sidebar { grid-template-columns: 1fr; gap: 8px; }
  .nsp-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nsp-workspace-menu { z-index: 100; }
  .nsp-nav { min-width: 0; }
  .nsp-settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nsp-explorer__body { grid-template-columns: minmax(0, 1fr); }
  .nsp-folder-item { max-width: 240px; }
  .nsp-profile-card { display: none; }
  .nsp-pdf-toolbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; padding: 8px; }
  .nsp-pdf-toolbar > span { display: none; }
  .nsp-pdf-pages { padding: 12px; }
  .nsp-ppt-preview { padding: 0 8px 12px; }
  .nsp-ppt-toolbar { width: 100%; margin: 0 !important; grid-template-columns: 1fr auto; gap: 8px; padding: 8px; }
  .nsp-ppt-toolbar > small { display: none; }
  .nsp-word-preview { width: calc(100% - 20px); margin: 10px; padding: 22px 18px; }
  .nsp-sheet-content { padding: 8px; }
}
@media (max-width: 620px) {
  .nsp-app { min-height: 100dvh; }
  .nsp-main { padding: 18px 12px calc(24px + env(safe-area-inset-bottom)); }
  .nsp-sidebar { padding-inline: 12px; }
  .nsp-workspace-menu { position: absolute; inset: calc(100% + 6px) 0 auto; max-height: min(320px, 45dvh); }
  .nsp-pagehead { align-items: center; }
  .nsp-pagehead .nsp-eyebrow { font-size: 10px; letter-spacing: .08em; }
  .nsp-pagehead h1 { font-size: 23px; }
  .nsp-panel__heading { flex-wrap: wrap; padding: 14px; }
  .nsp-stats article { min-width: 0; }
  .nsp-stats article > div > span { font-size: 11px; }
  .nsp-breadcrumb__trail .nsp-crumb { max-width: 200px; }
  .nsp-document--selectable { grid-template-columns: 24px 36px minmax(0, 1fr) 44px; gap: 8px; padding: 12px 10px; }
  .nsp-document__meta strong { font-size: 13px; }
  .nsp-document__meta > span { font-size: 11px; }
  .nsp-document__actions button[data-action="more"] { width: 44px; min-width: 44px; min-height: 44px; }
  .nsp-document-list[data-view="grid"] .nsp-document__actions { position: static; }
  .nsp-document-list[data-view="grid"] .nsp-document { padding-bottom: 8px; }
  .nsp-commandbar .nsp-sort { width: 100%; min-width: 0; }
  .nsp-commandbar .nsp-sort select { min-width: 0; width: 100%; }
  .nsp-page-size { gap: 6px; }
  .nsp-selection-summary { font-size: 12px; }
  .nsp-select-all span { display: inline; }
  .nsp-activity-card { flex-wrap: wrap; gap: 10px; }
  .nsp-activity-card time { margin-left: 0; font-size: 11px; }
  .nsp-version { flex-wrap: wrap; gap: 12px; }
  .nsp-preview-dialog { height: 100dvh; }
  .nsp-preview-dialog header { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .nsp-preview-file-info { flex: 1 1 100%; }
  .nsp-preview-actions { margin-left: auto; }
  .nsp-preview-dialog h2 { font-size: 15px; }
  .nsp-preview-fallback { padding: 24px 18px; }
  .nsp-text-preview { padding: 16px; font-size: 13px; }
  .nsp-upload-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .nsp-dialog input:not([type=checkbox]):not([type=file]), .nsp-dialog select,
  .nsp-app input[type=search], .nsp-password-card input, .nsp-login input { font-size: 16px; }
}
@media (pointer: coarse) {
  .nsp-button, .nsp-nav, .nsp-workspace-trigger, .nsp-workspace-menu button,
  .nsp-menu__item, .nsp-pager button, .nsp-view-control button,
  .nsp-pdf-toolbar button, .nsp-ppt-toolbar button, .nsp-preview-close { min-height: 44px; }
  .nsp-pager button, .nsp-view-control button, .nsp-pdf-toolbar button,
  .nsp-ppt-toolbar button { min-width: 44px; }
  .nsp-check-cell { min-height: 44px; display: grid; place-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .nsp-menu, .nsp-dialog *, .nsp-preview-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
