/* ===========================================================
   아리 — 라이프 케어(Life Care) · 클린 화이트 글래스 테마
   상단바 = 메인 메뉴 (공유)  ·  좌측 = 모듈 + 연결 소스  ·  본문 = 모듈별 코칭
   아리가 건강·금융·지식 데이터를 읽고 분석/코칭/리마인더를 준비한다.
   =========================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg-top: #f6efe7;
  --bg-mid: #eef0f1;
  --bg-bot: #e9ebed;
  --card: #ffffff;
  --card-2: #f4f5f6;
  --card-3: #eef0f1;
  --ink: #211f1c;
  --ink-2: #514d47;
  --muted: #8d8a85;
  --faint: #b6b3ad;
  --line: rgba(33, 31, 28, 0.07);
  --line-2: rgba(33, 31, 28, 0.13);
  --fill: #29241f;
  --fill-soft: #36302a;
  --on-fill: #f4efe6;
  --blue: #4f72e0;
  --coral: #df7256;
  --green: #4e9b66;
  --violet: #8b6fd4;
  --amber: #e0a23c;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px -14px rgba(30, 26, 22, 0.22), 0 2px 6px -2px rgba(30, 26, 22, 0.06);
  --shadow-sm: 0 4px 14px -8px rgba(30, 26, 22, 0.18);
  --glass: rgba(255, 255, 255, 0.4);
  --glass-2: rgba(255, 255, 255, 0.26);
  --glass-brd: rgba(255, 255, 255, 0.7);
  --glass-ink: rgba(26, 22, 18, 0.46);
  --blur: blur(26px) saturate(190%);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --font-disp: "Onest", "Pretendard", system-ui, sans-serif;
  --font-ui: "Pretendard", "Onest", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg-top: #201d1a;
  --bg-mid: #1a1816;
  --bg-bot: #161413;
  --card: #2c2925;
  --card-2: #353029;
  --card-3: #3b352d;
  --ink: #f3eee6;
  --ink-2: #c3bdb4;
  --muted: #948e85;
  --faint: #6f6a62;
  --line: rgba(244, 239, 230, 0.09);
  --line-2: rgba(244, 239, 230, 0.16);
  --fill: #f4efe6;
  --fill-soft: #e7e0d4;
  --on-fill: #211f1c;
  --shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.7), 0 2px 8px -3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 6px 16px -10px rgba(0, 0, 0, 0.6);
  --glass: rgba(48, 43, 38, 0.4);
  --glass-2: rgba(70, 63, 55, 0.28);
  --glass-brd: rgba(255, 255, 255, 0.1);
  --glass-ink: rgba(16, 13, 11, 0.42);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(178deg, var(--bg-top) 0%, var(--bg-mid) 20%, var(--bg-bot) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  word-break: keep-all;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1em; height: 1em; flex-shrink: 0; display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

.mpage { max-width: 1680px; margin: 0 auto; padding: 0 26px 26px; }

/* ====================== 상단바 — 메인 메뉴 (공유) ====================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  height: 70px; margin: 0 -26px; padding: 0 30px;
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--fill); color: var(--coral);
  display: grid; place-items: center; position: relative;
}
.brand-mark .ic { width: 21px; height: 21px; }
.brand-mark::after {
  content: ""; position: absolute; top: -2px; right: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral); border: 2px solid var(--bg-top);
}
.brand-tag { line-height: 1.15; }
.brand-tag b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand-tag span {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.mainnav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.mainnav a .ic { width: 16px; height: 16px; color: var(--muted); transition: color 0.16s; }
.mainnav a .badge { font-size: 11px; font-weight: 700; background: var(--coral); color: #fff; border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; }
.mainnav a:hover { color: var(--ink); }
.mainnav a:hover .ic { color: var(--ink-2); }
.mainnav a.active {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm);
  border: 1px solid var(--glass-brd);
}
.mainnav a.active .ic { color: var(--coral); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.t-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd); box-shadow: var(--shadow-sm);
  position: relative; transition: transform 0.12s, color 0.16s;
}
.t-btn .ic { width: 18px; height: 18px; }
.t-btn:hover { color: var(--ink); transform: translateY(-1px); }
.t-btn.dot::after {
  content: ""; position: absolute; top: 9px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral); border: 2px solid var(--card);
}
.t-ava {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm); cursor: pointer;
}

/* ====================== 본문 레이아웃 ====================== */
.lwork {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 16px; align-items: start; padding-top: 12px;
}

