/* ==========================================================================
   프로필 페이지 — 공용 스타일
   4가지 테마: Clean Light / Dark Pro / Warm Sand / Navy Biz
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 테마 토큰
   -------------------------------------------------------------------------- */
[data-theme='light'] {
  --bg: #eef1f6;
  --bg-accent: radial-gradient(1200px 600px at 50% -10%, #dfe7ff 0%, rgba(238, 241, 246, 0) 70%);
  --card: #ffffff;
  --card-soft: #f6f8fc;
  --text: #131a26;
  --text-2: #59637a;
  --text-3: #98a1b3;
  --line: #e7ebf3;
  --accent: #2f6bff;
  --accent-2: #7a5cff;
  --accent-soft: #eaf0ff;
  --accent-contrast: #ffffff;
  --chip-bg: rgba(255, 255, 255, 0.92);
  --chip-text: #131a26;
  --badge-bg: #ff4d4f;
  --badge-text: #ffffff;
  --price: #ff3d3d;
  --shadow-sm: 0 1px 2px rgba(19, 26, 38, 0.05);
  --shadow: 0 2px 6px rgba(19, 26, 38, 0.04), 0 14px 38px rgba(19, 26, 38, 0.07);
  --shadow-lg: 0 30px 80px rgba(19, 26, 38, 0.18);
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #070a10;
  --bg-accent: radial-gradient(1200px 620px at 50% -10%, #17233d 0%, rgba(7, 10, 16, 0) 70%);
  --card: #11161f;
  --card-soft: #171d29;
  --text: #e9eef8;
  --text-2: #97a2b6;
  --text-3: #67728a;
  --line: #232c3b;
  --accent: #6d9bff;
  --accent-2: #a78bfa;
  --accent-soft: #16233c;
  --accent-contrast: #06090f;
  --chip-bg: rgba(20, 26, 37, 0.82);
  --chip-text: #e9eef8;
  --badge-bg: #ff5a5c;
  --badge-text: #1a0708;
  --price: #ff6b6b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.72);
  color-scheme: dark;
}

[data-theme='sand'] {
  --bg: #f3ece1;
  --bg-accent: radial-gradient(1200px 600px at 50% -10%, #fbeedb 0%, rgba(243, 236, 225, 0) 70%);
  --card: #fffdf8;
  --card-soft: #faf4ea;
  --text: #3a2f26;
  --text-2: #7b6a5a;
  --text-3: #a8947f;
  --line: #ece0cf;
  --accent: #b96a3d;
  --accent-2: #8a8f52;
  --accent-soft: #f7e7db;
  --accent-contrast: #fff9f4;
  --chip-bg: rgba(255, 253, 248, 0.92);
  --chip-text: #3a2f26;
  --badge-bg: #c9503f;
  --badge-text: #fff7f5;
  --price: #c0442f;
  --shadow-sm: 0 1px 2px rgba(90, 66, 44, 0.07);
  --shadow: 0 2px 6px rgba(90, 66, 44, 0.05), 0 14px 34px rgba(90, 66, 44, 0.1);
  --shadow-lg: 0 30px 80px rgba(90, 66, 44, 0.22);
  color-scheme: light;
}

[data-theme='navy'] {
  --bg: #e9edf5;
  --bg-accent: radial-gradient(1200px 600px at 50% -10%, #dbe4f4 0%, rgba(233, 237, 245, 0) 70%);
  --card: #ffffff;
  --card-soft: #f4f7fc;
  --text: #101c33;
  --text-2: #55637d;
  --text-3: #8b97ad;
  --line: #dfe5ef;
  --accent: #17376b;
  --accent-2: #b08a2e;
  --accent-soft: #e7eef9;
  --accent-contrast: #ffffff;
  --chip-bg: rgba(255, 255, 255, 0.94);
  --chip-text: #101c33;
  --badge-bg: #17376b;
  --badge-text: #f6e6b8;
  --price: #a8342b;
  --shadow-sm: 0 1px 2px rgba(16, 28, 51, 0.06);
  --shadow: 0 2px 6px rgba(16, 28, 51, 0.05), 0 14px 36px rgba(16, 28, 51, 0.09);
  --shadow-lg: 0 30px 80px rgba(16, 28, 51, 0.22);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. 기본
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image: var(--bg-accent);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

h1,
h2,
h3,
p,
ul,
ol,
blockquote {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

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

/* --------------------------------------------------------------------------
   3. 레이아웃
   -------------------------------------------------------------------------- */
.profile-page {
  min-height: 100vh;
  padding-bottom: 40px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

/* 렌더 결과의 루트 — 편집기 미리보기 안에서도 테마 색을 그대로 쓴다 */
.profile-view {
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.phone__screen .profile-page {
  min-height: 100%;
}

.profile-page__inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px;
}

/* 상단 바 --------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.topbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.topbar__btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.topbar__btn:active {
  transform: scale(0.97);
}

.topbar__btn svg {
  width: 15px;
  height: 15px;
}

.topbar__btn--ghost {
  padding: 7px 13px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.topbar__spacer {
  flex: 1;
}

/* 카드 ------------------------------------------------------------------ */
.card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.card__title::before {
  content: '';
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.card__more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.card__more:hover {
  color: var(--accent);
}

.card__more svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   4. 히어로 카드
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  margin-top: 2px;
}

.hero__cover {
  position: relative;
  height: 172px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.14) 0%, rgba(0, 0, 0, 0) 42%);
  pointer-events: none;
}

/* 커버 프리셋 */
.cover--aurora {
  background-image: linear-gradient(135deg, #5f7cff 0%, #9a6bff 46%, #ff9ec4 100%);
}
.cover--sunset {
  background-image: linear-gradient(135deg, #ff9a5b 0%, #ff5f7e 56%, #c04cf0 100%);
}
.cover--mint {
  background-image: linear-gradient(135deg, #2fd3a4 0%, #27a8f7 100%);
}
.cover--slate {
  background-image: linear-gradient(135deg, #222a3a 0%, #415474 60%, #6f87ad 100%);
}
.cover--sand {
  background-image: linear-gradient(135deg, #e8c39a 0%, #c9925f 52%, #a86b3f 100%);
}
.cover--mono {
  background-image: linear-gradient(135deg, #14171c 0%, #3a4049 100%);
}

.hero__actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease;
}

.chip-btn:hover {
  transform: translateY(-1px);
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-btn svg {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

.hero__body {
  position: relative;
  padding: 0 20px 22px;
  text-align: center;
}

.hero__avatar {
  width: 92px;
  height: 92px;
  margin: -46px auto 12px;
  border-radius: 50%;
  background: var(--card-soft);
  border: 4px solid var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__avatar span {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.hero__name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.hero__handle {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 500;
}

.hero__headline {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero__bio {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-2);
  white-space: pre-line;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
}

.hero__tags li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero__contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
  padding: 3px 2px;
  border-radius: 8px;
  transition: color 0.15s ease;
}

a.contact:hover {
  color: var(--accent);
}

.contact svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex: none;
}

a.contact:hover svg {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   5. 프로모션 블록
   -------------------------------------------------------------------------- */
.promo__link {
  display: block;
}

.promo__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--card-soft) center/cover no-repeat;
  overflow: hidden;
}

.promo__media--empty {
  display: grid;
  place-items: center;
  background-image: radial-gradient(
      140% 130% at 8% 0%,
      color-mix(in srgb, var(--accent) 46%, var(--card)) 0%,
      transparent 62%
    ),
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent) 28%, var(--card)) 0%,
      color-mix(in srgb, var(--accent-2) 38%, var(--card)) 100%
    );
}

.promo__media--empty svg {
  width: 46px;
  height: 46px;
  color: #fff;
  opacity: 0.92;
  position: relative;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.22));
}

.promo__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.promo__body {
  padding: 15px 18px 18px;
}

.promo__kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  margin-bottom: 3px;
}

.promo__title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.promo__desc {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-line;
}

.promo__price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 11px;
  flex-wrap: wrap;
}

.promo__discount {
  font-size: 16px;
  font-weight: 800;
  color: var(--price);
  letter-spacing: -0.02em;
}

.promo__now {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.promo__was {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: line-through;
}

.promo__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 13px;
  padding: 9px 15px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 13px;
  font-weight: 700;
}

.promo__cta svg {
  width: 14px;
  height: 14px;
}

.promo:hover .promo__title {
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
}

/* --------------------------------------------------------------------------
   6. 링크 그리드
   -------------------------------------------------------------------------- */
.links__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 6px;
  padding: 14px 14px 18px;
}

.linktile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border-radius: 14px;
  transition: transform 0.15s ease;
}

.linktile:active {
  transform: scale(0.95);
}

.linktile__icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.linktile:hover .linktile__icon {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.linktile__icon svg {
  width: 22px;
  height: 22px;
}

.linktile__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 링크 종류별 색 */
.icon--instagram {
  background: linear-gradient(135deg, #feda75, #fa7e1e 35%, #d62976 65%, #962fbf);
  color: #fff;
  border-color: transparent;
}
.icon--youtube {
  background: #ff0033;
  color: #fff;
  border-color: transparent;
}
.icon--kakao {
  background: #fee500;
  color: #3c1e1e;
  border-color: transparent;
}
.icon--blog {
  background: #03c75a;
  color: #fff;
  border-color: transparent;
}
.icon--store {
  background: #ff5a1f;
  color: #fff;
  border-color: transparent;
}
.icon--site {
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 85%, var(--text));
}
.icon--mail {
  background: #eaf1ff;
  color: #2f6bff;
  border-color: transparent;
}
.icon--code {
  background: #1f2430;
  color: #fff;
  border-color: transparent;
}
.icon--music {
  background: #111;
  color: #fff;
  border-color: transparent;
}
.icon--briefcase {
  background: #0a66c2;
  color: #fff;
  border-color: transparent;
}
.icon--x {
  background: #0f1419;
  color: #fff;
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   7. 인용 블록
   -------------------------------------------------------------------------- */
.quote__body {
  padding: 14px 20px 22px;
  text-align: center;
}

.quote__text {
  position: relative;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: pre-line;
}

.quote__text::before,
.quote__text::after {
  content: '"';
  color: color-mix(in srgb, var(--accent) 55%, transparent);
  font-weight: 800;
}

.quote__author {
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. 리스트 / 포트폴리오 블록
   -------------------------------------------------------------------------- */
.list__items {
  padding: 10px 10px 14px;
}

.list__items--list .item + .item {
  border-top: 1px solid var(--line);
}

.item__link,
.item__static {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 14px;
  transition: background 0.15s ease;
}

.item__link:hover {
  background: var(--card-soft);
}

.item__thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 12px;
  background: var(--card-soft) center/cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid var(--line);
}

.item__thumb--a {
  background-image: linear-gradient(135deg, #7f9cff, #b18cff);
  color: #fff;
  border-color: transparent;
}
.item__thumb--b {
  background-image: linear-gradient(135deg, #ffb06b, #ff7a90);
  color: #fff;
  border-color: transparent;
}
.item__thumb--c {
  background-image: linear-gradient(135deg, #3fd0a4, #35a9f5);
  color: #fff;
  border-color: transparent;
}
.item__thumb--d {
  background-image: linear-gradient(135deg, #3a4557, #6a7d99);
  color: #fff;
  border-color: transparent;
}

.item__text {
  min-width: 0;
  flex: 1;
}

.item__tag {
  display: inline-block;
  margin-bottom: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 80%, var(--text));
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.item__title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item__desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item__chev {
  flex: none;
  color: var(--text-3);
  display: grid;
  place-items: center;
}

.item__chev svg {
  width: 16px;
  height: 16px;
}

/* 그리드 레이아웃 */
.list__items--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.list__items--grid .item {
  border: 0 !important;
}

.list__items--grid .item__link,
.list__items--grid .item__static {
  display: block;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  height: 100%;
}

.list__items--grid .item__thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  border: 0;
  font-size: 13px;
}

.list__items--grid .item__text {
  padding: 10px 11px 12px;
}

.list__items--grid .item__title {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.list__items--grid .item__desc {
  white-space: normal;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.list__items--grid .item__chev {
  display: none;
}

/* 빈 상태 */
.empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* 푸터 ------------------------------------------------------------------ */
.pagefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 6px 6px;
  color: var(--text-3);
  font-size: 11.5px;
}

.pagefoot a {
  color: var(--text-3);
  font-weight: 600;
}

.pagefoot a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. 모달
   -------------------------------------------------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.modal-root.is-open {
  display: block;
}

.modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.18s ease both;
}

.modal__sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal__grip {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 4px auto 12px;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.modal__title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal__sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-3);
}

.modal__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-soft);
  color: var(--text-2);
}

.modal__close svg {
  width: 16px;
  height: 16px;
}

.field {
  margin-bottom: 11px;
}

.field__label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}

.textarea {
  resize: vertical;
  min-height: 96px;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--soft {
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 85%, var(--text));
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--card-soft);
  color: var(--text);
}

.btn--block {
  width: 100%;
}

.btn-row .btn {
  flex: 1;
}

/* QR / 전자명함 */
.qr-box {
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.qr-box svg {
  width: 176px;
  height: 176px;
  display: block;
}

.qr-name {
  margin-top: 12px;
  text-align: center;
}

.qr-name strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.qr-name span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.qr-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   10. 토스트
   -------------------------------------------------------------------------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 22, 30, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  animation: toast-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.is-out {
  animation: toast-out 0.2s ease forwards;
}

.toast svg {
  width: 15px;
  height: 15px;
  color: #6ee7a8;
  flex: none;
}

/* 애니메이션 ------------------------------------------------------------ */
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(18px);
    opacity: 0.6;
  }
}

@keyframes toast-in {
  from {
    transform: translateY(10px) scale(0.96);
    opacity: 0;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(6px);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.profile-page__inner > * {
  animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.profile-page__inner > *:nth-child(1) {
  animation-delay: 0.02s;
}
.profile-page__inner > *:nth-child(2) {
  animation-delay: 0.05s;
}
.profile-page__inner > *:nth-child(3) {
  animation-delay: 0.08s;
}
.profile-page__inner > *:nth-child(4) {
  animation-delay: 0.11s;
}
.profile-page__inner > *:nth-child(5) {
  animation-delay: 0.14s;
}
.profile-page__inner > *:nth-child(6) {
  animation-delay: 0.17s;
}
.profile-page__inner > *:nth-child(7) {
  animation-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* 데스크톱 ---------------------------------------------------------------- */
@media (min-width: 560px) {
  body {
    padding: 0 0 24px;
  }

  .profile-page__inner {
    padding: 0 20px;
  }

  .topbar {
    padding: 14px 20px;
    margin-top: 6px;
  }

  .card {
    border-radius: 24px;
    margin-bottom: 14px;
  }

  .hero__cover {
    height: 196px;
  }

  .modal {
    align-items: center;
    padding: 24px;
  }

  .modal__sheet {
    border-radius: 26px;
    padding: 10px 24px 24px;
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
  }

  .modal__grip {
    display: none;
  }
}

/* ==========================================================================
   11. 편집 페이지 (editor.html)
   ========================================================================== */
body.editor {
  --ui-bg: #f2f4f8;
  --ui-panel: #ffffff;
  --ui-line: #e3e8f0;
  --ui-text: #172033;
  --ui-text-2: #5c6779;
  --ui-text-3: #98a2b3;
  --ui-accent: #2f6bff;
  --ui-accent-soft: #eaf0ff;
  --ui-ok: #12a06a;
  --ui-warn: #c2410c;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.editor.dark-chrome {
  --ui-bg: #0d1017;
  --ui-panel: #141922;
  --ui-line: #242c3a;
  --ui-text: #e8edf7;
  --ui-text-2: #98a3b6;
  --ui-text-3: #6b7688;
  --ui-accent-soft: #17233c;
}

.ed-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--ui-panel);
  border-bottom: 1px solid var(--ui-line);
  flex-wrap: wrap;
  z-index: 30;
}

.ed-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-right: 2px;
}

.ed-brand__dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--ui-accent), #8a6bff);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ed-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ui-text-3);
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-line) 45%, transparent);
  white-space: nowrap;
}

