:root {
  --repair-bg: #ffffff;
  --repair-surface: #f5f5f7;
  --repair-text: #1d1d1f;
  --repair-muted: #86868b;
  --repair-line: #d2d2d7;
  --repair-blue: #0071e3;
  --repair-blue-soft: #f0f7ff;
  --repair-danger: #b3261e;
}

html:has(.repair-flow-page) {
  background: var(--repair-bg);
}

body.repair-flow-page {
  --primary: var(--repair-blue);
  --primary-dark: #005bb5;
  --primary-soft: var(--repair-blue-soft);
  min-width: 320px;
  background: var(--repair-bg);
  color: var(--repair-text);
  font-family: "SF Pro Text", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.012em;
}

.repair-flow-page .page-shell {
  display: block;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) 24px max(40px, env(safe-area-inset-bottom));
}

.repair-flow-page .repair-page {
  width: min(100%, 560px);
  margin: 0 auto;
}

.flow-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.flow-back-link {
  color: var(--repair-blue);
  font-size: 17px;
  font-weight: 520;
  text-decoration: none;
}

.flow-back-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.flow-progress {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin: 0;
  color: var(--repair-text);
  font-size: 17px;
}

.flow-progress strong {
  color: var(--repair-blue);
  font-size: 19px;
  font-weight: 620;
}

.flow-progress span:last-child,
.flow-progress span:nth-last-child(2) {
  color: var(--repair-muted);
}

.flow-next-hint {
  margin: 24px 0 0;
  color: var(--repair-muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: right;
}

.repair-flow-page .flow-auth-state {
  display: block;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.repair-flow-page .flow-auth-state p {
  margin: 0;
  color: var(--repair-muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.repair-flow-page .flow-auth-state.is-warning p,
.repair-flow-page .flow-auth-state.is-error p {
  color: var(--repair-danger);
}

.repair-flow-page .repair-flow-form {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.flow-step {
  padding: 0 2px;
  animation: flow-step-in 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.flow-step[hidden] {
  display: none;
}

@keyframes flow-step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flow-step-header {
  margin: 64px 0 56px;
}

.flow-step-header h1 {
  max-width: 470px;
  margin: 0;
  color: var(--repair-text);
  font-family: "SF Pro Display", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  font-size: clamp(42px, 11vw, 58px);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1.04;
}

.flow-step-kicker {
  margin: 0 0 16px;
  color: var(--repair-muted);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.03em;
}

.flow-line-field,
.flow-text-field {
  display: grid;
  gap: 10px;
}

.flow-line-field {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--repair-line);
}

.flow-line-field .field-label,
.flow-text-field .field-label {
  color: var(--repair-text);
  font-size: 15px;
  font-weight: 560;
}

.flow-line-field input {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--repair-text);
  font-size: 20px;
  font-weight: 430;
  outline: none;
}

.flow-line-field input::placeholder,
.flow-text-field textarea::placeholder {
  color: #a1a1a6;
}

.flow-line-field input:focus {
  border: 0;
  box-shadow: none;
}

.field-error {
  min-height: 0;
  color: var(--repair-danger);
  font-size: 12px;
  line-height: 1.35;
}

.field-error:empty {
  display: none;
}

.issue-selector {
  display: grid;
  margin: 56px 0 48px;
  padding: 0;
  border: 0;
}

.issue-selector legend {
  margin-bottom: 14px;
  padding: 0;
  color: var(--repair-text);
  font-size: 15px;
  font-weight: 560;
}

.issue-option {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 14px;
  border-bottom: 1px solid var(--repair-line);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, border-radius 160ms ease;
}

.issue-option:has(input:checked) {
  z-index: 1;
  margin: -1px 0 0;
  border: 1px solid var(--repair-blue);
  border-radius: 12px;
  background: var(--repair-blue-soft);
}

.issue-option span {
  color: var(--repair-text);
  font-size: 18px;
  font-weight: 470;
}

.issue-option input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--repair-blue);
}

.issue-option:focus-within {
  outline: 3px solid rgba(0, 113, 227, 0.15);
  outline-offset: 2px;
}

.textarea-shell {
  position: relative;
}

.flow-text-field textarea {
  width: 100%;
  min-height: 142px;
  padding: 16px 16px 34px;
  resize: vertical;
  border: 1px solid var(--repair-line);
  border-radius: 12px;
  background: var(--repair-bg);
  color: var(--repair-text);
  font-size: 16px;
  line-height: 1.55;
  outline: none;
}

.flow-text-field textarea:focus {
  border-color: var(--repair-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.character-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--repair-muted);
  font-size: 12px;
}

.flow-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
}

.flow-actions-end {
  justify-content: flex-end;
}

.flow-primary-button,
.flow-secondary-button {
  min-height: 52px;
  padding: 0 28px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 560;
  cursor: pointer;
}

.flow-primary-button {
  border: 1px solid var(--repair-blue);
  background: var(--repair-blue);
  color: #ffffff;
}

.flow-primary-button:hover {
  background: #0068d1;
}

.flow-primary-button:active {
  transform: translateY(1px);
}

.flow-primary-button:focus-visible,
.flow-secondary-button:focus-visible,
.file-picker:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.2);
  outline-offset: 3px;
}

