@font-face {
  font-family:'IBM Plex Sans';
  font-style:normal;
  font-weight:100 700;
  font-display:swap;
  src:url(/fonts/ibm-plex-sans-latin.woff2) format('woff2');
}

@font-face {
  font-family:'IBM Plex Sans';
  font-style:italic;
  font-weight:400;
  font-display:swap;
  src:url(/fonts/ibm-plex-sans-italic-latin.woff2) format('woff2');
}

html {
  font-size:15px;
  position:relative;
  min-height:100%;
}

body {
  margin:0;
  background:var(--canvas);
  color:var(--ink);
  font-family:var(--font-sans);
}

/* ---- Phase 1B shell: sidebar, top bar, drawer (tokens in tokens.css) ---- */
.icon {
  width:20px;
  height:20px;
  flex:none;
  display:block;
  fill:currentColor;
}

.app-shell {
  display:flex;
  min-height:100vh;
}

.app-sidebar {
  width:16rem;
  flex:0 0 16rem;
  background:#fff;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  padding:20px 12px 16px;
}

.sidebar-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding-bottom:22px;
}

.brand {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  min-width:0;
  min-height:40px;
  padding:0 8px;
  color:var(--ink);
  text-decoration:none;
}

.brand-logo {
  display:block;
  width:152px;
  max-width:100%;
  height:auto;
}

/* Aligned under the "Architekten" wordmark: the ST box is ~27% of the logo width. */
.brand-product {
  margin-left:calc(152px * .275);
  color:var(--muted);
  font-size:.75rem;
  font-weight:500;
  letter-spacing:.14em;
  text-transform:uppercase;
  line-height:1;
}

.sidebar-nav {
  display:flex;
  flex-direction:column;
  gap:22px;
}

.nav-group {
  display:flex;
  flex-direction:column;
  gap:2px;
}

.sidebar-label {
  margin:0;
  padding:0 12px 6px;
  color:var(--muted);
  font-size:.867rem;
  font-weight:500;
  line-height:1.3;
}

.nav-row {
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  min-height:var(--tap);
  padding:6px 12px;
  border:0;
  border-radius:var(--r-btn);
  background:none;
  color:var(--nav-ink);
  font-family:inherit;
  font-size:1rem;
  line-height:1.3;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
  transition:background-color .15s ease-out,color .15s ease-out;
}

.nav-row > span {
  min-width:0;
  overflow-wrap:anywhere;
}

.nav-row:hover {
  background:var(--nav-hover);
  color:var(--ink);
}

.nav-row[aria-current="page"] {
  background:var(--accent-soft);
  color:var(--accent);
  font-weight:600;
}

.sidebar-account {
  margin-top:auto;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.account-id {
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 12px 10px;
}

.account-avatar {
  display:grid;
  place-items:center;
  flex:none;
  background:var(--accent-soft);
  color:var(--accent);
  border-radius:50%;
  width:32px;
  height:32px;
  font-size:.933rem;
  font-weight:600;
}

.account-copy {
  display:flex;
  flex-direction:column;
  min-width:0;
  flex:1;
  line-height:1.35;
}

.account-copy strong {
  font-size:.933rem;
  font-weight:500;
  overflow-wrap:anywhere;
}

.account-copy small {
  color:var(--muted);
  font-size:.867rem;
}

.icon-button {
  display:grid;
  place-items:center;
  flex:none;
  width:var(--tap);
  height:var(--tap);
  border:0;
  border-radius:var(--r-btn);
  background:none;
  color:var(--nav-ink);
  text-decoration:none;
  cursor:pointer;
  transition:background-color .15s ease-out,color .15s ease-out;
}

.icon-button:hover {
  background:var(--nav-hover);
  color:var(--accent);
}

.menu-btn,.drawer-close {
  display:none;
}

.app-main {
  flex:1;
  min-width:0;
}

.topbar {
  position:sticky;
  top:0;
  z-index:1020;
  height:56px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 var(--pad);
}

.topbar-actions {
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
}

.lang-group {
  display:flex;
  gap:2px;
  padding:1px;
  border:1px solid var(--line);
  border-radius:var(--r-btn);
}

.lang-group a {
  display:grid;
  place-items:center;
  min-width:calc(var(--tap) - 4px);
  height:calc(var(--tap) - 4px);
  border-radius:calc(var(--r-btn) - 2px);
  color:var(--muted);
  font-size:.867rem;
  font-weight:600;
  letter-spacing:.03em;
  text-decoration:none;
  transition:background-color .15s ease-out,color .15s ease-out;
}

.lang-group a:hover {
  background:var(--nav-hover);
  color:var(--accent);
}

.lang-group a[aria-current="true"] {
  background:var(--accent-soft);
  color:var(--accent);
}

.nav-scrim {
  position:fixed;
  inset:0;
  z-index:1040;
  background:rgba(36,50,56,.45);
}

.page-header {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:24px;
}

.page-header-copy {
  min-width:0;
}

.page-title {
  margin:0;
  font-weight:500;
  font-size:clamp(1.6rem,1.15rem + 1vw,2.1rem);
  line-height:1.2;
  letter-spacing:-.01em;
  overflow-wrap:anywhere;
  text-wrap:balance;
}

.page-description {
  margin:6px 0 0;
  max-width:70ch;
  color:var(--muted);
  font-size:1rem;
  line-height:1.5;
}

.page-header-actions {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.workspace {
  max-width:1360px;
  margin:0 auto;
  padding:clamp(20px,2.6vw,36px) var(--pad) 48px;
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:1rem;
  margin-bottom:1.25rem;
}

.page-heading h1 {
  font-size:1.8rem;
  font-weight:600;
  letter-spacing:-.02em;
  margin:.25rem 0 .3rem;
}

.muted {
  color:var(--muted);
}

.eyebrow {
  color:var(--accent);
  font-size:.68rem;
  font-weight:600;
  letter-spacing:.14em;
}

.workspace-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin:1rem 0 1.1rem;
}

.search-box {
  display:flex;
  align-items:center;
  gap:.45rem;
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
  padding:0 .7rem;
  color:var(--muted);
  min-width:260px;
}

.search-box input {
  border:0;
  outline:0;
  padding:.55rem 0;
  width:100%;
  background:transparent;
}

.result-count {
  color:var(--muted);
  font-size:.78rem;
}

.project-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:.85rem;
}

.project-card {
  display:flex;
  gap:1rem;
  padding:1.05rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  color:var(--ink);
  text-decoration:none;
  min-height:106px;
}

.project-card:hover {
  border-color:var(--accent);
  box-shadow:0 4px 14px #183f3b0d;
  color:var(--ink);
}

.project-card-copy {
  min-width:0;
}

.project-card h2 {
  font-size:1rem;
  margin:0;
}

.project-card p {
  color:var(--muted);
  margin:.35rem 0;
  font-size:.82rem;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.project-link {
  color:var(--accent);
  font-size:.75rem;
  font-weight:600;
}

.back-link {
  color:var(--accent);
  font-size:.78rem;
  text-decoration:none;
}

.project-heading {
  align-items:flex-start;
}

.access-badge {
  background:var(--accent-soft);
  color:var(--accent);
  border-radius:20px;
  padding:.35rem .7rem;
  font-size:.72rem;
  font-weight:600;
}

.breadcrumbs {
  display:flex;
  gap:.5rem;
  align-items:center;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:.8rem;
  margin:1.2rem 0;
}

.breadcrumbs a {
  color:var(--accent);
  text-decoration:none;
}

.file-toolbar {
  margin-top:0;
}

.file-toolbar {
  flex-wrap:wrap;
  gap:.75rem 1.25rem;
}

.toolbar-actions,.file-filters {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.5rem;
}

.file-filters {
  margin-left:auto;
  padding-left:1.25rem;
  border-left:1px solid var(--line);
}

.file-filters .search-box {
  min-width:200px;
  height:40px;
  flex:1 1 200px;
}

.file-filters .search-box .icon {
  width:16px;
  height:16px;
}

.file-filters .form-select,.file-filters .btn {
  height:40px;
  width:auto;
  min-width:0;
  padding-top:0;
  padding-bottom:0;
  font-size:.875rem;
}

.file-filters .form-select {
  padding-right:2rem;
  text-overflow:clip;
}

.tb-btn {
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  height:40px;
  padding:0 .95rem;
  font-size:.875rem;
  font-weight:500;
  white-space:nowrap;
}

.tb-btn .icon {
  width:16px;
  height:16px;
}

.tb-btn.btn-outline-secondary {
  background:var(--surface);
  border-color:var(--line);
  color:var(--ink);
}

.tb-btn.btn-outline-secondary:hover {
  background:var(--accent-soft);
  border-color:var(--accent);
  color:var(--accent);
}

.file-list,.admin-panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  overflow:visible;
}

.file-table-head,.file-row {
  display:grid;
  grid-template-columns:minmax(250px,1fr) 100px 110px 170px 42px;
  align-items:center;
  gap:1rem;
  padding:.68rem 1rem;
}

.file-table-head {
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:.64rem;
  font-weight:600;
  background:#fbfcfc;
  border-bottom:1px solid var(--line);
}

.file-row {
  min-height:49px;
  border-bottom:1px solid var(--line);
  font-size:.84rem;
}

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

.file-name {
  display:flex;
  align-items:center;
  gap:.65rem;
  min-width:0;
}

.file-name a,.file-name>span:last-child {
  color:var(--ink);
  font-weight:500;
  overflow-wrap:anywhere;
}

.file-name a {
  color:var(--accent);
  text-decoration:none;
}

.file-icon {
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:6px;
  background:#edf1f0;
  color:var(--muted);
  font-size:.75rem;
  flex-shrink:0;
}

.file-icon.folder {
  background:#f8edcf;
  color:#9b751d;
}

.file-type,.file-meta {
  color:var(--muted);
  font-size:.76rem;
}

.file-actions {
  position:relative;
  text-align:right;
}

.file-actions summary {
  cursor:pointer;
  list-style:none;
  color:var(--muted);
  letter-spacing:.08em;
}

.file-actions summary::-webkit-details-marker {
  display:none;
}

.action-menu {
  position:absolute;
  right:0;
  top:1.5rem;
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
  box-shadow:0 8px 24px #183f3b18;
  padding:.3rem;
  z-index:3;
  min-width:145px;
}

.action-menu a,.action-menu button {
  display:block;
  width:100%;
  border:0;
  background:none;
  text-align:left;
  padding:.45rem .55rem;
  color:var(--ink);
  font-size:.78rem;
  text-decoration:none;
  border-radius:4px;
}

.action-menu a:hover,.action-menu button:hover {
  background:var(--canvas);
}

.action-menu .danger {
  color:var(--danger);
}

.action-menu input {
  width:calc(100% - 1.1rem);
  margin:.3rem .55rem;
  padding:.3rem;
  border:1px solid var(--line);
  border-radius:4px;
  font-size:.75rem;
}

.empty-state {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.35rem;
  margin-top:1rem;
  padding:2.2rem;
  text-align:center;
  color:var(--muted);
  background:#fbfcfc;
  border:1px dashed var(--line);
  border-radius:9px;
}

.empty-state strong {
  color:var(--ink);
}

.compact-dialog {
  border:1px solid var(--line);
  border-radius:10px;
  padding:1.4rem;
  width:min(420px,calc(100% - 2rem));
  box-shadow:0 14px 50px #183f3b22;
}

.compact-dialog::backdrop {
  background:#182b2b55;
}

.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:.5rem;
  margin-top:1.2rem;
}

.admin-panel {
  padding:1.2rem;
}

.admin-panel h2 {
  font-size:1rem;
  margin:0 0 1rem;
}

.table {
  margin-bottom:0;
}

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

.alert {
  border-radius:7px;
}

.footer {
  display:none;
}

@media(max-width:899.98px) {
  :root {
    --tap:44px;
  }
  .menu-btn,.drawer-close {
    display:grid;
  }
  .app-sidebar {
    position:fixed;
    z-index:1041;
    top:0;
    bottom:0;
    left:0;
    width:min(20rem,calc(100vw - 56px));
    flex:none;
    overflow-y:auto;
    padding:16px 12px;
    border-right:0;
    border-radius:0 var(--r-pop) var(--r-pop) 0;
    box-shadow:var(--shadow-pop);
    transform:translateX(-102%);
    visibility:hidden;
    transition:transform .16s ease-out,visibility 0s linear .16s;
  }
  body.nav-open {
    overflow:hidden;
  }
  body.nav-open .app-sidebar {
    transform:none;
    visibility:visible;
    transition:transform .16s ease-out,visibility 0s;
  }
  .nav-row {
    font-size:1.067rem;
  }
  .sidebar-label {
    font-size:.933rem;
  }
}

@media(max-width:800px) {
  .file-table-head {
    display:none;
  }
  .file-row {
    grid-template-columns:minmax(0,1fr) 80px 36px;
    gap:.5rem;
  }
  .file-type {
    display:none;
  }
  .file-meta {
    display:none;
  }
  .file-filters {
    width:100%;
    margin-left:0;
    padding-left:0;
    border-left:0;
  }
  .file-filters .search-box {
    flex:1;
    min-width:0;
  }
  .workspace-toolbar {
    align-items:stretch;
    flex-direction:column;
  }
  .page-heading {
    align-items:flex-start;
  }
  .project-heading {
    flex-direction:column;
  }
}

