:root {
  --bg: #FAF6EC;        /* 아이보리 */
  --paper: #FFFDF8;
  --ink: #2B2620;       /* 구운 껍질 같은 진한 갈색 */
  --muted: #7B7166;
  --line: #E6DDCB;
  --ss: #3F6B4F;        /* 쑥 */
  --ss-soft: #A9C1AF;
  --mall: #C79A3E;      /* 태운 버터 */
  --sms: #7D6A92;       /* 무화과 */
  --warn: #B0432C;
  --ok: #3F6B4F;
  --radius-s: 6px;
  --radius-l: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 "Pretendard", system-ui, sans-serif;
  font-feature-settings: "tnum";
}
h1, h2, h3 { font-family: "MaruBuri", "Pretendard", serif; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 21px; }
h3 { font-size: 15px; margin: 22px 0 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page { max-width: 1480px; margin: 0 auto; padding: 28px 36px 48px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ss); outline-offset: 2px; }

/* 머리 */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.top-right { display: flex; gap: 12px; align-items: center; }
.period { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.period button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.period button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.ghost { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.banner { background: #F6E3DC; color: var(--warn); padding: 10px 14px; border-radius: var(--radius-s); }

section { margin-top: 36px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h2 { white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; font-family: "Pretendard", sans-serif; font-weight: 400; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.note:empty { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.two > section { min-width: 0; }

/* 이번 달 */
.month { margin-top: 26px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 4px 24px 0; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .k { font-size: 14px; color: var(--muted); }
.stat .v { font-family: "MaruBuri", serif; font-size: 34px; font-weight: 700; line-height: 1.25; margin-top: 2px; white-space: nowrap; }
.stat .v small { font-size: 18px; font-weight: 400; margin-left: 2px; }
.stat .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.status .v { display: inline-flex; align-items: center; gap: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); display: inline-block; }
.status.warn .v { color: var(--warn); }
.status.warn .dot { background: var(--warn); }

.pace { margin-top: 22px; }
.pace .bar { position: relative; height: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: visible; }
.pace .fill { position: absolute; inset: 0 auto 0 0; background: var(--ss); border-radius: 999px; }
.pace .mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); }
.pace .lab { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; gap: 12px; flex-wrap: wrap; }

/* 차트 */
.chart { position: relative; height: 240px; }
.chart.tall { height: 380px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--ink); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.num { text-align: right; white-space: nowrap; }
.events .c-date { width: 104px; }
.events td:nth-child(3) { width: 22%; }
.events td:nth-child(4) { width: 22%; }
.events tr.future td { color: var(--muted); }
.kind { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; margin-right: 6px; }
.kind.톡톡 { color: var(--ss); } .kind.문자 { color: var(--sms); } .kind.쿠폰 { color: #9A7224; }
.kind.광고 { color: var(--ink); } .kind.인플루언서 { color: #8A5A44; }
.wait { color: var(--muted); }
.small { font-size: 12px; color: var(--muted); display: block; }
.ratio { display: flex; align-items: center; gap: 8px; }
.ratio .track { flex: 1; height: 8px; background: var(--line); border-radius: 999px; position: relative; min-width: 60px; }
.ratio .track b { position: absolute; inset: 0 auto 0 0; background: var(--ss); border-radius: 999px; }
.ratio .track b.low { background: var(--warn); }
.ratio span { width: 64px; text-align: right; white-space: nowrap; }
.ratio-h { width: 38%; }
.eff-low { color: var(--warn); font-weight: 600; }
.eff-ok { color: var(--ss); font-weight: 600; }

.ad-top { display: flex; gap: 32px; margin-bottom: 8px; flex-wrap: wrap; }
.ad-top div { font-size: 13px; color: var(--muted); }
.ad-top strong { display: block; font-family: "MaruBuri", serif; font-size: 24px; color: var(--ink); }

/* 인플루언서 */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel .row { display: grid; grid-template-columns: 76px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.funnel .row b { height: 18px; background: var(--ss-soft); border-radius: 4px; display: block; }
.funnel .row.done b { background: var(--ss); }
.funnel .row.out b { background: var(--line); }
.funnel .row span:last-child { text-align: right; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; }
.list li em { font-style: normal; color: var(--muted); white-space: nowrap; }

.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius-l); padding: 18px; color: var(--muted); font-size: 14px; }

/* 갱신 상태 */
.fresh { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 40px; flex-wrap: wrap; font-size: 14px; }
.fresh .item b { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.fresh .stale { color: var(--warn); font-weight: 600; }
.fresh .fails { flex-basis: 100%; color: var(--warn); font-size: 13px; }

/* 로그인 */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 340px; }
.login h1 { font-size: 26px; margin-bottom: 24px; }
.login label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.login input { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.login button { margin-top: 14px; width: 100%; padding: 11px; border: 0; border-radius: var(--radius-s); background: var(--ink); color: var(--paper); font-size: 15px; }
.err { color: var(--warn); font-size: 14px; margin: 8px 0 0; }

/* 휴대폰: 같은 내용을 세로로 */
@media (max-width: 860px) {
  .page { padding: 18px 16px 40px; }
  .top { flex-direction: column; align-items: flex-start; }
  .top-right { width: 100%; justify-content: space-between; }
  .period button { padding: 6px 10px; font-size: 13px; }
  h1 { font-size: 24px; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .stat { padding: 0 0 0 14px; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat .v { font-size: 25px; }
  .chart.tall { height: 300px; }
  .events thead { display: none; }
  .events tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .events td { border: 0; padding: 2px 0; width: auto !important; }
  .events td:nth-child(1) { grid-column: 1; color: var(--muted); font-size: 13px; }
  .events td:nth-child(5) { grid-column: 2; grid-row: 1; }
  .events td:nth-child(2), .events td:nth-child(3), .events td:nth-child(4) { grid-column: 1 / -1; }
  .ratio-h { width: auto; }
  .ratio .track { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
