/*
 * 보내준 화면 코드의 Tailwind 클래스를 빌드 도구 없이 쓰기 위해 손으로 옮긴 유틸리티.
 * 원본 스타일(root.css, 원본 Tailwind 빌드)이 우선하도록 낮은 우선순위 레이어(tlfallback)에 둔다.
 * root.css 에 없는 클래스(새로 만든 화면용)와 관리자 화면에서만 쓰인다. 다크 모드는 아래쪽 레이어 밖 규칙으로 덮는다.
 */
@layer tlfallback {
:root {
  --fg-rgb: 22, 22, 22;
  --fg: #161616;
  --bg: #ffffff;
  --bg-sub: #f4f4f4;
  --border-strong: #c6c6c6;
  --badge-fg: #393939;
  --track: #e0e0e0;
  --divider: #e0e0e0;
  --accent: #003ce0;
  --accent-2: #0044ff;
  --link: #0043ce;
  --hover: #f3f4f6;
  --ok-icon: #198038;
  --ok-text: rgb(4, 67, 23);
  --warn: #8e6a00;
  --danger: #da1e28;
  --header-h: 80px;
  --bottom-bar-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ios-toolbar-hitbox: 0px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --fg-rgb: 244, 244, 244;
  --fg: #f4f4f4;
  --bg: #161616;
  --bg-sub: #262626;
  --border-strong: #525252;
  --badge-fg: #e0e0e0;
  --track: #393939;
  --divider: #393939;
  --accent: #4589ff;
  --accent-2: #78a9ff;
  --link: #78a9ff;
  --hover: #262626;
  --ok-icon: #42be65;
  --ok-text: #6fdc8c;
  --warn: #f1c21b;
  --danger: #ff8389;
  color-scheme: dark;
}

/* ---------- preflight ---------- */
*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
button, input, select, textarea { font: inherit; color: inherit; background: transparent; letter-spacing: inherit; }
button { cursor: pointer; text-align: center; }
button:disabled { cursor: default; }
img, svg, video, canvas { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

/* ---------- 컴포넌트성 클래스 ---------- */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.no-drag { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.header-fixed { position: relative; z-index: 20; }
.header-sub-fixed { position: relative; z-index: 20; background-color: var(--bg); }
.h-header { height: var(--header-h); }
.border-divider { border-color: var(--divider); }
.text-body { font-size: 16px; line-height: 28px; }
.text-small { font-size: 12px; line-height: 16px; }

/* ---------- display / layout ---------- */
.flex { display: flex; }
.inline-block { display: inline-block; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.bottom-0 { bottom: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-clip { overflow: clip; }
.overflow-y-auto { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pointer-events-none { pointer-events: none; }

.gap-0 { gap: 0; }
.gap-1 { gap: 4px; }
.gap-1\.5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-5 { gap: 20px; }
@media (min-width: 769px) { .tablet\:gap-10 { gap: 40px; } }

/* ---------- sizing ---------- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-dvh { height: 100vh; height: 100dvh; }
.min-w-0 { min-width: 0; }
.max-w-\[768px\] { max-width: 768px; }
.max-w-\[160px\] { max-width: 160px; }
.size-7 { width: 28px; height: 28px; }
.h-3 { height: 12px; }
.h-3\.5 { height: 14px; }
.w-3\.5 { width: 14px; }
.h-4 { height: 16px; }
.w-4 { width: 16px; }
.h-5 { height: 20px; }
.w-5 { width: 20px; }
.h-6 { height: 24px; }
.w-6 { width: 24px; }
.h-7 { height: 28px; }
.w-7 { width: 28px; }
.h-12 { height: 48px; }

/* ---------- spacing ---------- */
.px-0 { padding-left: 0; padding-right: 0; }
.px-1\.5 { padding-left: 6px; padding-right: 6px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-10 { padding-left: 40px; padding-right: 40px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-3\.5 { padding-top: 14px; padding-bottom: 14px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; }
.py-\[18px\] { padding-top: 18px; padding-bottom: 18px; }
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 4px; }
.pt-2\.5 { padding-top: 10px; }
.pt-5 { padding-top: 20px; }
.pt-10 { padding-top: 40px; }
.pb-1 { padding-bottom: 4px; }
.pb-2\.5 { padding-bottom: 10px; }
.pb-3 { padding-bottom: 12px; }
.pb-5 { padding-bottom: 20px; }
.pb-6 { padding-bottom: 24px; }
.pb-8 { padding-bottom: 32px; }
.pb-10 { padding-bottom: 40px; }
.pb-32 { padding-bottom: 128px; }
.mx-5 { margin-left: 20px; margin-right: 20px; }
.mt-2 { margin-top: 8px; }
.mr-2 { margin-right: 8px; }
.ml-2 { margin-left: 8px; }
.-ml-\[1px\] { margin-left: -1px; }
.mb-5 { margin-bottom: 20px; }
.mb-7 { margin-bottom: 28px; }

/* ---------- typography ---------- */
.text-sm { font-size: 14px; line-height: 20px; }
.text-base { font-size: 16px; line-height: 24px; }
.text-lg { font-size: 18px; line-height: 28px; }
.text-xl { font-size: 20px; line-height: 28px; }
.text-2xl { font-size: 24px; line-height: 32px; }
.text-\[14px\] { font-size: 14px; }
.text-\[18px\] { font-size: 18px; }
.text-\[20px\] { font-size: 20px; }
.text-\[32px\] { font-size: 32px; }
.leading-5 { line-height: 20px; }
.leading-6 { line-height: 24px; }
.leading-7 { line-height: 28px; }
.leading-8 { line-height: 32px; }
.leading-9 { line-height: 36px; }
.leading-\[32px\] { line-height: 32px; }
.leading-\[48px\] { line-height: 48px; }
.font-extralight { font-weight: 200; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.underline { text-decoration-line: underline; }
.decoration-solid { text-decoration-style: solid; }
.whitespace-nowrap { white-space: nowrap; }
.break-keep { word-break: keep-all; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opacity-90 { opacity: .9; }

/* ---------- colors ---------- */
.bg-white { background-color: var(--bg); }
.bg-transparent { background-color: transparent; }
.bg-\[\#f4f4f4\] { background-color: var(--bg-sub); }
.bg-\[\#e0e0e0\] { background-color: var(--track); }
.bg-gradient-to-r.from-\[\#003ce0\].to-\[\#0044ff\] { background-image: linear-gradient(to right, var(--accent), var(--accent-2)); }
.text-\[\#161616\] { color: var(--fg); }
.text-\[\#393939\] { color: var(--badge-fg); }
.text-\[\#003ce0\] { color: var(--accent); }
.text-\[\#0043ce\] { color: var(--link); }
.text-\[rgba\(22\,22\,22\,0\.25\)\] { color: rgba(var(--fg-rgb), .25); }
.text-\[rgba\(22\,22\,22\,0\.32\)\] { color: rgba(var(--fg-rgb), .32); }
.text-\[rgba\(22\,22\,22\,0\.4\)\] { color: rgba(var(--fg-rgb), .4); }
.text-\[rgba\(22\,22\,22\,0\.5\)\] { color: rgba(var(--fg-rgb), .5); }
.text-\[rgba\(22\,22\,22\,0\.56\)\] { color: rgba(var(--fg-rgb), .56); }
.text-\[rgba\(22\,22\,22\,0\.7\)\] { color: rgba(var(--fg-rgb), .7); }
.text-\[rgba\(22\,22\,22\,0\.72\)\] { color: rgba(var(--fg-rgb), .72); }
.hover\:bg-gray-100:hover { background-color: var(--hover); }
.disabled\:text-\[rgba\(22\,22\,22\,0\.25\)\]:disabled { color: rgba(var(--fg-rgb), .25); }
.disabled\:no-underline:disabled { text-decoration-line: none; }
.disabled\:pointer-events-none:disabled { pointer-events: none; }

/* ---------- borders ---------- */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-solid { border-style: solid; }
.border-\[1px_1px_0px\] { border-width: 1px 1px 0; }
.border-\[1px_1px_1px_1px\] { border-width: 1px; }
.border-\[\#c6c6c6\] { border-color: var(--border-strong); }
.border-\[\#161616\] { border-color: var(--fg); }
.border-\[rgba\(22\,22\,22\,0\.08\)\] { border-color: rgba(var(--fg-rgb), .08); }
.rounded-full { border-radius: 9999px; }
.rounded-\[2px\] { border-radius: 2px; }
.rounded-\[4px\] { border-radius: 4px; }

/* ---------- transitions ---------- */
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; transition-timing-function: cubic-bezier(.4, 0, .2, 1); }
.transition-transform { transition-property: transform; transition-duration: 150ms; transition-timing-function: cubic-bezier(.4, 0, .2, 1); }
.transition-\[background-color\] { transition-property: background-color; }
.transition-\[opacity\,transform\] { transition-property: opacity, transform; }
.duration-\[200ms\] { transition-duration: 200ms; }
.duration-\[250ms\] { transition-duration: 250ms; }
}

/* ---------- 다크 모드: 원본 색 클래스를 덮어쓴다 (레이어 밖이라 root.css 보다 우선) ---------- */
html[data-theme="dark"] body, html[data-theme="dark"] html { background-color: var(--bg); color: var(--fg); }
html[data-theme="dark"] .bg-white { background-color: var(--bg); }
html[data-theme="dark"] .bg-\[\#f4f4f4\] { background-color: var(--bg-sub); }
html[data-theme="dark"] .bg-\[\#e0e0e0\] { background-color: var(--track); }
html[data-theme="dark"] .bg-gradient-to-r.from-\[\#003ce0\].to-\[\#0044ff\] { background-image: linear-gradient(to right, var(--accent), var(--accent-2)); }
html[data-theme="dark"] .text-\[\#161616\] { color: var(--fg); }
html[data-theme="dark"] .text-\[\#393939\] { color: var(--badge-fg); }
html[data-theme="dark"] .text-\[\#003ce0\] { color: var(--accent); }
html[data-theme="dark"] .text-\[\#0043ce\] { color: var(--link); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.25\)\] { color: rgba(var(--fg-rgb), .25); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.3\)\] { color: rgba(var(--fg-rgb), .3); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.32\)\] { color: rgba(var(--fg-rgb), .32); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.4\)\] { color: rgba(var(--fg-rgb), .4); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.5\)\] { color: rgba(var(--fg-rgb), .5); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.56\)\] { color: rgba(var(--fg-rgb), .56); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.7\)\] { color: rgba(var(--fg-rgb), .7); }
html[data-theme="dark"] .text-\[rgba\(22\,22\,22\,0\.72\)\] { color: rgba(var(--fg-rgb), .72); }
html[data-theme="dark"] .border-\[\#c6c6c6\] { border-color: var(--border-strong); }
html[data-theme="dark"] .border-\[\#161616\] { border-color: var(--fg); }
html[data-theme="dark"] .border-divider { border-color: rgba(var(--fg-rgb), .14); }
html[data-theme="dark"] .border-\[rgba\(22\,22\,22\,0\.08\)\] { border-color: rgba(var(--fg-rgb), .1); }
html[data-theme="dark"] .border-\[rgba\(22\,22\,22\,0\.25\)\] { border-color: rgba(var(--fg-rgb), .3); }
html[data-theme="dark"] [style*="border-color: rgb(22, 22, 22)"] { border-color: var(--fg) !important; }
html[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: var(--hover); }
html[data-theme="dark"] .disabled\:text-\[rgba\(22\,22\,22\,0\.25\)\]:disabled { color: rgba(var(--fg-rgb), .25); }

/* 원본 마크업의 인라인 색/SVG fill 을 다크 모드에 맞춘다 */
html[data-theme="dark"] svg [fill="#161616"] { fill: var(--fg); }
html[data-theme="dark"] svg [fill="#198038"] { fill: var(--ok-icon); }
html[data-theme="dark"] .att-ok { color: var(--ok-text) !important; }
html[data-theme="dark"] .att-none { color: rgba(var(--fg-rgb), .3) !important; }
html[data-theme="dark"] svg [fill="#161616"][fill-opacity] { fill: var(--fg); }
