@import url("fonts.css");
@import url("tokens.css");
:root {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface-page);
  font-synthesis: none;
  --brand-blue: var(--accent);
  --brand-yellow: var(--highlight);
  --muted: var(--text-muted);
  --border: var(--line);
  --ink: var(--text);
  --paper: var(--surface);
  --radius: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  background: transparent;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--text-muted);
  outline-offset: 3px;
}
button svg {
  pointer-events: none;
}
svg.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-md);
  white-space: nowrap;
}
.primary {
  background: var(--brand-blue);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-xs);
}
.primary:hover {
  background: var(--accent);
}
.secondary {
  background: var(--surface);
  border: 1px solid var(--border);
}
.secondary:hover {
  background: var(--surface-page);
}
.quiet {
  color: var(--text-muted);
}
.danger {
  color: var(--danger);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
}
.icon-btn:hover {
  background: var(--surface-soft);
}
.eyebrow {
  text-transform: uppercase;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xl);
  font-weight: 750;
  letter-spacing: -1px;
}
.brand img {
  width: 35px;
  height: 35px;
}
.brand small {
  font-size: var(--text-2xs);
  letter-spacing: 1px;
  color: var(--muted);
  margin-left: 3px;
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-xs);
}
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  border-right: 1px solid var(--border);
  background: var(--surface-page);
  padding: 30px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.sidebar .brand {
  padding: 0 6px;
}
.workspace-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}
.workspace-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}
.nav-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 12px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: var(--text-md);
  font-weight: 600;
}
.nav-item.active {
  background: var(--surface-soft);
  color: var(--accent);
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-note {
  padding: 15px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--text-muted);
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 22px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  font-size: var(--text-xs);
  flex-shrink: 0;
}
.profile-name {
  font-size: var(--text-xs);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 108px;
}
.profile small {
  font-size: var(--text-2xs);
  color: var(--muted);
}
.page {
  min-width: 0;
}
.topbar {
  height: 82px;
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #ffffff82;
  font-size: var(--text-sm);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.breadcrumb strong {
  color: var(--text);
  font-weight: 550;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
}
.dashboard {
  padding: 38px 44px;
  max-width: 1500px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
h1 {
  font-size: var(--text-2xl);
  letter-spacing: -1px;
  font-weight: 650;
  margin: 0 0 8px;
}
h2 {
  font-size: var(--text-lg);
  letter-spacing: -0.45px;
  margin: 0;
}
.page-heading p {
  margin: 0;
  font-size: var(--text-md);
  color: var(--muted);
}
.welcome {
  background: var(--surface-soft);
  border: 1px solid var(--surface-soft);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}
.welcome-copy {
  max-width: 510px;
}
.welcome .eyebrow {
  color: var(--text);
  margin-bottom: 12px;
}
.welcome h2 {
  font-size: var(--text-xl);
  line-height: 1.25;
}
.welcome p {
  line-height: 1.65;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 12px 0 0;
}
.welcome-illustration {
  width: 180px;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
  transform: rotate(-5deg);
}
.mini-sheet {
  width: 143px;
  height: 116px;
  background: var(--surface-page);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
  box-shadow: 8px 10px 0 var(--surface-soft);
}
.mini-line {
  height: 5px;
  width: 80%;
  background: var(--surface-soft);
  border-radius: var(--radius-xs);
  margin: 8px 0;
}
.mini-image {
  height: 37px;
  background: var(--surface-soft);
  border-radius: var(--radius-xs);
}
.mini-pin {
  position: absolute;
  border: 4px solid var(--surface-soft);
  display: grid;
  place-items: center;
  background: var(--brand-blue);
  color: var(--text-on-accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: var(--text-xs);
  right: 24px;
  top: 13px;
  transform: rotate(5deg);
}
.mini-comment {
  position: absolute;
  bottom: 7px;
  left: -14px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 9px 14px;
  font-size: var(--text-2xs);
  border-radius: var(--radius-sm);
  transform: rotate(5deg);
  box-shadow: var(--shadow-sm);
}
.mini-comment span {
  color: var(--text-muted);
  margin-right: 5px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--muted);
}
.stat-value {
  font-size: var(--text-xl);
  letter-spacing: -1px;
  font-weight: 600;
  margin-top: 7px;
}
.stat-icon {
  width: 43px;
  height: 43px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.project-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-base);
  font-weight: 650;
}
.count-pill {
  font-size: var(--text-2xs);
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text-muted);
  padding: 3px 7px;
  border-radius: var(--radius-xs);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.search-box input {
  border: 0;
  background: transparent;
  min-height: 40px;
  padding: 8px 0;
  min-width: 0;
  width: 200px;
  font-size: var(--text-xs);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.project-preview {
  height: 170px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.folder-preview {
  width: 87px;
  height: 62px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px 12px 12px 12px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.folder-preview:before {
  content: "";
  position: absolute;
  top: -10px;
  left: -1px;
  width: 37px;
  height: 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 5px 7px 0 0;
  background: var(--surface-soft);
}
.project-info {
  padding: 18px;
}
.project-info h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 8px;
}
.project-meta {
  font-size: var(--text-2xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-soft);
  font-size: var(--text-2xs);
  color: var(--muted);
}
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  text-align: center;
  padding: 47px 24px;
}
.empty-icon {
  width: 60px;
  height: 60px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  margin: 0 auto 19px;
  color: var(--text-muted);
  border-radius: var(--radius-lg);
}
.empty h2 {
  font-size: var(--text-lg);
}
.empty p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--muted);
  max-width: 360px;
  margin: 12px auto 22px;
}
.footnote {
  text-align: center;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  margin: 25px 0;
}
.auth-page {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100dvh;
}
.auth-story {
  background: var(--login-background, var(--surface-soft));
  background-size: cover;
  background-position: center;
  color: var(--login-story-text, var(--text));
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-story .brand {
  color: var(--login-story-text, var(--text));
  margin-bottom: 100px;
}
.auth-story > .eyebrow { color:inherit; opacity:.8; }
.auth-story h1 {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: clamp(36px, 4vw, 58px);
  letter-spacing: -2px;
  line-height: 1.1;
  max-width: 530px;
}
.auth-story > p {
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--login-story-text, var(--text-muted));
  max-width: 440px;
  margin-top: 20px;
}
.auth-art {
  color: var(--text);
  margin: 40px 0 20px;
  width: 100%;
  max-width: 420px;
  background: var(--surface-page);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 16px 18px 0 var(--surface-soft);
  transform: rotate(-3deg);
}
.art-header {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--surface-soft);
  padding-bottom: 12px;
}
.art-header i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.art-content {
  display: flex;
  gap: 16px;
  padding: 20px 0 6px;
}
.art-block {
  width: 47%;
  height: 112px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}
.art-copy {
  flex: 1;
  padding-top: 16px;
}
.art-copy b {
  font-size: var(--text-lg);
  letter-spacing: -0.7px;
}
.art-feedback {
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: var(--radius-sm);
  max-width: 250px;
  padding: 12px 15px;
  margin: 8px 0 0 auto;
  transform: rotate(3deg);
  font-size: var(--text-xs);
}
.auth-footer {
  font-size: var(--text-2xs);
  color: var(--login-story-text, var(--text-muted));
  margin-top: auto;
  padding-top: 40px;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-page);
  padding: 50px 30px;
}
.auth-card {
  width: 100%;
  max-width: 375px;
}
.auth-card h2 {
  overflow-wrap: anywhere;
  font-size: var(--text-2xl);
  margin-bottom: 10px;
}
.auth-card > p {
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 30px;
}
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 19px;
}
.field label {
  font-size: var(--text-xs);
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 46px;
  font-size: var(--text-md);
  color: var(--text);
}
.field textarea {
  min-height: 100px;
  line-height: 1.5;
  resize: vertical;
}
.field small {
  font-size: var(--text-2xs);
  color: var(--muted);
}
input:user-invalid,
textarea:user-invalid {
  border-color: var(--danger);
}
.auth-card .primary {
  background: var(--login-accent, var(--accent));
  color: var(--login-accent-text, var(--text-on-accent));
  width: 100%;
  margin-top: 4px;
}
.auth-page .auth-card .primary:hover { background:var(--login-accent, var(--accent)); filter:brightness(.95); }
.auth-switch {
  text-align: center;
  font-size: var(--text-xs);
  margin-top: 24px;
  color: var(--muted);
}
.text-link {
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.error {
  color: var(--danger);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.error:empty {
  display: none;
}
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(460px, calc(100% - 32px));
  padding: 28px;
  color: inherit;
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: #2526b34d;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-head h2 {
  font-size: var(--text-lg);
}
.modal-description {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-inverse);
  color: var(--text-on-accent);
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  max-width: calc(100% - 30px);
  box-shadow: var(--shadow-md);
  transition:
    opacity 0.18s,
    transform 0.18s;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.update-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px 10px 18px;
  font-size: var(--text-sm);
  z-index: 20;
  max-width: calc(100% - 30px);
  box-shadow: var(--shadow-md);
}
.project-page {
  padding: 38px 44px;
}
.project-parent {
  margin: 0 0 14px;
  font-size: var(--text-sm);
}
.project-parent a {
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}
.subprojects {
  margin: 6px 0 28px;
}
.subprojects .project-controls {
  margin-bottom: 12px;
}
.upload-zone {
  width: 100%;
  padding: 38px 20px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--text);
}
.upload-zone strong {
  font-size: var(--text-base);
  color: var(--text);
}
.upload-zone small {
  font-size: var(--text-xs);
  color: var(--muted);
}
.upload-zone.dragging {
  background: var(--surface-soft);
  outline: 3px solid var(--text-muted);
}
.asset-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
}
.asset-thumb {
  height: 190px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
}
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.asset-details {
  padding: 17px;
}
.asset-details strong {
  font-size: var(--text-sm);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-details span {
  font-size: var(--text-2xs);
  color: var(--muted);
  display: block;
  margin-top: 7px;
}
.pdf-badge {
  background: var(--surface-page);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  box-shadow: 5px 5px 0 var(--line);
  color: var(--text-muted);
}
.pdf-badge span {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 7px;
}
.upload-progress {
  margin: -16px 0 25px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--text-xs);
  color: var(--muted);
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--brand-blue);
}
.share-row {
  display: flex;
  gap: 8px;
}
.share-row input {
  min-width: 0;
  flex: 1;
}
.share-warning {
  font-size: var(--text-xs);
  line-height: 1.65;
  color: var(--muted);
  margin: 18px 0;
}
.review-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-soft);
}
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 74px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.review-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.review-heading h1 {
  font-size: var(--text-md);
  letter-spacing: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 350px;
}
.review-heading small {
  display: block;
  color: var(--muted);
  font-size: var(--text-2xs);
  margin-top: 5px;
}
.review-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.asset-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 650;
}
.asset-navigation .icon-btn:disabled,
.zoom-controls .icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.zoom-controls select {
  min-height: 34px;
  max-width: 154px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: var(--surface);
  color: var(--ink);
}
.thumbnail-strip {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 100%;
  overflow-x: auto;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-page);
}
.file-thumbnail {
  width: 100px;
  flex: 0 0 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.file-thumbnail[aria-current="true"] {
  border: 2px solid var(--brand-blue);
  background: var(--surface-page);
}
.file-thumbnail > span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-2xs);
  margin-top: 4px;
}
.thumbnail-preview {
  height: 62px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--text-2xs);
}
.thumbnail-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 62px;
  object-fit: contain;
}
.review-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 355px;
}
.canvas-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.canvas-toolbar {
  min-height: 57px;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 18px;
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  gap: 10px;
}
.viewer-scroll {
  flex: 1 1 1px;
}
.viewer-stage {
  margin-inline: auto;
}
.page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-page);
  border: 1px solid var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  font-size: var(--text-2xs);
}
.page-controls .icon-btn {
  width: 30px;
  height: 30px;
}
.viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px 35px 80px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.viewer-stage {
  position: relative;
  max-width: none;
  box-shadow: var(--shadow-md);
  background: var(--surface);
  line-height: 0;
  flex-shrink: 0;
  margin-inline: auto;
}
.viewer-stage canvas,
.viewer-stage img {
  display: block;
  width: 100%;
  height: auto;
}
.viewer-stage.annotating {
  cursor: crosshair;
}
.pins-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pin {
  pointer-events: auto;
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid var(--surface);
  background: var(--brand-blue);
  color: var(--text-on-accent);
  border-radius: 50% 50% 50% 5px;
  box-shadow: var(--shadow-sm);
  font-size: var(--text-2xs);
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  touch-action: none;
  cursor: grab;
}
.pin.selected {
  background: var(--highlight);
  color: var(--text);
  width: 37px;
  height: 37px;
  z-index: 1;
}
.pin.resolved {
  background: var(--text-muted);
}
.canvas-bottom {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.canvas-bottom .btn {
  min-height: 36px;
  padding: 8px 14px;
  font-size: var(--text-xs);
}
.canvas-bottom .active {
  background: var(--surface-soft);
  color: var(--accent);
}
.canvas-bottom .divider {
  height: 20px;
  width: 1px;
  background: var(--border);
  margin: 0 7px;
}
.comment-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.comment-panel-header {
  padding: 24px 21px 16px;
}
.comment-panel-header h2 {
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-panel-header p {
  font-size: var(--text-2xs);
  color: var(--muted);
  line-height: 1.6;
  margin: 9px 0 15px;
}
.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab {
  padding: 10px 12px;
  font-size: var(--text-xs);
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.tab.active {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 650;
}
.discussion-list {
  overflow: auto;
  flex: 1;
  padding: 0 17px 22px;
}
.discussion-empty {
  text-align: center;
  padding: 60px 18px;
  color: var(--muted);
}
.discussion-empty .empty-icon {
  width: 48px;
  height: 48px;
}
.discussion-empty strong {
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--text);
}
.discussion-empty p {
  font-size: var(--text-xs);
  line-height: 1.7;
}
.comment-card {
  padding: 17px 6px;
  border-bottom: 1px solid var(--surface-soft);
}
.comment-card.selected {
  background: var(--surface-page);
  margin: 0 -8px;
  padding: 17px 14px;
  border-radius: var(--radius-sm);
}
.comment-top {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}
.comment-number {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: var(--text-2xs);
  font-weight: 700;
  flex-shrink: 0;
}
.comment-top strong {
  font-size: var(--text-2xs);
  font-weight: 650;
}
.comment-top time {
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
.comment-top .resolve-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--surface-soft);
  color: var(--text-muted);
}
.comment-top .resolve-btn.done {
  background: var(--surface-soft);
  color: var(--accent);
}
.comment-text {
  font-size: var(--text-xs);
  line-height: 1.75;
  margin: 11px 0;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-location {
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
.reply {
  border-left: 2px solid var(--surface-soft);
  padding: 2px 0 2px 11px;
  margin: 14px 0 0 12px;
}
.reply strong {
  font-size: var(--text-2xs);
}
.reply p {
  font-size: var(--text-2xs);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 5px 0;
  color: var(--text-muted);
}
.reply-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}
.reply-form textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: var(--text-xs);
  min-height: 38px;
  resize: vertical;
  width: 100%;
}
.reply-form .btn {
  min-height: 29px;
  padding: 6px 10px;
  font-size: var(--text-2xs);
  align-self: flex-end;
}
.reply-toggle {
  font-size: var(--text-2xs);
  color: var(--text);
  padding: 6px 0;
}
.comment-draft {
  padding: 17px;
  background: var(--surface-page);
  margin: 0 -3px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.comment-draft h3 {
  font-size: var(--text-xs);
  margin: 0 0 12px;
}
.comment-draft .field {
  margin: 0 0 11px;
}
.comment-draft textarea {
  font-size: var(--text-xs);
  padding: 10px;
  min-height: 90px;
}
.comment-draft .modal-actions {
  margin-top: 9px;
}
.comment-draft .btn {
  font-size: var(--text-2xs);
  padding: 8px 11px;
  min-height: 34px;
}
.guest-footer {
  border-top: 1px solid var(--border);
  padding: 15px 21px;
  font-size: var(--text-2xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.guest-footer .brand {
  font-size: var(--text-base);
}
.guest-footer img {
  width: 22px;
  height: 22px;
}
.mobile-tabs {
  display: none;
}
.error-screen {
  max-width: 480px;
  padding: 70px 25px;
  margin: auto;
  text-align: center;
}
.error-screen p {
  color: var(--muted);
  line-height: 1.7;
}
.viewer-message {
  font-size: var(--text-sm);
  line-height: 1.6;
  padding: 60px 30px;
  color: var(--muted);
}
.help-list {
  font-size: var(--text-sm);
  line-height: 1.85;
  color: var(--text-muted);
  padding-left: 18px;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 48px;
}
.password-wrap button {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .dashboard,
  .project-page {
    padding: 45px 60px;
  }
  .review-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .sidebar {
    padding: 25px 14px;
  }
  .dashboard,
  .project-page {
    padding: 30px 26px;
  }
  .topbar {
    padding: 0 26px;
  }
  .welcome-illustration {
    width: 140px;
  }
  .review-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .viewer-scroll {
    padding: 20px 20px 80px;
  }
  .auth-story {
    padding: 40px;
  }
  .auth-story .brand {
    margin-bottom: 75px;
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .sidebar .brand {
    font-size: var(--text-lg);
  }
  .sidebar nav,
  .workspace-tag,
  .sidebar-note,
  .nav-label,
  .sidebar-bottom > .profile small {
    display: none;
  }
  .sidebar-bottom {
    margin: 0;
  }
  .profile {
    border: 0;
    padding: 0;
    margin: 0;
  }
  .profile-name {
    display: none;
  }
  .topbar {
    height: 60px;
    padding: 0 20px;
  }
  .dashboard,
  .project-page {
    padding: 25px 20px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 10px;
  }
  h1 {
    font-size: var(--text-xl);
  }
  .page-heading p {
    font-size: var(--text-xs);
  }
  .page-heading .btn {
    font-size: var(--text-xs);
    padding: 10px 12px;
    min-height: 40px;
  }
  .welcome {
    padding: 23px;
  }
  .welcome h2 {
    font-size: var(--text-lg);
  }
  .welcome-illustration {
    display: none;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 16px 12px;
  }
  .stat-label {
    font-size: var(--text-2xs);
  }
  .stat-value {
    font-size: var(--text-xl);
  }
  .stat-icon {
    display: none;
  }
  .project-controls {
    flex-wrap: wrap;
  }
  .search-box input {
    width: 160px;
  }
  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-story {
    padding: 26px 28px;
  }
  .auth-story .brand {
    margin-bottom: 32px;
  }
  .auth-story h1 {
    font-size: var(--text-2xl);
    letter-spacing: -1px;
  }
  .auth-story > p {
    font-size: var(--text-sm);
    margin-bottom: 0;
  }
  .auth-art,
  .auth-footer {
    display: none;
  }
  .auth-panel {
    padding: 36px 28px;
  }
  .auth-card h2 {
    font-size: var(--text-xl);
  }
  .review-header {
    padding: 8px 12px;
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .review-heading {
    gap: 8px;
  }
  .review-heading h1 {
    font-size: var(--text-xs);
    max-width: 190px;
  }
  .review-heading small {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-2xs);
  }
  .review-header-actions {
    gap: 5px;
    margin-left: auto;
  }
  .review-header-actions .btn {
    font-size: var(--text-2xs);
    padding: 9px;
    min-height: 36px;
  }
  .review-header-actions .status-pill {
    display: none;
  }
  .review-header .brand {
    display: none;
  }
  .review-layout {
    display: flex;
    flex-direction: column;
  }
  .canvas-area {
    flex: 1;
  }
  .comment-panel {
    flex: 1;
    border-left: 0;
    display: none;
  }
  .review-shell.show-discussion .canvas-area {
    display: none;
  }
  .review-shell.show-discussion .comment-panel {
    display: flex;
  }
  .mobile-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    justify-content: center;
    border-bottom: 1px solid var(--border);
    padding: 4px;
  }
  .mobile-tabs .btn {
    min-height: 34px;
    padding: 8px 25px;
    font-size: var(--text-xs);
  }
  .mobile-tabs .active {
    background: var(--surface-soft);
  }
  .viewer-scroll {
    padding: 18px 12px 80px;
  }
  .canvas-toolbar {
    padding: 6px 10px;
    font-size: var(--text-2xs);
    gap: 6px;
  }
  .canvas-toolbar > #viewer-hint {
    flex: 1 1 100%;
  }
  .asset-navigation {
    order: 1;
  }
  .zoom-controls {
    order: 2;
  }
  #thumbnails-toggle {
    order: 3;
  }
  #download-file,
  #fullscreen-toggle {
    order: 4;
  }
  .thumbnail-strip {
    padding: 6px 10px;
  }
  .file-thumbnail {
    width: 78px;
    flex-basis: 78px;
  }
  .thumbnail-preview {
    height: 50px;
  }
  .thumbnail-preview img {
    max-height: 50px;
  }
  .guest-footer {
    padding: 12px 21px;
  }
  .canvas-bottom {
    bottom: 15px;
  }
  .project-page > .page-heading {
    flex-wrap: wrap;
  }
  .share-row .btn {
    padding: 10px;
  }
  .auth-card .field input {
    font-size: var(--text-base);
  }
  .comment-draft textarea {
    font-size: var(--text-base);
  }
  .reply-form textarea {
    font-size: var(--text-base);
  }
  .comment-top strong {
    font-size: var(--text-xs);
  }
  .comment-text {
    font-size: var(--text-md);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 760px) {
  .canvas-toolbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 60px;
    padding-block: 8px;
  }
  #viewer-hint {
    width: 100%;
    font-size: var(--text-2xs);
  }
}

