/* 웨드링크 소개·만들기 화면 */
:root {
  --bg: #f6f2ec;
  --card: #fffdf9;
  --ink: #2c2622;
  --muted: #847870;
  --line: #e5dcd2;
  --accent: #b9705d;
  --accent-ink: #fff;
  --field: #fff;
  --serif: "Gowun Batang", Georgia, serif;
  --sans: "Manrope", system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1714;
    --card: #231f1b;
    --ink: #f1e9e0;
    --muted: #a99b8f;
    --line: #3a332d;
    --accent: #e09a86;
    --accent-ink: #1a1714;
    --field: #1d1a17;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  word-break: keep-all;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 12px;
  letter-spacing: .18em;
}
.nav a { text-decoration: none; }
.brand { font-weight: 800; }
.brand span { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.btn.danger { border-color: #c0392b; color: #c0392b; }

/* ---- 소개 ---- */
.intro { padding: 72px 0 48px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.intro h1 {
  margin: 18px 0;
  font: 400 clamp(40px, 8vw, 84px)/1.15 var(--serif);
  letter-spacing: -.05em;
}
.intro h1 em { font-style: normal; color: var(--accent); }
.intro p { max-width: 480px; color: var(--muted); margin: 0 0 30px; }
.intro .row { display: flex; flex-wrap: wrap; gap: 10px; }

.mine { margin: 0 0 40px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.mine h2 { margin: 0 0 8px; font-size: 14px; }
.mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mine li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; }
.mine li span { color: var(--muted); }
.mine li a { margin-left: 10px; font-weight: 600; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; padding-bottom: 60px; }
.theme-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}
.theme-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgb(0 0 0 / .12); }
.poster {
  position: relative;
  height: 300px;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  overflow: hidden;
  color: #fff;
}
.poster > * { position: relative; }
.poster .k { font-size: 10px; letter-spacing: .2em; margin: 0 0 10px; opacity: .85; }
.poster .t { font: 400 32px/1.15 var(--serif); letter-spacing: -.04em; white-space: pre-line; }
.p-letter { background: linear-gradient(180deg, #bfd6dd 0, #e9dfc8 46%, #8fb3b4 47%, #6f9c9f 62%, #c9c09a 63%, #a6a275 100%); }
.p-letter::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(20 32 28 / .7), transparent 65%); }
.p-cinema { background: radial-gradient(circle at 50% 34%, #f3deba 0 13%, transparent 13.5%), linear-gradient(150deg, #301c23, #934c3c 58%, #d9ab78); }
.p-hanji { background: #e8e7d9; color: #30372f; }
.p-hanji > div { position: static; }
.p-hanji .t { writing-mode: vertical-rl; position: absolute; top: 30px; right: 40px; letter-spacing: .2em; line-height: 1.6; }
.p-blue { background: #123bd6; }
.p-blue .t { font: 800 44px/.92 var(--sans); text-transform: uppercase; letter-spacing: -.06em; }
.p-blue .k { color: #d9fa6d; }
.p-lunar { background: radial-gradient(circle at 66% 34%, #b3b8b6 0, #5b6870 17%, #1a2633 30%, #111821 60%); }
.p-lunar .k { font-family: "DM Mono", monospace; }
.p-ivory { background: radial-gradient(circle at 85% 8%, transparent 0 90px, #e7ddd2 91px 92px, transparent 93px), #fbf8f3; color: #3a3330; }
.p-ivory .k { color: #b5867a; }
.p-pullrequest { background: #0e1116; font-family: "DM Mono", monospace; }
.p-pullrequest .k { color: #3fb950; }
.p-pullrequest .t { font: 600 30px/1.3 var(--sans); }
.p-pullrequest::before {
  content: "- 혼자 먹는 저녁\A+ 둘이 먹는 저녁\A+ status: 평생 함께";
  white-space: pre;
  position: absolute;
  top: 26px;
  left: 24px;
  right: 24px;
  padding: 12px;
  border: 1px solid #262c36;
  border-radius: 8px;
  color: #aff5b4;
  font: 12px/1.9 "DM Mono", monospace;
  background: linear-gradient(rgb(248 81 73 / .15) 0 33%, rgb(46 160 67 / .15) 33%);
}
.p-boarding { background: #1d2a44; }
.p-boarding .k { color: #ffd166; font-family: "DM Mono", monospace; }
.p-boarding::before {
  content: "✈";
  position: absolute;
  top: 28px;
  right: 28px;
  font-size: 54px;
  color: #e8643c;
}
.p-receipt { background: #e9e6df; color: #232323; font-family: "DM Mono", monospace; }
.p-receipt::before {
  content: "사랑      1    ∞\A약속      1   평생\A──────────────\A합계          평생";
  white-space: pre;
  position: absolute;
  top: 24px;
  left: 50%;
  translate: -50% 0;
  width: 200px;
  padding: 16px;
  background: #fff;
  font: 12px/1.9 "DM Mono", monospace;
}
.p-pixel { background: linear-gradient(#211d4f 0 30%, #2c2870 30% 55%, #3b3796 55% 75%, #5450bf 75%); }
.p-pixel .k { color: #ffcc4d; }
.p-pixel .t { font: 26px/1.5 "Press Start 2P", monospace; text-shadow: 3px 3px 0 #ff4d6d; }
.theme-info { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; }
.theme-info strong { display: block; font-size: 15px; }
.theme-info small { color: var(--muted); font-size: 12px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; padding: 10px 0 70px; }
.features div { padding: 22px; border-top: 1px solid var(--line); }
.features b { display: block; font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }

.foot { padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- 만들기 ---- */
.maker { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 36px; align-items: start; padding-bottom: 120px; }
.maker h1 { font: 400 34px/1.3 var(--serif); margin: 10px 0 4px; letter-spacing: -.03em; }
.maker .lead { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.box { margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.box > h2 { margin: 0 0 16px; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.box > h2 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.fields.wide { grid-template-columns: 1fr; }
.fld { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fld input, .fld textarea, .fld select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
}
.fld textarea { resize: vertical; line-height: 1.7; }
.sub-h { margin: 18px 0 10px; font-size: 13px; font-weight: 700; }
.sub-h:first-child { margin-top: 0; }

.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-pick label { position: relative; cursor: pointer; }
.theme-pick input { position: absolute; inset: 0; margin: 0; opacity: 0; pointer-events: none; }
.theme-pick .sw { display: block; height: 70px; border-radius: 10px; border: 2px solid transparent; }
.theme-pick input:checked + .sw { border-color: var(--accent); box-shadow: 0 0 0 3px var(--bg) inset; }
.theme-pick input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-pick b { display: block; font-size: 12px; margin-top: 6px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / .6);
  color: #fff;
  font-size: 15px;
  line-height: 1;
}
.ph .mv { left: 4px; right: auto; }
.add-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}
.add-photo input { display: none; }
.cover-slot { width: 140px; }

.acc-row { display: grid; grid-template-columns: 90px 1fr 1.4fr 1fr 34px; gap: 8px; margin-bottom: 8px; }
.acc-row select, .acc-row input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 15px; min-width: 0; }
.acc-row button { border: 0; background: none; color: var(--muted); font-size: 20px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-top: 6px; }

.preview-col { position: sticky; top: 20px; }
.phone {
  width: 100%;
  height: min(780px, calc(100vh - 80px));
  border: 10px solid #1f1b18;
  border-radius: 36px;
  overflow: hidden;
  background: #1f1b18;
}
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 26px; background: #fff; }
.preview-col p { text-align: center; color: var(--muted); font-size: 12px; }

.savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.savebar .wrap { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 0; }
.savebar .status { margin-right: auto; color: var(--muted); font-size: 13px; }
.show-preview { display: none; }

.manage table { width: 100%; border-collapse: collapse; font-size: 13px; }
.manage th, .manage td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.manage th { color: var(--muted); font-weight: 600; }
.manage td button { border: 0; background: none; color: var(--muted); font-size: 16px; }
.manage .sum { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.manage .sum b { font-size: 20px; margin-left: 4px; }
.scroll-x { overflow-x: auto; }
.empty { color: var(--muted); font-size: 13px; margin: 0; }

dialog {
  width: min(460px, calc(100% - 32px));
  padding: 28px;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog h2 { margin: 0 0 6px; font: 400 26px var(--serif); }
dialog p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.linkbox { display: flex; gap: 8px; margin-bottom: 14px; }
.linkbox input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 14px; }
.linkbox-label { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.warn { font-size: 12px; color: var(--accent); }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 40;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .2s;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .maker { grid-template-columns: 1fr; }
  .preview-col { display: none; position: fixed; inset: 0; z-index: 30; padding: 16px; background: rgb(0 0 0 / .7); }
  .preview-col.open { display: grid; place-items: center; }
  .phone { max-width: 400px; height: calc(100vh - 100px); }
  .preview-col p { color: #fff; }
  .show-preview { display: inline-flex; }
  .acc-row { grid-template-columns: 1fr 1fr 34px; }
  .acc-row select { grid-column: 1 / -1; }
}
