:root {
  color-scheme: light;
  --ink: #1d252d;
  --muted: #66727f;
  --line: #d9e0e7;
  --soft: #f4f7f9;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --bad: #b42318;
  --ok: #057a55;
  --warn: #a15c07;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf2f5;
  font-family: "Malgun Gothic", "맑은 고딕", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: auto;
  text-rendering: auto;
}

.landing-body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #f7f8f5;
}

a {
  color: var(--brand-strong);
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.app-head strong {
  display: block;
  font-size: 18px;
}

.app-head span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 20;
  color: var(--ink);
  background: #fff;
  border-bottom: 1px solid #e1e5de;
}

.landing-header-inner {
  width: min(1180px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-brand,
.landing-action {
  color: var(--ink);
  font-weight: 800;
}

.landing-brand {
  font-size: 22px;
}

.landing-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: auto;
  border: 0;
  border-radius: 0;
  padding: 8px 2px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

.landing-action:hover {
  color: var(--brand-strong);
}

.landing-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.landing-menu a {
  color: inherit;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 600;
}

.landing-menu a[aria-current="page"] {
  color: var(--ink);
  font-weight: 800;
}

.landing-menu a:hover {
  color: var(--ink);
}

.landing,
.signup-screen {
  position: relative;
  min-height: calc(100vh - 68px);
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: clamp(90px, 12vh, 130px) clamp(24px, 6vw, 86px) clamp(38px, 8vh, 86px);
  overflow: hidden;
}

.landing-bg,
.landing-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.landing-bg {
  object-fit: cover;
}

.landing-shade {
  background:
    linear-gradient(90deg, rgba(24, 34, 34, 0.24), rgba(24, 34, 34, 0.52)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(24, 34, 34, 0.44));
}

.landing-copy,
.auth-card {
  position: relative;
  z-index: 1;
}

.landing-copy {
  width: min(720px, 100%);
  color: #fff;
}

.landing-copy h1 {
  max-width: none;
  margin: 0 0 18px auto;
  font-size: clamp(32px, 5.4vw, 72px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
  word-break: keep-all;
  white-space: nowrap;
}

.landing-copy p {
  max-width: 560px;
  width: auto;
  margin: 0 0 0 auto;
  color: #fff;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.45;
  font-weight: 700;
  word-break: keep-all;
}

.service-landing {
  display: flex;
  align-items: flex-start;
  padding: 0;
  text-align: right;
}

.service-landing .landing-shade {
  background: linear-gradient(90deg, rgba(16, 25, 22, 0.58) 0%, rgba(16, 25, 22, 0.34) 42%, rgba(16, 25, 22, 0.72) 100%);
}

.service-landing::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 120px;
  background: linear-gradient(to top, rgba(247, 248, 245, 0.88), rgba(247, 248, 245, 0));
}

.service-landing .landing-copy {
  display: block;
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding-top: clamp(150px, 22vh, 260px);
}

.service-landing .landing-copy p {
  margin-left: auto;
}

.landing-kicker {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(20px, 2.6vw, 32px);
  line-height: 1.2;
  font-weight: 800;
}

.signup-screen .landing-shade {
  background:
    linear-gradient(90deg, rgba(246, 250, 248, 0.96) 0%, rgba(246, 250, 248, 0.7) 48%, rgba(246, 250, 248, 0.84) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(239, 247, 244, 0.82));
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  padding: clamp(22px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 58px rgba(24, 67, 72, 0.13);
  transform: translateY(clamp(-56px, -6vh, -36px));
}

.signup-screen {
  place-items: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 26px;
  border-radius: 8px;
  padding: 4px;
  background: #edf3f1;
}

.auth-tab {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--brand-strong);
  background: #fff;
  box-shadow: 0 1px 4px rgba(24, 67, 72, 0.12);
}

.auth-card .stack {
  gap: 12px;
}

.auth-panel[hidden] {
  display: none;
}

.auth-card input,
.auth-card button {
  min-height: 48px;
}

.field-help {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
}

.landing-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.landing-points span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.landing-alert {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  border-radius: 8px;
  padding: 12px 14px;
  background: #e6f7ef;
  color: var(--ok);
  font-weight: 700;
  text-align: center;
}

.landing-alert.bad {
  background: #fee2e2;
  color: var(--bad);
}

.contact-page {
  min-height: calc(100vh - 122px);
  padding: clamp(34px, 7vw, 72px) 18px;
  background: #f7f8f5;
}

.contact-page-form {
  min-height: calc(100vh - 68px);
}

.contact-wrap {
  width: min(640px, 100%);
  margin: 0 auto;
}

.contact-card {
  border: 1px solid #dfe3dd;
  border-radius: 10px;
  padding: clamp(22px, 4vw, 34px);
  background: #fff;
  box-shadow: 0 16px 42px rgba(24, 54, 52, 0.08);
}

.contact-heading {
  margin-bottom: 24px;
}

.contact-heading p,
.privacy-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.contact-heading h1,
.privacy-card h1 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
  font-weight: 800;
}

.contact-heading span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  word-break: keep-all;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-type-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.contact-type-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.contact-type-option input[type="radio"] {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.contact-type-option span {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  word-break: keep-all;
}

.contact-type-option:hover span {
  border-color: rgba(15, 118, 110, 0.52);
}

.contact-type-option input[type="radio"]:focus-visible + span {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.contact-type-option input[type="radio"]:checked + span {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: #e9f5f2;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.contact-type-option input[type="radio"]:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.contact-form input {
  min-height: 52px;
  padding: 0 12px;
}

.contact-form textarea {
  min-height: 190px;
  padding: 14px 12px;
  resize: vertical;
  line-height: 1.6;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.contact-form .contact-type-option input[type="radio"]:focus {
  border: 0;
  outline: 0;
}

.phone-field {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.phone-prefix {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.contact-form .phone-field input {
  border: 0;
  border-radius: 0;
}

.contact-form .phone-field input:focus {
  outline: 0;
}

.phone-field:focus-within {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.contact-help,
.contact-privacy {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.contact-form button {
  min-height: 52px;
  border-radius: 8px;
  font-weight: 800;
}

.contact-status {
  margin: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.contact-status:empty {
  display: none;
}

.contact-status.bad {
  display: block;
  padding: 11px 12px;
}

.contact-status.bad {
  color: var(--bad);
  background: #fee2e2;
}

.contact-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  border: 1px solid #b9dfd3;
  border-radius: 10px;
  padding: 14px 18px;
  background: #e6f7ef;
  color: #075f54;
  box-shadow: 0 12px 32px rgba(24, 54, 52, 0.18);
  text-align: center;
}

.contact-toast[hidden] {
  display: none;
}

.contact-toast strong,
.contact-toast span {
  display: block;
}

.contact-toast strong {
  font-size: 15px;
  font-weight: 800;
}

.contact-toast span {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.45;
}

.contact-privacy {
  margin-top: 17px;
  text-align: center;
}

.contact-privacy a,
.privacy-card a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.public-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #e1e5de;
  background: #fff;
  font-size: 12px;
}

.privacy-card {
  display: grid;
  gap: 16px;
  color: #46524d;
  line-height: 1.75;
  word-break: keep-all;
}

.privacy-card h1,
.privacy-card h2,
.privacy-card p {
  margin-top: 0;
  margin-bottom: 0;
}

.privacy-card h2 {
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
}

.hero-line {
  display: grid;
  grid-template-columns: 1fr 160px 160px;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.admin-body {
  background: #edf2f5;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 22px 16px;
}

.sidebar-store {
  min-height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 16px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  word-break: keep-all;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 700;
}

.side-nav a.active,
.side-nav a:hover {
  background: #e7f4f1;
  color: var(--brand-strong);
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

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

.setting-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
}

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

.choice {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.choice input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.hero-line h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.hero-line > div,
.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.hero-line > div:first-child {
  padding: 18px;
}

.metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
}

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

.metric strong {
  font-size: 30px;
}

.panel {
  margin: 0 0 16px;
  padding: 18px;
}

.panel h1,
.panel h2,
.order-head h1 {
  margin: 0 0 14px;
  font-size: 20px;
}

.panel.wide {
  padding: 0;
}

.panel.wide h2 {
  padding: 18px 18px 0;
}

.narrow {
  max-width: 460px;
  margin: 60px auto;
}

.stack,
.grid-form,
.inline-form,
.row-form,
.public-form {
  display: grid;
  gap: 10px;
}

.grid-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-form.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inline-form {
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 180px)) auto;
  align-items: center;
  margin-bottom: 14px;
}

.row-form {
  grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
}

input,
select,
button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

button {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:disabled,
select:disabled,
input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
}

.check input {
  width: 18px;
  min-height: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: var(--soft);
  font-weight: 700;
}

.thumb {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.matched,
.badge.manual_matched {
  background: #dcfce7;
  color: var(--ok);
}

.badge.amount_mismatch,
.badge.name_mismatch,
.badge.duplicate_candidate {
  background: #ffedd5;
  color: var(--warn);
}

.badge.unmatched {
  background: #fee2e2;
  color: var(--bad);
}

.alert {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #e6f7ef;
  color: var(--ok);
  font-weight: 700;
}

.alert.bad {
  background: #fee2e2;
  color: var(--bad);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.clip {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-head {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.bank-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
  font-weight: 700;
}

.pick-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.product-pick {
  display: grid;
  grid-template-columns: 96px 1fr 82px;
  gap: 12px;
  align-items: center;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.product-pick img,
.no-image {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.product-pick strong,
.product-pick span {
  display: block;
}

.product-pick span {
  margin: 4px 0 8px;
  color: var(--brand-strong);
  font-weight: 700;
}

.summary {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  margin: 0;
}

.summary dt {
  color: var(--muted);
}

.summary dd {
  margin: 0;
  font-weight: 700;
}

.qr {
  text-align: center;
}

.qr img {
  width: 280px;
  height: 280px;
}

@media (max-width: 900px) {
  .app-head,
  .admin-layout,
  .hero-line,
  .grid-form,
  .inline-form,
  .row-form,
  .pick-list,
  .product-pick,
  .landing,
  .signup-screen {
    grid-template-columns: 1fr;
  }

  .app-head {
    position: static;
    align-items: flex-start;
    padding: 14px;
  }

  .shell {
    padding: 14px;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-nav a {
    justify-content: center;
  }

  .admin-main {
    padding: 14px;
  }

  .landing,
  .signup-screen {
    align-content: end;
    padding: 22px;
  }

  .landing-shade {
    background:
      linear-gradient(180deg, rgba(24, 34, 34, 0.16) 0%, rgba(24, 34, 34, 0.66) 100%);
  }

  .landing-copy h1 {
    font-size: clamp(48px, 15vw, 82px);
  }

  .service-landing {
    align-items: flex-start;
    padding: 0;
  }

  .service-landing .landing-copy {
    padding-top: clamp(88px, 18vh, 140px);
  }

  .service-landing .landing-copy h1 {
    font-size: clamp(32px, 11vw, 54px);
    white-space: normal;
  }

  .auth-card {
    width: 100%;
  }

  .landing-header-inner {
    width: min(100% - 24px, 1180px);
  }

  .landing-menu {
    gap: 0;
  }

  .landing-menu a {
    padding: 0 7px;
  }

  .contact-page {
    padding: 24px 12px 36px;
  }

  .contact-card {
    padding: 22px 16px;
  }

  .grid-form.compact,
  .choice-row {
    grid-template-columns: 1fr;
  }
}
