:root {
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-bg: #f5f5f7;
  --apple-card: #ffffff;
  --apple-text: #1d1d1f;
  --apple-secondary: #6e6e73;
  --apple-separator: rgba(60, 60, 67, 0.16);
  --apple-card-radius: 24px;
  --bg: #eef8f5;
  --panel: #ffffff;
  --panel-soft: #f2faf7;
  --text: #17211f;
  --muted: #727d7a;
  --line: #dfe8e5;
  --brand: #0071e3;
  --brand-dark: #005bb5;
  --brand-soft: #e8f2ff;
  --selected: #e11d48;
  --danger: #0b6b58;
  --shadow: 0 16px 42px rgba(6, 78, 59, 0.13);
  --form-control-height: 50px;
  --form-control-radius: 14px;
  --form-control-bg: #f5faf8;
  --form-control-border: rgba(6, 78, 59, 0.16);
  --form-control-placeholder: #82918d;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 6%, rgba(8, 125, 104, 0.14), transparent 28%),
    linear-gradient(180deg, #f7fffc, var(--bg));
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.mobile-shell :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea
) {
  width: 100%;
  min-width: 0;
  min-height: var(--form-control-height);
  border: 1px solid var(--form-control-border);
  border-radius: var(--form-control-radius);
  padding: 0 15px;
  outline: 0;
  color: var(--text);
  background-color: var(--form-control-bg);
  box-shadow: inset 0 1px 2px rgba(6, 78, 59, 0.025), 0 1px 0 rgba(255, 255, 255, 0.88);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, opacity .18s ease;
}

.mobile-shell :where(select) {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23087d68' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.mobile-shell :where(textarea) {
  min-height: 116px;
  padding-top: 14px;
  padding-bottom: 14px;
  line-height: 1.55;
  resize: vertical;
}

.mobile-shell :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea
):focus-visible {
  border-color: var(--brand);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(8, 125, 104, 0.14), 0 5px 15px rgba(8, 125, 104, 0.07);
}

.mobile-shell :where(input, textarea)::placeholder {
  color: var(--form-control-placeholder);
  opacity: 1;
}

.mobile-shell :where(input, select, textarea):disabled {
  cursor: not-allowed;
  color: #8d9a96;
  background-color: #edf3f1;
  box-shadow: none;
  opacity: .7;
}

.mobile-shell input:-webkit-autofill,
.mobile-shell input:-webkit-autofill:hover,
.mobile-shell input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--form-control-bg) inset;
  caret-color: var(--text);
}

.app {
  min-height: 100vh;
}

.login-page,
.mobile-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fbfefd;
  border-left: 1px solid rgba(6, 78, 59, 0.14);
  border-right: 1px solid rgba(6, 78, 59, 0.14);
}

.login-page {
  display: grid;
  place-items: stretch;
  padding: 12px;
  background:
    radial-gradient(circle at 16% 12%, rgba(41, 214, 226, 0.2), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(255, 209, 77, 0.2), transparent 22%),
    linear-gradient(180deg, #fff7ee 0%, #f4fbff 100%);
}

.login-card {
  min-height: calc(100vh - 24px);
  padding: 18px 18px 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 6%, rgba(255, 209, 77, 0.2), transparent 16%),
    linear-gradient(180deg, #fff4e9 0%, #fffaf4 48%, #eefbff 100%);
  color: #123047;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  box-shadow: 0 18px 46px rgba(20, 54, 72, 0.14);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 52, 72, 0.08);
}

.login-card-approved-cover {
  min-height: calc(100vh - 24px);
  padding: 0;
  background: #fff7ee;
  display: block;
}

.login-card::after {
  content: "";
  position: absolute;
  left: -16%;
  right: -12%;
  bottom: -5%;
  height: 180px;
  background:
    radial-gradient(circle at 30% 50%, rgba(41, 214, 226, 0.18), transparent 36%),
    radial-gradient(circle at 74% 26%, rgba(255, 209, 77, 0.22), transparent 34%);
  opacity: 0.95;
  pointer-events: none;
}

.login-card-approved-cover::after {
  content: normal;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.login-hero-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: clamp(300px, 48vh, 405px);
  object-fit: cover;
  object-position: top center;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(17, 57, 77, 0.12);
  background: #fff7ee;
}

.login-cover-page-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #fff7ee;
}

