:root {
  --green: #28a745;
  --green-soft: #e8f5eb;
  --text: #1a1a1a;
  --muted: #8e8e93;
  --border: #e0e0e0;
  --bg: #ffffff;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --pad-x: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px var(--pad-x) 40px;
  background: var(--bg);
}

.app-shell--state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40vh;
}

.state-message {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.screen {
  display: flex;
  flex-direction: column;
}

.screen--gallery {
  position: relative;
}

.screen--unified.screen--gallery-photo-open .gallery-grid,
.screen--gallery-photo-open .gallery-grid {
  pointer-events: none;
  opacity: 0;
}

.screen--unified.screen--gallery-photo-open #gallery .gallery-section__lead,
.screen--unified.screen--gallery-photo-open #gallery .gallery-section__hint,
.screen--gallery-photo-open #gallery .gallery-section__lead,
.screen--gallery-photo-open #gallery .gallery-section__hint {
  visibility: hidden;
}

.photo-inspect-overlay {
  /* Fixed to visual viewport: absolute + inset:0 on unified report matched full
     document height while window stayed at galleryScrollY (iOS Safari → wrong slice). */
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-width: 430px;
  margin: 0 auto;
  left: 0;
  right: 0;
  overflow: hidden;
}

html.body--inspect-open,
html.body--inspect-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.brand-block {
  text-align: center;
  padding: 4px 0 12px;
}

.store-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.wordmark {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.wordmark__check {
  color: var(--green);
}

.wordmark__go {
  color: var(--text);
}

.device-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 6px 0 14px;
  width: 100%;
}

.device-hero__hit {
  margin: 0;
  cursor: pointer;
  outline: none;
  text-align: center;
  width: 100%;
  max-width: 100%;
}

.device-hero__hit:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

.device-model {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: center;
}

