/* 온기 — 하늘나라 강아지 3D 메모리얼
   밤(night): 랜딩 A·등록·3D  /  낮(day): B안 산책 랜딩
   톤: 깊은 밤하늘 + 따뜻한 금빛 하나. 제목은 고운바탕, 본문은 Noto Sans KR */

:root {
  --night: #0F1424;
  --night-2: #161C31;
  --night-3: #1E2542;
  --line: #2C3454;
  --ink: #EEF0F6;
  --soft: #C9CEDC;
  --muted: #A3AAC2;
  --gold: #F2C98B;
  --gold-hi: #FFE2B3;
  --gold-ink: #1C1608;
  --danger: #FF9E8A;
  --display: "Gowun Batang", serif;
  --body: "Noto Sans KR", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --r-lg: 32px;
  --r-md: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); line-height: 1.7; word-break: keep-all; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; text-wrap: balance; letter-spacing: -.02em; }
img, svg { display: block; }
[hidden] { display: none !important; }
a, button, label, input, textarea { touch-action: manipulation; }
[id] { scroll-margin-top: 24px; }

/* 테마 */
.night { --bg: var(--night); --surface: var(--night-2); --text: var(--ink); --text-2: var(--soft); --text-3: var(--muted); --accent: var(--gold); --accent-hi: var(--gold-hi); --on-accent: var(--gold-ink); --rule: var(--line); color-scheme: dark; background: var(--bg); color: var(--text); }
.day { --bg: #F5EDE1; --surface: #FFF7EC; --text: #3B2A1E; --text-2: #5E4A3B; --text-3: #75604F; --accent: #7A4E2D; --accent-hi: #5A3820; --on-accent: #FFF8EE; --rule: #E2CFB4; color-scheme: light; background: var(--bg); color: var(--text); }

/* 브라우저 기본 요소도 팔레트로 */
::selection { background: var(--accent); color: var(--on-accent); }
html { scrollbar-color: var(--rule) var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
input, textarea { caret-color: var(--accent); }

.skip { position: absolute; left: 16px; top: -60px; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* 머리 */
.top { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }
.logo { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--accent); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; font-size: 15px; }
.top nav a:not(.btn) { color: var(--text-2); text-decoration: none; padding: 10px 0; }
.top nav a:not(.btn):hover { color: var(--text); }
.top .here { font-size: 14px; color: var(--text-3); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 26px; border-radius: 999px; border: 1px solid transparent; font: 700 16px/1.2 var(--body); text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s, transform .15s var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hi); }
.btn.ghost { border-color: var(--rule); background: transparent; color: var(--text); font-weight: 500; }
.btn.ghost:hover { border-color: var(--text-3); }
.btn.small { min-height: 44px; padding: 10px 20px; font-size: 15px; }

/* 히어로 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding-top: 40px; padding-bottom: 112px; min-height: min(calc(100svh - 96px), 760px); }
.hero h1 { font-size: clamp(42px, 5.4vw, 68px); line-height: 1.22; }
.hero .lead { margin-top: 24px; font-size: 18px; color: var(--text-2); max-width: 30em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* 메인 히어로: 화면 가득 밤하늘 + 가운데 큰 제목 (아래 지평선에서 금빛이 살짝) */
.sky-hero { position: relative; overflow: hidden; display: grid; place-items: center; text-align: center; min-height: min(calc(100svh - 96px), 760px); padding: 40px 0 120px; background: radial-gradient(60% 48% at 50% 100%, #283253, transparent 72%); }
.sky-hero .stars-bg { position: absolute; inset: 0; }
.sky-hero .wrap { position: relative; }
.sky-hero h1 { font-size: clamp(44px, 6.6vw, 88px); line-height: 1.18; }
.sky-hero .lead { margin: 28px auto 0; font-size: 18px; color: var(--text-2); max-width: 32em; }
.sky-hero .cta { justify-content: center; margin-top: 40px; }

/* 무대: 구름 위 강아지 + 별 */
.stage { position: relative; aspect-ratio: 1 / 1; max-height: 560px; width: 100%; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(120% 90% at 50% 85%, #3D3656 0%, #1C2238 55%, #121729 100%); border: 1px solid var(--line); color: var(--gold); }
.stage .dog { position: absolute; left: 50%; bottom: 15.5%; width: 46%; transform: translateX(-50%); }
.stage .cloud { position: absolute; left: 50%; bottom: 9%; width: 62%; height: 15%; transform: translateX(-50%); }
.stage .glow { position: absolute; left: 50%; bottom: 12%; width: 58%; height: 12%; transform: translateX(-50%); border-radius: 50%; background: var(--gold); opacity: .16; filter: blur(22px); }
.star { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 8px rgba(255, 226, 179, .6); }

/* 섹션 공통 */
.sec { padding-top: 120px; padding-bottom: 120px; }
.sec h2 { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.35; }
.sec .sub { margin-top: 16px; font-size: 17px; color: var(--text-2); max-width: 34em; }
.band { background: var(--surface); }

/* 세 단계 = 별자리처럼 이어진 점 (카드 대신) */
.path { list-style: none; padding: 0; margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; position: relative; }
.path::before { content: ""; position: absolute; left: 12px; right: 12px; top: 11px; border-top: 2px dashed var(--rule); }
.path li { position: relative; padding-top: 48px; }
.path li::before { content: ""; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 6px var(--surface); }
.path li:last-child::before { background: var(--accent); }
.path h3 { font-size: 22px; font-weight: 700; line-height: 1.4; }
.path p { margin-top: 10px; font-size: 16px; color: var(--text-2); max-width: 22em; }

/* 기능 */
.feature { display: block; }

/* 마무리 */
.closing { text-align: center; padding-top: 128px; padding-bottom: 128px; }
.closing h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.4; }
.closing .cta { justify-content: center; }
footer { border-top: 1px solid var(--rule); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 36px; font-size: 14px; color: var(--text-3); }
footer .logo { font-size: 20px; }

/* 폼 (등록) */
.steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--text-3); }
.steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--night-3); font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.steps [aria-current] { border-color: var(--accent); color: var(--text); }
.steps [aria-current] b { background: var(--accent); color: var(--on-accent); }
.reg h1 { margin-top: 28px; font-size: clamp(34px, 4vw, 46px); line-height: 1.3; }
.reg .sub { margin-top: 12px; font-size: 16px; color: var(--text-2); }
.reg-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; margin-top: 40px; align-items: start; }
.panel { padding: 36px; border-radius: 28px; background: var(--surface); }
.panel h2 { font-family: var(--body); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.panel .hint { margin-top: 4px; font-size: 14px; color: var(--text-3); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.field.full { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--night); color: var(--ink); font: 400 16px/1.5 var(--body); transition: border-color .2s; }
.field textarea { resize: vertical; min-height: 104px; }
.field input::placeholder, .field textarea::placeholder { color: #8A92AC; }
.field input:hover, .field textarea:hover { border-color: #4A5375; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 201, 139, .25); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.err { font-size: 13px; color: var(--danger); min-height: 0; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--night-3); display: flex; align-items: flex-end; padding: 10px; font-size: 13px; color: var(--soft); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph span { position: relative; padding: 2px 8px; border-radius: 999px; background: rgba(15, 20, 36, .75); }
.add { aspect-ratio: 1; border-radius: 16px; border: 1.5px dashed #4A5375; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--gold); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .2s, background-color .2s; }
.add:hover { border-color: var(--gold); background: rgba(242, 201, 139, .06); }
.add:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tips { margin-top: 20px; padding: 16px 20px 16px 36px; border-radius: 16px; background: var(--night); font-size: 14px; line-height: 1.9; color: var(--soft); }
.local { margin-top: 14px; font-size: 13px; color: var(--text-3); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 32px; padding-bottom: 96px; }

/* 추억 남기기: 사진 + 이야기 + 강아지의 한마디 미리보기 */
.mems-panel { margin-top: 28px; }
.mems { list-style: none; padding: 0; margin-top: 24px; display: flex; flex-direction: column; gap: 16px; counter-reset: mem; }
.mem { position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; padding: 20px; border-radius: 22px; background: var(--night); border: 1px solid var(--line); counter-increment: mem; }
.mem .pick { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1.5px dashed #4A5375; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--gold); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .2s, background-color .2s; }
.mem .pick:hover { border-color: var(--gold); background: rgba(242, 201, 139, .06); }
.mem .pick:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.mem .pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mem .pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mem .pick.has { border-style: solid; border-color: transparent; }
.mem .pick.has .lbl { position: absolute; left: 8px; bottom: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(15, 20, 36, .8); font-size: 12px; color: var(--soft); }
.mem .pick.has svg { display: none; }
.mem .body { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 12px; align-content: start; }
.mem .body .field.full { grid-column: 1 / -1; }
.mem .field textarea { min-height: 76px; }
.mem select { width: 100%; padding: 14px 40px 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--night-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23C9CEDC' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center; color: var(--ink); font: 400 16px/1.5 var(--body); appearance: none; cursor: pointer; }
.mem select:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 201, 139, .25); }
.mem .reply { grid-column: 1 / -1; padding: 14px 18px; border-radius: 16px; background: var(--night-3); font-family: var(--display); font-size: 17px; line-height: 1.6; color: var(--ink); }
.mem .reply b { display: block; font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--gold); margin-bottom: 2px; }
.mem .del { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color .2s, background-color .2s; }
.mem .del:hover { color: var(--ink); background: var(--night-3); }
.mem:only-child .del { display: none; }
.mem .body > .field:first-child { padding-right: 36px; }
.more { margin-top: 16px; }
.more[disabled] { opacity: .5; cursor: default; }

/* 3D로 만나기 */
.meet { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 28px; align-items: stretch; padding-top: 8px; padding-bottom: 96px; }
.viewer { position: relative; min-height: 640px; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(110% 80% at 50% 82%, #4A4060 0%, #1E2540 55%, #121729 100%); border: 1px solid var(--line); color: var(--gold); display: flex; flex-direction: column; justify-content: space-between; cursor: grab; user-select: none; touch-action: pan-y; }
.viewer:active { cursor: grabbing; }
.viewer:focus-visible { outline-offset: 4px; }
.viewer .bar { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px; font-size: 13px; color: var(--soft); }
.chip { padding: 6px 12px; border-radius: 999px; background: rgba(15, 20, 36, .7); }
.scene { position: relative; flex: 1; perspective: 900px; }
.scene .model { position: absolute; left: 50%; bottom: 14%; width: min(46%, 300px); transform-style: preserve-3d; transform: translateX(-50%) rotateY(var(--ry, 0deg)) scale(var(--zoom, 1)); transform-origin: 50% 100%; transition: transform .45s var(--ease-out); }
.viewer.dragging .model { transition: none; }
.model .dog { width: 100%; transition: transform .45s var(--ease-out); transform-origin: 50% 100%; }
.dog3d { position: absolute; inset: 0; }
.dog3d canvas { display: block; width: 100%; height: 100%; }
.scene:has(.dog3d.ready) .model, .scene:has(.dog3d.ready) .cloud { display: none; }
.scene:has(.dog3d.ready) .glow { opacity: .3; bottom: 12%; }
.scene .cloud { position: absolute; left: 50%; bottom: 5%; width: 64%; height: 15%; transform: translateX(-50%); }
.scene .glow { position: absolute; left: 50%; bottom: 9%; width: 56%; height: 12%; transform: translateX(-50%); border-radius: 50%; background: var(--gold); opacity: .2; filter: blur(22px); }
.controls { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 20px; cursor: default; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(15, 20, 36, .7); border: 1px solid #39415F; }
.seg button { min-height: 40px; padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--soft); font: 500 14px/1 var(--body); cursor: pointer; transition: background-color .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #39415F; background: rgba(15, 20, 36, .7); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-color .2s, color .2s; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.profile { display: flex; flex-direction: column; gap: 16px; }
.card { padding: 32px; border-radius: 28px; background: var(--surface); }
.profile .who { display: flex; align-items: center; gap: 16px; }
.profile .photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; }
.profile h1 { font-size: 40px; line-height: 1.2; overflow-wrap: anywhere; }
.profile .state { font-size: 14px; color: var(--gold); }
.facts { display: grid; grid-template-columns: 88px minmax(0, 1fr); row-gap: 12px; margin-top: 24px; font-size: 15px; }
.facts dt { color: var(--text-3); }
.facts dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.memory p { font-family: var(--display); font-size: 20px; line-height: 1.7; overflow-wrap: anywhere; }
.memory .label { font-family: var(--body); font-size: 14px; color: var(--text-3); margin-bottom: 8px; }
.sample { font-size: 13px; color: var(--text-3); }
.mini { padding: 24px 28px; }
.mini .label { font-size: 14px; color: var(--text-3); }
.mini ul { list-style: none; padding: 0; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.mini li { display: flex; align-items: center; gap: 12px; font-size: 15px; min-width: 0; }
.mini li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini img, .mini .nopic { width: 48px; height: 48px; flex: none; border-radius: 12px; object-fit: cover; background: var(--night-3); }

/* 반응형 */
@media (max-width: 900px) {
  .hero, .reg-grid, .meet { grid-template-columns: 1fr; }
  .hero { min-height: 0; gap: 40px; padding-top: 16px; padding-bottom: 80px; }
  .stage { max-height: none; aspect-ratio: 4 / 3.4; }
  .sec { padding-top: 88px; padding-bottom: 88px; }
  .path { grid-template-columns: 1fr; gap: 36px; margin-top: 48px; }
  .path::before { left: 11px; right: auto; top: 12px; bottom: 12px; border-top: 0; border-left: 2px dashed var(--rule); }
  .path li { padding-top: 0; padding-left: 48px; }
  .viewer { min-height: 520px; }
}
@media (max-width: 560px) {
  .top nav a.opt { display: none; }
  .seg button { padding: 8px 11px; }
  .icon-btn { width: 44px; height: 44px; }
  .controls { flex-wrap: nowrap; }
  .controls { gap: 6px; padding: 16px 12px; }
  .fields { grid-template-columns: 1fr; }
  .mem { grid-template-columns: 1fr; padding: 16px; }
  .mem .pick { aspect-ratio: 16 / 10; }
  .mem .body { grid-template-columns: 1fr; }
  .mem .body > .field:first-child { padding-right: 0; }
  .mem .del { background: rgba(15, 20, 36, .8); z-index: 1; right: 22px; top: 22px; }
  .panel, .card { padding: 26px 22px; }
  .hero .lead br, .sky-hero .lead br, .sub br { display: none; }
  .sky-hero { min-height: 0; padding: 72px 0 96px; }
  .btn { flex: 1 1 auto; }
  .actions .btn { flex: 1 1 0; }
}

/* 움직임: 히어로 등장 1번 + 별 반짝임. 움직임 줄이기면 전부 정지 */
@media (prefers-reduced-motion: no-preference) {
  .enter > * { animation: rise .9s var(--ease-out) both; }
  .enter > *:nth-child(2) { animation-delay: .08s; }
  .enter > *:nth-child(3) { animation-delay: .16s; }
  .enter > *:nth-child(4) { animation-delay: .24s; }
  .stage .dog, .scene .model .dog { animation: breathe 5s ease-in-out infinite; transform-origin: 50% 100%; }
  .star { animation: twinkle 4s ease-in-out infinite; animation-delay: var(--d, 0s); }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1 1.015; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* 함께한 날 (11/16: PC = 한 달력에서 두 날, 폰 = 편지지 휠) */
.together { position: relative; }
.reg-grid { position: relative; z-index: 2; } /* 달력이 아래 추억 칸 위로 뜨게 */
.tg-lab { display: block; }
.tg-pair, .tg-tabs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.tg-arrow { color: var(--gold); }
.tg-end, .tg-tab { min-width: 0; text-align: left; border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.tg-end { padding: 12px 16px; border-radius: 14px; background: var(--night); }
.tg-end:hover { border-color: #4A5375; }
.tg-end small, .tg-tab small { display: block; font: 500 12px/1.4 var(--body); color: var(--muted); }
.tg-end b, .tg-tab b { display: block; margin-top: 3px; font: 700 17px/1.4 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-end.empty b { font: 400 16px/1.5 var(--body); color: #8A92AC; }
.tg-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 4px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(120% 160% at 0% 0%, rgba(242, 201, 139, .14), transparent 60%), var(--night); }
.tg-sum b { font: 700 28px/1.2 var(--display); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.tg-sum small { font-size: 14px; color: var(--soft); }

.tg-pop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; width: min(380px, 100%); padding: 18px; border-radius: 22px; border: 1px solid #333C60; background: #141A30; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.tg-tabs { gap: 8px; margin-bottom: 14px; }
.tg-tab { padding: 9px 12px; border-radius: 14px; border-color: #333C60; background: none; }
.tg-tab b { font-size: 15px; }
.tg-tab.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 201, 139, .15); }
.tg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tg-title { display: inline-flex; align-items: center; gap: 6px; margin-left: -8px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: var(--gold-hi); font: 700 17px/1 var(--display); cursor: pointer; }
.tg-title:hover { background: rgba(242, 201, 139, .1); }
.tg-nav { display: flex; gap: 6px; }
.tg-nav button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #333C60; background: none; color: var(--soft); cursor: pointer; }
.tg-nav button:hover:not(:disabled) { border-color: #4A5375; color: var(--ink); }
.tg-nav button:disabled { opacity: .35; cursor: default; }
.tg-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.tg-w { padding-bottom: 4px; font-size: 12px; color: var(--muted); }
.tg-w:first-child { color: #E8A99A; }
.tg-d { display: grid; place-items: center; height: 38px; padding: 0; border: 0; background: none; color: var(--soft); font: 500 14px/1 var(--body); font-variant-numeric: tabular-nums; cursor: pointer; }
.tg-d span { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; transition: background-color .15s; }
.tg-d:not(.a):not(.b):hover:not(:disabled) span { background: rgba(255, 255, 255, .08); }
.tg-d:disabled { color: #3E4766; cursor: default; }
.tg-d.now span::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
.tg-d.in { background: #283253; }
.tg-d.a.run { background: linear-gradient(90deg, transparent 50%, #283253 50%); }
.tg-d.b.run { background: linear-gradient(90deg, #283253 50%, transparent 50%); }
.tg-d.a span, .tg-d.b span { color: var(--gold-ink); font-weight: 700; }
.tg-d.a span { background: var(--gold); }
.tg-d.b span { background: #F6D9E0; box-shadow: 0 0 16px rgba(246, 217, 224, .5); }
.tg-d:focus-visible { outline: none; }
.tg-d:focus-visible span { box-shadow: 0 0 0 2px var(--gold-hi); }
.tg-years, .tg-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tg-years { position: relative; max-height: 252px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #333C60 transparent; }
.tg-months { grid-template-columns: repeat(3, 1fr); }
.tg-y { height: 44px; border: 0; border-radius: 12px; background: none; color: var(--soft); font: 500 15px/1 var(--body); font-variant-numeric: tabular-nums; cursor: pointer; }
.tg-y:hover:not(:disabled):not(.on) { background: rgba(255, 255, 255, .07); }
.tg-y.on { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.tg-y:disabled { color: #3E4766; cursor: default; }
.tg-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #333C60; }
.tg-foot button { padding: 8px 4px; border: 0; background: none; color: var(--muted); font: 500 13px/1 var(--body); cursor: pointer; }
.tg-foot button:hover { color: var(--ink); }
.tg-foot [data-today] { color: var(--gold); }
.tg-end:focus-visible, .tg-pop button:not(.tg-d):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.tg-lock { overflow: hidden; }
.tg-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; }
.tg-back { position: absolute; inset: 0; background: rgba(6, 9, 18, .62); }
.tg-card { position: relative; width: 100%; padding: 28px max(20px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); border-radius: 26px 26px 0 0; background: #FFF7EC; color: #3B2A1E; }
.tg-card::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #E2CFB4; }
.tg-q { margin: 0 0 12px; text-align: center; font: 400 16px/1.6 var(--display); color: #75604F; }
.tg-wheels { position: relative; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
.tg-wheels::before { content: ""; position: absolute; left: 0; right: 0; top: 88px; height: 44px; border-radius: 12px; background: #F2E3CC; pointer-events: none; }
.tg-col { position: relative; height: 220px; padding: 88px 0; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; outline: none;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent); mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent); }
.tg-col::-webkit-scrollbar { display: none; }
.tg-col span { display: grid; place-items: center; height: 44px; scroll-snap-align: center; font: 400 18px/1 var(--display); color: #A8927C; font-variant-numeric: tabular-nums; cursor: pointer; }
.tg-col span.on { color: #3B2A1E; font-size: 20px; font-weight: 700; }
.tg-col:focus-visible span.on { color: #7A4E2D; text-decoration: underline; text-underline-offset: 6px; }
.tg-line { margin: 12px 0 0; text-align: center; font: 700 19px/1.4 var(--display); }
.tg-ok { width: 100%; margin-top: 14px; padding: 16px; border: 0; border-radius: 999px; background: #7A4E2D; color: #FFF8EE; font: 700 16px/1 var(--body); cursor: pointer; }
.tg-ok:disabled { opacity: .45; cursor: default; }
.tg-row { display: flex; justify-content: space-between; margin-top: 4px; }
.tg-row button { padding: 12px 6px; border: 0; background: none; color: #75604F; font: 500 14px/1 var(--body); cursor: pointer; }
.tg-sheet button:focus-visible { outline: 2px solid #7A4E2D; outline-offset: 2px; }
@media (max-width: 560px) { .tg-pair { gap: 6px; } .tg-end { padding: 11px 12px; } .tg-end b { font-size: 15px; } }
@media (prefers-reduced-motion: no-preference) {
  .tg-pop:not([hidden]) { animation: tg-pop .18s var(--ease-out); }
  .tg-sheet:not([hidden]) .tg-card { animation: tg-up .32s var(--ease-out); }
  .tg-sheet:not([hidden]) .tg-back { animation: tg-fade .25s ease-out; }
}
@keyframes tg-pop { from { opacity: 0; transform: translateY(-6px); } }
@keyframes tg-up { from { transform: translateY(100%); } }
@keyframes tg-fade { from { opacity: 0; } }