.flow-primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.flow-secondary-button {
  padding-inline: 0;
  border: 0;
  background: transparent;
  color: var(--repair-blue);
}

.flow-section {
  padding: 30px 0;
  border-top: 1px solid var(--repair-line);
}

.flow-section:first-of-type {
  border-top: 0;
}

.flow-section h2 {
  margin: 0;
  color: var(--repair-text);
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.025em;
}

.flow-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.flow-section-heading p {
  max-width: 300px;
  margin: 8px 0 0;
  color: var(--repair-muted);
  font-size: 13px;
  line-height: 1.5;
}

.file-picker {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--repair-surface);
  color: var(--repair-blue);
  font-size: 14px;
  font-weight: 580;
  cursor: pointer;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.repair-flow-page .empty-inline {
  margin-top: 20px;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--repair-line);
  border-radius: 0;
  background: transparent;
  color: var(--repair-muted);
  text-align: left;
}

.receiver-section {
  display: grid;
  gap: 28px;
}

.receiver-section h2 {
  margin-bottom: 4px;
}

.review-list {
  border-top: 1px solid var(--repair-line);
}

.review-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--repair-line);
}

.review-row span {
  color: var(--repair-muted);
  font-size: 14px;
}

.review-row strong {
  overflow-wrap: anywhere;
  color: var(--repair-text);
  font-size: 15px;
  font-weight: 540;
  text-align: right;
}

.review-row-address strong {
  line-height: 1.5;
}

.flow-optional {
  margin-top: 32px;
  border: 0;
  border-bottom: 1px solid var(--repair-line);
  background: transparent;
}

.flow-optional > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0;
  list-style: none;
  cursor: pointer;
}

.flow-optional > summary::-webkit-details-marker {
  display: none;
}

.flow-optional > summary span {
  display: grid;
  gap: 4px;
}

.flow-optional > summary strong {
  color: var(--repair-text);
  font-size: 16px;
  font-weight: 580;
}

.flow-optional > summary small,
.flow-optional > summary b {
  color: var(--repair-muted);
  font-size: 12px;
  font-weight: 500;
}

.flow-optional > .optional-step-body {
  display: grid;
  gap: 28px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--repair-line);
}