.device-spec {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.date-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.date-card__body {
  flex: 1;
  min-width: 0;
}

.date-card__label {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.date-card__value {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.date-card__value--na {
  font-weight: 500;
  color: var(--muted);
}

.section-heading {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
}

.status-row {
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #ececec;
  background: var(--bg);
}

.status-row--last {
  border-bottom: none;
}

.status-row__text {
  min-width: 0;
}

.status-row__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.status-row__value {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}

.status-row__value--ok {
  color: var(--green);
}

.status-row__value--neutral {
  color: var(--text);
  font-weight: 500;
}

.status-row__value--caution {
  color: #9a5b00;
  font-weight: 600;
}

.status-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.status-mark--ok {
  background: var(--green);
}

.status-mark--muted {
  background: #d1d1d6;
  color: #fff;
}

.status-mark--caution {
  background: #f5e6c8;
  color: #9a5b00;
  font-weight: 800;
}

.status-mark--info {
  background: #e8e8ed;
  color: #636366;
  font-size: 11px;
  font-style: italic;
  font-weight: 600;
}

.status-mark-slot {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-card__label--spaced {
  margin-top: 8px;
}

.gallery-section {
  margin: 22px 0 28px;
}

.gallery-section__lead {
  margin: 0 0 4px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.gallery-section__hint {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.photo-inspect__loupe-hint {
  margin: 0;
  padding: 0 var(--pad-x) 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.sub-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin: 0 calc(-1 * var(--pad-x)) 12px;
  padding: 2px var(--pad-x) 6px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}

.sub-header__title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.back-button {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}

.back-button:active {
  opacity: 0.6;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 11px;
}

.gallery-cell {
  margin: 0;
}

.gallery-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fafafa;
  aspect-ratio: 4 / 5;
}

.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.gallery-frame img.gallery-frame__img--pending {
  opacity: 0;
}

.gallery-frame img.gallery-frame__img--ready {
  opacity: 1;
}

.gallery-frame img.gallery-frame__img--failed {
  display: none;
}

.gallery-frame__retry {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px;
  font-size: 13px;
  color: var(--muted, #6b7280);
  text-align: center;
}

.gallery-frame--failed .gallery-frame__retry {
  display: flex;
}

.gallery-frame--tap {
  cursor: pointer;
}

.gallery-cell:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.report-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 8px;
  padding: 0;
}

.report-links__btn {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-links__btn:active {
  opacity: 0.65;
}

.report-links__sep {
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}

.photo-inspect__label {
  margin: 0 0 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.photo-loupe-viewport {
  flex: 1;
  min-height: min(72vh, 640px);
  margin: 0 calc(-1 * var(--pad-x));
  padding: 16px var(--pad-x);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.photo-loupe-surface {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: 72vh;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.photo-loupe-stack {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.photo-loupe-stack .photo-loupe-image--preview {
  position: relative;
  z-index: 1;
}

.photo-loupe-stack .photo-loupe-image--original {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
}

.photo-loupe-stack .photo-loupe-image--original.photo-loupe-image--original-loading {
  /* PS4 dual-layer: keep preview as the only visible tier until decode completes. */
  opacity: 0;
}

.photo-loupe-stack .photo-loupe-image--original.photo-loupe-image--ready {
  opacity: 1;
}

.photo-loupe-stack:has(.photo-loupe-image--original.photo-loupe-image--ready)
  .photo-loupe-image--preview {
  opacity: 0;
  visibility: hidden;
}

.photo-loupe-image.photo-loupe-image--pending {
  opacity: 0;
}

.photo-loupe-image.photo-loupe-image--preview,
.photo-loupe-image.photo-loupe-image--ready {
  opacity: 1;
}

.photo-loupe-image.photo-loupe-image--failed {
  opacity: 0.25;
}

.photo-loupe-image.photo-loupe-image--original-failed {
  opacity: 1;
}

.photo-loupe-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: none;
}

.photo-loupe-lens {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 120px;
  height: 120px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.05s linear;
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.27);
  border: 1.25px solid rgba(0, 0, 0, 0.5);
  background: #fff;
  overflow: hidden;
}

.photo-loupe-lens--visible {
  opacity: 1;
}

.photo-loupe-lens canvas {
  display: block;
  width: 120px;
  height: 120px;
}

.photo-loupe-lens__tier {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  user-select: none;
}

.photo-loupe-lens.photo-loupe-lens--preview-tier .photo-loupe-lens__tier {
  display: block;
}

.gallery-cell figcaption {
  margin-top: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.detail-card {
  margin: 0 0 24px;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid #ebebeb;
}

.detail-row:first-child {
  border-top: none;
}

.detail-row__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.detail-row__value {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  color: var(--text);
  flex-shrink: 0;
}

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

.verify-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  min-height: 34px;
}

.verify-chip__mark {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.service-line {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.report-section {
  scroll-margin-top: 8px;
  margin-top: 20px;
}

.report-section#section-dis-gorunum {
  margin-top: 22px;
}

.report-section#section-ozellikler,
.report-section#section-degisen-parcalar,
.report-section#section-apple-gecmis {
  margin-top: 18px;
}

.report-section__card {
  margin-bottom: 0;
}

#section-cihaz-bilgileri .chip-grid {
  margin-bottom: 8px;
}

.report-section .section-heading--sub {
  margin-top: 14px;
}

.report-paragraph {
  margin: 0;
  padding: 10px 15px 4px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.report-line {
  margin: 0;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
}

.report-line--ok {
  color: var(--green);
  font-weight: 600;
}

.report-line--issue {
  font-weight: 600;
}

.report-line--muted {
  color: var(--muted);
}

.report-line--neutral {
  color: var(--muted);
  font-weight: 500;
}

.report-field-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  align-items: start;
  padding: 10px 15px;
  border-top: 1px solid #ebebeb;
  font-size: 15px;
  line-height: 1.35;
}

.report-field-row:first-child {
  border-top: none;
}

.report-field-row--heading {
  grid-template-columns: 1fr;
  padding-bottom: 2px;
}

.report-field-row__label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.report-field-row__value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.report-field-row__value--neutral {
  color: var(--muted);
  font-weight: 500;
}

.report-compact-row {
  display: grid;
  grid-template-columns: 1.1fr 0.75fr 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px 15px;
  border-top: 1px solid #ebebeb;
  font-size: 14px;
  line-height: 1.35;
}

.report-compact-row:first-child {
  border-top: none;
}

.report-compact-row__part {
  font-weight: 600;
  color: var(--text);
}

.report-compact-row__action {
  color: var(--text);
  font-weight: 500;
}

.report-compact-row__meta {
  color: var(--muted);
  text-align: right;
  font-weight: 500;
}

.report-feature-row--issue .report-feature-row__value {
  color: #c44;
  font-weight: 600;
}

.report-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-top: 1px solid #ebebeb;
  font-size: 15px;
}

.report-feature-row--detail {
  flex-wrap: wrap;
}

.report-feature-row__detail {
  flex-basis: 100%;
  padding-left: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.report-feature-row:first-child {
  border-top: none;
}

.report-feature-row__value--ok {
  color: var(--green);
  font-weight: 600;
}

.report-defect {
  border-top: 1px solid #ebebeb;
  padding-bottom: 6px;
}

.report-defect__link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 15px 10px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

.icon-face {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2328a745' stroke-width='1.5'%3E%3Crect x='5' y='3' width='14' height='18' rx='3'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3Cpath d='M8.5 15.5c1.2 1.4 5.8 1.4 7 0'/%3E%3C/svg%3E");
}

.icon-battery {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2328a745' stroke-width='1.5'%3E%3Crect x='3' y='7' width='16' height='10' rx='2'/%3E%3Cpath d='M21 10v4' stroke-linecap='round'/%3E%3Cpath d='M7 10.5h7v3H7z' fill='%2328a745' stroke='none'/%3E%3C/svg%3E");
}

.icon-shield {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2328a745' stroke-width='1.5'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6l7-3z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
}

.icon-phone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2328a745' stroke-width='1.5'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Ccircle cx='12' cy='18' r='1' fill='%2328a745'/%3E%3C/svg%3E");
}

.icon-cosmetic {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2328a745' stroke-width='1.5'%3E%3Cpath d='M12 3l2.2 4.5 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5L4.8 8.2l5-.7L12 3z'/%3E%3C/svg%3E");
}

.icon-calendar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M4 10h16'/%3E%3C/svg%3E");
}

.icon-info-model,
.icon-info-capacity,
.icon-info-color,
.icon-info-battery,
.icon-info-shield,
.icon-info-calendar {
  width: 20px;
  height: 20px;
  background-size: 18px 18px;
  opacity: 0.45;
}

.icon-info-model {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3C/svg%3E");
}

.icon-info-capacity {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Cpath d='M4 7h16v10H4z'/%3E%3Cpath d='M8 7V5h8v2'/%3E%3C/svg%3E");
}

.icon-info-color {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3C/svg%3E");
}

.icon-info-battery {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Crect x='3' y='7' width='16' height='10' rx='2'/%3E%3Cpath d='M21 10v4'/%3E%3C/svg%3E");
}

.icon-info-shield {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6l7-3z'/%3E%3C/svg%3E");
}

.icon-info-calendar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='1.5'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M4 10h16'/%3E%3C/svg%3E");
}

@media (max-width: 360px) {
  .device-model {
    font-size: 24px;
  }

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