:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #63707a;
  --line: #d9e0e4;
  --paper: #f5f7f8;
  --panel: #ffffff;
  --red: #d83b31;
  --amber: #c9860a;
  --teal: #0f7b72;
  --blue: #275f9f;
  --shadow: 0 14px 34px rgba(23, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
select,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 18px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-title {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.brand-title .subtitle {
  grid-column: 1 / -1;
}

.app-logo {
  width: 74px;
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

h2 {
  font-size: 16px;
}

.score-tile {
  width: 92px;
  min-width: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  background: #fbfcfc;
  border-radius: 8px;
}

.score-tile span {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.score-tile small {
  color: var(--muted);
}

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

.sidebar,
.fixlist {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel,
.fixlist {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(23, 32, 38, 0.03);
}

.panel {
  padding: 16px;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.sample-button {
  position: relative;
  display: block;
  height: 86px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  background: #e8edf0;
  border-radius: 8px;
  cursor: pointer;
}

.sample-button.active {
  border-color: var(--teal);
}

.sample-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-button span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px dashed #9dacb5;
  border-radius: 8px;
  color: var(--blue);
  cursor: pointer;
}

.upload-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

#photoInput {
  display: none;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.primary,
.ghost {
  min-height: 42px;
  border-radius: 6px;
  cursor: pointer;
}

.primary {
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

.ghost {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

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

.metric-row strong {
  color: var(--ink);
}

.workspace {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.viewer-toolbar,
.fixlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.viewer-toolbar p {
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
}

.critical {
  background: var(--red);
}

.warning {
  background: var(--amber);
}

.low {
  background: var(--teal);
}

.canvas-frame {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 192px);
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(23, 32, 38, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 38, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 224px);
  background: #dfe5e8;
  border-radius: 6px;
}

.fixlist {
  min-height: 0;
  overflow: hidden;
}

#issueList {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  list-style: none;
  overflow: auto;
}

.issue-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #ffffff;
}

.issue-card[data-level="critical"] {
  border-left-color: var(--red);
}

.issue-card[data-level="warning"] {
  border-left-color: var(--amber);
}

.issue-card[data-level="low"] {
  border-left-color: var(--teal);
}

.issue-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2f4;
  font-size: 13px;
  font-weight: 800;
}

.issue-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-weight: 800;
}

.issue-title small {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.issue-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .fixlist {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand-title {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
  }

  .app-logo {
    width: 58px;
    height: 44px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .sample-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sample-button {
    height: 72px;
  }

  .viewer-toolbar,
  .fixlist-head {
    align-items: flex-start;
    flex-direction: column;
  }

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