/* Sunday.com — SONET AMS 크림톤 디자인을 바탕으로 한 업무관리 화면
   색·모서리·라벨·움직임은 AMS(sonet-theme / sonet-pages / motion.js)와 같은 결. */

:root {
  --bg0: #ECE7DE; --bg1: #F3EFE8; --bg2: #FFFFFF;
  --surface: #FFFFFF; --surface-2: #FAF8F4; --surface-3: #EFEAE1;
  --line: #E4DED3; --line-2: #D3CBBD;
  --ink: #16130F; --ink-2: #4A453D; --ink-3: #9A9387; --ink-inv: #FFFFFF;
  --red: #E5482D; --blue: #2F5D9E; --green: #1E7A5A; --amber: #C98A12; --violet: #6E56CF; --teal: #0E7C86;
  --hover: #F3EFE8; --sel: rgba(229, 72, 45, .08);
  --active: #16130F; --active-ink: #FFFFFF;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, -apple-system, sans-serif;
  --sh: 0 1px 2px rgba(22, 19, 15, .05), 0 8px 24px rgba(22, 19, 15, .07);
  --sh-lg: 0 2px 6px rgba(22, 19, 15, .06), 0 24px 60px rgba(22, 19, 15, .16);
  --spring: cubic-bezier(.3, 1.35, .5, 1);
  --ease: cubic-bezier(.2, .8, .3, 1);
  --r: 16px; --r-lg: 20px; --r-sm: 10px;
  --side-w: 264px;
  --gnb-h: 74px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg0: #0D0F12; --bg1: #121418; --bg2: #181B20;
  --surface: #1A1D22; --surface-2: #20242A; --surface-3: #2A2F36;
  --line: #2C3138; --line-2: #3A4049;
  --ink: #F2EEE8; --ink-2: #C3BDB3; --ink-3: #7F7A72; --ink-inv: #121418;
  --hover: #22262C; --sel: rgba(255, 122, 92, .12);
  --red: #FF6B4E; --blue: #6EA0F0; --green: #3DBE8B; --amber: #F0B23B; --violet: #9C87F5; --teal: #3CC2CC;
  --active: #F2EEE8; --active-ink: #121418;
  --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --sh-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); background: var(--bg1); color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em; overflow: hidden; }
::selection { background: rgba(229, 72, 45, .18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hide { display: none !important; }

/* ---------------- 레이아웃 */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; height: 100dvh; transition: grid-template-columns .35s var(--ease); }
.app.rail { --side-w: 76px; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; height: var(--gnb-h); padding: 0 18px; flex: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; background: var(--active); color: var(--active-ink); display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 14px rgba(22, 19, 15, .18); position: relative; overflow: hidden; }
.brand-mark::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 25%, rgba(229, 72, 45, .9) 0 5px, transparent 6px); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { min-width: 0; line-height: 1.15; white-space: nowrap; }
.brand-text b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.brand-text small { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--red); font-weight: 700; }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0 16px; }
.nav-group { font-size: 11px; letter-spacing: .04em; color: var(--ink-3); padding: 16px 22px 6px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.nav-group .chev { margin-left: auto; transition: transform .3s var(--spring); width: 14px; height: 14px; }
.nav-group.closed .chev { transform: rotate(-90deg); }
.side nav { position: relative; padding: 0 10px; }
.side nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2);
  text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .25s, background .2s; margin: 1px 0; }
.side nav a:hover:not(.active) { background: var(--hover); color: var(--ink); }
.side nav a.active { color: var(--active-ink); }
.side nav a .cnt { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); transition: color .25s; }
.side nav a.active .cnt { color: inherit; opacity: .7; }
.side nav a span.t { overflow: hidden; text-overflow: ellipsis; }
.side nav .sx-ind { position: absolute; left: 10px; right: 10px; top: 0; height: 0; border-radius: 12px; background: var(--active); z-index: 0;
  box-shadow: 0 6px 16px rgba(22, 19, 15, .18); transition: top .34s var(--spring), height .34s var(--spring); pointer-events: none; }
.side nav .sx-ind.stretch { transition: top .17s cubic-bezier(.4, 0, .6, 1), height .17s cubic-bezier(.4, 0, .6, 1); }
.nav-sub { overflow: hidden; transition: max-height .4s var(--ease), opacity .3s; }
.nav-group.closed + .nav-sub { max-height: 0 !important; opacity: 0; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; align-items: center; flex: none; }
.app.rail .brand-text, .app.rail .nav-group span, .app.rail .nav-group .chev, .app.rail .side nav a span.t, .app.rail .side nav a .cnt, .app.rail .side-foot .grow { display: none; }
.app.rail .nav-group { justify-content: center; padding: 12px 0 4px; }
.app.rail .nav-group::before { content: ""; width: 24px; height: 1px; background: var(--line); }
.app.rail .side nav a { justify-content: center; padding: 11px 0; }
.app.rail .nav-group.closed + .nav-sub { max-height: none !important; opacity: 1; }

.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; }
.gnb { height: var(--gnb-h); display: flex; align-items: center; gap: 14px; padding: 0 22px 0 18px; flex: none; position: relative; z-index: 20; }
.menu-btn { width: 42px; height: 42px; border-radius: 13px; background: var(--active); color: var(--active-ink); border: 0; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 14px rgba(22, 19, 15, .16); transition: transform .2s var(--spring), background .2s; flex: none; }
.menu-btn:hover { transform: translateY(-1px); }
.menu-btn:active { transform: scale(.94); }
.pg-ttl { min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; flex: 1; }
.pg-ttl small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.pg-ttl small span { color: var(--ink-3); }
.pg-ttl h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gnb-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh); color: var(--ink-3); cursor: pointer; min-width: 260px; transition: border-color .2s, transform .2s var(--spring); }
.gnb-search:hover { border-color: var(--ink); color: var(--ink-2); transform: translateY(-1px); }
.gnb-search kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.clock b { font-family: var(--mono); font-size: 17px; letter-spacing: .02em; }
.clock span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.user-chip { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh);
  padding: 5px 12px 5px 6px; cursor: pointer; transition: transform .2s var(--spring), border-color .2s; position: relative; }
.user-chip:hover { transform: translateY(-1px); border-color: var(--line-2); }
.user-chip b { font-size: 13px; display: block; line-height: 1.1; }
.user-chip small { font-size: 11px; color: var(--ink-3); }
.av { width: 30px; height: 30px; border-radius: 10px; background: var(--active); color: var(--active-ink); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.av.sm { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh); display: grid; place-items: center;
  cursor: pointer; color: var(--ink-2); transition: transform .2s var(--spring), border-color .2s, color .2s; flex: none; }
.icon-btn:hover { transform: translateY(-1px); border-color: var(--ink); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
#view { flex: 1; overflow: auto; padding: 6px 22px 28px; position: relative; scroll-behavior: smooth; }

/* ---------------- 공통 요소 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); position: relative; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px 13px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-h h3 i.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 45, .14); flex: none; }
.card-h small { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.card-b { padding: 14px 18px 16px; }
.btn { height: 38px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; text-decoration: none; position: relative; overflow: hidden;
  transition: transform .2s var(--spring), border-color .2s, background .2s, color .2s, box-shadow .2s; }
.btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--active); border-color: var(--active); color: var(--active-ink); }
.btn.primary:hover { box-shadow: 0 10px 20px rgba(22, 19, 15, .22); }
.btn.accent { background: var(--red); border-color: var(--red); color: #fff; }
.btn.accent:hover { box-shadow: 0 10px 20px rgba(229, 72, 45, .3); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); border-color: transparent; }
.btn.danger { color: var(--red); border-color: #F2B8AC; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn .badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 10.5px; padding: 0 6px; line-height: 17px; font-family: var(--mono); }
.btn.primary .badge { background: var(--red); }
input.in, select.in, textarea.in { height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px;
  font-weight: 500; transition: border-color .2s, box-shadow .2s; width: 100%; min-width: 0; }
textarea.in { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
input.in:hover, select.in:hover, textarea.in:hover { border-color: var(--line-2); }
input.in:focus, select.in:focus, textarea.in:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 19, 15, .08); }
label.lb { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin: 0 0 6px; text-transform: uppercase; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--c, #9A9387) 14%, var(--surface)); color: color-mix(in srgb, var(--c, #9A9387) 78%, var(--ink)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #9A9387); flex: none; }
.chip.plain::before { display: none; }
.chip.link { cursor: pointer; background: var(--surface-3); color: var(--ink-2); }
.chip.link::before { display: none; }
.chip.link:hover { background: var(--active); color: var(--active-ink); }
.chip.file { background: var(--surface-3); color: var(--ink-2); }
.chip.file::before { display: none; }
.tag-mono { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2); }
.empty { padding: 50px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 42px; height: 42px; stroke-width: 1.3; margin-bottom: 8px; }

/* 탭(보기) — 선택 표시가 미끄러져 옮겨 간다 */
.tabs { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh); position: relative; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px; background: var(--active); transition: left .38s var(--spring), width .38s var(--spring); z-index: 0;
  box-shadow: 0 6px 14px rgba(22, 19, 15, .2); }
.tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color .25s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--active-ink); }
.tabs button svg.i { width: 15px; height: 15px; }

/* ---------------- 대시보드 (벤토 그리드) */
.dash-head { display: flex; align-items: flex-end; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.w { grid-column: span 4; min-height: 150px; display: flex; flex-direction: column; overflow: hidden; }
.w.kpi { grid-column: span 3; min-height: 132px; }
.w.size-m { grid-column: span 6; }
.w.size-l { grid-column: span 8; }
.w.size-xl { grid-column: span 12; }
.w .card-b { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.w .w-tools { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.w:hover .w-tools, .editing .w .w-tools { opacity: 1; }
.kpi-v { font-size: 30px; font-weight: 800; letter-spacing: -.04em; font-family: var(--sans); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-v .u { font-size: 14px; font-weight: 700; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi-s { font-size: 12.5px; color: var(--ink-3); margin-top: auto; padding-top: 10px; display: flex; gap: 8px; align-items: center; }
.kpi .kpi-l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; font-weight: 700; color: var(--ink-3); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.kpi .kpi-l i { width: 8px; height: 8px; border-radius: 3px; background: var(--tone, var(--ink)); }
.kpi.tone-red { --tone: var(--red); } .kpi.tone-amber { --tone: var(--amber); } .kpi.tone-green { --tone: var(--green); } .kpi.tone-ink { --tone: var(--ink); }
.kpi .spark { position: absolute; right: 14px; top: 16px; width: 90px; height: 34px; opacity: .9; }
.kpi.hero { background: var(--active); color: var(--active-ink); border-color: var(--active); }
.kpi.hero .kpi-l, .kpi.hero .kpi-s, .kpi.hero .kpi-v .u { color: color-mix(in srgb, var(--active-ink) 62%, transparent); }
.kpi.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(229, 72, 45, .55), transparent 65%); pointer-events: none; }

.chart { width: 100%; flex: 1; min-height: 180px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .ax { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-3); }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .bar { fill: var(--ink); transition: fill .2s, opacity .2s; cursor: pointer; }
.chart .bar.alt { fill: var(--line-2); }
.chart .bar:hover { fill: var(--red); }
.chart g.dim .bar:not(:hover) { opacity: .35; }
.chart .val { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-2); font-weight: 700; }
.chart .ln { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { opacity: .1; }
.chart .pt { stroke: var(--surface); stroke-width: 2; transition: r .2s var(--spring); cursor: pointer; }
.chart .pt:hover { r: 6; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; cursor: pointer; }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.hbar .t { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.hbar .t i { display: block; height: 100%; border-radius: 6px; background: var(--ink); transform-origin: left; transition: background .2s; }
.hbar:hover .t i { background: var(--red); }
.hbar .v { font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex: 1; flex-wrap: wrap; justify-content: center; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.donut-wrap .seg { transition: transform .3s var(--spring), opacity .2s; transform-origin: 75px 75px; cursor: pointer; }
.donut-wrap .seg:hover { transform: scale(1.05); }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; min-width: 120px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-family: var(--mono); font-size: 11.5px; }
.tip { position: fixed; z-index: 9000; pointer-events: none; background: var(--active); color: var(--active-ink); padding: 7px 10px; border-radius: 10px; font-size: 12px; font-weight: 600;
  box-shadow: var(--sh-lg); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; animation: sxFade .15s; }
.tip b { font-family: var(--mono); }
.wlist { display: flex; flex-direction: column; }
.wlist a { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--line); text-decoration: none; cursor: pointer; border-radius: 8px;
  transition: background .15s, padding .2s var(--spring); }
.wlist a:hover { background: var(--hover); padding-left: 10px; }
.wlist a:last-child { border-bottom: 0; }
.wlist .d { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--red); min-width: 44px; }
.wlist .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.wlist .s { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }

/* 카드 위 스포트라이트(마우스 따라 빛) */
.spot { --mx: 50%; --my: 50%; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(229, 72, 45, .07), transparent 45%); }
.spot:hover::before { opacity: 1; }
.lift { transition: transform .35s var(--spring), box-shadow .3s, border-color .3s; }
.lift:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }

/* ---------------- 테이블 화면 */
.tb-head { display: flex; gap: 10px; align-items: center; margin: 4px 0 12px; flex-wrap: wrap; }
.tb-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tb-bar .search { position: relative; flex: 0 1 260px; min-width: 160px; }
.tb-bar .search svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--ink-3); }
.tb-bar .search input { padding-left: 34px; }
.n-info { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.n-info b { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--ink); margin-right: 2px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 11px; border-radius: 10px; background: var(--active); color: var(--active-ink); font-size: 12.5px; font-weight: 700; animation: sxPop .3s var(--spring); }
.filter-chip button { border: 0; background: rgba(255, 255, 255, .15); color: inherit; width: 20px; height: 20px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.desc-line { color: var(--ink-3); font-size: 12.5px; margin: -6px 0 12px; }

.gridwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: auto; max-height: calc(100dvh - 230px); position: relative; }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
table.grid th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-3); font-weight: 700;
  text-align: left; padding: 0 12px; height: 40px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; text-transform: uppercase; }
table.grid th:hover { color: var(--ink); }
table.grid th .ft { display: inline-flex; align-items: center; gap: 6px; }
table.grid th .ft svg { width: 13px; height: 13px; opacity: .6; }
table.grid th.sorted { color: var(--red); }
table.grid td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; background: var(--surface); }
table.grid tr.rec { cursor: pointer; }
table.grid tr.rec td { transition: background .15s; }
table.grid tr.rec:hover td { background: var(--hover); }
table.grid tr.rec.sel td { background: var(--sel); }
table.grid .c0 { position: sticky; left: 0; z-index: 2; font-weight: 700; min-width: 240px; max-width: 360px; box-shadow: 1px 0 0 var(--line); }
table.grid th.c0 { z-index: 4; }
table.grid .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
table.grid .rn { width: 46px; min-width: 46px; text-align: right; color: var(--ink-3); font-family: var(--mono); font-size: 11px; position: sticky; left: 0; z-index: 2; }
table.grid tr.grp td { background: var(--surface-2); height: 42px; position: sticky; top: 40px; z-index: 1; cursor: pointer; }
table.grid tr.grp td .gl { display: flex; align-items: center; gap: 10px; font-weight: 800; position: sticky; left: 12px; width: max-content; }
table.grid tr.grp td .gl svg { transition: transform .3s var(--spring); width: 15px; height: 15px; }
table.grid tr.grp.closed td .gl svg { transform: rotate(-90deg); }
table.grid tr.grp .gn { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
table.grid tr.sum td { background: var(--surface-2); font-weight: 700; height: 36px; color: var(--ink-2); }
.cell-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 11px; font-family: var(--mono); margin-left: 8px; font-weight: 600; }
.cell-meta svg { width: 12px; height: 12px; }
.more-row { text-align: center; padding: 14px; }
.ppl { display: inline-flex; align-items: center; gap: 4px; }
.ppl .av { margin-right: -2px; border: 2px solid var(--surface); }

/* 카드 목록(작은 화면) */
.cards { display: none; flex-direction: column; gap: 10px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; box-shadow: var(--sh); cursor: pointer; }
.rcard b { display: block; font-size: 14px; margin-bottom: 6px; }
.rcard .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.rcard .kv span:nth-child(odd) { color: var(--ink-3); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; padding-top: 2px; }
.rcard .kv span:nth-child(even) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 칸반 */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 290px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 240px); transition: background .2s, border-color .2s; }
.kcol.over { background: var(--sel); border-color: var(--red); }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 800; }
.kcol-h .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.kcol-b { overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; box-shadow: var(--sh); cursor: grab; font-size: 13px;
  transition: transform .25s var(--spring), box-shadow .25s, opacity .2s; }
.kcard:hover { transform: translateY(-2px) rotate(-.3deg); box-shadow: var(--sh-lg); }
.kcard.drag { opacity: .4; }
.kcard b { display: block; margin-bottom: 6px; line-height: 1.35; }
.kcard .m { display: flex; flex-wrap: wrap; gap: 5px; color: var(--ink-3); font-size: 12px; }

/* 달력 */
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; }
.cal-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cal-h b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; min-width: 120px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-g .dw { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 700; }
.cal-g .dc { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-g .dc:nth-child(7n) { border-right: 0; }
.cal-g .dc.out { background: var(--surface-2); }
.cal-g .dc .dn { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink-3); }
.cal-g .dc.today .dn { color: #fff; background: var(--red); border-radius: 6px; padding: 0 6px; align-self: flex-start; }
.cal-g .ev { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--active); color: var(--active-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  transition: transform .2s var(--spring); }
.cal-g .ev:hover { transform: scale(1.03); background: var(--red); }

/* ---------------- 상세 서랍 */
.scrim { position: fixed; inset: 0; background: rgba(22, 19, 15, .28); backdrop-filter: blur(3px); z-index: 80; animation: sxFade .25s; }
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(760px, calc(100vw - 20px)); background: var(--surface); border-radius: 22px; box-shadow: var(--sh-lg); z-index: 90;
  display: flex; flex-direction: column; overflow: hidden; animation: drawerIn .5s var(--spring); border: 1px solid var(--line); }
