/* 따복이 하우스 — 포근한 로컬 메모장 */

:root {
  --bg: #fff6ec;
  --bg-2: #ffeedf;
  --panel: #fffdfa;
  --line: #f2e0cf;
  --text: #5f4b40;
  --muted: #a9937f;
  --accent: #ff9470;
  --accent-ink: #e8653c;
  --accent-soft: #ffe9df;
  --mint: #8fd3bd;
  --butter: #ffd98e;
  --berry: #f6a5c0;
  --danger: #e8705f;
  --radius: 18px;
  --shadow: 0 2px 4px rgba(150, 110, 80, .06), 0 10px 24px rgba(150, 110, 80, .09);
  --shadow-sm: 0 1px 2px rgba(150, 110, 80, .07), 0 4px 10px rgba(150, 110, 80, .07);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #251f1b;
    --bg-2: #2d2520;
    --panel: #312924;
    --line: #42362e;
    --text: #f3e8df;
    --muted: #b09c8c;
    --accent: #ff9f7d;
    --accent-ink: #ffb496;
    --accent-soft: #4a3429;
    --mint: #7cc4ad;
    --butter: #e8c379;
    --berry: #dd92ab;
    --danger: #f0867a;
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, var(--bg-2) 0%, transparent 42%),
    radial-gradient(circle at 88% 92%, var(--bg-2) 0%, transparent 46%);
  color: var(--text);
  font: 15px/1.7 "Noto Sans KR", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  /* 머리글 · 본문 · (작은 화면이면) 아래 탭바를 위에서 아래로 쌓는다.
     세 칸이 화면 높이를 나눠 가지므로 서로 겹칠 수가 없다.
     100dvh 는 주소창이 접히고 펴지는 것까지 따라간다. 모르는 브라우저는
     앞 줄의 100vh 를 쓴다. */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button, input, textarea, a { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.hint { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ───────────────────────── 지붕(상단) ───────────────────────── */
.top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  height: 64px;
  background: var(--panel);
  border-bottom: 2px dashed var(--line);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 9px; }
.house { font-size: 24px; display: inline-block; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.4px;
  background: linear-gradient(100deg, var(--accent-ink), var(--berry));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cozy { font-size: 12.5px; }

.tabs { display: flex; gap: 6px; }
.tabs-bottom { display: none; }        /* 큰 화면에선 머리글 탭만 쓴다 */
.tab {
  padding: 8px 17px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  transition: .18s;
}
.tab span { margin-right: 3px; }
.tab:hover { background: var(--bg); transform: translateY(-1px); }
.tab.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

/* ───────────────────────── 버튼 ───────────────────────── */
.primary {
  background: linear-gradient(145deg, var(--accent), var(--berry));
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: .18s;
}
.primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.primary:active { transform: translateY(0); }
.primary.round {
  width: 42px; height: 42px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
  flex-shrink: 0;
}

.ghost {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: var(--panel);
  text-decoration: none;
  transition: .16s;
}
.ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.danger:hover { border-color: var(--danger); color: var(--danger); }
.ghost.light { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .3); color: #fff; }
.ghost.light:hover { background: rgba(255, 255, 255, .24); color: #fff; }

/* ───────────────────────── 방 배치 ───────────────────────── */
.view { flex: 1; display: flex; min-height: 0; }
.view[hidden] { display: none; }

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 2px dashed var(--line);
  display: flex;
  flex-direction: column;
}
.side-head {
  display: flex;
  gap: 9px;
  padding: 14px;
  border-bottom: 2px dashed var(--line);
}
#search {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13.5px;
}
#search:focus { outline: none; border-color: var(--accent); background: var(--panel); }

.note-list { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; }
.note-item {
  position: relative;
  padding: 12px 14px 12px 17px;
  border-radius: 14px;
  cursor: pointer;
  margin-bottom: 7px;
  background: var(--bg);
  border: 1.5px solid transparent;
  transition: .16s;
}
.note-item::before {
  content: "";
  position: absolute;
  left: 7px; top: 14px; bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: var(--c, var(--butter));
}
.note-item:hover { transform: translateX(2px) rotate(-.3deg); box-shadow: var(--shadow-sm); }
.note-item.on { background: var(--accent-soft); border-color: var(--accent); }
.note-item .t { font-weight: 700; font-size: 14px; }
.note-item .p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-item .d { color: var(--muted); font-size: 11.5px; margin-top: 5px; opacity: .85; }

/* ───────────────────────── 책상(편집) ───────────────────────── */
.editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 26px 30px;
  gap: 14px;
  min-width: 0;
  overflow-y: auto;
}
.editor[hidden] { display: none; }
.title {
  border: 0;
  background: none;
  font-size: 26px;
  font-weight: 800;
  padding: 2px 0;
  letter-spacing: -.5px;
}
.title:focus { outline: none; }
.title::placeholder { color: var(--line); }

.body {
  flex: 1;
  min-height: 230px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 20px;
  resize: vertical;
  line-height: 1.9;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s;
}
.body:focus { outline: none; border-color: var(--accent); }
.body::placeholder { color: var(--muted); opacity: .6; }

.attach {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px;
}
.attach-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.attach-title { font-size: 14px; font-weight: 700; }
.attach-title b { color: var(--accent-ink); }

.editor-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.saved { color: var(--mint); font-size: 12.5px; font-weight: 700; }

.placeholder { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; }
.placeholder[hidden] { display: none; }
.big { font-size: 58px; margin-bottom: 10px; animation: bob 3.6s ease-in-out infinite; }
.pl-title { font-size: 19px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.placeholder p { margin: 0; }

/* ───────────────────────── 사진방 ───────────────────────── */
.gallery { flex: 1; padding: 26px 30px; overflow-y: auto; }
.gal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.gal-head h2 { margin: 0 0 2px; font-size: 21px; font-weight: 800; letter-spacing: -.5px; }

.drop {
  border: 2.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
  background: var(--panel);
  transition: .18s;
}
.drop-emoji { display: block; font-size: 26px; margin-bottom: 4px; }
.drop.hot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  transform: scale(1.01);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.small-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }

.card {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border: 1.5px solid var(--line);
  transition: .18s;
}
.card:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.card .cap {
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .x {
  position: absolute;
  top: 7px; right: 7px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: rgba(60, 40, 32, .6);
  color: #fff;
  font-size: 13px;
  line-height: 27px;
  text-align: center;
  opacity: 0;
  transition: .14s;
  backdrop-filter: blur(3px);
}
.card:hover .x { opacity: 1; }
.card .x:hover { background: var(--danger); transform: scale(1.1); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.card .check {
  position: absolute;
  top: 7px; left: 7px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  line-height: 25px;
  text-align: center;
  display: none;
  box-shadow: var(--shadow-sm);
}
.card.sel .check { display: block; }

/* 날짜별 묶음 */
.day-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 22px 0 10px;
  flex-wrap: wrap;
}
.day-head:first-child { margin-top: 4px; }
.day-head .dh-date { font-size: 15px; font-weight: 800; }
.day-head .dh-age {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
}
.day-head .dh-n { font-size: 12px; color: var(--muted); }

/* 사진방 윗줄 단추 */
.gal-acts { display: flex; gap: 7px; flex-wrap: wrap; }
.gal-acts button { white-space: nowrap; }
.ghost.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 여러 장 고르기 — 스크롤해도 늘 위에 붙어 있게 한다 */
.pick-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.pick-bar[hidden] { display: none; }
.pick-n { white-space: nowrap; }
.pick-acts { display: flex; gap: 7px; flex-wrap: wrap; }
.pick-acts button { white-space: nowrap; }
.pick-acts button:disabled { opacity: .4; cursor: default; }
.card .fav {
  position: absolute;
  bottom: 34px; right: 7px;
  font-size: 17px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
  opacity: 0;
  transition: .14s;
}
.card:hover .fav, .card .fav.on { opacity: 1; }
.card .fav.on { color: var(--butter); }
body.picking .card .x { display: none; }
body.picking .card .check { display: block; background: var(--line); }
body.picking .card.sel .check { background: var(--accent); }

/* 크게 보기 — 좌우로 넘기기 */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 72px;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  transition: .14s;
}
.lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-nav[hidden] { display: none; }

.empty { text-align: center; color: var(--muted); padding: 40px 14px; }
.empty .emoji { font-size: 40px; margin-bottom: 8px; }
.empty p { margin: 0; font-size: 13.5px; line-height: 1.8; }
.empty.small { padding: 26px 12px; }
.empty.small .emoji { font-size: 32px; }
.empty[hidden] { display: none; }

/* ───────────────────────── 크게 보기 ───────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(50, 34, 26, .86);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 50;
  padding: 44px;
  overflow-y: auto;        /* 사진 밑에 적는 칸까지 더해져도 잘리지 않게 */
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 90vw;
  max-height: 62vh;
  border-radius: 14px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .4);
}
.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  color: #fff;
  font-size: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  transition: .16s;
}
.lb-close:hover { background: rgba(255, 255, 255, .18); transform: rotate(90deg); }
.lb-bar { display: flex; gap: 18px; align-items: center; color: #fdf3ec; font-size: 13.5px; flex-wrap: wrap; justify-content: center; }

.picker-box {
  background: var(--panel);
  border-radius: 22px;
  padding: 26px;
  /* 바깥 .lightbox 의 좌우 여백 안에 들어가야 한다.
     92vw 로 잡으면 그 여백만큼 화면 밖으로 삐져나간다. */
  width: 100%;
  max-width: 860px;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.picker-box h3 { margin: 0 0 16px; font-size: 17px; font-weight: 800; }
.picker-box .grid { margin-bottom: 18px; }

/* ─────────────────── 사진 설명과 태그 ─────────────────── */
.gal-search {
  width: 100%;
  margin-bottom: 10px;
  padding: 11px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 15px;
}
.gal-search:focus { outline: none; border-color: var(--accent); }
#gal-tags { padding: 0 0 2px; margin-bottom: 14px; }
#gal-tags[hidden] { display: none; }

/* 사진 밑 설명 — 길면 한 줄로 자른다 */
.cap-desc {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cap-sub { opacity: .78; }

/* 크게 보기에서 바로 적는 칸 */
.lb-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(620px, 92vw);
}
.lb-edit input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fdf3ec;
  font-size: 15px;
}
.lb-edit input::placeholder { color: rgba(253, 243, 236, .5); }
.lb-edit input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, .16);
}
/* .tag-chips 는 display:contents 라 칩들이 이 줄의 식구가 된다 */
.lb-tagline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lb-tagline input { flex: 1; min-width: 130px; width: auto; }
.lb-edit .chip {
  background: rgba(255, 255, 255, .16);
  color: #fdf3ec;
  border-color: transparent;
}

.bt-box { max-width: 420px; }
#bt-known { margin: -4px 0 14px; }
#bt-known[hidden] { display: none; }

/* ─────────────────── 고정 지출 — 한 줄 표 ─────────────────── */
/* 홈 카드 */
.fx-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.fx-big {
  font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -1px;
  background: linear-gradient(100deg, var(--accent-ink), var(--berry));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fx-big small { font-size: 13px; font-weight: 700; -webkit-text-fill-color: var(--muted); }
.fx-left { font-size: 13px; font-weight: 800; color: var(--text); }
.fx-bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.fx-bar i { display: block; height: 100%; width: 0; border-radius: 99px;
            background: linear-gradient(90deg, var(--mint), var(--accent)); transition: width .3s; }
.fx-bar.mini { flex: 1; min-width: 70px; max-width: 160px; }

/* 창 */
.fx-sheet { max-width: 560px; }
.fx-top { position: sticky; top: -1px; z-index: 2; background: var(--panel); padding-bottom: 10px; }
.fx-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fx-nav h3 { flex: 1; margin: 0; text-align: center; }
.fx-nav-b {
  width: 34px; height: 34px; padding: 0; border: 2px solid var(--line); border-radius: 50%;
  background: var(--panel); color: var(--accent-ink); font-size: 12px; cursor: pointer;
}
.fx-nav-b:disabled { opacity: .3; cursor: default; }
.fx-past { margin: 0 0 8px; padding: 7px 10px; border-radius: 10px; text-align: center;
           background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.fx-past[hidden] { display: none; }
/* 지난달: 칸은 읽기만 */
.fx-sheet.past .fx-in { background: none; cursor: default; }
.fx-sheet.past .fx-cb::after { display: none; }
#fx-add[hidden] { display: none; }
.fx-prog { margin: 6px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fx-cats-sum { display: flex; flex-wrap: wrap; gap: 5px; }
.fx-cats-sum:empty { display: none; }

/* 표: 체크 | 분류 | 항목 | 금액 | 지우기 */
.fx-head-row, .fx-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.45fr) 88px 22px;
  gap: 6px; align-items: center;
}
.fx-head-row { padding: 6px 0 4px; border-bottom: 2px dashed var(--line);
               font-size: 11.5px; font-weight: 800; color: var(--muted); }
.fx-head-row span:nth-child(4) { text-align: right; padding-right: 6px; }
.fx-rows { list-style: none; margin: 0; padding: 0; }
.fx-row { padding: 6px 0; border-bottom: 1px solid var(--bg); }
.fx-chk {
  width: 26px; height: 26px; border-radius: 8px; padding: 0;
  border: 2px solid var(--line); background: var(--panel);
  color: #fff; font-size: 15px; font-weight: 900; line-height: 1; cursor: pointer; transition: .15s;
}
.fx-row.done .fx-chk { background: var(--mint); border-color: var(--mint); }
.fx-in {
  width: 100%; min-width: 0; padding: 7px 8px; border: 1.5px solid transparent; border-radius: 9px;
  background: var(--bg); font-family: inherit; font-size: 14px; color: var(--text);
}
.fx-in:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.fx-in::placeholder { color: var(--muted); opacity: .6; }
.fx-cat { font-weight: 700; color: var(--accent-ink); }
.fx-nm { font-weight: 700; }
.fx-amt { text-align: right; font-weight: 800; color: var(--accent-ink); }
.fx-row.done .fx-nm { text-decoration: line-through; color: var(--muted); }
.fx-row.done .fx-amt, .fx-row.done .fx-cat { color: var(--muted); }
/* 고를 수 있는 칸에는 작은 ▾ */
.fx-cb { position: relative; min-width: 0; }
.fx-cb::after {
  content: "▾"; position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--muted); pointer-events: none;
}
.fx-cb .fx-in { padding-right: 18px; }
.fx-x {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 11px; cursor: pointer; opacity: .55;
}
.fx-x:hover { opacity: 1; color: var(--danger); background: var(--bg); }
.fx-add-row {
  width: 100%; margin-top: 8px; padding: 10px; border: 2px dashed var(--line); border-radius: 12px;
  background: none; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--muted);
}
.fx-add-row:hover { color: var(--accent-ink); border-color: var(--accent); }