.brand-logo-header {
  width: 54px;
  height: 62px;
  margin: 0 auto;
  border-radius: 8px;
}

.google-signin-host {
  width: 100%;
  max-width: 350px;
  min-height: 48px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.login-card-approved-cover .google-signin-host {
  position: absolute;
  z-index: 3;
  top: 38.6%;
  left: 13%;
  width: 74%;
  max-width: none;
  min-height: 48px;
  margin: 0;
}

.local-test-login-button {
  position: absolute;
  z-index: 3;
  top: 47%;
  left: 13%;
  width: 74%;
  min-height: 46px;
  border: 1px solid rgba(23, 99, 60, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #17633c;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.local-test-login-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 780;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, #0a9277, var(--brand));
  box-shadow: 0 10px 20px rgba(8, 125, 104, 0.18);
}

.secondary-button {
  color: var(--brand-dark);
  background: #fff;
  border-color: #b9ded1;
}

.title-loading-dots,
.button-loading-dots,
.generation-loading-dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  margin-left: 2px;
}

.title-loading-dots span,
.button-loading-dots span,
.generation-loading-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: titleDotBounce 0.9s ease-in-out infinite;
}

.title-loading-dots span:nth-child(2),
.button-loading-dots span:nth-child(2),
.generation-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.title-loading-dots span:nth-child(3),
.button-loading-dots span:nth-child(3),
.generation-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes titleDotBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.ghost-button {
  color: var(--brand);
  background: transparent;
}

.danger-button {
  width: 100%;
  color: var(--brand-dark);
  background: #eef8f4;
  border-color: #cce7dc;
}

.full-width {
  width: 100%;
}

.mobile-shell {
  position: relative;
  padding-bottom: 84px;
}

.mobile-content {
  min-height: calc(100vh - 84px);
  padding: 14px 14px calc(112px + env(safe-area-inset-bottom));
}

.mobile-app-header,
.page-header {
  min-height: 54px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.mobile-app-header h2,
.page-header h2 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brand);
  font-size: 24px;
  font-weight: 900;
}

.mobile-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  transform: translateX(-50%);
  height: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(6,78,59,0.08);
  z-index: 20;
}

.mobile-bottom-nav button {
  border: 0;
  background: transparent;
  color: #6e7775;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
}

.mobile-bottom-nav span {
  font-size: 20px;
  line-height: 1;
}

.mobile-bottom-nav button.active {
  color: var(--brand);
}

.notice {
  border: 1px solid #b9ded1;
  background: #f0faf6;
  color: var(--brand-dark);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 6px 0 14px;
}

.step {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #8a9390;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
}

.step-number {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #d8e0de;
  color: transparent;
  overflow: hidden;
}

.step.active {
  color: var(--brand);
}

.step.active .step-number {
  background: var(--brand);
}

.mobile-card,
.task-card,
.profile-card,
.account-panel,
.creation-tools,
.package-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(6, 78, 59, 0.06);
}