/* Casepoint internal feedback: white workspace, blue actions, yellow accents. */
:root {
  --brand-blue: var(--accent);
  --brand-yellow: var(--highlight);
  --brand-beige: var(--surface-soft);
  color: var(--text);
  background: var(--surface-page);
}
.brand > span {
  color: var(--brand-yellow);
}
.primary:hover {
  background: var(--accent-hover);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-color: var(--brand-blue);
}
.review-shell {
  background: var(--surface);
}
.review-header {
  height: 66px;
  gap: 12px;
}
.review-header-actions .status-pill {
  display: none;
}
.review-layout {
  grid-template-columns: 300px minmax(0, 1fr) 164px;
}
.review-layout.files-hidden {
  grid-template-columns: 300px minmax(0, 1fr);
}
.comment-panel {
  border-left: 0;
  border-right: 1px solid var(--border);
}
.review-project-title {
  padding: 24px 22px;
  border-bottom: 1px solid var(--border);
}
.review-project-title h2 {
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.5;
  margin: 0 0 8px;
}
.review-project-title span {
  font-size: var(--text-2xs);
  color: var(--muted);
}
.comment-panel-header {
  padding: 20px 22px 14px;
}
.comment-panel-header > p {
  display: none;
}
.comment-card {
  border-radius: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 22px;
}
.comment-card.selected {
  background: var(--surface-selected);
  box-shadow: inset 3px 0 var(--brand-blue);
}
.discussion-list {
  padding: 0;
}
.comment-number {
  background: var(--brand-blue);
  color: var(--text-on-accent);
  border-radius: 50%;
}
.files-panel {
  border-left: 1px solid var(--border);
  background: var(--surface);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.files-panel[hidden] {
  display: none;
}
.files-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
}
.files-panel h2 {
  font-size: var(--text-sm);
  margin: 0;
}
.thumbnail-strip {
  flex-direction: column;
  border: 0;
  background: var(--surface);
  padding: 16px 12px;
  overflow: auto;
  min-height: 0;
}
.file-thumbnail {
  flex: 0 0 auto;
  width: 100%;
  padding: 6px;
  border-color: transparent;
  border-radius: var(--radius-sm);
}
.file-thumbnail[aria-current="true"] {
  background: var(--surface-selected);
  border: 2px solid var(--brand-blue);
}
.thumbnail-preview {
  height: 86px;
  background: var(--surface-sunken);
  border-radius: var(--radius-xs);
}
.thumbnail-preview img {
  max-height: 86px;
  max-width: 100%;
}
.file-thumbnail > span:last-child {
  margin-top: 8px;
}
.canvas-toolbar {
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
}
#viewer-hint {
  width: 100%;
  font-size: var(--text-2xs);
}
.viewer-scroll {
  background: var(--surface);
  padding: 24px 28px;
}
.viewer-stage {
  box-shadow: none;
}
.asset-navigation {
  gap: 12px;
  color: var(--text-muted);
}
.canvas-bottom.review-mode {
  position: static;
  transform: none;
  padding: 3px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.review-mode .btn {
  min-height: 32px;
  padding: 6px 14px;
  font-size: var(--text-xs);
}
.review-mode .btn.active {
  color: var(--text-on-accent);
  background: var(--brand-blue);
}
.pin,
.pin.selected,
.pin.resolved {
  border-radius: 50%;
  width: 34px;
  height: 34px;
  border: 2px solid var(--surface);
  box-shadow:
    0 0 0 1px var(--brand-blue),
    0 4px 16px #2526b320;
  background: var(--brand-blue);
  color: var(--text-on-accent);
  font-size: var(--text-xs);
}
.pin.selected {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
.pin.resolved {
  background: var(--text-muted);
}
.pin.draft-pin {
  background: var(--brand-yellow);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--brand-yellow);
}
.pin-preview,
dialog.pin-dialog {
  position: fixed;
  inset: auto;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: min(430px, calc(100vw - 24px));
  z-index: 20;
  padding: 20px;
  font-size: var(--text-sm);
  line-height: 1.6;
  overflow: auto;
  max-height: calc(100dvh - 130px);
}
.pin-preview {
  width: min(350px, calc(100vw - 24px));
  max-height: 280px;
}
.pin-preview[hidden] {
  display: none;
}
.pin-preview-author {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.pin-preview time,
.pin-preview small {
  color: var(--muted);
  font-size: var(--text-2xs);
}
.pin-preview p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 14px 0 0;
}
.pin-preview .preview-status {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
}
.pin-dialog .modal-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.pin-dialog .modal-head h2 {
  font-size: var(--text-sm);
  font-weight: 600;
}
.pin-dialog .modal-description {
  margin-bottom: 14px;
  font-size: var(--text-2xs);
}
.pin-dialog textarea {
  min-height: 72px;
  background: var(--surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px;
}
.pin-dialog textarea:focus {
  border-color: var(--brand-blue);
}
.pin-dialog .conversation-text {
  margin: 0 0 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--text-md);
}
.pin-dialog .conversation-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.pin-dialog .conversation-actions .btn {
  min-height: 30px;
  font-size: var(--text-2xs);
  padding: 6px 10px;
}
.pin-dialog .modal-actions {
  margin-top: 14px;
}
.pin-dialog .btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: var(--text-xs);
}
@media (min-width: 1700px) {
  .review-layout {
    grid-template-columns: 340px minmax(0, 1fr) 184px;
  }
  .review-layout.files-hidden {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .review-layout {
    grid-template-columns: 250px minmax(0, 1fr) 128px;
  }
  .review-layout.files-hidden {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .review-heading h1 {
    max-width: 210px;
  }
  .review-mode .btn {
    padding: 6px 9px;
  }
}
@media (max-width: 760px) {
  .review-layout,
  .review-layout.files-hidden {
    display: flex;
  }
  .comment-panel {
    border-right: 0;
  }
  .files-panel {
    flex: 0 0 auto;
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: 132px;
  }
  .files-panel > header {
    display: none;
  }
  .thumbnail-strip {
    flex-direction: row;
    padding: 6px 10px;
  }
  .file-thumbnail {
    width: 100px;
    flex: 0 0 100px;
  }
  .thumbnail-preview,
  .thumbnail-preview img {
    height: 62px;
    max-height: 62px;
  }
  .review-shell.show-discussion .files-panel {
    display: none;
  }
  .asset-navigation {
    gap: 6px;
  }
  .review-mode .btn {
    font-size: var(--text-2xs);
    min-height: 28px;
    padding: 5px 9px;
  }
  .pin-dialog,
  .pin-preview {
    max-height: calc(100dvh - 150px);
  }
  .viewer-scroll {
    padding: 16px;
  }
}
.guest-footer {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 22px;
}
.guest-footer > span {
  font-size: var(--text-2xs);
}
.reply-toggle {
  margin-right: 12px;
  margin-top: 10px;
}
.pin-dialog .modal-description {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.pin-dialog .modal-description strong {
  color: var(--ink);
  font-size: var(--text-sm);
}
.pin-dialog .modal-head .conversation-actions {
  margin: 0 6px 0 auto;
}
.pin-dialog #toggle-resolved {
  width: 30px;
  padding: 4px;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.new-pin-dialog .modal-description {
  display: none;
}
.new-pin-dialog .field label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (min-width: 761px) and (max-width: 1100px) {
  .canvas-toolbar {
    gap: 6px;
    padding: 8px 12px;
  }
  .canvas-toolbar .icon-btn {
    width: 30px;
    height: 30px;
  }
  .zoom-controls select {
    max-width: 120px;
  }
  #image-size {
    display: none;
  }
  #thumbnails-toggle {
    min-height: 32px;
    padding: 5px 8px;
  }
}
/* Compact Pinpoint review and file management. */
.dashboard,
.project-page {
  padding: 24px 28px;
}
.page-heading {
  margin-bottom: 22px;
}
.page-heading h1 {
  font-size: var(--text-xl);
}
.page-heading p {
  font-size: var(--text-xs);
}
.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.project-preview,
.asset-thumb {
  height: 160px;
  background: var(--surface-sunken);
}
.project-preview img,
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-info,
.asset-details {
  padding: 12px 14px;
}
.project-info h3,
.asset-details strong {
  font-size: var(--text-sm);
}
.project-meta,
.project-footer,
.asset-details span {
  font-size: var(--text-2xs);
}
.upload-zone {
  padding: 20px;
  margin-bottom: 22px;
}
.upload-zone strong {
  font-size: var(--text-sm);
}
.asset-card,
.file-thumbnail {
  position: relative;
}
.asset-card > a {
  display: block;
}
.asset-actions {
  display: flex;
  gap: 4px;
  position: absolute;
  right: 6px;
  top: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.asset-card:hover .asset-actions,
.file-thumbnail:hover .asset-actions,
.asset-card:focus-within .asset-actions,
.file-thumbnail:focus-within .asset-actions {
  opacity: 1;
  pointer-events: auto;
}
.asset-actions .icon-btn {
  width: 27px;
  height: 27px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.asset-actions svg {
  width: 15px;
  height: 15px;
}
.file-select {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
}
.file-select > span:last-child {
  display: block;
  font-size: var(--text-2xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 5px;
}
.comment-panel[hidden],
.pins-layer[hidden] {
  display: none;
}
.review-layout.discussion-hidden {
  grid-template-columns: minmax(0, 1fr) 164px;
}
.review-layout.discussion-hidden.files-hidden {
  grid-template-columns: minmax(0, 1fr);
}
#discussion-toggle {
  position: fixed;
  left: 300px;
  top: 50%;
  width: 22px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 0;
  background: var(--surface);
  z-index: 4;
  padding: 2px;
}
.review-shell.discussion-collapsed #discussion-toggle {
  left: 0;
}
.pin-dialog .modal-head {
  padding-bottom: 8px;
  margin-bottom: 9px;
}
.pin-dialog .modal-description {
  margin-bottom: 10px;
  gap: 8px;
}
.pin-dialog .conversation-text {
  font-size: var(--text-sm);
  margin-bottom: 14px;
}
.pin-dialog .field {
  margin-bottom: 8px;
}
.pin-dialog textarea {
  min-height: 44px;
  padding: 9px;
  font-size: var(--text-xs);
}
.pin-dialog .btn {
  min-height: 29px;
  padding: 5px 9px;
  font-size: var(--text-2xs);
}
.pin-dialog .modal-actions {
  margin-top: 8px;
}
.pin,
.pin.selected,
.pin.resolved {
  width: 27px;
  height: 27px;
  font-size: var(--text-2xs);
}
.pin.draft-pin {
  background: var(--brand-blue);
  color: var(--text-on-accent);
  box-shadow: 0 0 0 1px var(--brand-blue);
}
dialog.file-dialog {
  width: min(360px, calc(100vw - 24px));
  padding: 20px;
}
.file-dialog .modal-head h2 {
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}
.file-dialog .modal-description {
  font-size: var(--text-xs);
  margin-bottom: 16px;
}
.file-dialog .btn {
  min-height: 32px;
  padding: 7px 12px;
  font-size: var(--text-xs);
}
@media (min-width: 1700px) {
  #discussion-toggle {
    left: 340px;
  }
  .review-layout.discussion-hidden {
    grid-template-columns: minmax(0, 1fr) 184px;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  #discussion-toggle {
    left: 250px;
  }
  .review-layout.discussion-hidden {
    grid-template-columns: minmax(0, 1fr) 128px;
  }
}
@media (max-width: 760px) {
  #discussion-toggle {
    display: none;
  }
  .dashboard,
  .project-page {
    padding: 20px;
  }
  .review-layout.discussion-hidden {
    display: flex;
  }
}
/* File ⋯ menu: touch screens only; mouse users get the hover icons. */
.asset-more {
  display: none;
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
}
.asset-more > summary {
  list-style: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.asset-more > summary::-webkit-details-marker {
  display: none;
}
.asset-more-list {
  position: fixed;
  z-index: 60;
  min-width: 180px;
  display: grid;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.asset-more-list button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: var(--text-md);
  color: var(--text);
  text-align: left;
}
.asset-more-list button:active {
  background: var(--surface-hover);
}
.asset-more-list .icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.asset-more-list .danger-text,
.asset-more-list .danger-text .icon {
  color: var(--danger);
}
@media (hover: none) {
  .asset-actions {
    display: none;
  }
  .asset-more {
    display: block;
  }
}
.page-heading .btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: var(--text-xs);
}
#discussion-toggle {
  width: 24px;
  height: 40px;
}
/* Keep review controls and card metadata in separate, compact rows. */
.topbar {
  height: 48px;
  min-height: 48px;
  padding: 0 24px;
}
.breadcrumb a {
  color: inherit;
  text-decoration: none;
}
.breadcrumb a:hover,
.review-title a:hover {
  text-decoration: underline;
}
.btn,
.page-heading .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: var(--text-xs);
}
.page-heading {
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}
.page-heading > div:last-child {
  flex-wrap: wrap;
}
.page-heading h1 {
  font-size: var(--text-xl);
}
.project-page .eyebrow {
  margin-bottom: 5px !important;
  font-size: var(--text-2xs);
}
.project-parent {
  margin-bottom: 12px;
  font-size: var(--text-xs);
}
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100px;
  padding: 16px;
}
.upload-zone small {
  font-size: var(--text-2xs);
}
.asset-card > a {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
.asset-thumb {
  height: 160px;
  flex: 0 0 160px;
  overflow: hidden;
}
.asset-thumb img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.asset-details {
  position: static;
  background: var(--surface);
  min-height: 64px;
  width: 100%;
  flex: 0 0 auto;
}
.asset-details strong,
.asset-details span {
  position: static;
  line-height: 1.4;
}
.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 280px));
}
.review-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  height: 52px;
  min-height: 52px;
  padding: 0 16px;
  gap: 10px;
}
.review-heading {
  min-width: 0;
  gap: 8px;
}
.review-title {
  min-width: 0;
}
.review-heading h1 {
  max-width: 100%;
  font-size: var(--text-xs);
}
.review-heading small {
  margin-top: 2px;
  font-size: var(--text-2xs);
}
.review-title a {
  color: inherit;
}
.review-header-actions {
  justify-self: end;
}
.asset-navigation {
  grid-column: 2;
  gap: 5px;
}
.canvas-bottom.review-mode {
  border-radius: var(--radius-sm);
  padding: 2px;
}
.review-mode .btn {
  min-height: 28px;
  padding: 4px 9px;
  font-size: var(--text-2xs);
}
.icon-btn {
  width: 30px;
  height: 30px;
}
.review-header .icon {
  width: 20px;
  height: 20px;
}
.canvas-toolbar {
  min-height: 44px;
  padding: 5px 10px;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
#viewer-hint {
  width: auto;
  flex: 1 1 auto;
  min-width: 100px;
  max-width: 300px;
  font-size: var(--text-2xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zoom-controls select {
  min-height: 28px;
  font-size: var(--text-2xs);
  max-width: 128px;
}
.zoom-controls {
  flex-shrink: 0;
  gap: 1px;
}
.canvas-toolbar .icon-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: var(--text-lg);
}
.canvas-toolbar .icon {
  width: 21px;
  height: 21px;
}
#thumbnails-toggle {
  min-height: 28px;
  padding: 4px;
  font-size: var(--text-2xs);
}
#image-size,
#zoom-label {
  font-size: var(--text-2xs);
  white-space: nowrap;
}
.review-layout {
  grid-template-columns: 270px minmax(0, 1fr) 132px;
}
.review-layout.files-hidden {
  grid-template-columns: 270px minmax(0, 1fr);
}
.review-layout.discussion-hidden {
  grid-template-columns: minmax(0, 1fr) 132px;
}
.review-layout.discussion-hidden.files-hidden {
  grid-template-columns: minmax(0, 1fr);
}
#discussion-toggle {
  left: 270px;
}
.files-panel > header {
  min-height: 44px;
  padding: 5px 10px;
}
.thumbnail-strip {
  padding: 10px 7px;
  gap: 10px;
}
.thumbnail-preview,
.thumbnail-preview img {
  max-height: 72px;
  height: 72px;
}
.review-project-title {
  padding: 15px 16px;
}
.review-project-title h2 {
  font-size: var(--text-md);
  margin-bottom: 4px;
}
.comment-panel-header {
  padding: 14px 16px 8px;
}
.comment-card {
  padding: 16px;
}
.comment-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
}
.comment-tools input {
  grid-column: 1 / -1;
}
.comment-tools input,
.comment-tools select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 5px 7px;
  font-size: var(--text-2xs);
}
.resolve-btn.done,
#toggle-resolved.done {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-soft);
}
.pin.resolved,
.timeline-marker.done {
  background: var(--success);
  box-shadow: var(--shadow-xs);
  color: var(--text-on-accent);
}
.pin-dialog .modal-head > h2 {
  display: none;
}
.conversation-navigation {
  display: flex;
  gap: 3px;
  margin-right: auto;
}
.conversation-navigation .icon-btn,
.pin-dialog .modal-head .icon-btn {
  width: 27px;
  height: 27px;
}
.conversation-navigation button:disabled {
  opacity: 0.3;
}
#conversation-reply .field {
  display: flex;
  gap: 6px;
  align-items: end;
  margin: 0;
}
#conversation-reply textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  max-height: 90px;
  border: 0;
  background: var(--surface-sunken);
}
#conversation-reply button[type="submit"] {
  width: 30px;
  height: 36px;
  padding: 6px;
  min-height: 36px;
  font-size: 0;
}
#conversation-reply button[type="submit"]::after {
  content: "➜";
  font-size: var(--text-lg);
}
#conversation-reply .error {
  margin: 5px 0 0;
}
.replacement-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--muted);
  border-radius: var(--radius-sm);
  padding: 28px 12px;
}
.replacement-drop.dragging {
  border-color: var(--brand-blue);
  background: var(--surface-selected);
}
.replacement-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.replacement-drop:focus-within {
  outline: 2px solid var(--brand-blue);
}
#replacement-name {
  font-size: var(--text-2xs);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.video-review video {
  display: block;
  max-width: none;
}
.video-review .pins-layer {
  pointer-events: none;
  bottom: 44px;
}
.video-review .pins-layer .pin {
  pointer-events: auto;
}
.video-controls {
  padding: 10px 24px;
  background: var(--surface-sunken);
  border-top: 1px solid var(--border);
}
#video-markers {
  height: 25px;
  position: relative;
  margin: 0 12px 4px;
}
.timeline-marker {
  position: absolute;
  transform: translateX(-50%);
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: var(--text-on-accent);
  font-size: var(--text-2xs);
  border: 1px solid var(--surface);
}
#video-seek {
  width: 100%;
  accent-color: var(--brand-blue);
  height: 16px;
  padding: 0;
  min-height: 0;
}
.video-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
}
.video-actions .icon-btn {
  width: 32px;
  font-size: var(--text-2xs);
}
#video-comment {
  margin-left: auto;
  font-size: var(--text-2xs);
}
@media (min-width: 1700px) {
  .review-layout {
    grid-template-columns: 290px minmax(0, 1fr) 140px;
  }
  .review-layout.files-hidden {
    grid-template-columns: 290px minmax(0, 1fr);
  }
  .review-layout.discussion-hidden {
    grid-template-columns: minmax(0, 1fr) 140px;
  }
  #discussion-toggle {
    left: 290px;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .review-layout {
    grid-template-columns: 240px minmax(0, 1fr) 112px;
  }
  .review-layout.files-hidden {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .review-layout.discussion-hidden {
    grid-template-columns: minmax(0, 1fr) 112px;
  }
  #discussion-toggle {
    left: 240px;
  }
  #viewer-hint {
    display: none;
  }
}
@media (max-width: 760px) {
  .review-header {
    height: auto;
    min-height: 80px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px 12px;
    gap: 4px;
  }
  .review-header-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .asset-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }
  .review-heading h1 {
    font-size: var(--text-2xs);
  }
  .canvas-toolbar {
    padding: 5px 8px;
  }
  #viewer-hint {
    display: none;
  }
  .review-layout {
    display: flex;
  }
  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .project-page,
  .dashboard {
    padding: 16px;
  }
  .video-controls {
    padding: 10px 16px;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1100px) {
  #viewer-hint {
    display: inline;
    min-width: 70px;
    max-width: 120px;
    flex: 0 1 120px;
    font-size: var(--text-2xs);
  }
}
.workspace-project-toolbar {
  border-block: 1px solid var(--border);
  margin-bottom: 22px;
  padding: 8px 0;
}
.project-toolbar-row,
.project-tool-icons,
#project-selection {
  display: flex;
  align-items: center;
  gap: 6px;
}
.project-toolbar-row {
  flex-wrap: wrap;
}
.project-toolbar-row > .section-title {
  margin-right: auto;
  font-size: var(--text-sm);
}
.project-tool-icons .active {
  background: var(--surface-selected);
  outline: 1px solid var(--brand-blue);
}
#project-selection {
  font-size: var(--text-xs);
}
#project-selection-count {
  background: var(--surface-sunken);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
}
.project-filter-row,
.project-find-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.project-filter-row {
  padding-top: 8px;
}
.project-filter-row > span {
  color: var(--muted);
  font-size: var(--text-2xs);
}
.project-filter-row select,
#project-sort {
  min-height: 30px;
  width: auto;
  padding: 4px 8px;
  font-size: var(--text-2xs);
  border: 0;
  background: transparent;
}
.project-find-row:has(> :not([hidden])) {
  padding-top: 8px;
}
#project-search-box {
  max-width: 250px;
}
.project-page .project-grid > [hidden],
.project-page .subprojects[hidden],
.project-page .project-grid[hidden],
.project-page > .project-controls[hidden],
.project-no-match[hidden] {
  display: none;
}
.project-no-match {
  padding: var(--space-5) 0;
  text-align: center;
}
#project-search {
  min-height: 30px;
  font-size: var(--text-xs);
}
.selectable-project {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-md);
}
.selectable-project .project-card {
  height: 100%;
}
.selectable-project.selected {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
}
.project-select-hit {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
}
.project-select-hit input {
  accent-color: var(--brand-blue);
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  cursor: pointer;
  background: var(--surface);
}
.selectable-project:hover .project-select-hit,
.selectable-project:focus-within .project-select-hit,
.selectable-project.selected .project-select-hit {
  opacity: 1;
}
.archive-label {
  font-size: var(--text-2xs);
  color: var(--muted);
}
@media (hover: none) {
  .project-select-hit {
    opacity: 1;
  }
}
@media (max-width: 760px) {
  .project-toolbar-row > .section-title {
    width: 100%;
  }
  .project-filter-row {
    gap: 4px;
  }
}
.video-review .pins-layer {
  bottom: 0;
}
.video-actions {
  flex-wrap: wrap;
}
#video-speed {
  width: 62px;
  min-height: 28px;
  padding: 3px 5px;
  font-size: var(--text-2xs);
}
#video-volume {
  width: 70px;
  min-height: 0;
  height: 16px;
  padding: 0;
  accent-color: var(--brand-blue);
}
#video-mute.muted {
  opacity: 0.45;
}
.video-actions .icon {
  width: 19px;
  height: 19px;
}
@media (max-width: 760px) {
  #video-comment {
    width: 100%;
    justify-content: center;
  }
}
#asset-version {
  min-height: 28px;
  width: 120px;
  flex: 0 0 120px;
  padding: 3px 5px;
  font-size: var(--text-2xs);
}
.history-view #viewer-hint {
  color: var(--brand-blue);
  font-weight: 600;
}
.history-view .viewer-stage.annotating {
  cursor: default;
}
.history-view .pin {
  cursor: pointer;
  touch-action: auto;
}
.project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.project-card .project-preview {
  flex: 0 0 160px;
  width: 100%;
}
.project-card .project-info {
  flex: 1;
  background: var(--surface);
}
.selectable-project .project-card {
  height: 100%;
}
dialog.compression-dialog {
  width: min(900px, calc(100vw - 24px));
  max-height: 90dvh;
  padding: 22px;
}
.compress-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-xs);
}
.compress-settings input {
  width: 80px;
  min-height: 30px;
  padding: 5px;
}
.compress-files {
  max-height: 180px;
  overflow: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.compress-files label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: var(--text-xs);
  cursor: pointer;
}
.compress-files input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--brand-blue);
}
.compress-files span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compress-files small {
  white-space: nowrap;
  color: var(--muted);
}
.compression-status {
  font-size: var(--text-xs);
  color: var(--muted);
}
.compression-result {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: var(--text-xs);
}
.compression-preview-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.compression-preview-pair figure {
  margin: 10px 0 0;
  min-width: 0;
}
.compression-preview-pair img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: var(--surface-sunken);
}
.compression-preview-pair figcaption {
  padding-top: 6px;
  font-size: var(--text-2xs);
  color: var(--muted);
}
.compression-dialog .modal-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 10px 0;
  border-top: 1px solid var(--border);
  z-index: 1;
}

