:root {
  color-scheme: dark;
  --ink-0: #070f0c;
  --ink-1: #0c1a15;
  --ink-2: #12241d;
  --surface: rgba(21, 39, 32, 0.62);
  --surface-strong: rgba(28, 50, 41, 0.82);
  --line: rgba(213, 183, 125, 0.14);
  --line-strong: rgba(213, 183, 125, 0.34);
  --text: #f0eadd;
  --muted: #9db1a6;
  --gold: #d5b77d;
  --gold-strong: #b8934e;
  --gold-soft: rgba(213, 183, 125, 0.12);
  --jade: #4cc394;
  --amber: #e2a83d;
  --coral: #e2695a;
  --shadow: 0 30px 70px rgba(2, 8, 6, 0.55);
  --font-display: "Shippori Mincho", serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --font-numeral: "Cormorant Garamond", "Shippori Mincho", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink-0);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(52% 44% at 12% -6%, rgba(59, 118, 96, 0.5), transparent 68%),
    radial-gradient(44% 40% at 96% 8%, rgba(183, 146, 78, 0.2), transparent 70%),
    radial-gradient(60% 52% at 78% 104%, rgba(38, 92, 72, 0.42), transparent 72%),
    linear-gradient(168deg, #0d1c16 0%, var(--ink-0) 52%, #0a1712 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-numeral);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- shell ---------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 324px 1fr;
}

.sidebar {
  padding: 34px 24px 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 28, 22, 0.9), rgba(9, 18, 14, 0.86));
  backdrop-filter: blur(14px);
}

.sidebar__head {
  margin-bottom: 26px;
}

.sidebar__head h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
  background: linear-gradient(120deg, #f4ecd9 30%, var(--gold) 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar__lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.sidebar__section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.sidebar__section h2 {
  margin: 0;
  font-size: 17px;
}

.sidebar__section--notice {
  padding-bottom: 0;
}

/* ---------- workspace ---------- */

.workspace {
  padding: 28px 30px 40px;
  display: grid;
  gap: 22px;
  align-content: start;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.workspace > * {
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.workspace > *:nth-child(2) {
  animation-delay: 0.08s;
}

.workspace > *:nth-child(3) {
  animation-delay: 0.16s;
}

.workspace > *:nth-child(4) {
  animation-delay: 0.24s;
}

.topbar,
.hero-band,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  border-radius: 22px;
}

.topbar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
}

.topbar__status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  min-width: 156px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 20, 16, 0.55);
}

.status-pill span,
.status-pill strong {
  display: block;
}

.status-pill span,
.field span,
.meta-chip {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.status-pill strong {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text);
}

/* ---------- hero ---------- */

.hero-band {
  padding: 26px 30px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(70% 130% at 0% 0%, rgba(76, 195, 148, 0.12), transparent 60%),
    radial-gradient(50% 120% at 100% 100%, rgba(213, 183, 125, 0.1), transparent 65%),
    var(--surface);
  position: relative;
  overflow: hidden;
}

.hero-band::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 58%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

.hero-band h3 {
  margin: 0 0 10px;
  font-size: 30px;
}

.hero-band__copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 13.5px;
}

.hero-band__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.hero-band__stats div {
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 20, 16, 0.5);
  text-align: center;
}

.hero-band__stats span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.hero-band__stats strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 15px;
}

/* ---------- panels ---------- */

.workspace-grid {
  display: grid;
  gap: 22px;
}

.panel {
  padding: 24px;
}

.panel__head,
.section-title,
.actions,
.compare-pickers,
.compare-canvases {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel__head,
.section-title {
  justify-content: space-between;
}

.panel__head {
  margin-bottom: 18px;
}

.panel__head h3 {
  margin: 0;
  font-size: 24px;
}

.section-title h4 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
}

/* ---------- capture ---------- */

.capture-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.action-tile {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 24, 19, 0.6);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease,
    background 0.22s ease, box-shadow 0.22s ease;
}

.action-tile:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 44px rgba(2, 8, 6, 0.5);
}

.action-tile strong {
  font-family: var(--font-display);
  font-size: 17px;
}

.action-tile small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.action-tile__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  background: var(--gold-soft);
  margin-bottom: 6px;
}

.action-tile__icon svg {
  width: 22px;
  height: 22px;
}

.action-tile--primary {
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(213, 183, 125, 0.16), transparent 60%),
    rgba(16, 31, 25, 0.75);
  border-color: var(--line-strong);
}

.capture-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.guideline,
.note-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(10, 20, 16, 0.5);
  border: 1px solid var(--line);
}

.guideline h4,
.note-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.notice-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 13px;
}