.step-card {
  min-height: 540px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.step-card h3,
.account-panel h3,
.page-header h2 {
  letter-spacing: 0;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.step-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.field label {
  font-size: 14px;
  font-weight: 820;
}

.field input,
.field select {
  width: 100%;
  min-height: var(--form-control-height);
  border: 1px solid var(--form-control-border);
  border-radius: var(--form-control-radius);
  padding: 0 14px;
  background: var(--form-control-bg);
  color: var(--text);
}

.profile-edit-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.profile-edit-form h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.profile-edit-form p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.form-field label {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.form-field input {
  width: 100%;
  min-width: 0;
  min-height: var(--form-control-height);
  border: 1px solid var(--form-control-border);
  border-radius: var(--form-control-radius);
  padding: 0 14px;
  background: var(--form-control-bg);
  color: var(--text);
}

.profile-edit-actions {
  margin-top: 4px;
}

.helper {
  color: var(--muted);
  font-size: 13px;
}

.text-count {
  text-align: right;
}

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

.candidate-list,
.tasks-list,
.package-list,
.action-option-list {
  display: grid;
  gap: 10px;
}

.custom-title-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f5f5f7;
}

.custom-title-card label {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

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

.custom-title-card .helper {
  text-align: right;
}

.custom-title-card .secondary-button {
  width: 100%;
}

.title-choice-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.title-choice-divider::before,
.title-choice-divider::after {
  width: 100%;
  height: 1px;
  background: var(--line);
  content: '';
}

.candidate {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.candidate.selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.radio-dot {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #b6c4c0;
  border-radius: 50%;
  margin-top: 3px;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.candidate.selected .radio-dot {
  border: 5px solid var(--brand);
}

.candidate h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.candidate p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.candidate-meta {
  color: var(--brand) !important;
  font-weight: 750;
}

.asset-upload-block {
  display: grid;
  gap: 14px;
}

.asset-upload-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-upload-section h4 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.3;
}

.asset-upload-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.asset-drop {
  position: relative;
  border: 1px dashed #a8d1c2;
  border-radius: 8px;
  background: #f5fcf9;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  overflow: hidden;
}

.primary-upload {
  min-height: 190px;
  color: var(--brand);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.asset-drop img,
.task-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-spec {
  margin-top: -6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.native-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.upload-file-icon {
  display: block;
  width: 92px;
  height: 70px;
  margin: 0 auto 4px;
  overflow: visible;
}

.upload-cloud-path,
.upload-arrow-path {
  fill: none;
  stroke: #111;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-preview-fallback-icon {
  align-self: center;
  justify-self: center;
  margin: 0;
}

.upload-file-icon + strong {
  color: var(--brand);
  font-size: 17px;
  line-height: 1.35;
}

.event-detail-fields {
  display: grid;
  gap: 12px;
}

.event-detail-field {
  margin: 0;
}

.event-detail-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-weight: 850;
  line-height: 1.35;
}

.event-detail-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--form-control-radius);
  padding: 0 14px;
  color: var(--text);
  background: #fff;
}

.asset-replace-option {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(8, 125, 104, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(6, 78, 59, 0.18);
  pointer-events: none;
}

.qr-upload-row .upload-file-icon {
  margin-bottom: 2px;
}

.qr-upload-row .native-file-input {
  position: absolute;
}

.upload-step-hint {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 850;
  text-align: center;
  line-height: 1.45;
}

.qr-upload-row {
  position: relative;
  min-width: 0;
  min-height: 120px;
  padding: 14px;
  border: 1px dashed #a8d1c2;
  border-radius: 8px;
  background: #f5fcf9;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.qr-upload-row span {
  font-weight: 850;
  white-space: normal;
  color: var(--brand-dark);
}

.qr-upload-row small {
  color: var(--brand);
  font-weight: 780;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.qr-upload-row img {
  width: min(160px, 72%);
  aspect-ratio: 1 / 1;
  justify-self: center;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.asset-upload-status {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  margin: 6px auto 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.asset-upload-status.saved {
  color: #087d68;
}

.asset-inline-error {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  width: calc(100% - 24px);
  margin: 8px auto 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(190, 34, 34, 0.24);
  background: rgba(255, 244, 244, 0.96);
  color: #a11d1d;
  text-align: left;
  line-height: 1.4;
  pointer-events: none;
}

.asset-inline-error strong { font-size: 14px; }
.asset-inline-error small { color: #8b2020; font-size: 12px; overflow-wrap: anywhere; }
.asset-inline-error em { color: #a11d1d; font-size: 12px; font-style: normal; font-weight: 800; }

.asset-drop.upload-error,
.qr-upload-row.upload-error {
  border-color: #d84b4b;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(216, 75, 75, 0.1);
}

.asset-drop.upload-error img,
.qr-upload-row.upload-error img {
  opacity: 0.5;
}

.asset-drop.upload-pending img,
.qr-upload-row.upload-pending img {
  opacity: 0.68;
}

.style-grid {
  display: flex;
  gap: 12px;
}

.style-card,
.action-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 14px;
  font-weight: 820;
}

.style-card {
  position: relative;
  min-height: 0;
  flex: 0 0 min(82%, 320px);
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  padding: 10px;
  scroll-snap-align: center;
}

.style-carousel {
  margin: 0 -18px;
  padding: 0 18px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.style-carousel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.style-card.selected,
.action-option.selected {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.style-card.selected {
  border-color: var(--selected);
  color: var(--text);
  background: #fff7f8;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.16);
}

.style-image-wrap {
  position: relative;
  display: block;
}

.task-thumb-missing {
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--apple-secondary);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.style-copy {
  display: grid;
  gap: 9px;
  padding: 2px 2px 0;
}

.style-template-image {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--selected);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.22);
}

.style-card h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.style-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

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

.style-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef8f4;
  border: 1px solid rgba(8, 125, 104, 0.12);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.generation-progress {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(8, 125, 104, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fffc, #eef8f4);
}

.generation-error {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #f0b4b4;
  border-radius: 8px;
  background: #fff5f5;
  color: #7f1d1d;
}

.generation-error strong {
  font-size: 20px;
}

.generation-error span {
  color: #8b3a3a;
  line-height: 1.55;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-dark);
  font-weight: 900;
}

.progress-head strong {
  font-size: 24px;
  color: var(--brand);
}

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

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b6b58, #13a07f);
  box-shadow: 0 0 18px rgba(19, 160, 127, 0.26);
}

.progress-checklist {
  display: grid;
  gap: 8px;
}

.progress-checklist span {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.action-option {
  display: grid;
  gap: 4px;
}

.action-option small {
  color: var(--muted);
  font-weight: 650;
}

.poster-frame {
  width: min(100%, 280px);
  margin: 8px auto 18px;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fcfa, #e2f4ee 55%, #0f7f6a);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  color: #12352f;
  position: relative;
}

.poster-frame.ratio-1-1 { aspect-ratio: 1 / 1; }
.poster-frame.ratio-3-4 { aspect-ratio: 3 / 4; }
.poster-frame.ratio-4-5 { aspect-ratio: 4 / 5; }
.poster-frame.ratio-9-16 { aspect-ratio: 9 / 16; }
.poster-frame.ratio-16-9 { aspect-ratio: 16 / 9; }

.poster-title,
.poster-subtitle,
.poster-bottom {
  position: relative;
  z-index: 2;
}

.poster-title {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.12;
}

.poster-subtitle {
  color: #315f55;
  font-weight: 700;
  font-size: 13px;
}

.poster-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.poster-subject {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 62%;
  object-fit: cover;
  object-position: center;
  opacity: 0.96;
  border-left: 10px solid rgba(255, 255, 255, 0.7);
  border-top: 10px solid rgba(255, 255, 255, 0.7);
}

.poster-abstract {
  position: absolute;
  right: -12%;
  bottom: -6%;
  width: 70%;
  height: 58%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.58), transparent 32%),
    linear-gradient(135deg, rgba(124, 179, 164, 0.58), rgba(15, 127, 106, 0.7));
  border-radius: 42% 0 0 0;
}

.poster-cta {
  font-weight: 860;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  padding: 8px 12px;
}

.qr-box {
  width: 64px;
  height: 64px;
  border: 5px solid #173b35;
  background: #fff;
  object-fit: contain;
}

.generated-image {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.page-header {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  margin-bottom: 12px;
}

.page-header h2 {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 22px;
}

.page-header-copy {
  grid-column: 1 / -1;
  display: block;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  writing-mode: horizontal-tb;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.recharge-header h2 {
  grid-column: 2;
  text-align: left;
}

.creation-tools {
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 10px;
}

.search-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
}

.filter-row,
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip,
.task-meta span,
.provider-chip {
  border: 1px solid var(--line);
  border-radius: var(--form-control-radius);
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip.active,
.provider-chip.ready {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.provider-chip.mock {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.task-card {
  padding: 10px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.task-thumb {
  width: 100%;
  height: 70px;
  border-radius: 8px;
  background: var(--panel-soft);
  object-fit: cover;
  display: block;
}

.task-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.task-card .actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.task-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
}

.task-pagination button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--apple-blue);
  font-weight: 700;
}

.task-pagination button:last-child { justify-self: stretch; }
.task-pagination button:disabled { color: #aeaeb2; background: #f2f2f7; }
.task-pagination span { color: var(--apple-secondary); font-size: 12px; white-space: nowrap; }

.task-detail-card { overflow: hidden; padding: 0; }
.task-detail-image { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #e8e8ed; }
.task-detail-copy { padding: 20px; }
.task-detail-copy span { color: var(--apple-blue); font-size: 12px; font-weight: 700; }
.task-detail-copy h3 { margin: 7px 0 5px; font-size: 21px; line-height: 1.35; }
.task-detail-copy p { margin: 0; color: var(--apple-secondary); line-height: 1.55; }
.task-detail-copy small { display: block; margin-top: 12px; color: #8e8e93; }
.task-detail-actions { display: grid; gap: 10px; padding: 0 20px 20px; }
.task-detail-actions > button { width: 100%; }

.account-panel {
  padding: 14px;
  margin-bottom: 12px;
}

.profile-main-card {
  display: grid;
  gap: 12px;
}

.profile-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.avatar-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.profile-heading h3,
.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.profile-heading p,
.section-title p,
.account-panel > p,
.package-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.edit-profile-button {
  min-height: 40px;
  justify-self: end;
  align-self: center;
  white-space: nowrap;
  padding: 8px 12px;
}

.outline-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.credit-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #eef8f4;
}

.credit-balance-card span,
.account-info-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.credit-balance-card strong {
  font-size: 30px;
  color: var(--text);
}

.credit-balance-card small {
  color: var(--muted);
  font-weight: 900;
}

.compact-button {
  min-height: 44px;
  min-width: 112px;
}

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

.account-info-list div {
  padding: 13px;
  border-radius: 8px;
  background: #f2eee7;
}

.account-info-list strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
}

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

.profile-card {
  padding: 14px;
}

.profile-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.profile-card strong {
  font-size: 30px;
  color: #2f3940;
}

.profile-card small {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 800;
}

.provider-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  background: #fbfdfc;
  color: var(--muted);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.section-icon {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.overview-card {
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
  background: #f2eee7;
}

.overview-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 900;
}

.overview-card strong {
  color: var(--text);
  font-size: 30px;
}

.profile-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.subsection-title {
  margin: 14px 0 10px;
  font-size: 16px;
}

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

.activity-record,
.activity-empty,
.recharge-empty {
  border-radius: 8px;
  background: #f2eee7;
}

.activity-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
}

.activity-record strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.activity-record span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.activity-record b {
  color: var(--text);
  font-size: 18px;
}

.activity-empty {
  padding: 16px;
  color: var(--muted);
}

.recharge-empty {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: var(--muted);
}

.account-operations {
  padding-bottom: 18px;
}

.package-list {
  display: grid;
  gap: 12px;
}

.package-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.package-card h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.package-credit-breakdown {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.package-card .package-paid-credits,
.package-card .package-bonus-credits {
  display: block;
  font-size: 21px;
  font-weight: 850;
  line-height: 1.25;
}

.package-card .package-paid-credits {
  color: var(--text);
}

.package-card .package-bonus-credits {
  color: var(--brand);
}

.package-card .package-total-credits {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.package-price {
  color: var(--text);
  font-weight: 800;
}

.package-price b {
  font-size: 22px;
}

.package-card .primary-button {
  grid-column: 2;
  grid-row: 2;
}

.payment-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.billing-mode-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #cfe4df;
  border-radius: 14px;
  background: #f4fbf9;
  color: #28584f;
  font-size: 14px;
  font-weight: 700;
}

.invoice-choice-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #e3e8e6;
  border-radius: 18px;
  background: #fff;
}

.invoice-choice-panel h3 { margin: 0 0 14px; }
.invoice-choice-panel label { display: grid; gap: 7px; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.invoice-choice-panel input,
.invoice-choice-panel select { width: 100%; min-height: var(--form-control-height); border: 1px solid var(--form-control-border); border-radius: var(--form-control-radius); padding-left: 15px; background-color: var(--form-control-bg); }
.invoice-choice-panel p { margin: 8px 0 0; color: #6c7d78; font-size: 12px; line-height: 1.6; }
.invoice-policy-row { display: flex; align-items: flex-start; gap: 12px; }
.invoice-policy-row strong { display: block; color: #153b32; font-size: 15px; }
.invoice-policy-icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #e3f4ed; color: #16866e; font-weight: 800; }
.invoice-extra-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.payment-status-card { text-align: center; padding: 42px 22px; }
.payment-status-card p { max-width: 440px; margin: 10px auto 24px; color: #64746f; line-height: 1.7; }
.payment-status-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50%; background: #edf7f4; color: #16705f; font-size: 30px; font-weight: 800; }

@media (max-width: 640px) {
  .invoice-extra-fields { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .login-page,
  .mobile-shell {
    border: 0;
  }

  .mobile-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .step-card {
    min-height: 520px;
  }
}

/* Apple official-site visual system for authenticated customer screens. */
.mobile-shell {
  color: var(--apple-text);
  background: var(--apple-bg);
  border-color: transparent;
}

.mobile-shell .mobile-content {
  background:
    radial-gradient(circle at 100% 0%, rgba(0, 113, 227, .08), transparent 24%),
    var(--apple-bg);
}

.mobile-shell :where(.mobile-card, .task-card, .account-panel, .creation-tools, .package-card) {
  border: 0;
  border-radius: var(--apple-card-radius);
  background: var(--apple-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .055);
}

.mobile-shell :where(.primary-button, .compact-button) {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--apple-blue);
  color: #fff;
  box-shadow: none;
  font-weight: 700;
}

.mobile-shell :where(.primary-button, .compact-button):hover {
  background: var(--apple-blue-hover);
}

.mobile-shell :where(.secondary-button, .outline-button, .icon-button) {
  border-color: transparent;
  border-radius: 999px;
  background: #e8e8ed;
  color: var(--apple-blue);
  box-shadow: none;
}

.mobile-shell :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea
) {
  min-height: 52px;
  border-color: transparent;
  border-radius: 14px;
  color: var(--apple-text);
  background: #f5f5f7;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, .1);
}

.mobile-shell :where(input, select, textarea):focus-visible {
  border-color: transparent;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--apple-blue), 0 0 0 4px rgba(0, 113, 227, .12);
}

.mobile-shell .mobile-app-header,
.mobile-shell .page-header {
  min-height: 76px;
  padding: 8px 4px 14px;
  background: transparent;
  border: 0;
}

.mobile-shell .page-header h2,
.mobile-shell .mobile-app-header h2 {
  color: var(--apple-text);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.035em;
}

.mobile-shell .page-header-copy {
  color: var(--apple-secondary);
  font-size: 14px;
  font-weight: 500;
}

.mobile-shell .stepper {
  padding: 0 4px;
}

.mobile-shell .step-number {
  height: 3px;
  background: #d2d2d7;
}

.mobile-shell .step-card {
  padding: 22px;
}

.mobile-shell .step-card-activity {
  min-height: auto;
}

.mobile-shell .step-card-activity .actions {
  margin-top: 24px;
}

.mobile-shell :where(.candidate, .asset-upload-section, .style-card, .action-option, .visual-option-card) {
  border-color: var(--apple-separator);
  border-radius: 18px;
  background: #fff;
}

.mobile-shell :where(.candidate.selected, .style-card.selected, .action-option.selected, .visual-option-card.selected) {
  border-color: var(--apple-blue);
  box-shadow: inset 0 0 0 1px var(--apple-blue);
}

.mobile-shell .asset-drop {
  border-color: rgba(0, 113, 227, .35);
  border-radius: 18px;
  background: #f5f9ff;
}

.mobile-bottom-nav {
  border-top: 1px solid var(--apple-separator);
  background: rgba(250, 250, 252, .78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .045);
}

.mobile-bottom-nav button {
  gap: 4px;
  color: #86868b;
  font-size: 11px;
  font-weight: 600;
}

.mobile-bottom-nav button > span {
  font-size: 11px;
}

.mobile-bottom-nav button.active {
  color: var(--apple-blue);
}

.apple-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-page-header {
  display: flex;
  align-items: center;
  gap: 13px;
}

.account-brand-mark {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}

.account-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-hero-card {
  padding: 22px;
}

.account-identity-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.account-avatar {
  width: 66px;
  height: 66px;
  overflow: hidden;
  border-radius: 50%;
  background: #1d1d1f;
}

.account-avatar-image,
.account-avatar-fallback {
  width: 100%;
  height: 100%;
}

.account-avatar-image { object-fit: cover; }
.account-avatar-fallback { display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 600; }
.account-identity-copy { min-width: 0; }
.account-identity-copy h3 { margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; letter-spacing: -.02em; }
.account-identity-copy p { margin: 6px 0 0; overflow: hidden; color: var(--apple-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-tier { display: inline-flex; align-items: center; gap: 4px; color: var(--apple-secondary); font-size: 12px; font-weight: 600; }
.account-tier .apple-icon { width: 14px; height: 14px; }

.apple-text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--apple-blue);
  font-weight: 650;
}

.apple-text-button .apple-icon { width: 18px; height: 18px; }
.account-status-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.account-status-pill,
.account-provider-pill { padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.account-status-pill { background: #e7f8ef; color: #087a44; }
.account-provider-pill { background: #f2f2f7; color: var(--apple-secondary); }

.apple-credit-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f1f6ff, #e8f2ff);
}

.apple-credit-card strong { color: var(--apple-text); }
.account-menu-card { overflow: hidden; padding: 0; }
.account-menu-row {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  padding: 17px 18px;
  border: 0;
  border-bottom: 1px solid var(--apple-separator);
  background: #fff;
  color: var(--apple-text);
  text-align: left;
}

.account-menu-row:last-child { border-bottom: 0; }
.account-menu-row > .apple-icon:first-child { width: 42px; height: 42px; padding: 10px; border-radius: 13px; background: #edf5ff; color: var(--apple-blue); }
.account-menu-row > .apple-icon:last-child { width: 18px; color: #aeaeb2; }
.account-menu-row strong,
.account-menu-row small { display: block; }
.account-menu-row strong { font-size: 16px; }
.account-menu-row small { margin-top: 3px; color: var(--apple-secondary); font-size: 12px; }
.account-menu-danger strong { color: #d70015; }
.account-menu-danger > .apple-icon:first-child { background: #fff1f2; color: #d70015; }

.detail-page-header {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.detail-page-header .icon-button { width: 38px; height: 38px; padding: 8px; }
.library-segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 0 18px;
  padding: 3px;
  border-radius: 12px;
  background: #e8e8ed;
}

.library-segmented-control button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--apple-secondary);
  font-size: 13px;
  font-weight: 650;
}

.library-segmented-control button.active { background: #fff; color: var(--apple-text); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.library-card { min-width: 0; overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .055); }
.library-preview { display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; border: 0; background: #e8e8ed; }
.library-preview img { width: 100%; height: 100%; object-fit: cover; }
.library-card-copy { padding: 12px 12px 6px; }
.library-card-copy span { color: var(--apple-blue); font-size: 11px; font-weight: 700; }
.library-card-copy strong,
.library-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-card-copy strong { margin-top: 4px; font-size: 14px; }
.library-card-copy small { margin-top: 4px; color: var(--apple-secondary); font-size: 10px; }
.library-download-button { display: flex; width: calc(100% - 24px); align-items: center; justify-content: center; gap: 5px; margin: 8px 12px 12px; padding: 9px; border: 0; border-radius: 999px; background: #edf5ff; color: var(--apple-blue); font-size: 12px; font-weight: 700; }
.library-download-button .apple-icon { width: 16px; height: 16px; }
.library-empty { display: grid; min-height: 300px; place-items: center; align-content: center; gap: 12px; padding: 30px; border-radius: var(--apple-card-radius); background: #fff; color: var(--apple-secondary); text-align: center; }
.library-empty > .apple-icon { width: 48px; height: 48px; color: #aeaeb2; }
.library-empty strong { color: var(--apple-text); font-size: 18px; }
.library-empty p { margin: 0; line-height: 1.55; font-size: 13px; }
.apple-spinner { width: 26px; height: 26px; border: 3px solid #d2d2d7; border-top-color: var(--apple-blue); border-radius: 50%; animation: apple-spin .8s linear infinite; }
@keyframes apple-spin { to { transform: rotate(360deg); } }

.records-summary-card { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 20px; border-radius: var(--apple-card-radius); background: linear-gradient(135deg, #0a84ff, #0071e3); color: #fff; }
.records-summary-card span { font-size: 13px; opacity: .85; }
.records-summary-card strong { font-size: 32px; }
.records-summary-card small { font-size: 13px; }
.records-card { padding: 20px; }
.records-card h3 { margin: 0 0 8px; font-size: 18px; }
.record-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--apple-separator); }
.record-row:last-child { border-bottom: 0; }
.record-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; font-weight: 800; }
.record-row strong,
.record-row small { display: block; }
.record-row strong { font-size: 14px; }
.record-row small { margin-top: 3px; color: var(--apple-secondary); font-size: 11px; }
.record-row b { font-size: 14px; }
.positive { color: #087a44; }
.record-icon.positive { background: #e7f8ef; }
.negative { color: #d70015; }
.record-icon.negative { background: #fff1f2; }
.records-empty { padding: 20px 0 8px; color: var(--apple-secondary); font-size: 13px; }

.mobile-shell .package-card { padding: 20px; }
.mobile-shell .billing-mode-note,
.mobile-shell .invoice-choice-panel { border: 0; border-radius: 18px; background: #f5f5f7; }
.mobile-shell .payment-status-icon { background: #edf5ff; color: var(--apple-blue); }

.login-referral-field { display: grid; gap: 6px; width: min(350px, calc(100% - 32px)); margin: 14px auto 0; text-align: left; }
.login-referral-field span { color: #6e6e73; font-size: 12px; font-weight: 650; }
.login-referral-field input { width: 100%; height: 46px; border: 1px solid #d2d2d7; border-radius: 12px; padding: 0 14px; background: rgba(255,255,255,.94); font: inherit; text-transform: uppercase; }
.login-referral-error { width: min(350px, calc(100% - 32px)); margin: 8px auto 0; color: #b42318; font-size: 12px; line-height: 1.45; text-align: left; }
.referral-share-card,
.referral-task-card,
.referral-line-card { display: grid; gap: 16px; margin-bottom: 14px; padding: 22px; }
.referral-kicker { color: var(--apple-blue); font-size: 12px; font-weight: 750; letter-spacing: .04em; }
.referral-share-card h3,
.referral-task-card h3,
.referral-line-card h3 { margin: 0; font-size: 21px; line-height: 1.25; }
.referral-share-card p,
.referral-line-card p { margin: 0; color: var(--apple-secondary); font-size: 13px; line-height: 1.6; }
.referral-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.referral-link-row input { min-width: 0; height: 48px; border: 1px solid #d2d2d7; border-radius: 13px; padding: 0 13px; background: #f5f5f7; color: #3a3a3c; }
.referral-link-row .primary-button { min-width: 132px; }
.referral-share-button { width: 100%; }
.referral-section-heading { display: flex; align-items: center; justify-content: space-between; }
.referral-section-heading > div { display: grid; gap: 5px; }
.referral-task-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; padding: 15px 0; border-top: 1px solid var(--apple-separator); }
.referral-task-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #edf5ff; color: var(--apple-blue); font-weight: 800; }
.referral-task-row strong { display: block; font-size: 15px; }
.referral-task-row p { margin: 5px 0 0; color: var(--apple-secondary); font-size: 13px; }
.referral-complete-badge { width: fit-content; border-radius: 999px; padding: 9px 13px; background: #e7f8ef; color: #087a44; font-size: 13px; font-weight: 750; }
.referral-line-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.referral-config-note { border-radius: 12px; padding: 12px; background: #fff7e8; color: #8a4b08 !important; }
.local-line-test-panel { display: grid; gap: 10px; border: 1px dashed #9ac7ff; border-radius: 16px; padding: 14px; background: #f4f9ff; }
.local-line-test-panel strong,
.local-line-test-panel small { display: block; }
.local-line-test-panel small { color: var(--apple-secondary); line-height: 1.45; }
.local-line-test-panel > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.poster-line-cta { display: grid; gap: 7px; margin-top: 16px; border-radius: 16px; padding: 16px; background: #f4f9ff; }
.poster-line-cta span { color: var(--apple-secondary); font-size: 13px; line-height: 1.5; }
.credit-choice-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: end center; padding: 18px; }
.credit-choice-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0,0,0,.42); backdrop-filter: blur(8px); }
.credit-choice-card { position: relative; display: grid; gap: 13px; width: min(520px, 100%); border-radius: 26px; padding: 26px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.credit-choice-card h2 { margin: 0; font-size: 24px; line-height: 1.22; }
.credit-choice-card p { margin: 0; color: var(--apple-secondary); font-size: 14px; line-height: 1.6; }
.credit-choice-close { position: absolute; top: 14px; right: 14px; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: #f2f2f7; color: #3a3a3c; font-size: 23px; }
.credit-choice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 5px; }

@media (max-width: 380px) {
  .account-identity-row { grid-template-columns: 56px minmax(0, 1fr); }
  .account-avatar { width: 56px; height: 56px; }
  .account-identity-row .apple-text-button { grid-column: 2; justify-self: start; padding-top: 0; }
  .referral-link-row,
  .local-line-test-panel > div,
  .credit-choice-actions { grid-template-columns: 1fr; }
}
