/* ===== 토큰 ===== */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --ink: #0F141A;
  --ink-2: #404A57;
  --line: #DDE1E6;
  --accent: #2B59FF;
  --accent-strong: #1F45D6;
  --accent-soft: #E9EEFF;
  --danger: #B42318;
  --danger-ink: #B42318;
  --danger-soft: #FDECEA;
  --ok: #0B7A4B;
  --ok-soft: #DDF5E8;
  --accent-deep: #1F45D6;
  --link: #2B59FF;
  --warn: #9A4A00;
  --stage-top: #FFFFFF;
  --stage-bottom: #E2E7EF;
  --radius: 8px;
  --wrap: 1080px;
  --font: 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Malgun Gothic', sans-serif;
}

/* 화면 모드: 기본은 라이트이고, 부드러운 그레이와 다크는 <html data-theme> 값으로 바꾼다(헤더 오른쪽 위 버튼). */
:root[data-theme="gray"] {
  --bg: #DDE1E7;
  --surface: #EEF0F4;
  --ink: #11161F;
  --ink-2: #364050;
  --line: #C3C9D3;
  --accent-soft: #D5DEF7;
  --danger-ink: #A21D12;
  --danger-soft: #F4D8D4;
  --ok: #0A6E43;
  --ok-soft: #CDEBDB;
  --link: #1F45D6;
  --warn: #8A4200;
  --stage-top: #F4F6F9;
  --stage-bottom: #D5DBE5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12151A;
  --surface: #1B1F26;
  --ink: #F6F8FB;
  --ink-2: #C6CDD8;
  --line: #2F3640;
  --accent: #3F63F0;
  --accent-strong: #5B7BF7;
  --accent-soft: #202A4A;
  --accent-deep: #3554DB;
  --danger-ink: #FFA79C;
  --danger-soft: #3A2220;
  --ok: #6EE7A8;
  --ok-soft: #173A2A;
  --link: #8FA8FF;
  --warn: #FFB26B;
  --stage-top: #262C38;
  --stage-bottom: #1B2029;
}

/* ===== 기본 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--font); }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--ink-2); font-size: 14px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--accent)); margin-right: 8px; vertical-align: 1px; }

/* ===== 헤더 / 푸터 ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; padding: 0 12px; border-radius: var(--radius); font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav a:hover { background: var(--bg); }
.search { position: relative; width: 240px; }
.theme-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.theme-btn:hover { color: var(--ink); }
.theme-btn[aria-pressed="true"] { background: var(--surface); border-color: var(--line); color: var(--ink); }
.theme-ico { display: block; font-size: 18px; line-height: 1; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.search input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; font: inherit; font-size: 15px; background: var(--bg); }
.search input:focus { background: var(--surface); border-color: var(--accent); }
.search-results { position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); z-index: 5; }
.search-results[hidden] { display: none; }
.search-results a { display: block; padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--accent-soft); }
.search-results b { display: block; font-size: 15px; }
.search-results span { display: block; font-size: 13px; color: var(--ink-2); }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 40px; }
.footer-nav { display: flex; gap: 0 16px; margin-bottom: 8px; flex-wrap: wrap; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 14px; }

/* ===== 홈 ===== */
.home-head { padding: 40px 0 8px; }
.home-head h1 { font-size: 32px; letter-spacing: -0.02em; margin-bottom: 8px; }
.lead { color: var(--ink-2); font-size: 17px; margin: 0; }
.group { margin-top: 32px; }
.group h2 { font-size: 20px; margin-bottom: 4px; }
.group-desc { color: var(--ink-2); font-size: 15px; max-width: 680px; margin: 0 0 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tool-link { display: block; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.tool-link:hover { border-color: var(--accent); }
.tool-link b { font-size: 16px; }
.tool-link span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.5; margin-top: 2px; }
.tool-link .dot { margin-right: 6px; }

/* ===== 도구 페이지 ===== */
.tool-head { padding: 28px 0 16px; }
.crumb { font-size: 14px; color: var(--ink-2); margin: -8px 0 0; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.tool-head h1 { font-size: 28px; letter-spacing: -0.02em; margin-bottom: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; }
.panel-side { display: grid; gap: 16px; align-content: start; }
.panel-main { min-width: 0; }
.panel-note { margin-top: 12px; }
.field label, .field .label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 12px; font: inherit; background: var(--surface); color: var(--ink);
}
.field textarea { padding: 10px 12px; min-height: 160px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; cursor: pointer; word-break: keep-all;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
}
.btn:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--accent); color: var(--link); box-shadow: 0 6px 14px -6px rgba(16, 24, 40, .25); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
/* 가장 중요한 버튼: 위에서 아래로 살짝 짙어지는 파랑 */
.btn-primary { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%); border-color: transparent; color: #fff; box-shadow: 0 10px 20px -10px rgba(43, 89, 255, .75), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-primary:hover:not(:disabled) { border-color: transparent; color: #fff; filter: brightness(1.08); box-shadow: 0 14px 26px -12px rgba(43, 89, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 10px 20px -10px rgba(43, 89, 255, .75); }
/* 추가·복사·적용처럼 가볍게 누르는 버튼: 연한 파랑 바탕 */
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--link); box-shadow: none; }
.btn-soft:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--link); box-shadow: none; }
/* 지우기·비우기처럼 되돌리기 어려운 버튼: 연한 빨강 바탕 */
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); box-shadow: none; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger-ink); color: var(--danger-ink); box-shadow: none; }
/* 작은 버튼은 알약 모양. 결과 줄의 고정·복사는 마우스에서만 36px, 터치 화면에서는 44px. */
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 999px; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
/* 복사 완료처럼 방금 성공했을 때 */
.btn.is-done { background: var(--ok-soft); border-color: transparent; color: var(--ok); box-shadow: none; transform: none; }
/* 켜고 끄는 버튼(탭·모드·즐겨찾기·고정): 켜지면 파랑으로 채운다 */
.btn[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 8px 16px -10px rgba(43, 89, 255, .8); }
.btn[aria-pressed="true"]:hover:not(:disabled) { color: #fff; border-color: transparent; filter: brightness(1.08); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result-item { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.result-item .text { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; word-break: break-all; }
.result-item.is-pinned { border-color: var(--accent); background: var(--accent-soft); }
.note { font-size: 14px; color: var(--ink-2); }
.note.is-warn { color: var(--warn); }
.once-note { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); }
.once-note strong { display: block; }
.once-note p { margin: 4px 0 10px; font-size: 14px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* 광고 자리. AdSense 코드를 넣을 때는 빌드된 HTML의 div 에 .is-live 를 붙여 자리를 미리 잡아 둔다(레이아웃 밀림 방지). */
.ad-slot { margin: 24px 0; min-height: 0; }
.ad-slot.is-live { min-height: 280px; }

/* ===== 본문 ===== */
.content { max-width: 720px; margin-top: 32px; }
.prose h1 { font-size: 28px; margin-bottom: 16px; }
.prose h2 { font-size: 20px; margin: 32px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 16px; margin: 20px 0 4px; }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 4px; }
.page { max-width: 680px; margin: 32px 0 0; }
.related { margin-top: 20px; }
.related h2 { font-size: 16px; margin-bottom: 10px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

/* ===== 반응형 ===== */
@media (max-width: 900px) {
}
@media (max-width: 960px) {
  /* 중간 폭: 헤더가 한 줄에 들어가도록 모드 버튼은 점만 보이고 검색칸은 줄인다. */
  .theme-btn .txt { display: none; }
  .theme-btn { padding: 0; }
  .search { width: 190px; }
  .header-inner { gap: 12px; }
}
@media (max-width: 720px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  /* 좁은 화면: 첫 줄에 이름과 검색, 둘째 줄에 가로로 밀리는 묶음 메뉴. */
  .header-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 8px; min-height: 0; padding-top: 8px; padding-bottom: 0; }
  .brand { grid-row: 1; grid-column: 1; }
  .search { grid-row: 1; grid-column: 2; width: auto; }
  .theme-switch { grid-row: 1; grid-column: 3; }
  .theme-btn .txt { display: none; }
  .theme-btn { padding: 0; }
  .nav { grid-row: 2; grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; }
  .home-head h1 { font-size: 26px; }
  .tool-head h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  /* 룰렛 판과 가위바위보 손은 버튼을 눌러 직접 시작하는 동작이라 예외로 둔다. */
  *:not(.wheel):not(.wheel-shadow):not(.rps-hand):not(.rps-card):not(.die-fly):not(.die3d):not(.die-shadow):not(.die-slot):not(.od-person):not(.ts-figure):not(.cc-figure):not(.cc-heart):not(.cc-spark) { transition: none !important; animation: none !important; }
}