.quality-list {
  display: grid;
  gap: 8px;
}

.quality-item {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 168, 61, 0.3);
  background: rgba(226, 168, 61, 0.08);
  color: #ecc07a;
  font-size: 13px;
  line-height: 1.6;
}

.quality-item--ok {
  border-color: rgba(76, 195, 148, 0.28);
  background: rgba(76, 195, 148, 0.08);
  color: #7ed8b4;
}

/* ---------- forms & buttons ---------- */

.stack {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field input,
.field select {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 13, 0.6);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--line-strong);
}

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

.button {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 13px;
  background: rgba(15, 29, 23, 0.8);
  color: var(--text);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(2, 8, 6, 0.5);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.button--primary {
  background: linear-gradient(135deg, #e3c68c, var(--gold-strong));
  color: #221a0c;
  font-weight: 700;
  border-color: transparent;
}

.button--primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  transition: left 0.5s ease;
}

.button--primary:hover::after {
  left: 130%;
}

.button--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--gold);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 13, 0.6);
}

.segment {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, background 0.2s ease;
}

.segment.is-active {
  background: linear-gradient(135deg, #e3c68c, var(--gold-strong));
  color: #221a0c;
  font-weight: 700;
}

.save-state {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: var(--coral);
  background: rgba(226, 105, 90, 0.14);
  border: 1px solid rgba(226, 105, 90, 0.45);
}

.save-state.is-saved {
  color: var(--jade);
  background: rgba(76, 195, 148, 0.12);
  border-color: rgba(76, 195, 148, 0.4);
}

@keyframes savePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(213, 183, 125, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(213, 183, 125, 0.16);
  }
}

.button.needs-save {
  animation: savePulse 2.4s ease-in-out infinite;
}

.meta-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 13, 0.5);
  white-space: nowrap;
}

/* ---------- lists ---------- */

.customer-list,
.session-list,
.point-legend,
.stat-grid,
.compare-summary {
  display: grid;
  gap: 10px;
}

.customer-item,
.session-item {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 24, 19, 0.55);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.customer-item {
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
}

.customer-item:hover {
  border-color: var(--line-strong);
}

.customer-item.is-active {
  border-color: var(--line-strong);
  background: var(--gold-soft);
}

.customer-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--gold);
}

.customer-item__name,
.customer-item__meta {
  display: block;
}

.customer-item__name {
  font-family: var(--font-display);
  font-size: 16px;
}

.customer-item__meta,
.session-item__meta,
.fineprint {
  color: var(--muted);
  font-size: 12.5px;
}

.session-item {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.session-item__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
}

.session-item__meta {
  margin: 4px 0 0;
}

.session-item__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-pill {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
  border: 1px solid var(--line);
}

/* ---------- analysis ---------- */

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 18px;
}

.analysis-canvas-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 16, 13, 0.6);
  align-self: start;
}

.analysis-canvas-wrap.is-empty::after {
  content: "撮影・アップロード・デモ読込で\aここに分析が表示されます";
  white-space: pre;
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 2.1;
  letter-spacing: 0.12em;
  pointer-events: none;
}

#analysisCanvas {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  height: auto;
  touch-action: none;
}

.analysis-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.score-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 180% at 100% 0%, rgba(213, 183, 125, 0.1), transparent 60%),
    rgba(10, 20, 16, 0.6);
}

.score-ring {
  position: relative;
  width: 128px;
  height: 128px;
  flex: none;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring__track,
.score-ring__fill {
  fill: none;
  stroke-width: 7;
}

.score-ring__track {
  stroke: rgba(240, 234, 221, 0.1);
}

.score-ring__fill {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.grade-A .score-ring__fill {
  stroke: var(--jade);
}

.grade-B .score-ring__fill {
  stroke: var(--gold);
}

.grade-C .score-ring__fill {
  stroke: var(--amber);
}

.grade-D .score-ring__fill {
  stroke: var(--coral);
}

.score-ring__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.score-ring__center strong {
  font-family: var(--font-numeral);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
}

.score-ring__center span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3em;
  margin-top: 2px;
}

.score-card__meta {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.grade-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--font-numeral);
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-soft);
}

.grade-A .grade-seal {
  color: var(--jade);
  border-color: rgba(76, 195, 148, 0.4);
  background: rgba(76, 195, 148, 0.1);
}

.grade-C .grade-seal {
  color: var(--amber);
  border-color: rgba(226, 168, 61, 0.4);
  background: rgba(226, 168, 61, 0.1);
}

.grade-D .grade-seal {
  color: var(--coral);
  border-color: rgba(226, 105, 90, 0.4);
  background: rgba(226, 105, 90, 0.1);
}

.score-card__label {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.14em;
}

.stat-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(10, 20, 16, 0.5);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.stat-card__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.band {
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.band-0 {
  color: var(--jade);
  background: rgba(76, 195, 148, 0.12);
}

.band-1 {
  color: var(--gold);
  background: var(--gold-soft);
}

.band-2 {
  color: var(--amber);
  background: rgba(226, 168, 61, 0.14);
}

.band-3 {
  color: var(--coral);
  background: rgba(226, 105, 90, 0.16);
}

.stat-card__value {
  font-family: var(--font-numeral);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.stat-card__value em {
  font-style: normal;
  font-size: 16px;
  color: var(--muted);
  margin-left: 2px;
}

.stat-card small {
  color: var(--muted);
  font-size: 11.5px;
}

.meter {
  height: 5px;
  border-radius: 999px;
  background: rgba(240, 234, 221, 0.08);
  overflow: hidden;
}

.meter__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.sev-0 {
  background: linear-gradient(90deg, #3aa87d, var(--jade));
}

.sev-1 {
  background: linear-gradient(90deg, #c2a25f, var(--gold));
}

.sev-2 {
  background: linear-gradient(90deg, #c98f2e, var(--amber));
}

.sev-3 {
  background: linear-gradient(90deg, #c25344, var(--coral));
}

.summary-text {
  margin: 10px 0 0;
  line-height: 2;
  font-size: 13.5px;
}

.point-legend {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.point-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.point-hint {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.point-item__swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(240, 234, 221, 0.08);
}

.fineprint {
  margin: 0;
  line-height: 1.8;
}

/* ---------- compare ---------- */

.compare-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.compare-pickers {
  align-items: end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.compare-canvases {
  align-items: flex-start;
}

.compare-canvases canvas {
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 13, 0.6);
}

/* ---------- step navigation ---------- */

.stepnav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.stepnav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(10, 20, 16, 0.45);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.stepnav__item:hover {
  transform: translateY(-2px);
  border-color: var(--line);
}

.stepnav__no {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(213, 183, 125, 0.1);
  color: var(--gold);
  font-family: var(--font-numeral);
  font-size: 19px;
  font-weight: 600;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.stepnav__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stepnav__body strong {
  font-family: var(--font-display);
  font-size: 16px;
  white-space: nowrap;
}

.stepnav__body small {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 今やるべきステップ */
.stepnav__item.is-current {
  border-color: var(--line-strong);
  background:
    radial-gradient(130% 180% at 0% 0%, rgba(213, 183, 125, 0.18), transparent 60%),
    rgba(16, 31, 25, 0.85);
}

.stepnav__item.is-current .stepnav__no {
  background: linear-gradient(135deg, #e3c68c, var(--gold-strong));
  color: #221a0c;
  border-color: transparent;
  animation: savePulse 2.4s ease-in-out infinite;
}

/* 完了したステップ */
.stepnav__item.is-done .stepnav__no {
  background: rgba(76, 195, 148, 0.16);
  border-color: rgba(76, 195, 148, 0.5);
  color: var(--jade);
  font-size: 0;
}

.stepnav__item.is-done .stepnav__no::after {
  content: "✓";
  font-family: var(--font-body);
  font-size: 16px;
}

.stepnav__item.is-done .stepnav__body small {
  color: rgba(126, 216, 180, 0.85);
}

/* まだ進めないステップ */
.stepnav__item.is-locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepnav__item.is-locked:hover {
  transform: none;
}

/* ---------- sticky save bar ---------- */

.savebar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px 14px 24px;
  border-radius: 18px;
  background: rgba(12, 24, 19, 0.96);
  border: 1px solid rgba(226, 105, 90, 0.5);
  box-shadow: 0 26px 60px rgba(2, 8, 6, 0.6);
  max-width: min(92vw, 620px);
}

.savebar.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.savebar__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.savebar__text strong {
  font-family: var(--font-display);
  font-size: 16px;
  color: #f2b7ae;
}

.savebar__text small {
  font-size: 12.5px;
  color: var(--muted);
}

.savebar .button {
  flex: none;
  min-height: 48px;
}

/* ---------- tutorial ---------- */

.tutorial {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 7, 0.82);
  backdrop-filter: blur(6px);
}

.tutorial[hidden] {
  display: none;
}

.tutorial__card {
  width: min(560px, 100%);
  padding: 32px 34px 28px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(213, 183, 125, 0.12), transparent 60%),
    rgba(18, 34, 28, 0.98);
  box-shadow: var(--shadow);
}

.tutorial__card h3 {
  margin: 0 0 14px;
  font-size: 28px;
}

.tutorial__body {
  margin: 0;
  color: var(--muted);
  line-height: 2;
  font-size: 15px;
  min-height: 96px;
}

.tutorial__dots {
  display: flex;
  gap: 8px;
  margin: 20px 0 22px;
}

.tutorial__dots span {
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: rgba(240, 234, 221, 0.16);
  transition: background 0.25s ease;
}

.tutorial__dots span.is-active {
  background: var(--gold);
}

.tutorial__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ---------- draggable point hint ---------- */

@keyframes pointHintFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(7, 15, 12, 0.78);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.06em;
  pointer-events: none;
  animation: pointHintFade 5s ease forwards;
  white-space: nowrap;
}

/* ---------- 接客モード ---------- */

.present {
  position: fixed;
  inset: 0;
  z-index: 85;
  padding: 40px 48px;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(59, 118, 96, 0.4), transparent 68%),
    radial-gradient(50% 46% at 96% 8%, rgba(183, 146, 78, 0.18), transparent 70%),
    linear-gradient(168deg, #0d1c16 0%, #070f0c 56%, #0a1712 100%);
  display: grid;
  place-items: center;
}

.present[hidden] {
  display: none;
}

.present__close {
  position: absolute;
  top: 24px;
  right: 28px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 16, 13, 0.65);
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.present__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 44px;
  align-items: center;
  width: min(1500px, 100%);
  max-height: 100%;
}

.present__photo {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 16, 13, 0.5);
}

.present__photo canvas {
  width: 100%;
  height: auto;
  display: block;
}

.present__side {
  display: grid;
  gap: 22px;
  align-content: center;
}

.present__score {
  display: flex;
  align-items: center;
  gap: 26px;
}

.present__score .score-ring {
  width: 180px;
  height: 180px;
}

.present__score .score-ring__center strong {
  font-size: 66px;
}

.present__score .grade-seal {
  width: 72px;
  height: 72px;
  font-size: 38px;
}

.present__score .score-card__label {
  font-size: 26px;
}

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

.present__metric {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 20, 16, 0.55);
}

.present__metric span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.present__metric strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-numeral);
  font-size: 34px;
  font-weight: 600;
}

.present__metric em {
  font-style: normal;
  font-size: 17px;
  color: var(--muted);
  margin-left: 3px;
}

.present__summary {
  margin: 0;
  font-size: 17px;
  line-height: 2.05;
  color: var(--text);
}

/* ---------- スコア推移グラフ ---------- */

.trend {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 20, 16, 0.5);
  margin-bottom: 12px;
}

.trend[hidden] {
  display: none;
}

.trend__body svg {
  width: 100%;
  height: 132px;
  display: block;
  margin-top: 10px;
  overflow: visible;
}

.trend__line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend__area {
  fill: rgba(213, 183, 125, 0.12);
  stroke: none;
}

.trend__dot {
  stroke: #0a1511;
  stroke-width: 2;
}

.trend__label {
  font-size: 10px;
  fill: var(--muted);
}

/* ---------- ゴースト重ね撮り ---------- */

.camera-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  pointer-events: none;
  mix-blend-mode: screen;
}

.camera-ghost[hidden] {
  display: none;
}

.camera-chip--ghost.is-active {
  background: linear-gradient(135deg, #e3c68c, var(--gold-strong));
  color: #221a0c;
  font-weight: 700;
  border-color: transparent;
}

/* ---------- バックアップ催促 ---------- */

.backup-reminder {
  margin: 2px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 168, 61, 0.36);
  background: rgba(226, 168, 61, 0.1);
  color: #ecc07a;
  font-size: 12.5px;
  line-height: 1.7;
}

.backup-reminder[hidden] {
  display: none;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 80;
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(12, 24, 19, 0.94);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow);
  pointer-events: none;
  max-width: min(86vw, 560px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--error {
  border-color: rgba(226, 105, 90, 0.55);
  color: #f2b7ae;
}

.compare-summary {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 20, 16, 0.5);
}

.compare-card span {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.compare-card strong {
  display: block;
  font-family: var(--font-numeral);
  font-size: 28px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--gold);
}

.compare-card small {
  color: var(--muted);
}

/* ---------- camera overlay ---------- */

.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
}

.camera-overlay[hidden] {
  display: none;
}

#cameraPreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#cameraPreview.is-mirrored {
  transform: scaleX(-1);
}

.camera-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.camera-guides__frame {
  position: absolute;
  inset: 7% 22% 5% 14%;
  border: 1.5px dashed rgba(213, 183, 125, 0.55);
  border-radius: 18px;
}