.compression-preview-pair video {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: var(--surface-sunken);
}

.viewer-stage iframe {
  display: block;
  border: 0;
  background: var(--surface-inverse);
}
.sharepoint-controls {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface);
  font-size: var(--text-xs);
}
.sharepoint-access-notice {
  width: min(560px, calc(100% - 24px));
  box-sizing: border-box;
  margin: 12px auto;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.viewer-scroll.sharepoint-embed-view {
  flex-direction: column;
  align-items: center;
}
.sharepoint-embed-view > * {
  flex-shrink: 0;
}
.sharepoint-access-notice p {
  margin: 6px 0;
  color: var(--muted);
}
.sharepoint-controls input {
  width: 90px;
}
.sharepoint-controls small,
.sharepoint-controls details {
  flex-basis: 100%;
  color: var(--muted);
}
.sharepoint-controls details p {
  margin-top: 8px;
}

.viewer-stage.linked-video .pins-layer {
  display: none;
}

/* Comparison uses the existing private file endpoints and read-only History. */
dialog.comparison-dialog {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}
dialog.comparison-dialog[open] { display:flex; flex-direction:column; }
dialog.comparison-dialog::backdrop { overflow:hidden; overscroll-behavior:contain; }
.comparison-dialog > .modal-head { flex-shrink:0; padding:12px 24px; margin:0; border-bottom:1px solid var(--border); }
.comparison-dialog > .modal-head .icon-btn { width:40px; height:40px; flex-shrink:0; }
.comparison-dialog > .modal-description { flex-shrink:0; margin:0; padding:12px 24px 0; }
.comparison-body { flex:1; min-height:0; padding:16px 24px 24px; overflow:auto; overscroll-behavior:contain; }
.comparison-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; font-size:var(--text-xs); }
.comparison-toolbar select { min-width:0; max-width:100%; min-height:32px; padding:5px 8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:inherit; font:inherit; }
#comparison-version { flex:1; }
.comparison-images, .comparison-feedback { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.comparison-images[hidden], .comparison-slider-controls[hidden] { display:none; }
.comparison-images figure { margin:0; min-width:0; }
.comparison-images figcaption { margin:0 0 8px; font-size:var(--text-xs); font-weight:650; }
.comparison-frame { position:relative; border:1px solid var(--border); background:var(--surface-soft); line-height:0; }
.comparison-frame img { display:block; width:100%; height:auto; }
.comparison-pins { position:absolute; inset:0; pointer-events:none; }
.comparison-pin { position:absolute; transform:translate(-50%,-50%); width:24px; height:24px; border:2px solid var(--surface); border-radius:50%; background:var(--accent); color:var(--text-on-accent); font-size:var(--text-2xs); cursor:pointer; pointer-events:auto; line-height:20px; padding:0; }
.comparison-pin.resolved { background:var(--success); }
.comparison-pin.selected { outline:3px solid var(--highlight); outline-offset:2px; }
.comparison-images.slider-view { display:block; position:relative; overflow:hidden; }
.comparison-images[hidden] { display:none; }
.slider-view figure:first-child { position:absolute; inset:0 0 auto; z-index:1; clip-path:inset(0 calc(100% - var(--split,50%)) 0 0); }
.slider-view figcaption { position:absolute; top:8px; right:8px; z-index:2; padding:4px 8px; border-radius:var(--radius-xs); background:var(--surface); }
.slider-view figure:first-child figcaption { right:auto; left:8px; }
.comparison-slider-controls { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:12px 0; font-size:var(--text-xs); }
.comparison-slider-controls input { flex:1; min-width:100px; accent-color:var(--accent); }
.comparison-slider-controls .admin-help { flex-basis:100%; margin:0; }
.comparison-feedback { margin-top:20px; }
.comparison-feedback h3 { font-size:var(--text-md); margin:0 0 12px; }
.comparison-feedback h3 small { color:var(--muted); font-weight:400; font-size:var(--text-2xs); }
.comparison-comment { padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:10px; font-size:var(--text-xs); overflow-wrap:anywhere; }
.comparison-comment.selected { border-color:var(--accent); background:var(--surface-selected); }
.comparison-comment p { white-space:pre-wrap; margin:8px 0; line-height:1.6; }
.comparison-comment-status { display:block; margin-top:4px; color:var(--muted); }
.comparison-comment .btn { font-size:var(--text-2xs); padding:4px 8px; min-height:28px; }
@media(max-width:640px) {
  .comparison-dialog > .modal-head { padding:8px 12px; }
  .comparison-dialog > .modal-description { padding:10px 12px 0; }
  .comparison-body { padding:12px; }
  .comparison-images, .comparison-feedback { grid-template-columns:minmax(0,1fr); }
  .comparison-toolbar select { flex-basis:100%; }
}

.casepoint-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  vertical-align: middle;
  line-height: 1.5;
}
.casepoint-loading-icon,
.btn[aria-busy="true"]::before {
  display: inline-block;
  width: 18px;
  height: 24px;
  flex-shrink: 0;
  background: url("casepoint-icon.svg") center / contain no-repeat;
}
.btn[aria-busy="true"]::before {
  content: "";
  background-color: var(--surface);
  background-size: 12px 16px;
  border-radius: var(--radius-xs);
}
.initial-loading {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
}
.initial-loading .casepoint-loader {
  flex-direction: column;
  gap: 22px;
}
.initial-loading .casepoint-loading-icon {
  width: 45px;
  height: 60px;
}
@media (prefers-reduced-motion: no-preference) {
  .casepoint-loading-icon,
  .btn[aria-busy="true"]::before {
    animation: casepoint-loading 1.4s ease-in-out infinite;
  }
}
@keyframes casepoint-loading {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-3px) scale(.93); opacity: .65; }
}
.video-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
  background: #faf9f6e6;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Shared surface treatment: calm contrast, clear edges and restrained motion. */
:root {
  --border: var(--line);
  --muted: var(--text-muted);
  --surface-shadow: var(--shadow-md);
}
.dashboard, .project-page { background: var(--surface-sunken); }
.project-card, .asset-card {
  border-color: var(--border);
  box-shadow: var(--surface-shadow);
}
.project-card:hover {
  transform: none;
  border-color: var(--cp-blue-20);
  box-shadow: var(--shadow-md);
}
.project-preview { background: var(--surface-sunken); }
.btn { letter-spacing: -.01em; }
.primary { box-shadow: 0 2px 3px #2526b314, inset 0 1px 0 #ffffff18; }
.secondary { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.secondary:hover, .icon-btn:hover { background-color: var(--surface-hover); }
.quiet:hover { background-color: var(--surface-hover); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), textarea, select {
  border-color: var(--line-strong);
}
.review-header { background: var(--surface); border-bottom-color: var(--border); }
.review-header-actions { gap: 12px; }
.canvas-toolbar, .comment-panel-header, .files-panel-header { border-color: var(--border); }
.comment-card { border-color: var(--line); }
.comment-card.selected { box-shadow: inset 3px 0 var(--brand-blue); }
.viewer-avatars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 3px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.viewer-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--surface-selected);
  color: var(--brand-blue);
  font-weight: 650;
  font-size: var(--text-2xs);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.viewer-avatars .viewer-avatar + .viewer-avatar { margin-left: -8px; }
.viewer-avatar-more { background: var(--surface-sunken); color: var(--text-muted); }
.viewer-avatars:hover { background: var(--surface-hover); }
.viewer-activity-popover {
  position: fixed;
  inset: auto;
  width: min(370px, calc(100vw - 24px));
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
.activity-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity-popover-heading h2 { margin: 0; font-size: var(--text-md); letter-spacing: -.02em; }
.viewer-activity-list { list-style: none; padding: 0; margin: 12px 0; }
.viewer-activity-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.viewer-activity-person { flex: 1; min-width: 0; }
.viewer-activity-person strong { font-size: var(--text-xs); font-weight: 600; overflow-wrap: anywhere; }
.viewer-activity-person small { display: block; font-size: var(--text-2xs); line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; margin-top: 4px; }
.viewer-activity-row time { color: var(--muted); font-size: var(--text-2xs); flex-shrink: 0; }
.activity-note { font-size: var(--text-2xs); line-height: 1.6; color: var(--muted); margin: 8px 0 16px; }
.activity-details { width: 100%; }
.activity-full-list .viewer-activity-row { border-bottom: 1px solid var(--border); align-items: flex-start; }
.activity-full-list time { max-width: 110px; text-align: right; line-height: 1.6; }
@media (max-width: 760px) {
  .review-header-actions { gap: 8px; }
  .viewer-avatars .viewer-avatar:nth-child(n+2) { display: none; }
  .viewer-avatar { width: 30px; height: 30px; font-size: var(--text-2xs); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .project-card, .asset-card, .viewer-avatars {
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }
  @starting-style { .viewer-activity-popover:popover-open { opacity: 0; } }
  .viewer-activity-popover:popover-open { transition: opacity 140ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn, .project-card, .asset-card, .viewer-avatars, .viewer-activity-popover { transition: none; }
}
.comment-tools input, .comment-tools select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.comment-tools input:focus, .comment-tools select:focus { background: var(--surface); }

/* Public sign-in and review identity also use this helper text. */
.admin-help { font-size:var(--text-xs); line-height:1.8; color:var(--muted); }

.review-more { position:relative; flex-shrink:0; }
.review-more > summary { list-style:none; cursor:pointer; }
.review-more > summary::-webkit-details-marker { display:none; }
.review-more > summary::after { content:"⌄"; margin-left:6px; }
.review-more-menu { position:fixed; z-index:60; min-width:200px; padding:6px; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); box-shadow:var(--shadow-md); display:grid; gap:2px; }
.review-more-menu button,
.review-more-menu #download-file { display:flex; align-items:center; justify-content:flex-start; gap:var(--space-2); width:100%; height:auto; min-height:36px; padding:0 10px; border:0; border-radius:var(--radius-sm); background:none; box-shadow:none; font:inherit; font-size:var(--text-sm); font-weight:var(--weight-medium); color:var(--text); white-space:nowrap; cursor:pointer; }
.review-more-menu button:hover,
.review-more-menu button:focus-visible { background:var(--surface-hover); }
.review-more-menu .icon,
.review-more-menu svg { width:16px; height:16px; flex:none; color:var(--text-muted); }
@media (pointer: coarse) { .review-more-menu button { min-height:var(--touch-target); } }

.brand img.login-logo { display:block; width:auto; max-width:220px; height:auto; max-height:64px; object-fit:contain; }

.account-page {
  max-width: 620px;
  margin: 70px auto;
  padding: 30px;
}
.account-page .brand {
  margin-bottom: 44px;
}
.account-page h1 {
  font-size: var(--text-2xl);
}
.account-page p {
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.8;
}
.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 25px;
}
.workspace-select {
  width: 100%;
  font: inherit;
  font-size: var(--text-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 11px;
  border-radius: var(--radius-sm);
  color: inherit;
}
.workspace-selector label {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  display: block;
  margin-bottom: 7px;
}
.signin-review {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-detail {
  font-size: var(--text-2xs);
  color: var(--muted);
}
@media (max-width:760px) {
  .account-page {
    margin: 30px auto;
    padding: 25px;
  }
  .workspace-selector {
    max-width: 160px;
  }
  .workspace-selector label {
    display: none;
  }
  .shell:not(.admin-shell) .sidebar .workspace-selector {
    display: block;
  }
}

/* Notification bell and inbox panel */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.inbox {
  position: relative;
}
.inbox-bell {
  position: relative;
}
.inbox-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: var(--danger);
  color: var(--text-on-accent);
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.inbox-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: left;
}
.inbox-panel[hidden] {
  display: none;
}
.inbox-head,
.inbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.inbox-head h2 {
  margin: 0;
  font-size: var(--text-md);
}
.inbox-panel .tabs {
  padding: 0 10px;
}
.inbox-foot {
  border-top: 1px solid var(--border);
}
.inbox-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow: auto;
  flex: 1;
}
.inbox-item {
  display: grid;
  gap: 3px;
  padding: 10px 16px 10px 26px;
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-xs);
}
.inbox-item:hover,
.inbox-item:focus-visible {
  background: var(--surface-sunken);
}
.inbox-item.unread::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-blue);
}
.inbox-line strong {
  font-weight: 650;
}
.inbox-excerpt {
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-item small {
  color: var(--muted);
  font-size: var(--text-2xs);
}
.inbox-empty {
  margin: 0;
  padding: 24px 16px;
  color: var(--muted);
  font-size: var(--text-xs);
}
.inbox-more {
  margin: 4px 16px 8px;
}
.choice-list {
  border: 0;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--brand-blue);
  background: var(--surface-sunken);
}
.choice small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.choice input {
  margin-top: 3px;
}

