:root {
  --bg: #f7f6fb;
  --card: #ffffff;
  --ink: #1c1a29;
  --muted: #6b6880;
  --line: #e6e3f0;
  --accent: #6d4aff;
  --accent-soft: #efeaff;
  --danger: #d43b4b;
  --ok: #138a5a;
  --warn: #b7791f;
  font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
textarea {
  font: inherit;
}
.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
}
h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 16px;
  margin: 8px 0 0;
}
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.top h1 {
  flex: 1;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.muted,
.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.error {
  color: var(--danger);
  font-size: 14px;
}
.warn {
  color: var(--warn);
  font-size: 13px;
}
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.big {
  min-height: 54px;
  font-size: 16px;
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.link {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
}
.login {
  justify-content: center;
  text-align: center;
}
.brand {
  margin-bottom: 24px;
}
.logo {
  width: 72px;
  height: 72px;
  border-radius: 22%;
  display: block;
  object-fit: cover;
  margin: 0 auto 12px;
  box-shadow: 0 6px 18px rgba(80, 60, 160, 0.18);
}
.brand p {
  color: var(--muted);
}
.credits-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.credits-total strong {
  font-size: 28px;
  color: var(--accent);
}
.credits-split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.services {
  display: grid;
  gap: 10px;
}
.service {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}
.service strong {
  font-size: 16px;
}
.service span {
  color: var(--muted);
  font-size: 13px;
}
.service.off {
  opacity: 0.6;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  min-height: 72px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  min-height: 48px;
}
fieldset.card {
  display: grid;
  gap: 10px;
  margin: 0;
}
legend {
  font-weight: 700;
  font-size: 14px;
  padding: 0 4px;
}
.article {
  display: grid;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 4px;
}
.segmented button {
  border: 0;
  background: transparent;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
}
.segmented .on {
  background: #fff;
  color: var(--accent);
}
.estimate ul {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 6px;
}
.estimate li {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.estimate h2 {
  display: flex;
  justify-content: space-between;
  margin: 0;
}
.estimate h2 strong {
  color: var(--accent);
}
.progress {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px 16px;
}
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.status {
  display: grid;
  gap: 4px;
}
.status.succeeded strong {
  color: var(--ok);
}
.status.failed strong {
  color: var(--danger);
}
.preview {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.caption p {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
  margin: 6px 0 0;
}
.caption .tags {
  color: var(--accent);
}
.row {
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}
.row span {
  color: var(--muted);
  font-size: 13px;
}
.danger h2 {
  color: var(--danger);
  margin: 0 0 6px;
}
.danger p {
  font-size: 13px;
  color: var(--muted);
}
.estimate .btn {
  width: 100%;
}

/* Offline / unhandled request failure notice */
.net-notice { position: sticky; top: 0; z-index: 50; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: #2b2440; color: #fff; font-size: 14px; line-height: 1.4; }
.net-notice .btn { color: #fff; border-color: rgba(255, 255, 255, 0.4); min-height: 36px; padding: 4px 12px; }

/* Google sign-in button (live mode) and the result report form */
.gis { display: flex; justify-content: center; min-height: 44px; width: 100%; }
.report-link { display: block; margin: 8px auto; color: #8a8597; font-size: 14px; }
.report fieldset { border: 0; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.report legend { font-weight: 600; margin-bottom: 4px; }
.report .radio { display: flex; gap: 8px; align-items: center; min-height: 40px; }
.report textarea { width: 100%; box-sizing: border-box; margin-top: 4px; font: inherit; }

/* Credit packs and subscriptions (Google Play Billing) */
.products { display: grid; gap: 8px; }
.product { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border: 1px solid #e3def5; border-radius: 14px; background: #fff; font: inherit; text-align: left; }
.product strong { font-weight: 600; }
.product span { color: #6d4aff; font-weight: 600; white-space: nowrap; }
.product:disabled { opacity: 0.6; }
