:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #14171c;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #e6a117;
  --accent-ink: #2a1a00;
  --accent-text: #9a5b0a;
  --accent-soft: #fdf1d6;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --warn: #b45309;
  --warn-bg: #fff3df;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015; --surface: #151a21; --surface-2: #1c222b; --text: #eceff4; --muted: #98a2b3;
    --line: #262d38; --accent: #f0b429; --accent-ink: #1a1100; --accent-text: #f2c53d; --accent-soft: #2b2210;
    --ok: #4ade80; --ok-bg: #11281a; --warn: #fbbf24; --warn-bg: #2a2010;
    --danger: #f87171; --danger-bg: #2d1616; --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1015; --surface: #151a21; --surface-2: #1c222b; --text: #eceff4; --muted: #98a2b3;
  --line: #262d38; --accent: #f0b429; --accent-ink: #1a1100; --accent-text: #f2c53d; --accent-soft: #2b2210;
  --ok: #4ade80; --ok-bg: #11281a; --warn: #fbbf24; --warn-bg: #2a2010;
  --danger: #f87171; --danger-bg: #2d1616; --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", Pretendard, "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 28px; height: 25px; object-fit: contain; flex: none; }
.brand small { font-weight: 500; color: var(--muted); }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 24px 0 14px; flex-wrap: wrap; }
.head:first-child { margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.card.hover:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.empty { padding: 36px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); grid-column: 1 / -1; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.narrow { width: 100%; max-width: 400px; padding: 28px; }
.narrow .brand { justify-content: center; margin-bottom: 20px; }
.narrow h1 { font-size: 22px; text-align: center; }
.narrow .muted.lead { text-align: center; margin-bottom: 20px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel] {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.suffix { display: flex; align-items: center; gap: 8px; }
.suffix span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; transition: transform .12s var(--ease), background .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { opacity: .92; background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 20px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 8px; }
.tabs button { flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.nav button { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.nav button.on { background: var(--accent-soft); color: var(--accent-text); }

.tile { display: flex; flex-direction: column; gap: 8px; min-height: 92px; }
.tile .name { font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 10px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.person .who { min-width: 0; }
.person .who b { display: block; }

#layer .backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(8, 10, 14, .5); display: grid; place-items: center;
  padding: 16px; animation: fade .18s var(--ease);
}
#layer .modal {
  width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  animation: rise .22s var(--ease);
}
#layer .modal h2 { margin-bottom: 6px; }
#layer .modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal.error h2 { color: var(--danger); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; animation: rise .22s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 600px) {
  .topbar .name-line { display: none; }
  .wrap { padding-top: 16px; }
  h1 { font-size: 21px; }
  .head .btn { width: 100%; }
}

/* 시작 화면: 진그룹 로고가 조각별로 들어오고 한 번 빛이 지나간다 */
#splash {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; background: var(--bg); transition: opacity .45s var(--ease), visibility .45s;
}
#splash.done { opacity: 0; visibility: hidden; }
#splash .logo { width: min(150px, 38vw); height: auto; overflow: visible; filter: drop-shadow(0 10px 24px rgba(230, 161, 23, .28)); }
#splash .part { opacity: 0; }
#splash .main { animation: draw-main .8s var(--ease) .1s forwards; transform-origin: 0% 50%; }
#splash .top { animation: drop-in .6s var(--ease) .55s forwards; }
#splash .bottom { animation: rise-in .6s var(--ease) .7s forwards; }
#splash .shine { animation: shine 1.4s ease-in-out 1.1s infinite; }
#splash .splash-word { font-weight: 700; letter-spacing: .42em; font-size: 13px; color: var(--accent-text); opacity: 0; animation: fade-in .6s var(--ease) .9s forwards; padding-left: .42em; }
@keyframes draw-main { from { opacity: 0; transform: translateX(-90px) scaleX(.85); } to { opacity: 1; transform: none; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-70px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(70px); } to { opacity: 1; transform: none; } }
@keyframes shine { from { transform: translateX(0) skewX(-20deg); } to { transform: translateX(3400px) skewX(-20deg); } }
@keyframes fade-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #splash .part, #splash .splash-word { opacity: 1 !important; } }