/* Account page */
a.profile-name,
a.avatar {
  color: inherit;
  text-decoration: none;
}
a.profile-name,
.profile small {
  display: block;
}
a.profile-name:hover {
  text-decoration: underline;
}
.settings-page {
  padding: 38px 44px;
  max-width: 760px;
}
.settings-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: -10px 0 22px;
  font-size: var(--text-sm);
}
.settings-jump a {
  color: var(--brand-blue);
}
.settings-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 18px;
  scroll-margin-top: 16px;
}
.settings-card h2 {
  margin: 0 0 6px;
  font-size: var(--text-base);
}
.settings-card h3 {
  margin: 22px 0 6px;
  font-size: var(--text-md);
}
.settings-help {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0 0 14px;
}
.settings-help .icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.settings-card form {
  max-width: 460px;
}
.settings-card .choice-list legend {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 8px;
}
.settings-facts {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  font-size: var(--text-sm);
}
.settings-facts div {
  display: flex;
  gap: 10px;
}
.settings-facts dt {
  width: 60px;
  color: var(--muted);
}
.settings-facts dd {
  margin: 0;
}
.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.settings-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-sm);
}
.settings-list small {
  color: var(--muted);
  flex: 1;
}
@media (max-width: 760px) {
  .settings-page {
    padding: 24px 16px;
  }
}

/* Mentions and assignments */
.mention {
  color: var(--brand-blue);
  background: var(--surface-selected);
  border-radius: var(--radius-xs);
  padding: 0 2px;
  font-weight: 600;
}
.field:has(.mention-picker) {
  position: relative;
}
.mention-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 70;
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  max-height: 220px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.mention-picker[hidden] {
  display: none;
}
.mention-picker li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
}
.mention-picker li[aria-selected="true"],
.mention-picker li:hover {
  background: var(--surface-selected);
}
.mention-initials {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-blue);
  color: var(--text-on-accent);
  font-size: var(--text-2xs);
  font-weight: 700;
}
.task-summary {
  margin: 6px 0 0;
  font-size: var(--text-2xs);
  color: var(--muted);
}
.task-summary strong {
  color: var(--ink);
}
.task-warning {
  color: var(--danger);
  font-weight: 600;
}
.task-priority.high {
  color: var(--danger);
  font-weight: 650;
}
.task-due.overdue {
  color: var(--danger);
  font-weight: 650;
}
.task-controls {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 10px 0;
  padding: 8px 10px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.task-controls legend {
  font-size: var(--text-2xs);
  font-weight: 650;
  color: var(--muted);
  padding: 0 4px;
}
.task-controls label {
  display: grid;
  gap: 3px;
  font-size: var(--text-2xs);
  color: var(--muted);
  flex: 1 1 110px;
}
.task-controls select,
.task-controls input {
  font: inherit;
  font-size: var(--text-xs);
  color: var(--ink);
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.comment-panel-header .tabs {
  flex-wrap: wrap;
}
.my-tasks {
  margin: 0 0 24px;
}
.task-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.task-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-sm);
}
.task-item:hover {
  border-color: var(--brand-blue);
}
.task-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-item small {
  grid-column: 1;
  color: var(--muted);
  font-size: var(--text-2xs);
}
.task-meta {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-2xs);
  color: var(--muted);
}

/* Version approval */
.approval-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-2xs);
  font-weight: 650;
  vertical-align: 1px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  white-space: nowrap;
}
.approval-badge.in_review {
  background: var(--surface-selected);
  color: var(--brand-blue);
}
.approval-badge.changes_requested {
  background: var(--warning-soft);
  color: var(--warning);
}
.approval-badge.approved {
  background: var(--success-soft);
  color: var(--success);
}
.approval-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.approval-button .approval-badge {
  margin: 0;
}
.approval-ask {
  font-size: var(--text-2xs);
  font-weight: 650;
  color: var(--brand-blue);
}
.approval-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--text-sm);
}
.approval-status .approval-badge {
  margin: 0;
}
.approval-approvers {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
}
.approval-approvers li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.approval-approvers p {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
}
.approval-decision {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted);
}
.approval-decision.approved {
  color: var(--success);
  font-weight: 650;
}
.approval-decision.changes_requested {
  color: var(--warning);
  font-weight: 650;
}
.approval-decision .icon {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}
.approval-people {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.approval-history {
  color: var(--success);
}

/* Trash */
.trash-page {
  max-width: 900px;
}
.trash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.trash-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.trash-item:first-child {
  border-top: 0;
}
.trash-item strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-md);
}
.trash-item strong .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.trash-item small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: 3px;
}
.trash-purge {
  color: var(--warning);
}
.trash-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.danger-text {
  color: var(--danger);
}
@media (max-width: 760px) {
  .trash-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Share-link rules */
.link-rules {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 4px 0 14px;
}
.link-rules summary {
  cursor: pointer;
  font-weight: 650;
  font-size: var(--text-sm);
}
.link-rules-summary {
  font-weight: 400;
  color: var(--muted);
}
.link-rules form {
  margin-top: 12px;
}
.inline-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: var(--text-sm);
  margin: 0 0 10px;
}
.inline-check input {
  margin-top: 3px;
}
.inline-check small {
  color: var(--muted);
}
.unlock-screen form {
  max-width: 320px;
  margin: 20px auto 0;
  text-align: left;
}
.field .inline-check {
  margin: 8px 0 4px;
}
.field .inline-check input[type="checkbox"],
.inline-check input[type="checkbox"] {
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  flex: none;
}
/* Page header actions: one main action, the rest in a More menu */
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.actions-menu {
  position: relative;
}
.actions-menu > summary {
  list-style: none;
  cursor: pointer;
}
.actions-menu > summary::-webkit-details-marker {
  display: none;
}
.actions-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 230px;
  display: grid;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.actions-menu-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.actions-menu-list button[hidden] {
  display: none;
}
.actions-menu-list button:hover,
.actions-menu-list button:focus-visible {
  background: var(--surface-sunken);
}
.actions-menu-list button.danger-text {
  color: var(--danger);
}
.actions-menu-list .icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.actions-menu-list hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 4px;
}
.muted-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0;
}
.muted-pill .icon {
  width: 12px;
  height: 12px;
}
.danger-text {
  color: var(--danger);
}
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--text-2xs);
  color: var(--muted);
}
.chip {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--paper);
  font: inherit;
  font-size: var(--text-2xs);
  color: var(--ink);
  cursor: pointer;
}
.chip.active {
  border-color: var(--brand-blue);
  background: var(--surface-selected);
  color: var(--brand-blue);
  font-weight: 650;
}
.approval-label {
  font-size: var(--text-2xs);
  color: var(--muted);
}
@media (max-width: 760px) {
  a.profile-name {
    display: none;
  }
}
/* Phones: the review toolbar fits without sideways scrolling. The hint and size are
   dropped there: touch users tap anyway, and the file strip switches files. */
@media (max-width: 760px) {
  .canvas-toolbar #viewer-hint,
  .canvas-toolbar #image-size,
  .canvas-toolbar #zoom-label {
    display: none;
  }
  .canvas-toolbar {
    justify-content: space-between;
  }
  .canvas-toolbar #zoom-select {
    max-width: 104px;
  }
  .canvas-toolbar .review-more {
    order: 10;
  }
}

/* Design tokens v1: app shell, dashboard, project and review pages.
   Casepoint brand first; Mobbin and Miro informed the flat, hairline-first surfaces and the
   segmented control. Tokens only (see tokens.css). Layout stays with the rules above. */
:root {
  --radius: var(--radius-lg);
  --surface-shadow: none;
}
body {
  color: var(--text);
  background: var(--surface-page);
}
:where(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
}

/* Buttons: one main action in Core Blue, the rest quiet */
.btn {
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  gap: var(--space-2);
}
.primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-xs);
}
.primary:hover {
  background: var(--accent-hover);
}
.primary:active {
  transform: translateY(1px);
}
.secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: none;
}
.secondary:hover,
.icon-btn:hover,
.quiet:hover {
  background: var(--surface-hover);
}
.icon-btn {
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.icon-btn:hover {
  color: var(--text);
}
.icon-btn.danger,
.danger-text {
  color: var(--danger);
}
.count-pill,
.muted-pill {
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  padding: 2px var(--space-2);
}
.eyebrow {
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
}

/* App shell: calm white canvas, beige reserved for soft fills */
.sidebar {
  background: var(--surface-page);
  border-right-color: var(--line);
}
.nav-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
}
.nav-item {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
}
.nav-item .icon {
  color: var(--text-muted);
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
  color: var(--accent);
  font-weight: var(--weight-semibold);
}
.nav-item.active .icon {
  color: var(--accent);
}
.sidebar-note {
  border: 0;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}
.workspace-select {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.topbar {
  background: var(--surface);
  border-bottom-color: var(--line);
}
.breadcrumb strong {
  font-weight: var(--weight-semibold);
}
.dashboard,
.project-page {
  background: var(--surface-page);
}

/* Page heading: one title, one line of help, one main action */
.page-heading h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-1);
}
.page-heading p {
  color: var(--text-muted);
  font-size: var(--text-md);
}
.section-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  gap: var(--space-2);
}

/* Project and file cards: flat, hairline, lift only on hover */
.project-card,
.asset-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  background: var(--surface);
}
.project-card:hover,
.asset-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.project-card:focus-within,
.asset-card:focus-within {
  border-color: var(--accent);
}
.project-preview,
.asset-thumb {
  background: var(--surface-soft);
}
.project-info,
.asset-details {
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.project-info h3,
.asset-details strong {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}
.project-meta,
.asset-details span {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.project-footer {
  border-top-color: var(--line);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}

.folder-preview,
.folder-preview:before {
  background: var(--surface);
  border-color: var(--line-strong);
}
.folder-preview {
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.pdf-badge {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 4px 4px 0 var(--line);
}
.nav-label {
  text-transform: uppercase;
}

/* Upload: drop files anywhere on the project page; progress shows bottom right */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: rgba(37, 38, 179, 0.08);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.drop-overlay[hidden] {
  display: none;
}
.drop-overlay-card {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  max-width: 420px;
  padding: var(--space-6) var(--space-7);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.drop-overlay-card .icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}
.drop-overlay-card strong {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.drop-overlay-card small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.upload-panel {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 70;
  width: min(360px, calc(100vw - 2 * var(--space-4)));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.upload-panel-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  max-height: min(288px, 45vh);
  overflow: auto;
  border-bottom: 1px solid var(--line);
}
.upload-panel.single .upload-panel-list,
.upload-panel.collapsed .upload-panel-list {
  display: none;
}
.upload-panel.single .upload-collapse {
  display: none;
}
.upload-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 2px var(--space-3);
  padding: var(--space-2) var(--space-4);
}
.upload-thumb {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  overflow: hidden;
}
.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-thumb .icon {
  width: 18px;
  height: 18px;
}
.upload-row-text {
  display: grid;
  min-width: 0;
}
.upload-row-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-row-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.upload-row.is-failed .upload-row-status {
  color: var(--danger);
}
.upload-row-mark {
  display: grid;
  place-items: center;
}
.upload-row-mark .icon,
.upload-summary-icon .icon {
  display: none;
  width: 18px;
  height: 18px;
}
.upload-row.is-done .upload-done-mark {
  display: block;
  color: var(--success);
}
.upload-row.is-failed .upload-error-mark {
  display: block;
  color: var(--danger);
}
.upload-row progress {
  grid-column: 2 / -1;
  width: 100%;
  height: 4px;
  appearance: none;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  overflow: hidden;
}
.upload-row:not(.is-active) progress {
  visibility: hidden;
}
.upload-row progress::-webkit-progress-bar {
  background: var(--surface-soft);
}
.upload-row progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: var(--radius-full);
}
.upload-row progress::-moz-progress-bar {
  background: var(--accent);
}
.upload-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
}
.upload-summary-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
}
.upload-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--cp-blue-20);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
}
.upload-panel[data-state="done"] .upload-summary-icon {
  background: var(--success);
  color: var(--text-on-accent);
}
.upload-panel[data-state="error"] .upload-summary-icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.upload-panel:not([data-state="busy"]) .upload-spinner {
  display: none;
}
.upload-panel[data-state="done"] .upload-summary-icon .upload-done-mark,
.upload-panel[data-state="error"] .upload-summary-icon .upload-error-mark {
  display: block;
}
.upload-summary-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.upload-summary-text strong {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
.upload-summary-text small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.upload-summary .icon-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.upload-collapse .icon {
  transform: rotate(180deg);
}
.upload-collapse[aria-expanded="true"] .icon {
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .upload-panel {
    animation: upload-panel-in var(--duration) var(--ease);
  }
  .upload-spinner {
    animation: upload-spin 0.9s linear infinite;
  }
  .upload-collapse .icon {
    transition: transform var(--duration-fast) var(--ease);
  }
  @keyframes upload-panel-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }
  @keyframes upload-spin {
    to {
      transform: rotate(360deg);
    }
  }
}

/* Review page */
.review-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.review-title strong,
.review-title h1 {
  font-weight: var(--weight-semibold);
}
.canvas-bottom.review-mode {
  background: var(--surface-soft);
  border: 0;
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.review-mode .btn {
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: transparent;
  font-weight: var(--weight-semibold);
}
.review-mode .btn:hover {
  color: var(--text);
}
.review-mode .btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.canvas-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
}
.canvas-toolbar .review-more > summary {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.zoom-controls select,
.comment-tools input,
.comment-tools select {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  box-shadow: none;
}
.comment-tools input:focus,
.comment-tools select:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.viewer-scroll {
  background: var(--surface-sunken);
}
.viewer-stage {
  box-shadow: var(--shadow-sm);
}
.comment-panel {
  background: var(--surface);
  border-right-color: var(--line);
}
.review-project-title {
  border-bottom-color: var(--line);
}
.review-project-title h2 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}
.review-project-title span {
  font-size: var(--text-xs);
}
.tabs {
  border-bottom-color: var(--line);
  gap: var(--space-1);
}
.tab {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: var(--weight-semibold);
}
.chip {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 2px 10px;
  white-space: nowrap;
}
.chip:hover {
  background: var(--surface-hover);
}
.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.comment-card {
  border-bottom: 1px solid var(--line);
}
.comment-card:hover {
  background: var(--surface-page);
}
.comment-card.selected {
  background: var(--surface-selected);
  box-shadow: inset 3px 0 var(--accent);
}
.comment-top strong {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.comment-top time,
.comment-location {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.comment-text {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}
.comment-number {
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: var(--text-2xs);
}
.comment-top .resolve-btn {
  border-color: var(--line-strong);
}
.comment-top .resolve-btn:hover {
  border-color: var(--success);
  color: var(--success);
}
.reply-toggle {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--accent);
}
.files-panel {
  background: var(--surface);
  border-left-color: var(--line);
}
.files-panel > header {
  border-bottom-color: var(--line);
}
.files-panel h2 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.thumbnail-strip {
  background: var(--surface);
  gap: var(--space-2);
}
.file-thumbnail {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.file-thumbnail:hover {
  background: var(--surface-hover);
}
.file-thumbnail[aria-current="true"] {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.thumbnail-preview {
  background: var(--surface-soft);
  border-radius: var(--radius-xs);
}
.file-thumbnail > span:last-child {
  font-size: var(--text-xs);
}
.pin,
.pin.selected {
  box-shadow:
    0 0 0 1px var(--accent),
    var(--shadow-sm);
}
.mobile-tabs {
  background: var(--surface);
  border-bottom-color: var(--line);
}
.mobile-tabs .active {
  background: var(--surface-soft);
  color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .nav-item,
  .chip,
  .tab,
  .comment-card,
  .file-thumbnail,
  .upload-zone,
  .review-mode .btn {
    transition:
      background-color var(--duration-fast) var(--ease),
      border-color var(--duration-fast) var(--ease),
      color var(--duration-fast) var(--ease),
      box-shadow var(--duration-fast) var(--ease);
  }
  .project-card,
  .asset-card {
    transition:
      border-color var(--duration) var(--ease),
      box-shadow var(--duration) var(--ease);
  }
}
@media (max-width: 760px) {
  .page-heading h1 {
    font-size: var(--text-xl);
  }
}
@media (pointer: coarse) {
  .page-heading .btn,
  .nav-item {
    min-height: var(--touch-target);
  }
}

/* Phones: a clean header. Logo mark, workspace picker and avatar on one row (Sign out lives
   on the Account page); a one-line breadcrumb; the main action full width with the
   secondary actions sharing the row below. */
@media (max-width: 760px) {
  .shell:not(.admin-shell) > .sidebar {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
    background: var(--surface);
  }
  .shell:not(.admin-shell) .sidebar .brand {
    font-size: 0;
    gap: 0;
    padding: 0;
    flex-shrink: 0;
  }
  .shell:not(.admin-shell) .sidebar .brand img {
    width: 36px;
    height: 36px;
  }
  .shell:not(.admin-shell) .sidebar .workspace-selector {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .shell:not(.admin-shell) .sidebar .workspace-selector label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .shell:not(.admin-shell) .sidebar .workspace-select {
    width: 100%;
    min-height: var(--control-height);
    padding: 0 var(--space-3);
    text-overflow: ellipsis;
  }
  .shell:not(.admin-shell) .sidebar-bottom {
    flex-shrink: 0;
  }
  .shell:not(.admin-shell) .sidebar-bottom #logout {
    display: none;
  }
  .shell:not(.admin-shell) .profile .avatar {
    width: 36px;
    height: 36px;
  }
  .topbar {
    height: 48px;
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }
  .breadcrumb {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    gap: var(--space-2);
    white-space: nowrap;
    font-size: var(--text-sm);
  }
  .breadcrumb > a:first-child {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .breadcrumb > a:not(:first-child),
  .breadcrumb > strong {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .breadcrumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dashboard,
  .project-page {
    padding: var(--space-5) var(--space-4);
  }
  .page-heading {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
  }
  .page-heading h1 {
    font-size: var(--text-xl);
  }
  .page-heading p {
    font-size: var(--text-sm);
  }
  .page-heading .eyebrow {
    margin-bottom: var(--space-2) !important;
  }
  .page-heading > .btn.primary {
    width: 100%;
  }
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    width: 100%;
  }
  .page-actions > .btn.primary {
    order: -1;
    flex: 1 0 100%;
  }
  .page-actions > .btn.secondary,
  .page-actions > .actions-menu {
    flex: 1 1 0;
    min-width: 0;
  }
  .page-actions > .actions-menu {
    flex: 0 0 var(--touch-target);
  }
  .page-actions > .actions-menu > summary {
    width: 100%;
    padding: 0;
    font-size: 0;
  }
  .page-actions > .actions-menu > summary::before {
    content: "\22EF";
    font-size: var(--text-lg);
    line-height: 1;
  }
  .page-actions > .btn.secondary {
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
  }
  .upload-panel {
    right: var(--space-4);
    bottom: var(--space-4);
  }
  .page-heading .btn {
    min-height: var(--touch-target);
    font-size: var(--text-md);
    padding: 0 var(--space-4);
  }
  .review-header .approval-label {
    display: none;
  }
  .canvas-toolbar #zoom-select {
    max-width: 128px;
  }
}

/* MarkUp-informed details: icon meta rows on cards, a quieter review toolbar */
.project-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-1) var(--space-4);
}
.meta-stat {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-xs);
}
.meta-stat .icon {
  width: 14px;
  height: 14px;
}
.meta-stat.has-open {
  color: var(--accent);
  font-weight: var(--weight-semibold);
}
.project-files-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.canvas-toolbar #zoom-select {
  border-color: transparent;
  background-color: transparent;
}
.canvas-toolbar #zoom-select:hover {
  background-color: var(--surface-hover);
}
.canvas-toolbar #viewer-hint,
.canvas-toolbar #image-size {
  color: var(--text-muted);
}

