:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; padding: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout: 좌측 레일(데스크톱) / 하단 탭바(모바일) + 한 줄 입력이 모든 화면의 머리 */
:root {
  --bg: #eef0ec;          /* 옅은 회녹 종이 */
  --surface: #fbfcfa;
  --sunk: #e4e7e1;
  --ink: #1d232c;          /* 먹 */
  --ink-2: #5a6370;
  --ink-3: #8a929c;
  --line: #d5d9d2;
  --accent: #2c4a8c;       /* 쪽빛 */
  --accent-ink: #ffffff;
  --accent-soft: #dfe5f2;
  --me: #2c4a8c;
  --wife: #b0566f;
  --us: #4f7a44;
  --me-soft: #e0e6f3;
  --wife-soft: #f4e2e7;
  --us-soft: #e2ecdd;
  --red: #c4423a;
  --blue: #3b6fb6;
  --warn: #b35b14;
  --shadow: 0 1px 2px rgba(29,35,44,.06), 0 6px 20px rgba(29,35,44,.06);
  --f-display: "Hahmlet", "Nanum Myeongjo", "AppleMyungjo", serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12151a; --surface: #1a1e25; --sunk: #232831; --ink: #e7e9ec; --ink-2: #a6adb7; --ink-3: #737b86; --line: #2c323c;
  --accent: #8ea8e6; --accent-ink: #0f1420; --accent-soft: #24304a;
  --me: #8ea8e6; --wife: #e090a6; --us: #95bf86; --me-soft: #232f48; --wife-soft: #3d2530; --us-soft: #24331f;
  --red: #ef7f77; --blue: #84aef0; --warn: #e8a15c; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #12151a; --surface: #1a1e25; --sunk: #232831; --ink: #e7e9ec; --ink-2: #a6adb7; --ink-3: #737b86; --line: #2c323c;
  --accent: #8ea8e6; --accent-ink: #0f1420; --accent-soft: #24304a;
  --me: #8ea8e6; --wife: #e090a6; --us: #95bf86; --me-soft: #232f48; --wife-soft: #3d2530; --us-soft: #24331f;
  --red: #ef7f77; --blue: #84aef0; --warn: #e8a15c; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--ink-2); }
.sm { font-size: 13px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.mw0 { min-width: 0; }
.pre { white-space: pre-wrap; }
.strike { text-decoration: line-through; color: var(--ink-3); }
.warn { color: var(--warn); }
.mt { margin-top: 18px; }
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.display.sm { font-size: 26px; }

/* 앱 골격 */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; padding-left: max(12px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.seal { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: #fff; font-family: var(--f-display); font-weight: 700; font-size: 18px; transform: rotate(-4deg); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.seal.sm { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
.brand-t { font-family: var(--f-display); font-weight: 700; font-size: 20px; }
.nav-b { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; position: relative; text-align: left; width: 100%; }
.nav-b:hover { background: var(--sunk); color: var(--ink); }
.nav-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav-b.on svg { color: var(--accent); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); padding: 0 12px; }
.main { min-width: 0; padding-block: 24px 64px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); max-width: 1180px; width: 100%; }
.topbar, .tabbar { display: none; }

/* 담당자 색 */
.odot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-3); }
.odot.o-me { background: var(--me); } .odot.o-wife { background: var(--wife); } .odot.o-us { background: var(--us); }
.ochip { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex: none; }
.ochip.o-me { background: var(--me-soft); color: var(--me); } .ochip.o-wife { background: var(--wife-soft); color: var(--wife); } .ochip.o-us { background: var(--us-soft); color: var(--us); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 14px; white-space: nowrap; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px currentColor; }
.ib { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); flex: none; }
.ib:hover { background: var(--sunk); color: var(--ink); }
.ib.sm { width: 30px; height: 30px; }
.ib.on { color: var(--accent); }
.ib.primary { background: var(--accent); color: var(--accent-ink); }
.lnk { color: var(--accent); font-size: 13px; font-weight: 500; }
.lnk:hover { text-decoration: underline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 예시 배너 */
.sample-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }

/* 한 줄 입력 */
.qa { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; margin-bottom: 24px; border: 1px solid var(--line); }
.qa.compact { margin-bottom: 20px; }
.qa-row { display: flex; align-items: center; gap: 6px; }
.qa-plus { display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent); flex: none; }
.qa-in { border: 0; background: transparent; padding: 12px 4px; font-size: 16px; }
.qa-in:focus { outline: none; }
.qa:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.qa-go { padding: 10px 18px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-weight: 600; flex: none; }
.qa-go:disabled { background: var(--sunk); color: var(--ink-3); cursor: default; }
.qa-prev, .qa-ex { padding: 8px 10px 8px; border-top: 1px dashed var(--line); margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.qa-ex { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.qa-types { display: flex; gap: 4px; flex-wrap: wrap; }
.tchip { font-size: 12px; padding: 3px 10px; border-radius: 999px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tchip.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.qa-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.qa-sum .mono { font-size: 13px; color: var(--accent); }
.ex { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); }
.ex:hover { color: var(--ink); background: var(--line); }
.tag { font-size: 12px; color: var(--ink-3); margin-left: 4px; }

/* 오늘 */
.today-head { margin-bottom: 18px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 6px; }
.today h1.display { font-size: clamp(28px, 4.2vw, 40px); }
.brief { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.strip-d { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.strip-d:hover { border-color: var(--ink-3); }
.strip-d .sw { font-size: 12px; color: var(--ink-2); }
.strip-d .sn { font-family: var(--f-mono); font-size: 18px; font-weight: 500; }
.strip-d.red .sw, .strip-d.red .sn { color: var(--red); }
.strip-d.blue .sw, .strip-d.blue .sn { color: var(--blue); }
.strip-d.is-today { background: var(--ink); border-color: var(--ink); }
.strip-d.is-today .sw, .strip-d.is-today .sn { color: var(--bg); }
.sdots { display: flex; gap: 3px; height: 8px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sub-h { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; margin-top: 6px; }
.empty { padding: 14px 0; color: var(--ink-3); }
.empty-t { font-weight: 500; color: var(--ink-2); }
.empty-h { font-size: 13px; margin-top: 2px; }

.tl { display: flex; flex-direction: column; }
.tl-i { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tl-i:last-child { border-bottom: 0; }
.tl-i:hover b { color: var(--accent); }
.tl-t { width: 76px; flex: none; font-size: 13px; color: var(--ink-2); }
.tl-bar { width: 3px; align-self: stretch; border-radius: 2px; flex: none; background: var(--ink-3); }
.tl-bar.o-me, .bar.o-me { background: var(--me); } .tl-bar.o-wife, .bar.o-wife { background: var(--wife); } .tl-bar.o-us, .bar.o-us { background: var(--us); }
.tl-b { flex: 1; min-width: 0; }
.mini li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.mini li:hover .grow { color: var(--accent); }
.w64 { width: 64px; flex: none; font-size: 13px; color: var(--ink-2); }

.todos li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.todos li .grow { cursor: pointer; overflow-wrap: anywhere; }
.todos li.late .due { color: var(--red); }
.todos.big li { padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.todos.faded li { opacity: .7; }
.due { font-size: 12px; color: var(--ink-2); flex: none; }
.chk { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--ink-3); flex: none; display: grid; place-items: center; color: var(--bg); transition: background .15s; }
.chk:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.chk.done { background: var(--us); box-shadow: none; color: #fff; }

.dd li { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.dd-n { min-width: 64px; text-align: center; padding: 6px 8px; border-radius: 8px; background: var(--wife-soft); color: var(--wife); font-weight: 500; font-size: 14px; }
.counter-mini { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.counter-mini b { font-size: 16px; color: var(--ink); }
.pins li { padding: 8px 10px; border-radius: 9px; background: var(--sunk); margin-bottom: 6px; cursor: pointer; display: flex; flex-direction: column; font-size: 14px; }
.pins li span { color: var(--ink-2); font-size: 13px; font-family: var(--f-mono); letter-spacing: -.02em; }
.shop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.stag { padding: 6px 12px; border-radius: 999px; background: var(--us-soft); color: var(--us); font-size: 14px; font-weight: 500; }
.stag:hover { text-decoration: line-through; }
.links-mini li { display: flex; flex-direction: column; padding: 6px 0; font-size: 14px; }
.links-mini .mono { font-size: 12px; }

/* 캘린더 */
.cal-head { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; gap: 4px; align-items: center; }
.filters { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }
.fchip.on { color: var(--ink); background: var(--surface); }
.fchip:not(.on) .odot { opacity: .3; }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mh { padding: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: center; border-bottom: 1px solid var(--line); }
.mh.red, .mn.red { color: var(--red); } .mh.blue, .mn.blue { color: var(--blue); }
.md { min-height: 96px; padding: 6px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.md:nth-child(7n+7) { border-right: 0; }
.md:hover { background: var(--sunk); }
.md.out { opacity: .4; }
.md.sel { background: var(--accent-soft); }
.mn { font-family: var(--f-mono); font-size: 13px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.md.is-today .mn { background: var(--ink); color: var(--bg); }
.hol { font-size: 10px; color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mevs { display: flex; flex-direction: column; gap: 2px; }
.mev { font-size: 11px; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mev.o-me { background: var(--me-soft); color: var(--me); } .mev.o-wife { background: var(--wife-soft); color: var(--wife); } .mev.o-us { background: var(--us-soft); color: var(--us); }
.mev.anniv::before { content: "♥ "; }
.more { font-size: 11px; color: var(--ink-3); padding-left: 4px; }
.mdots { display: none; gap: 2px; flex-wrap: wrap; }
.tdot { width: 8px; height: 8px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--ink-2); display: inline-block; }
.day-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.dp-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hol-b { font-size: 12px; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.dp-add, .inline-add { display: flex; gap: 8px; }
.dp-list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.bar { width: 3px; align-self: stretch; border-radius: 2px; flex: none; }

/* 할 일 */
.vh { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.vh p { width: 100%; font-size: 14px; }
.tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--sunk); margin-left: auto; }
.tabs button { padding: 6px 14px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.load { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.load-i { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; text-align: left; }
.load-i.on { border-color: currentColor; }
.load-i.o-me { color: var(--me); } .load-i.o-wife { color: var(--wife); } .load-i.o-us { color: var(--us); }
.load-i span:last-child { color: var(--ink-2); }
.load-n { font-size: 22px; font-weight: 500; }
.load-bar { grid-column: 1 / -1; display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; }
.load-bar .o-me { background: var(--me); } .load-bar .o-wife { background: var(--wife); } .load-bar .o-us { background: var(--us); }
.inline-add { margin-bottom: 18px; }
.tgroup { margin-bottom: 18px; }
.tgroup h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; margin-bottom: 2px; }
.tgroup h3.warn { color: var(--red); }
.done-h { display: flex; gap: 16px; }

/* 기억 */
.mem-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); min-width: 0; }
.search input { border: 0; padding: 10px 0; background: transparent; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--accent); }
.tagbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag-f { font-size: 13px; padding: 4px 11px; border-radius: 999px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tag-f.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.memo-grid { columns: 3 260px; column-gap: 14px; }
.memo { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.memo.pinned { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.memo-h { display: flex; align-items: flex-start; gap: 8px; }
.memo-h h3 { flex: 1; font-size: 16px; font-weight: 600; cursor: pointer; }
.memo p { font-size: 14px; color: var(--ink-2); cursor: pointer; overflow-wrap: anywhere; }
.memo-f { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.memo-f .lnk { margin-left: auto; }
.link-list li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.link-list li a { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list li.read a { color: var(--ink-2); font-weight: 400; }
.fav { width: 34px; height: 34px; border-radius: 9px; background: var(--sunk); display: grid; place-items: center; flex: none; color: var(--ink-2); }

/* 우리 */
.counters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.counter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; }
.counter.add { align-items: center; justify-content: center; flex-direction: row; gap: 8px; color: var(--ink-2); border-style: dashed; min-height: 110px; }
.c-l { font-size: 13px; color: var(--ink-2); }
.c-n { font-size: 38px; color: var(--accent); }
.c-n small { font-size: 16px; margin-left: 2px; color: var(--ink-2); }
.c-s { font-size: 12px; }
.us-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.prog { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.prog span { display: block; height: 100%; background: var(--us); border-radius: 3px; }
.otd { padding: 10px 12px; border-radius: 9px; background: var(--wife-soft); font-size: 14px; }
.otd b { color: var(--wife); margin-right: 6px; }
.rec-add { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; }
.tline { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.tl-month { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.tl-m { font-size: 13px; color: var(--ink-2); padding-top: 8px; }
.tl-month ul { border-left: 2px solid var(--line); padding-left: 14px; }
.tl-month li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 14px; cursor: pointer; position: relative; }
.tl-month li::before { content: ""; position: absolute; left: -19px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--ink-3); }
.tl-month li .mono { font-size: 12px; width: 30px; flex: none; }
.kind { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--sunk); color: var(--ink-2); flex: none; white-space: nowrap; }
.kind.k-record { background: var(--accent-soft); color: var(--accent); }
.kind.k-bucket { background: var(--wife-soft); color: var(--wife); }
.kind.k-todo { background: var(--us-soft); color: var(--us); }

/* 물어보기 */
.ask { display: flex; flex-direction: column; min-height: calc(100vh - 120px); }
.chat { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-bottom: 16px; }
.ask-empty p { color: var(--ink-2); margin-bottom: 10px; font-size: 14px; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.turn { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: min(640px, 92%); padding: 12px 16px; border-radius: 16px; font-size: 15px; }
.bubble.q { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.a { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; display: flex; flex-direction: column; gap: 10px; white-space: pre-wrap; }
.srcs { display: flex; flex-direction: column; gap: 4px; white-space: normal; }
.srcs button, .srcs a { display: flex; align-items: center; gap: 8px; font-size: 13px; text-align: left; padding: 6px 8px; border-radius: 8px; background: var(--sunk); width: 100%; color: var(--ink); }
.srcs button:hover, .srcs a:hover { background: var(--line); text-decoration: none; }
.srcs .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ask-bar { position: sticky; bottom: 16px; display: flex; gap: 8px; padding: 6px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.ask-bar input { border: 0; background: transparent; font-size: 16px; }
.ask-bar input:focus { outline: none; }

/* 설정 */
.prefs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lbl { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-b { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--ink-2); }
.seg-b.on { color: var(--ink); font-weight: 500; }
.seg-b.on.o-me { background: var(--me-soft); box-shadow: inset 0 0 0 1.5px var(--me); }
.seg-b.on.o-wife { background: var(--wife-soft); box-shadow: inset 0 0 0 1.5px var(--wife); }
.seg-b.on.o-us { background: var(--us-soft); box-shadow: inset 0 0 0 1.5px var(--us); }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.stats div { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 8px; background: var(--sunk); }
.stats .mono { font-size: 18px; font-weight: 500; }
.tbl-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.cmp th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 600; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cmp td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp td:nth-child(2) { color: var(--ink-2); white-space: nowrap; font-size: 13px; }
.cmp td:last-child { color: var(--ink); }

/* 모달·토스트 */
.modal-bg { position: fixed; inset: 0; background: rgba(15,18,24,.45); display: grid; place-items: center; z-index: 50; padding: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-h { display: flex; align-items: center; justify-content: space-between; }
.modal-h h2 { font-family: var(--f-display); font-size: 20px; }
.modal-f { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 14px 10px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); animation: up .2s ease-out; }
.toast button { color: var(--accent-soft); font-weight: 600; white-space: nowrap; }
@keyframes up { from { transform: translate(-50%, 8px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 반응형 */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-body { grid-template-columns: 1fr; }
  .day-panel { position: static; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .main { padding-block: 0 96px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 20; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
  .m-brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 18px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .tab-b { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 4px 0; position: relative; }
  .tab-b.on { color: var(--accent); font-weight: 600; }
  .tab-b .badge { position: absolute; top: 0; right: calc(50% - 22px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .grid, .us-grid, .prefs-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .ask { min-height: calc(100vh - 180px); }
  .ask-bar { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .qa-ex { display: none; }
  .qa-in { font-size: 15px; }
  .strip { gap: 4px; }
  .strip-d { padding: 8px 2px 6px; border-radius: 10px; }
  .md { min-height: 56px; padding: 4px 2px; align-items: center; }
  .mevs, .hol { display: none; }
  .mdots { display: flex; justify-content: center; }
  .md.sel { background: var(--accent-soft); }
  .filters { margin-left: 0; width: 100%; }
  .load-i { flex-direction: column; gap: 0; padding: 8px 10px; }
  .rec-add { grid-template-columns: 1fr auto; }
  .rec-add input[type="date"] { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .tl-month { grid-template-columns: 1fr; gap: 4px; }
  .tl-m { padding-top: 0; }
  .tl-t { width: 64px; font-size: 12px; }
  .memo-grid { columns: 1; }
  .counter.add { min-height: 56px; }
  .c-n { font-size: 32px; }
  .tabs { margin-left: 0; }
}

/* v1 추가: 동기화 상태, 기기 등록, 설정 */
.rep { color: var(--ink-3); font-size: 13px; flex: none; }
.panel.fresh { border-color: var(--accent); }
.panel.fresh .mini li { gap: 8px; }
.top-actions { display: flex; gap: 2px; }
.sync-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; margin-left: auto; margin-right: 4px; }
.sync-chip.s-offline { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(420px, 100%); gap: 14px; padding: 24px; box-shadow: var(--shadow); }
.gate-card .brand { padding: 0 0 4px; }
.gate-card .btn { justify-content: center; padding: 12px 14px; font-size: 15px; }
.code-in { font-size: 22px; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.code-box { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.code-box .code { font-size: 26px; letter-spacing: .1em; color: var(--accent); user-select: all; }
.dev-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dev-list li:last-child { border-bottom: 0; }
.prefs input[readonly] { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }

/* 공유 링크 피드 */
.share-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.share { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.share.new { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.share.visited .share-t { color: var(--ink-2); }
.share-h { display: flex; align-items: center; gap: 6px; min-width: 0; }
.src { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; flex: none; }
.src.s-insta { background: var(--wife-soft); color: var(--wife); }
.src.s-youtube { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.src.s-tiktok { background: var(--ink); color: var(--bg); }
.src.s-naver, .src.s-kakao { background: var(--us-soft); color: var(--us); }
.cat-sel { width: auto; flex: none; font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: 6px; border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.cat-sel.c-food, .tag-f.c-food.on { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.cat-sel.c-trip, .tag-f.c-trip.on { background: var(--us-soft); color: var(--us); }
.cat-sel.c-fun, .tag-f.c-fun.on { background: var(--wife-soft); color: var(--wife); }
.cat-sel.c-etc { background: var(--sunk); color: var(--ink-2); }
.tag-f.c-food.on, .tag-f.c-trip.on, .tag-f.c-fun.on { box-shadow: inset 0 0 0 1px currentColor; }
.tag-f.unseen { margin-left: auto; }
.new-dot { font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.share-t { font-size: 16px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; line-height: 1.4; }
.share.seen .share-t { font-weight: 500; }
.share-n { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.share-m { overflow-wrap: anywhere; }
.share-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.act { font-size: 13px; padding: 5px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); white-space: nowrap; }
.act:hover { color: var(--ink); background: var(--sunk); }
.act.on { background: var(--accent-soft); color: var(--accent); box-shadow: none; font-weight: 500; }
.links-mini li a { overflow-wrap: anywhere; }
@media (max-width: 560px) { .share-list { grid-template-columns: 1fr; } .tag-f.unseen { margin-left: 0; } }
.share-hint { align-self: flex-start; }
.share-h .mono { white-space: nowrap; }
.share-b { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.share-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.share-img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--sunk); flex: none; }
.share-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 요약·빠른 동작 창 */
.sheet { gap: 10px; outline: none; }
.sheet-h { display: flex; align-items: center; gap: 8px; }
.sheet-t { font-family: var(--f-display); font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.sheet-body { font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--sunk); overflow-wrap: anywhere; user-select: text; }
.qrow { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.qbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 12px; background: var(--sunk); color: var(--ink); font-weight: 500; font-size: 15px; flex: 1 1 auto; text-decoration: none; }
.qbtn:hover { background: var(--line); text-decoration: none; }
.qbtn.on { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 820px) {
  .sheet-bg { place-items: end center; padding: 0; }
  .sheet { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 86vh; animation: sheet-up .18s ease-out; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } }
