:root {
  color-scheme: light;
  --ink: #172018;
  --muted: #667068;
  --line: #dfe5df;
  --cream: #f5f3ec;
  --card: rgba(255, 255, 255, 0.91);
  --green: #276749;
  --green-dark: #184f36;
  --mint: #e7f3eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(64, 120, 83, .11), transparent 25rem),
    radial-gradient(circle at 88% 88%, rgba(193, 145, 71, .12), transparent 24rem),
    var(--cream);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.tool-card {
  position: relative;
  width: min(100%, 680px);
  padding: clamp(30px, 6vw, 58px);
  border: 1px solid rgba(39, 103, 73, .15);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(41, 54, 44, .12);
  backdrop-filter: blur(18px);
}

.tool-card::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;
  width: 55px;
  height: 55px;
  border-top: 1px solid rgba(39, 103, 73, .24);
  border-right: 1px solid rgba(39, 103, 73, .24);
  border-radius: 0 12px 0 0;
}

.brand-image {
  display: block;
  width: clamp(140px, 30vw, 190px);
  aspect-ratio: 1;
  margin: 0 auto 34px;
  border-radius: 24%;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(39, 103, 73, .16);
}

label { display: block; margin: 0 0 9px; font-size: 13px; font-weight: 700; }

.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7a837c;
  stroke-width: 1.8;
  stroke-linecap: round;
}

input {
  width: 100%;
  height: 58px;
  padding: 0 18px 0 49px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(39, 103, 73, .1); }
input::placeholder { color: #a2aaa4; }
.error-message { min-height: 21px; margin: 7px 0 3px; color: #ad3c35; font-size: 13px; }

.actions { display: block; }
.actions .primary { width: 100%; }
.button {
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 15px;
  font-weight: 700;
  transition: transform .18s, background .18s, box-shadow .18s;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .7; transform: none; }
.button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.loading-dots { width: 3ch; margin-left: -7px; text-align: left; }
.primary { color: #fff; background: var(--green); box-shadow: 0 9px 22px rgba(39, 103, 73, .19); }
.primary:hover { background: var(--green-dark); }
.secondary { color: var(--green-dark); border-color: #cbd8ce; background: #fff; }
.secondary:hover { background: var(--mint); }

.result { position: relative; margin-top: 18px; padding-top: 42px; }
.result::before {
  content: "↓";
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid #cbd8ce;
  border-radius: 50%;
  color: var(--green);
  background: #fff;
  font-size: 17px;
  font-weight: 700;
}
.short-result, .qr-result { align-items: center; gap: 18px; }
.short-result { position: relative; padding: 17px; border-radius: 12px; background: var(--mint); }
.result-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.result-value-wrap { position: relative; }
.result-value { height: 49px; padding: 0 64px 0 14px; color: var(--green-dark); font-weight: 700; background: #fff; }
.result-value.is-placeholder { color: #8a938c; font-size: 13px; font-weight: 500; }
.copy-button {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 50px;
  height: 39px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--green);
  cursor: pointer;
}
.copy-button:not(:disabled):hover { background: var(--green-dark); }
.copy-button:disabled { cursor: not-allowed; opacity: .45; }
.copy-button span { font-family: "Noto Sans KR", sans-serif; font-size: 10px; font-weight: 700; line-height: 1; }
.copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-status { min-height: 18px; margin: 7px 0 -5px; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.result-qr-button { width: 100%; margin-top: 10px; }
.result-qr-button:disabled { cursor: not-allowed; opacity: .45; }
.result-qr-button:disabled:hover { background: #fff; }
.qr-result { justify-content: center; margin-top: 17px; padding-top: 17px; border-top: 1px solid #cbd8ce; }
.qr-result::before { content: ""; width: 116px; }
.qr-frame { flex: 0 0 146px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.qr-frame img { display: block; width: 124px; height: 124px; }
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 116px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.download-button:hover { background: var(--green-dark); }
.download-button:disabled { cursor: wait; opacity: .7; }
.download-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.short-result:not([hidden]) { display: block; }
.qr-result:not([hidden]) {
  display: grid;
  grid-template-columns: 116px 146px 116px;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

@media (max-width: 560px) {
  .page-shell { padding: 22px 14px; }
  .tool-card { padding: 34px 22px; border-radius: 22px; }
  .qr-result:not([hidden]) { grid-template-columns: 62px 76px 62px; gap: 7px; }
  .qr-result::before { width: 62px; }
  .qr-frame { width: 76px; padding: 6px; }
  .qr-frame img { width: 62px; height: 62px; }
  .download-button { min-width: 62px; height: 48px; flex-direction: column; gap: 1px; padding: 0; font-size: 10px; }
  .download-button svg { width: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