.camera-guides__plumb {
  position: absolute;
  top: 5%;
  bottom: 3%;
  left: 46%;
  width: 1.5px;
  background: repeating-linear-gradient(
    180deg,
    rgba(213, 183, 125, 0.8) 0 14px,
    transparent 14px 26px
  );
}

.camera-guides__label {
  position: absolute;
  left: 46%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(7, 15, 12, 0.72);
  border: 1px solid rgba(213, 183, 125, 0.4);
  color: #f0eadd;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.camera-guides__label--top {
  top: 8.5%;
}

.camera-guides__label--bottom {
  bottom: 6.5%;
}

.camera-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}

.camera-note {
  position: absolute;
  left: 22px;
  bottom: 24px;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: rgba(240, 234, 221, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(7, 15, 12, 0.55);
  backdrop-filter: blur(6px);
}

/* 水準器: 全指標が鉛直線基準なので、端末が傾くと基準ごと狂う */
.level {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(7, 15, 12, 0.6);
  border: 1px solid rgba(240, 234, 221, 0.22);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.level__bubble {
  position: relative;
  width: 54px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  color: rgba(240, 234, 221, 0.5);
  transition: transform 0.12s linear, color 0.25s ease;
}

.level__bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: currentColor;
}

.level__value {
  min-width: 68px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(240, 234, 221, 0.75);
}

.level[data-state="ok"] {
  border-color: rgba(76, 195, 148, 0.6);
  background: rgba(76, 195, 148, 0.14);
}
.level[data-state="ok"] .level__bubble { color: var(--jade); }
.level[data-state="ok"] .level__value { color: #7ed8b4; }

.level[data-state="warn"] {
  border-color: rgba(226, 168, 61, 0.6);
  background: rgba(226, 168, 61, 0.14);
}
.level[data-state="warn"] .level__bubble { color: var(--amber); }
.level[data-state="warn"] .level__value { color: #ecc07a; }

.level[data-state="bad"] {
  border-color: rgba(226, 105, 90, 0.7);
  background: rgba(226, 105, 90, 0.18);
}
.level[data-state="bad"] .level__bubble { color: var(--coral); }
.level[data-state="bad"] .level__value { color: #f2b7ae; }

.camera-chip {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(240, 234, 221, 0.3);
  background: rgba(7, 15, 12, 0.55);
  color: #f0eadd;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.camera-side {
  position: absolute;
  top: 50%;
  right: 26px;
  transform: translateY(-50%);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.timer-group {
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(7, 15, 12, 0.55);
  border: 1px solid rgba(240, 234, 221, 0.2);
  backdrop-filter: blur(8px);
}

.timer-chip {
  min-width: 58px;
  padding: 9px 12px;
  border-radius: 999px;
  background: transparent;
  color: rgba(240, 234, 221, 0.75);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.timer-chip.is-active {
  background: linear-gradient(135deg, #e3c68c, var(--gold-strong));
  color: #221a0c;
  font-weight: 700;
}

.shutter {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid rgba(240, 234, 221, 0.9);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.shutter:active {
  transform: scale(0.94);
}

.shutter span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e3c68c, var(--gold-strong));
  box-shadow: 0 6px 24px rgba(213, 183, 125, 0.4);
}

.camera-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
  color: rgba(240, 234, 221, 0.7);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

@keyframes countPulse {
  0% {
    opacity: 0;
    transform: scale(1.5);
  }
  22% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0.9;
    transform: scale(0.94);
  }
}

.camera-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-family: var(--font-numeral);
  font-size: 190px;
  font-weight: 600;
  color: var(--gold);
  text-shadow: 0 6px 44px rgba(0, 0, 0, 0.75);
}

.camera-countdown[hidden] {
  display: none;
}

.camera-countdown.tick {
  animation: countPulse 1s ease both;
}

.capture-confirm {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  background: rgba(4, 9, 7, 0.94);
}

.capture-confirm[hidden] {
  display: none;
}

#confirmImage {
  place-self: center;
  max-width: 86%;
  max-height: 78vh;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.capture-confirm__bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 20px 22px 30px;
}

.capture-confirm__bar .button {
  min-width: 190px;
  min-height: 52px;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .analysis-layout,
  .compare-layout,
  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-band::after {
    display: none;
  }

  .capture-actions {
    grid-template-columns: 1fr;
  }

  .capture-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .panel {
    padding: 18px;
  }

  .stat-grid,
  .compare-summary,
  .point-legend {
    grid-template-columns: 1fr;
  }

  .triple {
    grid-template-columns: 1fr;
  }

  .camera-side {
    top: auto;
    bottom: 22px;
    right: 22px;
    transform: none;
  }
}
