/* TTLENS PD — UI giống flow đối thủ, branding TTLENS */
.ttlens-pd {
  --pd-navy: #011e60;
  --pd-blue: #1a73e8;
  --pd-green: #1e9e5a;
  --pd-purple: #6b4ce6;
  --pd-orange: #f07a1a;
  --pd-yellow: #ffcd00;
  --pd-line: #e5e8ef;
  --pd-ok: #0a7a3e;
  --pd-warn: #b45309;
  --pd-err: #b91c1c;
  --pd-cam: #0a2540;
  font-family: Montserrat, system-ui, sans-serif;
  color: #1a1f2e;
  max-width: 720px;
  margin: 0 auto 40px;
  padding: 0 12px 24px;
}

/* —— Banner đầu trang Đo PD —— */
.mv-pd-hero {
  position: relative;
  display: flex;
  align-items: center;
  height: clamp(150px, 17vw, 210px);
  margin: 14px 0 26px;
  overflow: hidden;
  border-radius: 8px;
  background: #011e60;
}

.mv-pd-hero-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.mv-pd-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(1, 20, 55, .92) 0%, rgba(1, 20, 55, .6) 45%, rgba(1, 20, 55, .1) 80%, rgba(1, 20, 55, 0) 100%);
  pointer-events: none;
}

.mv-pd-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 26px 30px;
  color: #fff;
  font-family: Montserrat, system-ui, sans-serif;
}

.mv-pd-hero-eyebrow {
  margin: 0 0 8px;
  color: #ffcd00;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.mv-pd-hero-inner h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(22px, 2.9vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
}

.mv-pd-hero-lead {
  max-width: 520px;
  margin: 0;
  font-size: clamp(12px, 1.2vw, 15px);
  line-height: 1.55;
  opacity: .93;
}

/* Vào chế độ camera toàn màn hình thì ẩn banner */
body.ttlens-pd-body-immersive .mv-pd-hero {
  display: none;
}

@media (max-width: 767px) {
  .mv-pd-hero {
    height: 140px;
    margin: 10px 0 18px;
  }

  .mv-pd-hero-inner {
    padding: 16px 18px;
  }
}

/* Camera / kết quả: tràn viền, bỏ khung card */
.ttlens-pd.ttlens-pd--immersive {
  max-width: none;
  width: 100vw;
  margin: 0 calc(50% - 50vw) 0;
  padding: 0;
  background: #0d2137;
}

