:root {
  color-scheme: light;
  --h5-width: 390px;
  --h5-height: 844px;
  --bg: #fbf8f2;
  --surface: #fffdf8;
  --ink: #2d2b2a;
  --muted: #7c7166;
  --line: #e7d9c6;
  --red: #b85a4b;
  --green: #6f7f55;
  --blue: #c58943;
  --gold: #b87835;
  --shadow: 0 18px 45px rgba(84, 56, 28, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(180deg, rgba(251, 248, 242, 0.98), rgba(246, 239, 228, 0.98)),
    radial-gradient(circle at top left, rgba(197, 137, 67, 0.13), transparent 30%),
    radial-gradient(circle at bottom right, rgba(111, 127, 85, 0.1), transparent 34%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

body.analyzing {
  overflow: hidden;
}

body.report-mode .intake-panel,
body.report-mode .quality-panel,
body.report-mode .analysis-card,
body.report-mode .results-grid {
  display: none !important;
}

body.report-mode .app-shell {
  padding: 0 12px 116px;
}

body.report-mode .capture-page,
body.report-mode .capture-help-modal {
  display: none;
}

body.report-mode .topbar {
  display: flex;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

button:hover {
  border-color: #d6bf9f;
  transform: translateY(-1px);
}

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

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

.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  pointer-events: none;
  justify-content: center;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(251, 248, 242, 0.98), rgba(246, 239, 228, 0.98)),
    radial-gradient(circle at top, rgba(197, 137, 67, 0.16), transparent 40%);
  padding: 18px 12px 28px;
}

.analysis-overlay.active {
  display: flex;
  pointer-events: auto;
}

.analysis-overlay[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}

.analysis-stage {
  display: grid;
  width: min(100%, 430px);
  min-height: calc(100vh - 36px);
  align-content: start;
  gap: 12px;
  padding-top: 10px;
}

.scan-photo {
  position: relative;
  overflow: hidden;
  order: 3;
  width: min(70vw, 300px);
  height: min(42vh, 380px);
  justify-self: center;
  border: 1px solid rgba(197, 137, 67, 0.28);
  border-radius: 8px;
  background: #f7efe3;
  box-shadow: 0 24px 60px rgba(84, 56, 28, 0.16);
}

.scan-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fffaf2;
}

.scan-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(197, 137, 67, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 137, 67, 0.11) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.65;
  pointer-events: none;
}

.scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: -22%;
  height: 26%;
  background:
    linear-gradient(180deg, transparent, rgba(197, 137, 67, 0.08), rgba(197, 137, 67, 0.42), rgba(111, 127, 85, 0.18), transparent),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  box-shadow: 0 0 28px rgba(197, 137, 67, 0.44);
  animation: scanBeam 2.1s linear infinite;
  pointer-events: none;
}

@keyframes scanBeam {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(520%);
  }
}

.analysis-stage h2 {
  order: 1;
  margin: 2px 0 0;
  text-align: center;
  font-size: 20px;
}

.analysis-steps {
  order: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  border: 1px solid rgba(231, 217, 198, 0.95);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  padding: 8px;
}

.analysis-step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  align-items: center;
  justify-items: center;
  color: #6f6257;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
}

.analysis-step .step-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #f2eadf;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analysis-step.done .step-icon {
  background: rgba(111, 127, 85, 0.14);
  color: var(--green);
}

.analysis-step.pending .step-icon {
  border: 1px solid rgba(197, 137, 67, 0.18);
  color: transparent;
}

.analysis-step.current .step-icon {
  border: 2px solid rgba(197, 137, 67, 0.2);
  border-top-color: var(--blue);
  color: transparent;
  animation: spin 0.8s linear infinite;
}

.analysis-step.failed .step-icon {
  background: rgba(176, 107, 27, 0.14);
  color: #8a5526;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.overall-progress {
  order: 4;
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 10px;
  align-items: center;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfce;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--blue));
  transition: width 0.18s ease;
}

.overall-progress strong {
  color: var(--blue);
  text-align: right;
  font-size: 14px;
}

.analysis-note,
.analysis-timeout {
  order: 5;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.analysis-timeout {
  display: none;
  color: #8a5526;
}

.analysis-overlay.error .analysis-timeout,
.analysis-overlay.timeout .analysis-timeout {
  display: block;
}

.analysis-actions {
  order: 6;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.analysis-overlay.error .analysis-actions,
.analysis-overlay.timeout .analysis-actions {
  display: grid;
}

.app-shell {
  width: min(100vw, var(--h5-width));
  margin: 0 auto;
  min-height: min(100vh, var(--h5-height));
  min-height: min(100svh, var(--h5-height));
  padding: 0;
}

.capture-page {
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) auto;
  width: 100%;
  height: min(100vh, var(--h5-height));
  height: min(100svh, var(--h5-height));
  background: #f7f4ed;
  color: var(--ink);
}

.capture-topbar {
  display: grid;
  grid-template-columns: 48px 1fr 84px;
  align-items: center;
  border-bottom: 1px solid rgba(231, 217, 198, 0.88);
  background: rgba(255, 253, 248, 0.96);
  padding: 0 8px;
}

.capture-topbar strong {
  justify-self: center;
  font-size: 16px;
  line-height: 1;
}

.capture-nav-button,
.capture-help-button,
.side-action,
.switch-camera,
.shutter-button,
.fallback-actions button,
.capture-help-card button {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.capture-nav-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  font-size: 34px;
  line-height: 1;
}

.capture-help-button {
  justify-self: end;
  color: var(--gold);
  font-size: 12px;
}

.camera-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.42), transparent 0 15%, transparent 30%),
    radial-gradient(circle at 18% 72%, rgba(255, 255, 255, 0.22), transparent 0 11%, transparent 30%),
    linear-gradient(180deg, #3f4441 0%, #5c625e 48%, #3d413e 100%);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.camera-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 26%, transparent 78%, rgba(0, 0, 0, 0.18)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.camera-stage:focus-visible {
  outline: 2px solid rgba(207, 144, 61, 0.72);
  outline-offset: -2px;
}

.camera-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 26%, transparent 78%, rgba(0, 0, 0, 0.12)),
    radial-gradient(circle at 50% 52%, transparent 0 36%, rgba(0, 0, 0, 0.12) 62%, rgba(0, 0, 0, 0.28) 100%);
  pointer-events: none;
}

.camera-stage.live-ready::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 26%, transparent 78%, rgba(0, 0, 0, 0.13)),
    radial-gradient(circle at 50% 52%, transparent 0 38%, rgba(0, 0, 0, 0.08) 64%, rgba(0, 0, 0, 0.22) 100%);
}

.camera-stage.system-camera-mode::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.16)),
    radial-gradient(circle at 50% 52%, transparent 0 38%, rgba(0, 0, 0, 0.08) 64%, rgba(0, 0, 0, 0.2) 100%);
}

.capture-stage-copy {
  position: absolute;
  top: 58px;
  left: 14px;
  right: 14px;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 5px;
  background: transparent;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.capture-stage-copy > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.capture-stage-copy strong {
  font-size: clamp(16px, 4.4vw, 20px);
  font-weight: 500;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

.capture-stage-copy p {
  width: min(100%, 326px);
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1.4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
}

.camera-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-preview.active {
  display: block;
}

.camera-preview.mirrored {
  transform: scaleX(-1);
}

.camera-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-content: center;
  justify-items: center;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(45, 45, 43, 0.38), rgba(38, 38, 36, 0.48)),
    rgba(45, 45, 43, 0.72);
  color: #fffdf8;
  text-align: center;
  padding: 96px 24px 24px;
}

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

.camera-fallback strong {
  font-size: 18px;
}

.camera-fallback p {
  width: min(100%, 320px);
  margin: 0;
  color: rgba(255, 253, 248, 0.78);
  font-size: 13px;
  line-height: 1.6;
}

.fallback-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: min(100%, 300px);
  margin-top: 4px;
}

.fallback-actions button,
.capture-help-card button {
  min-height: 40px;
  border: 1px solid rgba(231, 217, 198, 0.7);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
}

.fallback-actions .primary,
.capture-help-card .primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.tongue-guide {
  position: absolute;
  top: 52%;
  left: 50%;
  z-index: 4;
  width: min(calc(100vw - 46px), 366px);
  height: min(57vh, 430px);
  min-height: 330px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 15px 34px rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.viewfinder-corners {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#d5ba6f, #d5ba6f) left top / 38px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left top / 3px 38px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right top / 38px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right top / 3px 38px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left bottom / 38px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left bottom / 3px 38px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right bottom / 38px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right bottom / 3px 38px no-repeat;
  opacity: 0.9;
}

.camera-stage.system-camera-mode .tongue-guide::after {
  content: "点击取景区打开前置相机";
  position: absolute;
  left: 50%;
  bottom: -48px;
  width: max-content;
  max-width: 86vw;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.12);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
}

.tongue-guide[hidden] {
  display: none;
}

.tongue-guide-top {
  position: absolute;
  top: 7%;
  left: 50%;
  width: 78%;
  height: 43%;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-bottom: 0;
  border-radius: 50% 50% 25% 25% / 70% 70% 25% 25%;
  background: rgba(255, 255, 255, 0.05);
}

.tongue-guide-top::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 31%;
  width: 42%;
  height: 13%;
  transform: translateX(-50%);
  border-radius: 0 0 16px 16px;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(92, 92, 88, 0.32) 16% 17%, transparent 17% 33%, rgba(92, 92, 88, 0.32) 33% 34%, transparent 34% 50%, rgba(92, 92, 88, 0.32) 50% 51%, transparent 51% 67%, rgba(92, 92, 88, 0.32) 67% 68%, transparent 68% 84%, rgba(92, 92, 88, 0.32) 84% 85%, transparent 85%),
    rgba(255, 255, 255, 0.66);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.tongue-guide-top::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 32px;
  height: 50px;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top: 0;
  border-radius: 0 0 22px 22px;
}

.tongue-guide-body {
  position: absolute;
  left: 50%;
  top: 39%;
  width: 54%;
  height: 55%;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.56);
  border-radius: 38% 38% 47% 47% / 10% 10% 21% 21%;
  background: rgba(255, 255, 255, 0.02);
}

.tongue-guide-line {
  position: absolute;
  top: 49%;
  left: 50%;
  width: 16%;
  height: 31%;
  border-left: 3px solid rgba(255, 255, 255, 0.78);
  border-bottom: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 0 0 0 80%;
}

.permission-note {
  position: fixed;
  left: 50%;
  bottom: 118px;
  z-index: 4;
  display: none;
  width: min(calc(100vw - 44px), 360px);
  transform: translateX(-50%);
  border: 1px solid rgba(197, 137, 67, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  color: #7a5429;
  font-size: 11px;
  line-height: 1.45;
  padding: 7px 9px;
}

.capture-actions {
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  align-items: end;
  min-height: 108px;
  background: #130f0d;
  color: #fffdf8;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
}

.side-action {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #fffdf8;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
}

.action-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: rgba(255, 253, 248, 0.94);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-action-label {
  white-space: nowrap;
}

.center-actions {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.switch-camera {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 253, 248, 0.92);
  font-size: 11px;
  padding: 0 10px;
}

.shutter-button {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 3px solid rgba(255, 253, 248, 0.94);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(197, 137, 67, 0.2), rgba(197, 137, 67, 0) 68%);
  box-shadow:
    0 0 0 1px rgba(197, 137, 67, 0.42),
    0 12px 26px rgba(197, 137, 67, 0.25);
}

.shutter-button span {
  width: 52px;
  height: 52px;
  border-radius: inherit;
  background: linear-gradient(180deg, #d79a55 0%, var(--blue) 58%, #a96830 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.28),
    inset 0 -8px 14px rgba(98, 57, 22, 0.14);
}

.shutter-button:active {
  transform: scale(0.97);
}

.file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.capture-help-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  background: rgba(24, 18, 14, 0.52);
  padding: 18px;
}

.capture-help-modal.active {
  display: grid;
}

.capture-help-card {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  padding: 18px;
}

.capture-help-card h2 {
  margin: 0;
  font-size: 18px;
}

.capture-help-card p {
  margin: 0;
  color: #6b5f55;
  font-size: 13px;
  line-height: 1.6;
}

body.records-open {
  overflow: hidden;
}

.records-modal {
  position: fixed;
  inset: 0 auto 0 50%;
  left: 50%;
  z-index: 130;
  display: none;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  align-items: stretch;
  background: linear-gradient(180deg, #fffdf8 0%, #f7f1e7 100%);
}

.records-modal.active {
  display: flex;
}

.records-backdrop {
  display: none;
}

.records-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  overflow-y: auto;
  background: transparent;
  padding: 0 12px calc(18px + env(safe-area-inset-bottom));
}

.records-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: calc(56px + env(safe-area-inset-top));
  margin: 0 -12px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.9);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
  padding: env(safe-area-inset-top) 14px 0;
}

.records-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.records-head-spacer {
  width: 44px;
  height: 44px;
}

.records-back {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #302b27;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  padding: 0 0 4px;
}

.records-back:hover {
  border-color: transparent;
  transform: none;
}

.records-back:active {
  transform: scale(0.96);
}

.records-list {
  display: grid;
  gap: 12px;
  padding: 14px 0 0;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(231, 217, 198, 0.96);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 12px 28px rgba(80, 55, 25, 0.08);
  padding: 10px;
}

.record-main {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 98px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
}

.record-main:hover {
  border-color: transparent;
  transform: none;
}

.record-thumb {
  width: 86px;
  height: 98px;
  border: 1px solid rgba(231, 217, 198, 0.92);
  border-radius: 8px;
  background: #f8f0e5;
  object-fit: cover;
}

.record-content {
  display: grid;
  gap: 7px;
  min-width: 0;
  align-content: center;
}

.record-content strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.36;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-content em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.record-tags span {
  border-radius: 999px;
  background: rgba(197, 137, 67, 0.08);
  color: #7a5429;
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
}

.record-delete {
  justify-self: end;
  min-height: 30px;
  border-color: rgba(231, 217, 198, 0.84);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 0 10px;
}

.records-empty {
  display: block;
  margin-top: 44px;
  color: rgba(107, 95, 85, 0.72);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  padding: 0;
}

.records-empty[hidden] {
  display: none;
}

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 16;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 -10px 12px;
  padding: 14px 12px 12px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.74);
  background: rgba(251, 248, 242, 0.94);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.status-pill {
  display: none;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--muted);
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}

.status-pill.ok {
  border-color: rgba(111, 127, 85, 0.32);
  color: var(--green);
}

.status-pill.warn {
  border-color: rgba(176, 107, 27, 0.35);
  color: var(--gold);
}

.report-back {
  display: none;
}

.panel {
  border: 1px solid rgba(231, 217, 198, 0.95);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.intake-panel,
.quality-panel,
.viewer-panel {
  padding: 14px;
}

.quality-panel,
.analysis-card,
.results-grid {
  display: none !important;
}

.panel-heading p,
.canvas-toolbar p,
.report-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 184px;
  place-items: center;
  border: 1px dashed #d8c3a4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(111, 127, 85, 0.08), rgba(197, 137, 67, 0.07)),
    #fffaf2;
  text-align: center;
  padding: 18px;
  cursor: pointer;
}

.dropzone.dragging {
  border-color: var(--green);
  background: rgba(111, 127, 85, 0.09);
}

.dropzone input {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  display: block;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone > :not(input) {
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.dropzone strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
}

.dropzone small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.action-row {
  display: none;
  grid-template-columns: 1fr 0.72fr;
  gap: 8px;
  margin: 10px 0;
}

.capture-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.capture-guide div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  align-items: center;
  justify-items: center;
  border: 1px solid rgba(231, 217, 198, 0.95);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
  color: #6b5f55;
  font-size: 12px;
  padding: 8px 4px;
}

.capture-guide strong {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #f2eadf;
  color: var(--green);
  font-size: 12px;
}

.analysis-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
}

.analysis-card .analysis-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 999px;
  background: #f2eadf;
  color: var(--green);
  font-weight: 800;
}

.analysis-card.warn .analysis-icon {
  background: rgba(176, 107, 27, 0.12);
  color: var(--gold);
}

.analysis-card.blocked .analysis-icon {
  background: rgba(187, 63, 72, 0.1);
  color: var(--red);
}

.analysis-card h2 {
  margin-bottom: 3px;
}

.analysis-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.canvas-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.toggle-group {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8f0e5;
}