.project-heading-actions {
  display:flex;
  align-items:center;
  gap:.8rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.permission-legend {
  list-style:none;
  padding:0;
  margin:0 0 1rem;
  display:flex;
  flex-direction:column;
  gap:.25rem;
}

.permission-legend li {
  line-height:1.4;
}

.role-hint {
  margin:.35rem 0 0;
  font-size:.8125rem;
}

.new-user-form {
  display:flex;
  flex-wrap:wrap;
  gap:1rem 1.25rem;
  align-items:flex-end;
}

.new-user-form .form-field {
  display:flex;
  flex-direction:column;
  gap:.35rem;
  flex:1 1 200px;
  min-width:180px;
}

.new-user-form label {
  font-size:.78rem;
  font-weight:600;
  color:var(--ink);
}

.new-user-submit {
  flex:0 0 auto;
}

.new-user-submit button {
  white-space:nowrap;
}

.new-user-hint {
  flex-basis:100%;
  margin:.15rem 0 0;
}

.status-badge {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.3rem .65rem;
  border-radius:20px;
  font-size:.72rem;
  font-weight:600;
  text-decoration:none;
}

.status-badge::before {
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  flex-shrink:0;
}

.status-badge.is-active {
  background:var(--accent-soft);
  color:var(--accent);
}

.status-badge.is-active::before {
  background:#3f9c68;
}

.status-badge.is-paused {
  background:#f2efe9;
  color:#8a7f6b;
}

.status-badge.is-paused::before {
  background:#b8ab8f;
}

.users-table th,.users-table td {
  padding:.85rem 1rem;
}

.users-table tbody tr {
  transition:background .12s ease;
}

.users-table tbody tr:hover {
  background:#fbfcfc;
}

.users-table td {
  vertical-align:middle;
}

.user-row-actions {
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.role-form {
  display:flex;
  align-items:center;
  gap:.35rem;
}

.role-form .form-select {
  width:auto;
  min-width:148px;
}

.btn-role-save {
  border:1px solid var(--line);
  background:#fff;
  color:var(--accent);
  width:31px;
  height:31px;
  border-radius:6px;
  font-size:.85rem;
  line-height:1;
  cursor:pointer;
  flex-shrink:0;
}

.btn-role-save:hover {
  border-color:var(--accent);
  background:var(--accent-soft);
}

.overflow-menu {
  position:relative;
}

.overflow-menu summary {
  cursor:pointer;
  list-style:none;
  color:var(--muted);
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:6px;
  font-size:1rem;
  flex-shrink:0;
}

.overflow-menu summary::-webkit-details-marker {
  display:none;
}

.overflow-menu summary:hover {
  background:var(--canvas);
}

.overflow-menu .action-menu {
  min-width:230px;
}

.overflow-reset-form {
  padding:.3rem .1rem .55rem;
  border-bottom:1px solid var(--line);
  margin-bottom:.3rem;
  display:flex;
  flex-direction:column;
  gap:.4rem;
}

.overflow-reset-form input {
  width:100%;
  margin:0;
  padding:.4rem .5rem;
  border:1px solid var(--line);
  border-radius:4px;
  font-size:.78rem;
}

.overflow-reset-form button {
  border:1px solid var(--line);
  border-radius:4px;
  padding:.35rem .5rem;
  background:#fff;
  font-size:.75rem;
  text-align:center;
}

.delete-user-identity {
  display:flex;
  flex-direction:column;
  gap:.15rem;
  margin:.75rem 0;
}

.delete-user-identity strong {
  font-size:.95rem;
}

.delete-user-identity span {
  font-size:.8rem;
}

@media(max-width:900px) {
  .user-row-actions {
    justify-content:flex-start;
  }
  .role-form .form-select {
    min-width:120px;
  }
}

.users-table-scroll {
  overflow-x:visible;
  overflow-y:visible;
}

.pagination-bar {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:1rem;
  padding:1rem 0 .2rem;
  border-top:1px solid var(--line);
  margin-top:1rem;
}

.pagination-status {
  color:var(--muted);
  font-size:.8rem;
}

.pagination-bar a.disabled {
  pointer-events:none;
  opacity:.4;
}

.upload-drop-overlay {
  position:fixed;
  inset:0;
  z-index:50;
  display:grid;
  place-items:center;
  background:#182b2bcc;
  backdrop-filter:blur(1px);
}

.upload-drop-overlay-inner {
  border:2px dashed var(--accent);
  border-radius:14px;
  background:var(--surface);
  padding:3rem 3.5rem;
  text-align:center;
  box-shadow:0 20px 60px #10201f4d;
  max-width:min(90vw,420px);
}

.upload-drop-icon {
  font-size:1.8rem;
  color:var(--accent);
  margin-bottom:.6rem;
}

.upload-drop-title {
  font-size:1.05rem;
  font-weight:600;
  margin:0 0 .3rem;
  color:var(--ink);
}

.upload-drop-subtitle {
  margin:0;
  color:var(--muted);
  font-size:.82rem;
}

.upload-queue-panel {
  position:fixed;
  right:1.4rem;
  bottom:1.4rem;
  width:min(360px,calc(100vw - 2rem));
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:11px;
  box-shadow:0 16px 46px #10201f2e;
  z-index:40;
  overflow:hidden;
}

.upload-queue-header {
  width:100%;
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.75rem .9rem;
  background:none;
  border:0;
  cursor:pointer;
  text-align:left;
  font:inherit;
  color:var(--ink);
}

#uploadQueueHeaderText {
  font-weight:600;
  font-size:.85rem;
  flex-shrink:0;
}

.upload-queue-overall {
  color:var(--muted);
  font-size:.76rem;
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

.upload-queue-chevron {
  color:var(--muted);
  transition:transform .15s ease;
}

.upload-queue-header[aria-expanded="false"] .upload-queue-chevron {
  transform:rotate(180deg);
}

.upload-queue-body {
  border-top:1px solid var(--line);
}

/* Upload destination, shown in the drop overlay and while the queue runs. */
.upload-queue-dest,
.upload-drop-dest {
  display:flex;
  align-items:center;
  gap:.35rem;
  margin:0;
  font-size:.76rem;
  color:var(--muted);
  min-width:0;
}

.upload-queue-dest {
  padding:.55rem .9rem 0;
}

.upload-drop-dest {
  justify-content:center;
  margin-top:.7rem;
  font-size:.82rem;
}

.upload-queue-dest .icon,
.upload-drop-dest .icon {
  width:16px;
  height:16px;
  flex-shrink:0;
  fill:var(--accent);
}

.upload-queue-dest strong,
.upload-drop-dest strong {
  color:var(--ink);
  font-weight:600;
  overflow-wrap:anywhere;
}

.upload-queue-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:.5rem .9rem;
  gap:.6rem;
}

.upload-queue-link {
  border:0;
  background:none;
  color:var(--accent);
  font-size:.74rem;
  font-weight:600;
  padding:.2rem 0;
  cursor:pointer;
}

.upload-queue-list {
  list-style:none;
  margin:0;
  padding:0;
  max-height:300px;
  overflow-y:auto;
}

.upload-queue-item {
  padding:.6rem .9rem;
  border-top:1px solid var(--line);
  display:flex;
  align-items:flex-start;
  gap:.6rem;
}

.upload-queue-item:first-child {
  border-top:0;
}

.upload-item-main {
  min-width:0;
  flex:1;
}

.upload-item-name {
  font-size:.8rem;
  font-weight:500;
  color:var(--ink);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.upload-item-path {
  color:var(--muted);
  font-weight:400;
}

.upload-item-meta {
  font-size:.7rem;
  color:var(--muted);
  margin-top:.1rem;
}

.upload-item-bar {
  height:4px;
  border-radius:2px;
  background:var(--canvas);
  margin-top:.4rem;
  overflow:hidden;
}

.upload-item-bar-fill {
  height:100%;
  background:var(--accent);
  border-radius:2px;
  transition:width .2s ease;
}

.upload-queue-item.status-failed .upload-item-status,.upload-queue-item.status-failed .upload-item-meta {
  color:var(--danger);
}

.upload-queue-item.status-failed .upload-item-bar-fill {
  background:var(--danger);
}

.upload-queue-item.status-conflict .upload-item-status {
  color:#9b751d;
}

.upload-queue-item.status-conflict .upload-item-bar-fill {
  background:#9b751d;
}

.upload-queue-item.status-versionConflict .upload-item-status {
  color:#9b751d;
}

.upload-queue-item.status-versionConflict .upload-item-bar-fill {
  background:#9b751d;
}

.upload-queue-item.status-skipped {
  opacity:.55;
}

.upload-queue-item.status-complete .upload-item-bar-fill {
  background:#3f9c68;
}

.upload-item-actions {
  display:flex;
  flex-direction:column;
  gap:.3rem;
  flex-shrink:0;
}

.upload-item-btn {
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  border-radius:5px;
  font-size:.68rem;
  padding:.25rem .5rem;
  cursor:pointer;
  white-space:nowrap;
}

.upload-item-btn:hover {
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-soft);
}

@media(max-width:800px) {
  .upload-queue-panel {
    right:.6rem;
    left:.6rem;
    bottom:.6rem;
    width:auto;
  }
  .upload-drop-overlay-inner {
    padding:2rem 1.6rem;
  }
}

.drop-hint {
  display:flex;
  align-items:center;
  gap:.5rem;
  font-size:.8rem;
  color:var(--muted);
  margin:0 0 .9rem;
  padding:0;
}

.drop-hint .icon {
  width:14px;
  height:14px;
  color:var(--accent);
}

.search-trigger {
  display:flex;
  align-items:center;
  gap:10px;
  height:var(--tap);
  background:var(--canvas);
  border:1px solid var(--line);
  border-radius:var(--r-btn);
  padding:0 12px;
  color:var(--muted);
  font-size:.933rem;
  cursor:pointer;
  min-width:0;
  max-width:560px;
  flex:1;
}

.search-trigger:hover {
  border-color:var(--accent);
  color:var(--ink);
}

.search-trigger-icon {
  display:flex;
  flex-shrink:0;
}

.search-trigger-label {
  flex:1;
  text-align:left;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.search-trigger-kbd {
  font-size:.867rem;
  font-weight:500;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:6px;
  padding:1px 8px;
  background:#fff;
  flex-shrink:0;
}

.search-palette {
  border:none;
  border-radius:12px;
  padding:0;
  width:min(640px,92vw);
  max-height:min(560px,80vh);
  box-shadow:0 18px 48px rgba(20,30,32,.22);
  background:var(--surface);
  color:var(--ink);
}

.search-palette::backdrop {
  background:rgba(20,30,32,.4);
}

.search-palette-inner {
  display:flex;
  flex-direction:column;
  max-height:min(560px,80vh);
}

.search-palette-input-row {
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.9rem 1rem;
  border-bottom:1px solid var(--line);
  flex-shrink:0;
}

.search-palette-icon {
  display:flex;
  color:var(--muted);
  flex-shrink:0;
}

.search-palette-input {
  flex:1;
  border:none;
  outline:none;
  font-size:16px;
  font-family:inherit;
  color:var(--ink);
  background:transparent;
  min-width:0;
}

.search-palette-close {
  flex-shrink:0;
}

.search-palette-body {
  overflow-y:auto;
  padding:.5rem 0;
}

.search-palette-hint {
  margin:0;
  padding:1.4rem 1rem;
  color:var(--muted);
  font-size:.85rem;
  text-align:center;
}

.search-group {
  padding:.35rem 0;
}

.search-group-label {
  padding:.3rem 1rem;
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
}

.search-result-item {
  display:flex;
  align-items:center;
  gap:.65rem;
  padding:.5rem 1rem;
  text-decoration:none;
  color:var(--ink);
}

.search-result-item:hover,.search-result-item:focus-visible {
  background:var(--accent-soft);
}

.search-result-icon {
  color:var(--accent);
  font-size:1rem;
  flex-shrink:0;
  width:1.1rem;
  text-align:center;
}

.search-result-copy {
  display:flex;
  flex-direction:column;
  gap:.1rem;
  min-width:0;
}

.search-result-name {
  font-size:.88rem;
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.search-result-context {
  font-size:.74rem;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.search-palette-footer {
  border-top:1px solid var(--line);
  padding:.55rem 1rem;
  flex-shrink:0;
}

.search-palette-viewall {
  font-size:.8rem;
  color:var(--accent);
  text-decoration:none;
  font-weight:600;
}

.search-palette-viewall:hover {
  text-decoration:underline;
}

.search-page-filters {
  display:flex;
  gap:.5rem;
  margin:.2rem 0 1.1rem;
  flex-wrap:wrap;
}

.search-page-filters a {
  padding:.35rem .8rem;
  border-radius:20px;
  font-size:.8rem;
  color:var(--muted);
  text-decoration:none;
  border:1px solid var(--line);
}

.search-page-filters a.active {
  background:var(--accent-soft);
  color:var(--accent);
  border-color:var(--accent-soft);
}

.search-results-group {
  margin-bottom:1.6rem;
}

.search-results-group h2 {
  font-size:.95rem;
  margin:0 0 .6rem;
}

.search-result-row {
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.65rem .2rem;
  border-bottom:1px solid var(--line);
  text-decoration:none;
  color:var(--ink);
}

.search-result-row:hover {
  background:var(--canvas);
}

.file-row.is-highlighted {
  animation:searchHighlightFade 2.4s ease-out forwards;
}

@keyframes searchHighlightFade {
  0% {
    background:var(--accent-soft);
  }
  100% {
    background:transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .file-row.is-highlighted {
    animation:none;
    background:var(--accent-soft);
  }
}

@media (max-width:640px) {
  .topbar {
    gap:4px;
    padding:0 8px;
  }
  .topbar-actions {
    gap:4px;
  }
  .search-trigger-label,.search-trigger-kbd {
    display:none;
  }
  .search-trigger {
    flex:none;
    justify-content:center;
    width:var(--tap);
    max-width:none;
    padding:0;
  }
  .search-palette {
    width:100vw;
    max-width:100vw;
    height:100vh;
    height:100dvh;
    max-height:100vh;
    max-height:100dvh;
    border-radius:0;
  }
  .search-palette-inner {
    max-height:100vh;
    max-height:100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,body.nav-open .app-sidebar,.nav-row,.icon-button,.lang-group a {
    transition:none;
  }
}

.project-card {
  position:relative;
  padding:1.05rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  min-height:106px;
}

.project-card:hover {
  border-color:var(--accent);
  box-shadow:0 4px 14px #183f3b0d;
}

.project-card.is-archived {
  background:#fbfcfc;
}

.project-folder {
  flex:none;
  width:24px;
  height:24px;
  fill:var(--accent);
}

.project-card.is-archived .project-folder {
  fill:var(--muted);
}

.project-card-link {
  display:flex;
  gap:1rem;
  color:var(--ink);
  text-decoration:none;
  min-height:106px;
}

.project-card-controls {
  position:absolute;
  top:.55rem;
  right:.55rem;
  display:flex;
  align-items:center;
  gap:.3rem;
  z-index:2;
}

.pin-btn {
  border:0;
  background:none;
  color:var(--border-strong);
  font-size:1.15rem;
  line-height:1;
  cursor:pointer;
  padding:.25rem .35rem;
  border-radius:6px;
  min-width:32px;
  min-height:32px;
}

.pin-btn:hover {
  background:var(--accent-soft);
  color:var(--accent);
}

.pin-btn.is-pinned {
  color:var(--accent);
}

.status-badge.is-archived {
  background:#eef1f0;
  color:var(--muted);
}

.status-badge.is-archived::before {
  background:#9aa7a7;
}

.status-badge.is-in-progress {
  background:#faf3e3;
  color:#8a6d1d;
}

.status-badge.is-in-progress::before {
  background:#c99a2e;
}

.work-panel {
  margin-bottom:1rem;
}

.work-panel-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
}

.work-panel-people {
  list-style:none;
  margin:.6rem 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.3rem;
  font-size:.82rem;
  color:var(--muted);
}

.work-panel-warning {
  display:flex;
  align-items:center;
  gap:.5rem;
  padding:.55rem .8rem;
  margin:0 0 .75rem;
  background:#faf3e3;
  border:1px solid #eadfc4;
  border-radius:8px;
  color:#6b551a;
  font-size:.82rem;
}

.change-note-inline {
  display:flex;
  align-items:center;
  gap:.4rem;
  margin-top:.2rem;
}

.change-note-inline input {
  font-size:.78rem;
  padding:.2rem .4rem;
}

.change-note-edit-link {
  background:none;
  border:none;
  padding:0;
  color:var(--accent);
  font-size:.72rem;
  cursor:pointer;
}

.quick-work-action {
  margin:0;
  display:inline-flex;
  flex-shrink:0;
}

.quick-work-chip {
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  border:1px solid var(--line);
  background:var(--canvas);
  color:var(--ink);
  font-size:.72rem;
  font-weight:600;
  line-height:1;
  padding:.36rem .65rem;
  border-radius:6px;
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
}

.quick-work-chip-icon {
  font-size:.82rem;
  line-height:1;
}

.quick-work-chip:hover {
  border-color:var(--accent);
  background:var(--accent-soft);
  color:var(--accent);
}

.quick-work-chip.is-finish {
  border-color:#eadfc4;
  background:#faf3e3;
  color:#6b551a;
}

.quick-work-chip.is-finish:hover {
  border-color:#c99a2e;
  background:#f0dfab;
  color:#5c4813;
}

@media(max-width:800px) {
  .quick-work-chip {
    padding:.36rem .5rem;
  }
  .quick-work-chip-label {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
  }
}

.plan-state-panel .plan-state-version {
  font-size:1.3rem;
  font-weight:600;
  color:var(--ink);
  margin-top:.2rem;
}

.plan-state-note-label {
  margin-top:.75rem;
  font-size:.72rem;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}

.plan-state-note {
  margin:.25rem 0 0;
  font-size:.86rem;
  color:var(--ink);
}

.plan-state-note.is-empty {
  color:var(--muted);
  font-style:italic;
}

.notif-panel {
  padding:0;
}

.notif-row {
  display:flex;
  align-items:flex-start;
  gap:.7rem;
  padding:.75rem 1.1rem;
  border-bottom:1px solid var(--line);
  text-decoration:none;
  color:var(--ink);
}

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

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

.notif-row-dot {
  width:7px;
  height:7px;
  border-radius:50%;
  background:transparent;
  margin-top:.4rem;
  flex-shrink:0;
}

.notif-row.is-unread .notif-row-dot {
  background:var(--accent);
}

.notif-row-body {
  display:flex;
  flex-direction:column;
  gap:.15rem;
  min-width:0;
}

.notif-row-text {
  font-size:.86rem;
  color:var(--ink);
}

.notif-row.is-unread .notif-row-text {
  font-weight:600;
}

.notif-row-meta {
  font-size:.72rem;
  color:var(--muted);
}

.notification-bell {
  position:relative;
}

.notification-badge {
  position:absolute;
  top:2px;
  right:0;
  background:var(--accent);
  color:#fff;
  border-radius:9px;
  font-size:.867rem;
  font-weight:700;
  line-height:1.3;
  padding:0 .32rem;
  min-width:1.1rem;
  text-align:center;
}

.project-section {
  margin-bottom:.4rem;
}

.pinned-section {
  margin-bottom:1.7rem;
}

.pinned-section h2 {
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.1em;
  color:var(--muted);
  margin:0 0 .7rem;
  font-weight:600;
}

.archived-banner {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.6rem;
  padding:.65rem 1rem;
  margin:0 0 1.1rem;
  background:#eef1f0;
  border:1px solid var(--line);
  border-radius:8px;
  color:#5b6a6c;
  font-size:.82rem;
}

.archived-banner form {
  margin-left:auto;
}

.archive-control {
  margin-bottom:1rem;
}

h1 .status-badge {
  vertical-align:middle;
  margin-left:.5rem;
  font-size:.62rem;
}

@media(max-width:800px) {
  .project-card-controls {
    top:.4rem;
    right:.4rem;
  }
}

.project-tabs {
  display:flex;
  gap:.35rem;
  overflow-x:auto;
}

.project-tabs a {
  padding:.35rem .75rem;
  border-radius:20px;
  font-size:.8rem;
  color:var(--muted);
  text-decoration:none;
  border:1px solid var(--line);
  white-space:nowrap;
  flex-shrink:0;
}

.project-tabs a:hover {
  color:var(--ink);
}

.project-tabs a.active {
  background:var(--accent-soft);
  color:var(--accent);
  border-color:var(--accent-soft);
}

.overview-stats {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.75rem;
  margin:0 0 1.3rem;
}

.stat-chip {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  padding:.65rem 1.05rem;
  display:flex;
  flex-direction:column;
  gap:.15rem;
  min-width:100px;
}

.stat-value {
  font-size:1.3rem;
  font-weight:600;
  color:var(--ink);
  font-variant-numeric:tabular-nums;
  line-height:1.2;
}

.stat-label {
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.09em;
  font-size:.64rem;
  font-weight:600;
}

.overview-dates {
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:.78rem;
  margin-left:.25rem;
}

.overview-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1rem;
}

.overview-panel h2 {
  font-size:.92rem;
}

.overview-list {
  list-style:none;
  margin:0;
  padding:0;
}

.overview-list li {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.55rem 0;
  border-bottom:1px solid var(--line);
  font-size:.84rem;
}

.overview-list li:last-child {
  border-bottom:0;
}

.overview-list li>a {
  color:var(--accent);
  text-decoration:none;
  font-weight:500;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

.overview-list li>a:hover {
  text-decoration:underline;
}

.overview-list-meta {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.1rem;
  flex-shrink:0;
  font-size:.72rem;
  color:var(--muted);
  text-align:right;
  max-width:45%;
}

.overview-list-meta span:first-child {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
}

.overview-list-meta time {
  white-space:nowrap;
}

.overview-viewall {
  display:inline-block;
  margin-top:.85rem;
  color:var(--accent);
  font-size:.78rem;
  font-weight:600;
  text-decoration:none;
}

.overview-viewall:hover {
  text-decoration:underline;
}

.activity-badge {
  display:inline-block;
  padding:.2rem .55rem;
  border-radius:5px;
  background:var(--canvas);
  border:1px solid var(--line);
  color:var(--ink);
  font-size:.72rem;
  font-weight:600;
  flex-shrink:0;
}

.member-chip-list {
  display:flex;
  flex-direction:column;
  gap:.6rem;
}

.member-chip {
  display:flex;
  align-items:center;
  gap:.55rem;
  font-size:.84rem;
}

.member-chip .status-badge {
  margin-left:auto;
  padding:.15rem .5rem;
  font-size:.64rem;
}

.overview-more {
  margin:.5rem 0 0;
  font-size:.78rem;
  color:var(--muted);
}

.empty-state-inline {
  padding:.85rem 0;
  color:var(--muted);
  font-size:.82rem;
  display:flex;
  flex-direction:column;
  gap:.25rem;
}

.empty-state-inline strong {
  color:var(--ink);
  font-size:.86rem;
}

.quick-actions {
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}

.quick-actions form {
  display:contents;
}

@media(max-width:900px) {
  .overview-grid {
    grid-template-columns:1fr;
  }
}

.coordination-attention {
  margin-bottom:1rem;
}

.attention-item a {
  color:var(--ink);
  font-weight:500;
  white-space:normal;
}

.attention-item.is-error a {
  color:#b3261e;
}

.attention-item.is-warning a {
  color:#8a6d1d;
}

.attention-item.is-neutral a {
  color:var(--accent);
}

.overview-list li.has-sublist {
  display:block;
  padding-bottom:.5rem;
}

.overview-list-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}

.overview-list-row>a {
  color:var(--accent);
  text-decoration:none;
  font-weight:500;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

.attention-sublist {
  list-style:none;
  margin:.35rem 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.2rem;
}

.attention-sublist li {
  border:0;
  padding:0;
  font-size:.76rem;
}

.attention-sublist a {
  color:var(--accent);
  text-decoration:none;
}

.attention-sublist a:hover {
  text-decoration:underline;
}

.coordination-subhead {
  margin-top:1.1rem;
  padding-top:.9rem;
  border-top:1px solid var(--line);
  font-size:.92rem;
}

@media(max-width:800px) {
  .project-heading-actions {
    width:100%;
    justify-content:flex-start;
  }
  .project-tabs {
    width:100%;
  }
  .overview-list-meta {
    max-width:60%;
  }
}

.pwa-install-btn {
  display:inline-flex;
  align-items:center;
  min-height:var(--tap);
  border:1px solid var(--line);
  background:transparent;
  color:var(--accent);
  font-size:.867rem;
  font-weight:600;
  padding:0 .75rem;
  border-radius:var(--r-btn);
  cursor:pointer;
  white-space:nowrap;
}

.pwa-install-btn[hidden] {
  display:none;
}

.pwa-install-btn:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.pwa-install-btn:hover {
  border-color:var(--accent);
  background:var(--accent-soft);
}

@media(max-width:640px) {
  .pwa-install-btn {
    padding:0 .75rem;
    font-size:0;
  }
  .pwa-install-btn::before {
    content:"+";
    font-size:1rem;
  }
}

.drop-page {
  max-width:720px;
}

.drop-card {
  padding:1.8rem;
}

.drop-zone {
  margin-top:0;
  border:1px dashed var(--line);
  border-radius:12px;
  padding:2.6rem 1.5rem;
  text-align:center;
  background:var(--canvas);
  transition:border-color .15s,background .15s;
}

.drop-zone.is-dragover {
  border-color:var(--accent);
  background:var(--accent-soft);
}

.drop-zone-icon {
  display:block;
  font-size:1.8rem;
  color:var(--accent);
  margin-bottom:.9rem;
}

.drop-zone-actions {
  display:flex;
  gap:.6rem;
  justify-content:center;
  flex-wrap:wrap;
}

.drop-info-list {
  list-style:none;
  margin:1.4rem 0 0;
  padding:1.1rem 0 0;
  border-top:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:.65rem;
}

.drop-info-list li {
  display:flex;
  align-items:flex-start;
  gap:.65rem;
  font-size:.82rem;
  color:var(--muted);
  line-height:1.45;
}

.drop-info-icon {
  color:var(--accent);
  flex-shrink:0;
  font-size:.95rem;
  line-height:1.45;
}

.drop-staged-stage h2 {
  font-size:1.35rem;
  letter-spacing:-.015em;
  margin:0 0 .2rem;
}

.drop-file-list {
  list-style:none;
  margin:.8rem 0 1.4rem;
  padding:0;
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
}

.drop-file-row {
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.55rem .8rem;
  border-bottom:1px solid var(--line);
  font-size:.86rem;
}

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

.drop-file-name {
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.drop-file-size {
  color:var(--muted);
  font-size:.78rem;
  flex-shrink:0;
}

.drop-picker {
  padding:1.1rem 0;
  border-top:1px solid var(--line);
}

.drop-picker h3 {
  font-size:.9rem;
  font-weight:600;
  margin:0 0 .7rem;
}

.drop-picker-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
}

.drop-picker-head h3 {
  margin:0;
}

.link-btn {
  background:none;
  border:0;
  color:var(--accent);
  font-size:.8rem;
  font-weight:600;
  cursor:pointer;
  padding:0;
}

.link-btn:hover {
  text-decoration:underline;
}

.drop-project-group-label {
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  font-weight:600;
  margin:.7rem 0 .4rem;
}

.drop-project-group-label:first-child {
  margin-top:0;
}

.drop-project-grid {
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
}

.drop-project-btn,.drop-folder-btn {
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  font-size:.84rem;
  padding:.45rem .8rem;
  border-radius:8px;
  cursor:pointer;
  text-align:left;
}

.drop-project-btn:hover,.drop-folder-btn:hover {
  border-color:var(--accent);
  background:var(--accent-soft);
  color:var(--accent);
}

.drop-breadcrumb {
  font-size:.82rem;
  color:var(--muted);
  margin:.6rem 0 .7rem;
}

.drop-folder-list {
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.4rem;
}

.drop-folder-list .drop-folder-btn {
  width:100%;
}

.drop-conflicts {
  border:1px solid var(--line);
  border-radius:8px;
  padding:.7rem .9rem;
  margin:1rem 0;
  background:var(--canvas);
}

.drop-conflict-row {
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.4rem 0;
  font-size:.85rem;
  border-bottom:1px solid var(--line);
}

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

.drop-conflict-row.is-resolved {
  opacity:.5;
}

.drop-conflict-row span:first-child {
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.drop-actions {
  margin-top:1.2rem;
}

.drop-queue-list {
  margin-top:1rem;
}

@media(max-width:480px) {
  .drop-zone {
    padding:2rem 1rem;
  }
  .drop-zone-actions {
    flex-direction:column;
  }
}

.pwa-install-banner {
  display:flex;
  align-items:center;
  gap:.9rem;
  padding:.85rem 1.1rem;
  margin-bottom:1.4rem;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface);
}

.pwa-install-banner-icon {
  width:36px;
  height:36px;
  border-radius:8px;
  flex-shrink:0;
}

.pwa-install-banner-copy {
  flex:1;
  min-width:0;
}

.pwa-install-banner-copy strong {
  display:block;
  font-size:.88rem;
  color:var(--ink);
  margin-bottom:.2rem;
}

.pwa-install-banner-copy p {
  margin:0;
  font-size:.82rem;
  color:var(--muted);
  line-height:1.5;
}

.pwa-install-banner-actions {
  display:flex;
  gap:.5rem;
  flex-shrink:0;
}

@media(max-width:700px) {
  .pwa-install-banner {
    flex-wrap:wrap;
  }
  .pwa-install-banner-actions {
    width:100%;
    justify-content:flex-end;
  }
}

.permission-summary-panel {
  margin-bottom:1rem;
}

.permission-summary-panel h2 {
  font-size:.92rem;
}

.permission-summary {
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:1rem .9rem;
}

.permission-summary li {
  display:flex;
  align-items:flex-start;
  gap:.6rem;
}

.permission-summary-icon {
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:7px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:.85rem;
  flex-shrink:0;
}

.permission-summary li strong {
  font-size:.84rem;
  display:block;
}

.permission-summary li p {
  margin:.1rem 0 0;
  font-size:.78rem;
  line-height:1.4;
}

.permission-summary-hint {
  margin:1.1rem 0 0;
  padding-top:.9rem;
  border-top:1px solid var(--line);
}

.permissions-panel {
  padding:0;
}

.permissions-table th,.permissions-table td {
  padding:.7rem 1rem;
}

.permissions-table thead th {
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:.64rem;
  font-weight:600;
  background:#fbfcfc;
}

.permissions-table .perm-cell {
  text-align:center;
  width:64px;
}

.permissions-table .perm-action {
  text-align:right;
  width:110px;
}

.permissions-table tbody tr:hover {
  background:#fbfcfc;
}

.permissions-table tbody tr.is-self {
  background:var(--accent-soft);
}

.perm-check {
  display:inline-flex;
  margin:0;
  cursor:pointer;
}

.perm-check input {
  width:16px;
  height:16px;
  margin:0;
  cursor:pointer;
}

.permissions-member-name {
  display:flex;
  align-items:center;
  gap:.4rem;
  flex-wrap:wrap;
  font-weight:500;
}

.lifecycle-panel {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  margin-top:1.4rem;
  padding:1rem 1.2rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
}

.lifecycle-panel strong {
  font-size:.88rem;
}

.lifecycle-panel p {
  margin:.2rem 0 0;
}

.btn-danger-outline {
  color:var(--danger);
  border-color:#e4c3c5;
}

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

@media(max-width:800px) {
  .permissions-table thead {
    display:none;
  }
  .permissions-table,.permissions-table tbody,.permissions-table tr,.permissions-table td {
    display:block;
    width:auto;
  }
  .permissions-table tr {
    border:1px solid var(--line);
    border-radius:9px;
    margin:0 0 .7rem;
    padding:.3rem 0;
  }
  .permissions-table td {
    padding:.4rem 1rem;
    border:0;
  }
  .permissions-table .perm-cell {
    display:flex;
    align-items:center;
    justify-content:space-between;
    text-align:left;
  }
  .permissions-table .perm-cell::before {
    content:attr(data-label);
    color:var(--muted);
    font-size:.78rem;
  }
  .permissions-table .perm-action {
    text-align:left;
  }
  .lifecycle-panel {
    flex-direction:column;
    align-items:flex-start;
  }
}

.connector-hero {
  display:flex;
  flex-direction:column;
  gap:.4rem;
  max-width:760px;
  margin-bottom:2rem;
}

.connector-cta-row {
  display:flex;
  align-items:center;
  gap:.5rem 1.1rem;
  flex-wrap:wrap;
  margin:1rem 0 0;
}

.connector-cta {
  display:inline-flex;
  align-items:center;
  gap:.6rem;
  height:44px;
  padding:0 1.25rem;
  font-weight:500;
}

.connector-cta .icon {
  width:18px;
  height:18px;
}

.connector-hero .version-row {
  color:var(--muted);
  font-size:.82rem;
  margin:0;
}

.connector-card {
  max-width:760px;
}

.connector-steps {
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1.5rem;
}

.connector-step {
  border-top:2px solid var(--line);
  padding-top:.9rem;
}

.connector-step-number {
  display:block;
  color:var(--accent);
  font-size:.8rem;
  font-weight:600;
  letter-spacing:.08em;
  margin-bottom:.35rem;
}

.connector-step h3 {
  font-size:.95rem;
  margin:0 0 .3rem;
}

.connector-step p {
  margin:0;
  font-size:.85rem;
  color:var(--muted);
  line-height:1.5;
}

.connector-pilot-note {
  margin-top:2rem;
  padding:.1rem 0 .1rem 1rem;
  border-left:2px solid var(--accent);
  font-size:.85rem;
  color:var(--muted);
  line-height:1.5;
}

.connector-pilot-note strong {
  display:block;
  color:var(--ink);
  margin-bottom:.15rem;
  font-size:.88rem;
  font-weight:600;
}

.connector-pilot-note p {
  margin:0;
}

.connector-details {
  margin-top:2rem;
  padding-top:1.1rem;
  border-top:1px solid var(--line);
}

.connector-details h2 {
  font-size:.75rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin:0 0 .7rem;
  font-weight:600;
}

.connector-details-grid {
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  gap:.45rem 1.5rem;
  font-size:.82rem;
  margin:0;
}

.connector-details-grid dt {
  color:var(--muted);
  font-weight:400;
}

.connector-details-grid dd {
  margin:0;
  font-family:var(--font-mono);
  overflow-wrap:anywhere;
  word-break:break-all;
}

.compare-header {
  display:flex;
  gap:1.5rem;
  align-items:flex-start;
  flex-wrap:wrap;
}

.compare-version-col {
  flex:1;
  min-width:200px;
}

.compare-version-num {
  font-size:1.3rem;
  font-weight:600;
  margin:.2rem 0;
}

.compare-version-note {
  margin:.3rem 0 0;
  font-size:.82rem;
}

.compare-version-note.is-empty {
  color:var(--muted);
  font-style:italic;
}

.compare-version-vs {
  color:var(--muted);
  font-size:1.2rem;
  align-self:center;
}

.compare-header-actions {
  display:flex;
  gap:.5rem;
  align-items:flex-start;
  margin-left:auto;
}

.compare-root {
  margin-top:1rem;
}

.compare-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.9rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  padding:.55rem .8rem;
  margin-bottom:.75rem;
}

.compare-toolbar-group {
  display:flex;
  align-items:center;
  gap:.4rem;
}

.compare-mode-btn {
  border:1px solid var(--line);
  background:#fff;
  color:var(--muted);
  border-radius:6px;
  padding:.35rem .7rem;
  font-size:.78rem;
  cursor:pointer;
}

.compare-mode-btn.is-active {
  background:var(--accent-soft);
  color:var(--accent);
  border-color:var(--accent-soft);
  font-weight:600;
}

.compare-tool-btn {
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  border-radius:6px;
  width:28px;
  height:28px;
  font-size:.9rem;
  cursor:pointer;
}

.compare-tool-btn:disabled {
  opacity:.4;
  cursor:default;
}

.compare-indicator {
  font-size:.78rem;
  color:var(--muted);
  min-width:52px;
  text-align:center;
  font-variant-numeric:tabular-nums;
}

.compare-sync-toggle {
  display:flex;
  align-items:center;
  gap:.35rem;
  font-size:.78rem;
  color:var(--muted);
}

.compare-warning {
  background:#faf3e3;
  border:1px solid #eadfc4;
  color:#6b551a;
  border-radius:8px;
  padding:.5rem .8rem;
  font-size:.8rem;
  margin-bottom:.75rem;
}

.compare-error {
  background:#f7e4e4;
  border:1px solid #e6bcbc;
  color:var(--danger);
  border-radius:8px;
  padding:.5rem .8rem;
  font-size:.8rem;
  margin-bottom:.75rem;
}

.compare-viewport {
  background:var(--canvas);
  border:1px solid var(--line);
  border-radius:9px;
  padding:1rem;
  min-height:320px;
}

.compare-sidebyside {
  display:flex;
  gap:1rem;
}

.compare-viewport.is-swapped .compare-sidebyside {
  flex-direction:row-reverse;
}

.compare-pane {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:.4rem;
}

.compare-pane-label {
  font-size:.72rem;
  color:var(--muted);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.05em;
  cursor:default;
}

.compare-pane-label span.is-clickable {
  cursor:pointer;
  text-decoration:underline dotted;
  text-underline-offset:2px;
}

.compare-canvas-wrap {
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:6px;
  overflow:auto;
  display:flex;
  justify-content:center;
  min-height:200px;
}

.compare-canvas-wrap canvas {
  display:block;
  max-width:100%;
}

.compare-no-page {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:.85rem;
  background:#fbfcfc;
}

.compare-overlay {
  display:flex;
  flex-direction:column;
  gap:.75rem;
}

.compare-overlay-canvases {
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:6px;
  min-height:200px;
  display:flex;
  justify-content:center;
  overflow:auto;
}

#cmpOverlayCanvasA {
  position:relative;
  z-index:1;
}

#cmpOverlayCanvasB {
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  z-index:2;
}

.compare-overlay-controls {
  display:flex;
  align-items:center;
  gap:.6rem;
  flex-wrap:wrap;
}

.compare-opacity-label {
  display:flex;
  align-items:center;
  gap:.4rem;
  font-size:.78rem;
  color:var(--muted);
}

.compare-diff {
  display:flex;
  flex-direction:column;
  gap:.6rem;
}

.compare-diff-help {
  font-size:.76rem;
  color:var(--muted);
  margin:0;
}

.compare-diff-controls {
  display:flex;
  align-items:center;
  gap:1rem;
  flex-wrap:wrap;
  font-size:.78rem;
  color:var(--muted);
}

@media(max-width:800px) {
  .compare-sidebyside {
    flex-direction:column;
  }
  .compare-toolbar {
    gap:.5rem;
  }
  .compare-header {
    flex-direction:column;
  }
  .compare-header-actions {
    margin-left:0;
  }
}

.compare-select-bar {
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.75rem 1.2rem;
}

.compare-select-bar .eyebrow {
  margin-right:.2rem;
}

@media(max-width:700px) {
  .connector-steps {
    grid-template-columns:1fr;
  }
  .connector-steps {
    gap:1.1rem;
  }
}

.review-header {
  display:flex;
  gap:1.5rem;
  align-items:flex-start;
  flex-wrap:wrap;
}

.review-version-info {
  flex:1;
  min-width:200px;
}

.review-version-note {
  margin:.3rem 0 0;
  font-size:.82rem;
}

.review-version-note.is-empty {
  color:var(--muted);
  font-style:italic;
}

.review-open-count {
  font-size:.85rem;
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
}

.review-banner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  flex-wrap:wrap;
  border-radius:8px;
  padding:.55rem .9rem;
  font-size:.82rem;
  margin-bottom:.75rem;
}

.review-banner-newer {
  background:#faf3e3;
  border:1px solid #eadfc4;
  color:#6b551a;
}

.review-banner-older {
  background:#eef2ee;
  border:1px solid #cddccd;
  color:#3f5a3f;
}

.review-root {
  margin-top:1rem;
}

.review-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.9rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  padding:.55rem .8rem;
  margin-bottom:.75rem;
}

