:root {
  --bg: hsl(220, 20%, 97%);
  --surface: #ffffff;
  --surface2: hsl(220, 15%, 93%);
  --border: hsl(220, 15%, 88%);
  --text: hsl(220, 25%, 10%);
  --muted: hsl(220, 10%, 45%);
  --accent: hsl(152, 55%, 36%);
  --accent-hover: hsl(152, 55%, 28%);
  --danger: hsl(0, 84%, 60%);
  --success: hsl(152, 45%, 45%);
  --warning: hsl(38, 92%, 50%);
  --radius: 8px;
  --radius-lg: 12px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app { height: 100%; display: flex; flex-direction: column; }

#mainScreen {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Screens ─────────────────────────────── */
.screen { height: 100%; }
.screen--login {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(39,122,82,0.12), transparent 60%),
              radial-gradient(ellipse at 80% 70%, rgba(74,160,100,0.14), transparent 50%),
              var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: min(380px, 90vw);
}
.login-card__logo {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.login-card__logo-icon { color: var(--accent); flex-shrink: 0; }
.login-card__logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.login-card__logo-top { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.login-card__logo-bottom { font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: 0.5px; text-transform: uppercase; }
.login-card__title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.login-card__sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }

input[type="text"], input[type="password"], input[type="url"],
input[type="email"], input[type="number"], textarea, select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 150ms;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}
select { cursor: pointer; }

.error-msg { color: var(--danger); font-size: 13px; }