.toggle-group button {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.toggle-group button.active {
  background: var(--blue);
  color: #fff;
}

.image-preview-button {
  display: none;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(84, 56, 28, 0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(84, 56, 28, 0.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(84, 56, 28, 0.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(84, 56, 28, 0.045) 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.viewer-panel {
  display: none;
}

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

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.empty-state strong {
  color: var(--ink);
  font-size: 22px;
}

.score-ring {
  --score: 0;
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  margin: 10px auto 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--score) * 1%), #ece2d4 0);
}

.score-ring span {
  font-size: 30px;
  font-weight: 800;
}

.score-ring small {
  margin-top: -32px;
  color: var(--muted);
  font-size: 12px;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric {
  display: grid;
  gap: 5px;
}

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

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfce;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.notice {
  margin-top: 12px;
  border-left: 3px solid var(--gold);
  background: rgba(176, 107, 27, 0.08);
  color: #7a5429;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.5;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.results-grid .panel,
.report-section {
  padding: 12px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  border-radius: 999px;
  background: #f2eadf;
  color: var(--blue);
  padding: 5px 8px;
  font-size: 12px;
}

.region-table {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.region-row {
  display: grid;
  grid-template-columns: 70px 78px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  padding: 10px;
}

.region-row strong {
  font-size: 14px;
}

.region-row span {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.region-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.report-section {
  margin-top: 10px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.report-tabs {
  position: sticky;
  top: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0 -12px 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(10px);
}

.report-tabs button {
  min-height: 42px;
  border-radius: 0;
  background: #f8f0e5;
}

.report-tabs button:first-child {
  border-radius: 8px 0 0 8px;
}

.report-tabs button:last-child {
  border-radius: 0 8px 8px 0;
  border-left: 0;
}

.report-tabs button.active {
  background: var(--blue);
  color: #fff;
}

.report-body {
  display: grid;
  gap: 12px;
}

.report-tip {
  display: none;
}

body.report-mode .report-tip {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: block;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  border-top: 1px solid rgba(231, 217, 198, 0.96);
  background: rgba(255, 253, 248, 0.97);
  color: #6b5f55;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 -12px 34px rgba(84, 56, 28, 0.1);
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  padding: 14px;
}

.report-card h3 {
  margin-bottom: 8px;
  color: var(--ink);
}

.report-card p {
  margin-bottom: 8px;
  color: #5c5149;
  font-size: 14px;
  line-height: 1.68;
}

.report-card p:last-child {
  margin-bottom: 0;
}

body.report-mode {
  align-items: flex-start;
  background:
    linear-gradient(180deg, rgba(251, 248, 242, 0.98), rgba(246, 239, 228, 0.98)),
    radial-gradient(circle at top right, rgba(197, 137, 67, 0.12), transparent 34%);
}

body.report-mode .topbar {
  min-height: 58px;
  margin: 0 -12px 10px;
  padding: 12px 16px 10px;
  background: rgba(251, 248, 242, 0.97);
}

body.report-mode h1 {
  font-size: 20px;
}

body.report-mode .status-pill {
  min-width: auto;
  padding: 6px 12px;
  font-size: 12px;
  background: var(--surface);
}

body.report-mode .workspace {
  gap: 10px;
}

body.report-mode .viewer-panel {
  display: block;
  padding: 12px;
  border-color: rgba(231, 217, 198, 0.94);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 26px rgba(84, 56, 28, 0.07);
}

body.report-mode .canvas-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

body.report-mode .canvas-toolbar > div {
  min-width: 0;
}

body.report-mode .canvas-toolbar h2 {
  font-size: 17px;
}

body.report-mode .canvas-toolbar p {
  display: none;
  overflow: hidden;
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

body.report-mode .toggle-group {
  display: none;
}

body.report-mode .image-preview-button {
  display: inline-flex;
  width: auto;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-color: rgba(197, 137, 67, 0.28);
  border-radius: 999px;
  background: rgba(197, 137, 67, 0.08);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
}

body.report-mode .toggle-group button {
  font-size: 13px;
}

body.report-mode .toggle-group button:first-child {
  border-radius: 999px 0 0 999px;
}

body.report-mode .toggle-group button:last-child {
  border-radius: 0 999px 999px 0;
}

body.report-mode .canvas-wrap {
  display: grid;
  max-height: 330px;
  min-height: 220px;
  place-items: center;
  border-radius: 8px;
  background-color: #fffaf2;
}

body.report-mode canvas {
  width: auto;
  max-width: 100%;
  max-height: 330px;
}

body.report-mode .report-section.panel {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.report-mode .report-head {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 12px 2px 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.72);
}

body.report-mode .report-head h2 {
  margin: 0;
  font-size: 20px;
}

body.report-mode .report-tabs {
  top: 58px;
  margin: 0 -12px 12px;
  padding: 8px 12px;
  border-top: 1px solid rgba(231, 217, 198, 0.84);
  border-bottom: 1px solid rgba(231, 217, 198, 0.84);
  background: rgba(251, 248, 242, 0.98);
}

body.report-mode .report-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #51483f;
  font-size: 15px;
  font-weight: 800;
}

body.report-mode .report-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

body.report-mode .report-body {
  gap: 12px;
}

body.report-mode .report-card {
  border-color: rgba(231, 217, 198, 0.96);
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 8px 20px rgba(84, 56, 28, 0.055);
  padding: 14px;
}

body.report-mode .report-card:first-child {
  border-color: rgba(197, 137, 67, 0.22);
  background:
    linear-gradient(180deg, rgba(197, 137, 67, 0.07), rgba(255, 253, 248, 0.98)),
    var(--surface);
}

body.report-mode .report-card h3 {
  margin-bottom: 9px;
  font-size: 16px;
  line-height: 1.28;
}

body.report-mode .report-card p {
  margin-bottom: 9px;
  color: #5c5149;
  font-size: 14px;
  line-height: 1.68;
}

body.report-mode .report-summary-card {
  display: grid;
  gap: 12px;
  border-color: rgba(197, 137, 67, 0.28);
  background:
    linear-gradient(180deg, rgba(197, 137, 67, 0.08), rgba(255, 253, 248, 0.98)),
    var(--surface);
}

body.report-mode .summary-head {
  display: grid;
  gap: 6px;
}

body.report-mode .summary-head span,
body.report-mode .dimension-head span,
body.report-mode .report-field span,
body.report-mode .plan-item span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

body.report-mode .summary-head strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.42;
}

body.report-mode .summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.report-mode .summary-item {
  display: grid;
  gap: 3px;
  min-height: 62px;
  align-content: center;
  border: 1px solid rgba(231, 217, 198, 0.9);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.82);
  padding: 9px 10px;
}

body.report-mode .summary-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

body.report-mode .summary-item strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

body.report-mode .report-dimension-card {
  display: grid;
  gap: 11px;
}

body.report-mode .dimension-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

body.report-mode .dimension-head strong {
  color: var(--ink);
  text-align: right;
  font-size: 18px;
  line-height: 1.25;
}

body.report-mode .report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.report-mode .report-tags span {
  border: 1px solid rgba(197, 137, 67, 0.18);
  border-radius: 999px;
  background: rgba(197, 137, 67, 0.08);
  color: #7a5429;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1;
}

body.report-mode .report-fields,
body.report-mode .plan-list {
  display: grid;
  gap: 10px;
}

body.report-mode .report-field,
body.report-mode .plan-item {
  display: grid;
  gap: 5px;
}

body.report-mode .report-field p,
body.report-mode .plan-item p,
body.report-mode .plan-principle p {
  margin: 0;
}

body.report-mode .report-plan-card h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

body.report-mode .plan-item {
  border-left: 3px solid rgba(197, 137, 67, 0.42);
  padding-left: 10px;
}

body.report-mode .plan-principle {
  border-left-color: rgba(111, 127, 85, 0.46);
  background: rgba(111, 127, 85, 0.06);
  border-radius: 0 8px 8px 0;
  padding: 9px 10px;
}

body.report-mode .report-tip {
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  font-size: 11px;
  line-height: 1.45;
}

body.report-mode .app-shell {
  padding: 0 14px calc(138px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(251, 248, 242, 0.97), rgba(247, 241, 232, 0.98)),
    var(--bg);
}

body.report-mode .topbar {
  min-height: 62px;
  margin: 0 -14px 12px;
  padding: 14px 18px 12px;
  box-shadow: 0 8px 22px rgba(84, 56, 28, 0.04);
}

body.report-mode h1 {
  font-size: 22px;
  font-weight: 900;
}

body.report-mode .workspace {
  gap: 12px;
}

body.report-mode .viewer-panel {
  margin-top: 8px;
  padding: 14px;
  border-color: rgba(231, 217, 198, 0.98);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 18px 42px rgba(84, 56, 28, 0.08);
}

body.report-mode .canvas-toolbar {
  gap: 12px;
  margin-bottom: 12px;
}

body.report-mode .canvas-toolbar h2 {
  color: #2e2925;
  font-size: 20px;
  font-weight: 900;
}

body.report-mode .image-preview-button {
  min-height: 38px;
  border-color: rgba(197, 137, 67, 0.26);
  background: #fff7ec;
  box-shadow: 0 6px 16px rgba(197, 137, 67, 0.08);
  color: #bd7430;
  padding: 0 15px;
}

body.report-mode .canvas-wrap {
  position: relative;
  overflow: hidden;
  max-height: none;
  min-height: 0;
  border: 1px solid rgba(231, 217, 198, 0.86);
  background-color: #fffaf2;
  background-image:
    linear-gradient(45deg, rgba(231, 217, 198, 0.34) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(231, 217, 198, 0.34) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(231, 217, 198, 0.34) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(231, 217, 198, 0.34) 75%);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-size: 24px 24px;
  padding: 10px;
}

body.report-mode canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 6px;
  object-fit: contain;
}

body.report-mode .report-section.panel {
  margin-top: 16px;
}

body.report-mode .report-head {
  min-height: 56px;
  margin: 0 2px 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.78);
}

body.report-mode .report-title-block {
  display: grid;
  gap: 5px;
  min-width: 0;
}

body.report-mode .report-head h2 {
  color: #2e2925;
  font-size: 22px;
  font-weight: 900;
}

body.report-mode .report-head p {
  display: none;
  margin: 0;
  color: #897b6f;
  font-size: 12px;
  line-height: 1.35;
}

body.report-mode .report-tabs {
  top: 62px;
  z-index: 12;
  gap: 0;
  margin: 0 -2px 14px;
  border: 1px solid rgba(231, 217, 198, 0.98);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 8px 22px rgba(84, 56, 28, 0.05);
  padding: 0;
}

body.report-mode .report-tabs button {
  display: grid;
  min-height: 46px;
  align-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #51483f;
  font-size: 15px;
  font-weight: 900;
}

body.report-mode .report-tabs button:first-child,
body.report-mode .report-tabs button:last-child {
  border-radius: 7px;
}

body.report-mode .report-tabs button + button {
  border-left: 1px solid rgba(231, 217, 198, 0.86);
}

body.report-mode .report-tabs button.active {
  background: #c98d40;
  color: #fff;
}

body.report-mode .report-tabs button.active + button {
  border-left-color: transparent;
}

body.report-mode .report-body {
  gap: 12px;
}

body.report-mode .report-card {
  overflow: hidden;
  border-color: rgba(231, 217, 198, 0.98);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 12px 28px rgba(84, 56, 28, 0.065);
  padding: 16px;
}

body.report-mode .report-section[data-active-tab="plan"] .report-card:first-child {
  border-color: rgba(231, 217, 198, 0.98);
  background: rgba(255, 253, 248, 0.98);
}

body.report-mode .summary-head {
  gap: 8px;
}

body.report-mode .summary-head span,
body.report-mode .dimension-head span,
body.report-mode .report-field span,
body.report-mode .plan-item span {
  color: #bd7430;
  font-size: 12px;
  font-weight: 900;
}

body.report-mode .summary-head strong {
  font-size: 19px;
  font-weight: 900;
}

body.report-mode .summary-grid {
  gap: 9px;
}

body.report-mode .summary-item {
  min-height: 66px;
  border-color: rgba(231, 217, 198, 0.96);
  background: rgba(255, 250, 242, 0.92);
  padding: 10px;
}

body.report-mode .summary-item strong {
  font-size: 16px;
}

body.report-mode .report-dimension-card {
  gap: 12px;
}

body.report-mode .dimension-head {
  align-items: center;
}

body.report-mode .dimension-head div {
  display: grid;
  gap: 4px;
}

body.report-mode .dimension-head h3 {
  margin: 0;
  color: #2e2925;
  font-size: 18px;
  font-weight: 900;
}

body.report-mode .dimension-head strong {
  flex: 0 0 auto;
  border: 1px solid rgba(197, 137, 67, 0.18);
  border-radius: 999px;
  background: rgba(197, 137, 67, 0.08);
  color: #7a5429;
  font-size: 14px;
  padding: 7px 10px;
}

body.report-mode .report-tags {
  gap: 7px;
}

body.report-mode .report-tags span {
  background: rgba(111, 127, 85, 0.08);
  color: #667647;
}

body.report-mode .report-field {
  border-left: 3px solid rgba(197, 137, 67, 0.22);
  padding-left: 10px;
}

body.report-mode .report-field p,
body.report-mode .plan-item p,
body.report-mode .plan-principle p {
  color: #5d534a;
  font-size: 14px;
  line-height: 1.72;
}

body.report-mode .plan-card-head {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

body.report-mode .plan-card-head h3 {
  margin: 0;
  color: #2e2925;
  font-size: 20px;
  font-weight: 900;
}

body.report-mode .plan-list {
  gap: 12px;
}

body.report-mode .plan-item {
  border-left: 3px solid rgba(197, 137, 67, 0.34);
  padding-left: 11px;
}

body.report-mode .plan-principle {
  border-left-color: rgba(111, 127, 85, 0.48);
  background: rgba(111, 127, 85, 0.06);
  padding: 10px 11px;
}

body.report-mode .report-tip {
  width: min(100vw, 430px);
  min-height: 52px;
  border-top-color: rgba(231, 217, 198, 0.98);
  box-shadow: 0 -10px 30px rgba(84, 56, 28, 0.08);
  color: #665b51;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  font-size: 12px;
  line-height: 1.48;
}

body.report-mode .app-shell {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

body.report-mode .report-section.panel {
  padding-bottom: 0;
}

body.report-mode .report-tip {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  width: auto;
  min-height: 0;
  transform: none;
  margin: 14px 0 0;
  border: 1px solid rgba(231, 217, 198, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: none;
  color: #756a60;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

body.report-mode .topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  justify-content: stretch;
}

body.report-mode .topbar h1 {
  justify-self: center;
}

body.report-mode .report-back {
  display: grid;
  width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4f4740;
  font-size: 32px;
  line-height: 1;
  padding: 0 0 3px;
}

body.report-mode .report-back:active {
  background: rgba(197, 137, 67, 0.1);
  transform: none;
}

body.report-mode .report-back:hover {
  border-color: transparent;
  transform: none;
}

body.report-mode .status-pill {
  display: block;
  visibility: hidden;
  width: 40px;
  min-width: 40px;
  padding: 0;
}

body.report-mode .viewer-panel {
  display: grid;
  gap: 10px;
}

body.report-mode .canvas-toolbar {
  grid-template-columns: 1fr auto;
  margin-bottom: 0;
}

body.report-mode .canvas-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

body.report-mode .canvas-wrap {
  aspect-ratio: 1;
  min-height: 0;
  max-height: none;
  padding: 8px;
}

body.report-mode canvas {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  cursor: zoom-in;
}

body.report-mode .region-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.report-mode .region-legend span {
  display: grid;
  grid-template-columns: 12px auto 1fr;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid rgba(231, 217, 198, 0.8);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.76);
  color: #4f4740;
  padding: 7px 8px;
}

body.report-mode .region-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

body.report-mode .region-legend strong {
  font-size: 12px;
  line-height: 1;
}

body.report-mode .region-legend em {
  justify-self: end;
  color: #85796e;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

body.report-mode .legend-tip {
  background: rgba(187, 63, 72, 0.78);
}

body.report-mode .legend-middle {
  background: rgba(176, 107, 27, 0.78);
}

body.report-mode .legend-sides {
  background: rgba(23, 111, 99, 0.74);
}

body.report-mode .legend-root {
  background: rgba(45, 98, 143, 0.78);
}

body.report-mode .image-meta {
  display: none;
}

@media (max-width: 380px) {
  body.report-mode .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  body.report-mode .topbar {
    margin-right: -10px;
    margin-left: -10px;
  }

  body.report-mode .viewer-panel,
  body.report-mode .report-card {
    padding: 12px;
  }

  body.report-mode .report-tabs button {
    min-height: 44px;
    font-size: 14px;
  }

  body.report-mode .summary-grid {
    grid-template-columns: 1fr;
  }

  body.report-mode .dimension-head {
    align-items: start;
    flex-direction: column;
  }

  body.report-mode .region-legend {
    gap: 6px;
  }

  body.report-mode .region-legend span {
    grid-template-columns: 10px 1fr;
    gap: 5px;
    min-height: 30px;
    padding: 6px;
  }

  body.report-mode .region-legend em {
    display: none;
  }
}

body.preview-open {
  overflow: hidden;
}

.image-preview-modal {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 80;
  display: none;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  align-items: end;
  justify-content: center;
  padding: 0 12px 12px;
}

.image-preview-modal.active {
  display: flex;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 28, 22, 0.56);
}

.image-preview-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: 100%;
  max-height: min(84vh, 680px);
  overflow: hidden;
  border: 1px solid rgba(231, 217, 198, 0.96);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 -18px 48px rgba(36, 28, 22, 0.22);
  padding: 12px;
}

.image-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-preview-head strong {
  font-size: 17px;
}

.image-preview-head button {
  min-height: 32px;
  border-radius: 999px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
}

.image-preview-frame {
  display: grid;
  max-height: calc(min(84vh, 680px) - 72px);
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.image-preview-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(min(84vh, 680px) - 74px);
  object-fit: contain;
}

.report-hero {
  display: none;
}

body.report-mode .app-shell {
  padding: 0 12px calc(28px + env(safe-area-inset-bottom));
}

body.report-mode .topbar {
  min-height: 58px;
  margin: 0 -12px 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.82);
  box-shadow: 0 8px 20px rgba(84, 56, 28, 0.035);
}

body.report-mode .topbar h1 {
  color: #2e2925;
  font-size: 20px;
  font-weight: 900;
}

body.report-mode .report-hero {
  display: grid;
  gap: 12px;
  margin: 0 0 10px;
  border-color: rgba(197, 137, 67, 0.28);
  background:
    linear-gradient(180deg, rgba(197, 137, 67, 0.08), rgba(255, 253, 248, 0.98)),
    var(--surface);
  box-shadow: 0 14px 34px rgba(84, 56, 28, 0.07);
  padding: 16px;
}

body.report-mode .report-hero-kicker {
  color: #bd7430;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

body.report-mode .report-hero h2 {
  margin: 0;
  color: #2e2925;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.42;
}

body.report-mode .report-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

body.report-mode .report-hero-item {
  display: grid;
  gap: 4px;
  min-height: 58px;
  align-content: center;
  border: 1px solid rgba(231, 217, 198, 0.92);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.8);
  padding: 8px 7px;
}

body.report-mode .report-hero-item span {
  color: #85796e;
  font-size: 11px;
  line-height: 1;
}

body.report-mode .report-hero-item strong {
  color: #2e2925;
  font-size: 13px;
  line-height: 1.22;
}

body.report-mode .workspace {
  gap: 10px;
}

body.report-mode .viewer-panel {
  margin-top: 0;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(84, 56, 28, 0.055);
}

body.report-mode .canvas-toolbar {
  grid-template-columns: 1fr auto;
  gap: 10px;
}

body.report-mode .canvas-toolbar h2 {
  font-size: 17px;
}

body.report-mode .image-preview-button {
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
  padding: 0 12px;
}

body.report-mode .canvas-wrap {
  aspect-ratio: 1.08;
  padding: 8px;
}

body.report-mode .region-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid rgba(231, 217, 198, 0.72);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  padding: 8px;
}

body.report-mode .region-legend-title {
  grid-column: 1 / -1;
  color: #8a5526;
  font-size: 12px;
  line-height: 1.2;
}

body.report-mode .region-legend span {
  display: grid;
  grid-template-columns: 10px 1fr;
  grid-template-areas:
    "dot name"
    "dot organ";
  align-items: center;
  column-gap: 6px;
  min-height: 38px;
  border: 1px solid rgba(231, 217, 198, 0.64);
  border-radius: 7px;
  background: rgba(255, 250, 242, 0.74);
  padding: 6px 7px;
}

body.report-mode .region-legend i {
  grid-area: dot;
  width: 9px;
  height: 22px;
  border-radius: 999px;
}

body.report-mode .region-legend span strong {
  grid-area: name;
  color: #4f4740;
  font-size: 12px;
  line-height: 1.2;
}

body.report-mode .region-legend em {
  grid-area: organ;
  display: block;
  color: #85796e;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

@media (max-width: 380px) {
  body.report-mode .region-legend {
    gap: 6px;
    padding: 7px;
  }

  body.report-mode .region-legend span {
    min-height: 36px;
    padding: 6px;
  }
}

body.report-mode .report-section.panel {
  margin-top: 10px;
}

body.report-mode .report-head {
  display: none;
}

body.report-mode .report-head h2 {
  font-size: 20px;
}

body.report-mode .report-tabs {
  top: 58px;
  margin-bottom: 12px;
}

body.report-mode .report-tabs button {
  min-height: 44px;
}

body.report-mode .report-body {
  gap: 10px;
}

body.report-mode .report-card {
  padding: 14px;
}

body.report-mode .report-summary-card {
  display: none;
}

body.report-mode .dimension-head h3 {
  font-size: 17px;
}

body.report-mode .report-field p,
body.report-mode .plan-item p,
body.report-mode .plan-principle p {
  font-size: 14px;
  line-height: 1.68;
}

@media (max-width: 380px) {
  body.report-mode .report-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.report-mode .report-hero h2 {
    font-size: 19px;
  }
}

.placeholder {
  color: var(--muted);
}

@media (max-width: 380px) {
  h1 {
    font-size: 25px;
  }

  .region-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  body {
    background:
      linear-gradient(90deg, #efe3d1, #fbf8f2 32%, #fbf8f2 68%, #efe3d1),
      var(--bg);
  }

  .app-shell {
    border-left: 1px solid rgba(231, 217, 198, 0.92);
    border-right: 1px solid rgba(231, 217, 198, 0.92);
    background: rgba(251, 248, 242, 0.92);
  }
}

.report-time,
.report-share,
.report-score-panel {
  display: none;
}

body.report-mode .app-shell {
  padding: 0 12px calc(28px + env(safe-area-inset-bottom));
}

body.report-mode .topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: 44px 1fr 64px;
  align-items: center;
  min-height: 58px;
  margin: 0 -12px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.92);
  background: rgba(251, 248, 242, 0.98);
  box-shadow: 0 8px 22px rgba(84, 56, 28, 0.06);
  padding: 8px 12px;
}

body.report-mode .topbar h1 {
  justify-self: center;
  color: #2e2925;
  font-size: 20px;
  font-weight: 900;
}

body.report-mode .report-share {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  justify-self: end;
  border-color: rgba(197, 137, 67, 0.26);
  border-radius: 999px;
  background: rgba(197, 137, 67, 0.1);
  color: #b86f2c;
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
}

body.report-mode .status-pill {
  display: none;
}

body.report-mode .report-time {
  display: block;
  margin: 10px 0 8px;
  color: #796c60;
  font-size: 12px;
  line-height: 1.35;
}

body.report-mode .report-hero {
  display: none !important;
}

body.report-mode .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(126px, 0.72fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

body.report-mode .viewer-panel {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(84, 56, 28, 0.055);
}

body.report-mode .canvas-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
}

body.report-mode .canvas-toolbar h2 {
  font-size: 15px;
}

body.report-mode .image-preview-button {
  min-height: 30px;
  font-size: 12px;
  padding: 0 10px;
}

body.report-mode .canvas-wrap {
  aspect-ratio: 0.86;
  min-height: 0;
  max-height: none;
  padding: 6px;
}

body.report-mode canvas {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

body.report-mode .viewer-panel > .region-legend {
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 0;
  padding: 6px;
}

body.report-mode .viewer-panel > .region-legend .region-legend-title {
  font-size: 11px;
}

body.report-mode .viewer-panel > .region-legend span {
  min-height: 28px;
  padding: 5px 6px;
}

body.report-mode .viewer-panel > .region-legend i {
  height: 18px;
}

body.report-mode .viewer-panel > .region-legend span strong,
body.report-mode .viewer-panel > .region-legend em {
  font-size: 10px;
}

/* Local report image-first layout and in-page image viewer. */
body:not(.report-mode) .app-shell > .report-result-visual {
  display: none;
}

body.report-mode .app-shell > .report-result-visual {
  display: block;
  margin: 0 0 10px;
}

body.report-mode .app-shell > .report-result-visual .viewer-panel {
  display: grid !important;
  gap: 8px;
  margin: 0;
  border-color: rgba(231, 217, 198, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  padding: 10px;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
}

body.report-mode .app-shell > .report-result-visual .canvas-toolbar {
  grid-template-columns: 1fr auto;
  gap: 8px;
}

body.report-mode .app-shell > .report-result-visual .toggle-group {
  display: none;
}

body.report-mode .app-shell > .report-result-visual .image-preview-button {
  display: inline-flex;
}

body.report-mode .app-shell > .report-result-visual .canvas-wrap {
  display: grid;
  max-height: 44vh;
  place-items: center;
  overflow: hidden;
  padding: 8px;
}

body.report-mode .app-shell > .report-result-visual canvas {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(44vh - 18px);
}

body.report-mode .app-shell > .report-result-visual .viewer-panel > .region-legend {
  grid-template-columns: 1fr !important;
  gap: 7px;
  margin-top: 4px;
  padding: 9px;
}

body.report-mode .report-section > .report-result-visual {
  display: none !important;
}

body.preview-open .image-preview-modal {
  z-index: 180;
}

.image-preview-modal.active {
  display: flex;
}

.image-preview-modal {
  align-items: stretch;
  padding: 0;
}

.image-preview-backdrop {
  background: rgba(28, 22, 18, 0.86);
}

.image-preview-sheet {
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: rgba(19, 15, 13, 0.94);
  color: #fffdf8;
  box-shadow: none;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
}

.image-preview-head {
  min-height: 42px;
}

.image-preview-head strong {
  color: #fffdf8;
}

.image-preview-head span {
  color: rgba(255, 253, 248, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.image-preview-head button {
  border-color: rgba(255, 253, 248, 0.24);
  background: rgba(255, 253, 248, 0.08);
  color: #fffdf8;
}

.image-preview-frame {
  position: relative;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 0;
  background: rgba(255, 253, 248, 0.04);
  touch-action: none;
}

.image-preview-frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: none;
  user-select: none;
  will-change: transform;
  -webkit-user-drag: none;
}

.image-preview-dimensions {
  position: absolute;
  right: 18px;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  color: var(--gold);
  font-size: clamp(14px, 4.1vw, 19px);
  font-weight: 900;
  line-height: 1.24;
  pointer-events: none;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.42),
    0 0 10px rgba(255, 253, 248, 0.18);
}

.image-preview-dimensions span {
  display: flex;
  align-items: baseline;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.image-preview-dimensions b,
.image-preview-dimensions em {
  font-style: normal;
  font-weight: 900;
}

.image-preview-dimensions b {
  flex: 0 0 auto;
}

.image-preview-dimensions em {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 420px) {
  .image-preview-dimensions {
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: clamp(13px, 3.8vw, 17px);
  }
}

.preview-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none !important;
  width: 38px;
  height: 54px;
  min-height: 54px;
  transform: translateY(-50%);
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 999px;
  background: rgba(19, 15, 13, 0.36);
  color: #fffdf8;
  font-size: 34px;
  line-height: 1;
  padding: 0 0 4px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  will-change: transform;
}

.preview-nav::before {
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: rgba(255, 253, 248, 0.22);
  content: "";
  opacity: 0;
  transform: scale(0.68);
}

.preview-nav:hover {
  border-color: rgba(255, 253, 248, 0.32);
  background: rgba(255, 253, 248, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.preview-nav:active {
  background: rgba(255, 253, 248, 0.22);
}

.preview-nav.is-pressing::before {
  animation: previewNavPulse 0.32s ease-out;
}

.preview-prev {
  left: 8px;
}

.preview-next {
  right: 8px;
}

.preview-nav[hidden] {
  display: none;
}

@keyframes previewNavPulse {
  0% {
    opacity: 0.55;
    transform: scale(0.6);
  }
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

.report-overview-strip {
  display: none;
}

body.report-mode .report-time {
  display: none !important;
}

body.report-mode .report-overview-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  border: 1px solid rgba(231, 217, 198, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(255, 250, 242, 0.9));
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
  padding: 9px 10px;
}

body.report-mode .report-overview-strip .placeholder {
  margin: 0;
  color: #8d8074;
  font-size: 12px;
}

body.report-mode .overview-score {
  display: grid;
  min-width: 78px;
  justify-items: center;
  gap: 1px;
  border-right: 1px solid rgba(231, 217, 198, 0.8);
  padding-right: 10px;
}

body.report-mode .overview-score span {
  color: #d2913d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

body.report-mode .overview-score strong {
  color: #2e2925;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1.15;
}

body.report-mode .overview-score em {
  color: #8a5526;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
}

body.report-mode .overview-main {
  min-width: 0;
}

body.report-mode .overview-main strong {
  display: block;
  color: #2e2925;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

body.report-mode .overview-main p {
  margin: 3px 0 0;
  color: #77695d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

body.report-mode .report-overview-strip[data-grade="excellent"] .overview-score strong,
body.report-mode .report-overview-strip[data-grade="good"] .overview-score strong {
  color: #5f7148;
}

body.report-mode .report-overview-strip[data-grade="poor"] .overview-score strong,
body.report-mode .report-overview-strip[data-grade="bad"] .overview-score strong {
  color: #a84e41;
}

@media (max-width: 380px) {
  body.report-mode .report-overview-strip {
    gap: 8px;
    padding: 8px;
  }

  body.report-mode .overview-score {
    min-width: 70px;
    padding-right: 8px;
  }

  body.report-mode .overview-main strong {
    font-size: 13px;
  }
}

body.report-mode .app-shell {
  background: linear-gradient(180deg, #fbf8f2 0, #f8f1e7 100%);
}

body.report-mode .topbar {
  min-height: 56px;
  border-bottom-color: rgba(231, 217, 198, 0.96);
  box-shadow: 0 10px 24px rgba(84, 56, 28, 0.055);
}

body.report-mode .report-time {
  margin: 8px 0 8px;
  border: 1px solid rgba(231, 217, 198, 0.7);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  color: #76695e;
  padding: 7px 9px;
}

body.report-mode .workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(132px, 0.72fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 12px;
}

body.report-mode .viewer-panel,
body.report-mode .report-score-panel {
  border-color: rgba(231, 217, 198, 0.96);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 24px rgba(84, 56, 28, 0.06);
}

body.report-mode .viewer-panel {
  gap: 8px;
  padding: 10px;
}

body.report-mode .canvas-toolbar h2 {
  font-size: 16px;
}

body.report-mode .image-preview-button {
  min-height: 31px;
  font-size: 12px;
  padding: 0 10px;
}

body.report-mode .canvas-wrap {
  aspect-ratio: 1;
  border-radius: 8px;
  padding: 6px;
}

body.report-mode .viewer-panel > .region-legend {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px;
  margin-top: 0;
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.74);
  padding: 7px;
}

body.report-mode .viewer-panel > .region-legend .region-legend-title {
  grid-column: 1 / -1;
  font-size: 11px;
}

body.report-mode .viewer-panel > .region-legend span {
  grid-template-columns: 8px 1fr;
  min-height: 34px;
  column-gap: 5px;
  padding: 5px;
}

body.report-mode .viewer-panel > .region-legend i {
  width: 8px;
  height: 20px;
}

body.report-mode .viewer-panel > .region-legend span strong {
  font-size: 10px;
}

body.report-mode .viewer-panel > .region-legend em {
  font-size: 9px;
}

body.report-mode .report-score-panel {
  align-self: start;
  gap: 8px;
  padding: 10px;
}

body.report-mode .report-score-title {
  font-size: 12px;
}

body.report-mode .report-score-gauge {
  width: min(100%, 104px);
  background:
    radial-gradient(circle, #fffdf8 0 55%, transparent 56%),
    conic-gradient(var(--score-color) calc(var(--score, 0) * 1%), rgba(231, 217, 198, 0.86) 0);
}

body.report-mode .report-score-gauge strong {
  font-size: 29px;
}

body.report-mode .report-score-gauge span {
  margin-top: -18px;
}

body.report-mode .report-score-grade span {
  font-size: 13px;
}

body.report-mode .report-score-grade strong {
  font-size: 19px;
}

body.report-mode .report-score-parts {
  gap: 0;
  margin-top: 3px;
}

body.report-mode .report-score-parts div {
  min-height: 23px;
  align-items: center;
  padding-top: 0;
}

body.report-mode .report-score-parts span,
body.report-mode .report-score-parts strong {
  font-size: 10px;
}

body.report-mode .report-tabs {
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
}

body.report-mode .report-tabs button {
  min-height: 43px;
}

body.report-mode .report-card {
  border-color: rgba(231, 217, 198, 0.94);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 22px rgba(84, 56, 28, 0.045);
}

body.report-mode .dimension-head {
  align-items: center;
}

body.report-mode .report-field,
body.report-mode .plan-item {
  border-left: 3px solid rgba(197, 137, 67, 0.28);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 250, 242, 0.72);
  padding: 8px 9px;
}

@media (max-width: 380px) {
  body.report-mode .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(122px, 0.66fr);
    gap: 7px;
  }

  body.report-mode .viewer-panel,
  body.report-mode .report-score-panel {
    padding: 8px;
  }

  body.report-mode .report-score-gauge {
    width: min(100%, 94px);
  }

  body.report-mode .report-score-gauge strong {
    font-size: 25px;
  }

  body.report-mode .report-score-parts span,
  body.report-mode .report-score-parts strong {
    font-size: 9px;
  }
}

body.report-mode .report-score-panel {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(84, 56, 28, 0.055);
}

body.report-mode .report-score-title {
  color: #8a5526;
  font-size: 12px;
  font-weight: 900;
}

body.report-mode .report-score-gauge {
  --score-color: #c58943;
  position: relative;
  display: grid;
  width: min(100%, 116px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffdf8 0 58%, transparent 59%),
    conic-gradient(var(--score-color) calc(var(--score, 0) * 1%), rgba(231, 217, 198, 0.86) 0);
}

body.report-mode .report-score-gauge strong {
  color: #2e2925;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
}

body.report-mode .report-score-gauge span {
  margin-top: -18px;
  color: #8d8074;
  font-size: 11px;
  font-weight: 800;
}

body.report-mode .report-score-grade {
  display: grid;
  justify-items: center;
  gap: 3px;
}

body.report-mode .report-score-grade span {
  color: #d2913d;
  font-size: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

body.report-mode .report-score-grade strong {
  color: #2e2925;
  font-size: 20px;
  font-weight: 1000;
}

body.report-mode .report-score-panel[data-grade="excellent"] .report-score-gauge,
body.report-mode .report-score-panel[data-grade="good"] .report-score-gauge {
  --score-color: #6f7f55;
}

body.report-mode .report-score-panel[data-grade="poor"] .report-score-gauge,
body.report-mode .report-score-panel[data-grade="bad"] .report-score-gauge {
  --score-color: #b85a4b;
}

body.report-mode .report-score-parts {
  display: grid;
  gap: 5px;
}

body.report-mode .report-score-parts div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid rgba(231, 217, 198, 0.58);
  padding-top: 5px;
}

body.report-mode .report-score-parts span,
body.report-mode .report-score-parts strong {
  color: #6b5f55;
  font-size: 10px;
  line-height: 1.2;
}

body.report-mode .report-score-parts strong {
  color: #2e2925;
}

body.report-mode .report-section.panel {
  margin-top: 0;
  padding: 0;
}

body.report-mode .report-tabs {
  position: sticky;
  top: 58px;
  z-index: 80;
  margin: 0 -12px 12px;
  border: 0;
  border-top: 1px solid rgba(231, 217, 198, 0.9);
  border-bottom: 1px solid rgba(231, 217, 198, 0.9);
  border-radius: 0;
  background: rgba(251, 248, 242, 0.98);
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.06);
  padding: 8px 12px;
}

body.report-mode .report-tabs button {
  min-height: 44px;
  border: 1px solid rgba(231, 217, 198, 0.95);
  background: #fffdf8;
}

body.report-mode .report-tabs button.active {
  border-color: #c98d3e;
  background: #cf8f3d;
  color: #fff;
}

body.report-mode .report-body {
  display: grid;
  gap: 10px;
}

body.report-mode .report-tip {
  position: static;
  width: auto;
  min-height: auto;
  margin-top: 12px;
  border: 1px solid rgba(231, 217, 198, 0.86);
  border-radius: 8px;
  box-shadow: none;
  padding: 10px;
}

@media (max-width: 380px) {
  body.report-mode .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 0.68fr);
    gap: 8px;
  }

  body.report-mode .report-score-gauge {
    width: min(100%, 104px);
  }

  body.report-mode .report-score-gauge strong {
    font-size: 26px;
  }
}

.records-modal[hidden] {
  display: none !important;
}

body.report-mode .viewer-panel > .region-legend {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
  border: 1px solid rgba(231, 217, 198, 0.72);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  padding: 8px;
}

body.report-mode .viewer-panel > .region-legend .region-legend-title {
  display: block;
  grid-column: 1 / -1;
  color: #8a5526;
  font-size: 12px;
  line-height: 1.2;
}

body.report-mode .viewer-panel > .region-legend span {
  display: grid;
  grid-template-columns: 10px 1fr;
  grid-template-areas:
    "dot name"
    "dot organ";
  align-items: center;
  column-gap: 6px;
  min-height: 38px;
  border: 1px solid rgba(231, 217, 198, 0.64);
  border-radius: 7px;
  background: rgba(255, 250, 242, 0.78);
  padding: 6px 7px;
}

body.report-mode .viewer-panel > .region-legend i {
  grid-area: dot;
  width: 9px;
  height: 22px;
  border-radius: 999px;
}

body.report-mode .viewer-panel > .region-legend span strong {
  grid-area: name;
  color: #4f4740;
  font-size: 12px;
  line-height: 1.2;
}

body.report-mode .viewer-panel > .region-legend em {
  grid-area: organ;
  display: block !important;
  color: #85796e;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

@media (max-width: 380px) {
  body.report-mode .viewer-panel > .region-legend {
    gap: 6px;
    padding: 7px;
  }

  body.report-mode .viewer-panel > .region-legend span {
    min-height: 36px;
    padding: 6px;
  }
}

body.report-mode .viewer-panel > .region-legend {
  grid-template-columns: 1fr !important;
  gap: 5px;
  margin-top: 0;
  padding: 6px;
}

body.report-mode .viewer-panel > .region-legend .region-legend-title {
  font-size: 11px;
}

body.report-mode .viewer-panel > .region-legend span {
  min-height: 28px;
  padding: 5px 6px;
}

body.report-mode .viewer-panel > .region-legend i {
  height: 18px;
}

body.report-mode .viewer-panel > .region-legend span strong,
body.report-mode .viewer-panel > .region-legend em {
  font-size: 10px;
}

/* Final report layout: keep image evidence inside the result tab. */
body.report-mode .workspace {
  display: block !important;
  grid-template-columns: none !important;
  margin: 0 0 10px !important;
}

body.report-mode .workspace .report-score-panel {
  display: grid !important;
  width: 100%;
  max-width: none;
}

body.report-mode .report-result-visual {
  display: block;
  margin: 0 12px 10px;
}

body.report-mode .report-section[data-active-tab="plan"] .report-result-visual {
  display: none !important;
}

body.report-mode .report-result-visual .viewer-panel {
  display: grid !important;
  gap: 9px;
  margin: 0;
  padding: 10px;
}

body.report-mode .report-result-visual .canvas-wrap {
  aspect-ratio: 1.06;
  padding: 8px;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 7px;
  margin-top: 2px;
  padding: 8px;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend span {
  grid-template-columns: 1fr;
  grid-template-areas:
    "name"
    "organ";
  min-height: 34px;
  padding: 6px 7px;
  text-align: center;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend span strong {
  grid-area: name;
  justify-self: center;
  font-size: 11px;
  text-align: center;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend em {
  grid-area: organ;
  justify-self: center;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 380px) {
  body.report-mode .report-result-visual {
    margin-right: 10px;
    margin-left: 10px;
  }

  body.report-mode .report-result-visual .viewer-panel > .region-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Cleaner report reading flow: overview -> tabs -> tab content. */
body.report-mode .report-overview-strip {
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-areas: "score main";
  gap: 9px 12px;
  margin: 10px 0 10px;
  border-color: rgba(231, 217, 198, 0.92);
  background: rgba(255, 253, 248, 0.96);
  padding: 11px;
}

body.report-mode .overview-score {
  --score-color: #c58943;
  grid-area: score;
  display: grid;
  width: 70px;
  aspect-ratio: 1;
  min-width: 70px;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffdf8 0 57%, transparent 58%),
    conic-gradient(var(--score-color) calc(var(--score, 0) * 1%), rgba(231, 217, 198, 0.86) 0);
  padding: 0;
}

body.report-mode .overview-score strong {
  color: #2e2925;
  font-size: 23px;
  font-weight: 1000;
  line-height: 1;
}

body.report-mode .overview-score em {
  margin-top: -18px;
  color: #8d8074;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

body.report-mode .report-overview-strip[data-grade="excellent"] .overview-score,
body.report-mode .report-overview-strip[data-grade="good"] .overview-score {
  --score-color: #6f7f55;
}

body.report-mode .report-overview-strip[data-grade="poor"] .overview-score,
body.report-mode .report-overview-strip[data-grade="bad"] .overview-score {
  --score-color: #b85a4b;
}

body.report-mode .overview-main {
  grid-area: main;
  align-self: center;
}

body.report-mode .overview-grade {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 4px;
}

body.report-mode .overview-grade span {
  color: #d2913d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

body.report-mode .overview-grade strong {
  color: #2e2925;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
}

body.report-mode .overview-tendency {
  display: grid;
  gap: 2px;
  margin-bottom: 3px;
}

body.report-mode .overview-tendency strong {
  color: #2e2925;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.3;
}

body.report-mode .overview-main > strong {
  font-size: 13px;
  line-height: 1.38;
}

body.report-mode .overview-main p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}

body.report-mode .workspace {
  display: none !important;
}

body.report-mode .workspace .report-score-panel {
  display: none !important;
}

body.report-mode .report-section.panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.report-mode .report-tabs {
  top: 56px;
  margin: 0 -12px 10px;
  padding: 8px 12px;
}

body.report-mode .report-tabs button {
  min-height: 42px;
}

body.report-mode .report-result-visual {
  margin: 0 0 10px;
}

body.report-mode .report-result-visual .viewer-panel {
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
}

body.report-mode .report-body {
  gap: 9px;
}

@media (max-width: 380px) {
  body.report-mode .report-overview-strip {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  body.report-mode .overview-score {
    width: 64px;
    min-width: 64px;
  }

}

body.report-mode .report-result-visual .viewer-panel > .region-legend {
  grid-template-columns: 1fr !important;
  gap: 7px;
  margin-top: 4px;
  padding: 9px;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend .region-legend-title {
  display: block;
  color: #8a5526;
  font-size: 12px;
}

body:not(.report-mode) .capture-page {
  grid-template-rows: 56px minmax(0, 1fr) auto;
  align-content: stretch;
  min-height: min(100vh, var(--h5-height));
  min-height: min(100svh, var(--h5-height));
  background: #f7f4ed;
}

body:not(.report-mode) .camera-stage {
  align-self: stretch;
  height: auto;
  min-height: 0;
  max-height: none;
}

body:not(.report-mode) .capture-stage-copy {
  top: 54px;
}

body:not(.report-mode) .tongue-guide {
  top: calc(55% + 28px);
  width: min(calc(100vw - 132px), 276px);
  height: clamp(230px, 36vh, 320px);
  min-height: 0;
}

body:not(.report-mode) .viewfinder-corners {
  inset: 6px 0;
  background:
    linear-gradient(#d5ba6f, #d5ba6f) left top / 28px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left top / 3px 28px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right top / 28px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right top / 3px 28px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left bottom / 28px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left bottom / 3px 28px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right bottom / 28px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right bottom / 3px 28px no-repeat;
}

body:not(.report-mode) .camera-stage.system-camera-mode .tongue-guide::after {
  bottom: -40px;
}

body:not(.report-mode) .capture-actions {
  min-height: 106px;
}

@media (max-height: 720px) {
  body:not(.report-mode) .capture-page {
    grid-template-rows: 56px minmax(0, 1fr) auto;
  }

  body:not(.report-mode) .camera-stage {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  body:not(.report-mode) .capture-stage-copy {
    top: 44px;
  }

  body:not(.report-mode) .tongue-guide {
    height: clamp(230px, 36vh, 300px);
  }

  body:not(.report-mode) .camera-stage.system-camera-mode .tongue-guide::after {
    bottom: -24px;
  }
}

body.report-mode .report-card p,
body.report-mode .report-field p,
body.report-mode .plan-item p,
body.report-mode .plan-principle p {
  font-size: 15px;
  line-height: 1.62;
}

body.report-mode .report-field span,
body.report-mode .plan-item span,
body.report-mode .dimension-head span,
body.report-mode .summary-item span {
  font-size: 13px;
}

body.report-mode .summary-item strong {
  font-size: 17px;
}

body.report-mode .report-tags span {
  font-size: 13px;
  padding: 6px 9px;
}

body.report-mode .viewer-panel > .region-legend .region-legend-title {
  font-size: 13px;
}

body.report-mode .viewer-panel > .region-legend span strong {
  font-size: 13px;
}

body.report-mode .viewer-panel > .region-legend em {
  font-size: 12px;
}

body.report-mode .report-tip {
  font-size: 13px;
  line-height: 1.58;
}

/* Interaction polish: capture framing, failure state and report reading flow. */
:root {
  --radius-md: 14px;
  --radius-lg: 18px;
  --button-h: 46px;
}

.panel,
.record-card,
.capture-help-card,
.image-preview-sheet,
.records-sheet,
body.report-mode .report-card,
body.report-mode .report-overview-strip,
body.report-mode .viewer-panel {
  border-radius: var(--radius-lg);
}

button {
  min-height: var(--button-h);
  border-radius: var(--radius-md);
  font-weight: 800;
}

.capture-nav-button,
.capture-help-button,
.records-back {
  min-height: auto;
}

body:not(.report-mode) .camera-stage {
  --camera-zoom: 1.56;
}

body:not(.report-mode) .camera-preview.active {
  object-fit: cover;
  object-position: 50% 58%;
  transform: scale(var(--camera-zoom));
  transform-origin: 50% 58%;
}

body:not(.report-mode) .camera-preview.active.mirrored {
  transform: scaleX(-1) scale(var(--camera-zoom));
}

body:not(.report-mode) .capture-stage-copy {
  top: 42px;
  padding: 0 12px;
}

body:not(.report-mode) .capture-stage-copy p {
  width: min(100%, 318px);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

body:not(.report-mode) .tongue-guide {
  top: 51%;
  width: min(calc(100vw - 164px), 232px);
  height: clamp(210px, 30vh, 268px);
}

body:not(.report-mode) .viewfinder-corners {
  inset: 18px 16px 16px;
  background:
    linear-gradient(#d5ba6f, #d5ba6f) left top / 22px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left top / 3px 22px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right top / 22px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right top / 3px 22px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left bottom / 22px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) left bottom / 3px 22px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right bottom / 22px 3px no-repeat,
    linear-gradient(#d5ba6f, #d5ba6f) right bottom / 3px 22px no-repeat;
}

body:not(.report-mode) .tongue-guide-top {
  top: 4%;
  width: 84%;
  height: 37%;
}

body:not(.report-mode) .tongue-guide-body {
  top: 38%;
  width: 46%;
  height: 55%;
  border-style: dashed;
  border-radius: 36% 36% 48% 48% / 8% 8% 18% 18%;
}

body:not(.report-mode) .tongue-guide-line {
  top: 50%;
  width: 14%;
  height: 28%;
}

body:not(.report-mode) .capture-actions {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  min-height: 126px;
  align-items: center;
  column-gap: 12px;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
}

body:not(.report-mode) .side-action {
  width: 100%;
  min-height: 78px;
  border-radius: var(--radius-md);
}

body:not(.report-mode) .center-actions {
  gap: 7px;
}

body:not(.report-mode) .shutter-button {
  width: 82px;
  height: 82px;
  border-width: 4px;
}

body:not(.report-mode) .shutter-button span {
  width: 64px;
  height: 64px;
}

/* Report detail reset: restore a clean reading order and a real back affordance. */
body.report-mode .app-shell {
  display: flex !important;
  flex-direction: column;
  width: min(100vw, var(--h5-width));
  background: linear-gradient(180deg, #fbf8f2 0%, #f7efe4 100%);
  padding: 0 14px calc(96px + env(safe-area-inset-bottom));
}

body.report-mode .topbar {
  order: 1;
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) 72px;
  min-height: 58px;
  margin: 0 -14px;
  border-bottom: 1px solid rgba(231, 217, 198, 0.88);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: none;
  padding: 8px 14px;
}

body.report-mode .report-back {
  display: inline-flex;
  width: auto;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2f2a25;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

body.report-mode .report-back:hover {
  border-color: transparent;
  transform: none;
}

body.report-mode .topbar h1 {
  justify-self: center;
  font-size: 20px;
}

body.report-mode .report-share {
  justify-self: end;
  min-height: 36px;
  border-radius: 999px;
  border-color: rgba(197, 137, 67, 0.32);
  background: #fff8ef;
  color: #a66b2c;
  font-size: 14px;
  padding: 0 14px;
}

body.report-mode .report-overview-strip {
  order: 2;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0 10px;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
  padding: 12px;
}

body.report-mode .overview-score {
  width: 70px;
  min-width: 70px;
}

body.report-mode .overview-score span {
  max-width: 58px;
  font-size: 9px;
}

body.report-mode .overview-score strong {
  font-size: 25px;
}

body.report-mode .overview-grade {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

body.report-mode .overview-grade strong {
  font-size: 18px;
}

body.report-mode .overview-tendency {
  margin-bottom: 4px;
}

body.report-mode .overview-tendency strong {
  font-size: 15px;
  line-height: 1.35;
}

body.report-mode .overview-main p {
  font-size: 12px;
}

body.report-mode .report-section.panel {
  order: 3;
  display: block;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.report-mode .report-tabs {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: none;
  padding: 6px;
}

body.report-mode .report-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #5c5148;
  font-size: 15px;
}

body.report-mode .report-tabs button.active {
  background: #cf8f3d;
  color: #fff;
}

body.report-mode .report-body {
  gap: 12px;
}

body.report-mode .report-card {
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
  padding: 14px;
}

body.report-mode .report-result-visual {
  order: 4;
  margin: 12px 0 0;
}

body.report-mode .report-result-visual .viewer-panel {
  gap: 8px;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
  padding: 12px;
}

body.report-mode .report-result-visual .canvas-toolbar {
  min-height: 34px;
}

body.report-mode .report-result-visual .canvas-toolbar h2 {
  font-size: 17px;
}

body.report-mode .report-result-visual .canvas-wrap {
  aspect-ratio: 1.12;
  max-height: 360px;
  border-radius: 14px;
  padding: 8px;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend {
  display: none !important;
}

body.report-mode .report-tip {
  margin-top: 12px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.72);
}

@media (max-width: 380px) {
  body.report-mode .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  body.report-mode .topbar {
    grid-template-columns: 78px minmax(0, 1fr) 66px;
    margin-right: -12px;
    margin-left: -12px;
  }

  body.report-mode .report-overview-strip {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }
}

.analysis-actions button {
  min-height: 50px;
}

.analysis-overlay.error .scan-photo,
.analysis-overlay.timeout .scan-photo {
  width: min(76vw, 330px);
  height: min(38vh, 340px);
  border-radius: var(--radius-lg);
}

.analysis-overlay.error .scan-photo img {
  object-fit: cover;
  object-position: 50% 56%;
  transform: scale(1.16);
}

.analysis-overlay.error .analysis-step {
  color: #a49a90;
}

.analysis-overlay.error .analysis-step .step-icon,
.analysis-overlay.error .analysis-step.failed .step-icon,
.analysis-overlay.error .analysis-step.current .step-icon {
  border: 1px solid rgba(196, 186, 174, 0.9);
  background: #eee7dc;
  color: transparent;
  animation: none;
}

.analysis-overlay.error .analysis-stage h2 {
  color: #2e2925;
  font-size: 22px;
}

.analysis-overlay.error .analysis-timeout {
  color: #6f6257;
  font-size: 15px;
}

.analysis-overlay.error .analysis-note {
  color: #9a6a34;
}

.analysis-actions button:not(.primary) {
  border-color: rgba(197, 137, 67, 0.45);
  background: transparent;
  color: #7a5429;
}

body.report-mode .topbar {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 6px;
  padding-right: 12px;
  padding-left: 12px;
}

body.report-mode .report-back {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(197, 137, 67, 0.32);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: #8a5526;
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
}

body.report-mode .topbar h1 {
  justify-self: center;
}

body.report-mode .report-share {
  justify-self: end;
  min-height: 34px;
  border-radius: 999px;
}

body.report-mode .report-hero {
  display: none !important;
}

body.report-mode .report-overview-strip {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
}

body.report-mode .overview-score {
  width: 86px;
  min-width: 86px;
}

body.report-mode .overview-score span {
  max-width: 70px;
  color: #8a5526;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

body.report-mode .overview-score strong {
  font-size: 30px;
}

body.report-mode .overview-score em {
  margin-top: -16px;
}

body.report-mode .overview-grade {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

body.report-mode .overview-grade span,
body.report-mode .overview-tendency span {
  color: #a56f31;
  font-size: 12px;
  font-weight: 900;
}

body.report-mode .overview-grade strong {
  font-size: 22px;
}

body.report-mode .overview-tendency {
  gap: 4px;
  margin-bottom: 8px;
}

body.report-mode .overview-tendency strong {
  font-size: 17px;
}

body.report-mode .overview-main p {
  font-size: 13px;
}

body.report-mode .report-body {
  gap: 12px;
}

body.report-mode .report-card {
  padding: 14px;
}

body.report-mode .report-dimension-card {
  display: grid;
  gap: 12px;
}

body.report-mode .dimension-head h3 {
  font-size: 18px;
}

body.report-mode .dimension-head strong {
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 11px;
}

body.report-mode .report-fields,
body.report-mode .plan-list {
  gap: 12px;
}

body.report-mode .report-field,
body.report-mode .plan-item {
  border-left: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 242, 0.82);
  padding: 12px;
}

body.report-mode .report-field span,
body.report-mode .plan-item span {
  display: block;
  margin-bottom: 6px;
  color: #b06b1b;
  font-weight: 1000;
}

body.report-mode .report-field p,
body.report-mode .plan-item p {
  margin: 0;
}

body.report-mode .report-plan-card {
  border-color: rgba(197, 137, 67, 0.24);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 236, 0.96));
}

body.report-mode .report-tip {
  border-radius: var(--radius-lg);
}

@media (max-width: 380px) {
  body:not(.report-mode) .tongue-guide {
    width: min(calc(100vw - 150px), 220px);
  }

  body:not(.report-mode) .capture-actions {
    column-gap: 8px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body.report-mode .report-overview-strip {
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 12px;
  }

  body.report-mode .overview-score {
    width: 76px;
    min-width: 76px;
  }

  body.report-mode .overview-score strong {
    font-size: 26px;
  }
}

/* Final report detail cleanup. */
body.report-mode .app-shell {
  display: flex !important;
  flex-direction: column !important;
  width: min(100vw, var(--h5-width));
  background: linear-gradient(180deg, #fbf8f2 0%, #f7efe4 100%);
  padding: 0 14px calc(96px + env(safe-area-inset-bottom)) !important;
}

body.report-mode .topbar {
  order: 1 !important;
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) 72px !important;
  min-height: 58px;
  margin: 0 -14px 0 !important;
  border-bottom: 1px solid rgba(231, 217, 198, 0.88);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: none !important;
  padding: 8px 14px !important;
}

body.report-mode .report-back {
  display: inline-flex !important;
  width: auto !important;
  min-height: 40px !important;
  align-items: center;
  justify-content: flex-start !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #2f2a25 !important;
  font-size: 15px !important;
  font-weight: 900;
  line-height: 1;
  padding: 0 !important;
}

body.report-mode .report-back:hover {
  transform: none;
}

body.report-mode .topbar h1 {
  justify-self: center;
  font-size: 20px !important;
}

body.report-mode .report-share {
  justify-self: end;
  min-height: 36px !important;
  border-radius: 999px;
  border-color: rgba(197, 137, 67, 0.32);
  background: #fff8ef;
  color: #a66b2c;
  font-size: 14px;
  padding: 0 14px;
}

body.report-mode .report-overview-strip {
  order: 2 !important;
  grid-template-columns: 78px minmax(0, 1fr) !important;
  gap: 12px !important;
  margin: 12px 0 10px !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045) !important;
  padding: 12px !important;
}

body.report-mode .overview-score {
  width: 70px !important;
  min-width: 70px !important;
}

body.report-mode .overview-score span {
  max-width: 58px !important;
  font-size: 9px !important;
}

body.report-mode .overview-score strong {
  font-size: 25px !important;
}

body.report-mode .overview-grade {
  display: flex !important;
  gap: 8px !important;
  align-items: baseline !important;
  margin-bottom: 6px !important;
}

body.report-mode .overview-grade strong {
  font-size: 18px !important;
}

body.report-mode .overview-tendency {
  margin-bottom: 4px !important;
}

body.report-mode .overview-tendency strong {
  font-size: 15px !important;
  line-height: 1.35;
}

body.report-mode .overview-main p {
  font-size: 12px !important;
}

body.report-mode .report-section.panel {
  order: 3 !important;
  display: block;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.report-mode .report-tabs {
  position: static !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 248, 0.82) !important;
  box-shadow: none !important;
  padding: 6px !important;
}

body.report-mode .report-tabs button {
  min-height: 42px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent;
  color: #5c5148;
  font-size: 15px;
}

body.report-mode .report-tabs button.active {
  background: #cf8f3d !important;
  color: #fff !important;
}

body.report-mode .report-card {
  border-radius: 16px !important;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045) !important;
  padding: 14px !important;
}

body.report-mode .report-result-visual {
  order: 4 !important;
  margin: 12px 0 0 !important;
}

body.report-mode .report-result-visual .viewer-panel {
  gap: 8px !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045) !important;
  padding: 12px !important;
}

body.report-mode .report-result-visual .canvas-wrap {
  aspect-ratio: 1.12 !important;
  max-height: 360px !important;
  border-radius: 14px !important;
  padding: 8px !important;
}

body.report-mode .report-result-visual .viewer-panel > .region-legend {
  display: none !important;
}

@media (max-width: 380px) {
  body.report-mode .app-shell {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  body.report-mode .topbar {
    grid-template-columns: 78px minmax(0, 1fr) 66px !important;
    margin-right: -12px !important;
    margin-left: -12px !important;
  }

  body.report-mode .report-overview-strip {
    grid-template-columns: 70px minmax(0, 1fr) !important;
  }
}

/* Report detail UX: evidence image first, then conclusion and interpretation. */
body.report-mode .app-shell {
  gap: 0 !important;
  padding: 0 14px calc(88px + env(safe-area-inset-bottom)) !important;
}

body.report-mode .topbar {
  order: 1 !important;
  position: sticky;
  top: 0;
  z-index: 40;
}

body.report-mode .app-shell > .report-result-visual {
  order: 2 !important;
  display: block !important;
  margin: 12px 0 10px !important;
}

body.report-mode .app-shell > .report-result-visual .viewer-panel {
  display: grid !important;
  gap: 9px !important;
  overflow: hidden;
  border: 1px solid rgba(231, 217, 198, 0.96) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 248, 0.98) !important;
  box-shadow: 0 10px 22px rgba(84, 56, 28, 0.052) !important;
  padding: 12px !important;
}

body.report-mode .app-shell > .report-result-visual .canvas-toolbar {
  display: flex !important;
  flex-direction: row !important;
  min-height: 32px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 0 !important;
}

body.report-mode .app-shell > .report-result-visual .canvas-toolbar h2 {
  margin: 0 !important;
  color: #2f2a25 !important;
  font-size: 17px !important;
  line-height: 1.2 !important;
}

body.report-mode .app-shell > .report-result-visual .toggle-group {
  display: none !important;
}

body.report-mode .app-shell > .report-result-visual .image-preview-button {
  display: inline-flex !important;
  min-height: 32px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(197, 137, 67, 0.34) !important;
  border-radius: 999px !important;
  background: #fffaf2 !important;
  color: #b2712d !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  padding: 0 13px !important;
}

body.report-mode .app-shell > .report-result-visual .canvas-wrap {
  display: grid !important;
  width: 100% !important;
  height: min(46vh, 390px) !important;
  min-height: 270px !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid rgba(231, 217, 198, 0.9) !important;
  border-radius: 14px !important;
  background-size: 22px 22px !important;
  padding: 8px !important;
}

body.report-mode .app-shell > .report-result-visual canvas {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  cursor: zoom-in;
}

body.report-mode .app-shell > .report-result-visual .empty-state {
  border-radius: 12px !important;
}

body.report-mode .app-shell > .report-result-visual .image-meta {
  display: none !important;
}

body.report-mode .report-overview-strip {
  order: 3 !important;
  grid-template-columns: 74px minmax(0, 1fr) !important;
  gap: 12px !important;
  margin: 0 0 10px !important;
  border: 1px solid rgba(231, 217, 198, 0.92) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 248, 0.96) !important;
  box-shadow: 0 10px 22px rgba(84, 56, 28, 0.045) !important;
  padding: 12px !important;
}

body.report-mode .overview-score {
  width: 68px !important;
  min-width: 68px !important;
}

body.report-mode .overview-score strong {
  font-size: 24px !important;
}

body.report-mode .overview-score span {
  max-width: 56px !important;
  font-size: 9px !important;
}

body.report-mode .overview-grade {
  display: grid !important;
  gap: 3px !important;
  margin-bottom: 6px !important;
}

body.report-mode .overview-grade span,
body.report-mode .overview-tendency span {
  color: #b2712d !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
}

body.report-mode .overview-grade strong {
  font-size: 20px !important;
  line-height: 1.15 !important;
}

body.report-mode .overview-tendency {
  display: grid !important;
  gap: 3px !important;
  margin-bottom: 6px !important;
}

body.report-mode .overview-tendency strong {
  font-size: 15px !important;
  line-height: 1.35 !important;
}

body.report-mode .overview-main p {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body.report-mode .report-section.panel {
  order: 4 !important;
  display: block !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.report-mode .report-tabs {
  position: sticky !important;
  top: 58px !important;
  z-index: 35 !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  margin: 0 -2px 12px !important;
  border: 1px solid rgba(231, 217, 198, 0.9) !important;
  border-radius: 14px !important;
  background: rgba(255, 253, 248, 0.96) !important;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045) !important;
  padding: 5px !important;
}

body.report-mode .report-tabs button {
  min-height: 40px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 1000 !important;
}

body.report-mode .report-body {
  gap: 12px !important;
}

body.report-mode .report-card {
  border: 1px solid rgba(231, 217, 198, 0.94) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(255, 248, 238, 0.97)) !important;
  box-shadow: 0 10px 22px rgba(84, 56, 28, 0.045) !important;
  padding: 16px !important;
}

body.report-mode .report-summary-card {
  display: none !important;
}

body.report-mode .dimension-head {
  align-items: center !important;
}

body.report-mode .dimension-head h3 {
  font-size: 20px !important;
}

body.report-mode .dimension-head strong {
  min-height: 34px !important;
  border-radius: 999px !important;
  background: rgba(255, 250, 242, 0.96) !important;
  color: #8a5526 !important;
  font-size: 15px !important;
  padding: 7px 12px !important;
}

body.report-mode .dimension-tags {
  gap: 8px !important;
}

body.report-mode .dimension-tags span {
  border-color: rgba(197, 137, 67, 0.22) !important;
  background: #fffaf2 !important;
  color: #6f7f55 !important;
}

body.report-mode .report-fields,
body.report-mode .plan-list {
  gap: 10px !important;
}

body.report-mode .report-field,
body.report-mode .plan-item {
  border-left: 3px solid rgba(207, 143, 61, 0.25) !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 4px 0 4px 12px !important;
}

body.report-mode .report-field span,
body.report-mode .plan-item span {
  margin-bottom: 5px !important;
  color: #b2712d !important;
}

@media (max-width: 380px) {
  body.report-mode .app-shell > .report-result-visual .canvas-wrap {
    height: min(43vh, 340px) !important;
    min-height: 248px !important;
  }

  body.report-mode .report-overview-strip {
    grid-template-columns: 66px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body.report-mode .overview-score {
    width: 62px !important;
    min-width: 62px !important;
  }
}

/* Final report summary cleanup. */
body.report-mode .report-overview-strip {
  grid-template-columns: 72px minmax(0, 1fr) !important;
  align-items: center !important;
}

body.report-mode .overview-score {
  width: 66px !important;
  min-width: 66px !important;
}

body.report-mode .overview-score strong {
  font-size: 25px !important;
}

body.report-mode .overview-score em {
  margin-top: -14px !important;
  font-size: 11px !important;
}

body.report-mode .overview-main {
  display: grid !important;
  gap: 4px !important;
  align-self: center !important;
}

body.report-mode .overview-grade {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

body.report-mode .overview-grade strong {
  font-size: 20px !important;
  line-height: 1.1 !important;
}

body.report-mode .overview-grade span {
  color: #d2913d !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

body.report-mode .overview-tendency {
  display: block !important;
  margin: 0 !important;
}

body.report-mode .overview-tendency strong {
  font-size: 15px !important;
  line-height: 1.35 !important;
}

body.report-mode .overview-main p {
  margin: 0 !important;
  color: #7a6f65 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.app-toast {
  position: fixed;
  top: calc(72px + env(safe-area-inset-top));
  left: 50%;
  z-index: 220;
  width: min(calc(100vw - 32px), 356px);
  max-width: calc(var(--h5-width) - 28px);
  transform: translate(-50%, -12px);
  border: 1px solid rgba(197, 137, 67, 0.32);
  border-radius: 999px;
  background: rgba(45, 38, 31, 0.92);
  box-shadow: 0 14px 32px rgba(24, 18, 14, 0.22);
  color: #fffdf8;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  padding: 10px 16px;
}

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

.app-toast.warn {
  background: rgba(122, 84, 41, 0.94);
}

/* Analysis overlay viewport fit. */
.analysis-overlay {
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(100vw, var(--h5-width)) !important;
  height: min(100svh, var(--h5-height)) !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  transform: translateX(-50%);
  padding: clamp(10px, 2svh, 16px) 12px calc(14px + env(safe-area-inset-bottom)) !important;
}

.analysis-overlay.active {
  display: grid !important;
  place-items: start center;
}

.analysis-stage {
  width: 100% !important;
  max-width: calc(var(--h5-width) - 24px) !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  align-content: start !important;
  grid-auto-rows: max-content;
  gap: 10px !important;
  overflow: hidden;
  padding-top: 4px !important;
}

.analysis-stage h2 {
  margin-top: 0 !important;
  font-size: 20px !important;
  line-height: 1.2;
}

.analysis-steps {
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 4px !important;
  padding: 7px !important;
}

.analysis-step {
  min-width: 0;
  gap: 4px !important;
  font-size: 11px !important;
}

.analysis-step .step-icon {
  width: 20px !important;
  height: 20px !important;
  font-size: 12px !important;
}

.scan-photo {
  width: min(100%, 300px) !important;
  height: clamp(246px, 38svh, 330px) !important;
  max-height: calc(100svh - 238px) !important;
  min-height: 220px !important;
}

.overall-progress {
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) 42px !important;
  gap: 8px !important;
}

.analysis-note,
.analysis-timeout {
  width: 100%;
  margin: 0 !important;
  font-size: 14px !important;
}

.analysis-actions {
  width: 100%;
  min-width: 0;
}

.analysis-overlay.error .scan-photo,
.analysis-overlay.timeout .scan-photo {
  width: min(100%, 300px) !important;
  height: clamp(220px, 34svh, 300px) !important;
  max-height: calc(100svh - 300px) !important;
  border-radius: 8px !important;
}

@media (max-height: 700px) {
  .analysis-overlay {
    padding-top: 8px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }

  .analysis-stage {
    gap: 8px !important;
  }

  .analysis-stage h2 {
    font-size: 18px !important;
  }

  .analysis-steps {
    padding: 6px !important;
  }

  .scan-photo {
    height: clamp(210px, 34svh, 260px) !important;
    min-height: 190px !important;
  }

  .analysis-overlay.error .scan-photo,
  .analysis-overlay.timeout .scan-photo {
    height: clamp(190px, 30svh, 230px) !important;
  }

  .analysis-actions button {
    min-height: 44px !important;
  }
}

/* Capture tongue guide refinement. */
body:not(.report-mode) .tongue-guide {
  top: 53% !important;
  width: min(calc(100vw - 86px), 300px) !important;
  height: clamp(282px, 40vh, 348px) !important;
  min-height: 0 !important;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 18px 34px rgba(0, 0, 0, 0.22))
    drop-shadow(0 0 18px rgba(255, 253, 248, 0.12));
}

body:not(.report-mode) .tongue-guide::before {
  content: "";
  position: absolute;
  inset: 34px 26px 18px;
  border: 1px solid rgba(255, 253, 248, 0.11);
  border-radius: 34% 34% 28% 28% / 24% 24% 18% 18%;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(255, 253, 248, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.06), rgba(255, 253, 248, 0.015));
}

body:not(.report-mode) .viewfinder-corners {
  inset: 4px !important;
  background:
    linear-gradient(#e1c475, #e1c475) left top / 34px 4px no-repeat,
    linear-gradient(#e1c475, #e1c475) left top / 4px 34px no-repeat,
    linear-gradient(#e1c475, #e1c475) right top / 34px 4px no-repeat,
    linear-gradient(#e1c475, #e1c475) right top / 4px 34px no-repeat,
    linear-gradient(#e1c475, #e1c475) left bottom / 34px 4px no-repeat,
    linear-gradient(#e1c475, #e1c475) left bottom / 4px 34px no-repeat,
    linear-gradient(#e1c475, #e1c475) right bottom / 34px 4px no-repeat,
    linear-gradient(#e1c475, #e1c475) right bottom / 4px 34px no-repeat !important;
  opacity: 0.95;
}

body:not(.report-mode) .viewfinder-corners::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(255, 253, 248, 0.22);
  border-radius: 32px;
}

body:not(.report-mode) .tongue-guide-top {
  top: 8% !important;
  left: 50%;
  width: 88% !important;
  height: 34% !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 50% 50% 38% 38% / 72% 72% 30% 30%;
  background:
    radial-gradient(ellipse at 50% 78%, rgba(18, 15, 13, 0.34) 0 30%, transparent 31%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.09), rgba(255, 253, 248, 0.015));
  box-shadow:
    inset 0 0 0 2px rgba(255, 253, 248, 0.58),
    inset 0 -18px 22px rgba(0, 0, 0, 0.15);
}

body:not(.report-mode) .tongue-guide-top::before {
  top: 41% !important;
  width: 46% !important;
  height: 15% !important;
  border-radius: 0 0 18px 18px !important;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(87, 88, 84, 0.34) 14% 15%, transparent 15% 31%, rgba(87, 88, 84, 0.34) 31% 32%, transparent 32% 48%, rgba(87, 88, 84, 0.34) 48% 49%, transparent 49% 65%, rgba(87, 88, 84, 0.34) 65% 66%, transparent 66% 82%, rgba(87, 88, 84, 0.34) 82% 83%, transparent 83%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(232, 236, 232, 0.78)) !important;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.18),
    inset 0 -2px 0 rgba(86, 91, 88, 0.14) !important;
}

body:not(.report-mode) .tongue-guide-top::after {
  top: 56% !important;
  width: 28% !important;
  height: 28% !important;
  border: 2px solid rgba(255, 225, 222, 0.44) !important;
  border-top: 0 !important;
  border-radius: 0 0 999px 999px !important;
  background: linear-gradient(180deg, rgba(219, 122, 122, 0.13), rgba(219, 122, 122, 0.03));
}

body:not(.report-mode) .tongue-guide-body {
  top: 34% !important;
  left: 50%;
  width: 48% !important;
  height: 59% !important;
  border: 2px dashed rgba(255, 253, 248, 0.78) !important;
  border-radius: 42% 42% 49% 49% / 12% 12% 28% 28% !important;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 231, 224, 0.34), transparent 46%),
    radial-gradient(ellipse at 50% 76%, rgba(176, 78, 88, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(237, 152, 149, 0.34), rgba(224, 103, 119, 0.18)) !important;
  box-shadow:
    inset 0 8px 18px rgba(255, 253, 248, 0.13),
    inset 0 -18px 24px rgba(94, 42, 48, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

body:not(.report-mode) .tongue-guide-body::before {
  content: "";
  position: absolute;
  top: 9%;
  left: 50%;
  width: 36%;
  height: 78%;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 253, 248, 0.38) 48% 52%, transparent 52%),
    radial-gradient(ellipse at 50% 42%, rgba(255, 253, 248, 0.12), transparent 55%);
  opacity: 0.9;
}

body:not(.report-mode) .tongue-guide-body::after {
  content: "";
  position: absolute;
  right: 17%;
  bottom: 15%;
  width: 19%;
  height: 31%;
  border-right: 2px solid rgba(255, 253, 248, 0.28);
  border-radius: 999px;
  transform: rotate(-10deg);
}

body:not(.report-mode) .tongue-guide-line {
  top: 47% !important;
  left: 50% !important;
  width: 0 !important;
  height: 34% !important;
  transform: translateX(-50%);
  border: 0 !important;
  border-left: 3px solid rgba(255, 253, 248, 0.82) !important;
  border-radius: 999px;
  opacity: 0.86;
}

body:not(.report-mode) .tongue-guide-line::after {
  content: "";
  position: absolute;
  left: -2px;
  bottom: 0;
  width: 24px;
  height: 18px;
  border-bottom: 3px solid rgba(255, 253, 248, 0.76);
  border-left: 3px solid rgba(255, 253, 248, 0.76);
  border-radius: 0 0 0 24px;
}

@media (max-width: 380px) {
  body:not(.report-mode) .tongue-guide {
    width: min(calc(100vw - 74px), 286px) !important;
    height: clamp(260px, 39vh, 326px) !important;
  }
}

@media (max-height: 720px) {
  body:not(.report-mode) .tongue-guide {
    top: 54% !important;
    height: clamp(238px, 36vh, 292px) !important;
  }
}

/* Capture guide reference style: thin transparent line art over the camera. */
body:not(.report-mode) .tongue-guide {
  top: 52.5% !important;
  width: min(calc(100vw - 72px), 322px) !important;
  height: clamp(318px, 46vh, 402px) !important;
  filter:
    drop-shadow(0 18px 34px rgba(0, 0, 0, 0.2))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.12));
}

body:not(.report-mode) .tongue-guide::before,
body:not(.report-mode) .tongue-guide-top,
body:not(.report-mode) .tongue-guide-body,
body:not(.report-mode) .tongue-guide-line {
  display: none !important;
}

body:not(.report-mode) .viewfinder-corners {
  inset: 0 !important;
  background:
    linear-gradient(#d8bb6b, #d8bb6b) left top / 34px 4px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) left top / 4px 34px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) right top / 34px 4px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) right top / 4px 34px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) left bottom / 34px 4px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) left bottom / 4px 34px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) right bottom / 34px 4px no-repeat,
    linear-gradient(#d8bb6b, #d8bb6b) right bottom / 4px 34px no-repeat !important;
  opacity: 0.92;
}

body:not(.report-mode) .viewfinder-corners::before {
  display: none;
}

.tongue-guide-art {
  position: absolute;
  inset: 18px 14px 12px;
  width: calc(100% - 28px);
  height: calc(100% - 30px);
  overflow: visible;
}

.tongue-guide-art path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.54);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tongue-guide-art .guide-lip-outer {
  stroke: rgba(255, 255, 255, 0.52);
  stroke-width: 2;
}

.tongue-guide-art .guide-lip-inner {
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 1.8;
}

.tongue-guide-art .guide-teeth {
  fill: rgba(255, 255, 255, 0.32);
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 1.7;
}

.tongue-guide-art .guide-tooth-lines {
  stroke: rgba(74, 78, 75, 0.38);
  stroke-width: 1.3;
}

.tongue-guide-art .guide-tongue {
  stroke: rgba(255, 255, 255, 0.56);
  stroke-width: 2.15;
}

.tongue-guide-art .guide-midline {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2;
}

@media (max-width: 380px) {
  body:not(.report-mode) .tongue-guide {
    width: min(calc(100vw - 58px), 306px) !important;
    height: clamp(300px, 45vh, 378px) !important;
  }
}

@media (max-height: 720px) {
  body:not(.report-mode) .tongue-guide {
    top: 53.5% !important;
    height: clamp(282px, 42vh, 340px) !important;
  }

  .tongue-guide-art {
    top: 14px;
  }
}

/* Capture shooting area premium polish. */
body:not(.report-mode) .camera-stage {
  background:
    radial-gradient(ellipse at 50% 34%, rgba(248, 250, 244, 0.16), transparent 0 26%, transparent 56%),
    radial-gradient(ellipse at 22% 58%, rgba(255, 255, 255, 0.09), transparent 0 18%, transparent 48%),
    linear-gradient(180deg, #313834 0%, #626a64 44%, #444a45 72%, #171310 100%);
}

body:not(.report-mode) .camera-stage::before {
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.08), transparent 22%, transparent 76%, rgba(0, 0, 0, 0.3)),
    radial-gradient(ellipse at 50% 48%, rgba(255, 253, 246, 0.06), transparent 0 36%, rgba(0, 0, 0, 0.1) 72%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.2));
}

body:not(.report-mode) .camera-stage::after,
body:not(.report-mode) .camera-stage.live-ready::after,
body:not(.report-mode) .camera-stage.system-camera-mode::after {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0 47%, rgba(0, 0, 0, 0.08) 64%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 22%, transparent 74%, rgba(0, 0, 0, 0.24));
}

body:not(.report-mode) .capture-stage-copy {
  top: clamp(38px, 6.2svh, 64px);
  gap: 9px;
  padding: 0 18px;
}

body:not(.report-mode) .capture-stage-copy strong {
  font-size: clamp(20px, 5.2vw, 28px);
  font-weight: 850;
  letter-spacing: 0;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.42),
    0 0 1px rgba(255, 255, 255, 0.3);
}

body:not(.report-mode) .capture-stage-copy p {
  width: min(100%, 440px);
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(13px, 3.2vw, 18px);
  font-weight: 650;
  line-height: 1.45;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.46);
}

body:not(.report-mode) .tongue-guide {
  top: calc(50% + 34px) !important;
  width: min(calc(100vw - 126px), 348px) !important;
  height: min(clamp(360px, 54svh, 486px), calc(100% - 140px)) !important;
  max-height: calc(100% - 146px);
  filter:
    drop-shadow(0 20px 36px rgba(0, 0, 0, 0.22))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.12));
}

body:not(.report-mode) .viewfinder-corners {
  inset: 18px 18px 16px !important;
  background:
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left top / 32px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left top / 2px 32px no-repeat,
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right top / 32px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right top / 2px 32px no-repeat,
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left bottom / 32px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left bottom / 2px 32px no-repeat,
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right bottom / 32px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right bottom / 2px 32px no-repeat !important;
  opacity: 0.82;
  filter:
    drop-shadow(0 1px 0 rgba(255, 247, 207, 0.25))
    drop-shadow(0 0 10px rgba(223, 196, 119, 0.18));
}

body:not(.report-mode) .viewfinder-corners::before {
  display: none !important;
}

.tongue-guide-art {
  inset: 4px 2px 0;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  overflow: visible;
}

.tongue-guide-art path {
  vector-effect: non-scaling-stroke;
  fill: none;
  stroke: rgba(247, 249, 244, 0.52);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tongue-guide-art .guide-lip-outer {
  stroke: rgba(248, 250, 246, 0.52);
  stroke-width: 1.45;
}

.tongue-guide-art .guide-lip-inner,
.tongue-guide-art .guide-mouth-line {
  stroke: rgba(248, 250, 246, 0.34);
  stroke-width: 1.2;
}

.tongue-guide-art .guide-teeth {
  fill: url("#guideToothSheen");
  stroke: rgba(255, 255, 255, 0.56);
  stroke-width: 1.25;
}

.tongue-guide-art .guide-tooth-lines {
  stroke: rgba(54, 58, 55, 0.3);
  stroke-width: 0.8;
}

.tongue-guide-art .guide-uvula {
  stroke: rgba(248, 250, 246, 0.44);
  stroke-width: 1.2;
}

.tongue-guide-art .guide-tongue {
  stroke: rgba(248, 250, 246, 0.58);
  stroke-width: 1.6;
}

.tongue-guide-art .guide-midline {
  stroke: rgba(248, 250, 246, 0.52);
  stroke-width: 1.45;
}

body:not(.report-mode) .camera-stage.system-camera-mode .tongue-guide::after {
  bottom: -36px;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

@media (max-width: 380px) {
  body:not(.report-mode) .tongue-guide {
    width: min(calc(100vw - 78px), 330px) !important;
    height: min(clamp(318px, 50svh, 438px), calc(100% - 128px)) !important;
  }

  .tongue-guide-art {
    inset: 4px 2px 0;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
  }
}

@media (max-height: 720px) {
  body:not(.report-mode) .capture-stage-copy {
    top: 34px;
    gap: 7px;
  }

  body:not(.report-mode) .capture-stage-copy p {
    font-size: 12px;
  }

  body:not(.report-mode) .tongue-guide {
    top: calc(50% + 22px) !important;
    height: min(clamp(270px, 42svh, 350px), calc(100% - 128px)) !important;
  }

  .tongue-guide-art {
    inset: 4px 4px 0;
    width: calc(100% - 8px);
    height: calc(100% - 4px);
  }
}

body.report-mode .app-shell > .report-result-visual .canvas-toolbar > div {
  min-width: 0 !important;
}

body.report-mode .app-shell > .report-result-visual .canvas-context {
  display: block !important;
  margin: 3px 0 0 !important;
  overflow: hidden;
  color: #8a7867 !important;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 1.35 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-row {
  grid-template-columns: 62px 92px minmax(0, 1fr);
}

.region-row span {
  line-height: 1.25;
}

.region-row p {
  min-width: 0;
}

@media (max-width: 380px) {
  body.report-mode .app-shell > .report-result-visual .canvas-toolbar {
    gap: 7px !important;
  }

  body.report-mode .app-shell > .report-result-visual .canvas-toolbar h2 {
    font-size: 16px !important;
  }

  body.report-mode .app-shell > .report-result-visual .canvas-context {
    max-width: 190px;
    font-size: 10px !important;
  }

  body.report-mode .app-shell > .report-result-visual .image-preview-button {
    min-height: 30px !important;
    font-size: 12px !important;
    padding: 0 10px !important;
  }

  .region-row {
    grid-template-columns: 58px 82px minmax(0, 1fr);
    gap: 7px;
  }
}

/* Report detail cleanup: compact overview and user-facing evidence tags. */
body.report-mode .report-overview-strip {
  grid-template-columns: 74px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  margin: 0 0 10px !important;
  padding: 12px !important;
}

body.report-mode .overview-score {
  width: 68px !important;
  min-width: 68px !important;
}

body.report-mode .overview-score strong {
  font-size: 26px !important;
  line-height: 1 !important;
}

body.report-mode .overview-score em {
  margin-top: -13px !important;
  color: #8d8074 !important;
  font-size: 11px !important;
}

body.report-mode .overview-main {
  display: grid !important;
  min-width: 0 !important;
  gap: 6px !important;
}

body.report-mode .overview-grade {
  display: block !important;
  margin: 0 !important;
}

body.report-mode .overview-grade strong {
  color: #2f2a26 !important;
  font-size: 20px !important;
  font-weight: 1000 !important;
  line-height: 1.1 !important;
}

body.report-mode .overview-tendency {
  display: block !important;
  margin: 0 !important;
}

body.report-mode .overview-tendency strong {
  color: #2f2a26 !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
}

body.report-mode .overview-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

body.report-mode .overview-chips span {
  max-width: 100%;
  border: 1px solid rgba(231, 217, 198, 0.92);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.9);
  color: #7a6f65;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
}

body.report-mode .report-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.report-mode .report-tags span {
  border-color: rgba(197, 137, 67, 0.22) !important;
  background: #fffaf2 !important;
  color: #6f7f55 !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-overview-strip {
    grid-template-columns: 68px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  body.report-mode .overview-score {
    width: 62px !important;
    min-width: 62px !important;
  }

  body.report-mode .overview-score strong {
    font-size: 24px !important;
  }

  body.report-mode .overview-grade strong {
    font-size: 19px !important;
  }

  body.report-mode .overview-tendency strong {
    font-size: 14px !important;
  }

  body.report-mode .overview-chips span {
    font-size: 10px;
    padding: 4px 7px;
  }
}

/* Report detail fixed summary: image + overview stay visible above the tab content. */
.report-fixed-summary {
  display: none;
}

body.report-mode {
  overflow: hidden;
}

body.report-mode .app-shell {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(100vw, var(--h5-width)) !important;
  height: min(100svh, var(--h5-height));
  min-height: min(100svh, var(--h5-height));
  max-height: 100svh;
  overflow: hidden;
  gap: 0 !important;
  padding: 0 14px calc(10px + env(safe-area-inset-bottom)) !important;
}

body.report-mode .topbar {
  position: relative !important;
  top: auto !important;
  z-index: 30 !important;
  flex: 0 0 auto;
  margin: 0 -14px !important;
}

body.report-mode .report-fixed-summary {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fbf8f2 0%, #f7efe4 100%);
  padding: 10px 0 8px;
}

body.report-mode .report-fixed-summary .report-result-visual {
  display: block !important;
  min-width: 0;
  margin: 0 !important;
}

body.report-mode .report-fixed-summary .viewer-panel {
  display: grid !important;
  gap: 8px !important;
  overflow: hidden;
  border: 1px solid rgba(231, 217, 198, 0.96) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 248, 0.98) !important;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045) !important;
  padding: 10px !important;
}

body.report-mode .report-fixed-summary .canvas-toolbar {
  display: flex !important;
  min-height: 30px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin: 0 !important;
}

body.report-mode .report-fixed-summary .canvas-toolbar h2 {
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}

body.report-mode .report-fixed-summary .canvas-context {
  display: block !important;
  margin: 2px 0 0 !important;
  overflow: hidden;
  color: #8a7867 !important;
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1.25 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.report-mode .report-fixed-summary .toggle-group {
  display: none !important;
}

body.report-mode .report-fixed-summary .image-preview-button {
  display: inline-flex !important;
  min-height: 30px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(197, 137, 67, 0.34) !important;
  border-radius: 999px !important;
  background: #fffaf2 !important;
  color: #b2712d !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  padding: 0 12px !important;
}

body.report-mode .report-fixed-summary .canvas-wrap {
  display: grid !important;
  width: 100% !important;
  height: clamp(178px, 29svh, 248px) !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid rgba(231, 217, 198, 0.9) !important;
  border-radius: 14px !important;
  background-size: 22px 22px !important;
  padding: 7px !important;
}

body.report-mode .report-fixed-summary canvas {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}

body.report-mode .report-fixed-summary .image-meta {
  display: none !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  grid-template-columns: 66px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
  min-width: 0;
  margin: 0 !important;
  padding: 10px !important;
}

body.report-mode .report-fixed-summary .overview-score {
  width: 60px !important;
  min-width: 60px !important;
}

body.report-mode .report-fixed-summary .overview-score strong {
  font-size: 24px !important;
}

body.report-mode .report-fixed-summary .overview-score em {
  margin-top: -12px !important;
  font-size: 10px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  gap: 5px !important;
}

body.report-mode .report-fixed-summary .overview-grade strong {
  font-size: 18px !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  font-size: 13px !important;
  line-height: 1.3 !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  gap: 5px !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  font-size: 10px;
  padding: 4px 7px;
}

body.report-mode .report-section.panel {
  order: 3 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 !important;
  padding: 0 0 12px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.report-mode .report-tabs {
  position: sticky !important;
  top: 0 !important;
  z-index: 18 !important;
  margin: 0 0 10px !important;
  border: 1px solid rgba(231, 217, 198, 0.9) !important;
  border-radius: 14px !important;
  background: rgba(255, 253, 248, 0.98) !important;
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.055) !important;
  padding: 5px !important;
}

body.report-mode .report-body {
  min-height: 0;
  gap: 12px !important;
  padding-bottom: 4px;
}

body.report-mode .report-tip {
  margin-bottom: 0 !important;
}

@media (max-height: 760px) {
  body.report-mode .report-fixed-summary {
    gap: 6px;
    padding-top: 8px;
  }

  body.report-mode .report-fixed-summary .viewer-panel {
    gap: 6px !important;
    padding: 8px !important;
  }

  body.report-mode .report-fixed-summary .canvas-context {
    display: none !important;
  }

  body.report-mode .report-fixed-summary .canvas-wrap {
    height: clamp(138px, 23svh, 184px) !important;
    padding: 6px !important;
  }

  body.report-mode .report-fixed-summary .report-overview-strip {
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-score {
    width: 54px !important;
    min-width: 54px !important;
  }

  body.report-mode .report-fixed-summary .overview-score strong {
    font-size: 22px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade strong {
    font-size: 17px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 12px !important;
  }
}

/* Report detail correction: top bar first, image thumbnail inside the overview row. */
body.report-mode .topbar {
  order: 1 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 60 !important;
}

body.report-mode .report-fixed-summary {
  order: 2 !important;
  grid-template-columns: 104px minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 10px !important;
  overflow: visible;
  border: 1px solid rgba(231, 217, 198, 0.94);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 8px 18px rgba(84, 56, 28, 0.045);
  padding: 10px !important;
  margin: 10px 0 8px;
}

body.report-mode .report-section.panel {
  order: 3 !important;
}

body.report-mode .report-fixed-summary .report-result-visual {
  align-self: stretch;
}

body.report-mode .report-fixed-summary .viewer-panel {
  height: 100%;
  min-height: 104px;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.report-mode .report-fixed-summary .canvas-toolbar {
  display: none !important;
}

body.report-mode .report-fixed-summary .canvas-wrap {
  height: 100% !important;
  min-height: 104px !important;
  border-radius: 14px !important;
  padding: 4px !important;
}

body.report-mode .report-fixed-summary canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  grid-template-columns: 52px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-self: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.report-mode .report-fixed-summary .overview-score {
  width: 50px !important;
  min-width: 50px !important;
}

body.report-mode .report-fixed-summary .overview-score strong {
  font-size: 22px !important;
}

body.report-mode .report-fixed-summary .overview-score em {
  margin-top: -10px !important;
  font-size: 9px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  gap: 5px !important;
}

body.report-mode .report-fixed-summary .overview-grade strong {
  font-size: 18px !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  font-size: 13px !important;
  line-height: 1.32 !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  gap: 5px !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  font-size: 10px;
  line-height: 1.15;
  padding: 4px 7px;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  body.report-mode .report-fixed-summary .viewer-panel,
  body.report-mode .report-fixed-summary .canvas-wrap {
    min-height: 94px !important;
  }

  body.report-mode .report-fixed-summary .report-overview-strip {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  body.report-mode .report-fixed-summary .overview-score {
    width: 46px !important;
    min-width: 46px !important;
  }

  body.report-mode .report-fixed-summary .overview-score strong {
    font-size: 20px !important;
  }
}

/* Report top card polish: one compact card, image thumbnail on the left. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 118px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  overflow: hidden !important;
  border-color: rgba(231, 217, 198, 0.96);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(255, 250, 244, 0.98));
  padding: 12px !important;
}

body.report-mode .report-fixed-summary .report-result-visual {
  order: 1 !important;
  align-self: stretch !important;
  min-width: 0;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  order: 2 !important;
  grid-template-columns: 54px minmax(0, 1fr) !important;
  gap: 9px !important;
  align-self: center !important;
  min-width: 0;
}

body.report-mode .report-fixed-summary .viewer-panel {
  display: block !important;
  height: 100% !important;
  min-height: 118px !important;
}

body.report-mode .report-fixed-summary .canvas-wrap {
  width: 100% !important;
  height: 100% !important;
  min-height: 118px !important;
  border-radius: 12px !important;
  background-size: 18px 18px !important;
  padding: 3px !important;
}

body.report-mode .report-fixed-summary canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 9px !important;
}

body.report-mode .report-fixed-summary .overview-score {
  width: 52px !important;
  min-width: 52px !important;
  align-self: center !important;
}

body.report-mode .report-fixed-summary .overview-score strong {
  font-size: 22px !important;
}

body.report-mode .report-fixed-summary .overview-score em {
  margin-top: -10px !important;
  font-size: 9px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  min-width: 0 !important;
  gap: 6px !important;
}

body.report-mode .report-fixed-summary .overview-grade strong {
  font-size: 20px !important;
  line-height: 1.08 !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  display: -webkit-box !important;
  overflow: hidden;
  color: #332d27 !important;
  font-size: 13px !important;
  line-height: 1.28 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.report-mode .report-fixed-summary .overview-chips {
  gap: 5px !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  max-width: 100%;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.15;
  padding: 4px 7px;
  white-space: nowrap;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  body.report-mode .report-fixed-summary .viewer-panel,
  body.report-mode .report-fixed-summary .canvas-wrap {
    min-height: 104px !important;
  }

  body.report-mode .report-fixed-summary .report-overview-strip {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-score {
    width: 48px !important;
    min-width: 48px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade strong {
    font-size: 18px !important;
  }
}

/* Report top card image frame: fixed rectangle, proportional crop, hidden scrollbar. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 142px minmax(0, 1fr) !important;
  min-height: 142px;
}

body.report-mode .report-fixed-summary .report-result-visual {
  width: 132px !important;
  height: 112px !important;
  align-self: center !important;
  justify-self: center !important;
}

body.report-mode .report-fixed-summary .viewer-panel {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.report-mode .report-fixed-summary .canvas-wrap {
  position: relative !important;
  display: block !important;
  width: 132px !important;
  height: 112px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  padding: 0 !important;
}

body.report-mode .report-fixed-summary canvas {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: auto !important;
  min-width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  transform: translate(-50%, -50%);
}

body.report-mode .report-section.panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.report-mode .report-section.panel::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 126px minmax(0, 1fr) !important;
    min-height: 126px;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 116px !important;
    height: 100px !important;
  }
}

/* Report top card refinement: larger photo frame and orderly right-side summary. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 174px minmax(0, 1fr) !important;
  min-height: 168px;
  gap: 16px !important;
  padding: 14px !important;
}

body.report-mode .report-fixed-summary .report-result-visual {
  width: 160px !important;
  height: 136px !important;
}

body.report-mode .report-fixed-summary .canvas-wrap {
  width: 160px !important;
  height: 136px !important;
  border-radius: 14px !important;
}

body.report-mode .report-fixed-summary canvas {
  width: auto !important;
  min-width: 100% !important;
  height: 100% !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  grid-template-columns: 62px minmax(0, 1fr) !important;
  grid-template-areas: "score main";
  gap: 12px !important;
  align-items: center !important;
}

body.report-mode .report-fixed-summary .overview-score {
  grid-area: score;
  width: 58px !important;
  min-width: 58px !important;
}

body.report-mode .report-fixed-summary .overview-score strong {
  font-size: 24px !important;
}

body.report-mode .report-fixed-summary .overview-score em {
  margin-top: -11px !important;
  font-size: 10px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  grid-area: main;
  display: grid !important;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 8px !important;
}

body.report-mode .report-fixed-summary .overview-grade,
body.report-mode .report-fixed-summary .overview-tendency {
  margin: 0 !important;
  text-align: left !important;
}

body.report-mode .report-fixed-summary .overview-grade strong {
  font-size: 22px !important;
  line-height: 1.05 !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  font-size: 14px !important;
  font-weight: 1000 !important;
  line-height: 1.28 !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 6px 7px !important;
  justify-content: start;
}

body.report-mode .report-fixed-summary .overview-chips span {
  min-width: 0;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 150px minmax(0, 1fr) !important;
    min-height: 148px;
    gap: 12px !important;
    padding: 12px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 138px !important;
    height: 118px !important;
  }

  body.report-mode .report-fixed-summary .report-overview-strip {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  body.report-mode .report-fixed-summary .overview-score {
    width: 52px !important;
    min-width: 52px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade strong {
    font-size: 19px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 12px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips {
    grid-template-columns: 1fr;
  }

  body.report-mode .report-fixed-summary .overview-chips span {
    max-width: 100%;
  }
}

/* Report detail layout polish: structured summary block and cleaner dimension cards. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 200px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: center !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 188px !important;
  height: 154px !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  display: grid !important;
  grid-template-columns: 60px minmax(0, 1fr) !important;
  grid-template-areas:
    "score grade"
    "score tendency"
    "chips chips";
  align-content: center !important;
  gap: 7px 10px !important;
}

body.report-mode .report-fixed-summary .overview-score {
  grid-area: score;
  width: 58px !important;
  min-width: 58px !important;
  align-self: center !important;
}

body.report-mode .report-fixed-summary .overview-main {
  display: contents !important;
}

body.report-mode .report-fixed-summary .overview-grade {
  grid-area: grade;
}

body.report-mode .report-fixed-summary .overview-tendency {
  grid-area: tendency;
}

body.report-mode .report-fixed-summary .overview-grade strong,
body.report-mode .report-fixed-summary .overview-tendency strong {
  text-align: left !important;
}

body.report-mode .report-fixed-summary .overview-grade strong {
  font-size: 22px !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  font-size: 13px !important;
  line-height: 1.3 !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  grid-area: chips;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  display: inline-flex;
  min-width: 0;
  max-width: none;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.report-mode .report-dimension-card {
  padding: 18px !important;
}

body.report-mode .report-dimension-card .dimension-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
}

body.report-mode .report-dimension-card .dimension-head h3 {
  margin: 0 !important;
  font-size: 23px !important;
  line-height: 1.1 !important;
  text-align: left !important;
}

body.report-mode .report-dimension-card .dimension-head strong {
  flex: 0 0 auto;
  min-height: 34px !important;
  font-size: 15px !important;
  padding: 7px 14px !important;
}

body.report-mode .report-dimension-card .report-fields {
  gap: 16px !important;
}

body.report-mode .report-dimension-card .report-field {
  padding: 2px 0 2px 14px !important;
}

body.report-mode .report-dimension-card .report-field span {
  margin-bottom: 8px !important;
  font-size: 14px !important;
}

body.report-mode .report-dimension-card .report-field p {
  font-size: 16px !important;
  line-height: 1.72 !important;
  text-align: left !important;
  overflow-wrap: break-word;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 154px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 144px !important;
    height: 126px !important;
  }

  body.report-mode .report-fixed-summary .report-overview-strip {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 6px 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-score {
    width: 52px !important;
    min-width: 52px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade strong {
    font-size: 19px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 12px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips {
    grid-template-columns: 1fr !important;
  }
}

/* Report summary mental model: status first, score as an index, tendency as context. */
body.report-mode .report-fixed-summary .report-overview-strip {
  display: block !important;
  min-width: 0;
}

body.report-mode .report-fixed-summary .overview-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 8px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-status {
  display: grid;
  gap: 3px;
}

body.report-mode .report-fixed-summary .overview-status span,
body.report-mode .report-fixed-summary .overview-score span,
body.report-mode .report-fixed-summary .overview-tendency span {
  color: #a36a30;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

body.report-mode .report-fixed-summary .overview-status strong {
  color: #2f2924;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.05;
}

body.report-mode .report-fixed-summary .overview-score {
  display: grid !important;
  width: auto !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "bar bar";
  gap: 5px 8px;
  align-items: end;
  border-radius: 10px;
  background: rgba(255, 250, 242, 0.72);
  padding: 8px 9px;
}

body.report-mode .report-fixed-summary .overview-score span {
  grid-area: label;
  color: #7c7166;
}

body.report-mode .report-fixed-summary .overview-score strong {
  grid-area: value;
  color: #2f2924;
  font-size: 18px !important;
  font-weight: 1000;
  line-height: 1;
}

body.report-mode .report-fixed-summary .overview-score em {
  margin: 0 0 0 1px !important;
  color: #8d8074;
  font-size: 10px !important;
  font-style: normal;
  font-weight: 900;
}

body.report-mode .report-fixed-summary .overview-score i {
  grid-area: bar;
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #6f7f55 calc(var(--score, 0) * 1%), rgba(231, 217, 198, 0.82) 0);
}

body.report-mode .report-fixed-summary .overview-tendency {
  display: grid;
  gap: 4px;
  margin: 0 !important;
  border-left: 3px solid rgba(197, 137, 67, 0.28);
  padding-left: 8px;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  display: block !important;
  overflow: hidden;
  color: #3a332e !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  line-height: 1.34 !important;
  text-align: left !important;
  text-overflow: ellipsis;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  justify-content: center;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary .overview-main {
    gap: 6px !important;
  }

  body.report-mode .report-fixed-summary .overview-status strong {
    font-size: 20px;
  }

  body.report-mode .report-fixed-summary .overview-score {
    padding: 7px 8px;
  }

  body.report-mode .report-fixed-summary .overview-score strong {
    font-size: 16px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 12px !important;
  }
}

/* Report top summary reset: concise result, tendency, then dimension tags. */
body.report-mode .report-fixed-summary .report-overview-strip {
  display: block !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-primary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

body.report-mode .report-fixed-summary .overview-primary strong {
  color: #2f2924;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1.05;
}

body.report-mode .report-fixed-summary .overview-primary span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(197, 137, 67, 0.26);
  border-radius: 999px;
  background: #fffaf2;
  color: #9d652a;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
  padding: 0 10px;
  white-space: nowrap;
}

body.report-mode .report-fixed-summary .overview-score,
body.report-mode .report-fixed-summary .overview-status {
  display: none !important;
}

body.report-mode .report-fixed-summary .overview-tendency {
  display: block !important;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  display: block !important;
  overflow: hidden;
  color: #3d362f !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.34 !important;
  text-align: left !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  justify-content: center;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  border-color: rgba(197, 137, 67, 0.22);
  background: rgba(255, 250, 242, 0.92);
  color: #786b60;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 8px;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary .overview-main {
    gap: 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-primary strong {
    font-size: 23px;
  }

  body.report-mode .report-fixed-summary .overview-primary span {
    min-height: 26px;
    font-size: 12px;
    padding: 0 8px;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 13px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips span {
    font-size: 11px;
    padding: 6px 8px;
  }
}

/* Report top info cleanup: stable hierarchy inside the right summary area. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 200px minmax(0, 1fr) !important;
  gap: 14px !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  display: block !important;
  align-self: stretch !important;
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 2px 0 !important;
}

body.report-mode .report-fixed-summary .overview-main {
  display: grid !important;
  height: 100%;
  min-width: 0 !important;
  align-content: center !important;
  gap: 8px !important;
}

body.report-mode .report-fixed-summary .overview-primary {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  gap: 10px !important;
}

body.report-mode .report-fixed-summary .overview-primary strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #2f2924 !important;
  font-size: 29px !important;
  font-weight: 1000 !important;
  line-height: 1.08 !important;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-primary span {
  display: inline-flex !important;
  min-height: 28px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(197, 137, 67, 0.26) !important;
  border-radius: 999px !important;
  background: #fffaf2 !important;
  color: #9d652a !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  padding: 0 12px !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-tendency {
  display: grid !important;
  min-width: 0 !important;
  gap: 4px !important;
  margin: 0 !important;
  border: 1px solid rgba(231, 217, 198, 0.66) !important;
  border-radius: 12px !important;
  background: rgba(255, 250, 242, 0.72) !important;
  padding: 7px 9px !important;
}

body.report-mode .report-fixed-summary .overview-tendency span {
  display: block !important;
  color: #a36a30 !important;
  font-size: 10px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  display: -webkit-box !important;
  overflow: hidden !important;
  color: #3d362f !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  line-height: 1.32 !important;
  text-align: left !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0 !important;
  max-width: none !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 6px;
  overflow: hidden !important;
  border: 1px solid rgba(197, 137, 67, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(255, 253, 248, 0.76) !important;
  color: #776a60 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  padding: 6px 8px !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-chips b,
body.report-mode .report-fixed-summary .overview-chips em {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.report-mode .report-fixed-summary .overview-chips b {
  color: #a36a30;
  font-style: normal;
  font-weight: 1000;
}

body.report-mode .report-fixed-summary .overview-chips em {
  color: #776a60;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 170px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 160px !important;
    height: 128px !important;
  }

  body.report-mode .report-fixed-summary .overview-primary strong {
    font-size: 24px !important;
  }

  body.report-mode .report-fixed-summary .overview-primary span {
    min-height: 24px !important;
    font-size: 12px !important;
    padding: 0 9px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency {
    padding: 6px 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 12px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips {
    gap: 5px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips span {
    gap: 4px;
    font-size: 10px !important;
    padding: 5px 6px !important;
  }
}

/* Report detail final layout: balanced top summary and left-aligned dimension headings. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 156px minmax(0, 1fr) !important;
  min-height: 0 !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 156px !important;
  height: 132px !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  display: grid !important;
  min-width: 0 !important;
  height: 100% !important;
  align-self: stretch !important;
  align-items: center !important;
  overflow: visible !important;
  padding: 0 !important;
}

body.report-mode .report-fixed-summary .overview-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-primary {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

body.report-mode .report-fixed-summary .overview-grade-label {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: visible !important;
  color: #2f2924 !important;
  font-size: 31px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1.08 !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-score-pill {
  display: inline-flex !important;
  min-height: 28px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(197, 137, 67, 0.28) !important;
  border-radius: 999px !important;
  background: #fffaf2 !important;
  color: #9d652a !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  padding: 0 11px !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-tendency {
  display: grid !important;
  min-width: 0 !important;
  gap: 4px !important;
  margin: 0 !important;
  border: 1px solid rgba(231, 217, 198, 0.72) !important;
  border-radius: 12px !important;
  background: rgba(255, 250, 242, 0.76) !important;
  padding: 7px 9px !important;
  text-align: left !important;
}

body.report-mode .report-fixed-summary .overview-tendency span {
  display: block !important;
  color: #a36a30 !important;
  font-size: 10px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: left !important;
}

body.report-mode .report-fixed-summary .overview-tendency strong {
  display: -webkit-box !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #3d362f !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  line-height: 1.32 !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  min-width: 0 !important;
  max-width: none !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 5px !important;
  overflow: hidden !important;
  border: 1px solid rgba(197, 137, 67, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(255, 253, 248, 0.82) !important;
  color: #776a60 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  padding: 6px 7px !important;
  text-align: left !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-chips b,
body.report-mode .report-fixed-summary .overview-chips em {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  line-height: 1.1 !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-chips b {
  color: #a36a30 !important;
  font-style: normal !important;
  font-weight: 1000 !important;
}

body.report-mode .report-fixed-summary .overview-chips em {
  color: #776a60 !important;
  font-style: normal !important;
  font-weight: 900 !important;
}

body.report-mode .report-dimension-card {
  display: grid !important;
  gap: 14px !important;
  padding: 18px !important;
}

body.report-mode .report-dimension-card .dimension-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: start !important;
  align-items: start !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  text-align: left !important;
}

body.report-mode .report-dimension-card .dimension-head h3 {
  flex: 0 0 auto !important;
  margin: 0 !important;
  color: #bc732e !important;
  font-size: 26px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1.12 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

body.report-mode .report-dimension-card .dimension-head strong {
  display: inline-flex !important;
  min-height: 34px !important;
  flex: 0 1 auto !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  border: 1px solid rgba(197, 137, 67, 0.22) !important;
  border-radius: 999px !important;
  background: #fffaf2 !important;
  color: #8f5d2b !important;
  font-size: 16px !important;
  font-weight: 1000 !important;
  line-height: 1.1 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  padding: 7px 14px !important;
  text-align: left !important;
}

body.report-mode .report-dimension-card .report-tags {
  justify-content: flex-start !important;
}

body.report-mode .report-dimension-card .report-fields {
  display: grid !important;
  gap: 16px !important;
  min-width: 0 !important;
}

body.report-mode .report-dimension-card .report-field {
  display: grid !important;
  gap: 8px !important;
  min-width: 0 !important;
  padding: 2px 0 2px 14px !important;
  text-align: left !important;
}

body.report-mode .report-dimension-card .report-field span,
body.report-mode .report-dimension-card .report-field p {
  margin: 0 !important;
  text-align: left !important;
}

body.report-mode .report-dimension-card .report-field p {
  overflow-wrap: break-word !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 138px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 138px !important;
    height: 118px !important;
  }

  body.report-mode .report-fixed-summary .overview-main {
    gap: 6px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade-label {
    font-size: 25px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-pill {
    min-height: 24px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency {
    padding: 6px 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-tendency strong {
    font-size: 12px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips {
    gap: 5px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips span {
    gap: 4px !important;
    font-size: 10px !important;
    padding: 5px 6px !important;
  }

  body.report-mode .report-dimension-card {
    padding: 16px !important;
  }

  body.report-mode .report-dimension-card .dimension-head h3 {
    font-size: 24px !important;
  }

  body.report-mode .report-dimension-card .dimension-head strong {
    min-height: 32px !important;
    font-size: 15px !important;
    padding: 7px 12px !important;
  }
}

/* Final hard reset for old overview grid-area rules. */
body.report-mode .report-fixed-summary .report-overview-strip {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  grid-template-areas: none !important;
  justify-items: stretch !important;
  width: 100% !important;
}

body.report-mode .report-fixed-summary .overview-main {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas: none !important;
  justify-items: stretch !important;
  width: 100% !important;
}

body.report-mode .report-fixed-summary .overview-primary,
body.report-mode .report-fixed-summary .overview-tendency,
body.report-mode .report-fixed-summary .overview-chips {
  grid-area: auto !important;
  width: 100% !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.report-mode .report-fixed-summary .overview-primary .overview-grade-label {
  display: block !important;
  width: auto !important;
  min-width: max-content !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
  font-size: 31px !important;
  text-overflow: clip !important;
}

body.report-mode .report-fixed-summary .overview-primary .overview-score-pill {
  width: auto !important;
  min-width: max-content !important;
  flex: 0 0 auto !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary .overview-primary .overview-grade-label {
    font-size: 25px !important;
  }
}

/* Report top summary, reference style: grade badge, circular score and numbered tendency line. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 132px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: center !important;
  padding: 14px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 132px !important;
  height: 150px !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  align-items: center !important;
  overflow: visible !important;
}

body.report-mode .report-fixed-summary .overview-main {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  align-content: center !important;
  gap: 10px !important;
}

body.report-mode .report-fixed-summary .overview-topline {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 58px !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  display: inline-flex !important;
  min-height: 34px !important;
  align-items: center !important;
  justify-self: center !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, #efc983, #df9f48) !important;
  color: #fffdf8 !important;
  font-size: 20px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  padding: 0 13px !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-score-circle {
  display: grid !important;
  width: 58px !important;
  height: 58px !important;
  flex: 0 0 auto !important;
  place-items: center !important;
  align-content: center !important;
  border: 5px solid #66c6c1 !important;
  border-radius: 999px !important;
  background: rgba(255, 253, 248, 0.96) !important;
  color: #2f2924 !important;
  box-shadow: 0 5px 12px rgba(85, 185, 180, 0.16) !important;
}

body.report-mode .report-fixed-summary .overview-score-circle strong {
  display: block !important;
  margin: 0 !important;
  color: #2f2924 !important;
  font-size: 23px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
}

body.report-mode .report-fixed-summary .overview-score-circle span {
  display: block !important;
  margin-top: 3px !important;
  color: #8a7867 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis {
  min-width: 0 !important;
  color: #2f2924 !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1.42 !important;
  text-align: left !important;
  overflow-wrap: break-word !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-chips span {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: stretch !important;
  min-width: 0 !important;
  overflow: hidden !important;
  gap: 5px !important;
  border: 1px solid rgba(231, 217, 198, 0.9) !important;
  border-radius: 999px !important;
  background: rgba(255, 253, 248, 0.9) !important;
  color: #776a60 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  padding: 7px 9px !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-chips b,
body.report-mode .report-fixed-summary .overview-chips em {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  line-height: 1.1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-chips b {
  color: #a36a30 !important;
  font-style: normal !important;
  font-weight: 1000 !important;
}

body.report-mode .report-fixed-summary .overview-chips em {
  color: #776a60 !important;
  font-style: normal !important;
  font-weight: 900 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 118px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 118px !important;
    height: 140px !important;
  }

  body.report-mode .report-fixed-summary .overview-main {
    gap: 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-topline {
    grid-template-columns: minmax(0, 1fr) 52px !important;
    gap: 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade-badge {
    min-height: 30px !important;
    border-radius: 6px !important;
    font-size: 17px !important;
    padding: 0 11px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-circle {
    width: 52px !important;
    height: 52px !important;
    border-width: 4px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-circle strong {
    font-size: 20px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-circle span {
    font-size: 11px !important;
  }

  body.report-mode .report-fixed-summary .overview-diagnosis {
    font-size: 16px !important;
    line-height: 1.38 !important;
  }

  body.report-mode .report-fixed-summary .overview-chips {
    gap: 5px !important;
  }

  body.report-mode .report-fixed-summary .overview-chips span {
    gap: 4px !important;
    font-size: 10px !important;
    padding: 6px 7px !important;
  }
}

/* Report detail iteration: score first, grade after; multi-value chips wrap cleanly. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 132px minmax(0, 1fr) !important;
  gap: 14px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  gap: 10px !important;
}

body.report-mode .report-fixed-summary .overview-topline {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-score-inline {
  display: inline-flex !important;
  min-height: 34px !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 3px !important;
  color: #2f2924 !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.report-mode .report-fixed-summary .overview-score-inline span {
  color: #2f2924 !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
}

body.report-mode .report-fixed-summary .overview-score-inline strong {
  color: #2f2924 !important;
  font-size: 31px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  min-height: 30px !important;
  justify-self: auto !important;
  border-radius: 7px !important;
  font-size: 18px !important;
  padding: 0 12px !important;
}

body.report-mode .report-fixed-summary .overview-chip {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 5px !important;
}

body.report-mode .report-fixed-summary .overview-chip:not([data-count="1"]) {
  grid-column: 1 / -1 !important;
  align-items: start !important;
  border-radius: 14px !important;
  white-space: normal !important;
}

body.report-mode .report-fixed-summary .overview-chip em {
  display: flex !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

body.report-mode .report-fixed-summary .overview-chip em i {
  display: inline-block !important;
  min-width: 0 !important;
  color: #776a60 !important;
  font-style: normal !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  overflow-wrap: anywhere !important;
}

body.report-mode .report-dimension-card .dimension-head {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px 10px !important;
}

body.report-mode .report-dimension-card .dimension-head h3 {
  color: #2f2924 !important;
}

body.report-mode .report-dimension-card .dimension-label-pills {
  display: inline-flex !important;
  min-height: 34px !important;
  flex: 0 1 auto !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

body.report-mode .report-dimension-card .dimension-label-pills i {
  display: inline-flex !important;
  min-height: 34px !important;
  align-items: center !important;
  border: 1px solid rgba(197, 137, 67, 0.22) !important;
  border-radius: 999px !important;
  background: #fffaf2 !important;
  color: #8f5d2b !important;
  font-size: 16px !important;
  font-style: normal !important;
  font-weight: 1000 !important;
  line-height: 1.1 !important;
  padding: 7px 14px !important;
}

/* Report thumbnail image fit: center the full image inside the left frame without stretching. */
body.report-mode .report-fixed-summary .canvas-wrap {
  display: block !important;
  overflow: hidden !important;
  padding: 0 !important;
}

body.report-mode .report-fixed-summary canvas {
  position: static !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  transform: none !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 118px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body.report-mode .report-fixed-summary .overview-main {
    gap: 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline span {
    font-size: 15px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline strong {
    font-size: 25px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade-badge {
    min-height: 28px !important;
    font-size: 16px !important;
    padding: 0 10px !important;
  }

  body.report-mode .report-dimension-card .dimension-label-pills i {
    min-height: 32px !important;
    font-size: 15px !important;
    padding: 7px 12px !important;
  }
}

/* Report hierarchy polish: score panel, tendency panel, cleaner lower reading rhythm. */
body.report-mode .report-fixed-summary .overview-main {
  gap: 8px !important;
}

body.report-mode .report-fixed-summary .overview-score-panel {
  display: grid !important;
  gap: 4px !important;
  min-width: 0 !important;
  border: 1px solid rgba(231, 217, 198, 0.78) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 247, 235, 0.78)) !important;
  padding: 8px 10px !important;
}

body.report-mode .report-fixed-summary .overview-score-caption {
  color: #a36a30 !important;
  font-size: 10px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
}

body.report-mode .report-fixed-summary .overview-score-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-score-inline {
  min-height: 30px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline span {
  font-size: 16px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline strong {
  font-size: 33px !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  min-height: 32px !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #efc174, #d99135) !important;
  box-shadow: 0 8px 16px rgba(197, 137, 67, 0.18) !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
  border-left: 4px solid rgba(102, 198, 193, 0.84) !important;
  border-radius: 12px !important;
  background: rgba(246, 252, 250, 0.78) !important;
  padding: 8px 10px 9px 11px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card span {
  color: #5d8c87 !important;
  font-size: 10px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
  color: #2f2924 !important;
  font-size: 16px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1.38 !important;
  overflow-wrap: break-word !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  gap: 6px !important;
}

body.report-mode .report-fixed-summary .overview-chip {
  border-color: rgba(231, 217, 198, 0.82) !important;
  background: rgba(255, 253, 248, 0.72) !important;
  padding: 6px 8px !important;
}

body.report-mode .report-dimension-card {
  gap: 18px !important;
  padding: 22px 20px !important;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(255, 250, 244, 0.94)) !important;
}

body.report-mode .report-dimension-card .dimension-head {
  align-items: center !important;
  gap: 8px 10px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(231, 217, 198, 0.72) !important;
}

body.report-mode .report-dimension-card .dimension-head h3 {
  font-size: 30px !important;
  line-height: 1.08 !important;
}

body.report-mode .report-dimension-card .dimension-label-pills {
  min-height: 0 !important;
  gap: 5px !important;
}

body.report-mode .report-dimension-card .dimension-label-pills i {
  min-height: 30px !important;
  border-color: rgba(197, 137, 67, 0.2) !important;
  background: rgba(255, 250, 242, 0.9) !important;
  font-size: 14px !important;
  padding: 6px 12px !important;
}

body.report-mode .report-dimension-card .report-fields {
  gap: 20px !important;
}

body.report-mode .report-dimension-card .report-field {
  position: relative !important;
  gap: 7px !important;
  padding: 0 0 0 18px !important;
}

body.report-mode .report-dimension-card .report-field::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(197, 137, 67, 0.45), rgba(102, 198, 193, 0.28));
  content: "";
}

body.report-mode .report-dimension-card .report-field span {
  color: #a36a30 !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
  line-height: 1.2 !important;
}

body.report-mode .report-dimension-card .report-field p {
  color: #5b514a !important;
  font-size: 16px !important;
  line-height: 1.72 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary .overview-score-panel,
  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    padding: 7px 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline span {
    font-size: 14px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline strong {
    font-size: 27px !important;
  }

  body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
    font-size: 14px !important;
  }

  body.report-mode .report-dimension-card {
    padding: 18px 16px !important;
  }

  body.report-mode .report-dimension-card .dimension-head h3 {
    font-size: 27px !important;
  }

  body.report-mode .report-dimension-card .dimension-label-pills i {
    min-height: 28px !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
  }
}

/* Report detail polish: clearer hierarchy in the top summary and calmer analysis cards. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 136px minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 14px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 136px !important;
  height: 154px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  align-content: center !important;
}

body.report-mode .report-fixed-summary .overview-score-panel {
  display: grid !important;
  gap: 3px !important;
  min-width: 0 !important;
}

body.report-mode .report-fixed-summary .overview-score-caption,
body.report-mode .report-fixed-summary .overview-diagnosis-card span {
  display: block !important;
  color: #a36a30 !important;
  font-size: 10px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: left !important;
}

body.report-mode .report-fixed-summary .overview-score-row {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline {
  min-height: 32px !important;
  align-items: baseline !important;
  gap: 3px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline span {
  color: #3c332c !important;
  font-size: 17px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline strong {
  color: #2f2924 !important;
  font-size: 32px !important;
  line-height: 0.92 !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  min-height: 30px !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #efc47b, #d99434) !important;
  box-shadow: 0 5px 12px rgba(197, 137, 67, 0.18) !important;
  font-size: 18px !important;
  padding: 0 12px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
  border: 1px solid rgba(231, 217, 198, 0.86) !important;
  border-radius: 12px !important;
  background: rgba(255, 250, 242, 0.74) !important;
  padding: 8px 10px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
  display: block !important;
  min-width: 0 !important;
  color: #2f2924 !important;
  font-size: 16px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  line-height: 1.34 !important;
  text-align: left !important;
  overflow-wrap: break-word !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  gap: 6px !important;
}

body.report-mode .report-fixed-summary .overview-chip {
  min-height: 31px !important;
  border-color: rgba(231, 217, 198, 0.82) !important;
  background: rgba(255, 253, 248, 0.92) !important;
  box-shadow: 0 3px 8px rgba(84, 56, 28, 0.025) !important;
  padding: 6px 8px !important;
}

body.report-mode .report-tabs {
  border-radius: 16px !important;
  background: rgba(255, 253, 248, 0.96) !important;
  padding: 6px !important;
}

body.report-mode .report-tabs button {
  min-height: 48px !important;
  border-radius: 12px !important;
  font-size: 17px !important;
  font-weight: 1000 !important;
}

body.report-mode .report-tabs button.active {
  background: linear-gradient(180deg, #d99c42, #c9852f) !important;
  box-shadow: 0 7px 14px rgba(197, 137, 67, 0.2) !important;
}

body.report-mode .report-dimension-card {
  gap: 16px !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 244, 0.94)),
    var(--surface) !important;
  padding: 20px !important;
}

body.report-mode .report-dimension-card .dimension-head {
  gap: 8px 10px !important;
  padding-bottom: 2px !important;
}

body.report-mode .report-dimension-card .dimension-head h3 {
  font-size: 30px !important;
  line-height: 1.05 !important;
}

body.report-mode .report-dimension-card .dimension-label-pills {
  min-height: 28px !important;
  gap: 5px !important;
}

body.report-mode .report-dimension-card .dimension-label-pills i {
  min-height: 30px !important;
  border-color: rgba(197, 137, 67, 0.2) !important;
  background: rgba(255, 250, 242, 0.88) !important;
  color: #8f5d2b !important;
  font-size: 15px !important;
  padding: 6px 12px !important;
}

body.report-mode .report-dimension-card .report-fields {
  gap: 10px !important;
}

body.report-mode .report-dimension-card .report-field {
  display: grid !important;
  gap: 8px !important;
  border: 1px solid rgba(231, 217, 198, 0.72) !important;
  border-left: 4px solid rgba(197, 137, 67, 0.46) !important;
  border-radius: 10px !important;
  background: rgba(255, 253, 248, 0.72) !important;
  padding: 12px 13px 13px 14px !important;
}

body.report-mode .report-dimension-card .report-field span {
  color: #b2712d !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
}

body.report-mode .report-dimension-card .report-field p {
  color: #5e544c !important;
  font-size: 16px !important;
  line-height: 1.68 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 120px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 120px !important;
    height: 144px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline span {
    font-size: 14px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline strong {
    font-size: 27px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade-badge {
    min-height: 27px !important;
    font-size: 15px !important;
    padding: 0 9px !important;
  }

  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    padding: 7px 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
    font-size: 14px !important;
  }

  body.report-mode .report-dimension-card {
    padding: 18px !important;
  }

  body.report-mode .report-dimension-card .dimension-head h3 {
    font-size: 27px !important;
  }

  body.report-mode .report-dimension-card .report-field p {
    font-size: 15px !important;
  }
}

/* Final lower-section rhythm: no nested cards, just readable sections. */
body.report-mode .report-dimension-card .report-fields {
  gap: 22px !important;
}

body.report-mode .report-dimension-card .report-field {
  position: relative !important;
  display: grid !important;
  gap: 8px !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 0 0 18px !important;
}

body.report-mode .report-dimension-card .report-field::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(197, 137, 67, 0.5), rgba(102, 198, 193, 0.3));
  content: "";
}

body.report-mode .report-dimension-card .report-field span {
  color: #a96527 !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
  line-height: 1.2 !important;
}

body.report-mode .report-dimension-card .report-field p {
  color: #5b514a !important;
  font-size: 16px !important;
  line-height: 1.74 !important;
}

/* Final report polish: wider right summary, no four-dimension chips in the top card. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 112px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
  padding: 14px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 112px !important;
  height: 148px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  gap: 10px !important;
  align-content: center !important;
}

body.report-mode .report-fixed-summary .overview-chips {
  display: none !important;
}

body.report-mode .report-fixed-summary .overview-score-panel {
  gap: 5px !important;
  border: 1px solid rgba(231, 217, 198, 0.92) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 238, 0.88)) !important;
  box-shadow: 0 6px 14px rgba(84, 56, 28, 0.04) !important;
  padding: 9px 11px !important;
}

body.report-mode .report-fixed-summary .overview-score-caption {
  color: #a36a30 !important;
  font-size: 11px !important;
  letter-spacing: 0 !important;
}

body.report-mode .report-fixed-summary .overview-score-row {
  justify-content: space-between !important;
  gap: 10px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline span {
  font-size: 16px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline strong {
  font-size: 34px !important;
  line-height: 0.95 !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  min-height: 32px !important;
  border-radius: 8px !important;
  font-size: 17px !important;
  padding: 0 12px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card {
  gap: 6px !important;
  border: 1px solid rgba(102, 198, 193, 0.24) !important;
  border-left: 4px solid rgba(102, 198, 193, 0.86) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(247, 252, 250, 0.98), rgba(255, 253, 248, 0.94)) !important;
  box-shadow: 0 6px 14px rgba(84, 56, 28, 0.035) !important;
  padding: 10px 11px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card span {
  color: #4e8b86 !important;
  font-size: 11px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
  font-size: 18px !important;
  line-height: 1.38 !important;
}

body.report-mode .report-dimension-card .dimension-head {
  gap: 7px 8px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid rgba(231, 217, 198, 0.72) !important;
}

body.report-mode .report-dimension-card .dimension-head h3 {
  font-size: 24px !important;
  line-height: 1.12 !important;
}

body.report-mode .report-dimension-card .dimension-label-pills {
  min-height: 0 !important;
  gap: 4px !important;
}

body.report-mode .report-dimension-card .dimension-label-pills i {
  min-height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #9a642b !important;
  font-size: 15px !important;
  font-weight: 1000 !important;
  padding: 0 !important;
}

body.report-mode .report-dimension-card .dimension-label-pills i + i::before {
  color: #c9a57b;
  content: " / ";
  font-weight: 900;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 12px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 104px !important;
    height: 136px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline span {
    font-size: 14px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline strong {
    font-size: 29px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade-badge {
    min-height: 29px !important;
    font-size: 15px !important;
    padding: 0 9px !important;
  }

  body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
    font-size: 15px !important;
  }

  body.report-mode .report-dimension-card .dimension-head h3 {
    font-size: 22px !important;
  }

  body.report-mode .report-dimension-card .dimension-label-pills i {
    font-size: 14px !important;
  }
}

/* Top summary micro-adjustment: wider cards, flatter grade badge, calmer type scale. */
body.report-mode .report-fixed-summary .overview-score-panel,
body.report-mode .report-fixed-summary .overview-diagnosis-card {
  width: calc(100% + 12px) !important;
  margin-left: -12px !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  background: #dda04a !important;
  box-shadow: none !important;
}

body.report-mode .report-fixed-summary .overview-score-inline span {
  font-size: 15px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline strong {
  font-size: 30px !important;
  line-height: 0.96 !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
  font-size: 16px !important;
  line-height: 1.38 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary .overview-score-panel,
  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    width: calc(100% + 10px) !important;
    margin-left: -10px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline span {
    font-size: 13px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline strong {
    font-size: 26px !important;
  }

  body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
    font-size: 14px !important;
  }
}

/* Top summary height trim: keep content readable while reducing vertical whitespace. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 104px minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 10px 12px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 104px !important;
  height: 126px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  gap: 7px !important;
}

body.report-mode .report-fixed-summary .overview-score-panel,
body.report-mode .report-fixed-summary .overview-diagnosis-card {
  width: calc(100% + 10px) !important;
  margin-left: -10px !important;
  border-radius: 12px !important;
  padding: 7px 9px !important;
}

body.report-mode .report-fixed-summary .overview-score-panel {
  gap: 3px !important;
}

body.report-mode .report-fixed-summary .overview-score-caption,
body.report-mode .report-fixed-summary .overview-diagnosis-card span {
  font-size: 10px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline {
  min-height: 28px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline span {
  font-size: 14px !important;
}

body.report-mode .report-fixed-summary .overview-score-inline strong {
  font-size: 28px !important;
  line-height: 0.95 !important;
}

body.report-mode .report-fixed-summary .overview-grade-badge {
  min-height: 28px !important;
  border-radius: 7px !important;
  font-size: 16px !important;
  padding: 0 10px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card {
  gap: 4px !important;
}

body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
  font-size: 15px !important;
  line-height: 1.32 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 98px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 9px 10px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 98px !important;
    height: 118px !important;
  }

  body.report-mode .report-fixed-summary .overview-main {
    gap: 6px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-panel,
  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    width: calc(100% + 8px) !important;
    margin-left: -8px !important;
    padding: 6px 8px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline span {
    font-size: 12px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-inline strong {
    font-size: 24px !important;
  }

  body.report-mode .report-fixed-summary .overview-grade-badge {
    min-height: 26px !important;
    font-size: 14px !important;
    padding: 0 8px !important;
  }

body.report-mode .report-fixed-summary .overview-diagnosis-card strong {
    font-size: 13px !important;
  }
}

/* Capture guide final line art: keep a natural mouth ratio and avoid SVG stretching. */
body:not(.report-mode) .tongue-guide {
  top: calc(50% + 30px) !important;
  width: min(calc(100vw - 104px), 330px) !important;
  height: auto !important;
  aspect-ratio: 360 / 440;
  filter:
    drop-shadow(0 20px 36px rgba(0, 0, 0, 0.22))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.1));
}

body:not(.report-mode) .viewfinder-corners {
  inset: 16px !important;
  background:
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left top / 28px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left top / 2px 28px no-repeat,
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right top / 28px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right top / 2px 28px no-repeat,
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left bottom / 28px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) left bottom / 2px 28px no-repeat,
    linear-gradient(90deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right bottom / 28px 2px no-repeat,
    linear-gradient(180deg, rgba(217, 190, 112, 0), #dec16f 24%, #dec16f 80%, rgba(217, 190, 112, 0)) right bottom / 2px 28px no-repeat !important;
}

body:not(.report-mode) .tongue-guide-art {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: visible;
  transform: translateY(-34px);
}

body:not(.report-mode) .tongue-guide-art path {
  vector-effect: non-scaling-stroke;
  fill: none;
  stroke: rgba(247, 249, 244, 0.5);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.report-mode) .tongue-guide-art .guide-lip-outer {
  fill: none;
  stroke: rgba(248, 250, 246, 0.66);
  stroke-width: 1.65;
}

body:not(.report-mode) .tongue-guide-art .guide-upper-lip {
  fill: none;
  stroke: rgba(248, 250, 246, 0.58);
  stroke-width: 1.35;
}

body:not(.report-mode) .tongue-guide-art .guide-mouth-line {
  stroke: rgba(248, 250, 246, 0.58);
  stroke-width: 1.25;
}

body:not(.report-mode) .tongue-guide-art .guide-teeth {
  fill: none;
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 1.1;
}

body:not(.report-mode) .tongue-guide-art .guide-tongue {
  fill: none;
  stroke: rgba(248, 250, 246, 0.76);
  stroke-width: 1.85;
}

body:not(.report-mode) .tongue-guide-art .guide-midline {
  stroke: rgba(248, 250, 246, 0.78);
  stroke-width: 1.55;
}

@media (max-width: 380px) {
  body:not(.report-mode) .tongue-guide {
    width: min(calc(100vw - 78px), 312px) !important;
  }
}

@media (max-height: 720px) {
  body:not(.report-mode) .tongue-guide {
    top: calc(50% + 20px) !important;
    width: min(calc(100vw - 118px), 296px) !important;
  }
}

/* Report topbar share polish. */
body.report-mode .topbar {
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  min-height: 60px !important;
  padding: 8px 18px !important;
}

body.report-mode .report-back {
  display: inline-grid !important;
  width: 42px !important;
  min-height: 42px !important;
  place-items: center !important;
  justify-self: start !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #312c28 !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  padding: 0 !important;
}

body.report-mode .report-back svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.report-mode .report-back:hover,
body.report-mode .report-back:active {
  background: transparent !important;
  transform: none !important;
}

body.report-mode .topbar h1 {
  justify-self: center !important;
  color: #302b27 !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
}

body.report-mode .report-share {
  display: inline-grid !important;
  width: 42px !important;
  min-height: 42px !important;
  place-items: center !important;
  justify-self: end !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #a86a2c !important;
  padding: 0 !important;
}

body.report-mode .report-share svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.report-mode .report-share:hover,
body.report-mode .report-share:active {
  background: transparent !important;
  transform: none !important;
}

.share-sheet[hidden] {
  display: none !important;
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: end;
  justify-items: center;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.share-sheet.active {
  opacity: 1;
  pointer-events: auto;
}

.share-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: none;
}

.share-sheet-panel {
  position: relative;
  width: min(calc(100vw - 18px), var(--h5-width));
  overflow: hidden;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: none;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(10px);
  transition: transform 0.16s ease;
}

.share-sheet.active .share-sheet-panel {
  transform: translateY(0);
}

.share-sheet-head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 28px;
  margin-bottom: 18px;
}

.share-sheet-head strong {
  color: #242424;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.share-sheet-head button {
  position: absolute;
  right: -4px;
  top: 50%;
  display: grid;
  width: 32px;
  min-height: 32px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #242424;
  padding: 0;
  transform: translateY(-50%);
}

.share-sheet-head button:hover,
.share-sheet-head button:active {
  background: transparent;
  transform: translateY(-50%);
}

.share-sheet-head svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.share-option {
  display: grid;
  min-width: 0;
  min-height: 74px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #242424;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  padding: 0;
}

button.share-option {
  min-height: 74px;
}

.share-option > span:last-child {
  white-space: nowrap;
}

.share-option:hover,
.share-option:active {
  background: transparent;
  transform: none;
}

.share-option[hidden] {
  display: none !important;
}

.share-option-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #f4f4f4;
  color: #242424;
}

.share-option-icon svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.share-sheet-open {
  overflow: hidden;
}

/* Report tab compact polish. */
body.report-mode .report-tabs {
  gap: 4px !important;
  margin: 0 0 8px !important;
  border-radius: 12px !important;
  box-shadow: 0 5px 12px rgba(84, 56, 28, 0.035) !important;
  padding: 4px !important;
}

body.report-mode .report-tabs button {
  min-height: 34px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  padding: 0 12px !important;
}

body.report-mode .report-tabs button.active {
  background: linear-gradient(180deg, #d99a3b, #cf8726) !important;
  box-shadow: 0 4px 9px rgba(197, 137, 67, 0.16) !important;
}

/* Report top summary alignment: widen the right cards and close the middle gap. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 100px minmax(0, 1fr) !important;
  gap: 4px !important;
  padding: 10px 10px 10px 12px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 100px !important;
  height: 126px !important;
}

body.report-mode .report-fixed-summary .overview-main {
  gap: 7px !important;
}

body.report-mode .report-fixed-summary .overview-score-panel,
body.report-mode .report-fixed-summary .overview-diagnosis-card {
  width: calc(100% + 20px) !important;
  margin-left: -16px !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 94px minmax(0, 1fr) !important;
    gap: 4px !important;
    padding: 9px 9px 9px 10px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 94px !important;
    height: 118px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-panel,
  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    width: calc(100% + 16px) !important;
    margin-left: -12px !important;
  }
}

/* Report top summary tighter right column. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 96px minmax(0, 1fr) !important;
  gap: 2px !important;
  padding: 10px 8px 10px 10px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 96px !important;
}

body.report-mode .report-fixed-summary .overview-score-panel,
body.report-mode .report-fixed-summary .overview-diagnosis-card {
  width: calc(100% + 28px) !important;
  margin-left: -22px !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 90px minmax(0, 1fr) !important;
    gap: 2px !important;
    padding: 9px 8px 9px 9px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 90px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-panel,
  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    width: calc(100% + 22px) !important;
    margin-left: -16px !important;
  }
}

/* Tongue record page optimization. */
.records-modal {
  width: min(100vw, var(--h5-width)) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  background: linear-gradient(180deg, #fbf8f2 0%, #f7efe4 100%) !important;
  box-shadow: none !important;
}

body.records-open .app-shell {
  border-left: 0 !important;
  border-right: 0 !important;
}

.records-sheet {
  width: 100%;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 14px calc(18px + env(safe-area-inset-bottom)) !important;
}

.records-head {
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  min-height: 60px !important;
  margin: 0 -14px !important;
  border-bottom: 1px solid rgba(231, 217, 198, 0.88) !important;
  background: rgba(255, 253, 248, 0.96) !important;
  box-shadow: none !important;
  padding: 8px 18px !important;
}

.records-back,
.records-edit {
  display: inline-grid !important;
  width: 42px !important;
  min-height: 42px !important;
  place-items: center !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

.records-back {
  justify-self: start !important;
  color: #312c28 !important;
}

.records-back svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.records-edit {
  justify-self: end !important;
  color: #a86a2c !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.records-edit.active {
  color: #5f564c !important;
}

.records-back:hover,
.records-back:active,
.records-edit:hover,
.records-edit:active {
  background: transparent !important;
  transform: none !important;
}

.records-head h2 {
  justify-self: center !important;
  color: #302b27 !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
}

.records-list {
  gap: 12px !important;
  padding: 14px 0 calc(12px + env(safe-area-inset-bottom)) !important;
}

.records-modal.editing .records-list {
  padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
}

.record-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(231, 217, 198, 0.95) !important;
  background: rgba(255, 253, 248, 0.96) !important;
  padding: 14px !important;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.record-card.selected {
  border-color: rgba(197, 137, 67, 0.62) !important;
  background: #fffaf0 !important;
  box-shadow: 0 14px 34px rgba(197, 137, 67, 0.16) !important;
}

.record-main {
  display: grid !important;
  width: 100%;
  grid-template-columns: 96px minmax(0, 1fr) !important;
  gap: 13px !important;
  align-items: start !important;
  min-height: auto !important;
}

.record-photo-button,
.record-content-button {
  width: 100%;
  min-height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: left;
  padding: 0 !important;
}

.record-photo-button {
  display: block;
}

.record-content-button {
  min-width: 0;
}

.record-photo-button:hover,
.record-photo-button:active,
.record-content-button:hover,
.record-content-button:active {
  border-color: transparent !important;
  background: transparent !important;
  transform: none !important;
}

.records-modal.editing .record-main {
  grid-template-columns: 78px minmax(0, 1fr) !important;
  gap: 10px !important;
}

.record-thumb {
  width: 96px !important;
  height: 96px !important;
  border-radius: 8px !important;
}

.records-modal.editing .record-thumb {
  width: 78px !important;
  height: 104px !important;
}

.record-content {
  gap: 8px !important;
  align-content: start !important;
}

.record-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.record-topline time {
  flex: 0 0 auto;
  margin-top: 4px;
  color: rgba(124, 113, 102, 0.82);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.1;
  white-space: nowrap;
}

.record-score-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.record-score-pill,
.record-grade-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 0 9px;
}

.record-score-pill {
  background: rgba(197, 137, 67, 0.1);
  color: #735225;
}

.record-grade-badge {
  background: rgba(111, 127, 85, 0.12);
  color: #66754d;
}

.record-grade-badge[data-grade="poor"],
.record-grade-badge[data-grade="bad"] {
  background: rgba(184, 90, 75, 0.11);
  color: #a34e41;
}

.record-tendency {
  display: block;
  min-width: 0;
}

.record-tendency em {
  display: -webkit-box;
  overflow: hidden;
  color: #302b27;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-tags {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px !important;
}

.record-tags span {
  display: flex;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(231, 217, 198, 0.5);
  border-radius: 7px !important;
  background: rgba(250, 246, 239, 0.78) !important;
  color: #7a5429 !important;
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1.15 !important;
  padding: 4px 7px !important;
}

.record-tags b {
  flex: 0 0 auto;
  font-weight: 800;
}

.record-tags em {
  min-width: 0;
  overflow: hidden;
  color: #6c512c;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-weight: 700;
}

.record-select {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 1;
  display: inline-grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(197, 137, 67, 0.45);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 4px 12px rgba(84, 56, 28, 0.12);
  padding: 0;
}

.record-select span {
  position: relative;
  width: 15px;
  height: 15px;
}

.record-card.selected .record-select {
  border-color: #cf8726;
  background: #cf8726;
  color: #fff;
}

.record-card.selected .record-select span::after {
  position: absolute;
  left: 3px;
  top: 1px;
  width: 7px;
  height: 11px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(42deg);
}

.record-delete {
  justify-self: end !important;
  min-height: 32px !important;
  border-color: rgba(184, 90, 75, 0.22) !important;
  background: #fff8f4 !important;
  color: #a34e41 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  padding: 0 12px !important;
}

.records-actions[hidden],
.record-confirm-modal[hidden] {
  display: none !important;
}

.records-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 0.86fr 1.14fr 1fr;
  gap: 8px;
  margin: 0 -4px;
  border-top: 1px solid rgba(231, 217, 198, 0.86);
  background: linear-gradient(180deg, rgba(247, 239, 228, 0.88), #fbf8f2 24%);
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
}

.records-actions button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px;
  padding: 0 8px;
}

.records-danger {
  border-color: rgba(184, 90, 75, 0.28) !important;
  background: #b85a4b !important;
  color: #fff !important;
}

.records-danger.ghost {
  background: #fff8f4 !important;
  color: #a34e41 !important;
}

.record-confirm-modal {
  position: fixed;
  inset: 0 auto 0 50%;
  left: 50%;
  z-index: 170;
  display: none;
  width: min(100vw, var(--h5-width));
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  padding: 24px;
}

.record-confirm-modal.active {
  display: flex;
}

.record-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 42, 37, 0.42);
}

.record-confirm-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  border: 1px solid rgba(231, 217, 198, 0.95);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 22px 58px rgba(47, 42, 37, 0.22);
  padding: 22px 18px 16px;
}

.record-confirm-card p {
  margin: 0;
  color: #302b27;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
}

.record-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.record-confirm-actions button {
  min-height: 40px;
  border-radius: 8px;
}

@media (max-width: 380px) {
  .record-main {
    grid-template-columns: 86px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .record-thumb {
    width: 86px !important;
    height: 86px !important;
  }

  .record-tags {
    grid-template-columns: 1fr;
  }

  .records-modal.editing .record-main {
    grid-template-columns: 70px minmax(0, 1fr) !important;
  }

  .records-modal.editing .record-thumb {
    width: 70px !important;
    height: 96px !important;
  }
}

/* Final report overview spacing: fixed right cards inside the target column. */
body.report-mode .report-fixed-summary {
  grid-template-columns: 92px 236px !important;
  gap: 10px !important;
  justify-content: start !important;
  padding: 10px 8px 10px 10px !important;
}

body.report-mode .report-fixed-summary .report-result-visual,
body.report-mode .report-fixed-summary .canvas-wrap {
  width: 92px !important;
}

body.report-mode .report-fixed-summary .report-overview-strip {
  display: block !important;
  width: 236px !important;
  min-width: 0 !important;
  align-self: center !important;
}

body.report-mode .report-fixed-summary .overview-main {
  width: 100% !important;
}

body.report-mode .report-fixed-summary .overview-score-panel,
body.report-mode .report-fixed-summary .overview-diagnosis-card {
  width: 100% !important;
  margin-left: 0 !important;
}

@media (max-width: 380px) {
  body.report-mode .report-fixed-summary {
    grid-template-columns: 86px 236px !important;
    gap: 10px !important;
    justify-content: start !important;
    padding: 9px 8px 9px 9px !important;
  }

  body.report-mode .report-fixed-summary .report-result-visual,
  body.report-mode .report-fixed-summary .canvas-wrap {
    width: 86px !important;
  }

  body.report-mode .report-fixed-summary .report-overview-strip {
    width: 236px !important;
  }

  body.report-mode .report-fixed-summary .overview-score-panel,
  body.report-mode .report-fixed-summary .overview-diagnosis-card {
    width: 100% !important;
    margin-left: 0 !important;
  }
}