.review-toolbar-group {
  display:flex;
  align-items:center;
  gap:.4rem;
}

.review-panel-toggle {
  display:none;
  margin-left:auto;
}

.review-body {
  display:flex;
  gap:1rem;
  align-items:flex-start;
}

.review-canvas-area {
  position:relative;
  flex:1;
  min-width:0;
}

.review-canvas-wrap {
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  overflow:auto;
  display:flex;
  justify-content:center;
  min-height:320px;
}

.review-canvas-wrap canvas {
  display:block;
  max-width:100%;
  cursor:default;
}

.review-tool-pin canvas,.review-tool-area canvas {
  cursor:crosshair;
}

.review-marker-layer {
  position:absolute;
  inset:0;
  pointer-events:none;
}

.review-marker {
  position:absolute;
  pointer-events:auto;
  cursor:pointer;
}

.review-marker-pin {
  transform:translate(-50%,-50%);
}

.review-marker-badge {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 .3rem;
  border-radius:10px;
  background:#fff;
  font-size:.7rem;
  font-weight:700;
  line-height:1;
  box-shadow:0 1px 3px rgba(0,0,0,.25);
}

.review-marker-pin.is-open .review-marker-badge {
  border:2px solid #c8932a;
  color:#8a6415;
}

.review-marker-pin.is-resolved .review-marker-badge {
  border:2px solid #7a9a7a;
  color:#4b6b4b;
  opacity:.85;
}