/* Ẩn khoảng trắng do .container Bootstrap khi immersive */
body.ttlens-pd-body-immersive .container.ttlens-pd {
  max-width: none !important;
  width: 100vw !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.ttlens-pd-guide-box {
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 10px;
  padding: 18px 20px 16px;
  margin: 16px 0 22px;
  box-shadow: 0 4px 18px rgba(1, 30, 96, 0.05);
}

.ttlens-pd-guide-box h1 {
  margin: 0 0 10px;
  color: var(--pd-navy);
  font-size: 22px;
  font-weight: 700;
}

.ttlens-pd-guide-box ul {
  margin: 0;
  padding-left: 18px;
  color: #44506a;
  font-size: 13px;
  line-height: 1.7;
}

/* —— Home guide illustration (SVG phone mockup) —— */
.ttlens-pd-illus {
  max-width: 560px;
  margin: 4px auto 16px;
}

.ttlens-pd-illus svg {
  display: block;
  width: 100%;
  height: auto;
}

.ttlens-pd-callout-2 {
  display: flex;
  height: 100%;
  align-items: center;
  margin: 0;
  padding: 0;
  color: #3a4256;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
}

.ttlens-pd-guide-steps {
  counter-reset: pdstep;
  list-style: none;
  max-width: 560px;
  margin: 0 auto 12px;
  padding: 0;
}

.ttlens-pd-guide-steps li {
  counter-increment: pdstep;
  position: relative;
  padding: 6px 0 6px 34px;
  font-size: 14px;
  color: #3a4256;
  line-height: 1.55;
}

.ttlens-pd-guide-steps li::before {
  content: counter(pdstep);
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pd-orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ttlens-pd-guide-steps strong {
  color: var(--pd-navy);
}

.ttlens-pd-guide-note {
  max-width: 560px;
  margin: 0 auto 22px;
  font-size: 13px;
  color: #6b7385;
  line-height: 1.7;
}

.ttlens-pd-guide-star {
  color: var(--pd-orange);
  font-weight: 700;
}

/* —— Legacy phone preview + callouts (giữ tương thích) —— */
.ttlens-pd-phone-preview {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px;
  background: #f4f6fa;
  border-radius: 12px;
}

.ttlens-pd-phone-screen {
  background: linear-gradient(180deg, #1a3355, #0d1e33);
  border-radius: 16px;
  padding: 12px 10px 14px;
  color: #fff;
  box-shadow: 0 12px 28px rgba(1, 30, 96, 0.18);
  aspect-ratio: 9 / 14;
  display: flex;
  flex-direction: column;
}

.ttlens-pd-phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  margin-bottom: 8px;
}

.ttlens-pd-chip {
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 6px;
  border-radius: 4px;
}

.ttlens-pd-gaze {
  color: #ff3b30;
  font-size: 14px;
  line-height: 1;
}

.ttlens-pd-phone-face {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  margin: 4px 0 10px;
}

.ttlens-pd-corners {
  position: absolute;
  inset: 12%;
  border: 2px solid transparent;
  border-image: none;
  background:
    linear-gradient(#fff, #fff) left top / 18px 2px no-repeat,
    linear-gradient(#fff, #fff) left top / 2px 18px no-repeat,
    linear-gradient(#fff, #fff) right top / 18px 2px no-repeat,
    linear-gradient(#fff, #fff) right top / 2px 18px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 18px 2px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 2px 18px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 18px 2px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 2px 18px no-repeat;
}

.ttlens-pd-head-sil {
  width: 42%;
  aspect-ratio: 3 / 4;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50% 50% 45% 45% / 40% 40% 55% 55%;
  margin-bottom: 8px;
}

.ttlens-pd-phone-face p {
  margin: 0;
  font-size: 10px;
  opacity: 0.9;
  text-align: center;
  padding: 0 6px;
}

.ttlens-pd-phone-btn {
  text-align: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
}

.ttlens-pd-callouts {
  margin: 0;
  padding-left: 22px;
  color: #44506a;
  font-size: 13px;
  line-height: 1.65;
}

.ttlens-pd-callouts li {
  margin-bottom: 8px;
}

.ttlens-pd-callouts li::marker {
  color: var(--pd-orange);
  font-weight: 800;
}

.ttlens-pd-callouts strong {
  color: var(--pd-navy);
}

/* —— Menu cards —— */
.ttlens-pd-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ttlens-pd-menu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(1, 30, 96, 0.06);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ttlens-pd-menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(1, 30, 96, 0.1);
}

.ttlens-pd-menu-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.ttlens-pd-menu-icon.is-camera { background: var(--pd-blue); }
.ttlens-pd-menu-icon.is-photo { background: var(--pd-green); }
.ttlens-pd-menu-icon.is-fit { background: var(--pd-purple); }

.ttlens-pd-menu-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ttlens-pd-menu-copy strong {
  color: var(--pd-navy);
  font-size: 15px;
}

.ttlens-pd-menu-copy small {
  color: #6b7385;
  font-size: 12px;
  line-height: 1.4;
}

.ttlens-pd-menu-card > .fa-angle-right {
  color: #a0a8b8;
  font-size: 20px;
}

/* —— Live camera shell —— */
.ttlens-pd-cam-shell {
  background: var(--pd-cam);
  border-radius: 14px;
  padding: 12px 12px 18px;
  color: #fff;
  box-shadow: 0 12px 36px rgba(1, 30, 96, 0.2);
}

.ttlens-pd-cam-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  min-height: 36px;
}

.ttlens-pd-back {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.ttlens-pd-gaze-live {
  color: #ff3b30;
  font-size: 18px;
  line-height: 1;
}

.ttlens-pd-cam-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ttlens-pd-flip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ttlens-pd-cam-meta strong {
  font-size: 15px;
  font-weight: 700;
  min-width: 58px;
  text-align: right;
}

.ttlens-pd-stage {
  position: relative;
  background: #000;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  max-height: min(62vh, 520px);
  margin: 0 auto;
}

.ttlens-pd-stage video,
.ttlens-pd-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ttlens-pd-stage video {
  transform: scaleX(-1);
}

.ttlens-pd-stage canvas {
  transform: scaleX(-1);
  pointer-events: none;
}

.ttlens-pd-overlay-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ttlens-pd-frame-corners {
  position: absolute;
  inset: 10% 14%;
  background:
    linear-gradient(#fff, #fff) left top / 28px 3px no-repeat,
    linear-gradient(#fff, #fff) left top / 3px 28px no-repeat,
    linear-gradient(#fff, #fff) right top / 28px 3px no-repeat,
    linear-gradient(#fff, #fff) right top / 3px 28px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 28px 3px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 3px 28px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 28px 3px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 3px 28px no-repeat;
}

.ttlens-pd-head-guide {
  position: absolute;
  left: 50%;
  top: 48%;
  /* Larger oval so face fills the guide (was 38% — too tight on phone) */
  width: 58%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 2.5px solid rgba(255, 255, 255, 0.88);
  border-radius: 50% 50% 46% 46% / 42% 42% 56% 56%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease;
}

.ttlens-pd-head-guide.is-ok {
  border-color: #7dffa0;
  box-shadow: 0 0 0 9999px rgba(0, 40, 0, 0.12);
}

.ttlens-pd-frame-corners.is-ok {
  background:
    linear-gradient(#7dffa0, #7dffa0) left top / 28px 3px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) left top / 3px 28px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) right top / 28px 3px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) right top / 3px 28px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) left bottom / 28px 3px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) left bottom / 3px 28px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) right bottom / 28px 3px no-repeat,
    linear-gradient(#7dffa0, #7dffa0) right bottom / 3px 28px no-repeat;
}

.ttlens-pd-prompt {
  margin: 14px 0 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  min-height: 22px;
}

.ttlens-pd-prompt[data-kind="warn"] { color: #ffcd00; }
.ttlens-pd-prompt[data-kind="error"] { color: #ff8a80; }
.ttlens-pd-prompt[data-kind="ok"] { color: #7dffa0; }

.ttlens-pd-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(280px, 100%);
  margin: 0 auto;
  appearance: none;
  border: 2px solid #fff;
  background: var(--pd-blue);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.ttlens-pd-estimate {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.ttlens-pd-scale-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

.ttlens-pd-scale-tag[data-mode="iris"],
.ttlens-pd-scale-tag[data-mode="fusion"] {
  color: #ffcd00;
}

.ttlens-pd-scale-tag[data-mode="card"] {
  color: #7dffa0;
}

.ttlens-pd-result-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e6;
  color: #7a5a10;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.ttlens-pd-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  margin: 14px 8px 0;
}

.ttlens-pd-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pd-yellow), #fff);
  transition: width 0.2s ease;
}

.ttlens-pd-live-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ttlens-pd-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.ttlens-pd-btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ttlens-pd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ttlens-pd-btn-primary {
  background: var(--pd-navy);
  color: #fff;
}

.ttlens-pd-btn-secondary {
  background: #fff;
  color: var(--pd-navy);
  border: 1px solid var(--pd-line);
}

.ttlens-pd-live-tools .ttlens-pd-btn-secondary {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ttlens-pd-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* —— Result —— */
.ttlens-pd-result-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 14px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(1, 30, 96, 0.08);
}

.ttlens-pd-result-card > .ttlens-pd-back {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #eef1f7;
  color: var(--pd-navy);
}

.ttlens-pd-result-label {
  margin: 8px 0 6px;
  color: #6b7385;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.ttlens-pd-result-value {
  margin: 0;
  color: var(--pd-navy);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
}

.ttlens-pd-result-unit {
  font-size: 22px;
  font-weight: 700;
}

.ttlens-pd-result-conf {
  display: inline-block;
  margin: 14px 0 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8f7ee;
  color: var(--pd-ok);
  font-size: 12px;
  font-weight: 700;
}

.ttlens-pd-result-conf[data-level="medium"] {
  background: #fff7e6;
  color: var(--pd-warn);
}

.ttlens-pd-result-conf[data-level="low"] {
  background: #fdecec;
  color: var(--pd-err);
}

.ttlens-pd-mono {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}

.ttlens-pd-mono div {
  padding: 12px;
  border: 1px solid var(--pd-line);
  border-radius: 10px;
  background: #fafbfe;
}

.ttlens-pd-mono small {
  display: block;
  color: #6b7385;
  font-size: 11px;
  margin-bottom: 4px;
}

.ttlens-pd-mono strong {
  color: var(--pd-navy);
  font-size: 18px;
}

.ttlens-pd-meta {
  margin: 0 0 18px;
  color: #667089;
  font-size: 12px;
  line-height: 1.5;
}

.ttlens-pd-result-card .ttlens-pd-btn {
  width: min(280px, 100%);
  margin: 0 auto 10px;
  display: block;
}

.ttlens-pd-btn-ghost {
  background: transparent;
  color: #b91c1c;
  border: 1px dashed #e0a3a3;
  font-weight: 600;
}

.ttlens-pd-btn-ghost:hover:not(:disabled) {
  background: #fdecec;
}

/* —— Placeholders —— */
.ttlens-pd-placeholder-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(1, 30, 96, 0.06);
}

.ttlens-pd-placeholder-card > .ttlens-pd-back,
.ttlens-pd-placeholder-head .ttlens-pd-back {
  position: static;
  flex: 0 0 auto;
  background: #eef1f7;
  color: var(--pd-navy);
  margin-right: 0;
}

.ttlens-pd-placeholder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ttlens-pd-placeholder-card h2 {
  margin: 0;
  color: var(--pd-navy);
  font-size: 20px;
  line-height: 1.3;
}

.ttlens-pd-placeholder-card p {
  color: #44506a;
  font-size: 14px;
  line-height: 1.6;
}

.ttlens-pd-upload {
  display: inline-flex;
  margin-top: 8px;
  padding: 12px 18px;
  background: var(--pd-green);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.ttlens-pd-upload input {
  display: none;
}

.ttlens-pd-soon {
  margin-top: 12px;
  font-size: 13px;
  color: var(--pd-warn);
}

/* —— Full-bleed camera (competitor style) —— */
.ttlens-pd-screen-cam {
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 12px 24px;
  box-sizing: border-box;
}

.ttlens-pd-cam-shell-full {
  background: #0a1a2e;
  border-radius: 14px;
  padding: 10px 10px 18px;
  min-height: 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.ttlens-pd.ttlens-pd--immersive.ttlens-pd--cam {
  background: #eef1f6;
  padding: 16px 0 32px;
}

.ttlens-pd.ttlens-pd--immersive.ttlens-pd--result {
  background: #0d2137;
  padding: 0;
}

.ttlens-pd-live-pd {
  font-size: 15px;
  font-weight: 700;
  min-width: 64px;
  text-align: right;
}

.ttlens-pd-flip-onstage {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.ttlens-pd-dist-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}

.ttlens-pd-live-tools {
  display: none;
}

/* —— Result report —— */
.ttlens-pd-screen-result {
  max-width: none;
  margin: 0;
  width: 100%;
}

.ttlens-pd-report {
  position: relative;
  background: #0d2137;
  color: #e8eef7;
  border-radius: 0;
  padding: 32px max(16px, calc((100% - 520px) / 2)) 40px;
  box-shadow: none;
  min-height: calc(100vh - 120px);
}

.ttlens-pd-report-back {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ttlens-pd-report-hero {
  text-align: center;
  padding-top: 8px;
}

.ttlens-pd-report-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff;
  color: #0d2137;
  font-size: 28px;
  font-weight: 800;
  line-height: 56px;
}

.ttlens-pd-report-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.ttlens-pd-report-sub {
  margin: 0 0 16px;
  color: #9aafc4;
  font-size: 14px;
}

.ttlens-pd-report-pill {
  display: inline-block;
  margin: 0 auto;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--pd-blue);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.ttlens-pd-report-pdlabel {
  margin: 10px 0 8px;
  color: #9aafc4;
  font-size: 13px;
}

.ttlens-pd-remeasure {
  margin: 0 0 8px;
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 700;
}

.ttlens-pd-report-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 12px auto 8px;
  max-width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
  color: #c5d3e3;
}

.ttlens-pd-report-split > div {
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.ttlens-pd-report-split > div:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.ttlens-pd-report-split strong {
  color: #fff;
  font-size: 15px;
}

.ttlens-pd-frame-box {
  margin: 22px 0 18px;
  padding: 16px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ttlens-pd-frame-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ttlens-pd-frame-box h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: #fff;
}

.ttlens-pd-why-btn {
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ttlens-pd-frame-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #e8eef8;
}

.ttlens-pd-frame-summary-pd {
  font-weight: 700;
  color: #fff;
}

.ttlens-pd-frame-summary-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffcd00;
  font-weight: 600;
}

.ttlens-pd-frame-summary-tip .fa-glasses {
  font-size: 15px;
  color: #ffcd00;
}

.ttlens-pd-frame-table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
}

.ttlens-pd-frame-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #d5e0ec;
}

.ttlens-pd-frame-table th,
.ttlens-pd-frame-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.ttlens-pd-frame-table th {
  color: #9aafc4;
  font-weight: 600;
}

.ttlens-pd-frame-table th small {
  font-weight: 500;
  opacity: 0.8;
}

.ttlens-pd-frame-row--rec td {
  background: rgba(59, 130, 246, 0.16);
  border-bottom-color: rgba(59, 130, 246, 0.35);
}

.ttlens-pd-frame-row--rec td:first-child {
  border-left: 3px solid #3b82f6;
}

.ttlens-pd-frame-badge {
  display: inline-block;
  color: #cfe2ff;
  font-weight: 700;
}

.ttlens-pd-frame-extra {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #b8c8d9;
}

.ttlens-pd-frame-extra strong {
  color: #fff;
}

.ttlens-pd-report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  max-width: 420px;
  margin: 8px auto 0;
  width: 100%;
}

.ttlens-pd-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  border: 0;
  box-sizing: border-box;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ttlens-pd-action:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.ttlens-pd-action-primary {
  background: #1a73e8;
  color: #fff;
}

.ttlens-pd-action-light {
  background: #fff;
  color: #0d2137;
}

.ttlens-pd-action-ghost {
  background: transparent;
  color: #e8eef7;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.ttlens-pd-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ttlens-pd-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  color: #9aafc4;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.ttlens-pd-home-link:hover {
  color: #fff;
  text-decoration: none;
}

.ttlens-pd-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

/* Why modal */
.ttlens-pd-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 10, 30, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.ttlens-pd-modal-card {
  position: relative;
  width: min(480px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: #1a334f;
  color: #e8eef7;
  border-radius: 14px;
  padding: 22px 18px 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.ttlens-pd-modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.ttlens-pd-modal-card h3 {
  margin: 0 40px 12px 0;
  font-size: 17px;
  color: #fff;
}

.ttlens-pd-modal-body {
  font-size: 13px;
  line-height: 1.65;
  color: #c5d3e3;
}

.ttlens-pd-modal-body p {
  margin: 0 0 10px;
}

.ttlens-pd-modal-body code {
  font-size: 12px;
  color: #ffcd00;
}

.ttlens-pd-modal-cite {
  font-size: 11.5px;
  color: #8fa3b8;
}

/* Ẩn widget nổi khi đang đo / xem kết quả (tránh đè nút) */
body.ttlens-pd-body-immersive .mv-floating,
body.ttlens-pd-body-immersive .scrollToTop {
  opacity: 0.12;
  pointer-events: none;
}

@media (max-width: 640px) {
  .ttlens-pd {
    padding: 0 10px 20px;
    margin-bottom: 24px;
  }

  .ttlens-pd-phone-preview {
    grid-template-columns: 1fr;
  }

  .ttlens-pd-phone-screen {
    max-width: 220px;
    margin: 0 auto;
  }

  .ttlens-pd-illus {
    margin-bottom: 8px;
  }

  .ttlens-pd-guide-steps li {
    font-size: 13px;
    padding-left: 30px;
  }

  .ttlens-pd-menu-card {
    padding: 14px 12px;
    min-height: 64px;
  }

  .ttlens-pd-menu-icon {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .ttlens-pd.ttlens-pd--immersive.ttlens-pd--cam {
    padding: 8px 0 20px;
  }

  .ttlens-pd-screen-cam {
    max-width: none;
    width: 100%;
    padding: 0 10px 16px;
  }

  .ttlens-pd-cam-shell-full {
    border-radius: 12px;
    padding: 8px 8px 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .ttlens-pd-stage {
    aspect-ratio: 3 / 4;
    max-height: min(58vh, 480px);
    width: 100%;
  }

  .ttlens-pd-cam-top {
    min-height: 44px;
    margin-bottom: 6px;
  }

  .ttlens-pd-back {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .ttlens-pd-stop-btn {
    width: 100%;
    max-width: none;
    min-height: 48px;
    font-size: 16px;
    border-radius: 12px;
  }

  .ttlens-pd-prompt {
    font-size: 14px;
    margin: 10px 0 8px;
    padding: 0 4px;
  }

  .ttlens-pd-estimate {
    font-size: 13px;
  }

  .ttlens-pd-flip-onstage {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .ttlens-pd-report {
    min-height: auto;
    padding: 24px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .ttlens-pd-report-pill {
    font-size: 24px;
    padding: 10px 22px;
  }

  .ttlens-pd-report-hero h2 {
    font-size: 20px;
  }

  .ttlens-pd-frame-table {
    font-size: 11px;
  }

  .ttlens-pd-frame-table th,
  .ttlens-pd-frame-table td {
    padding: 7px 4px;
  }

  .ttlens-pd-action {
    min-height: 48px;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  .ttlens-pd-action-row {
    gap: 8px;
  }

  .ttlens-pd-modal-card {
    max-height: 85vh;
    padding: 20px 14px 16px;
  }

  .ttlens-pd-result-value {
    font-size: 44px;
  }

  .ttlens-pd-guide-box h1 {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .ttlens-pd-frame-table th:last-child,
  .ttlens-pd-frame-table td:last-child {
    min-width: 88px;
  }

  .ttlens-pd-report-split {
    font-size: 12px;
  }
}