.ed-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui-text-3);
  transition: background 0.2s ease;
}

.ed-status.is-saved {
  color: var(--ui-ok);
}

.ed-status.is-saved::before {
  background: var(--ui-ok);
}

.ed-status.is-dirty {
  color: var(--ui-warn);
}

.ed-status.is-dirty::before {
  background: var(--ui-warn);
}

.ed-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ed-actions .btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  border: 1px solid var(--ui-line);
  background: transparent;
  color: var(--ui-text-2);
}

.ed-actions .btn:hover {
  background: color-mix(in srgb, var(--ui-line) 45%, transparent);
  color: var(--ui-text);
}

.ed-actions .btn--primary {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: #fff;
}

.ed-actions .btn--primary:hover {
  filter: brightness(1.06);
  color: #fff;
}

.ed-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* 왼쪽 패널 ------------------------------------------------------------ */
.ed-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

.ed-panel__inner {
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: 90px;
}

.section {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 13px 15px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ui-text);
}

.section__head:hover {
  background: color-mix(in srgb, var(--ui-line) 30%, transparent);
}

.section__num {
  width: 21px;
  height: 21px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.section__chev {
  margin-left: auto;
  color: var(--ui-text-3);
  transition: transform 0.2s ease;
  display: grid;
  place-items: center;
}

.section__chev svg {
  width: 16px;
  height: 16px;
}

.section.is-open .section__chev {
  transform: rotate(90deg);
}

.section__body {
  display: none;
  padding: 4px 15px 16px;
  border-top: 1px solid var(--ui-line);
}

.section.is-open .section__body {
  display: block;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid2 > .field--wide {
  grid-column: 1 / -1;
}

@media (max-width: 480px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.field__hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ui-text-3);
  line-height: 1.45;
}

body.editor .field__label {
  color: var(--ui-text-2);
}

body.editor .input,
body.editor .textarea,
body.editor .select {
  background: color-mix(in srgb, var(--ui-line) 28%, transparent);
  border-color: var(--ui-line);
  color: var(--ui-text);
  font-size: 13.5px;
  padding: 9px 11px;
  border-radius: 10px;
}

body.editor .input:focus,
body.editor .textarea:focus,
body.editor .select:focus {
  border-color: var(--ui-accent);
  background: var(--ui-panel);
}

body.editor .textarea {
  min-height: 74px;
}

/* 테마 선택 ------------------------------------------------------------ */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 6px;
}

.theme-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 12px;
  border: 1.5px solid var(--ui-line);
  background: transparent;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-card:hover {
  background: color-mix(in srgb, var(--ui-line) 30%, transparent);
}

.theme-card.is-active {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.theme-card__swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.theme-card__swatch i {
  display: block;
  width: 100%;
  height: 100%;
}

.theme-card__name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ui-text);
  letter-spacing: -0.01em;
}

.theme-card__sub {
  font-size: 10.5px;
  color: var(--ui-text-3);
  margin-top: 1px;
}

/* 블록 카드 ------------------------------------------------------------ */
.block-card {
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  margin-bottom: 9px;
  overflow: hidden;
  background: transparent;
}

.block-card.is-off {
  opacity: 0.62;
}

.block-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
}

.block-card__grip {
  color: var(--ui-text-3);
  display: grid;
  place-items: center;
  flex: none;
}

.block-card__grip svg {
  width: 15px;
  height: 15px;
}

.block-card__name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ui-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-card__type {
  font-size: 10px;
  color: var(--ui-text-3);
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ui-line) 55%, transparent);
  flex: none;
}

.block-card__tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
}

.iconbtn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--ui-text-3);
  transition: background 0.14s ease, color 0.14s ease;
}

.iconbtn:hover {
  background: color-mix(in srgb, var(--ui-line) 60%, transparent);
  color: var(--ui-text);
}

.iconbtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.iconbtn svg {
  width: 14px;
  height: 14px;
}

.iconbtn--danger:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

/* 스위치 */
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-line) 90%, #000 6%);
  transition: background 0.18s ease;
  flex: none;
  padding: 0;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.switch[aria-checked='true'] {
  background: var(--ui-accent);
}

.switch[aria-checked='true']::after {
  transform: translateX(16px);
}

.block-card__body {
  display: none;
  padding: 2px 11px 12px;
  border-top: 1px solid var(--ui-line);
}

.block-card.is-open .block-card__body {
  display: block;
}

.block-card.is-open [data-act='open'] svg {
  transform: rotate(180deg);
}

[data-act='open'] svg {
  transition: transform 0.2s ease;
}

.block-card__body .field:first-child {
  margin-top: 10px;
}

/* 항목 편집 */
.items {
  margin-top: 12px;
  border-top: 1px dashed var(--ui-line);
  padding-top: 11px;
}

.items__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ui-text-2);
}

.items__count {
  font-weight: 600;
  color: var(--ui-text-3);
}

.items__head .btn {
  margin-left: auto;
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 8px;
  border: 1px solid var(--ui-line);
  background: transparent;
  color: var(--ui-text-2);
}

.item-row {
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  padding: 8px 9px 9px;
  margin-bottom: 7px;
  background: color-mix(in srgb, var(--ui-line) 18%, transparent);
}