.flow-result-panel {
  margin: 72px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.flow-result-panel h2 {
  margin: 0 0 32px;
  color: var(--repair-text);
  font-family: "SF Pro Display", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  font-size: clamp(36px, 10vw, 52px);
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.repair-flow-page .success-summary {
  padding: 20px 0;
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
}

.repair-flow-page .result-actions {
  margin-top: 32px;
}

.repair-flow-page .result-actions a {
  border-radius: 10px;
}

.repair-flow-page .selected-attachment-panel {
  margin-top: 20px;
}

.repair-flow-page .selected-attachment-summary {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--repair-muted);
  font-weight: 520;
}

.repair-flow-page .selected-attachment-card {
  grid-template-columns: 72px minmax(0, 1fr);
  padding: 14px 0;
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
}

.repair-flow-page .attachment-preview {
  min-height: 72px;
  border-radius: 8px;
}

.repair-flow-page .attachment-remove-button {
  border-color: transparent;
  background: transparent;
  color: var(--repair-blue);
}

.repair-flow-page .attachment-tag {
  border-radius: 6px;
  background: var(--repair-surface);
  color: var(--repair-muted);
  font-weight: 520;
}

@media (min-width: 760px) {
  .repair-flow-page .page-shell {
    padding-top: 44px;
  }

  .repair-flow-page .repair-page {
    margin-left: max(7vw, calc((100vw - 980px) / 2));
  }
}

@media (max-width: 480px) {
  .repair-flow-page .page-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .flow-step-header {
    margin-top: 58px;
    margin-bottom: 48px;
  }

  .flow-step-header h1 {
    font-size: clamp(40px, 12vw, 50px);
  }

  .flow-next-hint {
    max-width: 240px;
    margin-left: auto;
  }

  .flow-actions {
    margin-top: 42px;
  }

  .flow-section-heading {
    align-items: flex-end;
  }
}

@media (max-width: 360px) {
  .repair-flow-page .page-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .flow-step-header h1 {
    font-size: 39px;
  }

  .review-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-step {
    animation: none;
  }
}
/* 390x844 fidelity pass */
@media (max-width: 480px) {
  .repair-flow-page .page-shell {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-right: 24px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    padding-left: 24px;
  }

  .flow-next-hint {
    margin-top: 16px;
    font-size: 13px;
  }

  .repair-flow-page .flow-auth-state {
    margin-top: 4px;
  }

  .repair-flow-page .flow-auth-state p {
    font-size: 10px;
  }

  .flow-step-header {
    margin-top: 36px;
    margin-bottom: 30px;
  }

  .flow-step-header h1 {
    font-size: 44px;
  }

  .flow-line-field {
    gap: 6px;
    padding-bottom: 16px;
  }

  .flow-line-field input {
    min-height: 36px;
    font-size: 18px;
  }

  .issue-selector {
    margin-top: 34px;
    margin-bottom: 28px;
  }

  .issue-selector legend {
    margin-bottom: 10px;
  }

  .issue-option {
    min-height: 52px;
  }

  .issue-option span {
    font-size: 17px;
  }

  .flow-text-field textarea {
    min-height: 112px;
  }

  .flow-actions {
    margin-top: 30px;
  }

  .flow-primary-button,
  .flow-secondary-button {
    min-height: 48px;
  }
}

/* 20260727 Apple quiet repair flow */
.repair-flow-page,
.repair-flow-page button,
.repair-flow-page input,
.repair-flow-page textarea {
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  letter-spacing: -0.01em;
}

.repair-flow-page {
  background: #ffffff !important;
  color: #1d1d1f !important;
}

.repair-flow-page .repair-page {
  width: min(100%, 680px) !important;
}

.flow-next-hint,
.flow-step-kicker,
.optional-step summary small,
.flow-result-panel .success-note {
  display: none !important;
}

.repair-flow-page .flow-topbar {
  padding-bottom: 16px !important;
  border-bottom: 1px solid #d2d2d7 !important;
}

.repair-flow-page .flow-auth-state {
  min-height: 0 !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #6e6e73 !important;
}

.repair-flow-page .flow-auth-state p {
  font-size: 13px !important;
}

.repair-flow-page .flow-auth-state.is-warning,
.repair-flow-page .flow-auth-state.is-error {
  margin-top: 16px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
}

.flow-step-header {
  margin-top: 34px !important;
  margin-bottom: 34px !important;
}

.flow-step-header h1,
.flow-result-panel h2 {
  max-width: 620px;
  color: #1d1d1f !important;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-size: clamp(38px, 8vw, 54px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.05em !important;
}

.flow-line-field,
.flow-text-field,
.issue-selector,
.flow-section,
.review-list,
.flow-optional {
  border-color: #d2d2d7 !important;
  box-shadow: none !important;
}

.flow-section,
.review-list,
.flow-optional {
  border-radius: 18px !important;
}

.flow-section-heading p {
  color: #6e6e73 !important;
  font-size: 13px !important;
}

.flow-primary-button,
.flow-secondary-button,
.file-picker,
.result-actions a {
  border-radius: 999px !important;
  box-shadow: none !important;
}

.flow-actions {
  margin-top: 36px !important;
}

.issue-option {
  min-height: 56px !important;
}

.character-count,
.field-hint {
  color: #6e6e73 !important;
  font-size: 12px !important;
}

@media (max-width: 480px) {
  .repair-flow-page .page-shell {
    padding: max(20px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)) !important;
  }

  .flow-step-header {
    margin-top: 28px !important;
    margin-bottom: 28px !important;
  }

  .flow-step-header h1,
  .flow-result-panel h2 {
    font-size: 40px !important;
  }
}
