:root {
  --bg: #f2f4f6;
  --card: #ffffff;
  --fill: #f2f4f6;      /* 입력칸·약한 버튼 바탕 */
  --hover: #f9fafb;
  --line: #e5e8eb;
  --t1: #191f28;
  --t2: #4e5968;
  --t3: #8b95a1;
  --blue: #3182f6;
  --blue-d: #1b64da;
  --blue-weak: #e8f3ff;
  --red: #f04452;
  --red-weak: #ffeeee;
  --green: #03b26c;

  /* 구간 단계: 파란색 한 계열로 진행 정도 표현 */
  --st-todo: #e5e8eb;   --st-todo-t: #4e5968;
  --st-data: #c9e2ff;   --st-data-t: #1b64da;
  --st-model: #90c2ff;  --st-model-t: #0f4aa3;
  --st-place: #64a8ff;  --st-place-t: #0b3b80;
  --st-done: #3182f6;   --st-done-t: #ffffff;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --r: 20px;
  --r-sm: 12px;
  --pad: clamp(1.25rem, 4vw, 1.5rem);
  --max: 64rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--t1);
  font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -.01em;
  word-break: keep-all; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── 상단 ───────────────────────────────── */

.shell { min-height: 100vh; }

.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.top__row {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: .5rem;
  padding: calc(.7rem + env(safe-area-inset-top)) var(--pad) .7rem;
}
.top__logo { white-space: nowrap; font-weight: 800; font-size: 1.125rem; letter-spacing: -.02em; margin-right: auto; }
.top__logo span { color: var(--blue); }
.top__link {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 36px; padding: 0 .8rem; border-radius: 10px;
  font-weight: 600; font-size: .875rem; color: var(--t2);
}
.top__link:hover { background: var(--fill); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--blue-weak); color: var(--blue-d); font-weight: 700; font-size: .875rem;
}
.badge {
  min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .6875rem; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}

/* 밑줄 탭 */
.tabs {
  max-width: var(--max); margin: 0 auto;
  display: flex; gap: .25rem; padding: 0 calc(var(--pad) - .6rem);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: .35rem;
  padding: .7rem .6rem .8rem; border: 0; background: none; cursor: pointer;
  font-weight: 600; font-size: 1rem; color: var(--t3); white-space: nowrap;
}
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--t1); font-weight: 700; }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after {
  content: ""; position: absolute; left: .6rem; right: .6rem; bottom: 0; height: 2px; background: var(--t1); border-radius: 2px;
}

/* ── 본문 ───────────────────────────────── */

.view { max-width: var(--max); margin: 0 auto; padding: 1.5rem var(--pad) calc(3rem + env(safe-area-inset-bottom)); }
.view > * + * { margin-top: .75rem; }

.hello { font-weight: 700; font-size: 1.625rem; line-height: 1.35; letter-spacing: -.03em; padding: .25rem .25rem 1rem; }
.hello small { display: block; font-size: .9375rem; font-weight: 500; color: var(--t3); letter-spacing: -.01em; margin-top: .2rem; }

.panel { background: var(--card); border-radius: var(--r); padding: 1.5rem; }
.panel__title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: baseline; gap: .4rem; }
.panel__title em { font-style: normal; color: var(--blue); font-weight: 700; }
.panel__title small { font-size: .875rem; font-weight: 500; color: var(--t3); }
.empty { color: var(--t3); font-size: .9375rem; padding: .75rem 0; }

/* ── 입력·버튼 ───────────────────────────── */