/* Fluid layout: page gutters and titles scale with the screen instead of jumping at breakpoints */
.dashboard,
.project-page {
  padding: var(--page-gap) var(--page-gutter);
}
.topbar {
  padding-inline: var(--page-gutter);
}
.page-heading h1 {
  font-size: var(--text-title);
  overflow-wrap: anywhere;
}
.page-heading {
  margin-bottom: var(--page-gap);
}
.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--page-gap);
}
.page-heading {
  flex-wrap: wrap;
}
@media (min-width: 761px) {
  .page-heading > div:first-child {
    flex: 1 1 280px;
    min-width: 0;
  }
}
.page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filter-chips {
  flex-wrap: wrap;
}
/* Tablets: the review header uses two rows, like phones, so nothing overlaps. */
@media (min-width: 761px) and (max-width: 1100px) {
  .review-header {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--space-2) var(--space-4);
    row-gap: var(--space-2);
  }
  .review-header-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .asset-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }
  .review-header .approval-label {
    display: none;
  }
}

/* Dashboard upload: choose separate projects or one project for several files */
.upload-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-3);
}
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-5) var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  text-align: center;
}
.choice-card h3 {
  margin: var(--space-1) 0 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}
.choice-card p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.choice-card .field {
  width: 100%;
  text-align: left;
}
.choice-card .btn {
  width: 100%;
  margin-top: auto;
}
.choice-art {
  width: 64px;
  height: 48px;
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.upload-choice-note {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}
#modal.upload-choice-dialog {
  width: min(640px, calc(100vw - 2 * var(--space-4)));
  max-width: none;
}

/* Destructive confirmations: red, never Core Blue */
.btn.primary.danger {
  background: var(--danger);
  color: var(--text-on-accent);
}
.btn.primary.danger:hover {
  background: color-mix(in srgb, var(--danger) 85%, black);
}

/* Account pages (status, verify, invite, password): one calm card in the middle of the page */
.account-page {
  box-sizing: border-box;
  width: min(480px, calc(100% - 2 * var(--space-4)));
  max-width: none;
  margin: clamp(24px, 10vh, 112px) auto var(--space-7);
  padding: clamp(24px, 5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.account-page .brand {
  margin-bottom: var(--space-6);
}
.account-page h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}
.account-page p {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}
.account-page .eyebrow {
  margin-bottom: var(--space-2);
}
.account-page form {
  margin-top: var(--space-5);
}
.account-page form .btn.primary,
.account-page > .btn {
  width: 100%;
}
.account-email {
  color: var(--text);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.account-art {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
}
.account-status.is-alert .account-art {
  background: var(--danger-soft);
  color: var(--danger);
}
.account-art svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-page .status-detail {
  min-height: 0;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.account-page .status-detail:not(:empty) {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.account-page .status-detail.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}
.account-page .account-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.account-page .error:empty {
  display: none;
}
.account-footer {
  margin-top: var(--space-5) !important;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm) !important;
}
.account-footer .text-link {
  font: inherit;
  color: var(--accent);
  font-weight: var(--weight-semibold);
  padding: 0;
}
.invite-page input[readonly] {
  background: var(--surface-sunken);
  color: var(--text-muted);
}
.account-page .eyebrow {
  color: var(--accent);
}

/* Signed-in person, top right: who you are and your access, with a small account menu */
.topbar-actions {
  gap: var(--space-2);
}
.user-menu {
  position: relative;
}
.user-menu > summary {
  list-style: none;
}
.user-menu > summary::-webkit-details-marker {
  display: none;
}
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.user-menu-trigger:hover,
.user-menu[open] > .user-menu-trigger {
  background: var(--surface-hover);
}
.user-menu .avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.user-menu .avatar-lg {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}
.user-menu-who {
  display: grid;
  line-height: 1.25;
  text-align: left;
}
.user-menu-who .profile-name {
  max-width: 160px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.user-menu-who small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.user-menu-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.user-menu-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 60;
  width: min(300px, calc(100vw - 2 * var(--space-4)));
  display: grid;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.user-menu-head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-2) var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--line);
}
.user-menu-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.user-menu-head strong {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.user-menu-head small {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.role-chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
}
.role-chip.admin {
  background: var(--accent-soft);
  color: var(--accent);
}
.role-chip .icon {
  width: 12px;
  height: 12px;
}
.user-menu-panel [role="menuitem"] {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 40px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  text-align: left;
}
.user-menu-panel [role="menuitem"]:hover,
.user-menu-panel [role="menuitem"]:focus-visible {
  background: var(--surface-hover);
}
.user-menu-panel [role="menuitem"].danger-text {
  color: var(--danger);
}
.user-menu-panel [role="menuitem"] .icon {
  width: 18px;
  height: 18px;
}
.user-menu-panel hr {
  width: 100%;
  margin: var(--space-1) 0;
  border: 0;
  border-top: 1px solid var(--line);
}
@media (max-width: 1100px) {
  .user-menu-who,
  .user-menu-chevron {
    display: none;
  }
  .user-menu-trigger {
    padding: var(--space-1);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .user-menu[open] .user-menu-panel {
    animation: upload-panel-in var(--duration-fast) var(--ease);
  }
}

/* Section separation (feedback 2026-11-04): calm hairlines and a resting shadow so each
   area reads as its own block, without heavy borders. */
.project-card,
.asset-card {
  box-shadow: var(--shadow-xs);
}
.project-page .page-heading,
.dashboard .page-heading {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.project-page .workspace-project-toolbar {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.project-page .subprojects {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.review-header {
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  position: relative;
  z-index: 3;
}
.canvas-toolbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.comment-panel {
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.comment-panel-header,
.comment-tools {
  border-bottom: 1px solid var(--line);
}
.discussion-list > * + * {
  border-top: 1px solid var(--line);
}

/* Quick Share on project and subproject cards. Mouse: shows on hover or focus.
   Touch screens can't hover, so it stays visible there. */
.project-card-shell {
  position: relative;
  min-width: 0;
  height: 100%;
}
.card-share {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.card-share .icon {
  width: 14px;
  height: 14px;
}
.card-share:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.project-card-shell:hover .card-share,
.project-card-shell:focus-within .card-share,
.card-share:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .card-share {
    opacity: 1;
    min-height: 40px;
  }
}

/* Files panel: resizable width, thumbnail or list view, and reordering (feedback 2026-11-04) */
.files-panel {
  position: relative;
}
.files-tools {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.files-view {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.files-view .icon-btn {
  width: 28px;
  height: 28px;
  min-height: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  box-shadow: none;
  color: var(--text-muted);
}
.files-view .icon-btn[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--accent);
}
.files-view .icon {
  width: 16px;
  height: 16px;
}
.files-resize {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
}
.files-resize::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background var(--duration-fast) var(--ease);
}
.files-resize:hover::after,
.files-resize:focus-visible::after,
body.resizing-files .files-resize::after {
  background: var(--accent);
}
.files-resize:focus-visible {
  outline: none;
}
body.resizing-files {
  cursor: col-resize;
  user-select: none;
}
body.resizing-files iframe,
body.resizing-files .viewer-stage {
  pointer-events: none;
}
@media (min-width: 761px) {
  .review-layout {
    --comments-col: 270px;
  }
  .review-layout.files-resized:not(.files-hidden) {
    grid-template-columns: var(--comments-col) minmax(0, 1fr) var(--files-width);
  }
  .review-layout.files-resized.discussion-hidden:not(.files-hidden) {
    grid-template-columns: minmax(0, 1fr) var(--files-width);
  }
  /* List view: one row per file, small preview, full name. */
  .files-panel.list-view .thumbnail-strip {
    padding: var(--space-2);
    gap: 2px;
  }
  .files-panel.list-view .file-thumbnail {
    padding: 6px 8px;
  }
  .files-panel.list-view .file-select {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
  }
  .files-panel.list-view .thumbnail-preview {
    flex: 0 0 44px;
    width: 44px;
    height: 32px;
  }
  .files-panel.list-view .thumbnail-preview img {
    max-height: 32px;
  }
  .files-panel.list-view .file-select > span:last-child {
    margin: 0;
    font-size: var(--text-xs);
  }
  .files-panel.list-view.can-reorder .file-thumbnail {
    padding-left: 28px;
  }
  .files-panel.list-view .file-drag {
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    opacity: 1;
  }
  .files-panel.list-view .asset-actions {
    top: 50%;
    transform: translateY(-50%);
  }
}
@media (min-width: 1700px) {
  .review-layout {
    --comments-col: 290px;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .review-layout {
    --comments-col: 240px;
  }
}
/* Reorder handle: on hover or focus with a mouse; always visible on touch screens. */
.file-drag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.file-drag .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}
.file-thumbnail:hover .file-drag,
.file-thumbnail:focus-within .file-drag,
.file-drag:focus-visible {
  opacity: 1;
}
.file-drag:active {
  cursor: grabbing;
}
.file-thumbnail.dragging {
  opacity: 0.85;
  box-shadow: var(--shadow-md);
  background: var(--surface);
  z-index: 4;
}
.thumbnail-strip.reordering,
.thumbnail-strip.reordering * {
  cursor: grabbing;
  user-select: none;
}
@media (hover: none) {
  .file-drag {
    opacity: 1;
  }
}
@media (max-width: 760px) {
  .files-resize,
  .files-view {
    display: none;
  }
  .file-drag {
    top: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
  }
}
/* At its narrowest the panel has room for the controls only; "Files" stays for screen readers
   (the toolbar's Files button names the panel too). */
.files-panel {
  container-type: inline-size;
}
.files-panel > header {
  gap: var(--space-1);
  min-width: 0;
}
@container (max-width: 160px) {
  .files-panel > header h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .files-panel > header {
    justify-content: flex-end;
  }
}

/* Move files dialog (feedback 2026-11-04) */
.move-files fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-4);
  min-width: 0;
}
.move-files legend {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}
.move-file-list {
  display: grid;
  gap: 2px;
  max-height: min(240px, 34vh);
  overflow: auto;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.move-file-list label,
.move-all {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-xs);
  min-width: 0;
}
.move-file-list label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-file-list label:hover {
  background: var(--surface-hover);
}
.move-places {
  display: grid;
  gap: var(--space-2);
}
.move-place {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
}
.move-place:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.move-place:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.move-place input {
  accent-color: var(--accent);
  margin: 0;
  flex: 0 0 auto;
}
.move-place-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  flex: 0 0 auto;
}
.move-place > span:last-child {
  display: grid;
  min-width: 0;
}
.move-place strong {
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-place small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.move-files input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
}
.move-files .inline-check {
  margin: 0;
  align-items: center;
}
.move-files .inline-check input {
  margin-top: 0;
}

/* Optional files when creating a project or subproject (feedback 2026-11-04) */
.attach-field .field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}
.attach-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-3);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-muted);
  text-align: center;
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
.attach-drop .icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.attach-drop small {
  font-size: var(--text-xs);
}
.attach-drop.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.attach-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.attach-drop:focus-within {
  border-color: var(--accent);
}
.attach-browse {
  color: var(--accent);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  cursor: pointer;
}
.attach-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: min(180px, 26vh);
  overflow: auto;
}
.attach-list:empty {
  display: none;
}
.attach-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-1) 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 0;
}
.attach-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
}
.attach-size {
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex: 0 0 auto;
}
.attach-list .icon-btn {
  width: 32px;
  height: 32px;
  min-height: 0;
  flex: 0 0 auto;
}

