: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;

  --glass: rgba(255, 255, 255, .92);
  --fill-2: #e5e8eb;
  --seg-on: #ffffff;
  --blue-weak-2: #d6e9ff;
  --red-weak-2: #ffdede;
  --switch-off: #d1d6db;
  --toast: rgba(25, 31, 40, .92);
  color-scheme: light;

  --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;
}

/* 다크 모드: 기기 설정을 따르되, 직접 고르면 그 값을 씀 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #17171c; --card: #212128; --fill: #2c2c35; --fill-2: #34343e; --hover: #26262e; --line: #33333d;
  --t1: #ececee; --t2: #b4b4bd; --t3: #85858f;
  --blue: #4c93fa; --blue-d: #7ab0ff; --blue-weak: #1d2a40; --blue-weak-2: #243555;
  --red: #f4606c; --red-weak: #3a2026; --red-weak-2: #4a262d; --green: #2cc985;
  --st-todo: #3a3a45; --st-todo-t: #b4b4bd;
  --st-data: #23395c; --st-data-t: #9cc4ff;
  --st-model: #2c5490; --st-model-t: #d6e6ff;
  --st-place: #3b74c9; --st-place-t: #ffffff;
  --st-done: #4c93fa; --st-done-t: #ffffff;
  --glass: rgba(33, 33, 40, .9); --seg-on: #45454f; --switch-off: #4a4a55; --toast: rgba(60, 60, 70, .96);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17171c; --card: #212128; --fill: #2c2c35; --fill-2: #34343e; --hover: #26262e; --line: #33333d;
  --t1: #ececee; --t2: #b4b4bd; --t3: #85858f;
  --blue: #4c93fa; --blue-d: #7ab0ff; --blue-weak: #1d2a40; --blue-weak-2: #243555;
  --red: #f4606c; --red-weak: #3a2026; --red-weak-2: #4a262d; --green: #2cc985;
  --st-todo: #3a3a45; --st-todo-t: #b4b4bd;
  --st-data: #23395c; --st-data-t: #9cc4ff;
  --st-model: #2c5490; --st-model-t: #d6e6ff;
  --st-place: #3b74c9; --st-place-t: #ffffff;
  --st-done: #4c93fa; --st-done-t: #ffffff;
  --glass: rgba(33, 33, 40, .9); --seg-on: #45454f; --switch-off: #4a4a55; --toast: rgba(60, 60, 70, .96);
  color-scheme: dark;
}

*, *::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; }

/* 두 번 탭해도 확대하지 않음(두 손가락 확대는 그대로) */
html, body, button, a, input, select, textarea, label, [role="button"] { touch-action: manipulation; }

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

.shell { min-height: 100vh; }

/* 헤더는 바탕과 같은 색으로 채움, 구분선 없음 */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.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: var(--fill-2); }
.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: var(--blue-weak-2); }
.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: var(--red-weak-2); }
.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: var(--fill-2); }
.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(--seg-on); 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.css ── */
.ext-tag { display: inline-block; margin-right: .35rem; padding: .05rem .4rem; border-radius: 6px; font-size: .6875rem; font-weight: 700; vertical-align: .1em; color: var(--t2); background: var(--hover); }
.clip { width: .95em; height: .95em; margin-left: .3rem; vertical-align: -.12em; color: var(--t3); }
.files { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--hover); }
.files__title { font-size: .875rem; font-weight: 700; margin-bottom: .6rem; }
.files__title .clip { margin: 0 .3rem 0 0; }
.files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.file { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--hover); color: inherit; text-decoration: none; font-size: .9375rem; }
.file:hover { filter: brightness(.97); }
.file__name { overflow-wrap: anywhere; }
.file__size { flex: none; color: var(--t3); font-size: .8125rem; }

.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: var(--toast); 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: var(--blue-weak-2); }

.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; grid-template-rows: auto 1fr; 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; --num-h: 40px;
  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: var(--card); }

.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) 18%, var(--card)); color: color-mix(in srgb, var(--c) 75%, var(--t1)); }
.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, .todo__head .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: var(--switch-off); 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; }

