:root {
  --brand: #000066;
  --brand-2: #172554;
  --accent: #ff6b00;
  --green: #0f766e;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --panel: #fbfcfe;
  --line: #dbe3ec;
  --line-strong: #c4ceda;
  --text: #151b2c;
  --muted: #667085;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.access-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f6f8fb, #e8edf5);
}

.access-panel {
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-lock,
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.access-panel h1,
.topbar h1,
.preview-toolbar h2,
.feedback-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.access-panel h1 {
  margin-top: 18px;
  font-size: 24px;
}

.access-panel p {
  color: var(--muted);
}

.access-form {
  display: flex;
  gap: 10px;
}

.access-form input,
.access-form button,
.feedback-form input,
.feedback-form select,
.feedback-form textarea,
.search-box input {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.access-form input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 12px;
}

.access-form button {
  height: 42px;
  padding: 0 18px;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.access-error,
.error-banner {
  color: var(--danger);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.topbar-main,
.topbar-actions,
.preview-actions,
.feedback-head,
.feedback-meta,
.feedback-footer {
  display: flex;
  align-items: center;
}

.topbar-main {
  gap: 12px;
}

.topbar h1 {
  font-size: 19px;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 16px;
}

.page-sidebar,
.preview-panel,
.feedback-panel {
  min-width: 0;
}

.page-sidebar,
.feedback-panel {
  position: sticky;
  top: 88px;
  height: calc(100vh - 104px);
  overflow: auto;
}

.sidebar-section,
.search-box,
.feedback-panel,
.preview-toolbar,
.preview-frame,
.client-callout,
.annotation-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sidebar-section,
.search-box {
  display: block;
  padding: 14px;
  margin-bottom: 12px;
}

.version-card strong,
.version-card span,
.search-box span,
.feedback-form span {
  display: block;
}

.version-card strong {
  margin-top: 5px;
}

.version-card span,
.search-box span,
.feedback-form span,
.file-drop small {
  color: var(--muted);
  font-size: 12px;
}

.search-box input {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  padding: 0 10px;
}

.page-list {
  display: grid;
  gap: 6px;
}

.page-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.page-item:hover,
.page-item:focus-visible {
  border-color: var(--line-strong);
  background: #fff;
  outline: none;
}

.page-item.active {
  border-color: rgba(0, 0, 102, 0.2);
  background: #eef2ff;
  color: var(--brand);
  font-weight: 800;
}

.page-number,
.item-count,
.count-pill,
.mode-badge,
.bucket {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.page-number {
  width: 28px;
  height: 28px;
  background: #edf2f7;
  color: #475467;
}

.item-count,
.count-pill {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: #fff4e8;
  color: var(--warning);
}

.download-card {
  display: grid;
  gap: 8px;
}

.download-card a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.preview-panel {
  display: grid;
  gap: 12px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.preview-toolbar h2 {
  margin-top: 4px;
  font-size: 22px;
}

.preview-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.preview-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  font-weight: 850;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
  outline: none;
}

.button.full-width {
  width: 100%;
}

.mode-badge {
  min-height: 28px;
  padding: 0 10px;
  background: #e6f4f1;
  color: var(--green);
}

.client-callout {
  padding: 12px 14px;
  border-color: #fedf89;
  background: #fffbeb;
}

.client-callout p {
  margin: 4px 0 0;
  color: #7a4f01;
  line-height: 1.45;
}

.annotation-help {
  padding: 10px 14px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.preview-frame {
  min-height: calc(100vh - 188px);
  overflow: auto;
  padding: 14px;
  background: #e7ecf3;
}

.screenshot-surface,
.preview-frame iframe {
  display: block;
  width: 100%;
  min-width: 960px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.screenshot-surface {
  position: relative;
  cursor: crosshair;
}

.preview-frame img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

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

.annotation-pin {
  position: absolute;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  pointer-events: auto;
}

.annotation-pin.draft {
  background: var(--green);
}

.annotation-pin.focused {
  outline: 4px solid rgba(255, 107, 0, 0.24);
  outline-offset: 3px;
}

.preview-frame iframe {
  height: calc(100vh - 220px);
}

.feedback-panel {
  padding: 14px;
  background: var(--surface);
}

.feedback-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.feedback-head h2 {
  margin-top: 4px;
  font-size: 18px;
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
}

.feedback-form textarea {
  resize: vertical;
}

.anchor-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 0, 0.28);
  border-radius: 8px;
  background: #fff7ed;
}

.anchor-selection span {
  color: #9a3412;
}

.anchor-selection strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
}

.anchor-selection button {
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
  cursor: pointer;
}

.file-drop {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
}

.file-upload-control {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.file-upload-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.file-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.file-drop:focus-within .file-upload-button,
.file-drop:hover .file-upload-button {
  border-color: var(--brand);
  color: var(--brand);
}

.file-upload-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.attachment-preview span {
  color: var(--muted);
  font-size: 12px;
}

.attachment-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 6px;
  object-fit: contain;
}

.error-banner {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fff1f0;
  font-size: 13px;
}

.feedback-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.feedback-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.feedback-item.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.14);
}

.feedback-meta,
.feedback-footer {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-item h3 {
  margin: 10px 0 6px;
  font-size: 15px;
}

.feedback-item p {
  margin: 0 0 12px;
  color: #344054;
  line-height: 1.45;
  white-space: pre-wrap;
}

.bucket {
  min-height: 24px;
  padding: 0 9px;
  background: #e8eefc;
  color: var(--brand);
}

.bucket.Change,
.bucket.Bug {
  background: #fff0e6;
  color: var(--accent);
}

.bucket.Approved {
  background: #e6f4f1;
  color: var(--green);
}

.bucket.Defer {
  background: #eef2f7;
  color: #475467;
}

.attachment-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.anchor-link {
  display: inline-flex;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .feedback-panel {
    position: static;
    grid-column: 1 / -1;
    height: auto;
  }
}

@media (max-width: 820px) {
  .topbar,
  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .page-sidebar {
    position: static;
    height: auto;
  }

  .preview-frame {
    min-height: 420px;
  }
}