.review-marker-pin.is-selected .review-marker-badge {
  border-color:var(--accent);
  color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}

.review-marker-rect {
  border-radius:3px;
  background:rgba(200,147,42,.10);
  border:1.5px solid #c8932a;
}

.review-marker-rect.is-resolved {
  background:rgba(122,154,122,.10);
  border-color:#7a9a7a;
}

.review-marker-rect.is-selected {
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}

.review-marker-rect .review-marker-badge {
  position:absolute;
  top:-10px;
  left:-10px;
}

.review-marker-dragging {
  border:1.5px dashed var(--accent);
  background:rgba(37,99,235,.06);
}

.review-popover {
  position:absolute;
  z-index:5;
  width:250px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  box-shadow:0 6px 20px rgba(0,0,0,.15);
  padding:.7rem;
}

.review-popover-title {
  font-size:.78rem;
  font-weight:600;
  margin-bottom:.4rem;
}

.review-popover textarea {
  width:100%;
  min-height:70px;
  font-size:.82rem;
  resize:vertical;
}

.review-popover-actions {
  display:flex;
  justify-content:flex-end;
  gap:.4rem;
  margin-top:.5rem;
}

.review-panel {
  width:320px;
  flex-shrink:0;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  padding:.8rem;
  max-height:70vh;
  overflow-y:auto;
}

.review-panel-filters {
  display:flex;
  align-items:center;
  gap:.4rem;
  flex-wrap:wrap;
  margin-bottom:.6rem;
}

.review-filter-btn {
  border:1px solid var(--line);
  background:#fff;
  color:var(--muted);
  border-radius:6px;
  padding:.25rem .6rem;
  font-size:.74rem;
  cursor:pointer;
}

.review-filter-btn.is-active {
  background:var(--accent-soft);
  color:var(--accent);
  border-color:var(--accent-soft);
  font-weight:600;
}

.review-page-only {
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:.3rem;
  font-size:.74rem;
  color:var(--muted);
}

.review-note-list {
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

.review-note-item {
  border:1px solid var(--line);
  border-radius:7px;
  padding:.55rem .65rem;
  cursor:pointer;
}

.review-note-item.is-selected {
  border-color:var(--accent);
  box-shadow:0 0 0 2px var(--accent-soft);
}

.review-note-head {
  display:flex;
  align-items:center;
  gap:.5rem;
  margin-bottom:.25rem;
}

.review-note-index {
  font-weight:700;
  font-size:.78rem;
  color:var(--muted);
}

.review-note-status {
  font-size:.7rem;
  font-weight:600;
  padding:.05rem .4rem;
  border-radius:5px;
}

.review-note-status.is-open {
  background:#faf3e3;
  color:#8a6415;
}

.review-note-status.is-resolved {
  background:#eef2ee;
  color:#4b6b4b;
}

.review-note-body {
  font-size:.82rem;
  white-space:pre-wrap;
  word-break:break-word;
}

.review-note-meta {
  font-size:.7rem;
  color:var(--muted);
  margin-top:.3rem;
}

.review-note-actions {
  display:flex;
  gap:.4rem;
  margin-top:.45rem;
  flex-wrap:wrap;
}

.review-note-edit-body {
  width:100%;
  min-height:70px;
  font-size:.82rem;
}

.review-no-notes {
  color:var(--muted);
  font-size:.82rem;
  padding:.5rem;
}

@media(max-width:800px) {
  .review-body {
    flex-direction:column;
  }
  .review-panel-toggle {
    display:inline-block;
  }
  .review-panel {
    width:100%;
    max-height:none;
    display:none;
  }
  .review-panel.is-open {
    display:block;
  }
  .review-header {
    flex-direction:column;
  }
}

.review-count-badge {
  margin-left:.35rem;
  font-size:.68rem;
  font-weight:700;
  opacity:.85;
}

.file-icon.pdf {
  background:#f7e3e0;
  color:#a13f2e;
  font-size:.58rem;
  font-weight:700;
}

.file-icon.image {
  background:#e2ecf5;
  color:#2b5f8a;
  font-size:.58rem;
  font-weight:700;
}

.file-icon.dwg {
  background:#e7e2f2;
  color:#5b3f9e;
  font-size:.58rem;
  font-weight:700;
}

.file-icon.pln {
  background:#e2f0e6;
  color:#276f43;
  font-size:.58rem;
  font-weight:700;
}

.file-icon.pla {
  background:#def0ee;
  color:#1c7a71;
  font-size:.58rem;
  font-weight:700;
}

.file-icon.other {
  font-size:.75rem;
}

.search-result-icon.pdf,.search-result-icon.image,.search-result-icon.dwg,.search-result-icon.pln,.search-result-icon.pla {
  font-size:.58rem;
  font-weight:700;
}

.file-type-ext {
  color:var(--muted);
  font-size:.7rem;
  margin-left:.4rem;
}

.preview-header {
  display:flex;
  gap:1.5rem;
  align-items:flex-start;
  flex-wrap:wrap;
}

.preview-version-info {
  flex:1;
  min-width:200px;
}

.preview-version-note {
  margin:.3rem 0 0;
  font-size:.82rem;
}

.preview-version-note.is-empty {
  color:var(--muted);
  font-style:italic;
}

.preview-header-actions {
  display:flex;
  gap:.5rem;
  align-items:center;
  margin-left:auto;
  flex-wrap:wrap;
}

.preview-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.9rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  padding:.55rem .8rem;
  margin:1rem 0 .75rem;
}

.preview-toolbar-group {
  display:flex;
  align-items:center;
  gap:.4rem;
}

.preview-canvas-wrap {
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  overflow:auto;
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:320px;
  max-height:74vh;
}

.preview-canvas-wrap img {
  display:block;
  max-width:100%;
  max-height:74vh;
  object-fit:contain;
}

.preview-lightbox {
  position:fixed;
  inset:0;
  background:rgba(15,23,23,.92);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
}

.preview-lightbox img {
  max-width:96vw;
  max-height:96vh;
  object-fit:contain;
}

.preview-lightbox-close {
  position:absolute;
  top:1rem;
  right:1.2rem;
  background:none;
  border:0;
  color:#fff;
  font-size:1.6rem;
  cursor:pointer;
  line-height:1;
}

@media(max-width:800px) {
  .preview-header {
    flex-direction:column;
  }
}

.companion-badge {
  display:inline-flex;
  align-items:center;
  margin-left:.4rem;
  padding:.05rem .4rem;
  border-radius:5px;
  font-size:.68rem;
  font-weight:600;
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--muted);
}

.companion-panel {
  display:flex;
  flex-direction:column;
  gap:.6rem;
}

.companion-card {
  border-radius:8px;
  padding:.65rem .9rem;
  position:relative;
}

.companion-card.is-current {
  background:#eef2ee;
  border:1px solid #cddccd;
  color:#3f5a3f;
}

.companion-card.is-stale {
  background:#faf3e3;
  border:1px solid #eadfc4;
  color:#6b551a;
}

.companion-card.is-recycled {
  background:#f4f4f4;
  border:1px solid #ddd;
  color:#666;
}

.companion-card-title {
  font-weight:600;
  font-size:.9rem;
}

.companion-card-title a {
  color:inherit;
  text-decoration:underline;
}

.companion-card-meta {
  font-size:.78rem;
  opacity:.9;
  margin-top:.15rem;
}

.companion-status-badge {
  display:inline-block;
  margin-top:.35rem;
  font-size:.7rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
  opacity:.85;
}

.companion-card-actions {
  display:flex;
  gap:.4rem;
  flex-wrap:wrap;
  margin-top:.55rem;
}

.companion-history-badge {
  margin-left:.35rem;
  font-size:.68rem;
  font-weight:700;
  opacity:.75;
}

.planset-badge {
  display:inline-flex;
  align-items:center;
  margin-left:.4rem;
  padding:.05rem .4rem;
  border-radius:5px;
  font-size:.68rem;
  font-weight:600;
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--muted);
}

.planset-list-card {
  display:block;
  text-decoration:none;
  color:inherit;
  cursor:pointer;
}

.planset-add-dialog {
  max-width:520px;
}

.planset-candidate-list {
  max-height:260px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:.35rem;
  border:1px solid var(--line);
  border-radius:6px;
  padding:.5rem;
}

.planset-candidate-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  font-size:.85rem;
}

.planset-candidate-row label {
  display:flex;
  align-items:center;
  gap:.4rem;
}

.planset-candidate-row select {
  max-width:150px;
}

.issue-badge {
  display:inline-flex;
  align-items:center;
  margin-left:.4rem;
  padding:.05rem .4rem;
  border-radius:5px;
  font-size:.68rem;
  font-weight:600;
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--muted);
}

.issue-list-card {
  display:block;
  text-decoration:none;
  color:inherit;
  cursor:pointer;
}

.issue-status-badge {
  display:inline-block;
  margin-left:.5rem;
  padding:.1rem .5rem;
  border-radius:5px;
  font-size:.68rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
}

.issue-status-badge.is-draft {
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--muted);
}

.issue-status-badge.is-issued {
  background:#eef1f0;
  color:#3d4a4a;
  border:1px solid #c7d0d0;
}

.issue-status-badge.is-failed {
  background:#f7e4e4;
  color:var(--danger);
  border:1px solid #e6bcbc;
}

.issue-status-badge.is-revoked,.issue-status-badge.is-expired {
  background:#eef1f0;
  color:var(--muted);
  border:1px solid #d7dedd;
}

.issue-add-actions {
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  margin:.6rem 0;
}

.issue-sha {
  font-family:var(--font-mono);
  word-break:break-all;
  overflow-wrap:anywhere;
}

.companion-panel-solo {
  display:flex;
  flex-direction:column;
  gap:.3rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:8px;
  padding:1rem;
  margin:.8rem 0;
}

.transmittal-timeline {
  list-style:none;
  margin:0 0 .8rem;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.25rem;
  font-size:.85rem;
  color:var(--muted);
}

.copy-link-row input {
  font-family:var(--font-mono);
  font-size:.8rem;
  word-break:break-all;
}

.delivery-actions {
  display:flex;
  gap:.6rem;
  flex-wrap:wrap;
  margin:1rem 0;
}

.delivery-message {
  white-space:pre-wrap;
  border-left:3px solid var(--line);
  padding-left:.7rem;
  margin:.6rem 0;
}

/* Project cards reserve a clean control area, so long names never collide with badges or actions. */
.project-card-link {
  flex:1;
  min-width:0;
  padding-right:4.6rem;
}

.project-card-copy {
  flex:1;
  min-width:0;
}

