/* Shared base/theme lives in shared-theme.css */

.viewport {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.phone-shell {
  width: 100%;
  flex: 1;
  background: transparent;
  padding: 32px 40px 40px;
  animation: rise-up 0.55s ease both;
}

@keyframes rise-up {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.status-head {
  margin-bottom: 28px;
}

.status-head h1 {
  margin: 6px 0 4px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.mini-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-wrap {
  margin-top: 0;
  max-width: 520px;
}

.search-wrap label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(10, 17, 27, 0.74);
  color: var(--text);
  padding: 13px 16px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 201, 166, 0.18);
}

.apps-meta {
  margin-top: 18px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
}

.apps-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.app-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  padding: 22px 18px 18px;
  background: linear-gradient(145deg, rgba(10, 22, 36, 0.88), rgba(24, 40, 58, 0.88));
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  opacity: 0;
  animation: card-in 0.35s ease forwards;
  cursor: pointer;
}

.app-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: rgba(23, 201, 166, 0.65);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(23, 201, 166, 0.15);
}

.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: linear-gradient(155deg, #276c78, #1d3847);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.app-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.app-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.badge {
  align-self: start;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #07231f;
  background: linear-gradient(90deg, var(--accent), #5adbbf);
  padding: 3px 10px;
  letter-spacing: 0.04em;
}

.empty-state {
  margin-top: 26px;
  color: var(--danger);
  text-align: center;
  font-size: 0.92rem;
}

.hidden {
  display: none !important;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ─────────────────────────────────────────── */

/* tablet */
@media (max-width: 1100px) {
  .apps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* landscape phone / small tablet */
@media (max-width: 780px) {
  .phone-shell {
    padding: 24px 20px 28px;
  }

  .apps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .status-head h1 {
    font-size: 1.9rem;
  }
}

/* portrait phone */
@media (max-width: 480px) {
  .phone-shell {
    padding: 18px 14px 22px;
  }

  .apps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .app-card {
    min-height: 150px;
    padding: 16px 14px 14px;
  }

  .app-icon {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .app-title {
    font-size: 0.9rem;
  }

  .status-head h1 {
    font-size: 1.55rem;
  }
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 0;
  padding: 5px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-md);
  width: fit-content;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.tab.active {
  background: linear-gradient(135deg, #1a3a4a, #243650);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tab-panel {
  margin-top: 18px;
}

.docs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.drive-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.drive-btn:hover {
  background: rgba(23, 201, 166, 0.12);
  border-color: rgba(23, 201, 166, 0.5);
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 16px 0 0;
  font-size: 0.84rem;
}

.crumb {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.18s;
}

.crumb:hover {
  background: rgba(23, 201, 166, 0.12);
}

.crumb-root {
  color: var(--muted);
}

.crumb-sep {
  color: var(--line);
  font-size: 0.78rem;
  user-select: none;
}

/* ── Docs meta ────────────────────────────────────────────── */
.docs-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Docs sections ────────────────────────────────────────── */
.docs-content {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.docs-section-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}

/* ── Folders grid ─────────────────────────────────────────── */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.folder-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(10, 22, 36, 0.8), rgba(24, 40, 58, 0.8));
  transition: transform 0.2s, border-color 0.2s;
  opacity: 0;
  animation: card-in 0.3s ease forwards;
  cursor: pointer;
}

.folder-card:hover {
  transform: translateY(-3px);
  border-color: rgba(243, 162, 58, 0.55);
}

.folder-card .item-icon {
  font-size: 1.45rem;
  line-height: 1;
  flex-shrink: 0;
}

.folder-main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
}

.folder-card .item-name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  text-align: left;
  max-width: 100%;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.folder-card .file-actions {
  margin-top: auto;
  justify-content: flex-end;
  width: 100%;
  gap: 8px;
}

.folder-card .file-btn,
.folder-card a.file-btn {
  width: 32px;
  height: 32px;
}

/* ── Files list ───────────────────────────────────────────── */
.files-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(10, 18, 28, 0.65);
  transition: border-color 0.2s, background 0.2s;
  opacity: 0;
  animation: card-in 0.3s ease forwards;
  cursor: pointer;
}

.file-row:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(18, 32, 48, 0.8);
}