/* ── Password toggle ─────────────────────── */
.pass-wrap {
  position: relative;
}
.pass-wrap input {
  padding-right: 40px;
}
.pass-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  opacity: 0.45;
  transition: opacity 120ms;
  user-select: none;
}
.pass-toggle:hover { opacity: 0.85; }
.pass-toggle.active { opacity: 1; }
.pass-match-icon {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(152, 55%, 36%);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
}
.btn:hover { background: rgba(0,0,0,0.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: rgba(240,106,106,0.1); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--icon {
  width: 32px; height: 32px; padding: 0;
  font-size: 16px; border-radius: 50%;
}

/* ── Topbar ──────────────────────────────── */
.topbar {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(39,122,82,0.07);
  flex-shrink: 0;
  z-index: 10;
}
.brand { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.brand__logo { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.brand__logo-icon { color: var(--accent); flex-shrink: 0; }
.brand__logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__logo-top { font-size: 9px; font-weight: 400; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.brand__logo-bottom { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: 0.5px; text-transform: uppercase; }
.brand__divider { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }
.brand__info { display: flex; flex-direction: column; gap: 1px; }
.brand__title { font-weight: 700; font-size: 16px; }
.brand__subtitle { font-size: 12px; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 8px; }

/* ── Views ───────────────────────────────── */
.view { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.view__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.view__header h2 { font-size: 18px; font-weight: 600; }
.view__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Asset grid ──────────────────────────── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.asset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color 150ms, transform 120ms;
}
.asset-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(39,122,82,0.12); }
.asset-card__title { font-weight: 600; margin-bottom: 4px; }
.asset-card__meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.asset-card__desc { font-size: 13px; color: var(--muted); margin-top: 6px; }

.type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.type-badge--panorama { background: #dbeafe; color: #3b82f6; }
.type-badge--video    { background: #ede9fe; color: #7c3aed; }
.type-badge--text     { background: #dcfce7; color: #16a34a; }
.type-badge--audio    { background: #ffedd5; color: #ea580c; }
.type-badge--art      { background: #fce7f3; color: #be185d; }

/* ── Art viewer ─────────────────────────────────────────── */
.art-viewer {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #111;
}
.art-img-container {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  cursor: crosshair;
  touch-action: none;
}
.art-img {
  display: block;
  user-select: none;
  pointer-events: none;
}
.art-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.art-selection {
  position: absolute;
  border: 2px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  pointer-events: none;
  z-index: 10;
}
.art-annotation {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}
.art-annotation--point {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.art-annotation--rect {
  border: 2px solid rgba(239, 68, 68, 0.85);
  background: rgba(239, 68, 68, 0.10);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.art-annotation__num {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  background: rgba(239, 68, 68, 0.9);
  border-radius: 2px;
  padding: 1px 3px;
}
.art-annotation--highlight {
  outline: 3px solid #f59e0b;
}

.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.status-badge--pending   { background: #f1f2f7; color: var(--muted); }
.status-badge--in_review { background: #fef3c7; color: #b45309; }
.status-badge--reviewed  { background: #dbeafe; color: #1d4ed8; }
.status-badge--approved  { background: #dcfce7; color: #15803d; }
.status-badge--rejected  { background: #fee2e2; color: #dc2626; }
.status-badge--working   { background: #ede9fe; color: #6d28d9; }

/* Audit log table */
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th { text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); }
.audit-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.audit-table tbody tr:hover { background: rgba(0,0,0,.02); }
.audit-table tbody tr:last-child td { border-bottom: none; }

.location-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  background: hsl(38, 92%, 90%); color: hsl(38, 60%, 30%);
}

.user-loc-select {
  font-size: 12px; padding: 3px 6px; height: 28px;
  width: auto; min-width: 130px;
}

.user-locs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  max-width: 280px;
}

.loc-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.loc-check input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.location-checkboxes-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}

.location-checkboxes-form {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 6px 0 2px;
}

.location-checkboxes-form .loc-check {
  font-size: 13px;
  color: var(--text);
}

/* ── Review layout ───────────────────────── */
.review-layout {
  display: flex;
  height: calc(100vh - 57px);
  gap: 0;
  margin: -16px;
}
.review-layout__viewer {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  min-width: 0;
}
.review-layout__panel {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.panel-header h3 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-select {
  font-size: 12px; padding: 4px 8px; min-width: 120px;
}

.comment-list {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}

.comment-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms;
}
.comment-item:hover { border-color: var(--accent); }
.comment-item__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.comment-item__author { font-weight: 600; font-size: 12px; color: var(--accent); }
.comment-item__time { font-size: 11px; color: var(--muted); }
.comment-item__content { line-height: 1.4; }
.comment-item__region-info { font-size: 11px; color: var(--muted); margin-top: 4px; }
.comment-item__attachments { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.comment-item__attachments img {
  max-width: 160px; max-height: 100px; border-radius: 4px;
  border: 1px solid var(--border); cursor: pointer;
}
.comment-item__attachments audio {
  width: 100%; max-width: 100%; display: block;
}
.comment-item__attachments a {
  color: var(--accent); font-size: 12px; text-decoration: none;
}
.comment-item__attachments a:hover { text-decoration: underline; }
.comment-item__delete {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 14px; padding: 2px 4px; opacity: 0.6;
}
.comment-item__delete:hover { opacity: 1; }
.comment-item__edit {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 4px; opacity: 0.6;
}
.comment-item__edit:hover { opacity: 1; color: var(--accent); }
.edit-attachment-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 0;
}
.edit-attachment-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Viewer toolbars ─────────────────────── */
.viewer-toolbar {
  position: absolute;
  bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px 10px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(39,122,82,0.18);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  z-index: 20;
}

.viewer-toolbar .btn { height: 32px; font-size: 12px; color: var(--text); }

/* Annotation rectangle */
.annotation-rect {
  position: absolute;
  border: 2px solid #ef4444;
  background: rgba(239,68,68,0.08);
  pointer-events: none;
  z-index: 15;
}
.annotation-rect--active {
  pointer-events: auto;
  cursor: pointer;
}
.annotation-rect--highlight {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.15);
  animation: pulse-rect 1s ease-in-out 3;
}

@keyframes pulse-rect {
  0%, 100% { border-color: #f59e0b; }
  50% { border-color: #fbbf24; box-shadow: 0 0 12px rgba(245,158,11,0.4); }
}

/* Panorama overlay */
.panorama-overlay {
  position: absolute; inset: 0;
  cursor: crosshair;
  z-index: 12;
}
.panorama-drawing-rect {
  position: absolute;
  border: 2px dashed #ef4444;
  background: rgba(239,68,68,0.1);
  pointer-events: none;
}

.panorama-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(39,122,82,0.22), transparent 45%),
    radial-gradient(circle at 75% 80%, rgba(74,160,100,0.16), transparent 45%),
    rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
}

.panorama-loading.hidden {
  display: none;
}

.panorama-loading__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(39,122,82,0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 24px rgba(39,122,82,0.1);
}

.panorama-loading__spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(39,122,82,0.2);
  border-top-color: hsl(152, 55%, 36%);
  border-right-color: hsl(38, 92%, 50%);
  animation: panorama-spin 0.9s linear infinite;
}

.panorama-loading__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
}

.panorama-loading__text {
  font-size: 12px;
  color: var(--muted);
}

.panorama-loading__progress {
  width: min(320px, 70vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(39,122,82,0.12);
  overflow: hidden;
  border: 1px solid rgba(39,122,82,0.15);
}

.panorama-loading__progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, hsl(152, 55%, 36%), hsl(152, 55%, 52%));
  transition: width 120ms ease;
}

.panorama-loading__progress--indeterminate .panorama-loading__progress-fill {
  width: 42%;
  animation: panorama-progress-indeterminate 1.1s ease-in-out infinite;
}

.panorama-loading__percent {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2px;
}

@keyframes panorama-spin {
  to { transform: rotate(360deg); }
}

@keyframes panorama-progress-indeterminate {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(25%); }
  100% { transform: translateX(260%); }
}

/* Transparency slider */
.transparency-control {
  position: absolute;
  top: 12px; left: 12px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(39,122,82,0.18);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 20;
  font-size: 12px;
  color: var(--text);
}
.transparency-control input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}

/* ── Visualization reference panel ──────── */
.viz-panel {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface2);
}
.viz-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.viz-panel__body {
  background: #000;
  text-align: center;
}
.viz-panel__img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.audio-viewer .viz-panel {
  max-width: 700px;
}

/* ── Text reviewer ───────────────────────── */
.text-viewer {
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  height: 100%;
  overflow-y: auto;
  user-select: text;
  background: var(--surface);
  color: var(--text);
}
.text-highlight {
  background: rgba(239,68,68,0.2);
  border-bottom: 2px solid var(--danger);
  cursor: pointer;
  transition: background 150ms;
}
.text-highlight:hover { background: rgba(239,68,68,0.35); }
.text-highlight--active { background: rgba(245,158,11,0.3); border-color: var(--warning); }

/* ── Audio reviewer ──────────────────────── */
.audio-viewer {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 24px; gap: 24px;
}
.audio-player-wrap {
  width: 100%; max-width: 700px;
}
.audio-player-wrap audio { width: 100%; }
.audio-timeline {
  position: relative;
  width: 100%; max-width: 700px;
  height: 60px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: crosshair;
  overflow: hidden;
}
.audio-timeline__progress {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: rgba(39,122,82,0.15);
  pointer-events: none;
}
.audio-timeline__selection {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(239,68,68,0.2);
  border-left: 2px solid var(--danger);
  border-right: 2px solid var(--danger);
  pointer-events: none;
}
.audio-timeline__marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  pointer-events: none;
  z-index: 2;
}
.audio-marker-dot {
  position: absolute;
  top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: var(--danger);
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
}

/* ── Video overlay ───────────────────────── */
.video-container {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.video-container video {
  max-width: 100%; max-height: 100%;
}
.video-overlay {
  position: absolute; inset: 0;
  cursor: crosshair;
  z-index: 12;
}

/* ── Modal ───────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(13,24,18,0.35);
  backdrop-filter: blur(4px);
}
.modal__content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(460px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
}
.modal__content h3 { margin-bottom: 14px; }
.modal__content form { display: flex; flex-direction: column; gap: 10px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ── Admin — dashboard layout ────────────── */
.admin-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form--inline { flex-direction: row; align-items: center; flex-wrap: wrap; }
.admin-form--inline input { flex: 1 1 180px; min-width: 0; }
.file-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.file-label input[type="file"] { font-size: 13px; }

/* Stats row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 150ms;
}
.stat-card--accent  { border-color: rgba(39,122,82,0.4); background: #f0fdf4; }
.stat-card--warn    { border-color: rgba(245,158,11,0.35);  background: #fffbeb; }
.stat-card--success { border-color: rgba(91,191,133,0.4);   background: #f0fdf4; }
.stat-card__value { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card--accent  .stat-card__value { color: hsl(152, 55%, 28%); }
.stat-card--warn    .stat-card__value { color: #b45309; }
.stat-card--success .stat-card__value { color: #15803d; }
.stat-card__label { font-size: 12px; color: var(--muted); }

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  padding: 9px 18px;
  border: none; background: none;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
  border-radius: var(--radius) var(--radius) 0 0;
}
.admin-tab:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.admin-tab--active { color: var(--text); border-bottom-color: var(--accent); }

/* Cards */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-card__header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.admin-card__header h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.admin-card__body { padding: 18px; }
.admin-card__body--flush { padding: 0; }

/* Two-column panel layout */
.admin-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Role badges */
.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
}
.role-badge--admin    { background: #dcfce7; color: hsl(152, 55%, 28%); }
.role-badge--reviewer { background: #dcfce7; color: #15803d; }
.role-badge--supplier { background: #ffedd5; color: #c2410c; }

/* User list */
.user-list { display: flex; flex-direction: column; }
.user-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 8px;
  transition: background 120ms;
}
.user-item:last-child { border-bottom: none; }
.user-item:hover { background: rgba(255,255,255,0.03); }
.user-item__info { display: flex; gap: 10px; align-items: center; min-width: 0; flex-wrap: wrap; }
.user-item__username { font-size: 12px; color: var(--muted); }
.you-badge { font-size: 11px; color: var(--muted); padding: 2px 8px; background: var(--surface2); border-radius: 4px; }

/* Invite list */
.invite-list { display: flex; flex-direction: column; }
.invite-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 8px;
  transition: background 120ms;
}
.invite-item:last-child { border-bottom: none; }
.invite-item:hover { background: rgba(255,255,255,0.03); }
.invite-item__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.invite-item__name { font-weight: 600; }
.invite-item__email { font-size: 12px; color: var(--muted); }
.invite-item__badges { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.invite-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.invite-empty { padding: 14px 18px; font-size: 13px; color: var(--muted); }

/* ── Utilities ───────────────────────────── */
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Asset list tree layout ──────────────── */
.view--tree { padding: 0; overflow: hidden; }

.asset-list-layout {
  display: flex;
  height: 100%;
  min-height: 0;
}

.asset-tree {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 8px 0;
  user-select: none;
}

.asset-tree__location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background 100ms;
}
.asset-tree__location:hover { background: var(--surface2); }

.asset-tree__chevron {
  font-size: 10px;
  color: var(--muted);
  width: 12px;
  flex-shrink: 0;
}

.asset-tree__points {
  padding-left: 0;
}

.asset-tree__point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 6px calc(28px + var(--point-depth, 0) * 18px);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 100ms;
  border-left: 2px solid transparent;
}
.asset-tree__point:hover { background: var(--surface2); }
.asset-tree__point.is-active {
  background: hsl(152, 55%, 95%);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.asset-tree__count {
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 6px;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}
.asset-tree__point.is-active .asset-tree__count {
  background: hsl(152, 55%, 88%);
  border-color: hsl(152, 55%, 70%);
  color: var(--accent-hover);
}

.asset-tree__loading,
.asset-tree__empty {
  padding: 6px 28px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.asset-tree__unassigned-section {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  transition: background 100ms;
}
.asset-tree__unassigned-section:hover { background: var(--surface2); }
.asset-tree__unassigned-section.is-active {
  background: hsl(38, 92%, 95%);
  color: hsl(38, 70%, 35%);
}

.asset-list-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* ── Admin location+points panel ────────── */
.admin-location-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.admin-location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.admin-location-actions,
.admin-location-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-location-edit-form {
  width: 100%;
}
.admin-location-edit-form input[type="text"] {
  flex: 1 1 180px;
  min-width: 140px;
}
.admin-point-list { padding-left: 16px; }
.admin-point-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  padding-left: calc(var(--point-depth, 0) * 18px);
  font-size: 13px;
}
.admin-point-item[style*="--point-depth:1"] .admin-point-main,
.admin-point-item[style*="--point-depth:2"] .admin-point-main,
.admin-point-item[style*="--point-depth:3"] .admin-point-main {
  border-left: 2px solid var(--border);
  padding-left: 8px;
}
.admin-point-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
}
.admin-point-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.admin-point-name-input { flex: 1; height: 28px; font-size: 13px; padding: 2px 6px; min-width: 80px; }
.admin-point-coords {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-family: monospace;
}
.admin-point-coords--empty { font-style: italic; }
.admin-point-meta {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-point-edit-grid {
  flex: 1 1 360px;
  min-width: 260px;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 6px;
}
.admin-point-edit-grid input,
.admin-point-edit-grid select {
  min-width: 0;
  height: 28px;
  font-size: 13px;
  padding: 2px 6px;
}
.admin-add-point-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  padding-left: 16px;
  flex-wrap: wrap;
}
.admin-add-point-form input,
.admin-add-point-form select {
  flex: 1;
  min-width: 120px;
  height: 32px;
  font-size: 13px;
  padding: 4px 8px;
}
.admin-add-point-form--compact {
  justify-content: flex-start;
}
.admin-point-coord-input {
  flex: 0 0 110px !important;
  min-width: 0 !important;
}
.admin-epoch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.admin-epoch-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-epoch-item input {
  flex: 1 1 160px;
  min-width: 0;
  height: 32px;
  font-size: 13px;
  padding: 4px 8px;
}
.admin-epoch-item input[type="file"] {
  flex: 1 1 220px;
  padding: 4px 0;
}
.admin-epoch-image {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  overflow: hidden;
  flex: 0 0 52px;
}
.admin-epoch-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.admin-region-item {
  align-items: center;
  justify-content: space-between;
}
.admin-region-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.region-crest-preview {
  min-height: 120px;
  max-height: 220px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}
.region-crest-preview img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}
.point-icon-preview {
  min-height: 96px;
  max-height: 160px;
}
.point-icon-preview img {
  max-height: 140px;
}

/* ── Map view ────────────────────────────── */
.view--map { padding: 0; overflow: hidden; }
.map-view-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}
.map-view-tree {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 0;
}
.map-view-map {
  flex: 1;
  min-width: 0;
}
.mv-pin { font-size: 11px; }


/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .review-layout {
    flex-direction: column;
    height: calc(100dvh - 57px);
  }
  .review-layout__viewer {
    flex: 1 1 0;
    min-height: 0;
  }
  .review-layout__panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    flex: 0 0 46vh;
    max-height: 46vh;
  }
  .asset-grid { grid-template-columns: 1fr; }
  .topbar { padding: 8px 12px; }
  .brand__divider,
  .brand__subtitle { display: none; }
  .actions { gap: 4px; }
  /* Larger touch targets on mobile — do NOT shrink buttons */
  .btn { height: 40px; padding: 0 12px; }
  .btn--sm { height: 36px; padding: 0 10px; }
  .btn--icon { width: 40px; height: 40px; }
  .admin-cols { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .asset-tree { width: 160px; }
  /* Viewer toolbar: wrap on narrow screens */
  .viewer-toolbar {
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
    justify-content: center;
    bottom: 8px;
  }
}

@media (max-width: 480px) {
  .login-card { padding: 20px; }
  .viewer-toolbar { bottom: 8px; padding: 4px 6px; gap: 4px; }
  .asset-list-layout { flex-direction: column; }
  .asset-tree { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
}

/* ── Thread / versioning view ─────────────── */
.thread-layout {
  display: flex;
  height: 100%;
  min-height: 0;
}

.thread-layout__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thread-layout__panel {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}
.thread-header__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.thread-header__meta h2 {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-header__actions { display: flex; gap: 8px; align-items: center; }

/* ── Version tabs ─────────────────────────── */
.version-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  overflow-x: auto;
  flex-shrink: 0;
}
.version-changelog {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.version-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  color: var(--muted);
  transition: color 120ms, border-color 120ms;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.version-tab:hover { color: var(--text); }
.version-tab__export,
.thread-card__export {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.version-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.version-tab__badge {
  font-size: 10px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 1px 5px;
}
.version-tab.is-active .version-tab__badge {
  background: hsl(152, 55%, 88%);
  color: var(--accent-hover);
}
.version-tab--latest::after {
  content: 'Najnowsza';
  font-size: 10px;
  background: hsl(152, 55%, 88%);
  color: var(--accent-hover);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 4px;
}

.thread-viewer {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Thread comment panel ─────────────────── */
.thread-layout__panel .panel-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.thread-layout__panel .panel-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.open-count {
  font-size: 11px;
  background: hsl(38, 92%, 88%);
  color: hsl(38, 70%, 35%);
  border-radius: 8px;
  padding: 1px 6px;
}

.thread-layout__panel .comment-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  max-height: 40vh;
}

.asset-relations-section {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  max-height: 34vh;
  overflow-y: auto;
}
.asset-relations-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.asset-relations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.asset-relations-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}
.asset-relation-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 12px;
}
.asset-relation-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.asset-relation-item__type {
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
}
.asset-relation-item__target,
.asset-relation-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-relation-item__label {
  color: var(--muted);
}
.asset-relation-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.asset-relation-form select,
.asset-relation-form input,
.asset-relation-form textarea {
  font-size: 12px;
  padding: 7px 8px;
}
.asset-relation-form textarea {
  resize: vertical;
  min-height: 56px;
}

.localized-files-section {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  max-height: 34vh;
  overflow-y: auto;
}
.localized-files-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.localized-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.localized-files-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}
.localized-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 12px;
}
.localized-file-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.localized-file-item__lang {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.localized-file-item__meta {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.localized-file-item__missing {
  color: var(--danger);
  font-size: 11px;
}
.localized-file-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.localized-file-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.localized-file-form input {
  font-size: 12px;
  padding: 7px 8px;
}

/* ── Comment resolved state ───────────────── */
.comment-item { transition: opacity 200ms; }
.comment-item--resolved {
  opacity: 0.55;
}
.comment-item--resolved .comment-item__content {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.comment-resolve-btn {
  font-size: 11px;
  padding: 2px 7px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  color: var(--muted);
  transition: background 120ms, color 120ms;
}
.comment-resolve-btn:hover { background: hsl(152, 55%, 88%); color: var(--accent); border-color: hsl(152, 55%, 70%); }
.comment-item--resolved .comment-resolve-btn {
  background: hsl(152, 55%, 88%);
  color: var(--accent-hover);
  border-color: hsl(152, 55%, 70%);
}
.resolved-badge {
  font-size: 10px;
  background: hsl(152, 55%, 88%);
  color: var(--accent-hover);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* ── Thread messages section ──────────────── */
.thread-messages-section {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: 40vh;
  flex-shrink: 0;
}
.thread-messages-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 12px 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.thread-message-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  max-height: 180px;
}
.thread-message-item {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 12px;
}
.thread-message-item__author {
  font-weight: 600;
  color: var(--accent);
  margin-right: 4px;
}
.thread-message-item__role {
  font-size: 10px;
  color: var(--muted);
  margin-right: 6px;
}
.thread-message-item__time {
  font-size: 10px;
  color: var(--muted);
}
.thread-message-item__text {
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}
.thread-msg-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border);
}
.thread-msg-form textarea {
  resize: none;
  font-size: 12px;
}

/* ── Asset list — thread cards ────────────── */
.thread-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thread-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.thread-card__top .thread-card__title {
  flex: 1;
  min-width: 0;
}
.thread-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.thread-card__title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
.version-badge {
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 7px;
  color: var(--muted);
}
.open-issues-badge {
  font-size: 11px;
  background: hsl(38, 92%, 88%);
  color: hsl(38, 70%, 35%);
  border-radius: 8px;
  padding: 1px 7px;
}
.thread-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .thread-layout { flex-direction: column; }
  .thread-layout__panel { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 45vh; }
}

/* ── Inline comment form (sidebar, no backdrop) ───────────────────────────── */
.inline-comment-form {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.inline-comment-form__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.inline-comment-form__title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.inline-comment-form form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inline-comment-form textarea {
  resize: vertical;
  min-height: 72px;
}

/* ── Drawing overlay ──────────────────────────────────────────────────────── */
.drawing-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 20;
  display: none;
}
.drawing-overlay--visible { display: block; }
.drawing-overlay--readonly { pointer-events: none !important; }

/* ── Drawing toolbar ──────────────────────────────────────────────────────── */
.drawing-toolbar {
  position: fixed;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(20, 20, 30, 0.82);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  user-select: none;
}
.drawing-toolbar--visible { display: flex; }

.dt-group {
  display: flex;
  gap: 3px;
  align-items: center;
}
.dt-sep {
  width: 1px; height: 20px;
  background: rgba(255,255,255,0.2);
  margin: 0 4px;
}

.dt-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  min-width: 28px;
  text-align: center;
  transition: background 0.1s;
}
.dt-btn:hover { background: rgba(255,255,255,0.2); }
.dt-btn.dt-active {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.55);
}
.dt-btn--danger:hover { background: rgba(239,68,68,0.35); border-color: #ef4444; }
.dt-btn--done { background: rgba(34,197,94,0.25); border-color: rgba(34,197,94,0.6); font-weight: 600; }
.dt-btn--done:hover { background: rgba(34,197,94,0.45); border-color: #22c55e; }

.dt-colors { gap: 4px; }
.dt-color {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.1s;
}
.dt-color:hover { transform: scale(1.2); }
.dt-color.dt-active { border-color: #fff; transform: scale(1.15); }

/* ── Comment drawing badge ────────────────────────────────────────────────── */
.comment-item__drawing-badge {
  display: inline-block;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
  cursor: default;
  user-select: none;
}

/* ── Cross-version comment styles ─────────────────────── */
.comment-item--prev-version {
  opacity: 0.6;
  background: var(--surface2);
  border-left: 3px solid var(--border);
  padding-left: 8px;
}
.comment-item--prev-version .comment-item__content {
  font-style: italic;
}
.version-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Thread approved banner ────────────────────────────── */
.thread-approved-banner {
  background: hsl(152, 50%, 90%);
  color: hsl(152, 45%, 22%);
  border: 1px solid hsl(152, 40%, 70%);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  margin: 4px 0 8px;
}