/* ===== 문자표 (특수문자·이모티콘) ===== */
.cell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin: 16px 0; }
.cell-grid-wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cell { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; transition: background-color .15s, border-color .15s, transform .08s; background: var(--surface); font: inherit; font-size: 20px; cursor: pointer; color: var(--ink); padding: 0 6px; }
.cell-wide { font-size: 16px; }
.cell:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.cell:active { transform: scale(.96); }
.cell.is-done { background: var(--accent); border-color: var(--accent); color: #fff; }
.cell.is-fail { background: var(--danger); border-color: var(--danger); color: #fff; }
.basket { margin-top: 8px; }
.basket .row { margin-top: 8px; }

.result-item .text-normal { font-size: 16px; font-weight: 500; line-height: 1.6; }

/* ===== 날짜 도구 ===== */
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-height: 44px; }
.check input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center; width: 22px; height: 22px; min-height: 0; padding: 0; border: 2px solid var(--ink-2); border-radius: 7px; background: var(--surface); cursor: pointer; transition: background-color .15s, border-color .15s; }
.check input[type="checkbox"]::after { content: ''; width: 11px; height: 6px; margin-top: -2px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) scale(0); transition: transform .12s; }
.check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.check input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
.check input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.check input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
.big-result { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.big-result-sm { font-size: 20px; font-weight: 700; margin-top: 12px; min-height: 1.6em; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.panel-title { font-size: 17px; margin-bottom: 12px; }
.calc-row .field { flex: 1; min-width: 140px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.table .is-past { color: var(--ink-2); }
.table .nowrap { white-space: nowrap; }
@media (max-width: 720px) {
  .big-result { font-size: 44px; }
  .table { font-size: 14px; }
  .table th, .table td { padding: 10px 6px; }
}

/* ===== 궁합 ===== */
.result-label { font-size: 18px; font-weight: 700; margin: 4px 0 8px; }
.compat-who { margin: 0 0 8px; overflow-wrap: anywhere; }
.meter { display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.meter-track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); }
.meter b { text-align: right; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.person legend { font-weight: 700; padding: 0 6px; font-size: 14px; }

/* ===== 이름 목록 도구 ===== */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.teams:empty { display: none; }
.team { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 0; }
.team h3 { font-size: 15px; margin: 0 0 6px; }
.team ul { margin: 0; padding-left: 18px; }
.team li { overflow-wrap: anywhere; }
/* 빈 상태 문구도 aria-live 영역으로 남아 있어야 해서 숨기지 않고 여백만 없앤다. */
.note:empty { margin: 0; }
.panel-side > .note:empty { margin-top: -16px; }
.panel-main .result-list { margin-bottom: 12px; }
.numbered { counter-reset: n; }
.numbered .result-item::before { counter-increment: n; content: counter(n); flex: none; min-width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 700; }

/* ===== 룰렛 ===== */
.wheel-wrap { position: relative; width: min(100%, 420px); margin: 0 auto; padding: 10px 0 26px; overflow: hidden; }
.wheel { position: relative; z-index: 1; display: block; width: 100%; height: auto; border-radius: 50%; }
/* 판 아래 바닥 그림자와, 돌지 않고 제자리에 있는 유리 같은 반짝임(빛이 늘 위쪽에서 오는 것처럼 보이게 한다). */
.wheel-shadow { position: absolute; left: 8%; right: 8%; bottom: 4px; height: 26px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 70%); filter: blur(3px); }
.wheel-gloss { position: absolute; left: 0; right: 0; top: 10px; aspect-ratio: 1; border-radius: 50%; z-index: 2; pointer-events: none; background: radial-gradient(ellipse 40% 22% at 32% 15%, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 100%); }
.wheel-pointer { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 30px solid #E53935; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .45)); z-index: 3; }
#rl-result { text-align: center; font-size: 24px; overflow-wrap: anywhere; }
.history { margin: 8px 0 0; padding-left: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.history li { font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; overflow-wrap: anywhere; }
.history:empty { display: none; }

/* ===== 사다리타기 ===== (선 색은 core.PALETTE) */
.ladder-wrap { overflow-x: auto; padding: 4px 0 8px; }
.ladder-wrap svg { display: block; margin: 0 auto; max-width: none; }
.ladder-wrap svg.is-fit { max-width: 100%; height: auto; }
.ladder-wrap svg.is-compact .ld-pill-text { font-size: 13px; }
.ld-shadow rect { fill: #000; opacity: .22; }
.ld-rail, .ld-rung { stroke: #6B4220; stroke-width: .8; }
.ld-rail-shine { fill: #fff; opacity: .35; }
.ld-foot { fill: #3A2A1A; }
.ld-path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.ld-pill { cursor: pointer; outline: none; }
.ld-pill rect { stroke: transparent; stroke-width: 3; }
.ld-pill-text { fill: #fff; font-size: 14px; font-weight: 600; font-family: var(--font); pointer-events: none; }
.ld-pill.is-revealed { cursor: default; }
.ld-pill:focus-visible rect { stroke: var(--ink); stroke-width: 4; }
.ld-prize { fill: var(--ink); font-size: 14px; font-weight: 700; font-family: var(--font); }
.ld-prize.is-pop { animation: ld-pop .6s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes ld-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
/* 사다리를 걸어 내려가는 사람 */
.ld-walker { color: var(--accent); pointer-events: none; }
.ld-walker-head { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
.ld-walker-limb { stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.ld-walker-name { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.ld-log { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.ld-log:empty { display: none; }
.ld-log li { font-weight: 600; overflow-wrap: anywhere; }

/* ===== 주사위 ===== */
/* 던져서 굴러가는 3D 주사위. 쟁반 위에 놓이고, 눈은 CSS 로 그린다. */
.dice-board { --die: 72px; position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 30px 34px; min-height: 270px; padding: 36px 14px 30px; border: 1px solid #1F5A38; border-radius: var(--radius); background: radial-gradient(ellipse at 50% 35%, #3E9B66 0%, #2A7A4E 55%, #1D5A39 100%); perspective: 900px; overflow: hidden; }
.dice-board:empty::before { content: '던지기를 누르면 주사위가 굴러가요.'; align-self: center; color: rgba(255, 255, 255, .85); font-size: 15px; }
.dice-board.is-idle { padding-bottom: 46px; }
.dice-board.is-idle::after { content: '주사위를 던져 보세요'; position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: rgba(255, 255, 255, .88); font-size: 14px; font-weight: 600; }
.dice-board.is-idle .die-slot { animation: die-bob 2.8s ease-in-out infinite; }
.dice-board.is-idle .die-slot:nth-child(2n) { animation-delay: .7s; }
.dice-board.is-idle .die-slot:nth-child(3n) { animation-delay: 1.4s; }
@keyframes die-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.dice-board.is-many { --die: 56px; gap: 22px 24px; }
.die-slot { position: relative; width: var(--die); height: var(--die); }
.die-shadow { position: absolute; left: 4%; right: -10%; bottom: -18%; height: 24%; border-radius: 50%; background: #06251A; opacity: .3; filter: blur(4px); }
.die-fly { position: absolute; inset: 0; transform-style: preserve-3d; }
.die-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-26deg) rotateY(-30deg); }
.die3d { position: absolute; inset: 0; transform-style: preserve-3d; }
/* 면마다 같은 색 그라데이션 위에, 아래 ::before 의 반짝임과 ::after 의 빛·그림자를 겹쳐서 입체감을 낸다. */
.die-face { position: absolute; inset: 0; display: grid; place-items: center; box-sizing: border-box; border-radius: calc(var(--die) * .2); border: 1px solid rgba(0, 0, 0, .28); background: linear-gradient(145deg, var(--c-light, #fff) 0%, var(--c-base, #ddd) 52%, var(--c-dark, #aaa) 100%); box-shadow: inset 0 0 0 calc(var(--die) * .035) rgba(255, 255, 255, .28), inset 0 calc(var(--die) * -.07) calc(var(--die) * .12) rgba(0, 0, 0, .28); color: var(--pip, #fff); font-size: calc(var(--die) * .46); font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); backface-visibility: hidden; overflow: hidden; }
.die-face::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at 28% 18%, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 52%); pointer-events: none; }
.die-face::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.die-face[data-role="top"]::after { background: rgba(255, 255, 255, .22); }
.die-face[data-role="shade"]::after { background: rgba(0, 0, 0, .3); }
.die-face-front { transform: translateZ(calc(var(--die) / 2)); }
.die-face-back { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.die-face-right { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.die-face-left { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.die-face-top { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.die-face-bottom { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }
.die-face.is-pips { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: calc(var(--die) * .14); text-shadow: none; }
.pip-cell { display: grid; place-items: center; position: relative; z-index: 1; }
.pip { display: block; width: calc(var(--die) * .17); height: calc(var(--die) * .17); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--pip) 55%); box-shadow: inset 0 calc(var(--die) * .025) calc(var(--die) * .04) rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .35); }
.pip.is-one { width: calc(var(--die) * .26); height: calc(var(--die) * .26); background: radial-gradient(circle at 35% 30%, #fff 0%, var(--pip-one) 60%); }
.dice-board.is-wide .die-face { font-size: calc(var(--die) * .3); }
.dice-presets { margin-top: 8px; }
.dice-presets .btn { min-height: 44px; }
#dc-sum { overflow-wrap: anywhere; }
.btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.history-left { justify-content: flex-start; }

/* ===== 제비뽑기: 가위바위보 ===== */
.rps-stage { margin-bottom: 8px; }
.rps-stage[hidden] { display: none; }
.rps-duels { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.rps-duel { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rps-vs { font-weight: 800; font-size: 14px; color: var(--ink-2); }
.rps-card { display: grid; justify-items: center; gap: 4px; min-width: 112px; padding: 8px 6px 4px; border: 2px solid transparent; border-radius: var(--radius); transition: opacity .3s, border-color .3s; }
.rps-name { font-weight: 700; font-size: 15px; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rps-hand { display: block; width: 104px; height: 130px; transform-origin: 50% 92%; }
.rps-hand-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rps-card.is-right .rps-hand-svg { transform: scaleX(-1); }
.rps-hand.is-shaking { animation: rps-shake .38s ease-in-out 3; }
.rps-card.is-win { border-color: var(--accent); background: var(--accent-soft); }
.rps-card.is-win .rps-hand { animation: rps-pop .45s ease-out; }
.rps-card.is-out { opacity: .35; filter: grayscale(1); }
.rps-idle { display: flex; justify-content: center; align-items: flex-end; gap: 14px; padding: 28px 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rps-idle-item { display: grid; justify-items: center; gap: 6px; }
.rps-idle-item .rps-hand { width: 112px; height: 140px; animation: rps-bob 2.6s ease-in-out infinite; }
.rps-idle-item:nth-child(2) .rps-hand { animation-delay: .5s; }
.rps-idle-item:nth-child(3) .rps-hand { animation-delay: 1s; }
.rps-idle-name { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.rps-idle-text { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
@keyframes rps-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.rps-byes { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.rps-caption { min-height: 1.7em; margin: 4px 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.rps-caption:empty { min-height: 0; margin: 0; }
.rps-winners { display: flex; flex-wrap: wrap; gap: 8px; }
.rps-winner { padding: 10px 18px; border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 20px; font-weight: 800; }
@keyframes rps-shake { 0%, 100% { transform: translateY(6px) rotate(-12deg); } 50% { transform: translateY(-18px) rotate(12deg); } }
@keyframes rps-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ===== 순서 정하기: 첫 화면의 사람 모양 ===== */
.od-stage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; align-items: end; gap: 6px 10px; padding: 24px 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
.od-person { position: relative; display: grid; justify-items: center; gap: 4px; animation: od-bob 2.8s ease-in-out infinite; }
.od-person:nth-child(2) { animation-delay: .5s; }
.od-person:nth-child(3) { animation-delay: 1s; }
.od-person:nth-child(4) { animation-delay: 1.5s; }
.od-badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 16px; font-weight: 800; }
.od-figure { width: 92px; }
.person-svg { display: block; width: 100%; height: auto; }
.od-stage-text { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
@keyframes od-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (max-width: 420px) { .od-figure { width: 64px; } .od-stage { padding: 18px 6px 12px; } }

/* ===== 팀 나누기: 첫 화면의 응원하는 선수들 ===== */
.ts-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; padding: 22px 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
.ts-team { display: grid; justify-items: center; gap: 6px; }
.ts-players { display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.ts-figure { width: 88px; animation: ts-cheer 1.3s ease-in-out infinite; transform-origin: 50% 100%; }
.ts-team .ts-figure:nth-child(2) { animation-delay: .35s; }
.ts-team.is-blue .ts-figure:nth-child(1) { animation-delay: .7s; }
.ts-team.is-blue .ts-figure:nth-child(2) { animation-delay: 1.05s; }
.ts-label { padding: 2px 14px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 800; }
.ts-team.is-red .ts-label { background: #C62828; }
.ts-team.is-blue .ts-label { background: #1C5BC4; }
.ts-vs { align-self: center; font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.ts-stage-text { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
@keyframes ts-cheer { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-9px) scaleY(1.02); } }
@media (max-width: 520px) { .ts-figure { width: 56px; } .ts-stage { padding: 16px 6px 12px; } .ts-vs { font-size: 16px; } }

/* ===== 팀 나누기: 결과 화면(팀별로 서 있는 사람들, 머리 위에 이름) ===== */
.ts-stage.is-result { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 22px 20px; padding: 20px 12px 16px; --fw: 62px; }
.ts-stage.is-result[data-size="md"] { --fw: 50px; gap: 18px 14px; }
.ts-stage.is-result[data-size="sm"] { --fw: 40px; gap: 14px 10px; }
.ts-group { display: grid; justify-items: center; gap: 8px; }
.ts-members { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 6px 2px; max-width: calc(var(--fw) * 3 + 14px); }
.ts-member { display: grid; justify-items: center; gap: 2px; }
.ts-name { max-width: calc(var(--fw) + 18px); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-stage.is-result .ts-figure { width: var(--fw); animation-name: ts-drop, ts-cheer; animation-duration: .55s, 1.3s; animation-timing-function: cubic-bezier(.2, .9, .3, 1.25), ease-in-out; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + .6s); animation-iteration-count: 1, infinite; animation-fill-mode: backwards, none; }
.ts-stage.is-result[data-size="sm"] .ts-name { font-size: 11px; padding: 0 5px; }
@keyframes ts-drop { from { transform: translateY(-120px) scale(.6); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@media (max-width: 520px) { .ts-stage.is-result { --fw: 46px; } .ts-stage.is-result[data-size="md"] { --fw: 40px; } .ts-stage.is-result[data-size="sm"] { --fw: 34px; } }

/* ===== 순서 정하기: 결과 화면(순서대로 선 사람들, 머리 위에 번호와 이름) ===== */
.od-stage.is-result { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 18px 8px; padding: 20px 10px 14px; --fw: 76px; }
.od-stage.is-result[data-size="md"] { --fw: 58px; gap: 14px 6px; }
.od-stage.is-result[data-size="sm"] { --fw: 44px; gap: 12px 4px; }
.od-stage.is-result .od-person { animation-name: od-drop, od-bob; animation-duration: .55s, 2.8s; animation-timing-function: cubic-bezier(.2, .9, .3, 1.25), ease-in-out; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + .6s); animation-iteration-count: 1, infinite; animation-fill-mode: backwards, none; }
.od-stage.is-result .od-figure { width: var(--fw); }
.od-stage.is-result .od-badge { width: 28px; height: 28px; font-size: 15px; }
.od-name { max-width: calc(var(--fw, 92px) + 22px); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-stage.is-result[data-size="sm"] .od-badge { width: 22px; height: 22px; font-size: 12px; }
.od-stage.is-result[data-size="sm"] .od-name { font-size: 11px; padding: 0 5px; }
.od-stage.is-result .od-stage-text { flex-basis: 100%; }
@keyframes od-drop { from { transform: translateY(-110px) scale(.6); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@media (max-width: 520px) { .od-stage.is-result { --fw: 54px; } .od-stage.is-result[data-size="md"] { --fw: 44px; } .od-stage.is-result[data-size="sm"] { --fw: 36px; } }

/* 결과 화면의 사람 그림은 누르면 남자·여자가 바뀌는 버튼이다(기본 버튼 모양은 지운다). */
button.od-figure, button.ts-figure { display: block; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius); }
button.od-figure:focus-visible, button.ts-figure:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== 커플 궁합: 기승전결 이야기 ===== */
.story-title { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.story-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; padding: 0; list-style: none; }
.story-chip { display: grid; gap: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: 13px; }
.story-chip-label { font-size: 12px; color: var(--ink-2); }
.story-act { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.story-act h3 { margin: 0 0 4px; font-size: 15px; color: var(--link); }
.story-act p { margin: 0; line-height: 1.75; overflow-wrap: anywhere; }
.story-foot { margin-top: 14px; }

/* ===== 커플 궁합: 마주 보는 두 사람과 하트 ===== */
.cc-stage { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0; padding: 26px 8px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--stage-top), var(--stage-bottom)); perspective: 760px; overflow: hidden; }
.cc-person { display: grid; justify-items: center; gap: 4px; }
.cc-name { max-width: 110px; padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-name[hidden] { display: none; }
.cc-figure { width: 116px; transform-style: preserve-3d; transform-origin: 50% 100%; }
.cc-person.is-left .cc-figure { animation: cc-turn-left 3.4s ease-in-out infinite; }
.cc-person.is-right .cc-figure { animation: cc-turn-right 3.4s ease-in-out infinite; }
.cc-heart { position: relative; align-self: start; width: 74px; margin: 24px 4px 0; animation: cc-beat 1.3s ease-in-out infinite; transform-origin: 50% 60%; z-index: 1; }
.cc-heart-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 4px rgba(150, 10, 60, .35)); }
.cc-heart-text { position: absolute; left: 0; right: 0; top: 30%; text-align: center; color: #fff; font-size: 17px; font-weight: 800; text-shadow: 0 1px 2px rgba(80, 0, 30, .6); }
.cc-spark { position: absolute; left: 50%; top: 56px; width: 12px; height: 11px; opacity: 0; background: #F0386F; clip-path: path('M6 11 C2 8 0 6 0 3.4 C0 1.4 1.6 0 3.2 0 C4.4 0 5.4 0.8 6 1.8 C6.6 0.8 7.6 0 8.8 0 C10.4 0 12 1.4 12 3.4 C12 6 10 8 6 11 Z'); animation: cc-float 3.2s ease-in infinite; }
.cc-spark-1 { margin-left: -34px; animation-delay: 0s; }
.cc-spark-2 { margin-left: 22px; animation-delay: .8s; background: #FF8FA3; }
.cc-spark-3 { margin-left: -12px; animation-delay: 1.6s; background: #C2185B; }
.cc-spark-4 { margin-left: 36px; animation-delay: 2.4s; }
@keyframes cc-turn-left { 0%, 100% { transform: rotateY(34deg) rotate(1deg); } 50% { transform: rotateY(44deg) rotate(3deg) translateX(3px); } }
@keyframes cc-turn-right { 0%, 100% { transform: rotateY(-34deg) rotate(-1deg); } 50% { transform: rotateY(-44deg) rotate(-3deg) translateX(-3px); } }
@keyframes cc-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes cc-float { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-46px) scale(1.15); opacity: 0; } }
@media (max-width: 520px) { .cc-figure { width: 78px; } .cc-heart { width: 54px; margin-top: 28px; } .cc-heart-text { font-size: 13px; } .cc-name { max-width: 76px; font-size: 12px; } }

/* ===== 이모티콘·이모지 보기 ===== */
.emo-search { display: flex; gap: 8px; margin-bottom: 10px; }
.emo-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.emo-search input:focus { border-color: var(--accent); }
.emo-kind { margin-bottom: 8px; }
.emo-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.emo-tabs .btn { flex: none; }
.emo-detail { display: flex; align-items: center; gap: 18px; margin: 6px 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.emo-big { flex: none; display: grid; place-items: center; min-width: 96px; height: 96px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 58px; line-height: 1; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.emo-big.is-text { font-size: 24px; font-family: var(--font); max-width: 220px; overflow-wrap: anywhere; text-align: center; }
.emo-info { min-width: 0; display: grid; gap: 6px; }
.emo-name { margin: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.emo-code { font-size: 13px; color: var(--link); }
.emo-code[hidden], .emo-more[hidden] { display: none; }
.emo-more summary { cursor: pointer; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.emo-codes { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.emo-code-label { color: var(--ink-2); }
.emo-codes code { overflow-wrap: anywhere; }
.emo-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 8px; font-size: 17px; }
.emo-count { padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cell-emoji { font-size: 28px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.cell.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
@media (max-width: 520px) { .emo-detail { flex-direction: column; align-items: flex-start; } }

/* ===== 아이디 만들기: 첫 화면 ===== */
.idg-idle[hidden] { display: none; }
.idg-scene { position: relative; display: grid; place-items: center; min-height: 330px; padding: 28px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--stage-top), var(--stage-bottom)); overflow: hidden; }
.idg-card { position: relative; z-index: 1; width: min(280px, 82%); padding: 46px 20px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 14px 30px rgba(30, 40, 90, .16); animation: idg-card 4.2s ease-in-out infinite; }
.idg-avatar { position: absolute; left: 50%; top: -30px; width: 64px; height: 64px; margin-left: -32px; filter: drop-shadow(0 6px 8px rgba(60, 60, 140, .3)); }
.idg-avatar svg { display: block; width: 100%; height: 100%; }
.idg-at { position: absolute; right: -8px; bottom: -2px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; font-weight: 800; border: 2px solid var(--surface); animation: idg-pop 2.4s ease-in-out infinite; }
.idg-label { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.idg-field { display: flex; align-items: center; min-height: 46px; padding: 0 12px; border: 2px solid var(--accent); border-radius: 12px; background: var(--bg); font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 18px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; }
.idg-caret { flex: none; width: 2px; height: 22px; margin-left: 2px; background: var(--accent); animation: idg-blink 1s steps(1) infinite; }
.idg-rules { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.idg-rules span { padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--bg); }
.idg-chip { position: absolute; z-index: 0; padding: 3px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 13px; font-weight: 700; opacity: 0; animation: idg-float 7s ease-in infinite; white-space: nowrap; }
.idg-chip-1 { left: 5%; bottom: 8%; animation-delay: 0s; }
.idg-chip-2 { right: 5%; bottom: 14%; animation-delay: 1.2s; }
.idg-chip-3 { left: 12%; bottom: 4%; animation-delay: 2.4s; }
.idg-chip-4 { right: 10%; bottom: 2%; animation-delay: 3.6s; }
.idg-chip-5 { left: 2%; bottom: 20%; animation-delay: 4.8s; }
.idg-chip-6 { right: 2%; bottom: 6%; animation-delay: 6s; }
.idg-spark { position: absolute; z-index: 0; width: 14px; height: 14px; background: var(--accent); opacity: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: idg-twinkle 3s ease-in-out infinite; }
.idg-spark-1 { left: 22%; top: 16%; }
.idg-spark-2 { right: 20%; top: 22%; animation-delay: 1s; width: 10px; height: 10px; }
.idg-spark-3 { right: 34%; bottom: 14%; animation-delay: 2s; }
.idg-idle-text { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
@keyframes idg-card { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes idg-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes idg-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes idg-float { 0% { transform: translateY(24px); opacity: 0; } 15% { opacity: .9; } 70% { opacity: .9; } 100% { transform: translateY(-120px); opacity: 0; } }
@keyframes idg-twinkle { 0%, 100% { transform: scale(.3) rotate(0); opacity: 0; } 50% { transform: scale(1) rotate(45deg); opacity: .8; } }
@media (max-width: 520px) { .idg-chip-3, .idg-chip-5 { display: none; } .idg-field { font-size: 16px; } }

.btn-new { background: linear-gradient(135deg, #5B6EE8, #8A4FD6); border-color: transparent; color: #fff; font-weight: 700; }
.btn-new:hover { background: linear-gradient(135deg, #4C5FD9, #7B40C8); border-color: transparent; color: #fff; }
.btn-new[hidden] { display: none; }

/* ===== 만 나이 계산기 ===== */
.age-idle[hidden], #age-out[hidden] { display: none; }
.age-scene { position: relative; display: grid; place-items: end center; min-height: 300px; padding: 20px 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--stage-top), var(--stage-bottom)); overflow: hidden; }
.age-cake { width: min(250px, 72%); height: auto; animation: age-bob 4s ease-in-out infinite; }
.age-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: age-flicker .7s ease-in-out infinite alternate; }
.age-flame-2 { animation-delay: .2s; }
.age-flame-3 { animation-delay: .4s; }
.age-balloon { position: absolute; bottom: -30px; width: 34px; height: 42px; border-radius: 50% 50% 48% 48%; opacity: .9; animation: age-rise 7s ease-in infinite; }
.age-balloon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 26px; background: var(--ink-2); opacity: .5; }
.age-balloon-1 { left: 9%; background: #F27BA0; animation-delay: 0s; }
.age-balloon-2 { right: 10%; background: #5B8DEF; animation-delay: 2.3s; }
.age-balloon-3 { left: 76%; background: #F6BE5C; animation-delay: 4.6s; width: 28px; height: 36px; }
.age-confetti { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: age-fall 5s linear infinite; }
.age-confetti-1 { left: 20%; background: #EF5B7B; }
.age-confetti-2 { left: 38%; background: #3FBF9F; animation-delay: 1.4s; }
.age-confetti-3 { left: 62%; background: #5B8DEF; animation-delay: 2.6s; }
.age-confetti-4 { left: 84%; background: #F6BE5C; animation-delay: 3.8s; }
.age-idle-text { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.age-hero { padding: 14px 4px 4px; }
.age-hero-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.age-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.age-kind { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.age-kind-name { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.age-kind-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.age-kind-help { font-size: 12px; color: var(--ink-2); }
.age-rows { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.age-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.age-row:last-child { border-bottom: 0; }
.age-row-label { color: var(--ink-2); }
.age-row-value { text-align: right; }
.age-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.age-table-wrap .table th { position: sticky; top: 0; background: var(--surface); }
@keyframes age-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes age-flicker { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.85, 1.15) rotate(3deg); } }
@keyframes age-rise { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .9; } 100% { transform: translateY(-340px); opacity: 0; } }
@keyframes age-fall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(320px) rotate(300deg); opacity: 0; } }
@media (max-width: 520px) { .age-kind-num { font-size: 22px; } }

/* ===== 글자수 세기 ===== */
.cnt-text { width: 100%; min-height: 190px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; line-height: 1.6; resize: vertical; }
.cnt-text:focus { border-color: var(--accent); outline: none; }
.cnt-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 0; }
.cnt-stat { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.cnt-stat.is-main { background: var(--surface); border-color: var(--accent); }
.cnt-stat dt { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cnt-stat dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cnt-goal[hidden] { display: none; }
.cnt-bar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cnt-bar-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .2s; }
.cnt-goal.is-over .cnt-bar-fill { background: var(--warn); }
.cnt-goal.is-over .note { color: var(--warn); font-weight: 700; }

/* ===== 글자수 세기: 문항 탭·분량 버튼·넘친 부분 ===== */
.cnt-tabbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cnt-tabs { display: flex; flex: 1; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: thin; min-width: 0; }
.cnt-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.cnt-tab-meta { font-size: 12px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.cnt-tab.is-over .cnt-tab-meta { color: var(--warn); opacity: 1; font-weight: 800; }
.cnt-tab[aria-pressed="true"].is-over .cnt-tab-meta { color: #FFE3DE; }
.cnt-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cnt-deadline-text { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.cnt-deadline-text.is-urgent { color: var(--warn); }
.cnt-over { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--warn); border-radius: var(--radius); background: var(--bg); }
.cnt-over[hidden] { display: none; }
.cnt-over strong { color: var(--warn); font-size: 14px; }
.cnt-over-text { margin: 6px 0 0; max-height: 140px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--warn); font-size: 15px; line-height: 1.6; text-decoration: underline wavy; text-underline-offset: 4px; }

/* ===== 경력 기간 계산기 ===== */
.crr-result { margin-bottom: 16px; padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
.crr-total { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.crr-timeline { margin-top: 14px; }
.crr-timeline[hidden] { display: none; }
.crr-lane { position: relative; height: 28px; margin-bottom: 6px; border-radius: 6px; background: var(--line); opacity: .98; }
.crr-bar { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; min-width: 4px; padding: 0 8px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.crr-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.crr-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.crr-row { display: grid; grid-template-columns: minmax(130px, 1.3fr) 150px 150px auto auto minmax(130px, 1fr); gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.crr-row input[type="text"], .crr-row input[type="date"] { width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; }
.crr-row input:focus { border-color: var(--accent); outline: none; }
.crr-row input:disabled { opacity: .45; }
.crr-ongoing { white-space: nowrap; }
.crr-period { font-size: 14px; font-weight: 700; color: var(--ink); }
.crr-period.is-bad { color: var(--warn); }
@media (max-width: 860px) { .crr-row { grid-template-columns: 1fr 1fr; } .crr-company { grid-column: 1 / -1; } .crr-period { grid-column: 1 / -1; } .crr-total { font-size: 28px; } }
.cnt-tabhint { margin: -6px 0 14px; font-size: 13px; color: var(--ink-2); }

/* ===== 실행취소·확인 안내 ===== */
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; max-width: min(92vw, 560px); padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); font-size: 14px; font-weight: 600; transform: translate(-50%, 12px); opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s; }
.toast.is-open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast-msg { flex: 1 1 auto; min-width: 0; }
.toast .btn { min-height: 36px; background: transparent; color: inherit; border-color: rgba(128, 128, 128, .7); }
.toast .btn.is-primary { background: var(--surface); color: var(--ink); border-color: var(--surface); font-weight: 800; }

/* ===== 글자수 세기: 줄이기 도우미 ===== */
.cnt-trim { margin-top: 14px; padding: 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--bg); }
.cnt-trim[hidden] { display: none; }
.cnt-trim-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.cnt-trim-head .note { margin: 0; }
.cnt-trim-list { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.cnt-trim-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cnt-trim-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cnt-trim-kind { padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cnt-trim-label { font-size: 14px; }
.cnt-trim-saves { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--link); font-variant-numeric: tabular-nums; }
.cnt-trim-preview { grid-column: 1; margin: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.cnt-trim-preview del { color: var(--warn); text-decoration: line-through; }
.cnt-trim-preview ins { color: var(--link); text-decoration: none; font-weight: 700; }
.cnt-trim-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.cnt-trim-warn { grid-column: 1; font-size: 12px; color: var(--ink-2); }
@media (max-width: 520px) { .cnt-trim-item { grid-template-columns: 1fr; } .cnt-trim-actions { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; } }



/* ===== 날짜 선택기 (직접 입력 + 달력 팝업) ===== */
.dp { position: relative; width: 100%; }
.dp .dp-native { position: absolute !important; left: 0; top: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.dp .dp-text.dp-text { width: 100%; min-height: 44px; padding: 0 46px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; }
.dp .dp-text.dp-text:focus { border-color: var(--accent); outline: none; }
.dp .dp-text:disabled { opacity: .45; }
.dp.is-invalid .dp-text.dp-text { border-color: var(--warn); }
.dp-btn { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 40px; display: grid; place-items: center; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--ink-2); cursor: pointer; }
.dp-btn:hover:not(:disabled), .dp-btn[aria-expanded="true"] { background: var(--bg); color: var(--accent); }
.dp-btn:disabled { opacity: .45; cursor: default; }
.dp-btn:focus-visible, .dp-nav:focus-visible, .dp-title:focus-visible, .dp-day:focus-visible, .dp-cell:focus-visible, .dp-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.dp-backdrop { position: fixed; inset: 0; z-index: 1190; background: rgba(0, 0, 0, .4); }
.dp-backdrop[hidden], .dp-pop[hidden] { display: none; }
.dp-pop { position: fixed; z-index: 1200; width: 300px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 16px 40px rgba(0, 0, 0, .28); }
.dp-pop.is-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
.dp-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 4px; margin-bottom: 8px; }
.dp-nav, .dp-title { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.dp-nav { font-size: 22px; line-height: 1; color: var(--ink-2); }
.dp-nav:hover, .dp-title:hover:not(:disabled) { background: var(--bg); }
.dp-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.dp-title:disabled { cursor: default; }
.dp-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 2px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.dp-week .is-sun { color: var(--warn); }
.dp-week .is-sat { color: var(--link); }
.dp-grid { display: grid; gap: 2px; }
.dp-days { grid-template-columns: repeat(7, 1fr); }
.dp-months, .dp-years { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-day { display: grid; place-items: center; aspect-ratio: 1; min-height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.dp-day:hover:not(:disabled):not(.is-selected) { background: var(--bg); }
.dp-day.is-sun { color: var(--warn); }
.dp-day.is-sat { color: var(--link); }
.dp-day.is-out { opacity: .4; }
.dp-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 800; }
.dp-day.is-selected { background: var(--accent); color: #fff; font-weight: 800; box-shadow: none; opacity: 1; }
.dp-day:disabled { opacity: .25; cursor: default; }
.dp-cell { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.dp-cell:hover:not(:disabled) { border-color: var(--accent); }
.dp-cell.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }
.dp-cell.is-today:not(.is-current) { border-color: var(--accent); color: var(--accent); }
.dp-cell:disabled { opacity: .3; cursor: default; }
.dp-foot { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.dp-link { min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--link); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.dp-link:hover:not(:disabled) { background: var(--bg); }
.dp-link:disabled { opacity: .35; cursor: default; }
.dp-close { margin-left: auto; color: var(--ink-2); }

/* 재직 중: 켜고 끄는 알약 */
.crr-ongoing { min-height: 44px; padding: 0 16px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.crr-ongoing:hover { border-color: var(--accent); }
.crr-ongoing:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
.toast .btn { box-shadow: none; }
.toast .btn:hover:not(:disabled) { color: inherit; transform: none; }
.toast .btn.is-primary:hover:not(:disabled) { color: var(--ink); }
.crr-row .btn { white-space: nowrap; }


/* =====================================================================
   오로라 디자인: 부드러운 그라데이션 바탕, 유리 같은 카드, 큰 아이콘과 움직임.
   (앞쪽 기본 규칙 위에 덮어쓰는 층이에요.)
   ===================================================================== */
:root {
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(255, 255, 255, .9);
  --shadow: 0 20px 50px -28px rgba(40, 50, 120, .45);
  --blob-1: #A9B6FF;
  --blob-2: #FFC1E0;
  --blob-3: #BDF2E0;
  --blob-alpha: .55;
}
:root[data-theme="gray"] {
  --glass: rgba(238, 240, 244, .72);
  --glass-line: rgba(255, 255, 255, .55);
  --shadow: 0 20px 50px -28px rgba(40, 50, 90, .4);
  --blob-1: #A6B2E8;
  --blob-2: #E6B8CF;
  --blob-3: #B5DDD0;
  --blob-alpha: .42;
}
:root[data-theme="dark"] {
  --glass: rgba(27, 31, 38, .72);
  --glass-line: rgba(255, 255, 255, .08);
  --shadow: 0 20px 50px -28px rgba(0, 0, 0, .75);
  --blob-1: #3A41C9;
  --blob-2: #9A2F78;
  --blob-3: #0F7A66;
  --blob-alpha: .32;
}

body { position: relative; overflow-x: hidden; }
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--blob-alpha); animation: aurora-drift 20s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 560px; height: 560px; left: -140px; top: -140px; background: var(--blob-1); }
.aurora i:nth-child(2) { width: 480px; height: 480px; right: -120px; top: 60px; background: var(--blob-2); animation-delay: -7s; }
.aurora i:nth-child(3) { width: 540px; height: 540px; left: 30%; top: 560px; background: var(--blob-3); animation-delay: -13s; }
@keyframes aurora-drift { to { transform: translate(60px, 40px) scale(1.12); } }
.site-header, main, .site-footer, .skip { position: relative; z-index: 1; }
.site-header { z-index: 30; }

/* ----- 헤더: 떠 있는 유리 알약 ----- */
.site-header { position: sticky; top: 10px; background: none; border: 0; padding: 10px 0 0; }
.header-inner { width: calc(100% - 24px); max-width: var(--wrap); min-height: 56px; gap: 12px; padding: 6px 8px 6px 14px; background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border: 1px solid var(--glass-line); border-radius: 999px; box-shadow: var(--shadow); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 19px; letter-spacing: -0.03em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; background: linear-gradient(145deg, #7C8BFF, #B84BFF); font-size: 17px; box-shadow: 0 8px 14px -8px #6A5CFF, inset 0 1px 0 rgba(255, 255, 255, .5); font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.nav a { border-radius: 999px; }
.nav a:hover { background: var(--surface); }
.search input { border-radius: 999px; padding: 0 16px; background: var(--surface); }
.search-results { border-radius: 16px; box-shadow: var(--shadow); }
.theme-switch { background: var(--surface); }
.site-footer { background: var(--glass); border-top: 1px solid var(--glass-line); backdrop-filter: blur(12px); }

/* ----- 홈 첫 화면 ----- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: center; padding: 56px 0 28px; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--ink-2); box-shadow: 0 6px 18px -12px rgba(40, 50, 120, .4); }
.pill b { width: 8px; height: 8px; border-radius: 50%; background: #2BC48A; box-shadow: 0 0 0 4px rgba(43, 196, 138, .22); }
.hero h1 { margin: 18px 0 14px; font-size: clamp(36px, 6vw, 62px); line-height: 1.1; letter-spacing: -0.045em; font-weight: 900; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #4F5CFF, #B84BFF 55%, #FF5E9E); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: aurora-shine 6s linear infinite; }
@keyframes aurora-shine { to { background-position: 200% 0; } }
.hero .lead { max-width: 540px; margin: 0 0 22px; }
.hero-search { width: 100%; max-width: 540px; }
.hero-search input { height: 56px; padding: 0 22px; font-size: 16px; border-radius: 18px; border: 1px solid var(--glass-line); background: var(--surface); box-shadow: 0 18px 40px -22px rgba(60, 70, 160, .55); }
.hero-search .search-results { top: 62px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.quick a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); text-decoration: none; transition: transform .15s, color .15s; }
.quick a:hover { color: var(--link); transform: translateY(-2px); }
.hero-art { position: relative; height: 380px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.tile { position: absolute; display: grid; place-items: center; width: 104px; height: 104px; border-radius: 30px; font-size: 52px; box-shadow: 0 24px 40px -18px rgba(40, 50, 120, .5), inset 0 2px 0 rgba(255, 255, 255, .7); animation: aurora-bob 5s ease-in-out infinite; }
.tile:nth-child(1) { left: 6%; top: 6%; background: linear-gradient(145deg, #FFE1A8, #FFB454); --r: -8deg; }
.tile:nth-child(2) { left: 44%; top: 0; width: 128px; height: 128px; font-size: 64px; background: linear-gradient(145deg, #C8D2FF, #8793FF); --r: 6deg; animation-delay: -1s; }
.tile:nth-child(3) { right: 2%; top: 30%; background: linear-gradient(145deg, #FFC6DD, #FF7DB0); --r: 10deg; animation-delay: -2s; }
.tile:nth-child(4) { left: 18%; top: 50%; width: 120px; height: 120px; font-size: 60px; background: linear-gradient(145deg, #BFF1DE, #4FD3A7); --r: -4deg; animation-delay: -3s; }
.tile:nth-child(5) { right: 18%; bottom: 0; background: linear-gradient(145deg, #E3D2FF, #A878FF); --r: -10deg; animation-delay: -4s; }
@keyframes aurora-bob { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(calc(var(--r, 0deg) + 4deg)); } }
.spark { position: absolute; color: #fff; font-size: 22px; text-shadow: 0 0 10px rgba(120, 130, 255, .8); animation: aurora-tw 3s ease-in-out infinite; }
.spark.s1 { left: 38%; top: 34%; } .spark.s2 { right: 8%; top: 6%; animation-delay: -1s; } .spark.s3 { left: 4%; bottom: 12%; animation-delay: -2s; }
@keyframes aurora-tw { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.2); } }

/* ----- 많이 쓰는 도구 ----- */
.sec-title { margin: 40px 0 14px; font-size: 26px; letter-spacing: -0.035em; }
.sec-title small { margin-left: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }
.hot-row { display: flex; gap: 14px; overflow-x: auto; padding: 6px 4px 18px; margin: 0 -4px; scroll-snap-type: x mandatory; }
.hot { position: relative; flex: 0 0 230px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 250px; padding: 20px; border-radius: 28px; color: #fff; text-decoration: none; overflow: hidden; scroll-snap-align: start; transition: transform .25s; }
.hot:hover { transform: translateY(-6px) rotate(-1deg); }
.hot-ico { position: absolute; right: 14px; top: 10px; font-size: 80px; line-height: 1; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .28)); transition: transform .3s; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.hot:hover .hot-ico { transform: scale(1.12) rotate(8deg); }
.hot b { display: block; font-size: 20px; letter-spacing: -0.02em; }
.hot-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: 13px; line-height: 1.45; opacity: .92; }
.hot-0 { background: linear-gradient(150deg, #6A74FF, #3D49E0); } .hot-1 { background: linear-gradient(150deg, #FF8CB9, #E24A86); }
.hot-2 { background: linear-gradient(150deg, #3FC9A2, #0F8F76); } .hot-3 { background: linear-gradient(150deg, #E89A1F, #C26A00); }
.hot-4 { background: linear-gradient(150deg, #B280FF, #7647E0); } .hot-5 { background: linear-gradient(150deg, #4DA8F5, #2468D0); }

/* ----- 묶음 카드(벤토) ----- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.bento .group { grid-column: span 6; margin: 0; padding: 24px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--glass-line); border-radius: 30px; box-shadow: var(--shadow); }
.bento .group:nth-child(4n+1) { grid-column: span 7; }
.bento .group:nth-child(4n+2) { grid-column: span 5; }
.bento .group:nth-child(4n+3) { grid-column: span 8; }
.bento .group:nth-child(4n) { grid-column: span 4; }
.gh { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.gico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; font-size: 22px; background: color-mix(in srgb, var(--g, var(--accent)) 18%, var(--surface)); font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.gh h2 { margin: 0; font-size: 21px; letter-spacing: -0.03em; }
.gh h2 a { color: var(--ink); text-decoration: none; }
.gcount { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--ink-2); }
.group-desc { margin: 0 0 16px; font-size: 14px; }
.all-title { margin-top: 28px; }

/* ----- 도구 카드 (홈·묶음 페이지·함께 쓰면 좋은 도구 공통) ----- */
.tool-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tool-link { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.tool-link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--g, var(--accent)) 55%, var(--line)); box-shadow: 0 16px 30px -18px rgba(40, 50, 120, .55); }
.tool-link .dot { display: none; }
.tl-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; font-size: 25px; background: color-mix(in srgb, var(--g, var(--accent)) 16%, var(--surface)); transition: transform .25s; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.tool-link:hover .tl-ico { transform: scale(1.1) rotate(-6deg); }
.tl-body { min-width: 0; }
.tl-body b { display: block; font-size: 15px; letter-spacing: -0.01em; }
.tl-body span { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-2); line-height: 1.4; }

/* ----- 묶음·도구 페이지 머리 ----- */
.tool-head.tool-hero { position: relative; margin-top: 18px; padding: 20px 24px 22px; overflow: hidden; border: 1px solid var(--glass-line); border-radius: 30px; background: linear-gradient(135deg, color-mix(in srgb, var(--g, var(--accent)) 16%, var(--glass)), var(--glass) 70%); box-shadow: var(--shadow); }
.tool-hero::after { content: ''; position: absolute; right: -50px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--g, var(--accent)) 38%, transparent), transparent 70%); pointer-events: none; }
.tool-hero .crumb { position: relative; z-index: 1; margin: 0 0 8px; }
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.crumb a { min-height: 34px; gap: 6px; padding: 0 14px; border: 1px solid var(--glass-line, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); transition: transform .15s, background-color .15s, border-color .15s, box-shadow .15s; }
.crumb a:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--g, var(--accent)) 60%, var(--line)); background: color-mix(in srgb, var(--g, var(--accent)) 16%, var(--surface)); box-shadow: 0 8px 16px -10px color-mix(in srgb, var(--g, var(--accent)) 80%, #000); }
.crumb a:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--g, var(--accent)) 35%, transparent); }
.crumb .crumb-group { border-color: color-mix(in srgb, var(--g, var(--accent)) 45%, var(--line)); background: color-mix(in srgb, var(--g, var(--accent)) 18%, var(--surface)); }
.crumb-sep { color: var(--ink-2); font-size: 16px; font-weight: 700; opacity: .7; }
.crumb-home svg { flex: none; }
.th-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.th-ico { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; font-size: 40px; background: linear-gradient(145deg, color-mix(in srgb, var(--g, var(--accent)) 30%, #fff), color-mix(in srgb, var(--g, var(--accent)) 72%, #fff)); box-shadow: 0 18px 30px -14px color-mix(in srgb, var(--g, var(--accent)) 85%, #000), inset 0 2px 0 rgba(255, 255, 255, .7); animation: aurora-bob 5s ease-in-out infinite; --r: -6deg; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.tool-hero h1 { font-size: 30px; letter-spacing: -0.035em; }
.tool-hero .lead { margin-top: 2px; }
.group-page-grid { margin-top: 20px; }

/* ----- 도구 본체와 본문 ----- */
.panel { margin-top: 20px; padding: 24px; border: 1px solid var(--glass-line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.prose h2 { position: relative; padding-left: 14px; font-weight: 800; letter-spacing: -0.02em; }
.prose h2::before { content: ''; position: absolute; left: 0; top: .22em; bottom: .22em; width: 5px; border-radius: 3px; background: linear-gradient(var(--accent), #B84BFF); }
.related h2 { font-size: 17px; letter-spacing: -0.02em; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-art { height: 280px; }
  .bento .group, .bento .group:nth-child(n) { grid-column: span 12; }
}
@media (max-width: 640px) {
  .header-inner { border-radius: 26px; }
  .th-ico { width: 60px; height: 60px; font-size: 32px; border-radius: 20px; }
  .tool-hero h1 { font-size: 24px; }
  .tool-head.tool-hero { padding: 16px 16px 18px; border-radius: 24px; }
  .panel { padding: 16px; border-radius: 22px; }
  .bento .group { padding: 18px; border-radius: 24px; }
}

/* 헤더가 한 줄에 들어가도록 메뉴를 촘촘하게 */
.nav { flex-wrap: nowrap; gap: 2px; }
.nav a { min-height: 40px; padding: 0 10px; font-size: 14px; }
.nav .dot { margin-right: 6px; }
@media (max-width: 1040px) { .search { width: 170px; } .brand { font-size: 18px; } }
.hero .hero-search { width: 100%; max-width: 540px; }
.tool-link .tl-ico { margin: 0; font-size: 25px; line-height: 1; color: inherit; }
.tool-link .tl-body { margin: 0; }
.bento .tool-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tl-body span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-link .tl-ico { display: grid; place-items: center; }
@media (max-width: 640px) {
  .header-inner .search { width: 100%; min-width: 0; }
  .header-inner .search input { padding: 0 14px; }
  .theme-btn { min-width: 40px; min-height: 40px; }
}

/* ===== 여행·환전: 환전 vs 카드, 환율 계산기 ===== */
.fv-grid { grid-template-columns: 340px minmax(0, 1fr); }
.fv-rate { display: flex; align-items: center; gap: 8px; }
.fv-rate input { flex: 1; min-width: 0; }
.fv-rate span { flex: none; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.hint.is-warn { color: var(--warn); }
.fv-group { padding: 4px 14px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.fv-group > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.fv-group .field { margin-bottom: 10px; }
.fv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fv-pair .field label { font-size: 13px; }
.fv-range { width: 100%; accent-color: var(--accent); min-height: 32px; padding: 0; border: 0; background: none; }
#fv-share-out { margin-left: 6px; font-weight: 800; color: var(--link); }
.fv-headline { padding: 18px 20px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #2F80ED, #7A4DFF); box-shadow: 0 18px 30px -18px rgba(70, 90, 230, .8); }
.fv-head-label { font-size: 13px; font-weight: 700; opacity: .85; }
.fv-head-main { margin-top: 2px; font-size: 28px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.25; }
.fv-head-sub { margin: 6px 0 0; font-size: 14px; opacity: .95; }
.fv-rows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.fv-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.fv-row.is-best { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 25%, transparent); }
.fv-row.is-warn { border-style: dashed; border-color: var(--danger-ink); background: var(--danger-soft); }
.fv-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.fv-row-name { font-size: 15px; }
.fv-badge { padding: 1px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; }
.fv-row-cost { margin-left: auto; font-size: 18px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fv-bar { height: 10px; margin: 8px 0 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.fv-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2F80ED, #7A4DFF); transition: width .25s; }
.fv-row.is-best .fv-bar-fill { background: linear-gradient(90deg, #0F9D6E, #3FD6A3); }
.fv-row.is-warn .fv-bar-fill { background: linear-gradient(90deg, #E5484D, #FF8A5C); }
.fv-row-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); }
.fv-diff { font-weight: 800; color: var(--warn); }
.fv-row-detail { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.fv-breakeven { margin: 14px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: 15px; }
.fv-dcc { margin: 12px 0; padding: 12px 14px; border-radius: 16px; background: var(--danger-soft); color: var(--danger-ink); }
.fv-dcc p { margin: 2px 0 0; font-size: 14px; }
.fc-conv { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.fc-swap { width: 48px; padding: 0; font-size: 20px; margin-bottom: 0; }
.fc-result { margin: 8px 0 18px; padding: 18px 20px; border-radius: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); border: 1px solid var(--line); }
.fc-big { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.25; overflow-wrap: anywhere; }
.fc-line { margin: 4px 0 10px; font-size: 14px; color: var(--ink-2); }
.fc-real { margin: 8px 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); }
.fc-real[hidden] { display: none; }
.fc-real p { margin: 2px 0 0; font-size: 14px; }
.fc-rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.fc-rate-row { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; }
.fc-rate-name { flex: none; min-width: 96px; color: var(--ink-2); }
.fc-rate-row input { width: 100%; max-width: 120px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.fc-rate-row input:focus { border-color: var(--accent); outline: none; }
.fc-example { padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--link); font-size: 11px; font-weight: 800; }
.fc-example[hidden] { display: none; }
.fc-multi { display: grid; gap: 12px; }
.fc-multi-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.fc-multi-item { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.fc-multi-name { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.fc-table-head { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-bottom: 8px; }
.fc-table-head .field { min-width: 200px; }
.fc-table { max-width: 420px; }
@media (max-width: 860px) { .fv-grid { grid-template-columns: minmax(0, 1fr); } .fc-conv { grid-template-columns: 1fr 1fr; } .fc-amount { grid-column: 1 / -1; } .fc-swap { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 520px) { .fv-pair { grid-template-columns: 1fr; } .fv-head-main { font-size: 23px; } .fc-big { font-size: 25px; } }

@media (max-width: 1100px) {
  .theme-btn .txt { display: none; }
  .theme-btn { padding: 0; }
  .nav a { padding: 0 8px; font-size: 13.5px; }
  .nav .dot { margin-right: 4px; }
  .header-inner { gap: 8px; }
}
@media (max-width: 1100px) and (min-width: 641px) { .search { width: 150px; } }

/* ===== 여행 경비 계산·정산 ===== */
.tb-summary { margin-bottom: 16px; padding: 18px 20px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #2F80ED, #7A4DFF); box-shadow: 0 18px 30px -18px rgba(70, 90, 230, .8); }
.tb-sum-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.tb-sum-label { font-size: 13px; font-weight: 700; opacity: .85; }
.tb-sum-main { font-size: 36px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tb-sum-sub { font-size: 13px; opacity: .85; min-height: 1em; }
.tb-sum-side { font-size: 16px; font-weight: 800; }
.tb-sum-side.is-over { color: #FFD3CC; }
.tb-gauge { height: 12px; margin-top: 12px; border-radius: 999px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.tb-gauge[hidden] { display: none; }
.tb-gauge-fill { display: block; height: 100%; border-radius: 999px; background: #fff; transition: width .25s; }
.tb-gauge.is-over .tb-gauge-fill { background: #FFB4A8; }
.tb-sum-meta { margin: 8px 0 0; font-size: 13px; opacity: .92; }
.tb-people { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tb-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--link); font-weight: 800; font-size: 14px; }
.tb-chip-x { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 12px; cursor: pointer; }
.tb-chip-x:hover { background: var(--surface); }
.tb-person-form { display: flex; gap: 8px; }
.tb-person-form input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; }
.tb-person-form input:focus { border-color: var(--accent); outline: none; }
.tb-split { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-split-item { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; cursor: pointer; }
.tb-split-item:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
.tb-split-item input { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
.tb-empty { display: grid; justify-items: center; gap: 4px; padding: 26px 12px; border: 2px dashed var(--line); border-radius: 22px; text-align: center; color: var(--ink-2); }
.tb-empty[hidden] { display: none; }
.tb-empty-ico { font-size: 54px; line-height: 1; animation: aurora-bob 4s ease-in-out infinite; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.tb-empty p { margin: 0; }
.tb-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.tb-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.tb-item-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); font-size: 22px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.tb-item-body { min-width: 0; display: grid; }
.tb-item-note { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.tb-item-krw { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-cats { display: grid; gap: 8px; margin-bottom: 8px; }
.tb-cat { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.tb-cat-name { font-weight: 700; }
.tb-cat-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.tb-cat-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2F80ED, #7A4DFF); }
.tb-cat-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.tb-bal-wrap { overflow-x: auto; }
.tb-net.is-plus { color: var(--ok); font-weight: 800; }
.tb-net.is-minus { color: var(--danger-ink); font-weight: 800; }
.tb-transfers { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.tb-transfer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: 16px; background: var(--accent-soft); }
.tb-arrow { color: var(--link); font-weight: 900; }
.tb-transfer-amt { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .tb-sum-main { font-size: 28px; } .tb-item { grid-template-columns: auto 1fr; } .tb-item-krw { grid-column: 2; } .tb-item .btn { grid-column: 2; justify-self: start; } .tb-cat { grid-template-columns: 1fr; gap: 4px; } }
.fc-warn { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--warn); }
.fc-warn[hidden] { display: none; }
.fc-rate-row { flex-wrap: wrap; }
.fc-multi-rate { margin-top: 2px; font-size: 11px; color: var(--ink-2); }
.fc-table-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; }
.fc-table-note #fc-table-rate { font-weight: 800; color: var(--ink); }
.fc-table-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.fc-table-label { font-size: 14px; font-weight: 800; }
.fc-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.fc-inline input { width: 110px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.fc-inline input:focus { border-color: var(--accent); outline: none; }
.fc-inline input[aria-invalid="true"] { border-color: var(--warn); }
.fc-table-note .fc-warn { flex-basis: 100%; margin: 0; }
.fc-table-note > .note { flex-basis: 100%; margin: 0; }
.fc-ratebox { margin-top: 8px; }
.fc-rate-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.fc-rate-main .field { margin: 0; min-width: 180px; }
.fc-rate-main .field:last-of-type { flex: 1; max-width: 320px; }
.fc-rate-main .fc-example { margin-bottom: 12px; }
.fc-ratebox > .hint { margin: 8px 0 10px; font-size: 13px; color: var(--ink-2); }
.fc-ratebox > .fc-warn { margin: 6px 0 0; }
.fc-ratebox .fv-group { margin-top: 6px; }
.fc-ratebox { margin-bottom: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.fc-conv-title { margin-top: 16px; }


/* 접고 펼치는 묶음(환율 더 보기, 수수료 조건 등): 눌러 보라는 버튼처럼 보이게 */
.fv-group { overflow: hidden; }
.fv-group:not([open]) { padding-bottom: 0; }
.fv-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; margin: -4px -14px 0; padding: 0 16px; background: var(--accent-soft); color: var(--link); font-weight: 800; letter-spacing: -0.01em; cursor: pointer; transition: filter .15s, box-shadow .15s; }
.fv-group > summary::-webkit-details-marker { display: none; }
.fv-group > summary::after { content: ''; flex: none; width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.fv-group[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.fv-group > summary:hover { filter: brightness(1.06); box-shadow: inset 0 0 0 1px var(--accent); }
.fv-group > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.fv-group[open] > summary { margin-bottom: 12px; }

/* 숫자·금액 칸의 지우기(✕) 버튼 */
.clr-x { position: absolute; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; transition: background-color .15s, color .15s; }
.clr-x[hidden] { display: none; }
.clr-x:hover { background: var(--accent-soft); color: var(--link); }
input.has-clear { padding-right: 36px !important; }
input.has-clear.has-clear-number { padding-right: 56px !important; }

/* ===== 타이머 ===== */
.tm-quick { margin-bottom: 14px; }
.tm-quick-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.tm-quick-head .hint { margin: 0; }
.tm-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.tm-chip-main { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 16px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: background-color .15s; }
.tm-chip-main strong { font-weight: 800; }
.tm-chip-main span { color: var(--link); font-weight: 800; font-size: 13px; }
.tm-chip-main:hover { background: var(--accent-soft); }
.tm-chip-x { width: 34px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.tm-chip-x:hover { background: var(--danger-soft); color: var(--danger-ink); }
.tm-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
.tm-form .field { margin: 0; flex: 1 1 160px; min-width: 140px; }
.tm-empty { display: grid; justify-items: center; gap: 2px; margin: 18px 0; padding: 26px 12px; border: 2px dashed var(--line); border-radius: 22px; text-align: center; color: var(--ink-2); }
.tm-empty[hidden] { display: none; }
.tm-empty p { margin: 0; }
.tm-glass { font-size: 64px; line-height: 1; animation: aurora-bob 3.6s ease-in-out infinite; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.tm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.tm-card { display: grid; justify-items: center; gap: 10px; padding: 18px 16px 16px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.tm-card.is-running { border-color: var(--accent); }
.tm-card.is-done { border-color: var(--danger-ink); background: var(--danger-soft); animation: tm-pulse 1s ease-in-out infinite; }
@keyframes tm-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger-ink) 28%, transparent); } }
.tm-ring { position: relative; width: 150px; height: 150px; }
.tm-ring svg { width: 100%; height: 100%; }
.tm-ring-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.tm-ring-fg { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.tm-card.is-done .tm-ring-fg { stroke: var(--danger-ink); }
.tm-card.is-paused .tm-ring-fg { stroke: var(--ink-2); }
.tm-clock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tm-meta { display: grid; gap: 0; }
.tm-name { font-size: 17px; overflow-wrap: anywhere; }
.tm-total { font-size: 13px; color: var(--ink-2); }
.tm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tm-card:fullscreen { align-content: center; gap: 22px; background: var(--bg); border: 0; border-radius: 0; animation: none; }
.tm-card:fullscreen .tm-ring { width: min(60vh, 70vw); height: min(60vh, 70vw); }
.tm-card:fullscreen .tm-clock { font-size: min(14vh, 16vw); }
.tm-card:fullscreen .tm-name { font-size: 28px; }
.tm-settings { display: grid; gap: 4px; }
.tm-notify-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 8px; }
.tm-notify-row .hint { margin: 0; }

/* ===== 뽀모도로 ===== */
.pm-phases { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.pm-stage { --pm: #E5484D; --pm-soft: #FDECEA; display: grid; justify-items: center; gap: 14px; padding: 22px 12px 18px; border-radius: 28px; background: linear-gradient(180deg, color-mix(in srgb, var(--pm) 10%, var(--surface)), var(--surface)); border: 1px solid var(--line); }
.pm-stage[data-phase="short"] { --pm: #12A47A; }
.pm-stage[data-phase="long"] { --pm: #2F80ED; }
.pm-ring { position: relative; width: min(300px, 72vw); height: min(300px, 72vw); }
.pm-ring svg { width: 100%; height: 100%; }
.pm-ring-bg { fill: none; stroke: var(--line); stroke-width: 7; }
.pm-ring-fg { fill: none; stroke: var(--pm); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.pm-center { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 0; }
.pm-ico { font-size: 40px; line-height: 1; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.pm-stage.is-running .pm-ico { animation: aurora-bob 2.4s ease-in-out infinite; --r: 0deg; }
.pm-clock { font-size: clamp(44px, 12vw, 64px); font-weight: 900; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pm-phase-name { font-size: 15px; font-weight: 800; color: var(--pm); }
.pm-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pm-controls .btn-primary { min-width: 120px; background: linear-gradient(180deg, var(--pm), color-mix(in srgb, var(--pm) 78%, #000)); box-shadow: 0 10px 20px -10px var(--pm), inset 0 1px 0 rgba(255, 255, 255, .22); }
.pm-status { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); text-align: center; }
.pm-dots { display: flex; gap: 8px; }
.pm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background-color .2s, transform .2s; }
.pm-dot.is-on { background: var(--pm); transform: scale(1.15); }
.pm-stage:fullscreen { align-content: center; border-radius: 0; background: var(--bg); }
.pm-stage:fullscreen .pm-ring { width: min(70vh, 80vw); height: min(70vh, 80vw); }
.pm-stage:fullscreen .pm-clock { font-size: min(16vh, 18vw); }
.pm-today { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pm-stat { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.pm-stat span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pm-stat strong { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.pm-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; margin-bottom: 8px; }
.pm-bar { display: grid; grid-template-rows: 18px 1fr auto; gap: 4px; height: 100%; justify-items: center; }
.pm-bar-val { font-size: 10px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.pm-bar-track { display: flex; align-items: flex-end; width: 100%; max-width: 34px; height: 100%; border-radius: 10px; background: var(--line); overflow: hidden; }
.pm-bar-fill { display: block; width: 100%; border-radius: 10px; background: linear-gradient(180deg, #FF7A6B, #E5484D); }
.pm-bar.is-today .pm-bar-fill { background: linear-gradient(180deg, #7C8BFF, #4F5CFF); }
.pm-bar-label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pm-bar.is-today .pm-bar-label { color: var(--link); }
@media (max-width: 520px) { .tm-list { grid-template-columns: 1fr; } .pm-week { gap: 4px; } .pm-bar-val { font-size: 9px; } }


/* ---- 점심 메뉴 돌림판 ---- */
.lr-count { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); text-align: center; }
.lr-count.is-warn { color: var(--warn); }
#lr-go[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.lr-result { margin: 14px auto 0; max-width: 420px; padding: 18px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lr-result[hidden] { display: none; }
.lr-result-label { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.lr-result-name { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; word-break: keep-all; }
.lr-result-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lr-tag { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--link); font-size: 13px; font-weight: 700; }
.lr-maps { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 4px; }
.lr-maps-label { flex-basis: 100%; font-size: 13px; color: var(--ink-2); }
.lr-maps a.btn { text-decoration: none; }
.lr-team { margin-top: 20px; }
.lr-team-who { margin: 10px 0; font-weight: 800; }
.lr-team-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lr-team-grid .btn[aria-pressed="true"] { background: var(--danger-soft); color: var(--danger-ink); box-shadow: none; text-decoration: line-through; }
.lr-history { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lr-hist-item { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.lr-hist-date { font-size: 12px; color: var(--ink-2); }
.hint-inline { font-weight: 500; color: var(--ink-2); }
.panel > .panel-title { margin-top: 24px; }

/* ---- 단위 변환기 · 평수 계산기 ---- */
.ut-top { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: end; }
.ut-in-wrap { position: relative; }
.ut-in-wrap input { width: 100%; padding-right: 44px; font-size: 18px; font-weight: 700; }
.ut-in-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 12px; cursor: pointer; }
.ut-in-x[hidden] { display: none; }
.ut-examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.ut-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.ut-head .panel-title { margin: 0; }
.ut-sig { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.ut-sig select { min-height: 36px; }
.ut-rows { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 8px; }
.ut-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.ut-row.is-source { border-color: var(--accent); background: var(--accent-soft); }
.ut-row.is-idle { opacity: .7; }
.ut-star { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--line); font-size: 20px; cursor: pointer; }
.ut-star[aria-pressed="true"] { color: #F5A524; }
.ut-row-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ut-row-name { font-weight: 800; font-size: 15px; }
.ut-row-formula { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.ut-row-val { text-align: right; font-size: 18px; overflow-wrap: anywhere; }
.ut-row-sym { font-size: 13px; color: var(--ink-2); }
.ut-row.is-idle .ut-row-name { flex: 1; }
.ut-note { margin: 10px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.ut-note[hidden] { display: none; }
.pc-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; margin-bottom: 8px; }
.pc-swap { align-self: end; width: 44px; height: 44px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 50%; background: var(--accent-soft); color: var(--link); font-size: 20px; font-weight: 900; cursor: pointer; transition: transform .2s, background-color .15s; }
.pc-swap:hover { background: var(--accent); color: #fff; }
.pc-swap:active { transform: rotate(180deg); }
.pc-pair input[readonly] { background: var(--bg); font-weight: 800; }
.pc-eq { padding-bottom: 14px; font-weight: 900; color: var(--ink-2); }
.pc-result { margin: 4px 0 12px; font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.pc-result:empty { margin: 0; }
.pc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.pc-cards:empty { display: none; }
.pc-card { padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.pc-card-l { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pc-card-v { font-size: 17px; overflow-wrap: anywhere; }
.pc-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.pc-tt { font-size: 15px; margin: 4px 0 6px; }
.pc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.pc-table th, .pc-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.fv-group + .fv-group { margin-top: 12px; }
@media (max-width: 640px) {
  .ut-top { grid-template-columns: 1fr; }
  .ut-row { flex-wrap: wrap; }
  .ut-row-val { flex-basis: 100%; text-align: left; order: 4; }
  .pc-pair { grid-template-columns: 1fr; }
  .pc-eq { display: none; }
  .pc-swap { justify-self: center; margin: 0; transform: rotate(90deg); }
  .pc-swap:active { transform: rotate(270deg); }
}

.group-more { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 0 16px; border-radius: 999px; background: var(--accent-soft); color: var(--link); font-weight: 800; font-size: 15px; text-decoration: none; }
.group-more:hover { background: var(--accent); color: #fff; }

/* ---- 세금·급여 ---- */
.sc-basis { margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--link); font-size: 13px; font-weight: 700; }
.sc-basis.is-warn { background: var(--danger-soft); color: var(--danger-ink); }
.sc-basis:empty { display: none; }
.sc-card-x { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.sc-table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.sc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sc-table th, .sc-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.sc-table tbody tr:last-child th, .sc-table tbody tr:last-child td { border-bottom: 0; }
.sc-table thead th { font-size: 13px; color: var(--ink-2); background: var(--bg); }
.sc-table .sc-num { text-align: right; font-variant-numeric: tabular-nums; }
.sc-table .is-sub th, .sc-table .is-sub td { font-size: 13px; color: var(--ink-2); }
.sc-table .is-total th, .sc-table .is-total td { font-weight: 900; background: var(--accent-soft); }
.sc-diff { color: var(--ink-2); }
.sc-how-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 6px; }
.sc-how { margin-top: 12px; }

/* ---- 맞춤법 검사기 ---- */
.sp-scope { margin: 0 0 12px; padding: 9px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--link); font-size: 14px; font-weight: 700; }
.sp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 8px; }
.sp-count { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.sp-summary { margin: 6px 0 14px; font-weight: 800; }
.sp-summary:empty { display: none; }
.sp-summary.is-ok { color: var(--ink-2); font-weight: 700; }
.sp-view { padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; max-height: 320px; overflow: auto; }
.sp-mark { padding: 1px 3px; border-radius: 6px; color: inherit; cursor: pointer; }
.sp-mark.sp-spell { background: rgba(229, 57, 53, .22); box-shadow: inset 0 -2px 0 #E53935; }
.sp-mark.sp-space { background: rgba(245, 165, 36, .26); box-shadow: inset 0 -2px 0 #F5A524; }
.sp-mark.sp-loan { background: rgba(47, 128, 237, .22); box-shadow: inset 0 -2px 0 #2F80ED; }
.sp-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.sp-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); display: grid; gap: 6px; }
.sp-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.sp-tag { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.sp-ctx { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.sp-fix { font-size: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.sp-from { color: var(--danger-ink); text-decoration: line-through; }
.sp-arrow { color: var(--ink-2); }
.sp-to { color: var(--link); }
.sp-why { margin: 0; font-size: 14px; color: var(--ink-2); }

/* hidden 속성이 버튼·표시 규칙에 가려지지 않게 한다. */
[hidden] { display: none !important; }

/* ---- 이미지·영상 (GIF 도구) ---- */
.gu-drop { display: grid; justify-items: center; gap: 6px; padding: 28px 18px; text-align: center; border: 2px dashed var(--line); border-radius: 24px; background: var(--bg); cursor: pointer; transition: border-color .15s, background-color .15s; }
.gu-drop:hover, .gu-drop.is-drag, .gu-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.gu-drop-ico { font-size: 34px; line-height: 1; }
.gu-drop-sub { font-size: 13px; color: var(--ink-2); }
.gu-grid { margin: 14px 0 8px; }
.gu-video, .gu-img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 18px; background: #000; }
.gu-img { background: var(--bg); border: 1px solid var(--line); }
.gu-pos { display: flex; gap: 8px; align-items: center; }
.gu-pos input { flex: 1; min-width: 0; }
.gu-estimate { margin: 6px 0 10px; font-weight: 800; }
.gu-estimate:empty { display: none; }
.gu-estimate.is-warn { color: var(--warn); }
.gu-progress { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.gu-progress progress { flex: 1; height: 12px; accent-color: var(--accent); }
.gu-progress span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.gu-result { margin-top: 14px; padding: 16px; border: 1px solid var(--accent); border-radius: 24px; background: var(--accent-soft); display: grid; gap: 10px; justify-items: start; }
.gu-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.gu-size { font-size: 22px; }
.gu-info { color: var(--ink-2); font-size: 14px; }
.gu-saved, .gu-target { margin: 0; font-weight: 800; }
.gu-saved.is-warn, .gu-target.is-warn { color: var(--warn); }
.gu-original { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gu-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gu-facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gu-fact-l { color: var(--ink-2); font-size: 14px; }
.ig-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.ig-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ig-thumb { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.ig-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ig-settings { margin-top: 12px; }
@media (max-width: 640px) { .gu-original { grid-template-columns: 1fr; } }

/* ---- 파일 변환 ---- */
.ir-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.ir-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ir-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg); }
.ir-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ir-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-sub { font-size: 12px; color: var(--ink-2); }
.ir-sub.is-warn { color: var(--warn); }
.ir-item a.btn { text-decoration: none; }
#ir-quality { width: 100%; }

/* ---- 문서 변환 (Word·엑셀·PPT·한글) ---- */
.dv-notes { margin: 8px 0 12px; padding: 12px 16px; border: 1px solid var(--warn); border-radius: 18px; background: var(--bg); }
.dv-notes strong { color: var(--warn); }
.dv-notes ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.dv-clean { margin: 8px 0 12px; }
.dv-steps { margin: 12px 0; padding-left: 22px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.dv-frame { width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--line); border-radius: 18px; background: #e9ecf1; }
#dv-name { font-weight: 800; }

/* ===== 헤더 v2: 두 줄 막대(위: 이름·검색·즐겨찾기, 아래: 묶음 메뉴·화면 모드) ===== */
.site-header { position: sticky; top: 8px; padding: 8px 0 0; background: none; border: 0; z-index: 30; }
.site-header .header-inner { display: block; width: calc(100% - 24px); max-width: var(--wrap); min-height: 0; padding: 0; gap: 0; border-radius: 20px; background: var(--glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border: 1px solid var(--glass-line); box-shadow: var(--shadow); }
.hd-top { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 16px; }
.hd-top .brand { flex: none; }
.site-header .hd-top .search { flex: 1; width: auto; max-width: 560px; min-width: 0; margin: 0 auto 0 8px; }
.site-header .hd-top .search input { height: 42px; border-radius: 12px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); }
.hd-bottom { display: flex; align-items: center; gap: 10px; padding: 4px 10px 6px 12px; border-top: 1px solid var(--line); }
.site-header .nav { flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.site-header .nav::-webkit-scrollbar { display: none; }
.site-header .nav a { flex: none; min-height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.site-header .nav a:hover { background: var(--accent-soft); }
.site-header .theme-switch { flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.site-header .theme-btn { min-width: 34px; min-height: 34px; padding: 0 8px; border-radius: 9px; }
.site-header .theme-btn .txt { display: none; }
.fav-link { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; transition: border-color .15s, color .15s, background-color .15s; }
.fav-link:hover { border-color: #E5456B; color: #E5456B; }
.fav-link .fav-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #E5456B; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.fav-count[hidden] { display: none; }

@media (max-width: 760px) {
  .hd-top { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .hd-top .brand { order: 1; margin-right: auto; }
  .fav-link { order: 2; min-height: 40px; padding: 0 10px; }
  .fav-link .txt { display: none; }
  .site-header .hd-top .search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .hd-bottom { padding: 4px 8px 6px 8px; }
  .site-header .nav a { padding: 0 9px; font-size: 13.5px; }
}


/* 제목과 설명 글자는 더 또렷하게 */
.tool-link .tl-body b { font-weight: 800; color: var(--ink); }
.hot b { font-weight: 800; }
.tl-body span, .group-desc, .lead, .field .hint, .hint, .muted, .note { font-weight: 500; }
.tl-body span { color: var(--ink-2); }
.hot .hot-desc { opacity: 1; }

/* 지금 많이 쓰는 도구: 스크롤 막대 대신 < > 버튼으로 넘긴다 */
.hot-wrap { position: relative; }
.hot-row { scrollbar-width: none; scroll-behavior: smooth; }
.hot-row::-webkit-scrollbar { display: none; }
.hot-nav { position: absolute; top: calc(50% - 18px); z-index: 3; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: 0 8px 22px -8px rgba(20, 30, 70, .45); cursor: pointer; transition: transform .15s, background-color .15s, color .15s; }
.hot-nav:hover { background: var(--accent); border-color: transparent; color: #fff; transform: scale(1.06); }
.hot-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hot-prev { left: -10px; }
.hot-next { right: -10px; }
.hot-nav[hidden] { display: none; }
@media (max-width: 640px) { .hot-nav { width: 38px; height: 38px; } .hot-prev { left: -4px; } .hot-next { right: -4px; } }
@media (prefers-reduced-motion: reduce) { .hot-row { scroll-behavior: auto; } }

button.fav-link { font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

.hd-top .fav-wrap { margin-left: auto; }
@media (max-width: 760px) { .hd-top .fav-wrap { order: 2; } }

/* 헤더 오른쪽: 즐겨찾기(사이트 북마크) 버튼과 화면 모드 */
.hd-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.hd-top .fav-wrap { margin-left: 0; }
.fav-link .fav-ico { fill: none; }
.fav-link:hover .fav-ico { fill: currentColor; }
.hd-bottom .nav { flex: 1 1 auto; }
@media (max-width: 760px) {
  .hd-top .hd-actions { order: 2; gap: 6px; }
  .site-header .hd-actions .theme-btn { min-width: 32px; min-height: 32px; }
}

/* 헤더 즐겨찾기 버튼이 켜진 모양(빨간색) */
.fav-link[aria-pressed="true"] { color: #E5456B; border-color: #E5456B; background: color-mix(in srgb, #E5456B 10%, var(--surface)); }
.fav-link[aria-pressed="true"] .fav-ico { fill: currentColor; }

/* 헤더 윗줄 높이를 아랫줄(묶음 메뉴)과 같게 줄인다 */
.hd-top { padding: 6px 10px 6px 14px; gap: 10px; }
.hd-top .brand { font-size: 25px; letter-spacing: -0.02em; gap: 10px; }
.hd-top .brand-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 11px; }
.hd-top .fav-link { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.hd-top .fav-link .fav-ico { width: 18px; height: 18px; }
.site-header .hd-top .theme-switch { padding: 2px; }
.site-header .hd-top .theme-btn { min-width: 32px; min-height: 32px; }
.hd-bottom { padding: 3px 10px 4px 12px; }
.site-header .nav a { min-height: 36px; }
@media (max-width: 760px) { .hd-top { padding: 6px 10px; gap: 8px; } .hd-top .fav-link { min-height: 36px; } }

.hd-top { padding: 3px 10px 3px 14px; }
@media (max-width: 760px) { .hd-top { padding: 4px 10px; } }

/* 하트 버튼 */
.tl-wrap { position: relative; }
.tl-wrap > .tool-link { height: 100%; padding-right: 46px; }
.fav-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: color .15s, background-color .15s, transform .15s; }
.tl-wrap > .fav-btn { position: absolute; top: 8px; right: 8px; z-index: 2; }
.fav-btn:hover { background: color-mix(in srgb, #E5456B 14%, transparent); color: #E5456B; }
.fav-btn:active { transform: scale(.88); }
.fav-btn .fav-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill .15s; }
.fav-btn[aria-pressed="true"] { color: #E5456B; }
.fav-btn[aria-pressed="true"] .fav-ico { fill: currentColor; }
.th-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fav-hero { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); }
.fav-hero .fav-ico { width: 22px; height: 22px; }
.fav-section { margin: 0 0 28px; }
.fav-empty { margin: 4px 0 0; color: var(--ink-2); }


/* 즐겨찾기 목록 상자 */
.fav-wrap { position: relative; flex: none; }
.fav-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 480px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 24px 48px -16px rgba(20, 30, 70, .45); display: grid; gap: 4px; }
.fav-pop[hidden] { display: none; }
.fav-pop-item { display: flex; align-items: center; gap: 4px; border-radius: 12px; }
.fav-pop-item:hover { background: var(--accent-soft); }
.fav-pop-item a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.fav-pop-item a .fp-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--g, #6A5CFF) 14%, var(--surface)); font-size: 19px; }
.fav-pop-item a .fp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-pop-item .fav-btn { flex: none; margin-right: 4px; }
.fav-section { scroll-margin-top: 150px; }


/* 즐겨찾기 도구함(하트) 버튼 */
.fav-link.fav-open .fav-ico { fill: none; }
.fav-link.fav-open[aria-expanded="true"] { border-color: #E5456B; color: #E5456B; }
.hd-top .fav-wrap .fav-link { min-height: 36px; }
.fav-pop::before { content: '즐겨찾기 도구함'; display: block; padding: 6px 10px 4px; font-size: 12px; font-weight: 800; color: var(--ink-2); }

/* 헤더는 스크롤을 따라다니지 않고 페이지 맨 위에 둔다 */
.site-header { position: relative; top: auto; }

/* 화면 모드 드롭다운 */
.theme-menu { position: relative; flex: none; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: border-color .15s; }
.theme-toggle:hover, .theme-toggle[aria-expanded="true"] { border-color: var(--accent); }
.theme-toggle .theme-ico { font-size: 16px; line-height: 1; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.theme-caret { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.theme-toggle[aria-expanded="true"] .theme-caret { transform: rotate(180deg); }
.theme-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 48px -16px rgba(20, 30, 70, .45); display: grid; gap: 2px; }
.theme-list[hidden] { display: none; }
.theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.theme-opt:hover { background: var(--accent-soft); }
.theme-opt[aria-selected="true"] { background: var(--accent-soft); color: var(--link); }
.theme-opt[aria-selected="true"]::after { content: '✓'; margin-left: auto; font-weight: 900; }
.theme-opt .theme-ico { font-size: 18px; line-height: 1; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
@media (max-width: 760px) { .theme-toggle .txt { display: none; } .theme-toggle { padding: 0 8px 0 10px; } }

/* ---- 양궁 로또 번호 뽑기 ---- */
.al-stage { border-radius: 24px; overflow: hidden; border: 1px solid rgba(167, 139, 250, .35); box-shadow: 0 22px 50px -24px rgba(124, 58, 237, .7); background: #0B1030; }
.al-canvas { display: block; width: 100%; height: 480px; touch-action: pan-y; cursor: crosshair; outline: none; -webkit-tap-highlight-color: transparent; user-select: none; }
.al-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.al-hud { margin: 10px 0 6px; font-weight: 800; font-size: 15px; text-align: center; }
.al-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 10px; min-height: 52px; }
.al-chip { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-weight: 900; font-size: 18px; box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .25), 0 6px 12px -6px rgba(0, 0, 0, .5); }
.al-chip.is-small { width: 36px; height: 36px; font-size: 14px; }
.al-chip.is-empty { background: var(--bg); color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); }
.al-controls { gap: 4px 18px; }
.al-options, .al-exclude-row { gap: 12px 14px; align-items: flex-end; }
.al-opt { display: grid; gap: 6px; font-weight: 800; font-size: 13px; color: var(--ink-2); letter-spacing: -.01em; }
.al-opt select, .al-opt input { appearance: none; -webkit-appearance: none; box-sizing: border-box; min-height: 46px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--t, var(--accent)) 42%, var(--line)); border-radius: 14px; background-color: color-mix(in srgb, var(--t, var(--accent)) 13%, var(--surface)); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); transition: border-color .15s, box-shadow .15s, background-color .15s; }
.al-opt select { min-width: 150px; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239AA3B5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.al-opt:nth-child(1) { --t: #6C8CFF; }
.al-opt:nth-child(2) { --t: #3DBE9A; }
.al-exclude-row .al-opt { --t: #F5A524; }
.al-opt select:hover, .al-opt input:hover { border-color: var(--t, var(--accent)); background-color: color-mix(in srgb, var(--t, var(--accent)) 20%, var(--surface)); }
.al-opt select:focus-visible, .al-opt input:focus-visible { outline: none; border-color: var(--t, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t, var(--accent)) 28%, transparent); }
.al-opt input::placeholder { color: var(--ink-2); opacity: .6; font-weight: 600; }
.al-opt input { width: 100%; }
.al-grow { flex: 1 1 240px; }
.al-exclude-note { margin: 2px 0 8px; font-size: 13px; color: var(--ink-2); min-height: 1px; }
.al-sets { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.al-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.al-set-balls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.al-plus { font-weight: 900; color: var(--ink-2); }

@media (max-width: 520px) { .al-picks { gap: 5px; } .al-chip { width: 40px; height: 40px; font-size: 16px; } .al-chip.is-small { width: 34px; height: 34px; font-size: 13px; } }

/* ----- 도구 카드: 카드마다 다른 부드러운 색 ----- */
.tool-link { --c: var(--g, var(--accent)); border-color: color-mix(in srgb, var(--c) 38%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--c) 20%, var(--surface)), color-mix(in srgb, var(--c) 9%, var(--surface))); }
.tool-link:hover { border-color: color-mix(in srgb, var(--c) 65%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--c) 28%, var(--surface)), color-mix(in srgb, var(--c) 13%, var(--surface))); box-shadow: 0 16px 30px -18px color-mix(in srgb, var(--c) 80%, #000); }
.tool-link .tl-ico { background: linear-gradient(145deg, color-mix(in srgb, var(--c) 40%, var(--surface)), color-mix(in srgb, var(--c) 24%, var(--surface))); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }

/* ----- 언어 전환 드롭다운: 화면 모드 드롭다운과 같은 모양 ----- */
.lang-menu .theme-toggle svg.fav-ico { width: 18px; height: 18px; }
.lang-menu .theme-list { min-width: 150px; }
.lang-menu a.theme-opt { text-decoration: none; }
@media (max-width: 760px) { .lang-menu .theme-toggle .txt { display: inline; } }

/* ----- 영어 페이지: CSS 로 넣은 문구 ----- */
html[lang="en"] .dice-board:empty::before { content: 'Press roll and the dice will tumble.'; }
html[lang="en"] .dice-board.is-idle::after { content: 'Give the dice a roll'; }
html[lang="en"] .fav-pop::before { content: 'Favorite tools'; }

/* ===== 도구 화면의 입력칸·선택칸: 묶음 색을 입혀서 흰색 일색을 벗어난다(버튼은 원래 모양 그대로) ===== */
.tool-page, #tool { --t: var(--g, var(--accent)); --t-deep: color-mix(in srgb, var(--t) 62%, #14143a); }
#tool .field input, #tool .field select, #tool .field textarea { border-radius: 14px; border-color: color-mix(in srgb, var(--t) 30%, var(--line)); background-color: color-mix(in srgb, var(--t) 6%, var(--surface)); transition: border-color .15s, box-shadow .15s, background-color .15s; }
#tool .field input:hover, #tool .field select:hover, #tool .field textarea:hover { border-color: color-mix(in srgb, var(--t) 62%, var(--line)); }
#tool .field input:focus, #tool .field select:focus, #tool .field textarea:focus { outline: none; border-color: var(--t); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t) 22%, transparent); background-color: var(--surface); }
#tool .field select { min-height: 46px; padding-right: 40px; font-weight: 600; cursor: pointer; appearance: none; -webkit-appearance: none; background-color: color-mix(in srgb, var(--t) 26%, var(--surface)); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A93A5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
#tool .field label, #tool .field .label { color: var(--ink); }

#tool .check input[type="checkbox"]:checked { background: var(--t); border-color: var(--t); }
#tool .check input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--t); }


/* ===== 색을 한 단계 더 또렷하게 + 날짜 칸·검색 칸·글자 칸 ===== */
#tool :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select, textarea) { border-radius: 14px; border-color: color-mix(in srgb, var(--t) 52%, var(--line)); background-color: color-mix(in srgb, var(--t) 15%, var(--surface)); transition: border-color .15s, box-shadow .15s, background-color .15s; }
#tool select { background-color: color-mix(in srgb, var(--t) 26%, var(--surface)); }
#tool :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select, textarea):focus { outline: none; border-color: var(--t); background-color: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t) 24%, transparent); }
#tool .field input, #tool .field textarea { border-color: color-mix(in srgb, var(--t) 52%, var(--line)); background-color: color-mix(in srgb, var(--t) 15%, var(--surface)); }
#tool .field select { background-color: color-mix(in srgb, var(--t) 26%, var(--surface)); border-color: color-mix(in srgb, var(--t) 56%, var(--line)); }
#tool .field input:focus, #tool .field textarea:focus, #tool .field select:focus { background-color: var(--surface); }
#tool .dp .dp-text.dp-text { border-radius: 14px; border-color: color-mix(in srgb, var(--t) 52%, var(--line)); background: color-mix(in srgb, var(--t) 15%, var(--surface)); }
#tool .dp .dp-text.dp-text:focus { border-color: var(--t); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t) 24%, transparent); }

/* ===== 버튼: 파스텔 대신 배경과 또렷하게 대비되는 색 =====
   기본(흰 바탕) 버튼은 짙은 테두리와 굵은 글자, 추가·복사는 청록, 삭제는 빨강, 주요 버튼은 파랑, 켜진 것은 짙은 남색으로 채운다. */
.btn { background: var(--surface); border: 2px solid var(--ink); color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--ink); border-color: var(--ink); color: var(--surface); box-shadow: 0 6px 14px -6px rgba(16, 24, 40, .45); }
.btn:active:not(:disabled) { box-shadow: none; }
.btn-primary { background: linear-gradient(180deg, #3B66FF 0%, #1F45D6 100%); border: 2px solid #1A3BB8; color: #fff; box-shadow: 0 3px 0 #1A3BB8; }
.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(180deg, #4A73FF 0%, #2750E6 100%); border-color: #1A3BB8; color: #fff; filter: none; box-shadow: 0 6px 14px -6px rgba(31, 69, 214, .8); }
.btn-soft { background: linear-gradient(180deg, #11957F 0%, #0A6A60 100%); border: 2px solid #085A52; color: #fff; box-shadow: 0 3px 0 #085A52; }
.btn-soft:hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(180deg, #16A68F 0%, #0C7A6E 100%); border-color: #085A52; color: #fff; box-shadow: 0 6px 14px -6px rgba(10, 106, 96, .8); }
.btn-danger { background: linear-gradient(180deg, #E5484D 0%, #B42318 100%); border: 2px solid #98200F; color: #fff; box-shadow: 0 3px 0 #98200F; }
.btn-danger:hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(180deg, #EF5A5F 0%, #C42A1E 100%); border-color: #98200F; color: #fff; box-shadow: 0 6px 14px -6px rgba(180, 35, 24, .8); }
.btn[aria-pressed="true"] { background: linear-gradient(180deg, #3B66FF 0%, #1F45D6 100%); border: 2px solid #1A3BB8; color: #fff; box-shadow: 0 3px 0 #1A3BB8; }
.btn[aria-pressed="true"]:hover:not(:disabled) { color: #fff; border-color: #1A3BB8; filter: brightness(1.08); background: linear-gradient(180deg, #3B66FF 0%, #1F45D6 100%); }
.btn.is-done { background: linear-gradient(180deg, #17A66A 0%, #0B7A4B 100%); border: 2px solid #09663F; color: #fff; box-shadow: 0 3px 0 #09663F; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled, .btn[disabled] { opacity: .5; box-shadow: none; }
.btn-sm { box-shadow: 0 2px 0 var(--ink); }
.btn-primary.btn-sm { box-shadow: 0 2px 0 #1A3BB8; }
.btn-soft.btn-sm { box-shadow: 0 2px 0 #085A52; }
.btn-danger.btn-sm { box-shadow: 0 2px 0 #98200F; }
.btn[aria-pressed="true"].btn-sm { box-shadow: 0 2px 0 #1A3BB8; }

/* 좁은 화면: 애니메이션·결과 그림이 있는 도구는 그림 칸을 맨 위로 올리고 입력칸을 그 아래에 둔다(PC 는 그대로 두 칸) */
@media (max-width: 720px) { .panel-grid.has-stage > .panel-main { order: -1; } }