.file-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.file-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-pdf          { background: #7f1d1d; color: #fca5a5; }
.type-image        { background: #134e4a; color: #5eead4; }
.type-video        { background: #312e81; color: #a5b4fc; }
.type-audio        { background: #3b0764; color: #d8b4fe; }
.type-word         { background: #1e3a8a; color: #93c5fd; }
.type-excel        { background: #14532d; color: #86efac; }
.type-presentation { background: #7c2d12; color: #fdba74; }
.type-text         { background: #1c1917; color: #d6d3d1; }
.type-archive      { background: #422006; color: #fcd34d; }
.type-file         { background: #1f2937; color: #9ca3af; }

.file-size,
.file-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.file-owner {
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
}

.docs-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.docs-sort select {
  background: rgba(10, 17, 27, 0.8);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 0.82rem;
  outline: none;
}
.docs-sort select:focus { border-color: var(--accent); }
.docs-sort #docsSortDir { padding: 5px 10px; min-width: 34px; }

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.file-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.file-actions .file-btn,
.file-actions a.file-btn {
  cursor: pointer;
}

.file-btn:hover {
  background: rgba(23, 201, 166, 0.14);
  color: var(--accent);
  border-color: rgba(23, 201, 166, 0.5);
}

.file-btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.6);
}

/* ── Viewer modal ─────────────────────────────────────────── */
.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.viewer-shell {
  width: min(1100px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #0c1826;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  gap: 12px;
}

.viewer-title {
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  color: var(--text);
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.viewer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.viewer-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.viewer-close {
  padding: 6px 10px;
  font-size: 0.95rem;
}

.viewer-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080f18;
  min-height: 0;
}

.viewer-body iframe {
  width: 100%;
  height: 78vh;
  border: none;
}

.viewer-body img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.viewer-body video,
.viewer-body audio {
  max-width: 100%;
  outline: none;
}

.viewer-body audio {
  margin: 32px;
}

.text-content {
  width: 100%;
  max-height: 78vh;
  padding: 24px 28px;
  margin: 0;
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #d4d4d4;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
}

/* Rendered Markdown view (.md files) */
.md-rendered {
  width: 100%;
  max-height: 78vh;
  overflow: auto;
  padding: 24px 32px;
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--text);
  box-sizing: border-box;
}
.md-rendered h1, .md-rendered h2, .md-rendered h3,
.md-rendered h4, .md-rendered h5, .md-rendered h6 {
  color: #fff; font-weight: 700; line-height: 1.25; margin: 20px 0 10px;
}
.md-rendered h1 { font-size: 1.55rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.md-rendered h2 { font-size: 1.3rem; color: var(--accent); margin-top: 26px; }
.md-rendered h3 { font-size: 1.1rem; }
.md-rendered h1:first-child, .md-rendered h2:first-child { margin-top: 0; }
.md-rendered p { margin: 10px 0; }
.md-rendered ul, .md-rendered ol { margin: 10px 0; padding-left: 26px; }
.md-rendered li { margin: 5px 0; }
.md-rendered strong { color: #fff; font-weight: 700; }
.md-rendered a { color: var(--accent); }
.md-rendered del { opacity: 0.6; }
.md-rendered hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.md-rendered blockquote {
  margin: 12px 0; padding: 6px 16px; border-left: 3px solid var(--accent);
  background: rgba(23, 201, 166, 0.06); color: var(--muted); border-radius: 0 8px 8px 0;
}
.md-rendered code {
  font-family: "Cascadia Code", "Consolas", monospace; font-size: 0.86em;
  background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 5px;
}
.md-rendered pre.md-code {
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; margin: 12px 0;
  font-family: "Cascadia Code", "Consolas", monospace; font-size: 0.84rem; line-height: 1.5;
}
.md-rendered pre.md-code code { background: none; padding: 0; }
.md-rendered table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 0.88rem; display: block; overflow-x: auto; }
.md-rendered th, .md-rendered td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.md-rendered th { background: rgba(255, 255, 255, 0.06); color: #fff; }
.md-rendered tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.md-rendered .md-mathblock {
  font-family: "Cambria Math", Georgia, serif; font-size: 1.06em; text-align: center;
  margin: 12px 0; padding: 8px; background: rgba(255,255,255,0.03); border-radius: 8px; overflow-x: auto;
}
.md-rendered .md-math { font-family: "Cambria Math", Georgia, serif; }

.text-editor {
  width: 100%;
  height: 78vh;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #d4d4d4;
  padding: 24px 28px;
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.65;
}

.text-loading,
.viewer-error {
  padding: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.generic-preview {
  width: min(560px, 100%);
  margin: 32px auto;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(18, 29, 44, 0.75);
  text-align: center;
  color: var(--text);
}

.generic-preview-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.generic-preview h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  word-break: break-word;
}

.generic-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.generic-preview-meta {
  margin: 12px 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.generic-preview-hint {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .phone-shell {
    padding: 14px 12px 20px;
  }

  .status-head {
    margin-bottom: 16px;
  }

  .status-head h1 {
    font-size: 1.42rem;
    line-height: 1.2;
  }

  .subtitle {
    font-size: 0.84rem;
  }

  .tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .tab {
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.86rem;
  }

  .docs-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .drive-btn {
    width: 100%;
    min-height: 40px;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 700;
  }

  .search-wrap {
    max-width: 100%;
  }

  .apps-meta,
  .docs-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .folders-grid {
    grid-template-columns: 1fr;
  }

  .folder-main {
    align-items: flex-start;
    text-align: left;
    padding: 6px 4px;
    gap: 8px;
  }

  .folder-card .item-name {
    max-width: 100%;
    text-align: left;
  }

  .file-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .file-icon {
    display: none;
  }

  .file-name {
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
  }

  .file-meta-row {
    gap: 6px;
  }

  .file-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 8px;
    width: 100%;
  }

  .folder-card .file-actions {
    grid-template-columns: repeat(2, minmax(44px, 1fr));
    justify-content: stretch;
  }

  .file-btn {
    width: 100%;
    height: 36px;
    border-radius: 10px;
    font-size: 0.95rem;
  }

  .viewer-shell {
    border-radius: var(--radius-md);
    max-height: 95vh;
    width: 100%;
  }

  .viewer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .viewer-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
  }

  .viewer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .viewer-btn {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
  }

  .viewer-close {
    font-size: 0.9rem;
  }

  .viewer-body iframe {
    height: 72vh;
  }

  .viewer-body {
    align-items: flex-start;
  }

  .text-content,
  .text-editor {
    padding: 14px;
    font-size: 0.8rem;
    height: 70vh;
    max-height: 70vh;
  }

  .viewer-body audio,
  .viewer-body video {
    width: 100%;
  }

  .folders-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .tab {
    font-size: 0.8rem;
    padding: 9px 6px;
  }

  .mini-label {
    font-size: 0.74rem;
  }

  .status-head h1 {
    font-size: 1.28rem;
  }

  .viewer-actions {
    grid-template-columns: 1fr;
  }
}

/* ── PROGRESS OVERLAY ─────────────────────────── */
.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.progress-overlay.hidden {
  display: none;
}

.progress-modal {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.progress-label {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 0.2s ease;
  width: 0%;
}

.progress-pct {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ── FOLDER SELECTOR ──────────────────────────── */
.folder-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.folder-selector-overlay.hidden {
  display: none;
}

.folder-selector-modal {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 90%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.folder-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.folder-selector-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.folder-selector-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.folder-selector-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.folder-selector-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
}

.folder-selector-crumb {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.folder-selector-crumb:hover {
  background: rgba(23, 201, 166, 0.15);
}

.folder-selector-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.folder-selector-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: none;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 6px;
  transition: background 0.2s ease;
}

.folder-selector-item:hover {
  background: rgba(23, 201, 166, 0.2);
}

.folder-selector-item-current {
  background: rgba(23, 201, 166, 0.15);
  border: 1px solid rgba(23, 201, 166, 0.3);
  font-weight: 500;
}

.folder-selector-item-current:hover {
  background: rgba(23, 201, 166, 0.25);
  border-color: rgba(23, 201, 166, 0.5);
}

.folder-selector-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.folder-selector-item-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-selector-empty,
.folder-selector-error {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.folder-selector-error {
  color: #ef4444;
}

.folder-selector-footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.folder-selector-footer button {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.folder-selector-footer .btn-ghost {
  background: var(--surface);
  color: var(--text);
}

.folder-selector-footer .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.folder-selector-footer .btn-primary {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.folder-selector-footer .btn-primary:hover {
  background: #16b399;
  box-shadow: 0 4px 12px rgba(23, 201, 166, 0.3);
}

/* ── CHECKBOXES & SELECTION ───────────────────────── */
.item-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.folder-card.selected {
  border-color: rgba(23, 201, 166, 0.65);
  background: linear-gradient(145deg, rgba(23, 201, 166, 0.08), rgba(23, 201, 166, 0.04));
}

.file-row.selected {
  border-color: rgba(23, 201, 166, 0.55);
  background: rgba(23, 201, 166, 0.07);
}

.select-all-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
  user-select: none;
}

.select-all-wrap:hover {
  color: var(--text);
}

/* ── BULK BAR ─────────────────────────────────────── */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #0b1a28;
  border: 1px solid rgba(23, 201, 166, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  z-index: 9990;
  animation: fade-in 0.18s ease;
  white-space: nowrap;
}

.bulk-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.bulk-btns {
  display: flex;
  gap: 6px;
}

/* Indicador de preparación de la descarga múltiple (FR-013/013a). Se muestra al
   pulsar Descargar y se retira cuando llega la cookie testigo, no tras un
   temporizador ciego. Reutiliza los tokens de color de la barra masiva. */
.download-status {
  font-size: 0.8rem;
  color: var(--muted, #93a1b3);
  white-space: nowrap;
  animation: fade-in 0.18s ease;
}

.drive-btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

.drive-btn-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.drive-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.65);
  color: #fca5a5;
}

.load-more-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  text-align: center;
  font-size: 0.85rem;
}

/* ── LOGIN BUTTON ─────────────────────────────────── */
.status-head {
  position: relative;
}

.login-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.login-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.login-btn.is-admin {
  border-color: rgba(23, 201, 166, 0.5);
  color: var(--accent);
}

.login-btn.is-guest {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

/* ── LOGIN MODAL ──────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 0.18s ease;
}

.login-modal {
  position: relative;
  background: #0c1826;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 32px 28px 28px;
  width: min(360px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.login-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.login-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.login-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.login-sub {
  margin: 0 0 18px;
  font-size: 0.84rem;
  color: var(--muted);
}

.login-switch {
  margin: 12px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}
.login-switch a {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}
.login-switch a:hover { text-decoration: underline; }

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.login-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(10, 17, 27, 0.8);
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-fields input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 201, 166, 0.18);
}

.login-remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.login-remember-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s, box-shadow 0.18s, border-color 0.18s, color 0.18s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #061a16;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #14b38a;
  box-shadow: 0 4px 14px rgba(23, 201, 166, 0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.login-error {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.84rem;
  text-align: center;
}

.login-session-label {
  font-size: 0.92rem;
  color: var(--text);
  margin: 0 0 16px;
  text-align: center;
}

/* ── SECRET INDICATORS ────────────────────────────── */
.folder-card.is-secret  { border-color: rgba(239, 68, 68, 0.35); }
.file-row.is-secret     { border-color: rgba(239, 68, 68, 0.3); }
.file-card.is-secret    { border-color: rgba(239, 68, 68, 0.4); }

.folder-card.is-secret:hover { border-color: rgba(239, 68, 68, 0.65); }
.file-row.is-secret:hover    { border-color: rgba(239, 68, 68, 0.55); }

.secret-badge {
  font-size: 0.72rem;
  margin-left: 4px;
  opacity: 0.75;
}

/* Tarjeta que abre en pestaña nueva (p. ej. el acceso directo a My Teams) */
.external-badge {
  font-size: 0.72rem;
  margin-left: 4px;
  opacity: 0.75;
}

/* App card lock button (admin only) */
.app-lock-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10, 18, 28, 0.75);
  border: 1px solid var(--line);
  border-radius: 7px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 2;
}

.app-card { position: relative; }

.app-card:hover .app-lock-btn,
.app-card.app-secret .app-lock-btn { opacity: 1; }

.app-card.app-secret {
  border-color: rgba(239, 68, 68, 0.4);
}

/* ── VIEW SELECTOR ────────────────────────────────── */
.view-selector {
  display: flex;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  align-self: center;
}

.view-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--line);
  padding: 7px 10px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.view-btn:last-child { border-right: none; }

.view-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.view-btn.active {
  background: rgba(23, 201, 166, 0.15);
  color: var(--accent);
}

/* ── FILES GRID ───────────────────────────────────── */
.files-grid {
  display: grid;
  gap: 8px;
}

.docs-content[data-view="small"]  .files-grid { grid-template-columns: repeat(auto-fill, minmax(92px,  1fr)); gap: 6px;  }
.docs-content[data-view="medium"] .files-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 10px; }
.docs-content[data-view="large"]  .files-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

/* ── FILE CARD (grid modes) ───────────────────────── */
.file-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(10, 18, 28, 0.75);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: card-in 0.28s ease forwards;
  opacity: 0;
}

.file-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

.file-card.selected {
  border-color: rgba(23, 201, 166, 0.6);
  background: rgba(23, 201, 166, 0.06);
}

/* Preview area */
.file-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-card-preview img,
.file-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-type-icon {
  font-size: 2rem;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.docs-content[data-view="small"] .card-type-icon  { font-size: 1.4rem; }
.docs-content[data-view="large"]  .card-type-icon { font-size: 2.8rem; }

/* Colored preview backgrounds per type */
.preview-bg-pdf          { background: rgba(127, 29,  29,  0.45); }
.preview-bg-word         { background: rgba(30,  58,  138, 0.45); }
.preview-bg-excel        { background: rgba(20,  83,  45,  0.45); }
.preview-bg-presentation { background: rgba(124, 45,  18,  0.45); }
.preview-bg-text         { background: rgba(28,  25,  23,  0.65); }
.preview-bg-audio        { background: rgba(59,  7,   100, 0.45); }
.preview-bg-archive      { background: rgba(66,  32,  6,   0.45); }
.preview-bg-file         { background: rgba(31,  41,  55,  0.55); }
.preview-bg-video        { background: rgba(8,   10,  22,  0.85); }
.preview-bg-model        { background: rgba(13,  20,  32,  0.9); }
.preview-bg-presentation { background: rgba(124, 45,  18,  0.45); }

/* PDF / PPTX page-1 thumbnail (server-rendered) */
.file-card-preview .doc-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; background: #fff;
}
.doc-thumb-row {
  width: 32px; height: 32px; object-fit: cover; object-position: top;
  border-radius: 4px; background: #fff; display: block;
}

/* 3D model thumbnail (rendered in-browser, layered over the icon) */
.file-card-preview .model-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.model-thumb-row {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(13, 20, 32, 0.9);
  display: block;
}

/* Video play overlay */
.card-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  transition: opacity 0.18s;
  pointer-events: none;
}

/* Card footer */
.file-card-footer {
  padding: 6px 8px 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(0, 0, 0, 0.15);
}

.file-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.3;
}

.docs-content[data-view="medium"] .file-card-name,
.docs-content[data-view="large"]  .file-card-name { font-size: 0.78rem; }

/* Checkbox on grid cards — hidden until hover/selected */
.file-card .item-checkbox {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.15s;
}

.file-card:hover .item-checkbox,
.file-card.selected .item-checkbox { opacity: 1; }

/* Actions overlay on grid cards */
.file-card .file-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 24px 6px 6px;
  width: auto;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.file-card:hover .file-actions,
.file-card.selected .file-actions {
  opacity: 1;
  pointer-events: auto;
}

.file-card .file-btn {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  background: rgba(8, 15, 25, 0.88);
  border-color: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

/* ── VIEW TRANSITION ──────────────────────────────── */
.view-transitioning {
  opacity: 0 !important;
  transform: scale(0.97) !important;
  transition: opacity 0.13s ease, transform 0.13s ease !important;
}

/* ── MOBILE ADJUSTMENTS ───────────────────────────── */
@media (max-width: 640px) {
  .view-selector {
    margin-left: 0;
    width: 100%;
  }

  .view-btn { flex: 1; padding: 9px 6px; }

  .docs-content[data-view="small"]  .files-grid { grid-template-columns: repeat(auto-fill, minmax(78px,  1fr)); gap: 5px;  }
  .docs-content[data-view="medium"] .files-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px;  }
  .docs-content[data-view="large"]  .files-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
}

@media (max-width: 640px) {
  .bulk-bar {
    bottom: 12px;
    left: 12px;
    right: 12px;
    transform: none;
    flex-wrap: wrap;
    gap: 8px;
  }

  .bulk-btns {
    flex: 1;
    justify-content: flex-end;
  }
}

/* ── Presentation slide viewer ───────────────────────────── */
.slides-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; height: 100%; min-height: 300px; color: var(--muted); text-align: center; padding: 20px;
}
.slides-spinner {
  width: 40px; height: 40px; border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent, #17c9a6); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slides-viewer { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 10px; }
.slides-stage {
  position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: #0b1018; border-radius: 10px; overflow: hidden;
}
.slide-img {
  max-width: 100%; max-height: 100%; object-fit: contain; cursor: pointer;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5); border-radius: 4px;
}
.slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 1.8rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.slide-nav:hover { background: rgba(23, 201, 166, 0.8); }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }

.slides-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-shrink: 0; }
.slide-counter { color: var(--text, #e8eef6); font-size: 0.92rem; min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
.slide-btn {
  border: 1px solid var(--line, #2a3441); background: rgba(255, 255, 255, 0.04); color: var(--muted, #93a1b3);
  border-radius: 8px; padding: 5px 11px; font-size: 0.95rem; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.slide-btn:hover { background: rgba(23, 201, 166, 0.14); color: var(--accent, #17c9a6); }

.slides-thumbs {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; flex-shrink: 0;
  scrollbar-width: thin;
}
.slide-thumb {
  height: 56px; width: auto; border-radius: 5px; cursor: pointer; flex-shrink: 0;
  border: 2px solid transparent; background: #0b1018; opacity: 0.6; transition: opacity 0.15s, border-color 0.15s;
}
.slide-thumb:hover { opacity: 1; }
.slide-thumb.active { opacity: 1; border-color: var(--accent, #17c9a6); }

/* Fullscreen: fill the screen with a dark backdrop */
.slides-viewer:fullscreen { background: #05080d; padding: 18px; }
.slides-viewer:fullscreen .slides-stage { background: #05080d; }

/* ── Content search results ──────────────────────────────── */
.docs-search-status { color: var(--muted, #93a1b3); font-size: 0.86rem; padding: 14px; text-align: center; }
.content-search-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; margin-bottom: 8px; font-size: 0.86rem; color: var(--muted, #93a1b3);
  border-bottom: 1px solid var(--line, #2a3441);
}
.content-search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.content-search-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: 10px;
  cursor: pointer; border: 1px solid var(--line, #2a3441); background: rgba(255, 255, 255, 0.02);
}
.content-search-item:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--accent, #17c9a6); }
.csi-icon { font-size: 1.2rem; }
.csi-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.csi-name { color: var(--text, #e8eef6); font-size: 0.9rem; }
.csi-snippet { color: var(--muted, #93a1b3); font-size: 0.8rem; line-height: 1.35; }
.csi-path { color: rgba(147, 161, 179, 0.65); font-size: 0.72rem; }
.content-search-actions { display: flex; gap: 6px; }
.docs-answer {
  margin: 8px 0 12px; border: 1px solid rgba(23, 201, 166, 0.35); background: rgba(23, 201, 166, 0.06);
  border-radius: 12px; padding: 12px 14px;
}
.docs-answer-head { font-size: 0.82rem; color: var(--accent, #17c9a6); font-weight: 700; margin-bottom: 6px; }
.docs-answer-body { font-size: 0.9rem; color: var(--text, #e8eef6); line-height: 1.5; }
.docs-answer-src { margin-top: 8px; font-size: 0.76rem; color: var(--muted, #93a1b3); }
.docs-answer-src code { background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 4px; }

/* ── Background-job toasts ───────────────────────────────── */
.toast-host {
  position: fixed; right: 16px; bottom: 16px; z-index: 4000;
  display: flex; flex-direction: column; gap: 10px; max-width: min(92vw, 340px);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border-radius: 12px; background: rgba(17, 24, 36, 0.97); border: 1px solid var(--line, #2a3441);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); color: var(--text, #e8eef6);
  animation: toast-in 0.3s ease; border-left: 3px solid var(--accent, #17c9a6);
}
.toast-error { border-left-color: #ef4444; }
.toast-icon { font-size: 1.25rem; line-height: 1.2; }
.toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.toast-body strong { font-size: 0.9rem; }
.toast-detail { font-size: 0.78rem; color: var(--muted, #93a1b3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-x { background: none; border: none; color: var(--muted, #93a1b3); cursor: pointer; font-size: 0.85rem; padding: 0 2px; }
.toast-x:hover { color: var(--text, #e8eef6); }
.toast-out { opacity: 0; transform: translateX(20px); transition: opacity 0.4s, transform 0.4s; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ── Admin: user management panel ─────────────────────────── */
.admin-users { margin-top: 18px; border-top: 1px solid var(--line, #2a3441); padding-top: 14px; text-align: left; }
.admin-users.hidden { display: none; }
.admin-users-title { margin: 0 0 10px; font-size: 0.95rem; }
.admin-users-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.admin-user-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--line, #2a3441); border-radius: 8px; background: rgba(255, 255, 255, 0.03);
}
.au-nick { flex: 1; font-size: 0.88rem; color: var(--text, #e8eef6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-nick em { color: var(--muted, #93a1b3); font-style: normal; font-size: 0.78rem; }
.au-role {
  font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; text-transform: uppercase;
}
.au-role.role-admin { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.au-role.role-user  { background: rgba(255, 255, 255, 0.08); color: var(--muted, #93a1b3); }
.au-actions { display: flex; gap: 5px; }
.au-actions .mini-btn {
  border: 1px solid var(--line, #2a3441); background: rgba(255, 255, 255, 0.04); color: var(--muted, #93a1b3);
  border-radius: 7px; padding: 4px 8px; font-size: 0.74rem; cursor: pointer;
}
.au-actions .mini-btn:hover { color: var(--text, #e8eef6); border-color: var(--accent, #17c9a6); }
.au-actions .mini-btn.danger:hover { color: #ef4444; border-color: #ef4444; }
.au-actions .mini-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.admin-users-msg { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted, #93a1b3); min-height: 16px; }