.field { display: grid; gap: .4rem; }
.field > span { font-size: .875rem; font-weight: 600; color: var(--t2); }
.input, .select {
  width: 100%; min-height: 50px; padding: .7rem 1rem;
  background: var(--fill); border: 2px solid transparent; border-radius: var(--r-sm);
  font-size: 16px;
}
textarea.input { resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--t3); }
.input:focus, .select:focus { outline: none; border-color: var(--blue); background-color: var(--card); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 2.25rem; cursor: pointer; font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%238b95a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px;
}
.suffix { display: flex; align-items: center; background: var(--fill); border-radius: var(--r-sm); border: 2px solid transparent; }
.suffix:focus-within { border-color: var(--blue); background: var(--card); }
.suffix .input { border: 0; background: transparent; min-height: 46px; }
.suffix b { padding-right: 1rem; color: var(--t3); font-weight: 500; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 50px; padding: 0 1.25rem; border: 0; border-radius: var(--r-sm);
  background: var(--fill); color: var(--t2); font-weight: 600; font-size: 1rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #e5e8eb; }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-d); }
.btn--weak { background: var(--blue-weak); color: var(--blue-d); }
.btn--weak:hover { background: #d6e9ff; }
.btn--small { min-height: 36px; padding: 0 .85rem; font-size: .875rem; border-radius: 10px; }
.btn--danger { background: var(--red-weak); color: var(--red); }
.btn--danger:hover { background: #ffdede; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }

.msg { font-size: .875rem; min-height: 1.3em; }
.msg.is-error { color: var(--red); }
.msg.is-ok { color: var(--green); }

/* 리스트 행 + 꺾쇠 */
.rows { display: grid; margin: 0 -.5rem; }
.row { display: flex; align-items: center; gap: .75rem; padding: .85rem .5rem; border-radius: var(--r-sm); cursor: pointer; }
.row:hover { background: var(--hover); }
.row__label { flex: 1; font-weight: 600; color: var(--t2); }
.row__value { font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.chev { width: 16px; height: 16px; flex: none; fill: none; stroke: #b0b8c1; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── 로그인 ─────────────────────────────── */

.auth { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: var(--pad); background: var(--card); }
.auth__box { width: 100%; max-width: 400px; display: grid; gap: 2rem; }
.auth__logo { font-weight: 800; font-size: 1.75rem; letter-spacing: -.03em; line-height: 1.2; }
.auth__logo small { display: block; font-weight: 600; font-size: 1.0625rem; color: var(--t3); margin-top: .35rem; letter-spacing: -.01em; }
.auth__form { display: grid; gap: 1rem; }
.auth__form .btn { margin-top: .5rem; }
.auth__note { color: var(--t3); font-size: .8125rem; }

/* ── 개요 ───────────────────────────────── */

.overview { display: grid; gap: .75rem; }
@media (min-width: 52rem) { .overview { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.overview__side { display: grid; gap: .75rem; }

.big { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.big__num { font-weight: 700; font-size: 2.75rem; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.big__num small { font-size: .55em; margin-left: .05em; }
.big__label { color: var(--t3); font-size: .875rem; }


/* 23개 구간: 서→동 한 줄 */
.strip { display: grid; grid-template-columns: repeat(23, 1fr); gap: 3px; margin-top: 1.5rem; }
.strip i { height: 28px; border-radius: 4px; background: var(--st-todo); }
.strip__ends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--t3); margin-top: .4rem; }

.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0 1.25rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.legend span { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .875rem; color: var(--t2); }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.legend b { margin-left: auto; font-weight: 700; color: var(--t1); font-variant-numeric: tabular-nums; }

.mylist li { padding: .8rem 0; border-top: 1px solid var(--line); }
.mylist li:first-child { border-top: 0; padding-top: 0; }
.mylist p { font-weight: 600; }
.mylist small { display: block; color: var(--t3); font-size: .8125rem; margin-top: .1rem; }

/* ── 구간 ───────────────────────────────── */

.sec { display: grid; grid-template-columns: 2rem 1fr; gap: .5rem .75rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); }
.sec:first-child { border-top: 0; padding-top: 0; }
.sec__no { font-weight: 600; color: var(--t3); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.sec__name { font-weight: 700; font-size: 1rem; }
.sec__controls { grid-column: 2; display: grid; grid-template-columns: 1.25fr 1fr; gap: .5rem; }
.sec .select { padding-left: .8rem; }
.sec .select { min-height: 40px; font-size: 15px; padding-top: .45rem; padding-bottom: .45rem; border-radius: 10px; }
.stage-select { background-color: var(--c, var(--st-todo)); color: var(--ct, var(--t2)); }
@media (min-width: 44rem) {
  .sec { grid-template-columns: 2.5rem 1fr 10.5rem 10rem; }
  .sec__controls { grid-column: auto; display: contents; }
}

/* ── 할 일 ─────────────────────────────── */

.add { display: grid; gap: .5rem; }
@media (min-width: 48rem) { .add { grid-template-columns: 1fr 10rem 9rem auto; } }

.seg { display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: #e5e8eb; }
.seg button { flex: 1; min-height: 38px; border: 0; background: none; border-radius: 10px; font-weight: 600; color: var(--t2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--t1); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
@media (min-width: 60rem) { .seg { display: none; } }

.board { display: grid; gap: .75rem; }
.col { background: var(--card); border-radius: var(--r); padding: 1.25rem; }
.col[data-active="false"] { display: none; }
@media (min-width: 60rem) {
  .board { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .col[data-active="false"] { display: block; }
}
.col__head { display: flex; align-items: baseline; gap: .4rem; font-size: 1.0625rem; font-weight: 700; margin-bottom: .75rem; }
.col__head em { font-style: normal; color: var(--blue); }
.cards { display: grid; gap: .5rem; }
.card { background: var(--hover); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.card__title { font-weight: 600; line-height: 1.45; }
.card__meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin-top: .35rem; font-size: .8125rem; color: var(--t3); }
.card__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.card__actions .btn--danger { margin-left: auto; }

/* ── 팀 ─────────────────────────────────── */

.people li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; padding-top: 0; }
.people__who { flex: 1 1 12rem; display: flex; align-items: center; gap: .75rem; font-weight: 600; }
.people__who .avatar { width: 40px; height: 40px; font-size: 1rem; }
.people__who small { display: block; color: var(--t3); font-size: .8125rem; font-weight: 400; }
.tag { font-size: .6875rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; background: var(--blue-weak); color: var(--blue-d); margin-left: .35rem; vertical-align: 1px; }
.people__actions { display: flex; gap: .4rem; }
.form-grid { display: grid; gap: .9rem; }
@media (min-width: 48rem) { .form-grid--3 { grid-template-columns: 1fr 1.4fr 1fr; } .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-foot { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ── 웹메일 ─────────────────────────────── */

.mail-bar { max-width: var(--max); margin: 0 auto; padding: 1.25rem var(--pad) 0; }
.mail-bar #compose-open { width: 100%; }
@media (min-width: 40rem) { .mail-bar { display: flex; justify-content: flex-end; } .mail-bar #compose-open { width: auto; } }

.mail { max-width: var(--max); margin: 0 auto; display: grid; gap: .75rem; padding: .75rem var(--pad) calc(2rem + env(safe-area-inset-bottom)); }
@media (min-width: 60rem) {
  .mail { grid-template-columns: minmax(18rem, 24rem) 1fr; align-items: start; }
  .mail__back { display: none !important; }
}
@media (max-width: 59.99rem) {
  body.is-reading .mail__list, body.is-reading .mail-bar { display: none; }
  body:not(.is-reading) .mail__read { display: none; }
}

.mail__list, .mail__read { background: var(--card); border-radius: var(--r); padding: .5rem; }
.mail__read { padding: 1.5rem; min-height: 16rem; }
.item { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .9rem 1rem; border-radius: 14px; }
.item:hover { background: var(--hover); }
.item.is-open { background: var(--blue-weak); }
.item__who { font-size: .875rem; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__time { font-size: .8125rem; color: var(--t3); font-variant-numeric: tabular-nums; }
.item__subject { grid-column: 1 / -1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__snippet { grid-column: 1 / -1; font-size: .8125rem; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.is-unread .item__who { color: var(--t1); font-weight: 700; }
.item.is-unread .item__subject { font-weight: 700; }
.item.is-unread .item__who::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-right: .4rem; vertical-align: 2px; }
.mail__empty, .mail__placeholder { padding: 1rem; }

.mail__back { margin-bottom: 1rem; }
.mail__subject { font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.35; }
.mail__meta { display: grid; gap: .3rem; margin-top: 1rem; padding: 1rem; border-radius: 14px; background: var(--hover); font-size: .875rem; }
.mail__meta div { display: grid; grid-template-columns: 4.5rem 1fr; gap: .5rem; }
.mail__meta dt { color: var(--t3); }
.mail__meta dd span { color: var(--t3); }
.mail__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.5rem; }
.mail__body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 1rem; }

.compose { width: min(36rem, 100vw); max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--t1); }
.compose::backdrop { background: rgba(0, 0, 0, .4); }
.compose form { display: grid; gap: 1.1rem; padding: 1.5rem; }
@media (max-width: 40rem) {
  .compose { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; }
  .compose form { padding: calc(1rem + env(safe-area-inset-top)) 1.25rem calc(1rem + env(safe-area-inset-bottom)); }
  .compose .form-foot .btn--primary { width: 100%; }
}
.compose__head { display: flex; align-items: center; justify-content: space-between; }
.compose__head h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em; }
.compose__to legend { font-size: .875rem; font-weight: 600; color: var(--t2); margin-bottom: .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-grid; text-align: left; padding: .55rem .9rem; border-radius: 12px; border: 0; background: var(--fill); font-weight: 600; font-size: .9375rem; cursor: pointer; }
.chip small { font-weight: 400; font-size: .75rem; color: var(--t3); }
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; }
.chip[aria-pressed="true"] small { color: rgba(255,255,255,.75); }

/* ── 알림 ─────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem); opacity: 0; max-width: calc(100vw - 2rem);
  background: rgba(25, 31, 40, .92); color: #fff; border-radius: 14px;
  padding: .85rem 1.25rem; font-size: .9375rem; font-weight: 600;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 30;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: rgba(240, 68, 82, .95); }

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ── 캘린더 ─────────────────────────── */

:root { --k-meeting: #3182f6; --k-shoot: #03b26c; --k-deadline: #f04452; --k-etc: #8b95a1; }
.avatar--btn { border: 0; cursor: pointer; }
.avatar--btn:hover { background: #d6e9ff; }

.cal { max-width: var(--max); margin: 0 auto; padding: 1rem var(--pad) calc(3rem + env(safe-area-inset-bottom)); display: grid; gap: .75rem; }
@media (min-width: 60rem) {
  .cal { grid-template-columns: 1fr 22rem; align-items: start; }
  .cal__month { grid-row: span 2; }
}
.cal .panel { padding: 1.25rem; }
@media (max-width: 30rem) { .cal .cal__month { padding: 1rem .6rem; } }

.cal__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .4rem .75rem; }
.cal__title { font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cal__nav { display: flex; align-items: center; gap: .25rem; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--fill); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--t2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cal__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__week span { text-align: center; font-size: .8125rem; font-weight: 600; color: var(--t3); padding: .25rem 0 .5rem; }
.cal__week span:first-child { color: var(--red); }
.cal__week span:last-child { color: var(--blue); }

/* 한 주 = 한 줄. 날짜 칸이 뒤에 깔리고, 일정 선이 그 위에 칸을 가로질러 놓임 */
.week {
  --lane: 15px;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 40px repeat(3, var(--lane)) 12px;
  row-gap: 3px; padding-bottom: 4px;
}
@media (min-width: 48rem) { .week { --lane: 20px; grid-template-rows: 40px repeat(3, var(--lane)) 16px; padding-bottom: 6px; } }

.day {
  grid-row: 1 / -1; display: flex; flex-direction: column; align-items: center;
  padding: .3rem 0 0; border: 0; border-radius: 12px; background: none; cursor: pointer; min-width: 0;
}
.day:hover { background: var(--hover); }
.day__num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.day.is-sun .day__num { color: var(--red); }
.day.is-sat .day__num { color: var(--blue); }
.day.is-out .day__num { opacity: .35; }
.day.is-today .day__num { background: var(--fill); }
.day.is-sel .day__num { background: var(--t1); color: #fff; }

.bar {
  position: relative; z-index: 1; pointer-events: none; min-width: 0;
  height: var(--lane); line-height: var(--lane); padding: 0 3px;
  background: var(--c); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: -.03em;
  overflow: hidden; white-space: nowrap; text-overflow: clip;
}
.bar.is-start { margin-left: 2px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.bar.is-end { margin-right: 2px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
/* 하루짜리는 연한 바탕, 여러 날 일정은 진한 선으로 이어짐 */
.bar:not(.is-multi) { background: color-mix(in srgb, var(--c) 16%, white); color: color-mix(in srgb, var(--c) 80%, black); }
.more { grid-row: -2; z-index: 1; pointer-events: none; text-align: center; font-size: .625rem; font-weight: 700; color: var(--t3); line-height: 12px; }

@media (min-width: 48rem) {
  .bar { font-size: .75rem; padding: 0 .4rem; text-overflow: ellipsis; letter-spacing: -.01em; }
  .bar.is-start { margin-left: 4px; }
  .bar.is-end { margin-right: 4px; }
  .more { font-size: .75rem; line-height: 16px; }
}

.kinds { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 1rem .4rem 0; margin-top: .5rem; border-top: 1px solid var(--line); }
.kinds span { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--t2); }
.kinds span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

.day__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.day__title { font-size: 1.125rem; font-weight: 700; }
.events { display: grid; gap: .25rem; }
.events .empty { padding: .5rem 0; }
.next__when { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; color: var(--blue); padding: 0 .5rem; margin-top: -.25rem; }
.next__when ~ .next__when { display: none; }
.ev {
  width: 100%; display: flex; gap: .75rem; padding: .7rem .5rem; border: 0; border-radius: 12px;
  background: none; text-align: left; cursor: pointer;
}
.ev:hover { background: var(--hover); }
.ev__bar { width: 4px; border-radius: 4px; background: var(--c); flex: none; }
.ev__body { display: grid; gap: .1rem; min-width: 0; }
.ev__time { font-size: .8125rem; color: var(--t3); font-variant-numeric: tabular-nums; }
.ev__title { font-weight: 700; overflow-wrap: anywhere; }
.ev__meta { display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .8125rem; color: var(--t3); }
.ev__meta b { color: var(--c); font-weight: 700; }

.panel__title small { font-size: .875rem; font-weight: 500; color: var(--t3); }

/* ── 재무 ─────────────────────────────── */

.fin { max-width: var(--max); margin: 0 auto; padding: 1rem var(--pad) calc(3rem + env(safe-area-inset-bottom)); display: grid; gap: .75rem; }
@media (min-width: 60rem) {
  .fin { grid-template-columns: 1fr 22rem; align-items: start; }
  .fin__summary { grid-column: 1 / -1; }
}
.fin .panel { padding: 1.25rem; }

.sums { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem .75rem; padding: .25rem .4rem 0; }
.sums dt { font-size: .875rem; font-weight: 600; color: var(--t3); }
.sums dd { font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em; margin-top: .15rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sums .is-in { color: var(--blue); }
.sums .is-minus { color: var(--red); }
.sums__net { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid var(--line); }
.sums__net dd { font-size: 1.75rem; }
@media (min-width: 48rem) {
  .sums { grid-template-columns: repeat(3, 1fr); }
  .sums__net { grid-column: auto; padding-top: 0; border-top: 0; padding-left: 1.25rem; border-left: 1px solid var(--line); }
}
.fin__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1.25rem; }
@media (min-width: 48rem) { .fin__actions { display: flex; justify-content: flex-end; } }

.money { display: grid; }
.money .empty { padding: .5rem 0; }
.mrow {
  width: 100%; display: flex; align-items: center; gap: 1rem; padding: .8rem .5rem; border: 0; border-radius: 12px;
  background: none; text-align: left; cursor: pointer;
}
.mrow:hover { background: var(--hover); }
.mrow__main { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.mrow__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__sub { font-size: .8125rem; color: var(--t3); }
.mrow__amt { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.mrow__amt.is-in { color: var(--blue); }
.mrow__amt small { font-size: .8125rem; font-weight: 500; color: var(--t3); margin-left: .1rem; }
.mrow.is-off { opacity: .45; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 일정 시트 */
#event-form, #fin-form { display: contents; }
.sheet .field > legend, .sheet fieldset.field legend { font-size: .875rem; font-weight: 600; color: var(--t2); margin-bottom: .4rem; padding: 0; }
.sheet .seg { display: flex; }
.switch { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--t2); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: #d1d6db; position: relative; margin: 0; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(18px); }
.hint { font-size: .8125rem; color: var(--t3); }
.sheet__foot {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom)); background: var(--bg);
}
.sheet__foot .msg { flex: 1; }
.sheet__foot .btn--primary { min-width: 6rem; }
.sheet .form-grid--2 { grid-template-columns: 1fr 1fr; }
.sheet input[type="date"], .sheet input[type="time"] { min-width: 0; -webkit-appearance: none; appearance: none; }

/* 계정과 팀 시트 */
.sheet { width: min(32rem, 100vw); max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 24px; background: var(--bg); color: var(--t1); }
.sheet::backdrop { background: rgba(0, 0, 0, .4); }
@media (max-width: 40rem) {
  .sheet { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; }
}
.sheet__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: calc(1rem + env(safe-area-inset-top)) 1.25rem 1rem; background: var(--bg); }
.sheet__head h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em; }
.sheet__sec { margin: 0 1rem .75rem; background: var(--card); border-radius: var(--r); padding: 1.25rem; }
.sheet__sec:last-child { margin-bottom: calc(1rem + env(safe-area-inset-bottom)); }
.sheet__sec h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 1rem; }
.sheet__sec--me { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.me { display: flex; align-items: center; gap: .75rem; }
.me .avatar { width: 44px; height: 44px; font-size: 1.0625rem; }
.me b { display: block; font-size: 1.0625rem; }
.me small { color: var(--t3); }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }
