:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, .78);
  --ink: #121621;
  --muted: #6d7482;
  --line: rgba(16, 24, 40, .10);
  --blue: #007aff;
  --blue-soft: rgba(0, 122, 255, .12);
  --shadow: 0 18px 60px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 122, 255, .16), transparent 34rem),
    linear-gradient(135deg, #f8fbff, #eef2f8 55%, #f8f9fb);
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 122, 255, .22);
}

button.secondary {
  background: #eef2f7;
  color: var(--ink);
  box-shadow: none;
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

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

.status span, .status strong {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(18px);
}

.setup {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.setup-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

label {
  color: var(--muted);
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255,255,255,.82);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.hidden { display: none; }

.rail, .viewer {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.rail {
  padding: 16px;
  height: calc(100vh - 116px);
  overflow: hidden;
}

.meter {
  height: 8px;
  background: #e6ebf2;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

#meterFill {
  height: 100%;
  width: 0;
  background: var(--blue);
}

.chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  background: #edf2f8;
  color: var(--muted);
  box-shadow: none;
}

.chip.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.task-list {
  height: calc(100% - 76px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.task-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255,255,255,.68);
  cursor: pointer;
}

.task-item.active {
  border-color: rgba(0, 122, 255, .55);
  background: var(--blue-soft);
}

.task-item.done::after {
  content: "saved";
  color: var(--blue);
  font-size: 12px;
}

.viewer {
  min-height: calc(100vh - 116px);
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(380px, .9fr);
  overflow: hidden;
}

.image-panel {
  display: grid;
  place-items: center;
  padding: 22px;
  background: #0d1118;
}

.image-panel img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: 18px;
}

.form-panel {
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.sample-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
}

.ratings {
  display: grid;
  gap: 12px;
}

.rating-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
}

.rating-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.scale-note {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.score {
  padding: 10px 0;
  border-radius: 12px;
  background: #edf2f8;
  color: var(--ink);
  box-shadow: none;
}

.score.selected {
  background: var(--blue);
  color: white;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 10px;
}

@media (max-width: 980px) {
  .workspace, .viewer {
    grid-template-columns: 1fr;
  }
  .rail {
    height: 240px;
  }
}