.project-card-copy h2 {
  line-height:24px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.project-card-controls {
  white-space:nowrap;
  background:var(--surface);
  border-radius:7px;
}

.project-card.is-archived .project-card-controls {
  background:#fbfcfc;
}

.project-card.is-archived .project-card-link {
  padding-right:9.6rem;
}

.project-card-controls .status-badge {
  flex-shrink:0;
  white-space:nowrap;
}

.recent-list {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:9px;
  overflow:hidden;
}

.recent-item {
  display:flex;
  align-items:center;
  gap:.9rem;
  padding:.75rem 1.05rem;
  border-bottom:1px solid var(--line);
  text-decoration:none;
  color:var(--ink);
}

.recent-item:last-child {
  border-bottom:0;
}

.recent-item:hover {
  background:var(--canvas);
}

.recent-copy {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:.25rem;
}

.recent-copy strong {
  font-size:.88rem;
  font-weight:500;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.recent-copy small {
  color:var(--muted);
  font-size:.78rem;
  display:flex;
  align-items:center;
  gap:.4rem;
}

.recent-item time {
  color:var(--muted);
  font-size:.76rem;
  flex-shrink:0;
  white-space:nowrap;
}

.action-badge {
  display:inline-flex;
  align-items:center;
  background:var(--accent-soft);
  color:var(--accent);
  border-radius:20px;
  padding:.1rem .55rem;
  font-size:.7rem;
  font-weight:600;
  white-space:nowrap;
}

@media(max-width:640px) {
  .recent-item {
    flex-wrap:wrap;
  }
  .recent-item time {
    margin-left:calc(26px + .9rem);
  }
}

.pwa-install-btn {
  gap:.45rem;
}

.pwa-install-btn .icon {
  width:16px;
  height:16px;
}

@media(max-width:640px) {
  .pwa-install-btn {
    gap:0;
    font-size:.867rem;
    padding:0 .6rem;
  }
  .pwa-install-btn::before {
    content:none;
  }
  .pwa-install-label {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
}

.pwa-info {
  border:none;
  border-radius:12px;
  padding:0;
  width:min(480px,92vw);
  box-shadow:0 18px 48px rgba(20,30,32,.22);
  background:var(--surface);
  color:var(--ink);
}

.pwa-info::backdrop {
  background:rgba(20,30,32,.4);
}

.pwa-info-inner {
  padding:1.1rem 1.25rem 1.25rem;
}

.pwa-info-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  margin-bottom:.5rem;
}

.pwa-info-title {
  margin:0;
  font-size:1.1rem;
  font-weight:600;
}

.pwa-info-msg {
  margin:0 0 .9rem;
  line-height:1.5;
}

.pwa-info-how h3 {
  margin:0 0 .4rem;
  font-size:.867rem;
  font-weight:600;
  color:var(--muted);
}

.pwa-info-how ul {
  margin:0 0 .9rem;
  padding-left:1.1rem;
  font-size:.9rem;
  line-height:1.5;
}

.pwa-info-actions {
  display:flex;
  justify-content:flex-end;
}

/* ---- Premium Bauhaus polish: Drop, Admin Users, Admin Project Edit (page-scoped; no shared selectors changed) ---- */
.drop-page {
  max-width:760px;
}

.drop-page .drop-card {
  padding:clamp(1.1rem,3vw,2rem);
}

.drop-page .drop-zone {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1.25rem;
  min-height:230px;
  padding:2.5rem 1.5rem;
  border:1.5px dashed var(--border-strong);
  border-radius:var(--r-panel);
  background:var(--canvas);
}

.drop-page .drop-zone:hover {
  border-color:var(--accent);
}

.drop-page .drop-zone.is-dragover {
  border-color:var(--accent);
  border-style:solid;
  background:var(--accent-soft);
}

.drop-page .drop-zone-icon {
  width:44px;
  height:44px;
  margin:0;
  font-size:inherit;
  color:var(--accent);
}

.drop-page .drop-zone-actions {
  gap:.75rem;
}

.drop-page .drop-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  min-height:var(--tap);
  padding:0 1.15rem;
  border-radius:var(--r-btn);
  font-size:.9rem;
  font-weight:600;
}

.drop-page .drop-btn .icon {
  width:18px;
  height:18px;
}

.drop-page .drop-info-list {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1.25rem;
  margin-top:1.5rem;
  padding-top:1.25rem;
}

.drop-page .drop-info-list li {
  gap:.6rem;
  font-size:.8125rem;
  line-height:1.5;
}

.drop-page .drop-info-icon {
  width:18px;
  height:18px;
  margin-top:1px;
  color:var(--muted);
}

@media(max-width:760px) {
  .drop-page .drop-info-list {
    grid-template-columns:1fr;
    gap:.8rem;
  }
  .drop-page .drop-zone {
    min-height:190px;
    padding:2rem 1rem;
  }
  .drop-page .drop-zone-actions {
    width:100%;
    flex-direction:column;
  }
  .drop-page .drop-btn {
    width:100%;
  }
}

/* shared by the two admin pages */
.admin-section {
  padding:1.5rem;
}

.admin-section-head {
  margin-bottom:1.25rem;
}

.admin-section-head h2,.admin-section h2 {
  margin:0;
  font-size:1.05rem;
  font-weight:600;
  letter-spacing:-.005em;
}

.admin-section-head p {
  margin:.25rem 0 0;
  max-width:68ch;
}

.admin-panel .btn:not(.btn-sm) {
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-weight:600;
  font-size:.875rem;
}

.admin-panel .btn.btn-sm {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  min-height:34px;
  border-radius:var(--r-btn);
  font-weight:600;
  font-size:.8125rem;
}

.page-heading .btn,.project-heading-actions .btn {
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-size:.875rem;
}

.admin-panel .btn .icon,.page-heading .btn .icon,.lifecycle-panel .btn .icon {
  width:16px;
  height:16px;
}

/* Users: new-user form */
.new-user-form {
  display:grid;
  grid-template-columns:minmax(0,3fr) minmax(0,2fr);
  gap:1.25rem 2rem;
  align-items:start;
}

.new-user-form .new-user-group {
  display:grid;
  gap:1rem;
  align-content:start;
}

.new-user-form .new-user-group:first-child {
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.new-user-form .new-user-group:first-child .form-field:first-child {
  grid-column:1 / -1;
}

.new-user-form .form-field {
  min-width:0;
  margin:0;
}

.new-user-form .form-control,.new-user-form .form-select {
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-size:.9rem;
}

.new-user-form .new-user-group-setup {
  padding-left:2rem;
  border-left:1px solid var(--line);
}

.password-setup-choice {
  border:0;
  padding:0;
}

.password-setup-choice legend {
  float:none;
  width:auto;
  margin:0 0 .5rem;
  padding:0;
  font-size:.78rem;
  font-weight:600;
}

.password-setup-choice label {
  display:flex;
  align-items:center;
  gap:.55rem;
  min-height:32px;
  font-size:.875rem;
  font-weight:400;
  cursor:pointer;
}

.password-setup-choice input {
  accent-color:var(--accent);
  margin:0;
}

.new-user-footer {
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem 1.5rem;
  padding-top:1.1rem;
  border-top:1px solid var(--line);
}

.new-user-footer .new-user-hint {
  flex:1 1 auto;
  margin:0;
  max-width:72ch;
}

.new-user-footer .new-user-submit {
  flex:0 0 auto;
}

@media(max-width:860px) {
  .new-user-form {
    grid-template-columns:1fr;
  }
  .new-user-form .new-user-group-setup {
    padding:1.1rem 0 0;
    border-left:0;
    border-top:1px solid var(--line);
  }
  .new-user-footer {
    flex-direction:column-reverse;
    align-items:stretch;
  }
  .new-user-footer .new-user-submit .btn {
    width:100%;
    justify-content:center;
  }
}

@media(max-width:520px) {
  .new-user-form .new-user-group:first-child {
    grid-template-columns:1fr;
  }
}

/* Users: accounts table */
.admin-section .panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:1rem;
}

.admin-section .panel-heading h2 {
  margin:0;
}

.count-pill {
  min-width:28px;
  padding:.15rem .6rem;
  border-radius:20px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:.78rem;
  font-weight:600;
  text-align:center;
}

.users-table-scroll {
  overflow-x:auto;
  margin:0 -1.5rem;
  padding:0 1.5rem;
}

.users-table {
  min-width:760px;
}

.users-table th,.users-table td {
  padding:.6rem .85rem;
  font-size:.875rem;
}

.users-table thead th {
  color:var(--muted);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  white-space:nowrap;
  background:transparent;
}

.users-table .users-name {
  font-weight:600;
}

.users-table .users-login {
  white-space:nowrap;
}

.users-table .users-col-actions {
  text-align:right;
}

.users-table .status-badge {
  white-space:nowrap;
}

.users-table .role-form .form-select {
  min-width:150px;
  min-height:34px;
  padding-top:.2rem;
  padding-bottom:.2rem;
  border-radius:var(--r-btn);
  font-size:.8125rem;
}

.users-table .btn-role-save,.users-table .overflow-menu summary {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  padding:0;
  border:1px solid var(--border-strong);
  border-radius:var(--r-btn);
  background:var(--surface);
  color:var(--accent);
}

.users-table .overflow-menu summary {
  color:var(--ink);
}

.users-table .btn-role-save:hover,.users-table .overflow-menu summary:hover {
  background:var(--accent-soft);
  border-color:var(--accent);
}

.users-table .btn-role-save .icon,.users-table .overflow-menu summary .icon {
  width:16px;
  height:16px;
}

.users-table .btn-role-save:focus-visible,.users-table .overflow-menu summary:focus-visible {
  outline:2px solid var(--focus-ring);
  outline-offset:2px;
}

.users-table .user-row-actions {
  flex-wrap:nowrap;
  justify-content:flex-end;
}

/* Project edit: permission legend */
.permission-summary-panel {
  padding:1.5rem;
}

.permission-summary-panel h2 {
  margin-bottom:1.1rem;
  font-size:1.05rem;
}

.permission-summary {
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:1.1rem 1.5rem;
}

.permission-summary-icon {
  width:30px;
  height:30px;
  border-radius:var(--r-btn);
}

.permission-summary-icon .icon {
  width:16px;
  height:16px;
}

.permission-summary li strong {
  font-size:.875rem;
}

.permission-summary li p {
  font-size:.8125rem;
}

/* Project edit: permissions table */
.permissions-table th,.permissions-table td {
  padding:.55rem 1rem;
}

.permissions-table thead th {
  font-size:.72rem;
  letter-spacing:.05em;
  background:var(--canvas);
  border-bottom:1px solid var(--line);
}

.permissions-table .perm-cell {
  width:76px;
}

.permissions-table .perm-action {
  width:120px;
}

.perm-check input {
  width:18px;
  height:18px;
  accent-color:var(--accent);
}

.perm-check input:focus-visible {
  outline:2px solid var(--focus-ring);
  outline-offset:2px;
}

.permissions-table .perm-action .btn {
  min-width:84px;
  justify-content:center;
}

/* Project edit: linked folders */
.linked-folder-list {
  list-style:none;
  margin:0;
  padding:0;
  border-top:1px solid var(--line);
}

.linked-folder-row {
  display:flex;
  align-items:center;
  gap:.85rem;
  padding:.75rem 0;
  border-bottom:1px solid var(--line);
}

.linked-folder-row > .icon {
  color:var(--accent);
}

.linked-folder-info {
  flex:1 1 auto;
  min-width:0;
}

.linked-folder-info .muted {
  overflow-wrap:anywhere;
}

.linked-folder-empty {
  margin:0 0 .75rem;
}

.linked-folder-picker {
  margin-top:1rem;
  padding:1.1rem 1.25rem;
  border:1px solid var(--line);
  border-radius:var(--r-panel);
  background:var(--canvas);
}

.linked-folder-picker h3 {
  margin:0 0 .75rem;
  font-size:.95rem;
  font-weight:600;
}

.linked-folder-actions {
  display:flex;
  gap:.5rem;
  justify-content:flex-end;
}

@media(max-width:640px) {
  .linked-folder-row {
    flex-wrap:wrap;
  }
  .linked-folder-info {
    flex-basis:calc(100% - 2.5rem);
  }
}

/* Project edit: rename and lifecycle (destructive action visually separated) */
.lifecycle-panel {
  margin-top:1rem;
  padding:1.1rem 1.5rem;
  border-radius:var(--r-panel);
}

.lifecycle-panel strong {
  font-size:.9rem;
}

.lifecycle-panel .btn {
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-weight:600;
  font-size:.875rem;
  flex:0 0 auto;
}

.lifecycle-danger {
  margin-top:2rem;
  border-color:#e4c3c5;
  border-left:3px solid var(--danger);
}

.lifecycle-danger strong {
  color:var(--danger);
}

/* ==========================================================================
   Projects page (Pages/Index.cshtml, authenticated view) — pj-* components.
   Cards and List share one markup; [data-view] on .pj-collection switches layout.
   ========================================================================== */
.pj-new {
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-weight:600;
}

.pj-new .icon {
  width:16px;
  height:16px;
  fill:currentColor;
}

.pj-bar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.75rem 1rem;
  margin:1.1rem 0 1.4rem;
}

.pj-segment {
  display:inline-flex;
  gap:2px;
  padding:3px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-btn);
}

.pj-segment a,.pj-segment button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:0 .9rem;
  border:0;
  border-radius:calc(var(--r-btn) - 3px);
  background:transparent;
  color:var(--muted);
  font-size:.85rem;
  font-weight:600;
  text-decoration:none;
  cursor:pointer;
}

.pj-segment a:hover,.pj-segment button:hover {
  color:var(--ink);
  background:var(--canvas);
}

.pj-segment a.is-active,.pj-segment button[aria-pressed="true"] {
  background:var(--accent-soft);
  color:var(--accent);
}

.pj-view button {
  width:34px;
  padding:0;
}

.pj-view .icon {
  width:16px;
  height:16px;
  fill:currentColor;
}

.pj-search {
  display:flex;
  align-items:center;
  gap:.5rem;
  flex:1 1 220px;
  max-width:360px;
  min-height:var(--tap);
  padding:0 .75rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-btn);
  color:var(--muted);
}

.pj-search .icon {
  width:16px;
  height:16px;
  fill:currentColor;
  flex:none;
}

.pj-search input {
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--ink);
  font-size:.9rem;
}

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

.pj-count {
  margin-left:auto;
  color:var(--muted);
  font-size:.8rem;
}

.pj-collection {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  gap:.8rem;
}

.pj-group {
  grid-column:1 / -1;
  margin:.4rem 0 0;
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--muted);
}

.pj-group:not(:first-child) {
  margin-top:1.2rem;
}

.pj-group[hidden],.pj-item[hidden] {
  display:none;
}

.pj-item {
  position:relative;
  display:flex;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-panel);
}

.pj-item:hover,.pj-item:focus-within {
  border-color:var(--accent);
  box-shadow:0 4px 14px #183f3b0d;
}

.pj-item.is-archived {
  background:var(--canvas);
}

.pj-link {
  flex:1;
  min-width:0;
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  column-gap:.8rem;
  align-content:start;
  padding:.95rem 5rem .95rem 1rem;
  color:var(--ink);
  text-decoration:none;
  border-radius:var(--r-panel);
}

.pj-link:hover {
  color:var(--ink);
}

.pj-icon {
  grid-column:1;
  grid-row:1;
  width:24px;
  height:24px;
  fill:var(--accent);
}

.is-archived .pj-icon {
  fill:var(--muted);
}

.pj-name {
  grid-column:2;
  font-size:1rem;
  font-weight:600;
  line-height:24px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.pj-desc {
  grid-column:2;
  margin-top:.25rem;
  color:var(--muted);
  font-size:.83rem;
  line-height:1.4;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.pj-meta {
  grid-column:2;
  margin-top:.55rem;
  color:var(--muted);
  font-size:.75rem;
}

.pj-actions {
  position:absolute;
  top:.5rem;
  right:.5rem;
  display:flex;
  align-items:center;
  gap:.2rem;
  z-index:2;
}

.pj-actions form {
  margin:0;
}

.pj-pin,.pj-actions .pj-menu summary {
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  padding:0;
  border:0;
  border-radius:var(--r-btn);
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  list-style:none;
}

.pj-pin .icon,.pj-menu summary .icon {
  width:16px;
  height:16px;
}

.pj-pin .icon {
  fill:none;
  stroke:currentColor;
  stroke-width:1.6;
}

.pj-pin.is-pinned {
  color:var(--accent);
}

.pj-pin.is-pinned .icon {
  fill:currentColor;
  stroke:none;
}

.pj-menu summary .icon {
  fill:currentColor;
}

.pj-pin:hover,.pj-actions .pj-menu summary:hover {
  background:var(--accent-soft);
  color:var(--accent);
}

.pj-actions .status-badge {
  flex-shrink:0;
  margin-right:.2rem;
  white-space:nowrap;
}

.pj-actions .pj-menu summary {
  border:0;
}

.pj-actions .action-menu .text-danger {
  color:var(--danger);
}

.pj-actions .action-menu form {
  margin:0;
}

.pj-empty .icon {
  width:28px;
  height:28px;
  fill:var(--muted);
}

/* List mode: one bordered table-like surface, one row per project. */
.pj-collection[data-view="list"] {
  display:block;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-panel);
  overflow:visible;
}

.pj-collection[data-view="list"] .pj-group {
  padding:.7rem 1rem .4rem;
  margin:0;
  background:var(--canvas);
  border-bottom:1px solid var(--line);
}

.pj-collection[data-view="list"] .pj-group:first-child {
  border-radius:var(--r-panel) var(--r-panel) 0 0;
}

.pj-collection[data-view="list"] .pj-item {
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  box-shadow:none;
}

.pj-collection[data-view="list"] .pj-item:last-child {
  border-bottom:0;
  border-radius:0 0 var(--r-panel) var(--r-panel);
}

.pj-collection[data-view="list"] .pj-item:hover,.pj-collection[data-view="list"] .pj-item:focus-within {
  background:var(--accent-soft);
}

.pj-collection[data-view="list"] .pj-link {
  grid-template-columns:24px minmax(0,2fr) minmax(0,3fr) 9.5rem;
  align-items:center;
  padding:.65rem 5.5rem .65rem 1rem;
}

.pj-collection[data-view="list"] .pj-icon,.pj-collection[data-view="list"] .pj-name,.pj-collection[data-view="list"] .pj-desc,.pj-collection[data-view="list"] .pj-meta {
  grid-row:1;
  margin:0;
}

.pj-collection[data-view="list"] .pj-name {
  grid-column:2;
  padding-right:1rem;
}

.pj-collection[data-view="list"] .pj-desc {
  grid-column:3;
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding-right:1rem;
}

.pj-collection[data-view="list"] .pj-meta {
  grid-column:4;
  white-space:nowrap;
}

.pj-collection[data-view="list"] .pj-actions {
  top:50%;
  transform:translateY(-50%);
}

@media (max-width: 800px) {
  .pj-search {
    flex-basis:100%;
    max-width:none;
    order:3;
  }

  .pj-count {
    margin-left:0;
  }

  .pj-view {
    margin-left:auto;
  }

  .pj-collection {
    grid-template-columns:1fr;
  }

  .pj-collection[data-view="list"] .pj-link {
    grid-template-columns:24px minmax(0,1fr);
    padding:.75rem 5.5rem .75rem 1rem;
  }

  .pj-collection[data-view="list"] .pj-name,.pj-collection[data-view="list"] .pj-meta {
    grid-column:2;
  }

  .pj-collection[data-view="list"] .pj-meta {
    grid-row:2;
    margin-top:.15rem;
  }

  .pj-collection[data-view="list"] .pj-desc {
    display:none;
  }
}

/* Phase 3A — official Carbon pin icon, breadcrumbs, project tabs, file toolbar */
.pj-pin .icon,.pj-pin.is-pinned .icon {
  fill:currentColor;
  stroke:none;
}

.pin-btn {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  min-width:36px;
  min-height:36px;
  padding:0;
  color:var(--muted);
}

.pin-btn .icon {
  width:20px;
  height:20px;
}

.pin-btn:focus-visible,.overflow-menu summary:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.overflow-menu summary {
  width:36px;
  height:36px;
}

.overflow-menu summary .icon {
  width:20px;
  height:20px;
  fill:currentColor;
}

.project-heading .breadcrumbs {
  margin:0 0 .5rem;
  gap:.25rem;
  font-size:.82rem;
}

.breadcrumbs a {
  padding:.1rem .15rem;
  border-radius:4px;
}

.breadcrumbs a:hover {
  text-decoration:underline;
}

.breadcrumbs a:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}