.drawer.out { animation: drawerOut .28s var(--ease) forwards; }
@keyframes drawerIn { from { transform: translateX(60px) scale(.98); opacity: 0; filter: blur(6px); } }
@keyframes drawerOut { to { transform: translateX(60px); opacity: 0; } }
.dr-h { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.dr-h .ttl { flex: 1; min-width: 0; }
.dr-h small { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--red); text-transform: uppercase; }
.dr-h h2 { margin: 2px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.03em; line-height: 1.3; outline: none; border-radius: 8px; padding: 2px 4px; margin-left: -4px; }
.dr-h h2[contenteditable="true"]:hover { background: var(--hover); }
.dr-h h2:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--line-2); }
.dr-tabs { padding: 10px 20px 0; }
.dr-b { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fgrid .full { grid-column: 1 / -1; }
.fv { min-height: 38px; border: 1px solid transparent; border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; cursor: text; transition: border-color .2s, background .2s; }
.fv:hover { border-color: var(--line); background: var(--surface-2); }
.fv.ro { cursor: default; }
.fv.ro:hover { border-color: transparent; background: none; }
.fv .ph { color: var(--ink-3); }
.fv.edit { padding: 0; border: 0; background: none; }
.sec-t { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; font-weight: 700; color: var(--ink-3); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.sec-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cmt { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); animation: sxRow .4s var(--ease) both; }
.cmt .bd { flex: 1; min-width: 0; }
.cmt .hd { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.cmt .hd b { font-size: 13px; }
.cmt .hd span { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.cmt .tx { margin-top: 4px; font-size: 13.5px; line-height: 1.6; word-break: break-word; }
.cmt .tx p { margin: 0 0 4px; }
.cmt .tx .mention { color: var(--red); }
.cmt .tx .att { color: var(--ink-3); font-size: 12px; }
.cmt.reply { margin-left: 36px; padding-top: 8px; }
.cbox { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; position: sticky; bottom: -24px; background: var(--surface); padding: 10px 0 0; }
.act { font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); display: flex; gap: 8px; }
.act time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); min-width: 108px; }
.subt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.subt td, .subt th { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; white-space: nowrap; }
.subt th { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: .06em; }
.subt tr.click { cursor: pointer; }
.subt tr.click:hover td { background: var(--hover); }

/* 드롭다운·메뉴·팝오버 */
.pop { position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); padding: 6px; min-width: 200px; max-height: 60vh; overflow-y: auto;
  animation: sxPop .24s var(--spring); }
.pop .it { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pop .it:hover, .pop .it.kb { background: var(--hover); }
.pop .it.on { color: var(--red); }
.pop .it svg.i { width: 16px; height: 16px; color: var(--ink-3); }
.pop .sep { height: 1px; background: var(--line); margin: 5px 2px; }
.pop .hd { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-3); padding: 8px 10px 4px; font-weight: 700; }
.pop .body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-width: 300px; }

/* 모달 */
.modal-bg { position: fixed; inset: 0; z-index: 150; background: rgba(22, 19, 15, .32); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: sxFade .2s; }
.modal { background: var(--surface); border-radius: 22px; box-shadow: var(--sh-lg); width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: sxModal .45s var(--spring); border: 1px solid var(--line); }
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-h h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; flex: 1; }
.modal-b { padding: 4px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-f { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }

/* 필드 관리 */
.flist { display: flex; flex-direction: column; gap: 6px; }
.frow { display: grid; grid-template-columns: 22px 1fr 150px auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: transform .25s var(--spring), box-shadow .2s, border-color .2s; }
.frow:hover { border-color: var(--line-2); }
.frow.drag { opacity: .4; }
.frow.over { border-color: var(--red); transform: translateY(2px); }
.frow .grip { cursor: grab; color: var(--ink-3); display: grid; place-items: center; }
.frow input.in, .frow select.in { height: 32px; }
.choice-ed { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 4px 30px; }
.choice-ed .ce { display: flex; gap: 6px; align-items: center; }
.choice-ed input[type=color] { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); cursor: pointer; }