/* ── 작은 시트(메뉴·확인·짧은 입력): 넓은 화면은 가운데 카드, 휴대폰은 아래에서 올라오는 시트 ──
   모든 화면이 같은 모양: 손잡이 · 제목+닫기 · 흰 카드 안 아이콘 줄(dv-actions / dv-action) */
.sheet.sheet--small { width: min(26rem, 100vw); height: fit-content; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet--small:focus, .sheet--small:focus-visible { outline: none; }
.sheet--small .sheet__head { position: static; padding: 1.15rem 1.25rem .8rem; background: none; }
.sheet--small .sheet__head h2 { font-size: 1.25rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: .75rem; }
.sheet--small .sheet__foot { position: static; background: none; padding-top: .25rem; }
.sheet--small form .sheet__sec { display: grid; gap: 1rem; }
@media (max-width: 40rem) {
  .sheet.sheet--small { width: 100vw; height: fit-content; max-width: none; max-height: 88dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet--small::before { content: ""; display: block; width: 36px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line); }
  .sheet--small .sheet__head { padding-top: .6rem; }
  .sheet--small .sheet__sec:last-child, .sheet--small .dv-actions:last-child { margin-bottom: 1rem; }
  .sheet--small .sheet__foot { padding-bottom: .9rem; }
}
.dv-actions { display: grid; gap: 2px; margin: .5rem 1rem 1rem; padding: .4rem; background: var(--card); border-radius: var(--r); }
.sheet__sec.dv-actions { margin: 0 1rem 1rem; padding: .4rem; }
.sheet__head + .dv-actions { margin-top: 0; }
.dv-actions__info { display: flex; align-items: center; gap: .75rem; padding: .6rem .85rem .8rem; margin-bottom: .25rem; border-bottom: 1px solid var(--hover); font-size: .875rem; color: var(--t2); min-width: 0; }
.dv-actions__info b { font-size: 1rem; color: var(--t1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-actions__info img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.dv-actions__info .dv-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.dv-actions__info span { color: var(--t3); font-size: .8125rem; }
.dv-action { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 52px; padding: 0 .85rem; border: 0; border-radius: 14px; background: none;
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--t1); text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dv-action:hover, .dv-action:active { background: var(--fill); }
.dv-action:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.dv-action > svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--t2); }
.dv-action.is-danger, .dv-action.is-danger > svg { color: var(--red); }
.dv-action[disabled] { opacity: .4; cursor: default; background: none; }
.dv-actions hr { border: 0; height: 1px; background: var(--hover); margin: .25rem .85rem; }

/* 계정과 팀 시트 */
.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; } }

/* ── 햄버거 메뉴 ─────────────────────────── */

.menu-btn { position: relative; margin-left: -.5rem; flex: none; }
.menu-btn svg { stroke-width: 1.8; }
.dot-badge { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); }
.top__row .top__logo { margin-right: 0; }
.top__where { margin-right: auto; font-weight: 700; color: var(--t3); font-size: 1rem; white-space: nowrap; }
.top__where { transition: opacity .2s, transform .2s; }
.top:not(.has-where) .top__where { opacity: 0; transform: translateY(4px); pointer-events: none; }
.top__where:not(:empty)::before { content: "/"; margin: 0 .45rem 0 .1rem; color: var(--line); }

.drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0; width: min(18rem, 82vw); max-width: none; height: 100dvh; max-height: none;
  padding: 0; border: 0; background: var(--card); color: var(--t1);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .22s cubic-bezier(.2,.8,.2,1), display .22s allow-discrete, overlay .22s allow-discrete;
}
.drawer:not([open]) { display: none; }
.drawer[open] { transform: none; }
@starting-style { .drawer[open] { transform: translateX(-100%); } }
.drawer::backdrop { background: rgba(0, 0, 0, .35); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: calc(1rem + env(safe-area-inset-top)) 1rem 1rem 1.25rem; }
.drawer__nav { display: grid; align-content: start; gap: 1px; padding: .25rem .75rem; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.drawer__ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.drawer__ic svg { width: 30px; height: 30px; }
.drawer__item .badge { margin-left: auto; }
.drawer__foot { flex: none; padding: .75rem .75rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.drawer__item {
  display: flex; align-items: center; justify-content: flex-start; gap: .75rem; width: 100%;
  min-height: 46px; padding: 0 .65rem; border: 0; border-radius: 12px; background: none;
  font-size: 1.0625rem; font-weight: 600; color: var(--t2); text-align: left; cursor: pointer;
}
.drawer__item:hover { background: var(--hover); color: var(--t1); }
.drawer__item[aria-current="page"] { background: var(--blue-weak); color: var(--blue-d); font-weight: 700; }

/* ── 홈: 기능 카드 ─────────────────────── */

.home { max-width: var(--max); margin: 0 auto; padding: 1.25rem var(--pad) calc(3rem + env(safe-area-inset-bottom)); }
/* 위젯 그리드: 휴대폰 2칸, PC 4칸. 크기는 data-size(가로x세로) */
/* 아이폰 홈처럼: 1×1은 아이콘+이름, 키우면 카드 위젯. 휴대폰 4칸, PC 8칸 */
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 5.75rem; grid-auto-flow: dense; gap: .75rem; }
@media (min-width: 48rem) { .apps { grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: 6.5rem; } }
.app[data-size="2x1"] { grid-column: span 2; }
.app[data-size="1x2"] { grid-row: span 2; }
.app[data-size="2x2"] { grid-column: span 2; grid-row: span 2; }
.app {
  position: relative; min-width: 0; min-height: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: center; align-content: start; gap: .5rem .55rem;
  padding: .8rem .85rem; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; border: 0; border-radius: var(--r); background: var(--card);
  text-align: left; cursor: pointer; transition: transform .15s;
}
.app:hover { background: var(--hover); }
.app:active { transform: scale(.98); }
.app__icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 800; font-size: 1.375rem;
}
.app__icon--cal { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); place-items: stretch; grid-template-rows: auto 1fr; overflow: hidden; color: var(--t1); }
.app__icon--cal b { font-size: .625rem; font-weight: 700; color: var(--red); text-align: center; padding-top: 4px; line-height: 1; }
.app__icon--cal strong { font-size: 1.375rem; font-weight: 700; text-align: center; line-height: 1.35; letter-spacing: -.03em; }
.app__icon--fin { background: #03b26c; }
.app__icon--mail { background: var(--blue); }
.app__icon--mail svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.app__icon--team { background: #8b5cf6; font-size: 1.125rem; }
.app__name { font-size: 1.0625rem; font-weight: 700; }
.app__peek { font-size: .8125rem; color: var(--t3); line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app__peek b { display: block; color: var(--t2); font-weight: 700; }
.app__peek span { display: block; font-size: 1.125rem; font-weight: 700; color: var(--t1); letter-spacing: -.02em; }
.app__peek .is-minus { color: var(--red); }

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

/* ── 메모·링크·공용 계정·활동 기록 ───────── */

.page { max-width: 48rem; margin: 0 auto; padding: 1rem var(--pad) calc(3rem + env(safe-area-inset-bottom)); display: grid; gap: .75rem; align-content: start; }
.page__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .25rem 0; }
.page__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; }
.page__hint { padding: 0 .25rem; }
.page .empty { padding: 1.25rem; }
.warn { color: var(--red); font-weight: 600; font-size: .9375rem; line-height: 1.6; }

.notice {
  display: flex; align-items: baseline; gap: .6rem; margin-bottom: .75rem; padding: 1rem 1.1rem;
  border-radius: var(--r); background: var(--blue-weak); color: var(--t1);
}
.notice b { flex: none; color: var(--blue-d); font-weight: 700; }
.notice span { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notice em { flex: none; font-style: normal; font-size: .8125rem; color: var(--t3); }

.memo-new { display: grid; gap: .75rem; }
.memo-new textarea { resize: vertical; }
.memo-new__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.memos { display: grid; gap: .6rem; }
.memo { background: var(--card); border-radius: var(--r); padding: 1.1rem 1.25rem; }
.memo.is-pinned { box-shadow: inset 0 0 0 2px var(--blue); }
.memo__pin { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--blue-d); background: var(--blue-weak); padding: .1rem .5rem; border-radius: 6px; margin-bottom: .5rem; }
.memo__body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.memo__foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-top: .85rem; }
.memo__who { font-size: .8125rem; color: var(--t3); }
.memo__acts { display: flex; gap: .1rem; flex-wrap: wrap; }
/* 메모마다 버튼 세 개가 무겁지 않게: 바탕 없는 작은 글자 버튼 */
.memo__acts .btn { background: none; min-height: 32px; padding: 0 .55rem; font-size: .8125rem; color: var(--t3); }
.memo__acts .btn:hover { background: var(--fill); color: var(--t1); }
.memo__acts .btn--danger { color: var(--red); }