.item-row__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.item-row__idx {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ui-text-3);
  min-width: 16px;
}

.item-row__name {
  font-size: 11.5px;
  color: var(--ui-text-2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-row__tools {
  margin-left: auto;
  display: flex;
  gap: 2px;
  flex: none;
}

.item-row .field {
  margin-bottom: 6px;
}

.item-row .field:last-child {
  margin-bottom: 0;
}

.item-row .field__label {
  font-size: 10.5px;
}

.item-row .input,
.item-row .textarea,
.item-row .select {
  font-size: 12.5px;
  padding: 7px 9px;
  border-radius: 8px;
}

.item-row .textarea {
  min-height: 52px;
}

.item-row__row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.empty-note {
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--ui-text-3);
  border: 1px dashed var(--ui-line);
  border-radius: 10px;
}

/* 미리보기 ------------------------------------------------------------ */
.ed-preview {
  flex: none;
  width: 440px;
  border-left: 1px solid var(--ui-line);
  background: color-mix(in srgb, var(--ui-line) 30%, var(--ui-bg));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 14px;
  overflow-y: auto;
}

.preview-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ui-text-3);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.preview-head__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui-ok);
  box-shadow: 0 0 0 3px rgba(18, 160, 106, 0.16);
}

.phone {
  width: 100%;
  max-width: 390px;
  border-radius: 34px;
  background: #0b0d12;
  padding: 9px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), 0 2px 6px rgba(15, 23, 42, 0.14);
  flex: none;
}

