/* 화면 전용 — 마이페이지 허브(/my) · 크레딧 충전(/my/credits) · 외부 API 등록(/my/api-keys) · 요금(/pricing 묶음 카드).
   TubeAI credits.php · mobile_mypage.php · API·제휴서비스 대응(2026-10-05 사용자 방침 「99% 흡사」, 색은 C안 토큰).
   값은 토큰만 — 짙은 카드는 대시보드 히어로 토큰(--hero-*), 아이콘 칩은 묶음 토큰(--grp-*). 모바일 먼저(min-width 600 · 960 · 1280). */

.my-page { container: my / inline-size; display: grid; gap: var(--space-5); }
.my-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.my-head .page-title { font-size: var(--font-h1); }
.my-head .sub { margin-top: var(--space-1); max-width: 64ch; }
.my-kicker { font-size: var(--text-xs); font-weight: 800; letter-spacing: .08em; color: var(--brand-text); margin-bottom: var(--space-1); }
.my-tabs .tab { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.my-subtabs { margin-top: calc(var(--space-2) * -1); }

/* ── 크레딧: 잔액 카드 + 충전 묶음 ── */
.cr-top { display: grid; gap: var(--space-4); }
@container my (min-width: 900px) { .cr-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; } }

.cr-balance { position: relative; overflow: hidden; isolation: isolate; display: grid; align-content: start; gap: var(--space-2); padding: var(--space-6); border-radius: var(--r-lg); background: linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%); color: var(--on-hero); box-shadow: var(--shadow-pop); min-height: 280px; }
.cr-balance::after { content: "C"; position: absolute; z-index: -1; right: -24px; bottom: -70px; font-size: 260px; font-weight: 900; line-height: 1; color: var(--hero-deco); opacity: .14; }
.cr-kicker { font-size: var(--text-xs); font-weight: 800; letter-spacing: .1em; color: var(--on-hero-sub); }
.cr-amount { font-size: clamp(48px, 9cqi, 72px); font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; color: var(--on-hero); }
.cr-amount span { margin-left: var(--space-2); font-size: .42em; font-weight: 800; }
.cr-won { font-size: var(--text-base); font-weight: 700; color: var(--on-hero); }
.cr-held, .cr-temp { font-size: var(--text-sm); color: var(--on-hero-sub); }
.cr-chips { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cr-chips li { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 36px; padding: 0 var(--space-3); border: 1px solid color-mix(in srgb, var(--on-hero) 30%, transparent); border-radius: var(--r); background: color-mix(in srgb, var(--on-hero) 10%, transparent); font-size: var(--text-sm); font-weight: 700; color: var(--on-hero); }
.cr-chip-unit { font-weight: 500; color: var(--on-hero-sub); }

.cr-packs { display: grid; align-content: start; gap: var(--space-4); padding: var(--space-6); }
.cr-packs-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.cr-packs-head h2 { font-size: var(--text-2xl); line-height: var(--leading-tight); }
.cr-secure { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: 800; letter-spacing: .06em; color: var(--brand-text); }
.cr-pack-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.cr-pack-grid > li, .cr-pack-grid form { display: grid; }
@container my (min-width: 460px) { .cr-pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cr-pack { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: var(--space-3); row-gap: var(--space-1); min-height: 92px; padding: var(--space-5) var(--space-5) var(--space-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); text-align: left; font: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.cr-pack:is(:hover, .is-hover) { border-color: var(--brand-text); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.cr-pack:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cr-pack-c { grid-column: 1; font-size: var(--text-2xl); font-weight: 900; line-height: 1.1; letter-spacing: -0.01em; }
.cr-pack-won { grid-column: 1; font-size: var(--text-sm); font-weight: 600; color: var(--sub); }
.cr-pack-won s { font-weight: 400; }
.cr-pack-go { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); background: var(--brand-soft); color: var(--brand-text); }
.cr-pack-badge { position: absolute; top: -11px; left: var(--space-4); padding: 2px var(--space-2); border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-size: var(--text-xs); font-weight: 800; letter-spacing: .02em; }
.cr-pack.is-save { border: 2px solid var(--brand-text); }
.cr-pack.is-best { border-color: transparent; background: var(--hero-bg); color: var(--on-hero); }
.cr-pack.is-best .cr-pack-won { color: var(--on-hero-sub); }
.cr-pack.is-best .cr-pack-go { background: var(--hero-cta); color: var(--on-hero-cta); }
.cr-pack.is-best .cr-pack-badge { background: var(--hero-cta); color: var(--on-hero-cta); }
@media (prefers-reduced-motion: reduce) { .cr-pack { transition: none; } .cr-pack:hover { transform: none; } }

.cr-info { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
@container my (min-width: 760px) { .cr-info { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cr-info > li { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-5); }
.cr-info-ico { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: var(--space-1); border-radius: var(--r); background: var(--brand-soft); color: var(--brand-text); }
.cr-info h3 { font-size: var(--text-base); }
.cr-info p { margin: 0; font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--sub); }

.cr-history { display: grid; gap: var(--space-3); padding: var(--space-5); }
.cr-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cr-history-head h2 { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); }
.cr-history-head h2 .ico { color: var(--brand-text); }
.cr-history .table-wrap { border-radius: var(--r); }
.cr-history .table caption { display: none; }
.cr-foot { font-size: var(--text-xs); color: var(--sub); }
.cr-foot b { color: var(--ink); }

/* 요금(/pricing) — 같은 묶음 카드를 네 칸으로 */
.pricing-packs { display: grid; gap: var(--space-4); margin-bottom: var(--space-7); container: my / inline-size; }
@container my (min-width: 900px) { .cr-pack-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── 마이페이지 허브 ── */
.mh-top { display: grid; gap: var(--space-4); }
@container my (min-width: 900px) { .mh-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); } }
.mh-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); padding: var(--space-5); color: var(--ink); text-decoration: none; }
.mh-profile:is(:hover, .is-hover) { border-color: var(--line-strong); }
.mh-profile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mh-avatar { width: 56px; height: 56px; font-size: var(--text-xl); }
.mh-profile-text { display: grid; gap: 2px; min-width: 0; }
.mh-profile-text b { font-size: var(--text-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-profile-text .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-chev { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); background: var(--brand-soft); color: var(--brand-text); }
.mh-wallet { display: grid; gap: var(--space-3); }
@container my (min-width: 560px) { .mh-wallet { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.mh-credit { position: relative; display: grid; align-content: center; gap: var(--space-1); min-height: 96px; padding: var(--space-5); border-radius: var(--r-lg); background: linear-gradient(120deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%); color: var(--on-hero); text-decoration: none; box-shadow: var(--shadow-pop); }
.mh-credit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mh-credit-k { font-size: var(--text-sm); font-weight: 700; color: var(--on-hero-sub); }
.mh-credit-v { font-size: var(--text-3xl); font-weight: 900; line-height: 1.1; }
.mh-credit-ico { position: absolute; right: var(--space-5); top: 50%; translate: 0 -50%; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r); background: color-mix(in srgb, var(--on-hero) 16%, transparent); }
.mh-plan { display: grid; align-content: center; gap: 2px; padding: var(--space-4) var(--space-5); }
.mh-plan-k { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: 700; color: var(--sub); }
.mh-plan-v { font-size: var(--text-xl); font-weight: 800; }

.mh-quick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@container my (min-width: 600px) { .mh-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mh-quick > li { display: grid; }
.mh-q { display: grid; justify-items: center; align-content: center; gap: var(--space-2); min-height: 96px; padding: var(--space-4) var(--space-2); font-size: var(--text-sm); font-weight: 700; color: var(--ink); text-decoration: none; text-align: center; }
a.mh-q:is(:hover, .is-hover) { border-color: var(--brand-text); }
a.mh-q:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mh-q.is-soon { color: var(--sub); }
.mh-q-ico, .mh-row-ico, .mh-stat-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); background: var(--grp-bg, var(--brand-soft)); color: var(--grp-fg, var(--brand-text)); }
.is-credit { --grp-fg: var(--grp-make-fg); --grp-bg: var(--grp-make-bg); }
.is-yt     { --grp-fg: var(--danger); --grp-bg: var(--danger-soft); }
.is-set    { --grp-fg: var(--grp-grow-fg); --grp-bg: var(--grp-grow-bg); }
.is-help   { --grp-fg: var(--st-write-fg); --grp-bg: var(--st-write-bg); }
.is-api    { --grp-fg: var(--grp-lib-fg); --grp-bg: var(--grp-lib-bg); }
.is-mini   { --grp-fg: var(--grp-live-fg); --grp-bg: var(--grp-live-bg); }
.is-all    { --grp-fg: var(--grp-grow-fg); --grp-bg: var(--grp-grow-bg); }
.is-run    { --grp-fg: var(--st-write-fg); --grp-bg: var(--st-write-bg); }
.is-done   { --grp-fg: var(--st-done-fg); --grp-bg: var(--st-done-bg); }

.mh-cols { display: grid; gap: var(--space-4); }
@container my (min-width: 900px) { .mh-cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.mh-stats { display: grid; gap: var(--space-3); }
.mh-stat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.mh-stat-grid > li { display: grid; justify-items: center; gap: var(--space-1); padding: var(--space-4) var(--space-2); text-align: center; }
.mh-stat-grid b { font-size: var(--text-2xl); font-weight: 900; line-height: 1.1; }
.mh-stat-grid span:last-child { font-size: var(--text-xs); font-weight: 700; color: var(--sub); }
.mh-yt { display: grid; gap: var(--space-3); }
.mh-yt-title { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); }
.mh-yt-title .ico { color: var(--danger); }

.mh-menu { padding: var(--space-2); }
.mh-menu ul { list-style: none; margin: 0; padding: 0; display: grid; }
.mh-menu li + li { border-top: 1px solid var(--line); }
.mh-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); min-height: 72px; padding: var(--space-3) var(--space-4); border-radius: var(--r); color: var(--ink); text-decoration: none; }
a.mh-row:is(:hover, .is-hover) { background: var(--surface-2); }
a.mh-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.mh-row-text { display: grid; gap: 2px; min-width: 0; }
.mh-row-text b { font-size: var(--text-base); }
.mh-row .mh-chev { background: none; color: var(--sub); }
.mh-row.is-soon .mh-row-text b { color: var(--sub); }

/* ── 외부 API 등록 ── */
.ak-count { align-self: center; font-size: var(--text-sm); }
.ak-filter .check { min-height: var(--control-h-md); white-space: nowrap; }
.ak-groups .tab { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.ak-group { display: grid; gap: var(--space-3); }
.ak-group-title { display: inline-flex; align-items: center; gap: var(--space-2); }
.ak-group-title .ico { color: var(--brand-text); }
.ak-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
@container my (min-width: 640px)  { .ak-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container my (min-width: 1040px) { .ak-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container my (min-width: 1400px) { .ak-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ak-card { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-5); scroll-margin-top: var(--space-8); }
.ak-card.is-mine { border-color: var(--brand-text); }
.ak-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.ak-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); }
.ak-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r); }
.ak-ico-ai    { background: var(--grp-make-bg); color: var(--grp-make-fg); }
.ak-ico-shop  { background: var(--grp-lib-bg);  color: var(--grp-lib-fg); }
.ak-ico-media { background: var(--grp-grow-bg); color: var(--grp-grow-fg); }
.ak-ico-sns   { background: var(--grp-live-bg); color: var(--grp-live-fg); }
.ak-name { font-size: var(--text-base); font-weight: 800; margin-top: var(--space-1); }
.ak-desc { margin: 0; font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--sub); }
.ak-saved { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: 600; color: var(--st-done-fg); }
.ak-reg > summary { list-style: none; }
.ak-reg > summary::-webkit-details-marker { display: none; }
.ak-reg-btn { justify-self: start; width: max-content; color: var(--brand-text); font-weight: 700; }
.ak-reg[open] > .ak-reg-btn { margin-bottom: var(--space-2); }
.ak-form { padding: var(--space-4); border-radius: var(--r); background: var(--surface-2); }
.ak-links { align-items: flex-start; gap: var(--space-1) var(--space-4); }
.ak-links .link { display: inline-flex; align-items: center; gap: var(--space-1); }
.ak-how > summary { cursor: pointer; display: inline-flex; align-items: center; min-height: var(--control-h-sm); color: var(--brand-text); font-weight: 600; }
.ak-steps { margin: var(--space-1) 0 0; padding-left: var(--space-5); display: grid; gap: var(--space-1); font-size: var(--text-sm); color: var(--ink); }
.ak-del { justify-self: start; color: var(--danger); }
.ak-note .notice-list { font-size: var(--text-sm); }
.ak-note .section-title { display: inline-flex; align-items: center; gap: var(--space-2); }