.links { display: grid; }
.links li { display: flex; align-items: center; gap: .5rem; }
.link { flex: 1; min-width: 0; display: grid; gap: .1rem; padding: .75rem .5rem; border-radius: 12px; }
.link:hover { background: var(--hover); }
.link__title { font-weight: 600; color: var(--blue-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link__sub { font-size: .8125rem; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-group .panel__title { margin-bottom: .5rem; }

.accts { display: grid; gap: .6rem; }
.acct__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.acct__name { font-size: 1.125rem; font-weight: 700; }
.acct__rows { display: grid; gap: .5rem; }
.acct__rows div { display: grid; grid-template-columns: 4.5rem 1fr; align-items: baseline; gap: .5rem; }
.acct__rows dt { font-size: .875rem; color: var(--t3); }
.acct__rows dd { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.mono { flex: 1 1 8rem; min-width: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9375rem; overflow-wrap: anywhere; }
.acct__url { color: var(--blue-d); overflow-wrap: anywhere; }
.acct__note { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .875rem; color: var(--t2); white-space: pre-wrap; }

.filter { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: 0 .1rem; }
.filter::-webkit-scrollbar { display: none; }
.filter .chip { flex: none; }
.log { display: grid; }
.log__item { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.log__item:first-child { border-top: 0; padding-top: 0; }
.log__item .avatar { width: 34px; height: 34px; }
.log__body { flex: 1; min-width: 0; }
.log__body b { font-weight: 700; }
.log__what { font-size: .875rem; color: var(--t2); overflow-wrap: anywhere; margin-top: .1rem; }
.log__what span { color: var(--t3); }
.log__time { flex: none; font-size: .8125rem; color: var(--t3); padding-top: .1rem; }

.log--delete .log__body p:first-child { color: var(--red); }
.btn--block { width: 100%; }

.app__icon--memo { background: #f5a524; }
.app__icon--link { background: #0ea5e9; }
.app__icon--acct { background: #4e5968; }
.app__icon--log { background: #ff7a45; }
.app__icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* ── 홈: 고정 투두 ─────────────────────── */

.todo { margin-bottom: 1.5rem; }
.todo__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .35rem; }
.todo__head .panel__title { margin: 0; }
.todo__head .seg { flex: none; }
.todo__head .seg button { white-space: nowrap; padding: 0 .7rem; }
.todo__head .seg b { font-weight: 700; color: var(--blue); margin-left: .1rem; }
.todo__head .seg button[aria-pressed="false"] b { color: var(--t3); }
.todo__hint { font-size: .8125rem; color: var(--t3); margin-bottom: .85rem; }
.todo__add { display: flex; gap: .5rem; margin-bottom: .5rem; }
.todo__add .input { flex: 1; min-width: 0; min-height: 44px; }
.todo__add .btn { min-height: 44px; flex: none; }
.todo__list { display: grid; }
.todo__list .empty { padding: .75rem .25rem; }
.ti { display: flex; align-items: center; gap: .65rem; padding: .55rem .1rem; border-top: 1px solid var(--line); }
.ti:first-child { border-top: 0; }
.ti__check {
  width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--switch-off); background: none;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.ti__check svg { width: 14px; height: 14px; fill: none; stroke: transparent; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ti__check[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); }
.ti__check[aria-pressed="true"] svg { stroke: #fff; }
.ti__title { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.ti__title small { display: block; font-size: .75rem; color: var(--t3); }
.ti.is-done .ti__title { color: var(--t3); text-decoration: line-through; }
.ti__del { width: 32px; height: 32px; flex: none; border: 0; border-radius: 8px; background: none; display: grid; place-items: center; cursor: pointer; opacity: .55; }
.ti__del:hover { opacity: 1; background: var(--fill); }
.ti__del svg { width: 14px; height: 14px; fill: none; stroke: var(--t2); stroke-width: 2; stroke-linecap: round; }
.todo__more { margin-top: .5rem; border: 0; background: none; color: var(--t3); font-size: .875rem; font-weight: 600; cursor: pointer; padding: .25rem; }
.todo__more:hover { color: var(--t1); }

.apps__head { display: flex; align-items: center; justify-content: space-between; padding: 0 .25rem .75rem; }
.apps__title { font-size: 1.125rem; font-weight: 700; }

/* 바로가기 편집 */
.arrange { display: grid; margin-top: .75rem; }
.arr { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.arr:first-child { border-top: 0; }
.arr.is-off .switch span { color: var(--t3); }
.arr__moves { display: flex; gap: .25rem; }
.arr__moves .icon-btn { background: var(--fill); }
.arr__moves .icon-btn[disabled] { opacity: .3; cursor: default; }


/* 위젯 미리보기(1x1보다 클 때) */
.app__peek.is-list { -webkit-line-clamp: unset; display: block; width: 100%; overflow: hidden; flex: 1; min-height: 0; }
.peek { display: grid; gap: .45rem; margin-top: .15rem; }
.peek li { display: flex; align-items: baseline; gap: .45rem; min-width: 0; }
.peek li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t2); }
.peek li > em { flex: none; font-style: normal; font-weight: 700; color: var(--t1); font-variant-numeric: tabular-nums; }
.peek li > span em { font-style: normal; font-weight: 700; color: var(--t1); margin-right: .35rem; }
.peek .is-unread { color: var(--t1); font-weight: 600; }
.peek .is-in, .peek-sums .is-in { color: var(--blue); }
.peek .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; align-self: center; }
.app[data-size="1x2"] .peek li > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.app[data-size="1x2"] .peek li > span em { display: block; margin: 0 0 .05rem; font-size: .75rem; color: var(--t3); }
.peek-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .1rem 0 .6rem; }
.peek-sums dt { font-size: .75rem; color: var(--t3); }
.peek-sums dd { font-size: .9375rem; font-weight: 700; color: var(--t1); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.peek-sums .is-minus { color: var(--red); }
.app[data-size="1x2"] .peek-sums { grid-template-columns: 1fr; gap: .3rem; }

/* 편집 모드: 흔들리고, 빼기·크기 버튼이 나타남 */
.apps__btns { display: flex; gap: .4rem; }
.app__ctrl { display: none; }
.home-editing .app__ctrl { display: block; }
.app__remove {
  position: absolute; top: .55rem; left: .55rem; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--t3); color: var(--card); font-weight: 800; font-size: 1.125rem; line-height: 1; cursor: pointer;
}
/* 크기 핸들: 오른쪽 아래 모서리를 따라 휘어진 선. 잡고 끌거나, 눌러서 다음 크기로 */
.app__size {
  position: absolute; right: 0; bottom: 0; z-index: 2; width: 52px; height: 52px; cursor: nwse-resize; touch-action: none;
}
.app__size::after {
  content: ""; position: absolute; right: 9px; bottom: 9px; width: 22px; height: 22px;
  border: solid var(--t1); border-width: 0 4px 4px 0; border-bottom-right-radius: 16px; opacity: .85;
}
.app__sizetag {
  position: absolute; right: 38px; bottom: 12px; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap;
  background: var(--t1); color: var(--card); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .15s;
}
.app.is-resizing .app__sizetag { opacity: 1; }
.app.is-resizing { animation: none; outline: 2px solid var(--blue); outline-offset: 2px; }
.home-editing .app { touch-action: none; cursor: grab; animation: jiggle .28s ease-in-out infinite alternate; }
.home-editing .app:nth-child(2n) { animation-delay: -.14s; animation-direction: alternate-reverse; }
.app.is-dragging { z-index: 20; pointer-events: none; animation: none; cursor: grabbing; box-shadow: 0 16px 40px rgba(0, 0, 0, .22); transition: none; }
@keyframes jiggle { from { transform: rotate(-.7deg); } to { transform: rotate(.7deg); } }
@media (prefers-reduced-motion: reduce) { .home-editing .app { animation: none; outline: 2px dashed var(--line); } }

/* 큰 위젯: 작은 아이콘과 이름을 한 줄에, 아래에 미리보기 */
.app .app__icon { width: 30px; height: 30px; border-radius: 9px; font-size: .9375rem; }
.app .app__icon svg { width: 18px; height: 18px; }
.app .app__icon--cal b { font-size: .4375rem; padding-top: 2px; }
.app .app__icon--cal strong { font-size: .875rem; line-height: 1.25; }
.app .app__icon--team { font-size: .8125rem; }
.app .app__name { font-size: .9375rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .app__peek { grid-column: 1 / -1; align-self: stretch; font-size: .8125rem; }
.app .peek { gap: .3rem; margin: 0; }
.app .peek li { font-size: .8125rem; }
.app .app__peek > b { font-size: .75rem; margin-bottom: .2rem; }
.peek-sums { grid-template-columns: 1fr; gap: .2rem; margin: 0 0 .4rem; }
.peek-sums > div { display: flex; justify-content: space-between; gap: .5rem; }
.peek-sums dd { font-size: .875rem; }
/* 좁고 긴 1×2는 아이콘 위, 이름 아래로 쌓음 */
.app[data-size="1x2"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); gap: .4rem; padding: .7rem .6rem; }
.app[data-size="1x2"] .app__peek { grid-column: 1; }
.app[data-size="1x2"] .peek li, .app[data-size="1x2"] .peek-sums dd { font-size: .75rem; }
.app[data-size="1x2"] .peek-sums > div { display: block; }

/* 1×1: 카드 없이 아이콘과 이름만 */
.app:not([data-size]), .app[data-size="1x1"] {
  display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 0; background: none; text-align: center;
}
.app:not([data-size]):hover, .app[data-size="1x1"]:hover { background: none; }
.app[data-size="1x1"] .app__icon, .app:not([data-size]) .app__icon { width: 58px; height: 58px; border-radius: 16px; font-size: 1.5rem; }
.app[data-size="1x1"] .app__icon svg, .app:not([data-size]) .app__icon svg { width: 30px; height: 30px; }
.app[data-size="1x1"] .app__icon--cal b { font-size: .625rem; padding-top: 5px; }
.app[data-size="1x1"] .app__icon--cal strong { font-size: 1.5rem; line-height: 1.3; }
.app[data-size="1x1"] .app__icon--team { font-size: 1.25rem; }
.app[data-size="1x1"] .app__name, .app:not([data-size]) .app__name { font-size: .75rem; font-weight: 600; color: var(--t1); width: 100%; }
.app[data-size="1x1"] .app__peek, .app:not([data-size]) .app__peek { display: none; }
@media (min-width: 48rem) {
  .app[data-size="1x1"] .app__icon { width: 64px; height: 64px; border-radius: 18px; }
  .app[data-size="1x1"] .app__name { font-size: .8125rem; }
}

/* 편집 버튼 위치: 빼기는 모서리 바깥, 1×1은 아이콘 모서리 */
.app__remove { top: -7px; left: -7px; width: 24px; height: 24px; font-size: 1rem; }
.app[data-size="1x1"] .app__remove { left: calc(50% - 29px - 8px); top: -6px; }
.app[data-size="1x1"] .app__size { width: 30px; height: 30px; right: calc(50% - 29px - 6px); top: 34px; bottom: auto; }
.app[data-size="1x1"] .app__size::after { width: 12px; height: 12px; right: 5px; bottom: 5px; border-width: 0 3px 3px 0; border-bottom-right-radius: 9px; }
.app[data-size="1x1"] .app__sizetag { right: 28px; bottom: 4px; }
.app__size { width: 40px; height: 40px; }
.app__size::after { width: 16px; height: 16px; right: 7px; bottom: 7px; border-width: 0 3px 3px 0; border-bottom-right-radius: 12px; }
.app__sizetag { right: 30px; bottom: 8px; }
.app .app__peek.is-list span { font-size: inherit; font-weight: 500; letter-spacing: 0; color: var(--t2); }
.app .app__peek.is-list span em { font-size: inherit; }
.app .peek .is-unread { color: var(--t1); font-weight: 600; }
.peek-sums dt { white-space: nowrap; }

/* 프로필 사진과 편집 */
/* 사진은 동그라미 전체를 채움(아이폰 사파리 버튼 기본 여백에 줄어들지 않게) */
.avatar { position: relative; overflow: hidden; padding: 0; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.avatar--xl { width: 88px; height: 88px; font-size: 2rem; }
.me__btns { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.pf-photo { display: flex; align-items: center; gap: 1.1rem; }
.pf-photo__btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.pf-photo__btns label { display: inline-flex; align-items: center; cursor: pointer; }
.stack-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-height: 50px; padding: .45rem .55rem;
  border: 1px solid transparent; border-radius: 12px; background: var(--fill); cursor: text;
}
.stack-input:focus-within { border-color: var(--blue); background: var(--card); }
.stack-input__text { flex: 1 1 7rem; min-width: 6rem; min-height: 32px; border: 0; background: none; color: var(--t1); font: inherit; font-size: 1rem; outline: none; }
.stack-input__text::placeholder { color: var(--t3); }
.stack-chip {
  display: inline-flex; align-items: center; gap: .15rem; padding: .3rem .25rem .3rem .65rem; border-radius: 999px;
  background: var(--blue-weak); color: var(--blue-d); font-size: .875rem; font-weight: 600;
}
.stack-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.stack-chip button:hover { background: var(--blue-weak-2); }
.stack { display: flex; flex-wrap: wrap; gap: .3rem; }
.stack li { padding: .2rem .55rem; border-radius: 999px; background: var(--fill); color: var(--t2); font-size: .75rem; font-weight: 600; }
.people__more { flex-basis: 100%; display: grid; gap: .45rem; padding-left: calc(40px + .75rem); }
.people__bio { font-size: .875rem; color: var(--t2); line-height: 1.5; overflow-wrap: anywhere; }
.people__contact { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8125rem; }
.people__contact a { color: var(--blue); font-weight: 600; overflow-wrap: anywhere; }
.app__icon--team { overflow: hidden; }
.app__icon--team img { width: 100%; height: 100%; object-fit: cover; }
.sheet__end { display: flex; justify-content: center; padding: .5rem 0 calc(1.5rem + env(safe-area-inset-bottom)); }
.link-btn { border: 0; background: none; padding: .5rem .75rem; font-size: .8125rem; font-weight: 600; color: var(--t3); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--red); }

/* 파일 위젯 */
.app__icon--files { background: #1f8fff; }
.peek-meter { display: grid; gap: .35rem; margin-bottom: .45rem; }
.peek-meter > div { display: flex; align-items: baseline; gap: .3rem; }
.peek-meter > div b { font-size: .9375rem; color: var(--t1); font-variant-numeric: tabular-nums; }
.peek-meter > div span { font-size: .75rem; color: var(--t3); }
.peek-meter > i { display: block; height: 6px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.peek-meter > i b { display: block; height: 100%; background: #1f8fff; border-radius: inherit; }
.peek-fee { font-size: .75rem; color: var(--t3); margin-top: .2rem; }
.peek-empty { font-size: .75rem; color: var(--t3); }

/* 그림 아이콘(토스 스타일): 흰 카드 칸 위에 입체 그림 */
.app__icon--art, .app__icon--cal.app__icon--art, .app__icon--team {
  background: var(--card); overflow: hidden; display: block; box-shadow: 0 1px 2px rgba(0, 20, 60, .06), inset 0 0 0 1px rgba(0, 20, 60, .04);
}
.app[data-size="1x1"] .app__icon--art, .app:not([data-size]) .app__icon--art,
.app[data-size="1x1"] .app__icon--team, .app:not([data-size]) .app__icon--team { padding: 7px; }
.app .app__icon--art, .app .app__icon--team { padding: 3px; }
.app .app__icon svg.ic, .app[data-size] .app__icon svg.ic, .app:not([data-size]) .app__icon svg.ic {
  width: 100%; height: 100%; display: block; fill: initial; stroke: none;
}
.app__icon svg.ic text { font-family: var(--font); }
/* 큰 위젯(흰 카드) 안의 작은 아이콘은 회색 칸으로 구분 */
.app[data-size="2x1"] .app__icon--art, .app[data-size="1x2"] .app__icon--art, .app[data-size="2x2"] .app__icon--art,
.app[data-size="2x1"] .app__icon--team, .app[data-size="1x2"] .app__icon--team, .app[data-size="2x2"] .app__icon--team { background: var(--fill); box-shadow: none; }
.app__icon svg.ic ellipse { opacity: .06; }
:root[data-theme="dark"] .app__icon--art, :root[data-theme="dark"] .app__icon--team { background: #2a2a33; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app__icon--art, :root:not([data-theme="light"]) .app__icon--team { background: #2a2a33; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
}
/* 계정과 팀: 칸 안에 동그란 프로필 */
.team-dot { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #6aa8ff, #3182f6); color: #fff; }
.team-dot img { width: 100%; height: 100%; object-fit: cover; }
.peek-meter > div b, .peek-meter > div span { white-space: nowrap; }
.app[data-size="1x2"] .peek-meter > div { display: grid; gap: 0; }
.app[data-size="1x2"] .peek-meter > div span { font-size: .6875rem; }

/* ── 통합 검색 ── */
.search-btn { margin-left: auto; }
.top__row .top__where { margin-right: 0; }
.search-btn svg { width: 20px; height: 20px; }
.search-sheet { width: min(36rem, 100vw); margin: 8vh auto auto; max-height: 80vh; display: none; }
.search-sheet[open] { display: flex; flex-direction: column; }
@media (max-width: 40rem) { .search-sheet { margin: 0; max-height: none; height: 100dvh; } }
.search-head { display: flex; align-items: center; gap: .5rem; padding: calc(.9rem + env(safe-area-inset-top)) 1rem .75rem; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.search-box { flex: 1; }
.search-box input { font-size: 1.0625rem; }
.search-body { overflow-y: auto; padding: 0 1rem calc(1.25rem + env(safe-area-inset-bottom)); display: grid; gap: .75rem; align-content: start; }
.search-body.is-loading { opacity: .6; transition: opacity .2s; }
.search-hint { color: var(--t3); font-size: .9375rem; line-height: 1.6; padding: 1rem .25rem; }
.search-cap { display: flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 700; color: var(--t3); padding: .25rem .25rem .4rem; }
.search-cap small { font-weight: 600; }
.search-cap button { margin-left: auto; border: 0; background: none; color: var(--t3); font-weight: 600; font-size: .8125rem; cursor: pointer; }
.search-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.search-chips .chip { background: var(--card); font-size: .875rem; padding: .45rem .8rem; }
.search-group ul { background: var(--card); border-radius: var(--r); padding: .3rem; display: grid; gap: 1px; }
.search-item { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .65rem; border: 0; border-radius: 14px; background: none; text-align: left; color: inherit; cursor: pointer; }
.search-item:hover, .search-item.is-active { background: var(--fill); }
.search-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: .8125rem; font-weight: 800;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--card)); }
.search-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.search-text b { font-size: .9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-text small { font-size: .8125rem; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-text mark { background: color-mix(in srgb, var(--blue) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-ext { color: var(--t3); font-weight: 700; }

/* 찾은 항목 반짝임 */
@keyframes rl-flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 25%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 55%, transparent); } }
.is-flash { animation: rl-flash 1.6s ease-in-out; border-radius: var(--r); }

/* 백업 */
.bk-desc { color: var(--t2); font-size: .875rem; line-height: 1.6; margin: -.25rem 0 1rem; }
.bk-now { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
#bk-status { font-size: .875rem; color: var(--t3); }
.bk-bar { margin-top: .75rem; height: 6px; }
.bk-list { display: grid; margin-top: .75rem; }
.bk-item { display: flex; align-items: center; gap: .4rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.bk-item > div { flex: 1; min-width: 0; }
.bk-item b { display: block; font-size: .9375rem; }
.bk-item small { color: var(--t3); font-size: .8125rem; }
.bk-item .btn { text-decoration: none; display: inline-grid; place-items: center; }