.phone__screen {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg);
  height: 660px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.phone__screen::-webkit-scrollbar,
.ed-panel::-webkit-scrollbar {
  width: 8px;
}

.phone__screen::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
}

.ed-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 8px;
}

.phone__screen .profile-page {
  min-height: 100%;
}

.phone__screen .topbar {
  padding: 8px 12px;
}

.phone__screen .hero__cover {
  height: 132px;
}

.phone__screen .modal-root {
  position: absolute;
}

/* 모바일 편집 ---------------------------------------------------------- */
.ed-mobilebar {
  display: none;
}

@media (max-width: 900px) {
  .ed-preview {
    position: fixed;
    inset: 0;
    width: 100%;
    border-left: 0;
    z-index: 20;
    display: none;
    padding: 12px;
    justify-content: flex-start;
  }

  body.view-preview .ed-preview {
    display: flex;
  }

  body.view-preview .ed-panel {
    display: none;
  }

  body.view-preview .ed-top {
    display: none;
  }

  .ed-preview .phone {
    max-width: 420px;
    margin: 0 auto;
  }

  .ed-preview .phone__screen {
    height: calc(100dvh - 96px);
  }

  .ed-mobilebar {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  }

  .ed-mobilebar button {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ui-text-2);
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .ed-mobilebar button svg {
    width: 14px;
    height: 14px;
  }

  .ed-mobilebar button.is-active {
    background: var(--ui-accent);
    color: #fff;
  }

  .ed-panel__inner {
    padding-bottom: 110px;
  }

  .preview-head {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .ed-actions {
    width: 100%;
    gap: 5px;
  }

  .ed-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 9px;
    font-size: 12px;
  }
}

/* 인쇄 ------------------------------------------------------------------ */
@media print {
  .topbar,
  .modal-root,
  .toast-root,
  .pagefoot {
    display: none !important;
  }
  .profile-page {
    background: #fff;
  }
  .card {
    box-shadow: none;
    border: 1px solid #e5e5e5;
  }
}