/* -------- 좌측: 모듈 + 연결 소스 -------- */
.subnav {
  position: sticky; top: 92px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glass-hi);
  padding: 14px 12px 12px;
  display: flex; flex-direction: column;
}
.sn-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
  padding: 14px 10px 7px; display: flex; align-items: center;
}
.mod-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 12px; margin-bottom: 3px; white-space: nowrap;
  color: var(--ink-2); transition: background 0.13s, color 0.13s;
}
.mod-row .m-ic {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--card-2); color: var(--muted);
  transition: background 0.13s, color 0.13s;
}
.mod-row .m-ic .ic { width: 17px; height: 17px; }
.mod-row .m-txt { min-width: 0; flex: 1; line-height: 1.25; }
.mod-row .m-txt b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.mod-row .m-txt span { font-size: 11px; color: var(--muted); }
.mod-row:hover { background: var(--glass-2); }
.mod-row.on { background: var(--fill); }
.mod-row.on .m-txt b, .mod-row.on .m-txt span { color: var(--on-fill); }
.mod-row.on .m-txt span { opacity: 0.7; }
.mod-row.on .m-ic { background: rgba(255,255,255,0.14); color: var(--on-fill); }
.mod-row.on.t-coral .m-ic { background: var(--coral); color: #fff; }
.mod-row.on.t-blue .m-ic { background: var(--blue); color: #fff; }
.mod-row.on.t-violet .m-ic { background: var(--violet); color: #fff; }
.mod-row.on.t-amber .m-ic { background: var(--amber); color: #fff; }

.src-list { margin-top: 2px; display: flex; flex-direction: column; gap: 1px; }
.src-row {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 9px; white-space: nowrap;
  transition: background 0.13s;
}
.src-row:hover { background: var(--glass-2); }
.src-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.src-dot.off { background: var(--faint) !important; }
.src-info { min-width: 0; flex: 1; line-height: 1.2; }
.src-info b { font-size: 12.5px; font-weight: 600; color: var(--ink); display: block; }
.src-info span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.src-row .src-stat { font-size: 9.5px; font-weight: 700; color: var(--green); }
.src-row .src-stat.off { color: var(--faint); }
.src-add {
  display: flex; align-items: center; gap: 9px; width: 100%; white-space: nowrap;
  padding: 9px 10px; margin-top: 4px; border-radius: 10px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  border: 1px dashed var(--line-2); transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.src-add .ic { width: 15px; height: 15px; }
.src-add:hover { background: var(--glass-2); color: var(--ink); border-color: var(--muted); }

.sn-foot {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sn-foot .av-lg {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sn-foot .txt { min-width: 0; flex: 1; }
.sn-foot .txt b { font-size: 13px; font-weight: 600; display: block; }
.sn-foot .txt span { font-size: 11.5px; color: var(--muted); }

/* ====================== 본문 패널 ====================== */
.lmain { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* 아리 코칭 히어로 */
.coach-hero {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px 24px; border-radius: var(--radius);
  background:
    radial-gradient(90% 130% at 0% 0%, color-mix(in oklab, var(--coral) 18%, transparent), transparent 56%),
    var(--card);
  border: 1px solid color-mix(in oklab, var(--coral) 22%, var(--line-2));
  box-shadow: var(--shadow);
}
.coach-hero .ch-ava {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; background: var(--coral);
  box-shadow: 0 7px 18px -6px var(--coral);
}
.coach-hero .ch-ava .ic { width: 23px; height: 23px; }
.coach-hero .ch-main { flex: 1; min-width: 0; }
.coach-hero .ch-eyebrow { font-size: 12px; font-weight: 700; color: var(--coral); letter-spacing: 0.02em; }
.coach-hero h1 { font-family: var(--font-disp); font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin: 5px 0 0; }
.coach-hero p { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 10px 0 0; max-width: 70ch; }
.coach-hero p b { color: var(--ink); font-weight: 700; }

/* 모듈 헤더 */
.mod-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.mod-head .mh-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.mod-head .mh-ic .ic { width: 19px; height: 19px; }
.mod-head .mh-txt { min-width: 0; flex: 1; }
.mod-head h2 { font-family: var(--font-disp); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.mod-head .mh-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.mod-head .mh-act { display: flex; gap: 7px; flex-shrink: 0; }

/* 그리드 */
.lgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 1180px) {
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
}

/* 카드 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm);
  padding: 18px 19px;
}
.card.glassy {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-color: var(--glass-brd); box-shadow: var(--shadow), var(--glass-hi);
}
.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.card-head .c-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.card-head .c-ic .ic { width: 16px; height: 16px; }
.card-head .c-h { flex: 1; min-width: 0; line-height: 1.2; }
.card-head .c-h b { font-size: 14px; font-weight: 700; display: block; }
.card-head .c-h span { font-size: 11.5px; color: var(--muted); }
.card-head .c-act { font-size: 11.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 8px; white-space: nowrap; transition: background 0.13s, color 0.13s; }
.card-head .c-act .ic { width: 13px; height: 13px; }
.card-head .c-act:hover { background: var(--card-2); color: var(--ink); }

/* 토큰 색상 헬퍼 */
.t-blue { color: var(--blue); }
.t-coral { color: var(--coral); }
.t-green { color: var(--green); }
.t-violet { color: var(--violet); }
.t-amber { color: var(--amber); }
.t-muted { color: var(--muted); }
.bg-blue { background: color-mix(in oklab, var(--blue) 13%, transparent); color: var(--blue); }
.bg-coral { background: color-mix(in oklab, var(--coral) 14%, transparent); color: var(--coral); }
.bg-green { background: color-mix(in oklab, var(--green) 14%, transparent); color: var(--green); }
.bg-violet { background: color-mix(in oklab, var(--violet) 14%, transparent); color: var(--violet); }
.bg-amber { background: color-mix(in oklab, var(--amber) 16%, transparent); color: var(--amber); }
.bg-muted { background: var(--card-3); color: var(--muted); }

/* ---------- 건강: 액티비티 링 ---------- */
.rings3 { display: flex; gap: 14px; }
.ring-card { flex: 1; text-align: center; }
.ring {
  --p: 0; --c: var(--coral);
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; position: relative;
  background:
    radial-gradient(closest-side, var(--card) 73%, transparent 74%),
    conic-gradient(var(--c) calc(var(--p) * 1%), var(--card-3) 0);
}
.ring .r-in { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.ring .r-in .ic { width: 17px; height: 17px; color: var(--c); margin-bottom: 3px; }
.ring .r-in b { font-size: 16px; font-weight: 800; font-family: var(--font-disp); font-variant-numeric: tabular-nums; }
.ring-card .rc-label { font-size: 12.5px; font-weight: 600; }
.ring-card .rc-goal { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* 바이탈 */
.vitals { display: flex; flex-direction: column; gap: 1px; }
.vital-row { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-top: 1px solid var(--line); }
.vital-row:first-child { border-top: none; }
.vital-row .v-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.vital-row .v-dot .ic { width: 15px; height: 15px; }
.vital-row .v-main { flex: 1; min-width: 0; }
.vital-row .v-main b { font-size: 13px; font-weight: 600; }
.vital-row .v-main span { font-size: 11px; color: var(--muted); display: block; }
.vital-row .v-val { font-family: var(--font-disp); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.vital-row .v-val small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }

/* 수면 */
.sleep-top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.sleep-score {
  --p: 0; width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--card) 72%, transparent 73%), conic-gradient(var(--violet) calc(var(--p)*1%), var(--card-3) 0);
}
.sleep-score b { font-size: 19px; font-weight: 800; font-family: var(--font-disp); }
.sleep-score span { font-size: 9px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.sleep-meta { min-width: 0; }
.sleep-meta .sm-total { font-family: var(--font-disp); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sleep-meta .sm-label { font-size: 12px; color: var(--muted); }
.sleep-bar { display: flex; height: 11px; border-radius: 999px; overflow: hidden; margin-bottom: 9px; gap: 2px; }
.sleep-bar > span { display: block; height: 100%; border-radius: 3px; }
.sleep-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sleep-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.sleep-legend .lg i { width: 9px; height: 9px; border-radius: 3px; }
.sleep-week { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: 16px; }
.sleep-week .sw { flex: 1; background: var(--card-3); border-radius: 5px 5px 3px 3px; position: relative; transition: background 0.13s; }
.sleep-week .sw.peak { background: color-mix(in oklab, var(--violet) 55%, transparent); }
.sleep-week-labels { display: flex; gap: 6px; margin-top: 5px; }
.sleep-week-labels span { flex: 1; text-align: center; font-size: 9.5px; color: var(--faint); }
.sleep-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: color-mix(in oklab, var(--violet) 7%, var(--card-2)); border: 1px solid color-mix(in oklab, var(--violet) 18%, var(--line)); }

/* 습관 */
.habits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
@media (max-width: 1180px) { .habits { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .habits { grid-template-columns: 1fr; } }
.habit {
  padding: 14px 15px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line);
  transition: border-color 0.14s, background 0.14s, transform 0.12s;
}
.habit.done { background: color-mix(in oklab, var(--green) 9%, var(--card-2)); border-color: color-mix(in oklab, var(--green) 28%, var(--line)); }
.habit-top { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.habit-top .h-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.habit-top .h-ic .ic { width: 17px; height: 17px; }
.habit-top .h-tx { flex: 1; min-width: 0; line-height: 1.25; }
.habit-top .h-tx b { font-size: 13.5px; font-weight: 700; display: block; }
.habit-top .h-tx span { font-size: 11px; color: var(--muted); }
.habit-streak { font-size: 10.5px; font-weight: 700; color: var(--amber); display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
.habit-streak .ic { width: 12px; height: 12px; }
.habit-prog { display: flex; align-items: center; gap: 9px; }
.habit-prog .hp-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.habit-prog .hp-bar > i { display: block; height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(0.2,0.7,0.2,1); }
.habit-prog .hp-n { font-size: 11px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.habit-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.habit-at { font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.habit-at .ic { width: 12px; height: 12px; flex-shrink: 0; }
.habit-btn {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex-shrink: 0;
  font-size: 11.5px; font-weight: 700; padding: 6px 11px; border-radius: 8px;
  background: var(--fill); color: var(--on-fill); transition: filter 0.13s, transform 0.12s;
}
.habit-btn .ic { width: 12px; height: 12px; }
.habit-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.habit-btn.done { background: color-mix(in oklab, var(--green) 16%, transparent); color: var(--green); pointer-events: none; }

/* ---------- 금융 ---------- */
.budget-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.budget-top .bt-spent { font-family: var(--font-disp); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.budget-top .bt-of { font-size: 13px; color: var(--muted); }
.budget-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.budget-delta .ic { width: 13px; height: 13px; }
.budget-gauge { height: 12px; border-radius: 999px; background: var(--card-3); overflow: hidden; margin: 14px 0 8px; position: relative; }
.budget-gauge > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--blue)); transition: width 0.6s cubic-bezier(0.2,0.7,0.2,1); }
.budget-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* 카테고리 */
.cats { display: flex; flex-direction: column; gap: 1px; }
.cat-row { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-top: 1px solid var(--line); }
.cat-row:first-child { border-top: none; }
.cat-row .ca-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.cat-row .ca-ic .ic { width: 15px; height: 15px; }
.cat-row .ca-main { flex: 1; min-width: 0; }
.cat-row .ca-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.cat-row .ca-name .over-tag { font-size: 9.5px; font-weight: 700; color: var(--coral); background: color-mix(in oklab, var(--coral) 13%, transparent); padding: 1px 6px; border-radius: 999px; }
.cat-row .ca-bar { height: 6px; border-radius: 999px; background: var(--card-3); overflow: hidden; margin-top: 6px; }
.cat-row .ca-bar > i { display: block; height: 100%; border-radius: 999px; }
.cat-row .ca-amt { font-family: var(--font-disp); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; flex-shrink: 0; text-align: right; }
.cat-row .ca-amt small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }

/* 구독 */
.subs { display: flex; flex-direction: column; gap: 8px; }
.sub-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  transition: border-color 0.13s, transform 0.12s;
}
.sub-row.soon { border-color: color-mix(in oklab, var(--coral) 30%, var(--line)); background: color-mix(in oklab, var(--coral) 6%, var(--card-2)); }
.sub-row .su-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.sub-row .su-ic .ic { width: 17px; height: 17px; }
.sub-row .su-main { flex: 1; min-width: 0; line-height: 1.3; }
.sub-row .su-main b { font-size: 13.5px; font-weight: 700; }
.sub-row .su-main span { font-size: 11px; color: var(--muted); display: block; }
.sub-row .su-when { text-align: right; flex-shrink: 0; }
.sub-row .su-when .sw-date { font-size: 12px; font-weight: 600; color: var(--ink); }
.sub-row .su-when .sw-in { font-size: 10px; font-weight: 700; color: var(--coral); }
.sub-row .su-when .sw-in.far { color: var(--muted); }
.sub-row .su-amt { font-family: var(--font-disp); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 64px; text-align: right; }

/* 인사이트 */
.insights { display: flex; flex-direction: column; gap: 9px; }
.insight {
  display: flex; gap: 11px; padding: 13px 14px; border-radius: 13px;
  background: var(--card-2); border: 1px solid var(--line);
}
.insight.alert { background: color-mix(in oklab, var(--coral) 7%, var(--card-2)); border-color: color-mix(in oklab, var(--coral) 24%, var(--line)); }
.insight .in-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.insight .in-ic .ic { width: 16px; height: 16px; }
.insight.alert .in-ic { background: var(--coral); color: #fff; }
.insight.save .in-ic { background: color-mix(in oklab, var(--green) 14%, transparent); color: var(--green); }
.insight.info .in-ic { background: color-mix(in oklab, var(--blue) 14%, transparent); color: var(--blue); }
.insight .in-main { flex: 1; min-width: 0; }
.insight .in-main b { font-size: 13px; font-weight: 700; display: block; }
.insight .in-main p { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 4px 0 0; }
.insight .in-act { align-self: center; flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 7px 12px; border-radius: 9px; background: var(--fill); color: var(--on-fill); transition: filter 0.13s, transform 0.12s; }
.insight .in-act:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* ---------- 지식 (제2의 뇌) ---------- */
.kn-search {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 18px; border-radius: 16px;
  background: var(--card); border: 1.5px solid var(--line-2);
  transition: box-shadow 0.16s, border-color 0.16s;
}
.kn-search:focus-within { border-color: color-mix(in oklab, var(--violet) 45%, var(--line)); box-shadow: 0 0 0 4px color-mix(in oklab, var(--violet) 14%, transparent); }
.kn-search .ks-spark { width: 20px; height: 20px; color: var(--violet); flex-shrink: 0; }
.kn-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 15px; color: var(--ink); }
.kn-search input::placeholder { color: var(--faint); }
.kn-search .ks-go { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--violet); color: #fff; flex-shrink: 0; transition: filter 0.13s, transform 0.12s; }
.kn-search .ks-go:hover { transform: translateY(-1px); filter: brightness(1.07); }
.kn-search .ks-go .ic { width: 17px; height: 17px; }
.kn-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kn-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 13px; transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.kn-chip .ic { width: 13px; height: 13px; color: var(--violet); }
.kn-chip:hover { background: color-mix(in oklab, var(--violet) 9%, var(--card-2)); border-color: color-mix(in oklab, var(--violet) 30%, var(--line)); color: var(--ink); }

/* AI 답변 카드 */
.kn-answer {
  display: flex; gap: 13px; padding: 17px 18px; border-radius: 16px;
  background:
    radial-gradient(90% 120% at 0% 0%, color-mix(in oklab, var(--violet) 14%, transparent), transparent 55%),
    var(--card);
  border: 1px solid color-mix(in oklab, var(--violet) 26%, var(--line-2));
  box-shadow: var(--shadow-sm); animation: rise 0.35s cubic-bezier(0.2,0.7,0.2,1);
}
.kn-answer .ka-ava { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--violet); color: #fff; flex-shrink: 0; box-shadow: 0 5px 14px -5px var(--violet); }
.kn-answer .ka-ava .ic { width: 17px; height: 17px; }
.kn-answer .ka-main { flex: 1; min-width: 0; }
.kn-answer .ka-q { font-size: 12px; color: var(--violet); font-weight: 700; margin-bottom: 5px; }
.kn-answer .ka-body { font-size: 13.5px; color: var(--ink); line-height: 1.6; }
.kn-answer .ka-body b { font-weight: 700; }
.kn-answer .ka-src { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.kn-answer .ka-src .src-chip { font-size: 11px; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 5px; }
.kn-answer .ka-src .src-chip .ic { width: 11px; height: 11px; color: var(--muted); }

/* 컬렉션 */
.collections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.coll {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 13px;
  background: var(--card-2); border: 1px solid var(--line); text-align: left;
  transition: border-color 0.13s, transform 0.12s, background 0.13s;
}
.coll:hover { transform: translateY(-1px); background: var(--card-3); }
.coll .co-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.coll .co-ic .ic { width: 16px; height: 16px; }
.coll .co-tx { min-width: 0; flex: 1; line-height: 1.25; }
.coll .co-tx b { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll .co-tx span { font-size: 11px; color: var(--muted); }

/* 스크랩 카드 */
.scraps { display: flex; flex-direction: column; gap: 11px; }
.scrap {
  padding: 15px 17px; border-radius: 15px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: border-color 0.14s, transform 0.12s;
}
.scrap:hover { transform: translateY(-1px); border-color: var(--line-2); }
.scrap-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.scrap-top .sc-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.scrap-top .sc-ic .ic { width: 16px; height: 16px; }
.scrap-top .sc-h { flex: 1; min-width: 0; }
.scrap-top .sc-h b { font-size: 14.5px; font-weight: 700; line-height: 1.3; display: block; }
.scrap-top .sc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.scrap-top .sc-meta .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.scrap-type { font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.scrap-excerpt { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: 0 0 11px; }
.scrap-ai { display: flex; gap: 9px; padding: 11px 13px; border-radius: 12px; background: color-mix(in oklab, var(--violet) 7%, var(--card-2)); border: 1px solid color-mix(in oklab, var(--violet) 17%, var(--line)); margin-bottom: 11px; }
.scrap-ai .sa-ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--violet); color: #fff; flex-shrink: 0; }
.scrap-ai .sa-ic .ic { width: 12px; height: 12px; }
.scrap-ai p { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.scrap-ai p b { color: var(--violet); font-weight: 700; }
.scrap-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 4px; }
.tag::before { content: "#"; color: var(--faint); font-weight: 700; }
.tag.auto { color: var(--violet); background: color-mix(in oklab, var(--violet) 8%, transparent); border-color: color-mix(in oklab, var(--violet) 22%, var(--line)); }
.scrap-foot .sf-spacer { flex: 1; }
.scrap-foot .sf-act { font-size: 11.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; transition: background 0.13s, color 0.13s; }
.scrap-foot .sf-act .ic { width: 13px; height: 13px; }
.scrap-foot .sf-act:hover { background: var(--card-2); color: var(--ink); }

/* 빈 상태 (검색) */
.kn-empty { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 13px; }

/* 진입 애니메이션 */
.entered .lwork > * { animation: rise 0.42s cubic-bezier(0.2,0.7,0.2,1) both; }
.entered .lmain { animation-delay: 0.05s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 토스트 */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 13px;
  background: var(--fill); color: var(--on-fill);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  animation: toastin 0.3s cubic-bezier(0.2,0.7,0.2,1);
}
.toast .t-dot { width: 8px; height: 8px; border-radius: 50%; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 반응형 */
@media (max-width: 1080px) {
  .lwork { grid-template-columns: 1fr; }
  .subnav { position: static; flex-direction: column; }
}
@media (max-width: 760px) {
  .mpage { padding: 0 12px 20px; }
  .topbar { margin: 0 -12px; padding: 0 14px; gap: 14px; }
  .mainnav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