/* SNS 자동 게시(선택 옵션) 카드 — TubeAI 마이페이지 같은 자리(일치도 점검 2026-10-05) */
.mh-sns { display: grid; gap: var(--space-3); }
.mh-sns > p { margin: 0; }
.mh-sns-note { padding: var(--space-3) var(--space-4); border-radius: var(--r); background: var(--grp-grow-bg); color: var(--ink); line-height: var(--leading-normal); }
.mh-sns .mh-yt-title .ico { color: var(--grp-grow-fg); }

/* API·제휴 — 다른 쇼핑몰 안내 · 첫 방문 안내 창(일치도 2차 2026-10-05) */
.ak-shops { display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--r-lg); background: var(--grp-grow-bg); color: var(--ink); }
.ak-shops-h { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-md); }
.ak-shops p { margin: 0; line-height: var(--leading-normal); }
.ak-guide-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); counter-reset: ak; }
.ak-guide-steps li { position: relative; display: grid; gap: 2px; padding: var(--space-2) 0 var(--space-2) calc(32px + var(--space-3)); counter-increment: ak; color: var(--ink); }
.ak-guide-steps li::before { content: counter(ak); position: absolute; left: 0; top: var(--space-2); width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-full); background: var(--brand-soft); color: var(--brand-text); font-weight: 800; font-size: var(--text-sm); }
.ak-guide-steps span { color: var(--sub); font-size: var(--text-sm); }
/* 묶음 I(메뉴 사이 잇기 · 2026-10-05) — SNS 카드 연결 상태 두 줄 */
.mh-sns-state { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.mh-sns-state li { display: flex; align-items: flex-start; gap: var(--space-2); }
.mh-sns-state .ico-sm { flex: none; margin-top: 2px; color: var(--sub); }
.mh-sns-state li.is-ok .ico-sm { color: var(--st-done-fg); }

/* 개인 키 허용 꺼짐 안내(2026-10-05 · byok 스위치) */
.ak-off { display: flex; align-items: flex-start; gap: var(--space-1); margin: 0; color: var(--sub); }
.ak-off .ico-sm { flex: none; margin-top: 3px; }