/* 고르는 목록 */
.fx-pop {
  position: fixed; z-index: 80; margin: 0; padding: 5px; list-style: none;
  max-height: 220px; overflow-y: auto; max-width: 260px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.fx-pop[hidden] { display: none; }
.fx-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.fx-opt:hover, .fx-opt.on { background: var(--accent-soft); color: var(--accent-ink); }
.fx-opt.empty { cursor: default; font-size: 12px; font-weight: 600; color: var(--muted); background: none; }
.fx-opt-x {
  flex-shrink: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 11px; cursor: pointer;
}
.fx-opt-x:hover { color: var(--danger); background: var(--bg); }

/* ─────────────────── 누가 적었는지 ─────────────────── */
.who-chip {
  flex-shrink: 0;
  padding: 7px 13px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: .16s;
}
.who-chip:hover { border-color: var(--accent); }
/* 아직 안 골랐으면 눈에 띄게 */
.who-chip.unset { border-style: dashed; color: var(--muted); }

.who-box { max-width: 400px; }
.who-box .hint { margin: -6px 0 16px; line-height: 1.7; }
.who-picks { display: flex; gap: 10px; margin-bottom: 15px; }
.who-pick {
  flex: 1;
  padding: 16px 8px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: .14s;
}
.who-pick:hover { border-color: var(--accent); }
.who-pick.on {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ─────────────────── 두 사람 ─────────────────── */
.couple-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 15px 18px;
  border-radius: 20px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(105deg, var(--berry), var(--accent)) border-box;
  box-shadow: var(--shadow-sm);
}
.couple-card[hidden] { display: none; }
.cc-left { flex: 1; min-width: 0; }
.cc-label { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: -.3px; }
.cc-days { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.cc-days b {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.8px;
  margin-right: 3px;
  background: linear-gradient(100deg, var(--berry), var(--accent-ink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cc-from { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); opacity: .9; }

.cc-right { display: flex; flex-direction: column; gap: 6px; text-align: right; flex-shrink: 0; }
.cc-mark { line-height: 1.3; }
.cc-name { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cc-left-d { font-size: 17px; font-weight: 800; color: var(--berry); letter-spacing: -.3px; }
.cc-when { font-size: 10.5px; color: var(--muted); opacity: .85; }
/* 두 번째 기념일은 곁들이는 정도로만 */
.cc-mark.small .cc-left-d { font-size: 12.5px; color: var(--muted); }
.cc-mark.small .cc-name { font-size: 10.5px; opacity: .8; }
.cc-mark.small .cc-when { display: none; }

/* 되풀이 표시 */
.rep-tag {
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: 1px;
}
.ev-rep-tip { margin: -6px 0 13px; }
.ev-rep-tip:empty { display: none; }
#ev-until-wrap[hidden] { display: none; }
.ev-form select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
}
.ev-form select:focus { outline: none; border-color: var(--accent); background: var(--panel); }

/* ───────────────────────── 자라는 기록 ───────────────────────── */
/* 홈 카드 — 평소엔 숫자 세 개만 */
.growth-card {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 15px 18px 13px;
  text-align: left;
  background: var(--panel);
  border: 2px dashed var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .16s;
}
.growth-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.gc-head { display: flex; justify-content: space-between; align-items: center; }
.gc-title { font-size: 14.5px; font-weight: 800; color: var(--muted); letter-spacing: -.3px; }
.gc-more { font-size: 12px; font-weight: 700; color: var(--accent-ink); }

.gc-marks { display: flex; gap: 10px; margin: 12px 0 8px; }
.gc-one { flex: 1; min-width: 0; }
.gc-name { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.gc-val {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.8px;
  background: linear-gradient(100deg, var(--accent-ink), var(--berry));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gc-val small {
  font-size: 12px; font-weight: 700; margin-left: 2px;
  -webkit-text-fill-color: var(--muted);
}
.gc-val.none { -webkit-text-fill-color: var(--line); }
.gc-diff { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.gc-diff.up { color: var(--mint); }
.gc-diff.down { color: var(--berry); }
.gc-none { font-size: 14px; font-weight: 700; color: var(--muted); }
.gc-when { font-size: 11.5px; color: var(--muted); opacity: .9; }

/* ─────────────────── 수유 기록 ─────────────────── */
.feed-card { cursor: default; }
.feed-card:hover { transform: none; border-color: var(--line); }
.gc-more { border: 0; background: none; font-family: inherit; cursor: pointer; padding: 4px 2px; }
.fd-last { margin-top: 12px; }
.fd-last-main { font-size: 16.5px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.fd-count { margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.fd-count-lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.fd-chip-c {
  padding: 3px 10px; border-radius: 99px; background: var(--bg);
  font-size: 12.5px; font-weight: 800; color: var(--accent-ink);
}

.fd-btns { display: flex; gap: 10px; margin-top: 13px; }
.fd-btn {
  flex: 1; padding: 15px 10px; border: 0; border-radius: 15px;
  font-family: inherit; font-size: 16px; font-weight: 800; letter-spacing: -.3px;
  color: #fff; cursor: pointer; transition: .14s; box-shadow: var(--shadow-sm);
}
.fd-btn:active { transform: scale(.96); }
.fd-btn.formula { background: linear-gradient(135deg, #5aa9e6, #3d7fc4); }
.fd-btn.solid { background: linear-gradient(135deg, #f3a953, #e2823c); }

/* 언제 먹였나 — 시간 먼저 고르기 */
.fd-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 13px; }
.fd-when-lab { font-size: 12px; font-weight: 800; color: var(--muted); margin-right: 1px; }
.fd-chip {
  padding: 6px 11px; border: 1.5px solid var(--line); border-radius: 99px;
  background: var(--panel); color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: .12s;
}
.fd-chip:hover { border-color: var(--accent); }
.fd-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fd-exact {
  padding: 5px 8px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 700;
}
.fd-exact.on { border-color: var(--accent); color: var(--accent-ink); }
.fd-when-read { font-size: 12px; font-weight: 800; color: var(--accent-ink); margin-left: 2px; }

/* 모달 */
.fd-sheet { max-width: 520px; }
.fd-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fd-nav h3 { flex: 1; margin: 0; text-align: center; }
.fd-counts { text-align: center; font-size: 13px; font-weight: 800; color: var(--accent-ink); margin-bottom: 16px; }

/* 하루 24시간 타임라인 */
.fd-timeline { padding: 6px 6px 26px; }
.fd-track { position: relative; height: 42px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--line); }
.fd-tick { position: absolute; top: 0; bottom: -16px; border-left: 1px dashed var(--line); }
.fd-tick span { position: absolute; bottom: -16px; left: 3px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.fd-tick:last-child span { left: auto; right: 3px; }
.fd-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%; font-size: 13px; line-height: 23px; text-align: center;
  background: var(--panel); border: 2px solid var(--line); box-shadow: var(--shadow-sm);
}
.fd-dot.formula { border-color: #3d7fc4; }
.fd-dot.solid { border-color: #e2823c; }

/* 목록 (최근이 위로) */
.fd-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.fd-item { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--bg); }
.fd-hm { width: 46px; font-size: 15px; font-weight: 800; color: var(--text); }
.fd-name { font-weight: 700; color: var(--accent-ink); }
.fd-item.formula .fd-name { color: #3d7fc4; }
.fd-item.solid .fd-name { color: #cf7430; }
.fd-by { font-size: 12px; color: var(--muted); }
.fd-ctl { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.fd-nudge {
  padding: 5px 7px; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.fd-nudge:hover { border-color: var(--accent); color: var(--accent-ink); }
.fd-del {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 12px; cursor: pointer;
}
.fd-del:hover { background: var(--bg); color: var(--danger); }
.fd-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

.fd-add { display: flex; gap: 10px; margin-top: 16px; }
.fd-add[hidden] { display: none; }

/* 토스트 되돌리기 버튼 */
.toast-act {
  margin-left: 12px; padding: 4px 11px; border: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .22); color: #fff;
  font-family: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer;
}

/* ─────────────────── 수유 — 하루 시간표(톡 눌러 기록) ─────────────────── */
.fd-hint { margin: 12px 0 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fd-tl { padding: 0 2px; }
.fd-row { position: relative; margin-bottom: 26px; }
.fd-row:last-child { margin-bottom: 8px; }
.fd-row-tag {
  display: inline-block; margin: 0 0 9px 1px; padding: 3px 11px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; letter-spacing: .2px;
}
.fd-track {
  position: relative; height: 58px; border-radius: 14px;
  background: var(--bg); border: 1.5px solid var(--line); cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
}
.fd-tl.big .fd-track { height: 50px; }
/* 오늘 지난 시간 옅은 채움 */
.fd-fill { position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; background: var(--accent-soft); border-radius: 13px 0 0 13px; opacity: .6; }
.fd-tick { position: absolute; top: 6px; bottom: -14px; border-left: 1px dashed var(--line); }
.fd-tick.start { border-left: 0; }
.fd-tick span { position: absolute; bottom: -14px; left: 3px; font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.fd-tick.end { border-left: 0; }
.fd-tick.end span { left: auto; right: 3px; }
.fd-now { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--berry); z-index: 4; }
.fd-now::before {
  content: ""; position: absolute; top: -5px; left: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--berry);
}
.fd-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 32px; height: 32px; border-radius: 50%; z-index: 2;
  font-size: 16px; line-height: 28px; text-align: center;
  background: var(--panel); border: 2.5px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer;
}
.fd-dot.formula { border-color: #3d7fc4; }
.fd-dot.solid { border-color: #e2823c; }
.fd-dot:hover { transform: translate(-50%, -50%) scale(1.12); }

/* 고른 자리를 가리키는 핀 */
.fd-pin { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); z-index: 3; }
.fd-pin::before {
  content: ""; position: absolute; top: -6px; left: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}

/* 큰 버튼 시간 스테퍼 — 모바일에서 손가락으로 쉽게 */
.fd-ctrl { margin-top: 15px; padding-top: 16px; border-top: 1px solid var(--line); }
.fd-time-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 13px; }
.fd-time-col { display: flex; flex-direction: column; min-width: 0; }
.fd-time-lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.fd-time { font-size: 27px; font-weight: 800; color: var(--text); letter-spacing: -.6px; line-height: 1; }
.fd-reset {
  margin-left: auto; flex-shrink: 0; padding: 9px 17px; border: 1.5px solid var(--line); border-radius: 99px;
  background: var(--panel); color: var(--accent-ink); font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.fd-reset:active { background: var(--accent-soft); transform: scale(.96); }
/* 오전/오후 전환 */
.fd-seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 11px; background: var(--bg); border-radius: 13px; }
.fd-seg-btn {
  flex: 1; padding: 10px; border: 0; border-radius: 10px; background: none;
  font-family: inherit; font-size: 14px; font-weight: 800; color: var(--muted); cursor: pointer;
}
.fd-seg-btn.on { background: var(--panel); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
/* 시 그리드 12칸 */
.fd-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 10px; }
.fd-hcell {
  padding: 14px 0; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel);
  font-family: inherit; font-size: 15.5px; font-weight: 800; color: var(--text); cursor: pointer;
}
.fd-hcell.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fd-hcell.off { opacity: .32; cursor: default; }
.fd-hcell:not(.off):not(.on):active { background: var(--accent-soft); border-color: var(--accent); }
/* 분 칸 */
.fd-mrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 13px; }
.fd-mcell {
  padding: 10px 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel);
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.fd-mcell.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.fd-mcell.off { opacity: .32; cursor: default; }
.fd-type-row { display: flex; gap: 10px; }
.fd-pk-btn {
  flex: 1; min-width: 0; padding: 18px 8px; border: 0; border-radius: 16px; color: #fff;
  font-family: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .10);
}
.fd-pk-btn:active { transform: scale(.97); }
.fd-pk-btn.formula { background: linear-gradient(135deg, #5aa9e6, #3d7fc4); }
.fd-pk-btn.solid { background: linear-gradient(135deg, #f3a953, #e2823c); }
/* 점을 눌러 기록을 수정할 때 */
.fd-edit-label { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.fd-edit-save {
  flex: 1; min-width: 0; padding: 16px 8px; border: 0; border-radius: 15px; background: var(--accent); color: #fff;
  font-family: inherit; font-size: 15.5px; font-weight: 800; cursor: pointer;
}
.fd-edit-save:active { transform: scale(.97); }
.fd-edit-del, .fd-edit-cancel {
  flex-shrink: 0; padding: 16px 16px; border: 1.5px solid var(--line); border-radius: 15px; background: var(--panel);
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.fd-edit-del { color: var(--danger); }
.fd-edit-cancel { color: var(--muted); }

/* ───── 전체 보기: 통계 대시보드 ───── */
.fd-dash { max-width: 520px; }
/* 상단 헤더 (닫기 버튼) — 스크롤해도 고정 */
.fd-head2 {
  position: sticky; top: -18px; z-index: 5; display: flex; align-items: center; gap: 8px;
  margin: -4px -2px 6px; padding: 10px 2px; background: var(--panel);
}
.fd-head2 h3 { flex: 1; margin: 0; text-align: center; font-size: 17px; }
.fd-back, .fd-xbtn {
  width: 38px; height: 38px; padding: 0; border: 1.5px solid var(--line); border-radius: 50%;
  background: var(--panel); color: var(--text); font-size: 17px; font-weight: 800; cursor: pointer;
}
.fd-back:active, .fd-xbtn:active { background: var(--bg); }
.fd-dayname { flex: 1; text-align: center; font-size: 14px; font-weight: 800; color: var(--accent-ink); }
.fd-sec { margin: 20px 0 11px; font-size: 13px; font-weight: 800; color: var(--muted); }

/* 핵심 지표: 도넛 + 범례 */
.fd-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 16px; border-radius: 18px; background: var(--bg); margin-bottom: 10px;
}
.fd-ring {
  width: 104px; height: 104px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fd-ring-hole {
  width: 70px; height: 70px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fd-ring-v { font-size: 27px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -1px; }
.fd-ring-l { margin-top: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.fd-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.fd-leg { display: flex; align-items: center; gap: 8px; }
.fd-leg-dot { width: 13px; height: 13px; border-radius: 4px; flex-shrink: 0; }
.fd-leg-dot.formula { background: #5aa9e6; }
.fd-leg-dot.solid { background: #f3a953; }
.fd-leg-lab { font-size: 13.5px; font-weight: 700; color: var(--text); }
.fd-leg-n { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--accent-ink); }

/* 지표 3칸 */
.fd-metrics { display: flex; gap: 8px; }
.fd-metric { flex: 1; text-align: center; padding: 13px 5px; border-radius: 14px; border: 1.5px solid var(--line); }
.fd-metric-v { font-size: 15px; font-weight: 800; color: var(--accent-ink); letter-spacing: -.3px; }
.fd-metric-l { margin-top: 4px; font-size: 10.5px; font-weight: 700; color: var(--muted); }

/* 최근 7일 막대 */
.fd-week { display: flex; align-items: flex-end; gap: 6px; height: 112px; padding: 2px 2px 0; }
.fd-wcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.fd-wnum { font-size: 11px; font-weight: 800; color: var(--muted); }
.fd-wbar-wrap { width: 72%; height: 70px; display: flex; flex-direction: column-reverse; align-items: stretch; border-radius: 7px; overflow: hidden; background: var(--bg); }
.fd-wseg.formula { background: #5aa9e6; }
.fd-wseg.solid { background: #f3a953; }
.fd-wlab { font-size: 11px; font-weight: 700; color: var(--muted); }
.fd-wcol.today .fd-wlab { color: var(--accent-ink); font-weight: 800; }
.fd-wcol.today .fd-wbar-wrap { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 시간대 분포 */
.fd-buckets { display: flex; flex-direction: column; gap: 9px; }
.fd-bk { display: flex; align-items: center; gap: 10px; }
.fd-bk-l { width: 58px; font-size: 12.5px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.fd-bk-bar { flex: 1; height: 14px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.fd-bk-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--mint), var(--accent)); min-width: 0; transition: width .3s; }
.fd-bk-n { width: 18px; text-align: right; font-size: 12.5px; font-weight: 800; color: var(--accent-ink); }

/* 전체 보기 타임라인은 보기 전용 */
#fd-tl-modal .fd-track, #fd-tl-modal .fd-dot { cursor: default; }

/* 창 — 그래프와 지난 기록 */
.gr-box { max-width: 560px; }
.gr-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: var(--bg); border-radius: 999px; padding: 4px;
}
.gr-tab {
  flex: 1; padding: 9px 4px; border: 0; border-radius: 999px;
  background: none; color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: .14s;
}
.gr-tab.active { background: var(--panel); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

.gr-chart {
  background: var(--bg);
  border-radius: 16px;
  padding: 6px 4px 2px;
  margin-bottom: 16px;
}
.gr-svg { display: block; overflow: visible; }
.gr-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.gr-line { fill: none; stroke: var(--accent); stroke-width: 2.5;
           stroke-linejoin: round; stroke-linecap: round; }
.gr-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2.4; }
.gr-dot.last { fill: var(--accent); }
.gr-ylab { fill: var(--muted); font-size: 10.5px; text-anchor: end; }
.gr-xlab { fill: var(--muted); font-size: 10.5px; }
.gr-vlab { fill: var(--accent-ink); font-size: 12.5px; font-weight: 800; }
.gr-nochart { padding: 46px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.gr-list { list-style: none; margin: 0 0 16px; padding: 0; max-height: 240px; overflow-y: auto; }
.gr-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 13px; margin-bottom: 7px;
  border: 2px solid var(--line); border-radius: 14px;
  cursor: pointer; transition: .14s;
}
.gr-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.gr-when { flex-shrink: 0; min-width: 68px; }
.gr-when b { display: block; font-size: 13.5px; font-weight: 800; }
.gr-when small { display: block; font-size: 10.5px; color: var(--muted); }
.gr-vals { flex: 1; min-width: 0; }
.gr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.gr-chip {
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg); color: var(--muted);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.gr-chip.on { background: var(--accent-soft); color: var(--accent-ink); }
.gr-memo { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* 적기 창은 기록 창 위에 뜬다 */
#gr-form { z-index: 55; }
.ev-form .three { display: flex; gap: 9px; min-width: 0; }
.ev-form .three label { flex: 1; min-width: 0; }
.gr-tip { margin: -4px 0 13px; }

/* ───────────────────────── 프로필 고치기 ───────────────────────── */
.pf-form { max-width: 480px; }
.pf-face { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.pf-face > img {
  width: 82px; height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.pf-face-acts { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.pf-face-acts button { flex: 1; white-space: nowrap; }
.pf-grid { max-height: 230px; overflow-y: auto; }
.pf-grid .card { cursor: pointer; }

.pf-crop { margin-bottom: 18px; }
.pf-crop .hint { margin: 0 0 10px; text-align: center; }

/* 자르는 판 — 사진은 이 안에서만 움직인다 */
.pf-stage {
  position: relative;
  width: 100%;
  max-width: 264px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: #2a211c;
  cursor: grab;
  touch-action: none;            /* 끌 때 화면이 같이 밀리지 않게 */
  user-select: none;
}
.pf-stage:active { cursor: grabbing; }
.pf-stage img {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* 실제로 얼굴이 될 범위를 동그라미로 보여 준다 */
.pf-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(40, 28, 22, .5);
  border: 2px solid rgba(255, 255, 255, .85);
  pointer-events: none;
}

.pf-zoom { display: flex !important; align-items: center; gap: 10px;
           max-width: 264px; margin: 12px auto 0; }
.pf-zoom input {
  flex: 1; width: auto; min-height: 0;
  padding: 0; border: 0; background: none;
  accent-color: var(--accent);
}

/* ───────────────────────── 사진 저장 ───────────────────────── */
/* 공유 판은 손가락을 뗀 직후에만 열린다. 사진을 다 챙긴 뒤 이 띠를 눌러 연다. */
.share-ask {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 28px);
  padding: 10px 12px 10px 18px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 70;
  animation: pop .22s ease-out;
}
.share-ask button { white-space: nowrap; }

/* ───────────────────────── 알림 ───────────────────────── */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--panel);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 60;
  box-shadow: var(--shadow);
  animation: pop .22s ease-out;
}
@keyframes pop {
  from { transform: translateX(-50%) translateY(12px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.toast[hidden] { display: none; }

/* ───────────────────────── 일정방 ───────────────────────── */
.cal-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.cal-link b { font-size: 14.5px; }
.cal-link p { margin: 4px 0 0; }

.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--c, var(--mint));
  border-radius: 14px;
  padding: 13px 16px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: .16s;
}
.ev-item:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.ev-item.past { opacity: .5; }
.ev-item.important { border-left-color: var(--accent); }

.ev-dday {
  flex-shrink: 0;
  min-width: 62px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-ink);
  line-height: 1.3;
}
.ev-dday small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.ev-body { min-width: 0; flex: 1; }
.ev-title { font-weight: 700; font-size: 15px; }
.ev-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* 입력 폼 — 일정 적기와 프로필 고치기가 같이 쓴다 */
.ev-form label, .pf-form label { display: block; margin-bottom: 13px; font-size: 13px; font-weight: 700; }
.ev-form input[type=text], .ev-form input[type=date],
.ev-form input[type=time], .ev-form input[type=number], .ev-form textarea,
.pf-form input[type=text], .pf-form input[type=date] {
  display: block;
  width: 100%;
  /* 날짜·시각 칸은 기기 기본 너비를 고집해서 밖으로 삐져나간다.
     줄어들 수 있게 풀어 준다. */
  min-width: 0;
  max-width: 100%;
  margin-top: 5px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 16px;
  font-weight: 400;
}
/* iOS 사파리의 날짜·시각 칸은 기기 기본 외형을 쓰는 동안
   width:100% 를 줘도 자기 최소 너비를 고집해 카드 밖으로 삐져나간다.
   외형을 벗기면 보통 칸처럼 줄어든다. 눌렀을 때 뜨는 피커는 그대로다. */
.ev-form input[type=date], .ev-form input[type=time],
.pf-form input[type=date] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  min-height: 48px;          /* 외형을 벗기면 높이가 찌그러지는 것 방지 */
  line-height: 1.2;
}
.ev-form label, .pf-form label { min-width: 0; }
.ev-form .two { min-width: 0; }
.ev-form textarea { border-radius: 14px; resize: vertical; line-height: 1.6; }
.ev-form input:focus, .ev-form textarea:focus,
.pf-form input[type=text]:focus, .pf-form input[type=date]:focus {
  outline: none; border-color: var(--accent); background: var(--panel);
}
.ev-form .two { display: flex; gap: 11px; }
.ev-form .two label { flex: 1; }
.check-line { display: flex !important; align-items: center; gap: 8px; }
.check-line input { width: 19px; height: 19px; accent-color: var(--accent); }

/* ───────────────────────── 홈 ───────────────────────── */
.brand { cursor: pointer; }
.brand:hover .name { filter: brightness(1.12); }
.brand:hover .avatar { transform: scale(1.06); }
.avatar { transition: .16s; }

.home { flex: 1; overflow-y: auto; padding: 22px 26px 30px; }

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  border: 2px dashed var(--line);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.hero-face {
  width: 86px; height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--bg);
  box-shadow: 0 6px 18px rgba(190, 130, 95, .25);
  animation: bob 4.4s ease-in-out infinite;
  flex-shrink: 0;
}
/* 얼굴을 누르면 프로필을 고친다 */
.hero-face-btn {
  position: relative;
  padding: 0; border: 0; background: none;
  cursor: pointer; flex-shrink: 0; line-height: 0;
}
.hero-face-btn .face-pen {
  position: absolute; right: -2px; bottom: 2px;
  width: 27px; height: 27px; line-height: 27px;
  font-size: 13px; text-align: center;
  background: var(--panel);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
/* 얼굴은 늘 살랑이고 있다. 거기에 겹쳐 쓰지 않도록 단추 쪽을 키운다. */
.hero-face-btn { transition: transform .16s; }
.hero-face-btn:hover { transform: scale(1.04); }

.hero-text { flex: 1; min-width: 120px; }
.hero-text h2 {
  margin: 0 0 1px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.4px;
}
.lived { margin: 0; font-size: 14px; color: var(--muted); }
.lived b {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(100deg, var(--accent-ink), var(--berry));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-right: 3px;
}
.hero-weather { text-align: right; font-size: 13px; color: var(--muted); line-height: 1.7; }
.hero-weather .wnow { font-size: 22px; }

/* 미세먼지 — 숫자보다 '좋음·나쁨' 이 먼저 눈에 들어와야 한다 */
.wdust { display: flex; gap: 5px; justify-content: flex-end; margin-top: 5px; }
.pm {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: default;
}
.pm.good  { background: #e3f0ff; color: #2d6cb5; }
.pm.fair  { background: #e4f4e6; color: #3a7c46; }
.pm.bad   { background: #fdeede; color: #a8651c; }
.pm.awful { background: #fde6e6; color: #b23b3b; }
.hero-weather b { color: var(--text); font-size: 15px; }

.home-h {
  margin: 26px 0 11px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: -.3px;
}

.dday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
}
.dday {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
}
.dday.soon { border-color: var(--accent); background: var(--accent-soft); }
.dday .dn { font-size: 13px; font-weight: 700; }
.dday .dl {
  font-size: 21px;
  font-weight: 800;
  color: var(--accent-ink);
  margin: 3px 0 1px;
}
.dday .dd { font-size: 11.5px; color: var(--muted); }
.dday.past { opacity: .55; }
.dday.past .dl { color: var(--muted); font-size: 15px; }

.note-list.flat { padding: 0; }
.note-list.flat .note-item { cursor: pointer; }

.home-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }

/* ───────────────────────── 즐겨찾기 · 태그 ───────────────────────── */
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row .title { flex: 1; min-width: 0; }
.star {
  flex-shrink: 0;
  font-size: 25px;
  line-height: 1;
  color: var(--line);
  transition: .16s;
  padding: 2px;
}
.star:hover { transform: scale(1.15); }
.star.on { color: var(--butter); text-shadow: 0 1px 4px rgba(220, 170, 60, .4); }

.tag-edit {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}
.tag-chips { display: contents; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 700;
}
.chip b { cursor: pointer; opacity: .55; font-weight: 700; }
.chip b:hover { opacity: 1; }
#tag-input {
  flex: 1;
  min-width: 130px;
  padding: 6px 13px;
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
}
#tag-input:focus { outline: none; border-color: var(--accent); border-style: solid; }

/* 목록 위 태그 고르기 줄 */
.tag-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px 2px;
  scrollbar-width: none;
}
.tag-bar::-webkit-scrollbar { display: none; }
.tag-bar:empty { display: none; }
.tag-pick {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.tag-pick:hover { border-color: var(--accent); color: var(--accent-ink); }
.tag-pick.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.note-item .row-top { display: flex; align-items: center; gap: 5px; }
.note-item .mini-star { color: var(--butter); font-size: 12.5px; flex-shrink: 0; }
.note-item .tags { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; }
.note-item .tags i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

/* ───────────────────────── 이야기방 ───────────────────────── */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border-bottom: 2px dashed var(--line);
  flex-shrink: 0;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-hello { text-align: center; color: var(--muted); padding: 40px 16px; margin: auto; }
.chat-hello img {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  animation: bob 4s ease-in-out infinite;
}
.chat-hello p { margin: 0; font-size: 13.5px; line-height: 1.8; }
.chat-hello b { color: var(--text); font-size: 15px; }

.bubble {
  max-width: min(600px, 78%);
  padding: 11px 16px;
  border-radius: 18px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
  animation: rise .2s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.bubble.me {
  align-self: flex-end;
  background: linear-gradient(145deg, var(--accent), var(--berry));
  color: #fff;
  border-bottom-right-radius: 6px;
}
.bubble.ai {
  align-self: flex-start;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-bottom-left-radius: 6px;
}
.bubble.err {
  align-self: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  border: 0;
  box-shadow: none;
}
.bubble .when {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  opacity: .6;
}

.auto-line { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.auto-line input { width: 17px; height: 17px; accent-color: var(--accent); }

/* 따복이 머리 고르기 */
.chat-top { flex-wrap: wrap; }
.model-pick {
  flex-shrink: 0;
  padding: 7px 30px 7px 13px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  /* 기기 기본 화살표를 지우고 우리 것을 그린다 */
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.model-pick:hover { border-color: var(--accent); }
.model-pick:focus { outline: none; border-color: var(--accent); }
.model-pick[hidden] { display: none; }
.model-hint {
  margin: 0;
  padding: 7px 26px 0;
  font-size: 11.5px;
  flex-shrink: 0;
}
.model-hint:empty { display: none; }

/* 적을까요? 카드 */
.propose {
  align-self: flex-start;
  max-width: min(600px, 86%);
  background: var(--panel);
  border: 2px dashed var(--accent);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  animation: rise .2s ease-out;
}
.propose .ptitle { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.propose .pline { font-size: 13px; color: var(--muted); line-height: 1.8; }
.propose .pline b { color: var(--accent-ink); font-weight: 700; }
.propose .pbtn { display: flex; gap: 8px; margin-top: 13px; }
.propose .pbtn button { flex: 1; padding: 9px; font-size: 13.5px; }
.propose.done { border-style: solid; border-color: var(--line); opacity: .65; }
.propose.done .pbtn { display: none; }

.typing { display: flex; gap: 4px; padding: 4px 2px; }
.typing i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.3s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.chat-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 26px calc(18px + env(safe-area-inset-bottom));
  border-top: 2px dashed var(--line);
  background: var(--panel);
}
#chat-input {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  padding: 12px 17px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
}
#chat-input:focus { outline: none; border-color: var(--accent); background: var(--panel); }
#chat-send { flex-shrink: 0; }
#chat-send:disabled { opacity: .45; cursor: default; transform: none; }

/* ───────────────────────── 머리글 아바타 ───────────────────────── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--panel);
  box-shadow: 0 2px 7px rgba(190, 130, 95, .3);
  flex-shrink: 0;
}
.brand { min-width: 0; }
.name { white-space: nowrap; }
.tab em, .ghost em { font-style: normal; }

/* 목록으로 돌아가기 — 작은 화면에서만 쓴다 */
.back {
  display: none;
  align-self: flex-start;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 700;
}

/* ═════════════════════ 작은 화면 (휴대폰) ═════════════════════ */
@media (max-width: 760px) {
  /* 방 고르는 단추를 아래로 내린다. 머리글이 널널해지고 엄지로 누르기도 쉽다. */
  .tabs-top { display: none; }
  .tabs-bottom {
    display: flex;
    flex-shrink: 0;                    /* 본문이 아무리 길어도 눌리지 않는다 */
    gap: 0;
    background: var(--panel);
    border-top: 2px dashed var(--line);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(150, 110, 80, .07);
  }


  .top {
    gap: 10px;
    padding: 0 14px;
    height: 56px;
    flex-wrap: nowrap;
  }
  .name { font-size: 16px; }              /* 이제 자리가 넉넉하다 */
  .cozy { display: none; }
  .spacer { flex: 1; }

  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 2px;
    border-radius: 13px;
    font-size: 11px;
    font-weight: 600;
  }
  .tab:hover { transform: none; background: none; }
  .tab span { margin: 0; font-size: 20px; line-height: 1.25; }
  .tab em { display: block; }             /* 아래 글씨를 늘 보이게 */
  .tab.active { background: var(--accent-soft); }
  .tab.active em { display: block; font-weight: 800; }

  .ghost.icon-only { padding: 8px 12px; flex-shrink: 0; }
  .ghost.icon-only em { display: none; }
  .who-chip { padding: 6px 10px; font-size: 11.5px; }
  .who-picks { gap: 8px; }
  .who-pick { padding: 14px 6px; font-size: 14px; }

  /* 한 번에 한 화면씩 — 목록 ↔ 본문 */
  .sidebar {
    width: 100%;
    border-right: 0;
  }
  .placeholder { display: none; }
  body.editing .sidebar { display: none; }
  body:not(.editing) .editor { display: none; }
  .back { display: block; }

  .side-head { padding: 11px 12px; }
  #search { padding: 11px 15px; font-size: 16px; }   /* iOS 확대 방지 */
  .primary.round { width: 46px; height: 46px; }

  .note-list { padding: 9px; }
  .note-item { padding: 14px 15px 14px 19px; margin-bottom: 8px; }
  .note-item .t { font-size: 15px; }

  .editor { padding: 14px 15px 22px; gap: 11px; }
  .title { font-size: 21px; }
  .body { min-height: 180px; padding: 15px 16px; font-size: 16px; }

  .attach { padding: 13px 14px; }
  .attach-head { flex-direction: column; align-items: flex-start; gap: 9px; }
  .small-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

  .editor-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .editor-foot .row { justify-content: space-between; }

  .gallery { padding: 16px 15px 24px; }
  .gal-head { align-items: stretch; }
  .gal-head h2 { font-size: 19px; }

  /* 끌어다 놓기는 손가락으로는 할 수 없다. 작은 화면에선 감춘다. */
  .drop { display: none; }

  .gal-acts { width: 100%; }
  .gal-acts button { flex: 1; padding: 9px 4px; font-size: 12.5px; }

  .pick-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .pick-acts { width: 100%; }
  .pick-acts button { flex: 1; padding: 8px 2px; font-size: 12px; }

  .home { padding: 16px 15px 24px; }
  .hero { padding: 16px; gap: 14px; }
  .hero-face { width: 68px; height: 68px; }
  .hero-face-btn .face-pen { width: 24px; height: 24px; line-height: 24px; font-size: 12px; }
  .lived b { font-size: 26px; }
  .hero-weather { text-align: left; width: 100%; }
  .wdust { justify-content: flex-start; }
  .dday-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }

  /* 머리글이 세 줄로 늘어지지 않게 바짝 당긴다. 본문이 그만큼 넓어진다. */
  .chat-top { padding: 8px 14px; gap: 7px; }
  .chat-top .ghost { padding: 7px 11px; font-size: 12.5px; }
  .model-pick { padding: 6px 26px 6px 11px; font-size: 12.5px; }
  .auto-line .hint { font-size: 12px; }
  .model-hint { padding: 5px 14px 0; font-size: 11px; }
  .chat-log { padding: 16px 14px 6px; gap: 10px; }
  .bubble { max-width: 86%; padding: 10px 14px; }
  /* 아래 여백은 body 가 이미 탭바만큼 비워 두었다. 또 더하지 않는다. */
  .chat-bar { padding: 11px 14px 12px; gap: 8px; }
  .chat-hello img { width: 76px; height: 76px; }

  .cal-link { flex-direction: column; align-items: stretch; padding: 14px; }
  .cal-link .row { justify-content: stretch; }
  .cal-link .row > * { flex: 1; text-align: center; }
  .ev-form .two { flex-direction: column; gap: 0; }
  /* 숫자 세 칸은 좁아도 한 줄에 둔다. 셋을 한눈에 보며 적는 편이 낫다. */
  .ev-form .three { gap: 7px; }
  .ev-form .three label { font-size: 12px; }
  .ev-form .three input { padding: 11px 9px; }
  .ev-item { padding: 12px 13px; gap: 11px; }
  .ev-dday { min-width: 54px; font-size: 13px; }
  .drop { padding: 20px 14px; margin-bottom: 15px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .card .x { opacity: 1; width: 30px; height: 30px; line-height: 30px; }  /* 터치엔 hover가 없다 */
  .card .fav { opacity: 1; bottom: 32px; }
  .day-head { margin: 18px 0 9px; }
  .day-head .dh-date { font-size: 14px; }
  .pick-bar { font-size: 12.5px; padding: 9px 11px; }
  .lb-nav { width: 40px; height: 58px; font-size: 30px; }
  .lb-nav.prev { left: 4px; }
  .lb-nav.next { right: 4px; }

  .lightbox { padding: 18px; gap: 11px; }
  .lightbox img { max-height: 46vh; }
  .lb-edit input { font-size: 16px; padding: 9px 14px; }   /* iOS 확대 방지 */
  .gal-search { font-size: 16px; padding: 10px 15px; }
  .lb-close { top: 10px; right: 12px; }
  .picker-box { padding: 18px 15px; border-radius: 18px; }

  .fx-big { font-size: 22px; }
  /* 분류는 '주거·공과금' 다섯 글자가 다 보이게 항목과 폭을 나눈다 */
  /* 좁은 화면에선 ▾ 를 빼서 글자 자리를 늘린다 (칸을 누르면 목록은 그대로 뜬다) */
  .fx-head-row, .fx-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1.1fr) 68px 18px; gap: 4px; }
  .fx-in { padding: 7px 6px; font-size: 13.5px; text-overflow: ellipsis; }
  .fx-cat { font-size: 12.5px; letter-spacing: -0.4px; }
  .fx-cb .fx-in { padding-right: 6px; }
  .fx-cb::after { display: none; }
  .couple-card { padding: 13px 14px; gap: 10px; margin-top: 14px; }
  .cc-days b { font-size: 23px; }
  .cc-left-d { font-size: 15px; }
  .growth-card { padding: 14px 15px 12px; margin-top: 18px; }
  .gc-marks { gap: 7px; margin: 10px 0 7px; }
  .gc-val { font-size: 21px; letter-spacing: -1px; }
  .gc-name, .gc-diff { font-size: 11px; }
  .gr-tab { font-size: 12.5px; padding: 9px 2px; }
  .gr-list { max-height: 200px; }
  .gr-item { gap: 10px; padding: 10px 11px; }
  .gr-when { min-width: 60px; }

  /* 작은 화면에서도 '저장'까지 한눈에 들어오도록 바짝 당긴다 */
  .picker-box { max-height: 88vh; }
  .pf-form label { margin-bottom: 10px; }
  .pf-face { gap: 11px; margin-bottom: 13px; }
  .pf-face > img { width: 64px; height: 64px; }
  .pf-face-acts button { padding: 9px 6px; font-size: 12.5px; }
  .pf-grid { max-height: 170px; }
  .pf-crop { margin-bottom: 13px; }
  .pf-stage { max-width: 196px; }
  .pf-zoom { max-width: 196px; margin-top: 10px; }

  .toast { bottom: 18px; font-size: 13px; }
  .share-ask { padding: 9px 10px 9px 15px; gap: 8px; font-size: 12.5px; }
  .share-ask button { padding: 9px 12px; font-size: 12.5px; }
}


/* 아주 좁은 화면 — 탭은 아래에 있으니 글씨만 조금 줄인다 */
@media (max-width: 380px) {
  .top { gap: 7px; padding: 0 11px; }
  .fx-head-row, .fx-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.1fr) 62px 16px; gap: 3px; }
  .fx-in { padding: 7px 4px; font-size: 12.5px; }
  .fx-cb .fx-in { padding-right: 4px; }
  .fx-cat { font-size: 12px; }
  .fx-chk { width: 22px; height: 22px; font-size: 13px; }
  .name { font-size: 14.5px; }
  .tab { font-size: 10px; }
  .tab span { font-size: 18px; }
}