.breadcrumbs [aria-current="page"] {
  color:var(--ink);
  font-weight:600;
  padding:.1rem .15rem;
}

.breadcrumbs .crumb-sep {
  width:16px;
  height:16px;
  flex-shrink:0;
  fill:currentColor;
  color:var(--muted);
}

.project-tabs {
  align-items:center;
  gap:.25rem;
  scrollbar-width:thin;
}

.project-tabs .tab-sep {
  width:1px;
  height:18px;
  margin:0 .35rem;
  background:var(--line);
  flex-shrink:0;
}

.project-tabs a {
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:0 .85rem;
  border-radius:var(--r-btn,6px);
  border-color:transparent;
  font-weight:500;
}

.project-tabs a:hover {
  background:var(--accent-soft);
  color:var(--accent);
}

.project-tabs a:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.project-tabs a.active,.project-tabs a[aria-current="page"] {
  background:var(--accent-soft);
  color:var(--accent);
  font-weight:600;
}

.file-toolbar {
  align-items:center;
  gap:.75rem 1rem;
  padding:.75rem 0;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  margin:.5rem 0 1rem;
}

.toolbar-actions {
  gap:.5rem;
}

.tb-btn {
  justify-content:center;
}

.tb-btn .icon {
  flex-shrink:0;
  fill:currentColor;
}

.tb-btn:focus-visible,.file-filters .form-select:focus-visible,.file-filters .btn:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

@media(max-width:760px) {
  .file-toolbar {
    align-items:stretch;
  }
  .toolbar-actions {
    width:100%;
  }
  .toolbar-actions .tb-btn {
    flex:1 1 calc(50% - .5rem);
    min-height:44px;
  }
  .toolbar-actions #uploadFilesBtn {
    flex-basis:100%;
  }
  .file-filters .form-select,.file-filters .btn {
    min-height:44px;
  }
  .file-filters .form-select {
    flex:1 1 40%;
  }
  .project-tabs a {
    min-height:44px;
  }
  .pin-btn,.overflow-menu summary {
    width:44px;
    height:44px;
  }
}

/* Phase 3A final refinement: search field wide enough for the German placeholder */
.file-filters .search-box {
  flex:1 1 280px;
  min-width:260px;
  max-width:360px;
}

.file-filters .search-box input {
  min-width:0;
  text-overflow:ellipsis;
}

@media(max-width:760px) {
  .file-filters .search-box {
    flex:1 1 100%;
    min-width:0;
    max-width:none;
  }
}

/* Phase 3B — file table, file-type presentation, sortable headers, action menu, rename dialog */
.file-table-head,.file-row {
  grid-template-columns:minmax(250px,1fr) 78px 88px minmax(84px,150px) 148px 40px;
  gap:.75rem 1rem;
}

.file-row {
  min-height:48px;
  padding-top:.5rem;
  padding-bottom:.5rem;
  transition:background-color .12s ease;
}

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

.file-table-head .sort-link {
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  color:inherit;
  text-decoration:none;
}

.file-table-head .sort-link:hover,.file-table-head .sort-link.is-active {
  color:var(--ink);
}

.file-table-head .sort-link:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
  border-radius:3px;
}

.file-table-head .sort-link .icon {
  width:12px;
  height:12px;
}

.file-name {
  gap:.75rem;
}

.file-icon {
  width:30px;
  height:30px;
  border-radius:4px;
}

.file-icon .icon {
  width:18px;
  height:18px;
}

.file-icon.dxf,.file-icon.ifc,.file-icon.rvt {
  font-size:.58rem;
  font-weight:700;
}

.file-icon.dxf {
  background:#e6e8f5;
  color:#3f4a9e;
}

.file-icon.ifc {
  background:#e0f0f4;
  color:#1f6b80;
}

.file-icon.rvt {
  background:#f5e6ee;
  color:#9a3a67;
}

.type-badge {
  display:inline-block;
  min-width:2.6rem;
  padding:.12rem .45rem;
  border-radius:3px;
  background:#edf1f0;
  color:var(--ink);
  font-size:.68rem;
  font-weight:700;
  letter-spacing:.04em;
  text-align:center;
  line-height:1.35;
}

.type-badge.kind-pdf {
  background:#f7e3e0;
  color:#8f3424;
}

.type-badge.kind-image {
  background:#e2ecf5;
  color:#24547b;
}

.type-badge.kind-dwg {
  background:#e7e2f2;
  color:#4f3590;
}

.type-badge.kind-dxf {
  background:#e6e8f5;
  color:#38428f;
}

.type-badge.kind-ifc {
  background:#e0f0f4;
  color:#195c70;
}

.type-badge.kind-rvt {
  background:#f5e6ee;
  color:#85305a;
}

.type-badge.kind-pln {
  background:#e2f0e6;
  color:#215f3a;
}

.type-badge.kind-pla {
  background:#def0ee;
  color:#17655d;
}

.type-label {
  font-size:.76rem;
}

.file-size,.file-modified {
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.file-version {
  display:flex;
  align-items:center;
  gap:.5rem;
  min-width:0;
}

.version-tag {
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  color:var(--ink);
  font-weight:600;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.version-tag .icon {
  width:14px;
  height:14px;
  color:var(--muted);
}

.version-note {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

.quick-work-chip-icon.icon {
  width:14px;
  height:14px;
}

.file-actions summary {
  display:inline-grid;
  place-items:center;
  width:32px;
  height:32px;
  border-radius:4px;
  letter-spacing:0;
}

.file-actions summary .icon {
  width:20px;
  height:20px;
}

.file-actions summary:hover,.file-actions details[open]>summary {
  background:var(--accent-soft);
  color:var(--accent);
}

.file-actions summary:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}

.file-actions .action-menu {
  top:2.25rem;
  min-width:210px;
  padding:.35rem;
  text-align:left;
  box-shadow:0 8px 24px #183f3b22;
}

.file-actions .action-menu form {
  margin:0;
}

.file-actions .action-menu a,.file-actions .action-menu button {
  display:flex;
  align-items:center;
  gap:.6rem;
  min-height:34px;
  white-space:nowrap;
  font-size:.82rem;
  cursor:pointer;
}

.file-actions .action-menu .icon {
  width:16px;
  height:16px;
  color:var(--muted);
}

.file-actions .action-menu .danger .icon {
  color:var(--danger);
}

.file-actions .action-menu a:focus-visible,.file-actions .action-menu button:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:-2px;
}

.action-menu-sep {
  height:1px;
  margin:.3rem .2rem;
  background:var(--line);
}

#fileListRegion .compact-dialog input.form-control {
  width:100%;
}

@media(max-width:800px) {
  .file-row {
    grid-template-columns:minmax(0,1fr) 40px;
    gap:.5rem;
  }
  .file-size,.file-version,.file-modified {
    display:none;
  }
}

/* Phase 3C — linked folders, upload interface, responsive file rows, toolbar grouping */
.file-toolbar {
  justify-content:flex-start;
}

.file-toolbar .file-filters {
  flex:1 1 auto;
  flex-wrap:wrap;
  justify-content:flex-end;
  min-width:0;
}

.file-filters .search-box {
  flex:1 1 220px;
  min-width:180px;
  max-width:360px;
}

.file-filters .filter-group {
  display:flex;
  align-items:center;
  flex:0 0 auto;
  flex-wrap:nowrap;
  gap:.5rem;
}

.file-filters .filter-group .btn {
  flex:0 0 auto;
  white-space:nowrap;
}

@media(max-width:1180px) {
  .file-toolbar .file-filters {
    flex-basis:100%;
    justify-content:flex-start;
    margin-left:0;
    padding-left:0;
    border-left:0;
  }
}

@media(max-width:760px) {
  .file-filters .filter-group {
    flex:1 1 100%;
  }
  .file-filters .filter-group .form-select {
    flex:1 1 0;
    min-width:0;
  }
}

.file-row .file-name>span:nth-of-type(2),.file-row .file-name>a {
  min-width:0;
}

/* Upload overlay */
.upload-drop-overlay-inner {
  border-radius:8px;
}

.upload-drop-icon {
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  margin:0 auto .8rem;
  border-radius:50%;
  background:var(--accent-soft);
  font-size:inherit;
}

.upload-drop-icon .icon {
  width:26px;
  height:26px;
  fill:currentColor;
}

/* Upload queue */
.upload-queue-panel {
  border-radius:8px;
}

.upload-queue-header:focus-visible,.upload-queue-link:focus-visible,.upload-item-btn:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:-2px;
}

.upload-queue-chevron {
  display:inline-grid;
  place-items:center;
  transform:rotate(180deg);
}

.upload-queue-chevron .icon {
  width:16px;
  height:16px;
  fill:currentColor;
}

.upload-queue-header[aria-expanded="false"] .upload-queue-chevron {
  transform:none;
}

.upload-queue-link {
  min-height:32px;
  padding:.2rem .3rem;
  border-radius:4px;
}

.upload-queue-link:hover {
  background:var(--accent-soft);
}

.upload-queue-item {
  border-left:3px solid transparent;
  padding:.7rem .9rem .7rem calc(.9rem - 3px);
}

.upload-queue-item.status-uploading,.upload-queue-item.status-processing,.upload-queue-item.status-finalizing {
  border-left-color:var(--accent);
}

.upload-queue-item.status-complete {
  border-left-color:#3f9c68;
}

.upload-queue-item.status-failed {
  border-left-color:var(--danger);
  background:#fdf5f4;
}

.upload-queue-item.status-conflict,.upload-queue-item.status-versionConflict {
  border-left-color:#9b751d;
}

.upload-item-name {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.3;
}

.upload-item-meta {
  font-size:.74rem;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.upload-item-status {
  font-weight:600;
}

.upload-item-bar {
  height:6px;
  border-radius:3px;
}

.upload-item-bar-fill {
  border-radius:3px;
}

.upload-item-btn {
  min-height:32px;
  padding:.25rem .65rem;
  font-size:.74rem;
  border-radius:4px;
}

@media(max-width:800px) {
  .upload-item-btn,.upload-queue-link {
    min-height:44px;
  }
  .upload-queue-header {
    min-height:48px;
  }
  .upload-queue-list {
    max-height:45vh;
  }
}

/* Responsive file rows (tablet / mobile): name + action on line one, type / size / version / date on line two */
@media(max-width:800px) {
  .file-row {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.15rem .85rem;
    padding:.6rem .85rem;
  }
  .file-row .file-name {
    order:1;
    flex:1 1 calc(100% - 56px);
    min-width:0;
    flex-wrap:wrap;
  }
  .file-row .file-actions {
    order:2;
    flex:0 0 44px;
    display:flex;
    justify-content:center;
  }
  .file-row .file-type,.file-row .file-meta {
    order:3;
    display:block;
    font-size:.74rem;
    min-width:0;
  }
  .file-row .file-type {
    margin-left:calc(30px + .75rem);
  }
  .file-row .file-version {
    display:flex;
    flex:1 1 auto;
    max-width:100%;
  }
  .file-actions summary {
    width:44px;
    height:44px;
  }
  .file-actions .action-menu {
    top:2.9rem;
    max-width:calc(100vw - 1.5rem);
  }
  .file-actions .action-menu a,.file-actions .action-menu button {
    min-height:44px;
  }
}

@media(max-width:800px) {
  #fileListRegion .file-list {
    overflow-x:clip;
  }
}

.file-actions summary:focus-visible,.file-row .file-name a:focus-visible,.sort-link:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

/* Phase M1 — mobile foundations + Project Files workspace.
   Card rows and the stacked project header start at 1120px: below that the Files table (min ~800px) no longer fits beside the sidebar.
   Phone-only behavior (toolbar stack, bottom-sheet menus, 44px targets) starts at 800px. Desktop above 1120px is unchanged. */
.file-meta-group {
  display:contents;
}

.project-tabs {
  position:relative;
}

@media(max-width:1120px) {
  /* Project header: breadcrumbs / title + pin + overflow / description / tabs, all inside the page width */
  .project-heading {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    align-items:center;
    gap:0;
  }
  .project-heading>div:first-child,.project-heading-actions {
    display:contents;
  }
  .project-heading .breadcrumbs {
    grid-column:1 / -1;
    grid-row:1;
    min-width:0;
  }
  .project-heading h1 {
    grid-column:1;
    grid-row:2;
    min-width:0;
    margin:.1rem 0;
    overflow-wrap:anywhere;
  }
  .project-heading>div:first-child>p {
    grid-column:1 / -1;
    grid-row:3;
    margin:.15rem 0 0;
    overflow-wrap:anywhere;
  }
  .project-heading-actions>form {
    grid-column:2;
    grid-row:2;
    margin-left:.25rem;
  }
  .project-heading-actions>.overflow-menu {
    grid-column:3;
    grid-row:2;
    margin-left:.25rem;
  }
  .project-heading-actions>.project-tabs {
    grid-column:1 / -1;
    grid-row:4;
    display:flex;
    flex-wrap:nowrap;
    width:auto;
    margin:.85rem calc(-1 * var(--pad)) 0;
    padding:0 var(--pad);
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-padding-inline:var(--pad);
  }
  .project-tabs a {
    min-height:44px;
  }
  .pin-btn,.overflow-menu summary {
    width:44px;
    height:44px;
  }

  /* File rows: name + actions on line one, type / size / version / date on line two */
  .file-table-head {
    display:none;
  }
  .file-list .file-row {
    --file-indent:calc(30px + .75rem);
    display:grid;
    grid-template-columns:minmax(0,1fr) 44px;
    grid-template-areas:"name actions" "meta meta";
    align-items:start;
    gap:.1rem .5rem;
    padding:.5rem .85rem .75rem;
    font-size:.95rem;
  }
  .file-list .file-row:has(.file-actions:empty) {
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"name" "meta";
  }
  .file-list .file-row:has(.file-actions:empty) .file-actions {
    display:none;
  }
  .file-row .file-name {
    grid-area:name;
    order:0;
    position:relative;
    display:flex;
    flex-wrap:wrap;
    align-content:center;
    align-items:center;
    gap:.3rem .45rem;
    min-width:0;
    min-height:44px;
    padding-left:var(--file-indent);
  }
  .file-row .file-name .file-icon {
    position:absolute;
    left:0;
    top:7px;
  }
  .file-row .file-name>a,.file-row .file-name>.file-icon+span {
    flex:1 1 100%;
    min-width:0;
    font-size:1rem;
    line-height:1.35;
    overflow-wrap:anywhere;
  }
  .file-row .quick-work-chip {
    min-height:44px;
    font-size:.8rem;
  }
  .file-row .file-actions {
    grid-area:actions;
    order:0;
    display:flex;
    justify-content:center;
    align-self:start;
    flex:none;
  }
  .file-actions summary {
    width:44px;
    height:44px;
  }
  .file-row .file-meta-group {
    grid-area:meta;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.2rem .9rem;
    min-width:0;
    padding-left:var(--file-indent);
  }
  .file-row .file-meta-group .file-type,.file-row .file-meta-group .file-meta {
    display:block;
    order:0;
    margin:0;
    min-width:0;
    font-size:.8rem;
    line-height:1.4;
  }
  .file-row .file-meta-group .file-size,.file-row .file-meta-group .file-modified {
    white-space:nowrap;
  }
  .file-row .file-meta-group .file-meta.file-version {
    display:contents;
  }
  .file-row .file-meta-group .version-note {
    flex:1 1 100%;
    order:9;
    font-size:.8rem;
    line-height:1.4;
  }
  .file-row .file-meta-group .file-meta.is-empty {
    display:none;
  }
}