/* Workspace search in the top bar (roadmap 5c) */
.topbar {
  position: relative;
}
.global-search {
  position: relative;
  display: flex;
  align-items: center;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: clamp(200px, 24vw, 340px);
}
.search-field > .icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  height: 36px;
  min-height: 0;
  padding: 0 34px 0 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text);
}
.search-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-field input::-webkit-search-cancel-button {
  display: none;
}
.search-field kbd {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  pointer-events: none;
}
.search-field input:focus ~ kbd,
.search-field input:not(:placeholder-shown) ~ kbd {
  display: none;
}
.search-open {
  display: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 70;
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.search-group + .search-group {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
.search-group h3 {
  margin: var(--space-1) var(--space-2) var(--space-1);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.search-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.search-option:hover,
.search-option[aria-selected="true"] {
  background: var(--surface-hover);
}
.search-option[aria-selected="true"] {
  box-shadow: inset 2px 0 var(--accent);
}
.search-kind {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
}
.search-kind .icon {
  width: 16px;
  height: 16px;
}
.search-text {
  display: grid;
  min-width: 0;
}
.search-text strong,
.search-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-text strong {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.search-text small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.search-text mark {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}
.search-empty {
  margin: 0;
  padding: var(--space-4) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}
/* Narrow screens: a magnifier in the bar opens the field across the whole bar. */
@media (max-width: 900px) {
  .search-open {
    display: grid;
  }
  .search-field {
    display: none;
  }
  .global-search {
    position: static;
  }
  .global-search.expanded .search-field {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 71;
    width: auto;
    padding: 6px 12px;
    background: var(--surface);
  }
  .global-search.expanded .search-field > .icon {
    left: 22px;
  }
  .global-search.expanded .search-field kbd {
    display: none;
  }
  .search-results {
    position: absolute;
    top: 100%;
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Recently viewed on the dashboard (roadmap 5c) */
.recent-views {
  margin-bottom: var(--page-gap, var(--space-5));
}
.recent-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0 0 var(--space-1);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  scroll-snap-align: start;
}
.recent-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.recent-preview {
  display: grid;
  place-items: center;
  width: 56px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
}
.recent-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-text {
  display: grid;
  min-width: 0;
}
.recent-text strong,
.recent-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-text strong {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.recent-text small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
@media (max-width: 760px) {
  .recent-list {
    grid-auto-columns: minmax(200px, 78%);
  }
}

/* UI polish (audit P3): open comments on file cards */
.open-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: var(--space-1);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  vertical-align: middle;
}
.open-count .icon {
  width: 12px;
  height: 12px;
}
/* Comparison tools (roadmap 5e): zoom with synced scrolling, and a difference view */
.comparison-stage {
  position: relative;
  width: calc(var(--zoom, 1) * 100%);
  line-height: 0;
}
.comparison-stage img {
  display: block;
  width: 100%;
  height: auto;
}
.comparison-images.zoomed .comparison-frame {
  overflow: auto;
  max-height: min(70vh, 720px);
  overscroll-behavior: contain;
}
.comparison-images.diff-view {
  display: none;
}
.comparison-diff {
  margin: 0;
}
.comparison-diff[hidden] {
  display: none;
}
.comparison-diff figcaption {
  margin: 0 0 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.comparison-diff canvas {
  display: block;
  width: 100%;
  height: auto;
}
.comparison-diff .admin-help {
  margin-top: 8px;
}
.comparison-toolbar select:disabled {
  opacity: 0.55;
}
.comparison-pages {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
}
.comparison-frame canvas {
  display: block;
  width: 100%;
  height: auto;
}
.comparison-missing {
  margin: 0;
  padding: var(--space-6, 32px) var(--space-4);
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Trash: search, workspace filter and select-several (audit item 20) */
.trash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.trash-toolbar .search-box {
  flex: 1 1 240px;
  min-width: 0;
}
.trash-toolbar .search-box input {
  width: 100%;
}
.trash-toolbar select {
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-sm);
  max-width: 100%;
}
.trash-select-all {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  font-size: var(--text-sm);
}
.trash-bulk {
  position: sticky;
  top: var(--space-2);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.trash-bulk[hidden] {
  display: none;
}
.trash-bulk strong {
  margin-right: auto;
  font-size: var(--text-sm);
}
.trash-item {
  justify-content: flex-start;
}
.trash-item > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.trash-item[hidden],
.trash-page .settings-card[hidden] {
  display: none;
}
.trash-check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  cursor: pointer;
}
.trash-check input,
.trash-select-all input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}
@media (max-width: 760px) {
  .trash-item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .trash-item > div:nth-child(2) {
    flex: 1 1 calc(100% - 48px);
  }
  .trash-actions {
    width: 100%;
    padding-left: 40px;
    flex-wrap: wrap;
  }
}

/* Subprojects without a preview image use a short folder band instead of a tall placeholder
   (audit item 21). */
.subprojects .project-card .project-preview:has(.folder-preview) {
  flex-basis: 84px;
  height: 84px;
  min-height: 0;
}
.subprojects .project-card .folder-preview {
  width: 60px;
  height: 44px;
}

/* Drop a file on a file's box to replace it; on empty space to add files. */
[data-replace-target] {
  position: relative;
}
[data-replace-target].drop-replace {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  background: var(--accent-soft);
}
[data-replace-target].drop-replace::after {
  content: "Drop to replace";
  position: absolute;
  inset: auto 6px 6px 6px;
  z-index: 6;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-on-accent, #fff);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-align: center;
  pointer-events: none;
}
body.dropping-on-file .drop-overlay {
  opacity: 0;
}
/* Offer to compress files over the limit */
.compress-ask-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: grid;
  gap: var(--space-1);
  max-height: min(240px, 40vh);
  overflow: auto;
}
.compress-ask-list li {
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.compress-ask-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
}
.compress-ask-list small {
  color: var(--text-muted);
  font-size: var(--text-xs);
}
.compress-fit {
  margin: var(--space-3) 0 0;
  align-items: flex-start;
}
.compress-fit input {
  accent-color: var(--accent);
}
.upload-limits {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}
.upload-limits .field {
  flex: 1 1 140px;
  margin: 0;
}
.upload-limits .field small {
  color: var(--text-muted);
}
.upload-limits .error {
  flex-basis: 100%;
}
.history-pick {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-3);
  display: grid;
  gap: var(--space-1);
  max-height: min(280px, 45vh);
  overflow: auto;
}
.history-pick legend {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}
.history-pick .inline-check {
  margin: 0;
  align-items: center;
  min-height: 36px;
}
.history-pick .inline-check input {
  margin-top: 0;
  accent-color: var(--accent);
}

/* Feedback export (roadmap priority 3) */
.export-format {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: grid;
  gap: var(--space-2);
}
.export-format legend {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}
.export-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.export-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.export-option input {
  accent-color: var(--accent);
  margin: 0;
}
.export-option > span {
  display: grid;
}
.export-option small {
  color: var(--text-muted);
  font-size: var(--text-xs);
}
.report-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 40px);
  background: var(--surface);
  color: var(--text);
}
.report-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: calc(-1 * clamp(16px, 4vw, 40px)) calc(-1 * clamp(16px, 4vw, 40px)) var(--space-5);
  padding: var(--space-3) clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.report-toolbar .muted {
  margin-right: auto;
  font-size: var(--text-sm);
}
.report-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: 2px solid var(--text);
}
.report-header h1 {
  margin: 0 0 var(--space-1);
  font-size: clamp(22px, 3vw, 30px);
  overflow-wrap: anywhere;
}
.report-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.report-file {
  margin-bottom: var(--space-6, 32px);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.report-file h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg, 18px);
  overflow-wrap: anywhere;
}
.report-file h2 small {
  font-weight: var(--weight-medium, 500);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.report-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.report-figure {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
  background: var(--surface-soft);
}
.report-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.report-figure.placeholder {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  min-height: 160px;
  line-height: 1.4;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.report-pin {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent, #fff);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.report-pin.resolved {
  background: var(--success, #2e7d4f);
}
.report-pin.on-image {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.report-comments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.report-comment {
  display: flex;
  gap: var(--space-3);
  break-inside: avoid;
}
.report-comment > div {
  min-width: 0;
}
.report-meta {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.report-meta strong {
  color: var(--text);
}
.report-text {
  margin: 0;
  font-size: var(--text-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.report-replies {
  margin: var(--space-2) 0 0;
  padding: 0 0 0 var(--space-3);
  border-left: 2px solid var(--line);
  list-style: none;
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-xs);
}
.report-empty {
  color: var(--text-muted);
}
@media (max-width: 760px) {
  .report-body {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media print {
  @page {
    margin: 14mm;
  }
  body {
    background: #fff;
  }
  .no-print,
  #toast,
  .upload-panel {
    display: none !important;
  }
  .report-page {
    max-width: none;
    padding: 0;
  }
  .report-file {
    break-inside: avoid-page;
  }
  .report-body {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .report-header {
    flex-direction: column;
    gap: var(--space-2);
  }
}
/* Review: every file's comments, grouped by file (like the Files panel numbering). */
.file-group-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 12px 22px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-page);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 1;
}
.file-group-head:hover { color: var(--text); }
.file-group-head:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: -2px; }
.file-group-head.current { color: var(--text); font-weight: 600; }
.file-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-group-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-align: center;
}
.file-group-head .icon { width: 14px; height: 14px; transition: transform 0.15s ease; }
.file-group.collapsed .file-group-head .icon { transform: rotate(-90deg); }
.file-group-empty { margin: 0; padding: 16px 22px; color: var(--text-muted); font-size: var(--text-xs); }
.comment-card.compact { cursor: pointer; transition: background 0.12s ease; }
.comment-card.compact:hover { background: var(--surface-page); }
.comment-card.compact:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: -2px; }
.comment-card.compact .comment-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comment-card.compact.is-resolved .comment-number { background: var(--surface-soft); color: var(--text-muted); }
.conversation-count { min-width: 44px; text-align: center; font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.conversation-navigation { display: inline-flex; align-items: center; gap: 2px; }
@media (prefers-reduced-motion: reduce) { .file-group-head .icon { transition: none; } }
.file-group .comment-card.selected { margin: 0; padding: 22px; border-radius: 0; }

/* ---- Comment panel polish (final layer) ----
   One rhythm for every card: 16/20 padding, 22px number badge, 14px text, quiet actions
   that never touch the panel edge. The scrollbar keeps its own gutter so nothing is cropped. */
.comment-panel .discussion-list { scrollbar-gutter: auto; padding: 0; }
.comment-panel .comment-card,
.comment-panel .file-group .comment-card.selected {
  position: relative;
  margin: 0;
  padding: 16px 20px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: background 0.12s ease;
}
.comment-panel .comment-card:hover { background: var(--surface-page); }
.comment-panel .comment-card.selected { background: color-mix(in srgb, var(--cp-blue) 6%, white); box-shadow: inset 3px 0 0 var(--cp-blue); }
.comment-panel .comment-top { gap: 10px; align-items: center; min-height: 32px; }
.comment-panel .comment-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cp-blue);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #fff;
}
.comment-panel .comment-card.compact.is-resolved .comment-number,
.comment-panel .comment-card:has(.resolve-btn.done) .comment-number { background: var(--success); }
.comment-panel .comment-top strong { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.comment-panel .comment-top time { font-size: var(--text-xs); color: var(--text-muted); }
.comment-panel .comment-top .resolve-btn {
  flex: none;
  margin-left: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.comment-panel .comment-top .resolve-btn .icon { width: 16px; height: 16px; stroke-width: 2.25; }
.comment-panel .comment-top .resolve-btn:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.comment-panel .comment-top .resolve-btn:focus-visible { outline: 2px solid var(--cp-blue); outline-offset: 2px; }
.comment-panel .comment-top .resolve-btn:active { transform: scale(0.94); }
.comment-panel .comment-top .resolve-btn.done { background: var(--success); border-color: var(--success); color: #fff; }
.comment-panel .comment-top .resolve-btn.done:hover { background: #17652a; border-color: #17652a; color: #fff; }
.comment-panel .comment-text { font-size: 14px; line-height: 1.55; margin: 10px 0 8px; color: var(--text); }
.comment-panel .comment-location { font-size: var(--text-xs); color: var(--text-muted); }
.comment-panel .comment-card .reply { margin: 10px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.comment-panel .comment-card .reply strong { font-size: var(--text-xs); }
.comment-panel .comment-card .reply p { margin: 2px 0 0; font-size: 13px; line-height: 1.5; }
.comment-panel .reply-toggle {
  margin: 10px 16px 0 0;
  padding: 4px 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--cp-blue);
  background: none;
  border: 0;
  cursor: pointer;
}
.comment-panel .reply-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.comment-panel .reply-toggle:focus-visible { outline: 2px solid var(--cp-blue); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .comment-panel .comment-card, .comment-panel .comment-top .resolve-btn { transition: none; }
  .comment-panel .comment-top .resolve-btn:active { transform: none; }
}

/* ---- Canvas toolbar polish (final layer) ----
   Left: what the file is. Right: one row of same-size icon controls, zoom as one grouped pill. */
.review-shell .canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 6px 12px 6px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.review-shell .canvas-toolbar #image-size { order: -2; flex: none; font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; padding-right: 12px; margin-right: 4px; border-right: 1px solid var(--line); }
.review-shell .canvas-toolbar #image-size[hidden] { display: none; }
.review-shell .canvas-toolbar #viewer-hint { order: -1; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); color: var(--text-muted); }
.review-shell .canvas-toolbar .icon-btn,
.review-shell .canvas-toolbar .review-more > summary {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}
.review-shell .canvas-toolbar .review-more > summary::-webkit-details-marker { display: none; }
.review-shell .canvas-toolbar .icon-btn .icon,
.review-shell .canvas-toolbar .review-more > summary .icon { width: 18px; height: 18px; }
.review-shell .canvas-toolbar .icon-btn:hover,
.review-shell .canvas-toolbar .review-more > summary:hover { background: var(--surface-soft); color: var(--text); }
.review-shell .canvas-toolbar .icon-btn:focus-visible,
.review-shell .canvas-toolbar .review-more > summary:focus-visible { outline: 2px solid var(--cp-blue); outline-offset: 1px; }
.review-shell .canvas-toolbar .icon-btn:disabled { opacity: 0.4; cursor: default; background: transparent; }
.review-shell .canvas-toolbar #thumbnails-toggle[aria-pressed="true"] { color: var(--cp-blue); background: color-mix(in srgb, var(--cp-blue) 8%, white); }
.review-shell .canvas-toolbar .review-more[open] > summary { background: var(--surface-soft); color: var(--text); }
.review-shell .canvas-toolbar .zoom-controls {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 32px;
  margin-right: 6px;
  padding: 0 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.review-shell .canvas-toolbar .zoom-controls .icon-btn { width: 28px; height: 28px; border-radius: 6px; }
.review-shell .canvas-toolbar .zoom-controls .icon-btn .icon { width: 16px; height: 16px; }
.review-shell .canvas-toolbar #zoom-select {
  height: 28px;
  width: auto;
  min-width: 0;
  padding: 0 22px 0 8px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  background-color: transparent;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
}
.review-shell .canvas-toolbar #zoom-label { order: 9; min-width: 40px; padding: 0 6px; font-size: var(--text-xs); font-variant-numeric: tabular-nums; color: var(--text-muted); text-align: right; }
.review-shell .canvas-toolbar #asset-version { height: 32px; max-width: 200px; font-size: var(--text-xs); border-radius: 8px; }

/* ---- Comment panel header polish ---- */
.comment-panel .comment-panel-header { padding: 16px 16px 0; }
.comment-panel .comment-panel-header h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 650; margin: 0 0 8px; }
.comment-panel .comment-panel-header > p { display: none; }
.comment-panel .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -16px; padding: 0 12px; }
.comment-panel .tabs .tab { padding: 8px 10px 9px; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; cursor: pointer; }
.comment-panel .tabs .tab:hover { color: var(--text); }
.comment-panel .tabs .tab.active { color: var(--cp-blue); border-bottom-color: var(--cp-blue); }
.comment-panel .tabs .tab:focus-visible { outline: 2px solid var(--cp-blue); outline-offset: -2px; border-radius: 4px; }
.comment-panel .filter-chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 10px 0 0; overflow-x: auto; scrollbar-width: none; }
.comment-panel .filter-chips > span { font-size: var(--text-xs); color: var(--text-muted); flex: none; }
.comment-panel .filter-chips .chip { flex: none; height: 26px; padding: 0 10px; font-size: var(--text-xs); font-weight: 500; border-radius: 999px; white-space: nowrap; }
.comment-panel .comment-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.comment-panel .comment-tools #comment-search { grid-column: 1 / -1; height: 34px; font-size: var(--text-sm); }
.comment-panel .comment-tools select { height: 32px; font-size: var(--text-xs); min-width: 0; }
.review-shell .canvas-toolbar [hidden] { display: none !important; }
.review-shell .canvas-toolbar .review-more > summary::after { content: none; }
.review-shell .canvas-toolbar .review-more > summary .icon { stroke-width: 3.2; }
.comment-panel .filter-chips > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phone Viewer / Comments switch: one segmented control, the active side raised. */
@media (max-width: 760px) {
  .review-shell .mobile-tabs { display: flex; gap: 0; margin: 8px 16px; padding: 3px; background: var(--surface-soft); border: 0; border-radius: 10px; }
  .review-shell .mobile-tabs .btn { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: var(--text-sm); font-weight: 600; box-shadow: none; }
  .review-shell .mobile-tabs .btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(23, 23, 19, 0.12); }
  .review-shell .mobile-tabs .btn:focus-visible { outline: 2px solid var(--cp-blue); outline-offset: 1px; }
}
/* ---- Folders (subprojects) ----
   A folder card is a folder: a tab on its top edge and a peek at what's inside. Hovering dims
   the peek and centres Open and Share, the same pair a project card offers. */
.folder-grid { padding-top: 12px; }
.folder-card-shell { --folder-bg: var(--thumb-well); --folder-visual: 168px; }
.folder-card.project-card { position: relative; overflow: visible; border-radius: 4px 16px 16px 16px; }
.folder-tab {
  position: absolute;
  top: -12px;
  left: -1px;
  width: 42%;
  height: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 14px 0 0;
}
.folder-card.project-card:hover .folder-tab,
.folder-card.project-card:focus-visible .folder-tab { border-color: var(--line-strong); }
.folder-visual { position: relative; padding: 10px 10px 0; }
.folder-body {
  position: relative;
  height: var(--folder-visual);
  padding: 10px;
  border-radius: 10px;
  background: var(--folder-bg);
  overflow: hidden;
}
.folder-mosaic { display: grid; gap: 8px; height: 100%; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.folder-mosaic.tiles-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.folder-mosaic.tiles-2 { grid-template-rows: 1fr; }
.folder-mosaic.tiles-3 .mosaic-tile:first-child { grid-row: span 2; }
.mosaic-tile { position: relative; min-width: 0; min-height: 0; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(23, 23, 19, 0.08); }
.mosaic-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic-more { display: grid; place-items: center; font-size: 15px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.folder-empty { display: grid; place-items: center; height: 100%; color: var(--cp-beige-dark); }
.folder-empty .icon { width: 44px; height: 44px; stroke-width: 1.4; }
.folder-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 19, 0.42);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.folder-open {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(23, 23, 19, 0.18);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}
.folder-open .icon { width: 14px; height: 14px; }
.folder-card-shell:has(.card-share) .folder-open { transform: translate(calc(-100% - 4px), -50%); }
.folder-card-shell:hover .folder-body::after,
.folder-card-shell:focus-within .folder-body::after,
.folder-card-shell:hover .folder-open,
.folder-card-shell:focus-within .folder-open { opacity: 1; }
.folder-card-shell .card-share {
  top: calc(10px + var(--folder-visual) / 2);
  right: auto;
  left: 50%;
  height: 34px;
  min-height: 34px;
  transform: translate(4px, -50%);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(23, 23, 19, 0.18);
}
.folder-card .project-info h3 { margin-top: 2px; }
.files-empty-line { margin: 0 0 24px; font-size: var(--text-sm); }
@media (hover: none) {
  .folder-card-shell .card-share { top: 18px; right: 18px; left: auto; transform: none; }
  .folder-open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .folder-body::after, .folder-open { transition: none; }
}

/* Top bar trail: Workspace / Project / Folder. */
.topbar .breadcrumb .project-parent { display: contents; }
.topbar .breadcrumb a { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-page .subprojects { margin-top: 36px; }
.page-actions .actions-menu > summary .icon { width: 14px; height: 14px; margin-left: 2px; }

/* Project cards: the same hover as folders, dim the preview with Open and Share centred. */
.project-card-shell:not(.folder-card-shell) { --preview-h: 160px; }
.project-card-shell:not(.folder-card-shell) .project-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 19, 0.42);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card-open {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(23, 23, 19, 0.18);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}
.card-open .icon { width: 14px; height: 14px; }
.project-card-shell:not(.folder-card-shell):has(.card-share) .card-open { transform: translate(calc(-100% - 4px), -50%); }
.project-card-shell:not(.folder-card-shell):hover .project-preview::after,
.project-card-shell:not(.folder-card-shell):focus-within .project-preview::after,
.project-card-shell:not(.folder-card-shell):hover .card-open,
.project-card-shell:not(.folder-card-shell):focus-within .card-open { opacity: 1; }
.project-card-shell:not(.folder-card-shell) .card-share {
  top: calc(var(--preview-h) / 2);
  right: auto;
  left: 50%;
  height: 34px;
  min-height: 34px;
  transform: translate(4px, -50%);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(23, 23, 19, 0.18);
}
@media (hover: none) {
  .card-open { display: none; }
  .project-card-shell:not(.folder-card-shell) .card-share { top: 10px; right: 10px; left: auto; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card-open, .project-card-shell .project-preview::after { transition: none; }
}
@media (max-width: 760px) {
  .page-actions > .actions-menu > summary .icon { display: none; }
}
@media (max-width: 760px) {
  .workspace-project-toolbar .project-toolbar-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; }
  .workspace-project-toolbar .project-toolbar-row .section-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-project-toolbar .project-tool-icons { flex: none; display: flex; gap: 2px; }
}

/* =====================================================================
   Polish audit 2026-11-05: shared foundations (final layer, wins over
   the older layered rules above). One button height, one icon-button
   standard, neutral dialog backdrop, brand-coloured native controls.
   ===================================================================== */
.btn { min-height: 40px; }
.btn.quiet { min-height: 36px; }
@media (max-width: 760px) { .btn, .btn.quiet { min-height: var(--touch-target); } }
.auth-page .btn.primary, .auth-page button[type="submit"].btn { min-height: 46px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--cp-blue); }
select { font-size: inherit; }
textarea { resize: vertical; }
#conversation-reply textarea, #comment-text, .reply-form textarea { resize: none; }
dialog::backdrop { background: rgba(23, 23, 19, 0.45); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.page-heading h1, .auth-page h1, .auth-page h2, .modal-head h2, .empty h2 { text-wrap: balance; }
.page-heading p, .modal-description, .empty p { text-wrap: pretty; }
.brand > span { margin-left: -8px; }

/* The dialog close button and other bare icon buttons: 32px, quiet, clear focus ring. */
#modal .modal-head > .icon-btn {
  width: 32px; height: 32px; min-height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); box-shadow: none;
}
#modal .modal-head > .icon-btn:hover { background: var(--surface-soft); color: var(--text); }
#modal .modal-head > .icon-btn .icon { width: 18px; height: 18px; }
:is(.icon-btn, .btn, button, summary, a):focus-visible { outline: 2px solid var(--cp-blue); outline-offset: 2px; }

/* Resolve ticks everywhere: readable at rest, green on hover and when done. */
.comment-panel .comment-top .resolve-btn,
.pin-dialog #toggle-resolved {
  width: 32px; height: 32px; min-height: 32px; padding: 0;
  display: inline-grid; place-items: center;
  border: 1.5px solid #c9c4b8; border-radius: 50%;
  background: #fff; color: var(--text); box-shadow: none;
}
.comment-panel .comment-top .resolve-btn .icon,
.pin-dialog #toggle-resolved .icon { width: 16px; height: 16px; stroke-width: 2.25; }
.comment-panel .comment-top .resolve-btn:hover,
.pin-dialog #toggle-resolved:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.comment-panel .comment-top .resolve-btn.done,
.pin-dialog #toggle-resolved.done { background: var(--success); border-color: var(--success); color: #fff; }

/* ---- Audit: review screen ---- */
/* The comment list gets the whole column; the brand footer belongs to the header. */
.review-shell .comment-panel .guest-footer { display: none; }
/* The panel handle is a tab attached to the panel edge. */
#discussion-toggle { width: 24px; height: 44px; border-left: 0; border-radius: 0 8px 8px 0; box-shadow: 2px 0 6px rgba(23, 23, 19, 0.06); display: grid; place-items: center; color: var(--text-muted); }
#discussion-toggle:hover { color: var(--text); background: var(--surface-soft); }
#discussion-toggle .icon { width: 16px; height: 16px; }
/* Zoom: the select is wide enough for "Fit Horizontally". */
.review-shell .canvas-toolbar #zoom-select { min-width: 128px; padding-right: 26px; text-overflow: ellipsis; }
/* PDF pages: one line. */
#page-label { white-space: nowrap; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.review-shell .canvas-toolbar .page-controls { flex: none; display: inline-flex; align-items: center; gap: 2px; }
/* Video controls: quiet pills that match the toolbar. */
.video-actions { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
#video-back, #video-forward { width: auto; min-width: 40px; padding: 0 8px; font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 8px; color: var(--text-muted); }
#video-back:hover, #video-forward:hover { color: var(--text); background: var(--surface-soft); }
#video-speed { height: 32px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 8px; background-color: #fff; font-size: var(--text-xs); font-weight: 600; }
#video-volume { accent-color: var(--text-muted); height: 4px; width: 88px; }
#video-fullscreen { display: none; } /* the toolbar has fullscreen */
@media (max-width: 760px) {
  #video-volume { display: none; }
  .video-actions .icon-btn, #video-speed { min-width: var(--touch-target); min-height: var(--touch-target); }
  .video-controls { padding: 8px 12px; }
  .review-shell .canvas-toolbar { overflow-x: auto; scrollbar-width: none; }
  .review-shell .canvas-toolbar #zoom-select { min-width: 96px; }
}

/* ---- Audit: cards ---- */
.asset-details .open-count { display: inline-flex; width: auto; max-width: max-content; margin: 6px 0 4px; }
.pdf-badge {
  display: grid; justify-items: center; gap: 6px;
  min-width: 88px; padding: 16px 18px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; box-shadow: 0 1px 2px rgba(23, 23, 19, 0.08), 0 6px 16px rgba(23, 23, 19, 0.06);
  color: var(--text-muted);
}
.pdf-badge .icon { width: 28px; height: 28px; stroke-width: 1.6; }
.pdf-badge.is-video .icon { color: var(--cp-blue); fill: color-mix(in srgb, var(--cp-blue) 12%, transparent); }
.pdf-badge.is-pdf .icon { color: var(--danger); }
.pdf-badge span { margin: 0; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0; color: var(--text); }

/* ---- Audit: top bar trail ---- */
.topbar { gap: 16px; }
.topbar .breadcrumb { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.topbar .breadcrumb > a, .topbar .breadcrumb .project-parent a { flex: 0 1 auto; min-width: 0; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }
.topbar .breadcrumb > span { flex: none; color: var(--cp-beige-dark); }
.topbar .breadcrumb strong { overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { flex: none; }
.topbar-actions .user-menu-who { max-width: 168px; min-width: 0; }
.topbar-actions .user-menu-who > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1080px) { .topbar-actions .user-menu-who { display: none; } }
@media (max-width: 760px) {
  /* Phones: just where you are. */
  .topbar .breadcrumb > a:not([aria-current]), .topbar .breadcrumb > span, .topbar .breadcrumb .project-parent { display: none; }
  .topbar .breadcrumb > a[aria-current], .topbar .breadcrumb > strong { max-width: 100%; }
}

/* ---- Audit: share dialog, guest landing, sign-in ---- */
.link-rules > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-weight: 600; }
.link-rules > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.15s ease; color: var(--text-muted); }
.link-rules[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
#guest-form button[type="submit"] { width: 100%; min-height: 44px; justify-content: center; }
#guest-form .field + .btn, #guest-form .error + .btn { margin-top: 4px; }
.auth-story .eyebrow { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .link-rules > summary::after { transition: none; } }
/* One find-bar style on the dashboard and project pages (no doubled divider). */
.dashboard .workspace-project-toolbar {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* ---- Audit: account ---- */
.settings-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.settings-jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-size: var(--text-sm); font-weight: 500; text-decoration: none; }
.settings-jump a:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.choice:has(input:checked) { border-color: var(--cp-blue); background: color-mix(in srgb, var(--cp-blue) 5%, white); box-shadow: 0 0 0 1px var(--cp-blue); }
.choice small { font-size: var(--text-xs); }
.settings-card .field small, .settings-card .hint { font-size: var(--text-xs); }
.settings-card dd, .settings-card .settings-value { overflow-wrap: anywhere; hyphens: none; }
@media (max-width: 760px) { .settings-jump a { min-height: var(--touch-target); } }

/* ---- Audit: notifications ---- */
.inbox-empty { display: grid; justify-items: center; gap: 6px; padding: 32px 24px; text-align: center; color: var(--text-muted); }
.inbox-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 50%; background: var(--surface-soft); color: var(--text-muted); }
.inbox-empty-icon .icon { width: 20px; height: 20px; }
.inbox-empty strong { color: var(--text); font-size: var(--text-sm); }
.inbox-empty p { margin: 0; max-width: 28ch; font-size: var(--text-xs); line-height: 1.5; }
.inbox-foot { padding-inline: 16px; }
@media (max-width: 760px) {
}

/* ---- Audit: printable report ---- */
.report-header { border-bottom: 1px solid var(--line); }
.report-comment.resolved .report-pin { background: var(--success); }
.report-figure.placeholder { min-height: 96px; place-content: center; gap: 6px; }
@media (max-width: 760px) {
  .report-toolbar { flex-wrap: wrap; }
  .report-toolbar #report-print { flex: 1 0 100%; justify-content: center; }
}

/* ---- Audit round 2 ---- */
/* Inputs: one clear focus ring, not an outline plus a border glow. */
:is(input, textarea, select):focus-visible { outline: none; border-color: var(--cp-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp-blue) 18%, transparent); }
/* Review header subtitle stays on one line. */
.review-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Video: the time and speed never squeeze. */
#video-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
#video-speed { min-width: 60px; padding-right: 20px; }
/* Card actions sit inside the card with breathing room. */
.asset-actions { top: 12px; right: 12px; }
.asset-actions .icon-btn { width: 32px; height: 32px; border-radius: 8px; border-color: var(--line); }
/* Project toolbar name ellipsizes; the count stays. */
.workspace-project-toolbar .section-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.workspace-project-toolbar .toolbar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Share dialog summary label stays on one line. */
.link-rules > summary { flex-wrap: wrap; }
.link-rules > summary > :first-child, .link-rules > summary strong { white-space: nowrap; }
/* Trail: the current page never shrinks first; the others are quieter. */
.topbar .breadcrumb > a:not([aria-current]), .topbar .breadcrumb .project-parent a { font-weight: 400; color: var(--text-muted); }
.topbar .breadcrumb > a[aria-current] { flex: 0 0 auto; max-width: 48ch; overflow: hidden; text-overflow: ellipsis; }
.topbar .breadcrumb .project-parent a { max-width: 22ch; }
/* Trash: purge date is information, not a warning colour. */
.trash-purge { color: var(--text-muted); }
@media (max-width: 760px) {
  #discussion-toggle { display: none; }
  .settings-jump { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .settings-jump a { flex: none; }
  .video-actions { flex-wrap: wrap; row-gap: 8px; }
  #video-comment { flex: 1 0 100%; justify-content: center; }
  /* The conversation on phones is a bottom sheet over the file strip. */
  dialog.pin-dialog[open] { position: fixed; inset: auto 0 0 0 !important; width: 100%; max-width: none !important; max-height: 72dvh; overflow: auto; margin: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(23, 23, 19, 0.16); }
  .review-shell:has(dialog.pin-dialog[open]) .thumbnail-strip { visibility: hidden; }
  /* Notifications open under the top bar, full width. */
  .topbar { position: relative; }
  .topbar .inbox { position: static; }
  .inbox-panel { position: absolute; top: calc(100% + 6px); left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 140px); }
  /* Admin keeps its own trail with separators. */
  .admin-shell .topbar .breadcrumb > span, .admin-shell .topbar .breadcrumb > a { display: inline; }
}
@media (max-width: 480px) {
  .review-shell .canvas-toolbar #zoom-label, .review-shell .canvas-toolbar #fullscreen-toggle, .review-shell .canvas-toolbar #viewer-hint { display: none; }
}
@media (max-width: 480px) { .review-shell .canvas-toolbar #zoom-in, .review-shell .canvas-toolbar #zoom-out { display: none; } }
/* One grid for files and folders (as on markup.io): the folder's tab sits inside its cell. */
.project-items { margin-top: 4px; }
.project-items .folder-card-shell { padding-top: 12px; }
.project-items .folder-card-shell .card-share { top: calc(12px + 10px + var(--folder-visual) / 2); }
.project-items .folder-card-shell { display: flex; flex-direction: column; }
.project-items .folder-card-shell > .folder-card { flex: 1 1 auto; height: auto; }
/* The folder tab is drawn by the wrapper so the card itself can clip to its rounded corners. */
.project-items .folder-card.project-card { overflow: hidden; border-radius: 4px 16px 16px 16px; }
.project-items .folder-card .folder-tab { display: none; }
.project-items .folder-card-shell { position: relative; }
.project-items .folder-card-shell::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 42%;
  height: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 14px 0 0;
  pointer-events: none;
}
.project-items .folder-card-shell:hover::before,
.project-items .folder-card-shell:focus-within::before { border-color: var(--line-strong); }

/* ---- One project bar (like markup.io): where you are on the left, every tool on the right ---- */
.project-page .project-bar { margin: 0 0 20px; padding: 8px 10px 8px 16px; }
.project-bar .project-toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.project-bar-title { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.project-bar-title h1 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.project-bar-title .muted-pill { vertical-align: middle; margin-left: 6px; }
.project-bar-parent { flex: 0 1 auto; min-width: 0; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 4px; }
.project-bar-parent:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.project-bar-title > .icon { flex: none; width: 14px; height: 14px; color: var(--cp-beige-dark); }
.project-bar-title .count-pill { flex: none; }
.project-bar-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.project-bar .project-tool-icons { display: flex; gap: 2px; }
.project-bar .project-tool-icons .icon-btn { width: 36px; height: 36px; border-radius: 8px; }
.bar-divider { width: 1px; height: 24px; margin: 0 6px; background: var(--line); }
.project-bar .page-actions { display: flex; align-items: center; gap: 8px; margin: 0; width: auto; }
.project-bar .page-actions .btn { min-height: 36px; padding: 0 12px; font-size: var(--text-sm); }
.project-bar .page-actions .btn .icon { width: 16px; height: 16px; }
.project-bar .project-filter-row, .project-bar .project-find-row { margin-top: 8px; }
.project-bar .project-find-row:not(:has(:not([hidden]))) { display: none; }
@media (max-width: 1100px) {
  /* Narrower screens: New folder and Upload become icon buttons with tooltips. */
  .project-bar #new-subproject, .project-bar #upload-files { font-size: 0; gap: 0; width: 36px; padding: 0; justify-content: center; }
  .project-bar #new-subproject .icon, .project-bar #upload-files .icon { width: 18px; height: 18px; }
}
@media (max-width: 760px) {
  .project-bar .project-toolbar-row { flex-wrap: wrap; row-gap: 10px; }
  .project-bar-title { flex: 1 0 100%; }
  .project-bar-tools { flex: 1 0 100%; flex-wrap: wrap; gap: 8px; }
  .bar-divider { display: none; }
  .project-bar .page-actions { flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; }
  .project-bar .page-actions > .btn.primary { order: 0; flex: 1 1 auto; }
  .project-bar .page-actions .btn { min-height: var(--touch-target); }
  .project-bar #new-subproject, .project-bar #upload-files { width: var(--touch-target); }
}
.project-bar-title .project-parent { display: contents; }
@media (min-width: 761px) { .project-bar .project-toolbar-row { flex-wrap: nowrap; } }

/* ==========================================================================
   Redesign v2 (2026-11): Asana/Miro-style shell in Casepoint colours.
   Tokens live at the end of tokens.css. This block wins over the earlier layers.
   ========================================================================== */
svg.icon { stroke-width: var(--icon-stroke); }
.shell, .shell .page, .shell .page > main { background: var(--surface); }

@media (min-width: 761px) {
  /* Sidebar */
  .shell { grid-template-columns: 240px 1fr; }
  .sidebar {
    background: var(--nav-bg);
    border-right: 1px solid var(--nav-line);
    padding: var(--space-4) var(--space-3);
    gap: var(--space-6);
    color: var(--nav-text);
  }
  .sidebar .brand { color: var(--nav-text-strong); padding: var(--space-1) var(--space-2); font-size: 20px; }
  .sidebar .brand img { width: 28px; height: 28px; }
  .workspace-selector { padding: 0 var(--space-1); }
  .workspace-selector label,
  .sidebar .nav-label {
    color: var(--nav-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0 var(--space-2);
    margin: 0 0 var(--space-1);
  }
  .sidebar .workspace-select {
    height: var(--control-h);
    min-height: 0;
    color: var(--nav-text-strong);
    background-color: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    padding: 0 28px 0 var(--space-2);
    line-height: 30px;
  }
  .sidebar .workspace-select:hover { background-color: var(--nav-hover); }
  .sidebar nav { gap: 2px; }
  .sidebar .nav-item {
    height: 36px;
    min-height: 0;
    padding: 0 var(--space-2);
    gap: 10px;
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: none;
    background: transparent;
    color: var(--nav-text);
    font-size: 14px;
    font-weight: 500;
  }
  .sidebar .nav-item .icon { width: var(--icon-sm); height: var(--icon-sm); }
  .sidebar .nav-item:hover { background: var(--nav-hover); color: var(--nav-text-strong); }
  .sidebar .nav-item.active,
  .sidebar .nav-item[aria-current="page"] { background: var(--nav-active); color: var(--nav-active-text); border: 0; box-shadow: none; }
  .sidebar .nav-item .icon { color: inherit; stroke: currentColor; }
  .sidebar .nav-item.active .icon, .sidebar .nav-item[aria-current="page"] .icon { color: var(--cp-blue); }
  .sidebar .nav-item:focus-visible { outline: 2px solid var(--cp-blue); outline-offset: 1px; }
  .sidebar .sidebar-note, .sidebar .sidebar-bottom { color: var(--nav-faint); }

  /* Top bar */
  .shell .topbar { height: 48px; padding: 0 var(--space-6); }
  .shell .breadcrumb { font-size: 13px; }
  .shell .search-field input { height: var(--control-h); border-radius: var(--radius-sm); }

  /* Pages */
  .shell .dashboard,
  .shell .project-page { padding: var(--space-6) var(--space-8) var(--space-8); }
  .shell .page-heading { padding-bottom: var(--space-4); margin-bottom: var(--space-4); align-items: center; }
  .shell .page-heading h1 { font-size: 22px; letter-spacing: -0.01em; }
  .shell .page-heading p { font-size: 13px; margin-top: 2px; }

  /* Buttons: compact in toolbars and headings */
  .shell .btn { height: var(--control-h); min-height: 0; padding: 0 var(--space-3); font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); gap: 6px; }
  .shell .btn .icon { width: var(--icon-sm); height: var(--icon-sm); }
  .shell .icon-btn { border-radius: var(--radius-sm); }
  .shell .topbar .icon-btn .icon,
  .shell .project-bar .icon-btn .icon { width: var(--icon-md); height: var(--icon-md); }

  /* Project bar: a flat header row, not a card */
  .shell .project-bar {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 var(--space-3);
    margin-bottom: var(--space-6);
  }
  .shell .project-bar h1 { font-size: 20px; letter-spacing: -0.01em; }
  .shell .project-bar .icon-btn { width: var(--control-h); height: var(--control-h); }
  .shell .workspace-project-toolbar:not(.project-bar) { border-radius: var(--radius-md); box-shadow: none; }

  /* Cards */
  .shell .project-grid { gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
  .shell .project-card,
  .shell .asset-card { border-radius: var(--radius-lg); box-shadow: none; border: 1px solid var(--line); transition: box-shadow var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease); }
  .shell .project-card:hover,
  .shell .asset-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
  .shell .asset-details { padding: var(--space-3); gap: 2px; }
  .shell .asset-details strong,
  .shell .project-card h2,
  .shell .project-card h3 { font-size: 14px; font-weight: 500; }
  .shell .asset-details span { font-size: 12px; color: var(--text-muted); }
  .shell .project-card:hover,
  .shell .asset-card:hover { box-shadow: none; border-color: var(--line-strong); }

  /* Thumbnails float on a grey well, like paper on a desk (markup.io) */
  .shell .asset-card .asset-thumb,
  .shell .project-card .project-preview { background: var(--thumb-well); }
  .shell .asset-card .asset-thumb img,
  .shell .project-card .project-preview img {
    box-sizing: border-box;
    padding: var(--space-4) var(--space-4) 0;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 1px 2px rgba(23, 23, 19, 0.12)) drop-shadow(0 4px 10px rgba(23, 23, 19, 0.06));
  }
}

  /* Project bar: New folder and Upload are icon buttons (with tooltips) up to 1440px; More is always ⋯. */
@media (max-width: 1440px) {
  .project-bar #new-subproject, .project-bar #upload-files { font-size: 0; gap: 0; width: var(--control-h); padding: 0; justify-content: center; }
  .project-bar #new-subproject .icon, .project-bar #upload-files .icon { width: var(--icon-md); height: var(--icon-md); }
}
.project-bar #project-more > summary.icon-only { width: var(--control-h); padding: 0; justify-content: center; }
.project-bar #project-more > summary.icon-only .icon { width: var(--icon-md); height: var(--icon-md); }
@media (max-width: 760px) {
  .project-bar #new-subproject, .project-bar #upload-files, .project-bar #project-more > summary.icon-only { width: var(--touch-target); }
}

/* Redesign v2 buttons: Core Blue for the main action, beige for everything else (no grey). */
.shell .btn.secondary,
.shell .project-bar #project-more > summary.btn,
.shell .page-actions > .btn.secondary {
  background: var(--btn-soft);
  border: 1px solid transparent;
  color: var(--btn-soft-text);
  box-shadow: none;
}
.shell .btn.secondary:hover,
.shell .project-bar #project-more > summary.btn:hover,
.shell .project-bar #project-more[open] > summary.btn { background: var(--btn-soft-hover); }
.shell .btn.primary { background: var(--cp-blue); border-color: var(--cp-blue); color: #fff; }
.shell .btn.primary:hover { background: var(--cp-blue-hover); border-color: var(--cp-blue-hover); }
.shell .icon-btn:hover,
.shell .icon-btn[aria-expanded="true"] { background-color: var(--btn-soft); }
.shell .search-field input { background: var(--surface); border: 1px solid var(--line-strong); }
/* Thumbnail well and floating file on every width (phones too). */
.shell .asset-card .asset-thumb,
.shell .project-card .project-preview { background: var(--thumb-well); }
.shell .asset-card .asset-thumb img,
.shell .project-card .project-preview img {
  box-sizing: border-box;
  padding: var(--space-4) var(--space-4) 0;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 1px 2px rgba(23, 23, 19, 0.12)) drop-shadow(0 4px 10px rgba(23, 23, 19, 0.06));
}

/* ==========================================================================
   Redesign v2: review screen (markup.io layout, Casepoint colours).
   ========================================================================== */
.review-shell .review-header { height: 56px; padding: 0 var(--space-4); border-bottom: 1px solid var(--line); }
.review-shell .review-title h1 { font-size: 14px; font-weight: 600; }
.review-shell .review-header .btn { height: var(--control-h); min-height: 0; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); padding: 0 var(--space-3); }
.review-shell .review-header .btn.primary { background: var(--cp-blue); border-color: var(--cp-blue); }
.review-shell .review-header .btn.primary:hover { background: var(--cp-blue-hover); }
.review-shell .review-header .btn.primary .icon { width: var(--icon-sm); height: var(--icon-sm); }
.review-shell .icon-btn:hover,
.review-shell .icon-btn[aria-pressed="true"],
.review-shell .icon-btn[aria-expanded="true"] { background-color: var(--btn-soft); }
.review-shell .approval-button { background: var(--btn-soft); }
.review-shell .approval-button:hover { background: var(--btn-soft-hover); }

/* Comment / Browse switch: hairline frame, Core Blue for the active mode */
.review-shell .canvas-bottom.review-mode { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 2px; height: auto; }
.review-shell .review-mode .btn { height: 28px; min-height: 0; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-muted); background: transparent; box-shadow: none; padding: 0 var(--space-3); }
.review-shell .review-mode .btn .icon { width: var(--icon-sm); height: var(--icon-sm); }
.review-shell .review-mode .btn.active { background: var(--cp-blue); color: #fff; box-shadow: none; }
.review-shell .review-mode .btn:not(.active):hover { color: var(--text); background: var(--btn-soft); }

/* Left comment panel */
.review-shell .review-project-title h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.review-shell .comment-panel .tab { font-size: 13px; font-weight: 500; }
.review-shell .comment-panel .tab.active { font-weight: 600; }
.review-shell .chip { background: var(--btn-soft); border-color: transparent; color: var(--text); font-weight: 500; }
.review-shell .chip:hover { background: var(--btn-soft-hover); }
.review-shell .chip.active { background: var(--cp-blue); border-color: var(--cp-blue); color: #fff; }
.review-shell .comment-tools input,
.review-shell .comment-tools select { height: var(--control-h); min-height: 0; background-color: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 13px; }
.review-shell .file-group-head { background: var(--thumb-well); font-size: 12px; }
.review-shell .file-group-head.current { background: var(--btn-soft); }
.review-shell .comment-card { transition: background-color var(--duration-fast) var(--ease); }
.review-shell .comment-card:hover { background: var(--thumb-well); }
.review-shell .comment-card.selected { background: var(--surface-selected); box-shadow: inset 2px 0 0 var(--cp-blue); }

/* Canvas toolbar and viewer */
.review-shell .canvas-toolbar { height: 48px; }
.review-shell .zoom-controls { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: none; }
.review-shell .viewer-scroll { background: var(--thumb-well); }

/* Files panel: hairline-framed thumbnails, Core Blue frame for the open file */
.review-shell .files-view { background: var(--btn-soft); border-color: transparent; }
.review-shell .file-thumbnail { border: 1px solid transparent; }
.review-shell .file-thumbnail .thumbnail-preview { background: var(--thumb-well); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.review-shell .file-thumbnail:hover .thumbnail-preview { border-color: var(--line-strong); }
.review-shell .file-thumbnail[aria-current="true"] { background: transparent; border-color: transparent; box-shadow: none; }
.review-shell .file-thumbnail[aria-current="true"] .thumbnail-preview { border: 2px solid var(--cp-blue); }
.review-shell .file-thumbnail[aria-current="true"] span:last-child { color: var(--cp-blue); font-weight: 600; }

/* Phones: Viewer / Comments switch in beige with a white thumb */
.review-shell .mobile-tabs { background: var(--btn-soft); }

/* Review header: version approval as one quiet status dropdown (markup.io's "No status" control). */
.review-shell .approval-button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px 0 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: none;
}
.review-shell .approval-button:hover { background: var(--thumb-well); border-color: var(--text-faint); }
.review-shell .approval-button .icon { width: 14px; height: 14px; color: var(--text-muted); }
.review-shell .approval-button .status-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; border: 1.5px solid var(--text-faint); box-sizing: border-box; }
.review-shell .approval-button.status-in_review .status-dot { background: var(--cp-yellow); border-color: var(--cp-yellow); }
.review-shell .approval-button.status-changes_requested .status-dot { background: var(--danger); border-color: var(--danger); }
.review-shell .approval-button.status-approved .status-dot { background: var(--success); border-color: var(--success); }
.review-shell .approval-button .approval-ask { color: var(--cp-blue); font-weight: 600; }
.review-shell .approval-button .approval-ask::before { content: "·"; margin-right: 6px; color: var(--text-faint); font-weight: 400; }
.review-shell .review-heading #approval-slot { flex: none; margin-left: var(--space-3); display: inline-flex; align-items: center; }
.review-shell .review-heading #approval-slot:empty { display: none; }
@media (max-width: 760px) { .review-shell .review-heading #approval-slot { margin-left: var(--space-2); } .review-shell .approval-button .approval-text { display: none; } .review-shell .approval-button { padding: 0 6px; } }

/* ==========================================================================
   Redesign v2: settings pages, forms and dialogs.
   ========================================================================== */
@media (min-width: 761px) {
  /* The sidebar edge runs the full page height, not just the first screen. */
  .shell .sidebar { border-right: 0; }
  .shell .page { border-left: 1px solid var(--line); min-width: 0; }
  /* Fields: 36px on desktop, white with a hairline; phones keep the touch size. */
  .shell .field input:not([type="checkbox"]):not([type="radio"]),
  .shell .field select,
  .modal .field input:not([type="checkbox"]):not([type="radio"]),
  .modal .field select,
  .shell .account-page input[type="text"], .shell .account-page input[type="password"], .shell .account-page input[type="email"] {
    height: 36px; min-height: 0; font-size: 14px; border-radius: var(--radius-sm);
  }
  .modal .btn { height: 36px; min-height: 0; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); }
}
/* The breadcrumb already names the page, so the blue eyebrow above the heading goes. */
.shell .page-heading .eyebrow,
.shell main > .eyebrow,
.shell .account-page .eyebrow,
.shell .trash-page .eyebrow { display: none; }
/* Chosen option: thin Core Blue frame and a faint tint, not a thick ring. */
.choice:has(input:checked) { border-color: var(--cp-blue); background: var(--surface-selected); box-shadow: none; }
.modal .btn.secondary { background: var(--btn-soft); border-color: transparent; color: var(--text); }
.modal .btn.secondary:hover { background: var(--btn-soft-hover); }
/* Sign-in: faint beige welcome panel (default #faf7f1, admin-configurable) and a white form side. */
.auth-page:not(.branding-preview) .auth-story { border-right: 1px solid var(--line); }
.auth-page .auth-panel { background: var(--surface); }
@media (max-width: 760px) {
  /* Phones: the same flat project header as desktop, not a boxed card. */
  .shell .project-bar { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 0 0 var(--space-3); margin-bottom: var(--space-4); }
  .shell .project-bar h1 { font-size: 18px; }
  .shell .project-card, .shell .asset-card { box-shadow: none; border-radius: var(--radius-lg); }
}

/* ==========================================================================
   Redesign v2: conversation thread docked in the left panel (desktop), like markup.io.
   Same #modal dialog and controls as the popup; only its place and layout change.
   ========================================================================== */
#modal.pin-dialog.thread-docked {
  position: fixed; margin: 0; padding: 0;
  flex-direction: column;
  border: 0; border-right: 1px solid var(--line); border-radius: 0;
  box-shadow: none; background: var(--surface);
  max-height: none; overflow: hidden; z-index: 30;
  animation: thread-in var(--duration-fast) var(--ease);
}
#modal.pin-dialog.thread-docked[open] { display: flex; }
@keyframes thread-in { from { opacity: 0; } }
#modal.thread-docked > .modal-head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--line); margin: 0; flex: none;
}
#modal.thread-docked > .modal-head > button[aria-label="Close dialog"] { order: -1; width: var(--control-h); height: var(--control-h); }
#modal.thread-docked #modal-title { flex: 1; font-size: 15px; font-weight: 600; margin: 0; }
#modal.thread-docked .conversation-actions { display: flex; align-items: center; gap: var(--space-2); }
#modal.thread-docked > .modal-description { padding: var(--space-4) var(--space-4) 0; margin: 0; font-size: 13px; flex: none; }
#modal.thread-docked .conversation-body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-2) var(--space-4) var(--space-4); min-height: 0; }
#modal.thread-docked .conversation-text { font-size: 14px; line-height: 1.5; }
#modal.thread-docked .reply { margin: var(--space-3) 0 0; padding: var(--space-3) 0 0 var(--space-3); border-left: 2px solid var(--line); border-top: 0; }
#modal.thread-docked .reply strong { font-size: 13px; }
#modal.thread-docked .reply p { font-size: 14px; margin: 2px 0; }
#modal.thread-docked .reply time { font-size: 12px; color: var(--text-muted); }
#modal.thread-docked .task-fields,
#modal.thread-docked fieldset { margin: 0 var(--space-4) var(--space-3); flex: none; }
#modal.thread-docked #conversation-reply,
#modal.thread-docked .conversation-signin { flex: none; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); margin: 0; background: var(--surface); }
#modal.thread-docked #conversation-reply .field { margin: 0; }
#modal.thread-docked .thread-footer {
  flex: none; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-top: 1px solid var(--line); background: var(--thumb-well);
}
#modal.thread-docked .thread-footer .conversation-count { font-size: 13px; font-weight: 500; min-width: 64px; text-align: center; }
#modal.thread-docked #modal-title { display: block; position: static; width: auto; height: auto; clip: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#modal.thread-docked .thread-footer { width: 100%; box-sizing: border-box; align-self: stretch; }

/* Reply composer: one bordered field with a small send button inside (Lucide send icon).
   Quiet beige while empty, Core Blue once there is something to send. */
#conversation-reply .field {
  align-items: flex-end; gap: 4px; padding: 4px 4px 4px 0;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
#conversation-reply .field:focus-within { border-color: var(--cp-blue); box-shadow: 0 0 0 3px var(--surface-selected); }
#conversation-reply textarea { background: transparent; border: 0; box-shadow: none; outline: none; padding: 6px 10px; height: 32px; min-height: 32px; font-size: 14px; }
#conversation-reply textarea:focus, #conversation-reply textarea:focus-visible { outline: none; box-shadow: none; }
#conversation-reply button[type="submit"] {
  flex: none; width: 30px; height: 30px; min-height: 0; padding: 0;
  display: inline-grid; place-items: center;
  border: 0; border-radius: var(--radius-sm);
  background: var(--cp-blue); color: #fff; box-shadow: none;
}
#conversation-reply button[type="submit"]::after { content: none; }
#conversation-reply button[type="submit"] .icon { width: 15px; height: 15px; stroke-width: 2; }
#conversation-reply button[type="submit"]:hover { background: var(--cp-blue-hover); }
#conversation-reply .field:has(textarea:placeholder-shown) button[type="submit"] { background: var(--btn-soft); color: var(--text-muted); }

/* Docked thread, premium pass: a light task row instead of a boxed form, a quiet Edit,
   and a calm focus ring on the back button. */
#modal.thread-docked .task-controls {
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
  margin: 0; padding: var(--space-3) var(--space-4) var(--space-2);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-2);
  flex: none; background: var(--surface);
}
#modal.thread-docked .task-controls legend {
  float: left; grid-column: 1 / -1; padding: 0; margin: 0 0 2px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
#modal.thread-docked .task-controls label { display: grid; gap: 4px; font-size: 12px; color: var(--text-muted); margin: 0; }
#modal.thread-docked .task-controls label:first-of-type { grid-column: 1 / -1; }
#modal.thread-docked .task-controls select,
#modal.thread-docked .task-controls input {
  height: 32px; min-height: 0; font-size: 13px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background-color: var(--surface);
}
#modal.thread-docked .conversation-actions .text-link {
  height: 28px; padding: 0 var(--space-2); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none;
}
#modal.thread-docked .conversation-actions .text-link:hover { background: var(--btn-soft); }
#modal.thread-docked #toggle-resolved { width: 28px; height: 28px; min-height: 0; border-radius: 50%; }
#modal.thread-docked > .modal-head > button:focus:not(:focus-visible) { outline: none; box-shadow: none; }
#modal.thread-docked > .modal-head > button:focus-visible { outline: 2px solid var(--cp-blue-20); outline-offset: 0; }

/* Version history: a visible picker with a clock icon ("v2 · Latest"), shown once a file has been replaced. */
.review-shell .version-picker { display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 4px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.review-shell .version-picker:has(select[hidden]) { display: none; }
.review-shell .version-picker .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--text-muted); }
.review-shell .version-picker select { border: 0; background-color: transparent; height: 100%; min-height: 0; padding: 0 22px 0 0; font-size: 13px; font-weight: 500; max-width: 180px; box-shadow: none; }
.review-shell .history-view .version-picker,
.review-shell.history-view .version-picker { border-color: var(--cp-blue); background: var(--surface-selected); }

/* Polish: file-type tiles in the Files panel match the project cards (icon on a small white tile). */
.review-shell .thumbnail-preview .thumb-kind { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-rest), 0 0 0 1px var(--line); }
.review-shell .thumbnail-preview .thumb-kind .icon { width: 18px; height: 18px; }
.review-shell .thumbnail-preview .thumb-kind.video .icon { color: var(--cp-blue); }
.review-shell .thumbnail-preview .thumb-kind.pdf .icon { color: var(--danger); }
.review-shell .thumbnail-preview { display: grid; place-items: center; }
/* Zoom menu shows its full label; the file sits on the well like paper. */
.review-shell .canvas-toolbar #zoom-select { min-width: 132px; }
.review-shell #viewer-stage > img,
.review-shell #viewer-stage > canvas { box-shadow: 0 1px 2px rgba(23, 23, 19, 0.06), 0 8px 24px rgba(23, 23, 19, 0.06); }
.review-shell .canvas-toolbar #zoom-select { min-width: 148px; }
/* Cards: no divider between title and details (markup.io); details sit just under the title. */
.shell .project-footer { border-top: 0; margin-top: var(--space-1); padding-top: 0; }
.shell .folder-card .project-footer { margin-top: var(--space-2); }
/* Dashboard find bar: a flat row like the project bar, not a boxed card under the heading line. */
@media (min-width: 761px) {
  .shell .dashboard .workspace-project-toolbar:not(.project-bar) { background: transparent; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; border-radius: 0; padding: 0 0 var(--space-3); margin: var(--space-6) 0 var(--space-6); }
  .shell .dashboard .page-heading { border-bottom: 0; margin-bottom: var(--space-2); padding-bottom: 0; }
}

/* Comment bar (markup.io): "5 Open · 2 Resolved" tabs with sort, filter and search icons.
   Each icon opens its control in a slim row underneath; a dot marks one that is in use. */
.review-shell .comment-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); border-bottom: 1px solid var(--line); padding: 0 var(--space-2) 0 var(--space-4); }
.review-shell .comment-bar .tabs { border: 0; gap: var(--space-4); padding: 0; margin: 0; }
.review-shell .comment-bar .tab { padding: 10px 0; display: inline-flex; gap: 5px; align-items: baseline; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.review-shell .comment-bar .tab.active { color: var(--text); font-weight: 600; }
.review-shell .comment-bar .tab-count { font-variant-numeric: tabular-nums; }
.review-shell .comment-bar-tools { display: flex; gap: 2px; padding-bottom: 5px; }
.review-shell .comment-bar-tools .icon-btn { width: 28px; height: 28px; min-height: 0; position: relative; color: var(--text-muted); }
.review-shell .comment-bar-tools .icon-btn .icon { width: var(--icon-sm); height: var(--icon-sm); }
.review-shell .comment-bar-tools .icon-btn:hover, .review-shell .comment-bar-tools .icon-btn[aria-expanded="true"] { color: var(--text); background: var(--btn-soft); }
.review-shell .comment-bar-tools .icon-btn.is-set::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--cp-blue); box-shadow: 0 0 0 2px var(--surface); }
.review-shell .comment-tools { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.review-shell .comment-tools[hidden], .review-shell .comment-tools [hidden] { display: none; }
.review-shell .comment-tools > * { width: 100%; }
.review-shell .comment-panel-header > p { display: none; }
.review-shell .comment-panel-header { padding-bottom: 0; border-bottom: 0; }
.review-shell .comment-panel-header .tabs:not(.comment-bar .tabs) { display: none; }

/* Project status (markup.io's status menu): a quiet button with a coloured dot and a one-click list. */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-sizing: border-box; background: transparent; border: 1.5px solid var(--text-faint); }
.status-open_for_review .status-dot { background: var(--cp-blue); border-color: var(--cp-blue); }
.status-editing .status-dot { background: var(--cp-yellow); border-color: var(--cp-yellow); }
.status-on_hold .status-dot { background: var(--danger); border-color: var(--danger); }
.status-completed .status-dot { background: var(--success); border-color: var(--success); }
.review-shell .review-heading #status-slot { flex: none; margin-left: var(--space-3); display: inline-flex; align-items: center; position: relative; }
.review-shell .review-heading #status-slot:empty { display: none; }
.status-menu { position: relative; }
.status-menu > summary { list-style: none; }
.status-menu > summary::-webkit-details-marker { display: none; }
.status-button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap;
}
.status-button:hover, .status-menu[open] > .status-button { background: var(--thumb-well); border-color: var(--text-faint); }
.status-button.read-only { cursor: default; padding-right: 10px; }
.status-button .icon { width: 14px; height: 14px; color: var(--text-muted); }
.status-list {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 200px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-float);
}
.status-list button {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px 0 6px;
  border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left;
}
.status-list button:hover, .status-list button:focus-visible { background: var(--btn-soft); outline: none; }
.status-list .status-check { width: 16px; display: inline-grid; place-items: center; color: var(--cp-blue); }
.status-list .status-check .icon { width: 14px; height: 14px; stroke-width: 2.25; }
@media (max-width: 760px) { .review-shell .status-button .status-text { display: none; } .review-shell .status-button { padding: 0 6px; } .review-shell .review-heading #status-slot { margin-left: var(--space-2); } }
.project-status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* Version approval as a More-menu item; a dot on ⋯ when someone is waiting on you. */
.review-more .approval-item-status { margin-left: auto; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.review-more .approval-item.status-approved .approval-item-status { color: var(--success); }
.review-more .approval-item.status-changes_requested .approval-item-status { color: var(--danger); }
.review-more .approval-item .approval-ask { margin-left: 6px; font-size: 12px; color: var(--cp-blue); font-weight: 600; }
.review-more.has-ask > summary { position: relative; }
.review-more.has-ask > summary::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--cp-blue); box-shadow: 0 0 0 2px var(--surface); }
.shell .project-card .project-status-badge { margin-top: 2px; }
.review-shell .comment-bar .tabs { display: flex; flex-direction: row; flex-wrap: nowrap; width: auto; flex: 1 1 auto; min-width: 0; }
.review-shell .comment-bar .tab { flex: none; width: auto; margin: 0; white-space: nowrap; border-bottom: 2px solid transparent; }
.review-shell .comment-bar .tab.active { border-bottom-color: var(--cp-blue); }
.review-shell .comment-bar-tools { flex: none; }
.review-shell .comment-bar { padding: 0; margin-right: -8px; gap: var(--space-2); }
.review-shell .comment-bar .tabs { gap: var(--space-3); }
.review-shell .comment-bar-tools { gap: 0; }

/* Card status stays independent of the project link and fits in the existing white card. */
.project-card-shell:has(> .card-status-slot) .project-info { padding-bottom: 52px; }
.card-status-slot { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.card-status-slot .status-button { height: 28px; padding: 0 6px; border-color: transparent; background: transparent; }
.card-status-slot .status-button:hover,
.card-status-slot .status-menu[open] > .status-button { background: var(--btn-soft); border-color: transparent; }
.status-list[popover] { position: fixed; margin: 0; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
.status-button[aria-disabled="true"] { cursor: progress; }
@media (max-width: 760px), (pointer: coarse) {
  .project-card-shell:has(> .card-status-slot) .project-info { padding-bottom: 64px; }
  .card-status-slot .status-button { height: 40px; }
  .status-list button { min-height: 44px; }
}
