:root {
  --bg: #fff7fb;
  --ink: #171821;
  --muted: #6b7280;
  --line: #ead5de;
  --brand: #d94672;
  --brand-dark: #9f1239;
  --blue: #2563eb;
  --yellow: #a16207;
  --green: #15803d;
  --panel: #ffffff;
  --shadow: 0 18px 44px rgba(48, 18, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 247, 251, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px max(0px, env(safe-area-inset-right)) 56px max(0px, env(safe-area-inset-left));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 28px;
  align-items: center;
  min-height: 72vh;
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 1.05;
}

.hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel,
.card,
.score-panel,
article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel,
.card,
article {
  padding: 22px;
  min-width: 0;
}

.grid {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.narrow {
  max-width: 620px;
  margin-inline: auto;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

textarea {
  resize: vertical;
}

fieldset {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.check input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.field-help {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn.danger {
  border-color: #fecaca;
  color: #991b1b;
}

.btn[aria-disabled="true"],
.diagnosis-flow[data-locked="true"] .capture-actions label,
.diagnosis-flow[data-locked="true"] .preview-actions button {
  cursor: progress;
  opacity: 0.68;
  pointer-events: none;
}

.capture-actions,
.preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.preview-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-pills,
.guide-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.flow-pills span,
.guide-grid span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.shooting-guide,
.preview-panel,
.client-checks,
.diagnosis-status {
  margin: 16px 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shooting-guide h2,
.client-checks h2,
.diagnosis-status h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.preview.has-image {
  display: grid;
  background: #111827;
}

.preview-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.preview-empty strong {
  color: var(--ink);
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.photo-card img,
.share-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.photo-card {
  position: sticky;
  top: 88px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.photo-card img,
.deleted {
  aspect-ratio: 3 / 4;
}

.photo-card p {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.deleted {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f3f4f6;
}

.score-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 22px;
}

.big-score {
  font-size: 84px;
  line-height: 1;
  color: var(--brand-dark);
}

.score-lines p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3e3ea;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list div,
.diagnosis-status li,
.quick-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid #f3e3ea;
}

.check-list span,
.quick-list b {
  color: var(--muted);
  font-weight: 800;
}

.check-list b {
  flex: 0 0 auto;
  color: #6b7280;
}

.check-list [data-status="ok"] b,
.diagnosis-status .is-complete {
  color: var(--green);
}

.check-list [data-status="retake"] b,
.diagnosis-status [data-step].is-active {
  color: var(--brand-dark);
}

.diagnosis-status ol {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding-left: 20px;
}

.diagnosis-status li {
  display: list-item;
  padding: 0;
  border: 0;
}

.diagnosis-status p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.diagnosis-flow[data-state="uploading"] .hero-panel,
.diagnosis-flow[data-state="processing"] .hero-panel,
.diagnosis-flow[data-state="diagnosing"] .hero-panel {
  cursor: progress;
}

.diagnosis-flow[data-state="uploading"] .diagnosis-status,
.diagnosis-flow[data-state="processing"] .diagnosis-status,
.diagnosis-flow[data-state="diagnosing"] .diagnosis-status {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.diagnosis-flow[data-state="uploading"] .diagnosis-status h2::after,
.diagnosis-flow[data-state="processing"] .diagnosis-status h2::after,
.diagnosis-flow[data-state="diagnosing"] .diagnosis-status h2::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid #93c5fd;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-quick {
  margin: 18px 0;
}

.result-priority {
  margin: 18px 0;
}

.result-next-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.lead-result {
  margin: 4px 0 16px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.result-priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-priority-grid p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border: 1px solid #f3e3ea;
  border-radius: 8px;
  background: #fff;
}

.result-priority-grid p:first-child {
  grid-column: 1 / -1;
}

.result-priority-grid b {
  color: var(--muted);
  font-size: 13px;
}

.result-priority-grid span {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.quick-list {
  display: grid;
  gap: 0;
}

.quick-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.metric-grid div {
  padding: 16px;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-grid b {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.result-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.result-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.result-card span,
.result-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-card b {
  display: block;
  margin: 4px 0;
  color: var(--brand-dark);
  font-size: 26px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.celebrity-visual-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.celebrity-visual-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.celebrity-visual-grid span,
.celebrity-visual-grid small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.celebrity-visual-grid b {
  display: block;
  margin: 8px 0 4px;
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1.2;
}

.result-section,
.result-summary-grid {
  margin: 18px 0;
}

.quality-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.quality-check {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.quality-check div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.quality-check span {
  font-weight: 800;
}

.quality-check b {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}

.quality-check.warning b {
  background: #fef3c7;
  color: #92400e;
}

.quality-check.retake b {
  background: #fee2e2;
  color: #991b1b;
}

.quality-check.ok b {
  background: #dcfce7;
  color: #166534;
}

.quality-check strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.quality-check p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.photo-quality-detail {
  margin: 18px 0;
}

.quality-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.quality-head strong {
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1.2;
  white-space: nowrap;
}

.quality-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #ffe4ec;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.advice {
  padding-left: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.face-analysis-panel {
  margin: 22px 0;
}

.face-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.face-analysis-grid div {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.face-analysis-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.face-analysis-grid b {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.rankme-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.rankme-sections .card {
  box-shadow: none;
}

.rankme-sections .notice {
  grid-column: 1 / -1;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.notice {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.legal-page,
.error-page {
  max-width: 820px;
  margin: 32px auto;
}

.legal-page li,
.error-page p {
  overflow-wrap: anywhere;
}

.error-page {
  padding: clamp(28px, 6vw, 56px);
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.error-page h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(64px, 16vw, 132px);
  line-height: 1;
}

.mini-def {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px 12px;
  margin: 14px 0;
}

.mini-def dt {
  color: var(--muted);
  font-weight: 800;
}

.mini-def dd {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
  min-width: 0;
  font-weight: 700;
}

.mini-def pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-data-table {
  max-width: 100%;
}

.accent {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.share-grid > div {
  min-width: 0;
}

.share-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

th,
td {
  min-width: 0;
  padding: 10px;
  border-bottom: 1px solid #f0dce4;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-tabs {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  color: var(--ink);
}

.admin-tabs a,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-tabs a[aria-current="page"] {
  border-color: var(--brand);
  background: #fff0f5;
  color: var(--brand-dark);
}

.sub-tabs {
  margin-top: -6px;
}

.status-pill {
  min-height: auto;
  color: var(--brand-dark);
}

.dashboard-group {
  margin: 24px 0;
}

.dashboard-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dashboard-group-head h2 {
  margin: 0;
}

.dashboard-group-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 168px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.kpi-card[data-status="READY"],
.kpi-card[data-status="IMPORT_READY"],
.kpi-card[data-status="BASELINE_READY"] {
  border-left-color: #16a34a;
}

.kpi-card[data-status="PROCESSING"] {
  border-left-color: #2563eb;
}

.kpi-card[data-status="NEEDS_MORE_DATA"],
.kpi-card[data-status="QUARANTINE"] {
  border-left-color: #d97706;
}

.kpi-card[data-status="FAILED"],
.kpi-card[data-status="NOT_READY"] {
  border-left-color: #dc2626;
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--brand-dark);
  font-size: 12px;
}

.kpi-value {
  display: block;
  margin: 10px 0 8px;
  color: var(--brand-dark);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.kpi-card p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.kpi-card small {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.status-ready,
.status-import-ready,
.status-baseline-ready {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.status-processing {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.status-needs-more-data,
.status-quarantine {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.status-not-ready,
.status-failed {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.admin-table-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.admin-table-tools label {
  flex: 1 1 240px;
  min-width: 0;
  margin: 0;
}

.admin-table-tools label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-table-tools input[type="search"] {
  width: 100%;
}

.admin-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quality-bars {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.quality-bars div {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.quality-bars b {
  display: block;
  min-width: 2px;
  height: 10px;
  border-radius: 999px;
  background: #2563eb;
}

.quality-bars em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.admin-data-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.admin-data-table th[data-sort]::after {
  content: "  並替";
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.admin-data-table th[aria-sort="ascending"]::after {
  content: "  昇順";
}

.admin-data-table th[aria-sort="descending"]::after {
  content: "  降順";
}

.table-empty-row td {
  color: var(--muted);
  text-align: center;
}

.is-hidden {
  display: none !important;
}

.danger-zone {
  border-color: #fecaca;
  background: #fff7f7;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.eval-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.eval-grid .wide {
  grid-column: 1 / -1;
}

.flat-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flat-card h3 {
  margin-top: 0;
}

.score-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.score-filter label {
  margin: 0;
}

.epr-stepper {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.epr-stepper button {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.epr-stepper button[aria-current="step"] {
  border-color: var(--brand);
  background: #fff0f5;
  color: var(--brand-strong);
}

.epr-stepper button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}

.epr-step {
  scroll-margin-top: 16px;
}

.epr-step.is-active {
  border-color: var(--brand);
}

.single-photo-wizard {
  display: grid;
  gap: 12px;
}

.consent-status-panel {
  border-color: #fecaca;
  background: #fff7f7;
}

.consent-status-panel.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.consent-status-panel [data-consent-required-action] {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
}

.store-candidates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.store-candidates > h3 {
  margin: 0;
}

.candidate-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.candidate-selected-count {
  padding: 7px 10px;
  white-space: nowrap;
}

.candidate-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.candidate-check {
  align-items: center;
  color: var(--brand);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 6px;
  white-space: nowrap;
}

.candidate-row p {
  margin: 4px 0;
  word-break: break-word;
}

.candidate-row small {
  color: var(--muted);
}

.candidate-row.is-selected {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.store-candidates > form,
.store-candidates > p {
  grid-column: 1 / -1;
}

.store-fetch-status {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
}

.store-fetch-status[data-status="FETCHING"] {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #1d4ed8;
}

.store-fetch-status[data-status="FETCHED"],
.store-fetch-status[data-status="PARTIAL"] {
  border-color: #34d399;
  background: #ecfdf5;
  color: #047857;
}

.store-fetch-status[data-status="FAILED"],
.store-fetch-status[data-status="BLOCKED"] {
  border-color: #f87171;
  background: #fef2f2;
  color: #b91c1c;
}

.store-auto-results {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.store-auto-card table {
  table-layout: fixed;
}

.store-auto-card td {
  word-break: break-word;
}

.epr-preview-grid {
  display: grid;
  grid-template-columns: minmax(220px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.epr-preview {
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.epr-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.epr-actions {
  margin: 0 0 16px;
}

.metric-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}

.metric-grid.compact b {
  font-size: 18px;
}

.wizard-steps,
.workflow-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 0;
}

.wizard-steps li,
.progress-card {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
}

.wizard-steps strong,
.progress-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.wizard-steps span,
.progress-card span {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
}

.wizard-steps [data-status="DONE"] span,
.wizard-steps [data-status="READY"] span,
.progress-card span {
  background: #dcfce7;
  color: #166534;
}

.wizard-steps [data-status="BLOCKED"] span,
.wizard-steps [data-status="TODO"] span {
  background: #fee2e2;
  color: #991b1b;
}

.wizard-steps p,
.progress-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.progress-card div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.progress-card progress,
.upload-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--brand);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.dropzone.is-dragging,
.dropzone.is-ready {
  border-color: var(--brand);
  background: #fff0f5;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone label {
  margin: 0;
  pointer-events: none;
}

.dropzone strong,
.dropzone span {
  display: block;
}

.upload-progress {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-footer {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px max(0px, env(safe-area-inset-right)) 40px max(0px, env(safe-area-inset-left));
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 860px) {
  .hero,
  .result-layout,
  .grid.two,
  .grid.three,
  .share-grid,
  .rankme-sections,
  .score-panel,
  .metric-grid,
  .result-cards,
  .celebrity-visual-grid,
  .result-next-actions,
  .result-priority-grid,
  .face-analysis-grid,
  .quality-detail-grid,
  .quality-check-grid,
  .kpi-grid,
  .metric-grid.compact,
  .score-filter,
  .epr-stepper,
  .epr-preview-grid,
  .wizard-steps,
  .workflow-progress-grid {
    grid-template-columns: 1fr;
  }

  .quality-bars div {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .photo-card {
    position: static;
  }

  .big-score {
    font-size: 64px;
  }

  .site-header,
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .capture-actions,
  .preview-actions {
    grid-template-columns: 1fr;
  }

  .actions form {
    width: 100%;
  }

  .dashboard-group-head,
  .admin-table-tools,
  .admin-table-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-table-actions {
    width: 100%;
  }

  .store-candidates {
    grid-template-columns: 1fr;
  }

  .candidate-bulk-actions {
    justify-content: flex-start;
  }

  .candidate-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  main,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .hero-panel,
  .card,
  article,
  .score-panel {
    padding: 16px;
  }

  .score-lines p,
  .quality-check div {
    display: grid;
  }

  table {
    font-size: 12px;
    white-space: normal;
  }

  th,
td {
    padding: 7px 5px;
  }
}

.thumb-token {
  align-items: center;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #edf5ff, #fff5f8);
  border: 1px solid rgba(27, 45, 82, 0.14);
  border-radius: 8px;
  color: #20314f;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  margin-right: 8px;
  vertical-align: middle;
  width: 42px;
}

.training-photo-table td:nth-child(2) {
  min-width: 150px;
}

.training-photo-table small {
  color: var(--muted);
  display: inline-block;
  max-width: 110px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

#photo-list,
#dataset-manager article,
#registry-prediction article {
  overflow-x: auto;
}

#photo-list .admin-data-table,
#dataset-manager .admin-data-table,
#registry-prediction .admin-data-table {
  min-width: 760px;
  table-layout: auto;
}

#nightwork-teacher-breakdown-list .table-scroll,
#nightwork-teacher-breakdown-list .teacher-breakdown-scroll {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

#nightwork-teacher-breakdown-list .admin-data-table,
#nightwork-teacher-breakdown-list .teacher-breakdown-table {
  max-width: none;
  min-width: 1320px;
  table-layout: auto !important;
  width: max-content;
}

#nightwork-teacher-breakdown-list .admin-data-table th,
#nightwork-teacher-breakdown-list .admin-data-table td,
#nightwork-teacher-breakdown-list .teacher-breakdown-table th,
#nightwork-teacher-breakdown-list .teacher-breakdown-table td {
  overflow-wrap: normal !important;
  padding: 8px 12px;
  vertical-align: middle;
  white-space: normal;
  word-break: normal !important;
}

#nightwork-teacher-breakdown-list .tbd-photo-number {
  max-width: 150px;
  min-width: 120px;
  white-space: nowrap !important;
}

#nightwork-teacher-breakdown-list .tbd-image {
  max-width: 150px;
  min-width: 128px;
  width: 140px;
}

#nightwork-teacher-breakdown-list .tbd-store,
#nightwork-teacher-breakdown-list .tbd-style {
  min-width: 130px;
}

#nightwork-teacher-breakdown-list .tbd-wage,
#nightwork-teacher-breakdown-list .tbd-status,
#nightwork-teacher-breakdown-list .tbd-created {
  min-width: 120px;
  white-space: nowrap !important;
}

#nightwork-teacher-breakdown-list .tbd-reason {
  min-width: 190px;
}

#nightwork-teacher-breakdown-list .nightwork-thumb {
  align-items: center;
  display: inline-flex;
  height: 80px;
  justify-content: center;
  margin: 0 0 6px;
  max-width: 100%;
  width: 80px;
}

#nightwork-teacher-breakdown-list .nightwork-thumb img {
  display: block;
  height: 80px;
  max-width: 100%;
  object-fit: cover;
  width: 80px;
}

#nightwork-teacher-breakdown-list .nightwork-thumb-fallback {
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
}

#nightwork-teacher-breakdown-list .admin-data-table small {
  display: -webkit-box;
  max-width: 118px;
  overflow: hidden;
  overflow-wrap: normal !important;
  word-break: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#nightwork-teacher-breakdown-list .teacher-breakdown-token {
  display: inline-block;
  white-space: nowrap;
}

#nightwork-teacher-breakdown-list .nightwork-row-actions {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  min-width: 132px;
}

#nightwork-teacher-breakdown-list .nightwork-row-actions .btn,
#nightwork-teacher-breakdown-list .nightwork-delete-confirm > summary {
  min-width: 56px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

#nightwork-teacher-breakdown-list .nightwork-delete-confirm {
  min-width: 56px;
}

#nightwork-teacher-breakdown-list .tbd-actions {
  background: #fff;
  min-width: 148px;
  position: sticky;
  right: 0;
  z-index: 1;
}

@media (max-width: 520px) {
  #nightwork-teacher-breakdown-list .admin-data-table,
  #nightwork-teacher-breakdown-list .teacher-breakdown-table {
    min-width: 1160px;
  }
}

@media (max-width: 520px) {
  .thumb-token {
    height: 34px;
    width: 34px;
  }

  #photo-list .admin-data-table,
  #dataset-manager .admin-data-table,
  #registry-prediction .admin-data-table {
    min-width: 860px;
  }
}