@media(max-width:800px) {
  /* Shared foundation */
  .workspace {
    padding-bottom:calc(32px + env(safe-area-inset-bottom));
  }
  .workspace h1,.workspace h2 {
    overflow-wrap:anywhere;
  }
  .project-heading h1 {
    font-size:1.5rem;
    line-height:1.2;
  }
  .compact-dialog input,.compact-dialog select,.compact-dialog textarea {
    font-size:1rem;
  }
  .dialog-actions {
    flex-wrap:wrap;
  }
  .dialog-actions .btn {
    flex:1 1 auto;
    min-height:44px;
  }

  /* Breadcrumbs: wrap, never wider than the page; one oversized crumb truncates */
  .project-heading .breadcrumbs {
    gap:0 .1rem;
    margin:0 0 .15rem;
    font-size:.875rem;
  }
  .project-heading .breadcrumbs a,.project-heading .breadcrumbs [aria-current="page"] {
    max-width:100%;
    padding:.7rem .3rem;
    line-height:1.3;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .project-tabs {
    scrollbar-width:none;
  }
  .project-tabs::-webkit-scrollbar {
    display:none;
  }

  /* Files toolbar: Upload full width, secondary actions in two columns, search and filters full width */
  .file-toolbar {
    flex-direction:column;
    align-items:stretch;
    gap:.75rem;
  }
  .file-toolbar .toolbar-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.5rem;
    width:100%;
  }
  .toolbar-actions #uploadFilesBtn {
    grid-column:1 / -1;
    min-height:48px;
    font-size:1rem;
  }
  .toolbar-actions .tb-btn {
    flex:none;
    height:auto;
    min-height:44px;
    padding:.45rem .6rem;
    white-space:normal;
    text-align:center;
    line-height:1.2;
  }
  .file-toolbar .file-filters {
    flex:none;
    flex-direction:column;
    align-items:stretch;
    gap:.5rem;
    width:100%;
    margin:0;
    padding:0;
    border:0;
  }
  .file-filters .search-box {
    flex:none;
    width:100%;
    max-width:none;
    min-width:0;
    height:48px;
  }
  .file-filters .search-box input {
    font-size:1rem;
  }
  .file-filters .filter-group {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    flex:none;
    gap:.5rem;
    width:100%;
  }
  .file-filters .filter-group .form-select {
    width:100%;
    height:48px;
    font-size:1rem;
    text-overflow:ellipsis;
  }
  .file-filters .filter-group .btn {
    grid-column:1 / -1;
    width:100%;
    height:48px;
    font-size:1rem;
  }
  .drop-hint {
    display:none;
  }

  /* Menus: a bottom sheet that always fits the viewport; the dim layer closes it (it belongs to the summary) */
  .file-actions details[open]>summary::before,.overflow-menu[open]>summary::before {
    content:"";
    position:fixed;
    inset:0;
    z-index:1030;
    background:rgba(36,50,56,.4);
  }
  .file-actions details>.action-menu,.overflow-menu>.action-menu {
    position:fixed;
    left:.75rem;
    right:.75rem;
    bottom:calc(.75rem + env(safe-area-inset-bottom));
    top:auto;
    width:auto;
    min-width:0;
    max-width:none;
    max-height:min(75vh,calc(100dvh - 2rem));
    overflow-y:auto;
    overscroll-behavior:contain;
    z-index:1031;
    padding:.5rem;
    border-radius:var(--r-pop);
    box-shadow:var(--shadow-pop);
  }
  .file-actions .action-menu a,.file-actions .action-menu button,.overflow-menu .action-menu a,.overflow-menu .action-menu button {
    display:flex;
    align-items:center;
    gap:.75rem;
    min-height:48px;
    padding:.5rem .75rem;
    font-size:1rem;
    white-space:normal;
  }
  .file-actions .action-menu .icon,.overflow-menu .action-menu .icon {
    width:20px;
    height:20px;
  }
}

@media(max-width:1120px) {
  /* Linked folders: same card pattern, icon-only 44px download */

}

@media(max-width:420px) {
  .file-filters .filter-group {
    grid-template-columns:minmax(0,1fr);
  }
}

/* Phase M1 final polish — file card hierarchy, sheet context, quieter tab scroller (mobile only) */
.sheet-title {
  display:none;
}

@media(max-width:1120px) {
  .project-tabs {
    scrollbar-width:thin;
    scrollbar-color:var(--line) transparent;
  }
  .project-tabs::-webkit-scrollbar {
    height:4px;
  }
  .project-tabs::-webkit-scrollbar-track {
    background:transparent;
  }
  .project-tabs::-webkit-scrollbar-thumb {
    background:var(--line);
    border-radius:2px;
  }

  /* Meta line: a quiet divider under the name, fixed rhythm for type / size / version / date */
  .file-row .file-meta-group {
    margin-top:.15rem;
    padding-top:.45rem;
    border-top:1px solid var(--line);
    gap:.25rem .85rem;
  }
  .file-row .file-meta-group .file-type,.file-row .file-meta-group .file-meta {
    font-size:.82rem;
    color:var(--muted);
  }
  .file-row .file-meta-group .file-size {
    color:var(--ink);
    font-weight:500;
  }
  /* Start / finish editing: a labelled pill under the name instead of a lone pencil */
  .file-row .quick-work-action {
    display:contents;
  }
  .file-row .quick-work-chip {
    min-height:36px;
    margin-top:.15rem;
    padding:.3rem .8rem;
    font-size:.85rem;
  }
}

@media(max-width:800px) {
  .file-row .quick-work-chip-label {
    position:static;
    width:auto;
    height:auto;
    overflow:visible;
    clip:auto;
    white-space:normal;
  }
  .file-row .quick-work-chip {
    padding:.3rem .8rem;
  }
  .sheet-title {
    display:block;
    position:sticky;
    top:-.5rem;
    z-index:1;
    margin:-.5rem -.5rem .35rem;
    padding:.85rem 1rem .65rem;
    background:var(--surface,#fff);
    border-bottom:1px solid var(--line);
    border-radius:var(--r-pop) var(--r-pop) 0 0;
    color:var(--ink);
    font-size:.95rem;
    font-weight:600;
    line-height:1.3;
    overflow-wrap:anywhere;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
  }
}

/* =====================================================================================================================
   Phase M2 — design consistency + responsive completion for project and daily workspaces (2026-10-13).
   Shared components first (page actions, data tables, comments, forms, notices, companion cards), then breakpoints.
   Colors come from tokens.css and the existing status-badge palette; no new brand colors. Desktop of approved pages
   (Files, Projects list, Users, Project Access) is not restyled here.
   ===================================================================================================================== */

/* ---- Card grids never force a column wider than the content box (was minmax(270/280px,1fr)) ------------------------ */
.pj-collection {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr));
}

.project-grid {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));
}

/* ---- Page header (non-project): breadcrumbs, action group ------------------------------------------------------- */
.page-heading>div:first-child {
  min-width:0;
}

.page-heading.is-top {
  align-items:flex-start;
}

.page-heading:not(.project-heading) .breadcrumbs {
  margin:0 0 .5rem;
}

.crumb-sep {
  width:14px;
  height:14px;
  color:var(--border-strong);
}

.page-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:.6rem;
}

.page-actions form {
  margin:0;
}

.inline-form {
  display:inline;
}

/* ---- Search box with Carbon icon (companion toolbars, Search page) ---------------------------------------------- */
.search-box .icon {
  width:16px;
  height:16px;
}

.search-page-form {
  margin:0 0 1.1rem;
  padding:0;
  border:0;
  max-width:640px;
}

.search-page-form .search-box {
  flex:1 1 260px;
  height:44px;
}

.search-result-icon {
  display:grid;
  place-items:center;
  width:1.5rem;
}

.search-result-icon .icon {
  width:18px;
  height:18px;
}

/* ---- Pagination with Carbon chevrons ---------------------------------------------------------------------------- */
.pagination-bar .btn {
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-weight:600;
}

.pagination-bar .btn .icon {
  width:16px;
  height:16px;
}

/* ---- Data tables (Activity, Recycle bin, Versions, admin tables) ------------------------------------------------ */
.data-panel {
  padding:.35rem 1rem;
}

.data-table {
  --bs-table-bg:transparent;
  width:100%;
  margin:0;
}

.data-table thead th {
  padding:.75rem .85rem;
  border-bottom:1px solid var(--line);
  background:transparent;
  color:var(--muted);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  white-space:nowrap;
}

.data-table td {
  padding:.7rem .85rem;
  border-color:var(--line);
  font-size:.875rem;
  vertical-align:middle;
  overflow-wrap:anywhere;
}

.data-table tbody tr:last-child td {
  border-bottom:0;
}

.data-table .cell-muted {
  color:var(--muted);
}

.data-table .cell-select {
  width:2.75rem;
}

.data-table input[type="checkbox"] {
  width:18px;
  height:18px;
  accent-color:var(--accent);
}

.row-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.4rem;
}

.row-actions form {
  margin:0;
}

.row-actions .btn {
  white-space:nowrap;
}

/* ---- Comments (Discussion, file comments) ----------------------------------------------------------------------- */
.collaboration-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:1.25rem;
  align-items:start;
}

.comment-composer {
  margin-bottom:1rem;
}

.comment-composer .form-label {
  font-size:.8rem;
  font-weight:600;
}

.comment-composer textarea {
  min-height:88px;
  resize:vertical;
}

.comment-composer .dialog-actions {
  margin-top:.75rem;
}

.comment-list {
  display:flex;
  flex-direction:column;
  gap:.7rem;
}

.comment-card {
  padding:.9rem 1.05rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-panel);
}

.comment-head {
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:.15rem .75rem;
}

.comment-head strong {
  font-size:.9rem;
  font-weight:600;
}

.comment-head time {
  color:var(--muted);
  font-size:.76rem;
}

.comment-card>p {
  margin:.45rem 0 0;
  font-size:.92rem;
  line-height:1.5;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.comment-actions {
  margin-top:.6rem;
  padding-top:.2rem;
  border-top:1px solid var(--line);
}

.comment-actions summary {
  display:flex;
  align-items:center;
  min-height:var(--tap);
  color:var(--accent);
  font-size:.8rem;
  font-weight:600;
  cursor:pointer;
  list-style:none;
}

.comment-actions summary::-webkit-details-marker {
  display:none;
}

.comment-actions summary:hover {
  text-decoration:underline;
}

.comment-actions textarea {
  min-height:72px;
}

.members-panel {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.45rem;
}

.members-panel h2 {
  flex:1 1 100%;
  margin:0 0 .35rem;
}

/* ---- Forms and notices (project Share, simple admin forms) ------------------------------------------------------ */
.stack-form {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));
  gap:1rem;
  align-items:end;
}

.stack-form label {
  display:flex;
  flex-direction:column;
  gap:.35rem;
  font-size:.8rem;
  font-weight:600;
}

.stack-form-actions {
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
}

.notice-panel {
  margin-top:1rem;
  padding:1rem 1.1rem;
  background:var(--accent-soft);
  border:1px solid var(--accent);
  border-radius:var(--r-panel);
}

.notice-panel input {
  font-family:var(--font-mono);
  font-size:.82rem;
}

.member-row {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:.5rem 1rem;
  padding:.75rem 0;
  border-top:1px solid var(--line);
}

.member-row>span {
  display:flex;
  flex-direction:column;
  gap:.15rem;
  min-width:0;
}

.member-row small {
  color:var(--muted);
  font-size:.78rem;
}

.member-row form {
  margin:0;
}

/* ---- Companion cards: plan sets, issues, transmittals (aligned with the status-badge palette) ------------------- */
.companion-card {
  padding:.8rem 1rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-panel);
  color:var(--ink);
}

.companion-card.is-current {
  background:var(--surface);
  border-color:var(--line);
  color:var(--ink);
  box-shadow:inset 3px 0 0 #3f9c68;
}

.companion-card.is-stale {
  background:#faf3e3;
  border-color:#eadfc4;
  color:var(--ink);
  box-shadow:inset 3px 0 0 #c99a2e;
}

.companion-card.is-recycled {
  background:#fbfcfc;
  border-color:var(--line);
  color:var(--muted);
}

.companion-card-title {
  font-size:.92rem;
  overflow-wrap:anywhere;
}

.companion-card-meta {
  color:var(--muted);
  opacity:1;
  overflow-wrap:anywhere;
}

.companion-card-actions form {
  margin:0;
}

.companion-status-badge {
  display:inline-flex;
  align-items:center;
  padding:.2rem .6rem;
  border-radius:20px;
  background:#eef1f0;
  color:var(--muted);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:0;
  text-transform:none;
  opacity:1;
}

.companion-card.is-current .companion-status-badge {
  background:var(--accent-soft);
  color:var(--accent);
}

.companion-card.is-stale .companion-status-badge {
  background:#f8edcf;
  color:#8a6d1d;
}

.issue-status-badge {
  margin-left:0;
  padding:.2rem .6rem;
  border-radius:20px;
  font-size:.72rem;
  letter-spacing:0;
  text-transform:none;
}

.issue-status-badge.is-issued {
  background:var(--accent-soft);
  border-color:var(--accent-soft);
  color:var(--accent);
}

h1 .issue-status-badge,.page-heading .issue-status-badge {
  margin-left:0;
  vertical-align:middle;
}

.companion-panel>a.companion-card {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  column-gap:.75rem;
  align-items:center;
  text-decoration:none;
}

.companion-panel>a.companion-card>* {
  grid-column:1 / -1;
}

.companion-panel>a.companion-card>.companion-card-title {
  grid-column:1;
  grid-row:1;
}

.companion-panel>a.companion-card>.issue-status-badge,.companion-panel>a.companion-card>.companion-status-badge {
  grid-column:2;
  grid-row:1;
  justify-self:end;
  margin:0;
}

.companion-panel>a.companion-card:hover {
  border-color:var(--accent);
  box-shadow:0 4px 14px #183f3b0d;
}

.companion-panel>a.companion-card.is-stale:hover,.companion-panel>a.companion-card.is-current:hover {
  border-color:var(--accent);
}

.companion-panel>a.companion-card .review-count-badge {
  justify-self:start;
  margin-top:.35rem;
}

.companion-panel-solo {
  gap:.2rem;
  padding:1.1rem 1.2rem;
  border-radius:var(--r-panel);
}