/* 명령 팔레트 */
.cmdk { position: fixed; inset: 0; z-index: 200; background: rgba(22, 19, 15, .3); backdrop-filter: blur(6px); display: flex; justify-content: center; padding-top: 12vh; animation: sxFade .2s; }
.cmdk-box { width: min(640px, calc(100vw - 24px)); background: var(--surface); border-radius: 22px; box-shadow: var(--sh-lg); overflow: hidden; animation: sxModal .45s var(--spring); border: 1px solid var(--line); align-self: flex-start; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in input { border: 0; outline: none; background: none; font-size: 17px; flex: 1; font-weight: 600; }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.cmdk-list .it { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.cmdk-list .it small { margin-left: auto; color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.cmdk-list .it.kb { background: var(--active); color: var(--active-ink); }
.cmdk-list .it.kb small { color: inherit; opacity: .7; }
.cmdk-list .hd { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-3); padding: 10px 12px 4px; font-weight: 700; }

/* 토스트 */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--active); color: var(--active-ink); padding: 11px 16px; border-radius: 14px; font-size: 13px; font-weight: 600; box-shadow: var(--sh-lg); animation: sxToast .45s var(--spring);
  display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--red); color: #fff; }
.toast.out { animation: sxFade .3s reverse forwards; }

/* 로그인 */
.lg { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg1); }
.lg-art { position: relative; overflow: hidden; background: #16130F; color: #F3EFE8; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.lg-art .orb { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .85; animation: orb 14s ease-in-out infinite alternate; }
.lg-art .o1 { width: 420px; height: 420px; background: radial-gradient(circle, #E5482D, transparent 65%); right: -120px; top: -80px; }
.lg-art .o2 { width: 360px; height: 360px; background: radial-gradient(circle, #6E56CF, transparent 65%); left: -100px; bottom: -120px; animation-delay: -6s; }
.lg-art .o3 { width: 260px; height: 260px; background: radial-gradient(circle, #C98A12, transparent 65%); left: 40%; top: 45%; animation-delay: -3s; opacity: .5; }
@keyframes orb { to { transform: translate(-40px, 50px) scale(1.12); } }
.lg-art .gridbg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 40% 50%, #000, transparent 75%); }
.lg-art > * { position: relative; }
.lg-art h2 { font-size: clamp(34px, 4.4vw, 60px); line-height: 1.05; letter-spacing: -.045em; margin: 0; font-weight: 800; }
.lg-art h2 em { font-style: normal; color: #E5482D; }
.lg-art p { color: rgba(243, 239, 232, .6); max-width: 420px; }
.lg-form { display: grid; place-items: center; padding: 24px; }
.lg-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.lg-card h3 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.lg-card .in { height: 46px; font-size: 14px; }
.lg-card .btn { height: 46px; justify-content: center; font-size: 14px; }
.lg-err { color: var(--red); font-size: 13px; min-height: 18px; }

/* 문서 */
.doc { max-width: 860px; margin: 0 auto; }
.doc-body { padding: 26px 32px; min-height: 60vh; line-height: 1.75; font-size: 15px; outline: none; }
.doc-body h1, .doc-body h2, .doc-body h3 { letter-spacing: -.02em; }

/* 스켈레톤 */
.sk { background: linear-gradient(90deg, var(--surface-3) 0, var(--surface-2) 40%, var(--surface-3) 80%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------- 움직임 (AMS motion.js와 같은 결) */
.sx-ring { position: fixed; z-index: 99999; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1.5px solid rgba(22, 19, 15, .5); pointer-events: none; animation: sxRing .6s var(--ease) forwards; }
:root[data-theme="dark"] .sx-ring { border-color: rgba(255, 140, 110, .8); }
@keyframes sxRing { to { transform: scale(5.5); opacity: 0; border-width: .5px; } }
.sx-rv { animation: sxIn .55s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--sx-i, 0) * 45ms); }
@keyframes sxIn { from { opacity: 0; filter: blur(10px); transform: translateY(12px) scale(.985); } to { opacity: 1; filter: none; transform: none; } }
.sx-wipe { animation: sxWipe .7s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes sxWipe { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.sx-grow-y { transform-origin: bottom; transform-box: fill-box; animation: sxGrowY .8s var(--spring) both; animation-delay: calc(var(--sx-j, 0) * 40ms); }
.sx-grow-x { transform-origin: left; animation: sxGrowX .8s var(--spring) both; animation-delay: calc(var(--sx-j, 0) * 50ms); }
@keyframes sxGrowY { from { transform: scaleY(0); } }
@keyframes sxGrowX { from { transform: scaleX(0); } }
.sx-draw { animation: sxDraw 1.2s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes sxDraw { from { stroke-dashoffset: var(--sx-len); } to { stroke-dashoffset: 0; } }
.sx-seg { animation: sxSeg 1s var(--ease) both; animation-delay: calc(var(--sx-j, 0) * 90ms); }
@keyframes sxSeg { from { stroke-dasharray: 0 999; } }
@keyframes sxPop { from { opacity: 0; transform: translateY(-8px) scale(.96); filter: blur(4px); } }
@keyframes sxFade { from { opacity: 0; } }
@keyframes sxRow { from { opacity: 0; transform: translateY(6px); } }
@keyframes sxModal { from { opacity: 0; transform: translateY(18px) scale(.97); filter: blur(5px); } }
@keyframes sxToast { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.view-out { animation: viewOut .18s ease forwards; }
@keyframes viewOut { to { opacity: 0; filter: blur(6px); transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 반응형 */
@media (max-width: 1280px) {
  .w.kpi { grid-column: span 6; }
  .w { grid-column: span 6; }
  .w.size-l, .w.size-m { grid-column: span 12; }
  .gnb-search { min-width: 0; }
  .gnb-search span.t { display: none; }
  .gnb-search kbd { display: none; }
}
@media (max-width: 1100px) { .clock { display: none; } }
@media (max-width: 860px) {
  .app, .app.rail { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; transform: translateX(-102%); transition: transform .45s var(--spring); box-shadow: var(--sh-lg); }
  .app.open .side { transform: none; }
  .app.open::after { content: ""; position: fixed; inset: 0; background: rgba(22, 19, 15, .3); z-index: 25; animation: sxFade .2s; }
  .app.rail .brand-text, .app.rail .nav-group span, .app.rail .side nav a span.t, .app.rail .side nav a .cnt { display: initial; }
  .gnb { padding: 0 12px; gap: 10px; --gnb-h: 64px; height: 64px; }
  .pg-ttl h1 { font-size: 19px; }
  .user-chip div { display: none; }
  .user-chip { padding: 5px; }
  #view { padding: 4px 12px 24px; }
  .fgrid { grid-template-columns: 1fr; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .lg { grid-template-columns: 1fr; }
  .lg-art { display: none; }
  .gridwrap { max-height: none; }
}
@media (max-width: 640px) {
  .bento { gap: 10px; }
  .w, .w.kpi, .w.size-m, .w.size-l { grid-column: span 12; }
  .w.kpi { min-height: 110px; }
  .kpi-v { font-size: 26px; }
  .gridwrap.can-card { display: none; }
  .cards.on { display: flex; }
  .tb-bar .search { flex: 1 1 100%; }
  .frow { grid-template-columns: 22px 1fr auto; }
  .frow select.in { grid-column: 2; }
  .kcol { flex-basis: 82vw; }
  .cal-g .dc { min-height: 70px; }
  .cal-g .ev { font-size: 10px; padding: 1px 4px; }
}

/* ---------- 추가: 스위치, 필드 관리, 위젯 편집 */
.sw { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .25s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .35s var(--spring); }
.sw input:checked + i { background: var(--green); }
.sw input:checked + i::after { transform: translateX(16px); }
.frow-wrap { display: flex; flex-direction: column; }
.frow-wrap .choice-ed { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; margin: -4px 4px 0; padding-top: 12px; background: var(--surface-2); }
.fe { max-height: 64vh; overflow-y: auto; padding-right: 4px; }
.editing .w { cursor: grab; outline: 1px dashed var(--line-2); outline-offset: 3px; }
.doc .tb-bar { margin-bottom: 12px; }
.doc-body ul, .doc-body ol { padding-left: 22px; }
.lb svg.i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }

.w .card-h h3 { flex: 1 1 auto; white-space: nowrap; }
.w .card-h h3 span { overflow: hidden; text-overflow: ellipsis; }
.w .card-h small { white-space: nowrap; flex: none; }
.w.kpi.size-s { grid-column: span 4; }

/* ---------------- 마우스 올림 효과 (강화) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  /* 왼쪽 메뉴: 오른쪽으로 밀리며 아이콘이 통통 튐, 왼쪽 강조선 */
  .side nav a { transition: color .25s, background .2s, transform .35s var(--spring), padding .3s var(--spring); }
  .side nav a::before { content: ""; position: absolute; left: 2px; top: 50%; width: 3px; height: 0; border-radius: 3px; background: var(--red); transform: translateY(-50%); transition: height .3s var(--spring); }
  .side nav a:hover:not(.active) { transform: translateX(4px); }
  .side nav a:hover:not(.active)::before { height: 60%; }
  .side nav a svg.i, .side nav a > svg { transition: transform .4s var(--spring); }
  .side nav a:hover svg.i, .side nav a:hover > svg { transform: scale(1.18) rotate(-8deg); }
  .side nav a:hover .cnt { color: var(--red); }

  /* 대시보드 카드: 떠오르며 살짝 커지고 테두리·그림자 강조, 마우스 방향으로 기울어짐(JS) */
  .w { transition: transform .45s var(--spring), box-shadow .35s, border-color .3s; transform-style: preserve-3d; will-change: transform; }
  .w:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px) scale(1.012);
    box-shadow: 0 22px 44px -18px rgba(22, 19, 15, .28), 0 2px 6px rgba(22, 19, 15, .06); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); z-index: 2; }
  .editing .w:hover { transform: none; }
  .w .card-h .dot { transition: transform .35s var(--spring), background .25s; }
  .w:hover .card-h .dot { transform: scale(1.6); background: var(--red); }
  .w .card-h h3 span { transition: color .2s; }
  .w:hover .card-h h3 span { color: var(--red); }
  .kpi-v { transition: transform .4s var(--spring); transform-origin: left bottom; }
  .w.kpi:hover .kpi-v { transform: scale(1.06); }
  .kpi .kpi-l i { transition: transform .35s var(--spring); }
  .w.kpi:hover .kpi-l i { transform: scale(1.5) rotate(45deg); }
  .kpi-part { border-radius: 6px; padding: 1px 4px; margin: -1px -4px; transition: background .2s, color .2s; }
  .kpi-part:hover { background: var(--sel); color: var(--red); }

  /* 그래프: 가로 막대는 올린 줄만 굵어지고 나머지는 흐려짐 */
  .hbar { transition: opacity .25s, transform .3s var(--spring); }
  .hbars:hover .hbar:not(:hover) { opacity: .4; }
  .hbar:hover { transform: translateX(3px); }
  .hbar .t { transition: height .3s var(--spring); }
  .hbar:hover .t { height: 14px; }
  .hbar:hover .l { color: var(--ink); font-weight: 800; }
  .hbar:hover .v { color: var(--red); }
  .chart .bars:hover .bar:not(:hover) { opacity: .4; }
  .chart .bar:hover { filter: drop-shadow(0 6px 8px rgba(229, 72, 45, .35)); }
  .donut-wrap svg:hover .seg:not(:hover) { opacity: .35; }
  .donut-wrap .seg:hover { transform: scale(1.08); }
  .legend div { transition: transform .25s var(--spring); }
  .legend div:hover { transform: translateX(4px); }

  /* 표: 줄 강조 + 왼쪽 빨간 선, 이름이 살짝 밀림 */
  table.grid tr.rec td { transition: background .15s; }
  table.grid tr.rec td.c0 { transition: background .15s, box-shadow .2s, padding .3s var(--spring); }
  table.grid tr.rec:hover td { background: var(--sel); }
  table.grid tr.rec:hover td.c0 { box-shadow: inset 3px 0 0 var(--red); padding-left: 16px; color: var(--red); }
  .subt tr.click:hover td { background: var(--sel); }

  /* 칸반·카드·칩·달력 */
  .rcard { transition: transform .35s var(--spring), box-shadow .3s, border-color .25s; }
  .rcard:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--sh-lg); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
  .kcard:hover { transform: translateY(-4px) scale(1.02) rotate(-.4deg); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
  .chip { transition: transform .25s var(--spring), background .2s, color .2s; }
  .chip.link:hover, td .chip:hover { transform: scale(1.08); }

  /* 단추: 아이콘이 튀고, 진한 단추에는 빛이 지나감 */
  .btn, .icon-btn { position: relative; overflow: hidden; }
  .btn svg.i, .icon-btn svg.i, .btn > svg, .icon-btn > svg { transition: transform .35s var(--spring); }
  .btn:hover svg.i, .icon-btn:hover svg.i, .btn:hover > svg, .icon-btn:hover > svg { transform: scale(1.15) rotate(-6deg); }
  .btn.primary::after, .btn.accent::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform .7s ease; pointer-events: none; }
  .btn.primary:hover::after, .btn.accent:hover::after { transform: translateX(120%); }
  .btn:active, .icon-btn:active { transform: scale(.96); }

  /* 탭·메뉴·목록 */
  .tabs button { transition: color .2s, transform .25s var(--spring); }
  .tabs button:hover { transform: translateY(-1px); }
  .pop .it { transition: background .15s, padding .25s var(--spring), color .15s; }
  .pop .it:hover { padding-left: 16px; color: var(--ink); }
  .wlist a:hover { box-shadow: inset 3px 0 0 var(--red); }
  .wlist a:hover .n { color: var(--red); }
}
