:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-active: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #eef2f6;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-border: rgba(79, 70, 229, 0.25);
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.28);
  --pub-bg: rgba(16, 185, 129, 0.1);
  --pub-text: #047857;
  --pub-border: rgba(16, 185, 129, 0.3);
  --share-bg: rgba(59, 130, 246, 0.1);
  --share-text: #1d4ed8;
  --share-border: rgba(59, 130, 246, 0.3);
  --edit-bg: rgba(168, 85, 247, 0.1);
  --edit-text: #7e22ce;
  --edit-border: rgba(168, 85, 247, 0.3);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11;
    --bg-subtle: #11141a;
    --surface: #141820;
    --surface-hover: #1a1f2a;
    --surface-active: #202634;
    --border: #232936;
    --border-subtle: #1c212c;
    --border-strong: #323b4d;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.14);
    --accent-border: rgba(99, 102, 241, 0.35);
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --danger-border: rgba(239, 68, 68, 0.35);
    --pub-bg: rgba(16, 185, 129, 0.14);
    --pub-text: #34d399;
    --pub-border: rgba(16, 185, 129, 0.35);
    --share-bg: rgba(59, 130, 246, 0.14);
    --share-text: #60a5fa;
    --share-border: rgba(59, 130, 246, 0.35);
    --edit-bg: rgba(168, 85, 247, 0.14);
    --edit-text: #c084fc;
    --edit-border: rgba(168, 85, 247, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
  color: inherit;
}

/* Impersonation Banner */
.imp-banner {
  background: #4f46e5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 20px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 40;
}

.imp-banner.active {
  display: flex;
}

.imp-banner-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.imp-banner-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Top Navbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.brand-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}

.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Search Box */
.search-wrap {
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-kbd {
  position: absolute;
  right: 10px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
  line-height: 1.3;
}

.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd {
  display: none;
}

/* User Menu */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.user-chip {
  position: relative;
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.user-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  color: var(--text-muted);
  display: flex;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 50;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.dropdown-email {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.dropdown-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: var(--danger-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* Main Workspace */
.workspace {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 34px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.crumb:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.crumb.current {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.crumb-sep {
  color: var(--text-muted);
  opacity: 0.55;
  display: inline-flex;
  align-items: center;
  padding: 0 1px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* File Browser Card / Table */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 100px 52px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.panel-head .col-size,
.panel-head .col-date {
  text-align: right;
}

.rows {
  divide-y: 1px solid var(--border-subtle);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s;
  position: relative;
}

.row:last-child {
  border-bottom: 0;
}

.row:hover {
  background: var(--surface-hover);
}

/* Real anchor link spans Name + Modified + Size so Click = same tab, Ctrl+Click = new tab */
.row-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 100px;
  align-items: center;
  padding: 10px 0 10px 16px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.row-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.row-cell-date,
.row-cell-size {
  text-align: right;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-cell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

/* File & Folder Icon Tiles */
.fi {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.fi svg {
  width: 18px;
  height: 18px;
}

.fi-folder {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.2);
}

.fi-up {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border);
}

.fi-img {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.2);
}

.fi-pdf {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.fi-code {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.fi-text {
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.2);
}

.fi-media {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.2);
}

.fi-zip {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.2);
}

.fi-file {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border);
}

/* Row Name + Non-clipping Badges */
.row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.row-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.row-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row.is-dir .row-name {
  font-weight: 600;
}

.row-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Badges — flex-shrink:0 and outside overflow:hidden so they NEVER clip */
.row-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.badge-public {
  background: var(--pub-bg);
  color: var(--pub-text);
  border: 1px solid var(--pub-border);
}

.badge-shared {
  background: var(--share-bg);
  color: var(--share-text);
  border: 1px solid var(--share-border);
}

.badge-editor {
  background: var(--edit-bg);
  color: var(--edit-text);
  border: 1px solid var(--edit-border);
}

/* Kebab button */
.kebab-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.kebab-btn:hover,
.kebab-btn.active {
  background: var(--surface-active);
  color: var(--text);
}

/* Inline Editor / Confirm Rows */
.row-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border-subtle);
}

.row-inline.confirm-danger {
  background: var(--danger-soft);
}

.inline-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.inline-label {
  flex: 1;
  font-size: 13.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Floating Context Menu */
#ctxmenu {
  position: fixed;
  min-width: 188px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  display: none;
  z-index: 80;
}

#ctxmenu.open {
  display: block;
}

.ctx-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.ctx-item svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ctx-item:hover {
  background: var(--surface-hover);
}

.ctx-item:hover svg {
  color: var(--text);
}

.ctx-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.ctx-item.danger {
  color: var(--danger);
}

.ctx-item.danger svg {
  color: var(--danger);
}

.ctx-item.danger:hover {
  background: var(--danger-soft);
}

/* Empty State */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Share Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 90;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-top: 2px;
  word-break: break-all;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-copy-row {
  display: flex;
  gap: 8px;
}

.link-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  outline: none;
}

.public-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.public-toggle-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-toggle-title {
  font-size: 13.5px;
  font-weight: 600;
}

.public-toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: 0.18s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.18s;
}

.toggle input:checked + .toggle-slider {
  background: #10b981;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.share-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.share-add-row {
  display: flex;
  gap: 8px;
}

.share-email-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.share-email-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.role-select {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.role-select.sm {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.people-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  divide-y: 1px solid var(--border-subtle);
}

.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.person-row:last-child {
  border-bottom: 0;
}

.person-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.person-email {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.modal-footer {
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

/* Drag and Drop Overlay */
.dropzone-overlay {
  position: fixed;
  inset: 16px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}

.dropzone-overlay.active {
  display: flex;
}

/* Landing Page (/) */
.hero-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 20px 64px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 48px 40px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 14px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .btn {
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.feature-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 6px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Users Page (/users) */
.users-head-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 210px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.user-table-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 210px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.user-table-row:last-child {
  border-bottom: 0;
}

.user-table-row:hover {
  background: var(--surface-hover);
}

.grant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
}

.grant-chip-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text);
}

.grant-chip-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.grant-chip-role.editor {
  color: var(--edit-text);
}

@media (max-width: 680px) {
  .users-head-grid,
  .user-table-row {
    grid-template-columns: 1fr;
  }
  .panel-head {
    grid-template-columns: minmax(0, 1fr) 84px 44px;
  }
  .row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .row-link {
    grid-template-columns: minmax(0, 1fr) 84px;
  }
  .panel-head .col-date,
  .row-cell-date {
    display: none;
  }
  .hero-card {
    padding: 32px 20px;
  }
}