.companion-panel-solo>.companion-card-title {
  margin-top:.8rem;
  color:var(--muted);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.companion-panel-solo>.companion-card-title:first-child {
  margin-top:0;
}

.companion-panel-solo p {
  margin:0;
  overflow-wrap:anywhere;
}

.issue-add-actions .btn {
  display:inline-flex;
  align-items:center;
  min-height:var(--tap);
  border-radius:var(--r-btn);
  font-weight:600;
}

/* ---- Tablet: card tables for the wide Versions table, single column grids -------------------------------------- */
@media(max-width:1120px) {
  .stack-wide thead {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
  .stack-wide,.stack-wide tbody,.stack-wide tr,.stack-wide td {
    display:block;
    width:100%;
  }
  .stack-wide tr {
    margin:0 0 .6rem;
    padding:.55rem .75rem;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--r-panel);
  }
  .stack-wide tr:last-child {
    margin-bottom:0;
  }
  .stack-wide td {
    display:grid;
    grid-template-columns:minmax(96px,28%) minmax(0,1fr);
    align-items:start;
    gap:.15rem .75rem;
    padding:.4rem 0;
    border:0;
  }
  .stack-wide td[data-label]::before {
    content:attr(data-label);
    padding-top:.15rem;
    color:var(--muted);
    font-size:.72rem;
    font-weight:600;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .stack-wide td:not([data-label]),.stack-wide td:has(>.row-actions) {
    display:block;
  }
  .stack-wide td:has(>.row-actions) {
    margin-top:.3rem;
    padding-top:.65rem;
    border-top:1px solid var(--line);
  }
  .stack-wide td:has(>.row-actions)::before {
    content:none;
  }
  .stack-wide .row-actions .btn {
    min-height:44px;
  }
}

@media(max-width:900px) {
  .collaboration-layout {
    grid-template-columns:minmax(0,1fr);
  }
  .overview-grid {
    grid-template-columns:minmax(0,1fr);
  }
}

/* ---- Phones ------------------------------------------------------------------------------------------------------ */
@media(max-width:800px) {
  /* Page header: stacked, readable, actions grouped under the title */
  .page-heading:not(.project-heading) {
    flex-direction:column;
    align-items:stretch;
    gap:.75rem;
  }
  .page-heading h1 {
    font-size:1.5rem;
    line-height:1.2;
    overflow-wrap:anywhere;
  }
  .page-heading:not(.project-heading)>.btn {
    align-self:flex-start;
    justify-content:center;
  }
  .page-heading:not(.project-heading)>.btn-primary {
    align-self:stretch;
  }
  .page-heading .page-actions {
    justify-content:flex-start;
    width:100%;
  }
  .page-heading .page-actions>.btn,.page-heading .page-actions>form {
    flex:1 1 auto;
  }
  .page-heading .page-actions>form .btn {
    width:100%;
  }
  .page-heading .btn,.page-actions .btn {
    min-height:44px;
  }
  .page-heading:not(.project-heading) .breadcrumbs {
    gap:0 .1rem;
    margin:0 0 .15rem;
    font-size:.875rem;
  }
  .page-heading:not(.project-heading) .breadcrumbs a,.page-heading:not(.project-heading) .breadcrumbs [aria-current="page"] {
    max-width:100%;
    padding:.7rem .3rem;
    line-height:1.3;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  /* Companion toolbars (plan sets, issues, transmittals): same stack as the Files toolbar */
  .toolbar-actions>.btn-primary:only-child {
    grid-column:1 / -1;
    min-height:48px;
    font-size:1rem;
  }
  .toolbar-actions.muted {
    font-size:.875rem;
  }
  .file-filters>.form-select {
    width:100%;
    height:48px;
    font-size:1rem;
    text-overflow:ellipsis;
  }
  .search-page-form {
    max-width:none;
  }

  /* Card tables */
  .data-panel {
    padding:.6rem;
  }
  .stack-mobile thead {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
  .stack-mobile,.stack-mobile tbody,.stack-mobile tr,.stack-mobile td {
    display:block;
    width:100%;
  }
  .stack-mobile tr {
    margin:0 0 .6rem;
    padding:.55rem .75rem;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--r-panel);
  }
  .stack-mobile tr:last-child {
    margin-bottom:0;
  }
  .stack-mobile td {
    display:grid;
    grid-template-columns:minmax(88px,32%) minmax(0,1fr);
    align-items:start;
    gap:.15rem .75rem;
    padding:.4rem 0;
    border:0;
    font-size:.9rem;
  }
  .stack-mobile td[data-label]::before {
    content:attr(data-label);
    padding-top:.15rem;
    color:var(--muted);
    font-size:.72rem;
    font-weight:600;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .stack-mobile td:not([data-label]),.stack-mobile td:has(>.row-actions) {
    display:block;
  }
  .stack-mobile td:has(>.row-actions) {
    margin-top:.3rem;
    padding-top:.65rem;
    border-top:1px solid var(--line);
  }
  .stack-mobile td:has(>.row-actions)::before {
    content:none;
  }
  .stack-mobile .row-actions .btn {
    min-height:44px;
  }
  .pagination-bar {
    flex-wrap:wrap;
    gap:.6rem;
  }

  /* Comments, forms, share links */
  .comment-card {
    padding:.85rem .9rem;
  }
  .comment-actions .btn {
    min-height:44px;
  }
  .stack-form-actions .btn {
    width:100%;
    min-height:48px;
  }
  .member-row .btn {
    min-height:44px;
  }
  .notice-panel input {
    font-size:1rem;
  }

  /* Cards and lists */
  .companion-card-actions .btn,.issue-add-actions .btn {
    min-height:44px;
  }
  .issue-add-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .issue-add-actions>.btn:only-child {
    grid-column:1 / -1;
  }
  .overview-list li {
    flex-wrap:wrap;
    gap:.25rem .75rem;
  }
  .overview-list li>a {
    flex:1 1 100%;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .overview-list-meta {
    max-width:100%;
    flex:1 1 100%;
    flex-direction:row;
    flex-wrap:wrap;
    justify-content:flex-start;
    gap:.1rem .75rem;
    text-align:left;
  }
  .overview-list-meta span:first-child {
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .overview-list-row {
    flex-wrap:wrap;
  }
  .overview-list-row>a {
    flex:1 1 100%;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .overview-stats {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .overview-stats>.overview-dates,.overview-stats>.status-badge {
    grid-column:1 / -1;
  }
  .stat-value {
    overflow-wrap:anywhere;
  }
  .recent-copy strong {
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .recent-copy small {
    flex-wrap:wrap;
  }
  .planset-candidate-row {
    flex-wrap:wrap;
  }
  .planset-candidate-row select {
    max-width:none;
    width:100%;
  }
  .planset-candidate-list {
    max-height:min(260px,40vh);
  }
  .search-page-filters a {
    min-height:44px;
    display:inline-flex;
    align-items:center;
  }
  .notif-row {
    min-height:56px;
  }
}

@media(max-width:480px) {
  .overview-stats {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .stack-mobile td,.stack-wide td {
    grid-template-columns:minmax(0,1fr);
    gap:.05rem;
  }
}

/* Phase M2 — Drop and Connector: narrow-screen touch targets and wrapping (desktop unchanged) */
@media(max-width:800px) {
  .drop-card {
    padding:1.1rem;
  }
  .drop-btn {
    min-height:48px;
  }
  .drop-project-btn,.drop-folder-btn {
    min-height:44px;
  }
  .drop-file-name,.drop-conflict-row span:first-child {
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .drop-conflict-row {
    flex-wrap:wrap;
  }
  .drop-conflict-row .btn {
    min-height:44px;
  }
  .drop-actions .btn {
    flex:1 1 auto;
    min-height:48px;
  }
  .connector-cta {
    width:100%;
    justify-content:center;
    height:48px;
  }
  .connector-details-grid {
    grid-template-columns:minmax(0,1fr);
    gap:.1rem 0;
  }
  .connector-details-grid dd {
    margin-bottom:.55rem;
  }
}

/* =====================================================================================================================
   Phase M3 — document tools (Preview, Compare, Review) and administration (2026-10-13).
   Desktop of Users / Project Access (12.20) keeps its look; the changes are Carbon controls, token-based surfaces and
   narrow-screen layouts. Viewers keep internal scrolling/zoom; nothing hides page-level overflow.
   ===================================================================================================================== */

/* ---- Shared admin form + table helpers --------------------------------------------------------------------------- */
.form-panel {
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.form-panel.narrow {
  max-width:560px;
}

.form-panel-actions {
  display:flex;
  justify-content:flex-end;
}

.admin-panel p {
  overflow-wrap:anywhere;
}

.data-panel-title {
  margin:.65rem .85rem .35rem;
}

.data-table td.cell-actions .row-actions {
  justify-content:flex-end;
}

.cell-hash {
  font-family:var(--font-mono);
  font-size:.78rem;
  word-break:break-all;
}

.picker-crumbs {
  margin:0 0 .6rem;
  font-size:.85rem;
}

/* ---- Document tools: Carbon controls, tokens instead of ad-hoc fills --------------------------------------------- */
.compare-tool-btn {
  display:inline-grid;
  place-items:center;
  padding:0;
}

.compare-tool-btn .icon {
  width:16px;
  height:16px;
}

.compare-version-vs .icon {
  width:24px;
  height:24px;
}

.preview-header-actions .btn {
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}

.preview-header-actions .btn .icon {
  width:16px;
  height:16px;
}

.preview-lightbox-close {
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
}

.preview-lightbox-close .icon {
  width:28px;
  height:28px;
}

.compare-version-col,.review-version-info,.preview-version-info {
  min-width:min(200px,100%);
}

.review-popover {
  width:min(250px,calc(100% - 1rem));
}

.review-banner-older {
  background:var(--accent-soft);
  border-color:var(--accent-soft);
  color:var(--accent);
}

/* ---- Administration tables: no sideways scrolling below 1120px (cards instead) ------------------------------------ */
@media(max-width:1120px) {
  .users-table {
    min-width:0;
  }
  .users-table-scroll {
    margin:0;
    padding:0;
    overflow:visible;
  }
  .users-table .user-row-actions {
    flex-wrap:wrap;
    justify-content:flex-start;
  }
  .stack-wide td.cell-actions {
    text-align:left;
  }
  .stack-wide td.cell-actions .row-actions {
    justify-content:flex-start;
  }
  .stack-wide td.cell-actions:empty {
    display:none;
  }
  .stack-wide td.users-name {
    font-size:1rem;
  }
}

@media(max-width:800px) {
  .stack-mobile td.cell-actions {
    text-align:left;
  }
  .stack-mobile td.cell-actions .row-actions {
    justify-content:flex-start;
  }
  .stack-mobile td.cell-actions:empty {
    display:none;
  }
  .data-panel-title {
    margin:.2rem .15rem .6rem;
  }
  .form-panel.narrow {
    max-width:none;
  }
  .form-panel-actions .btn {
    width:100%;
    min-height:48px;
  }

  /* Users: role select grows, 44px controls */
  .users-table .role-form {
    flex:1 1 220px;
  }
  .users-table .role-form .form-select {
    flex:1;
    width:100%;
    min-height:44px;
    font-size:1rem;
  }
  .users-table .btn-role-save,.users-table .overflow-menu summary {
    width:44px;
    height:44px;
  }
  .users-table .user-row-actions .btn {
    min-height:44px;
  }

  /* Linked folder list and picker (Project Access) */
  .linked-folder-row {
    flex-wrap:wrap;
  }
  .linked-folder-row .linked-folder-info {
    flex:1 1 60%;
    min-width:0;
    overflow-wrap:anywhere;
  }
  .linked-folder-picker .file-row {
    min-height:48px;
  }
  .linked-folder-picker .btn,.linked-folder-row .btn {
    min-height:44px;
  }
  .permission-summary {
    grid-template-columns:minmax(0,1fr);
  }

  /* Viewers: controls reflow, targets 44px, nothing clipped */
  .compare-toolbar,.review-toolbar,.preview-toolbar {
    gap:.5rem .6rem;
    padding:.5rem .6rem;
  }
  .compare-toolbar-group,.review-toolbar-group,.preview-toolbar-group {
    flex-wrap:wrap;
  }
  .compare-mode-group,.review-tool-group {
    width:100%;
  }
  .compare-mode-group .compare-mode-btn,.review-tool-group .compare-mode-btn {
    flex:1 1 0;
    min-height:44px;
    font-size:.82rem;
  }
  .compare-tool-btn {
    width:44px;
    height:44px;
  }
  .compare-toolbar .btn,.review-toolbar .btn,.preview-toolbar .btn,.compare-overlay-controls .btn {
    min-height:44px;
  }
  .compare-sync-toggle {
    min-height:44px;
    font-size:.85rem;
  }
  .compare-overlay-controls,.compare-diff-controls {
    flex-wrap:wrap;
  }
  .compare-opacity-label {
    flex:1 1 100%;
    flex-wrap:wrap;
  }
  .compare-opacity-label input[type="range"] {
    flex:1 1 160px;
    min-height:44px;
  }
  .compare-viewport {
    padding:.6rem;
  }
  .compare-header-actions,.preview-header-actions {
    width:100%;
    margin-left:0;
  }
  .compare-header-actions .btn,.preview-header-actions .btn {
    flex:1 1 auto;
    justify-content:center;
    min-height:44px;
  }
  .compare-version-vs {
    align-self:flex-start;
    transform:rotate(90deg);
  }
  .review-open-count {
    white-space:normal;
  }
  .review-panel-toggle {
    width:100%;
    margin-left:0;
    min-height:44px;
  }
  .review-filter-btn {
    min-height:40px;
    padding:.3rem .75rem;
    font-size:.8rem;
  }
  .review-banner .btn {
    min-height:44px;
  }
  .review-popover {
    position:fixed;
    left:.75rem !important;
    right:.75rem;
    top:auto !important;
    bottom:calc(.75rem + env(safe-area-inset-bottom));
    width:auto;
    z-index:1050;
  }
  .review-popover textarea {
    font-size:1rem;
  }
  .review-popover-actions .btn {
    min-height:44px;
  }
  .compare-select-bar {
    flex-wrap:wrap;
  }
  .compare-select-bar .btn {
    width:100%;
    min-height:44px;
  }
  .preview-canvas-wrap {
    min-height:240px;
  }
}

/* =====================================================================================================================
   Phase M4 — public/account pages and final consistency (2026-10-13).
   Entry (public) pages keep their landing.css look; this block only adds the Connector authorization card, a shared
   pre-wrap helper and a phone-only minimum text size for the smallest labels. Breakpoints used by new code: 480 / 800 /
   900 / 1120 px; the older ones (520, 640, 700, 760, 860, 1180) are intentionally left in the approved pages.
   ===================================================================================================================== */
.pre-wrap {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.connector-account {
  margin:0 0 1.5rem;
  padding:.85rem 1rem;
  background:var(--canvas);
  border:1px solid var(--line);
  border-radius:var(--r-panel);
  font-size:1.05rem;
  font-weight:600;
  overflow-wrap:anywhere;
}

.connector-authorize-actions {
  flex-direction:row;
  flex-wrap:wrap;
  gap:.75rem;
}

.connector-authorize-actions .entry-btn {
  margin-top:0;
}

@media(max-width:800px) {
  /* Smallest labels: never below ~12px on phones (they were .58–.72rem) */
  .eyebrow,.eyebrow-navy {
    font-size:.75rem;
  }
  .stat-label {
    font-size:.72rem;
  }
  .status-badge,.activity-badge,.action-badge,.issue-status-badge,.companion-status-badge,.review-count-badge,.issue-badge {
    font-size:.78rem;
  }
  .companion-card-meta,.overview-list-meta,.recent-copy small,.recent-item time,.comment-head time,.result-count,.search-result-context,.notif-row-meta,.pagination-status,.drop-file-size,.member-row small,.file-type-ext {
    font-size:.8rem;
  }
}

@media(max-width:640px) {
  .connector-authorize-actions .entry-btn {
    flex:1 1 100%;
  }
}

/* Admin import: scan button aligned with the adjacent fields */
.import-scan-action{display:flex;flex-direction:column}
.import-scan-action .form-label{visibility:hidden;user-select:none}
.import-scan-action .btn{align-self:flex-start;min-height:calc(1.5em + .75rem + 2px)}
@media(max-width:767.98px){
  .import-scan-action .form-label{display:none}
  .import-scan-action .btn{align-self:stretch;min-height:44px}
}

/* Access requests: overflow action menu in the Actions cell */
.data-table td.cell-actions .file-actions {
  display:inline-block;
}

@media(max-width:1120px) {
  .stack-wide td.cell-actions .file-actions .action-menu {
    right:auto;
    left:0;
  }
}

/* Desktop: sidebar stays locked in the viewport; only the page content scrolls. */
@media(min-width:900px) {
  .app-sidebar {
    position:sticky;
    top:0;
    align-self:flex-start;
    height:100vh;
    overflow-y:auto;
  }
}

/* Linked server folder upload status (no-JS fallback form in the shared File Workspace toolbar). */
.linked-upload-status {
  flex:1 0 100%;
  margin:0;
  font-size:.84rem;
  color:var(--muted);
}

.linked-upload-status:empty {
  display:none;
}

.linked-upload-status.is-error {
  color:var(--danger);
}

/* Unified File Workspace: one toolbar and file list for managed and linked folders */
/* The linked upload button lives in its no-JS fallback form; the form must not affect the toolbar layout. */
.tb-form {
  display:contents;
}

.toolbar-actions .linked-upload-status {
  grid-column:1 / -1;
}

/* Linked server folder context under the toolbar: same scale as the drop hint, stays visible on mobile. */
.workspace-context {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.35rem .6rem;
  margin:0 0 .6rem;
  font-size:.8rem;
  color:var(--muted);
  overflow-wrap:anywhere;
}

.workspace-context>.icon {
  width:14px;
  height:14px;
  flex-shrink:0;
  color:var(--accent);
  fill:currentColor;
}
