@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("vendor/PretendardVariable.woff2") format("woff2-variations");
}

/* ---------- 색·크기 규칙 ---------- */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: #f0f0f3;
  --fill-2: #e8e8ed;
  --line: rgba(0, 0, 0, 0.09);
  --line-2: rgba(0, 0, 0, 0.05);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --accent: #0071e3;
  --accent-weak: rgba(0, 113, 227, 0.1);
  --danger: #d70015;
  --danger-weak: rgba(215, 0, 21, 0.08);
  --ok: #248a3d;
  --warn: #b25000;
  --pop-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 12px 36px rgba(0, 0, 0, 0.14);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --side-w: 236px;
}
:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --surface: #1c1c1e;
  --fill: #2a2a2d;
  --fill-2: #36363a;
  --line: rgba(255, 255, 255, 0.11);
  --line-2: rgba(255, 255, 255, 0.06);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --accent: #2997ff;
  --accent-weak: rgba(41, 151, 255, 0.16);
  --danger: #ff453a;
  --danger-weak: rgba(255, 69, 58, 0.14);
  --ok: #32d74b;
  --warn: #ff9f0a;
  --pop-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 16px 44px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.muted { color: var(--text-2); }
.grow { flex: 1; }
.ic { width: 18px; height: 18px; flex: none; }
kbd {
  font: 500 11px/1 inherit; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px;
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-weight: 500; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:hover { background: var(--fill); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.icon { width: 36px; padding: 0; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary.danger { background: var(--danger); }
.btn.block { width: 100%; height: 44px; font-size: 16px; border-radius: var(--r-md); }
.btn.block kbd { color: rgba(255, 255, 255, 0.75); border-color: rgba(255, 255, 255, 0.35); }
.btn-group { display: inline-flex; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-left: -1px; }
.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; border-radius: 6px; font-weight: 500; font-size: 14px; }
.link:hover { background: var(--accent-weak); }
.iconbtn {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border: 0; border-radius: 8px; background: none; color: var(--text-2);
}
.iconbtn:hover { background: var(--fill-2); color: var(--text); }
.iconbtn.danger:hover { background: var(--danger-weak); color: var(--danger); }

/* ---------- 입력칸 ---------- */
input, select, textarea {
  width: 100%;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--fill); padding: 9px 12px; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-weak); }
textarea { resize: none; min-height: 104px; line-height: 1.55; display: block; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.field { margin-top: 18px; }
.flabel { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.flabel em { font-style: normal; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 7px; line-height: 1.45; }
.suffix { position: relative; }
.suffix input { padding-right: 34px; text-align: right; }
.suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.row { display: flex; gap: 8px; align-items: center; }

/* 눌러서 고르는 버튼 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 5px 13px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.chip:hover { background: var(--fill); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { margin-left: 5px; font-weight: 400; opacity: 0.6; }
.chips.sm .chip { padding: 3px 11px; font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 22px; }

/* ---------- 로그인 ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.login-box .brand { font-size: 26px; margin-bottom: 2px; }
.login-box input { height: 46px; font-size: 16px; background: var(--surface); border-color: var(--line); border-radius: var(--r-md); }
.msg { min-height: 20px; font-size: 13.5px; color: var(--danger); }
.brand { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.brand .over { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 2px; }

/* ---------- 전체 틀 ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 16px;
  padding: 26px 14px 16px; border-right: 1px solid var(--line-2);
}
.side .brand { padding: 0 10px; }
.searchbtn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--r-sm); background: var(--fill-2); color: var(--text-2); font-size: 14px;
}
.searchbtn:hover { color: var(--text); }
.searchbtn kbd { margin-left: auto; }
#nav { display: flex; flex-direction: column; gap: 2px; }
.navbtn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; padding: 9px 10px; border-radius: var(--r-sm);
  text-align: left; font-weight: 500; color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}
.navbtn:hover { background: var(--fill-2); color: var(--text); }
.navbtn.on { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, 0.04); }
.navbtn.on .ic { color: var(--accent); }
.navbtn .badge { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.undo {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  font-size: 13.5px; font-weight: 500; text-align: left;
}
.undo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync { display: flex; align-items: center; gap: 8px; padding: 0 2px 0 10px; font-size: 12.5px; color: var(--text-2); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.sync.bad i { background: var(--danger); }
.sync.bad { color: var(--danger); }
.sync .iconbtn { margin-left: auto; }
main { padding: 34px 36px 60px; min-width: 0; }
.view { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.tabbar { display: none; }

/* ---------- 화면 머리 ---------- */
.vhead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.vhead .over { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.vhead .sub { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.vhead .sub b { color: var(--accent); font-weight: 600; }
.vtools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rel { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  background: var(--surface); border-radius: 14px; box-shadow: var(--pop-shadow); padding: 14px;
  animation: fade 0.12s ease-out;
}

/* 날짜 띠 */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.strip.w5 { grid-template-columns: repeat(5, 1fr); }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface);
  padding: 10px 6px 9px; min-width: 0;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.day:hover { border-color: var(--line); background: var(--fill); }
.day .w { font-size: 12px; font-weight: 600; color: var(--text-2); }
.day .n { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.day .c { font-size: 11.5px; color: var(--text-3); min-height: 17px; }
.day.off .w, .day.off .n { color: var(--text-3); }
.day.today .w { color: var(--accent); }
.day.today .n { color: var(--accent); }
.day.on { background: var(--accent); border-color: var(--accent); }
.day.on .w, .day.on .n, .day.on .c { color: #fff; }
.day.on .c { opacity: 0.85; }
.strip.w5 .day .n { font-size: 15px; }

/* 달력 창 */
.cal { width: 292px; }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calhead b { font-size: 15px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calgrid > span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 4px 0; }
.cd {
  position: relative; height: 36px; border: 0; border-radius: 9px; background: none; font-size: 14px;
}
.cd:hover { background: var(--fill); }
.cd.out { color: var(--text-3); }
.cd.today { color: var(--accent); font-weight: 700; }
.cd.on { background: var(--accent); color: #fff; font-weight: 600; }
.cd i { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--text-3); }
.cd.on i { background: #fff; }

/* ---------- 입력 + 목록 2단 ---------- */
.split { display: grid; grid-template-columns: 352px minmax(0, 1fr); gap: 20px; align-items: start; }
.composer { position: sticky; top: 24px; }
.chead { display: flex; align-items: center; justify-content: space-between; }
.composer .btn.block { margin-top: 22px; }
.menu { width: 280px; padding: 6px; max-height: 340px; overflow: auto; }
.menu button {
  display: block; width: 100%; border: 0; background: none; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 14px;
}
.menu button:hover { background: var(--fill); }
.menu button small { display: block; color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }
.menu .save { color: var(--accent); font-weight: 500; }

.listcard { padding: 0; overflow: clip; }
.lhead { display: flex; align-items: baseline; gap: 10px; padding: 20px 22px 0; }
.lhead .count { font-weight: 500; color: var(--text-2); margin-left: 4px; }
.lhead .total { font-size: 15px; font-weight: 650; }
.lhead .total small { font-weight: 400; color: var(--text-2); font-size: 13px; margin-right: 6px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 22px 14px; border-bottom: 1px solid var(--line-2); }
.searchbox { position: relative; width: 210px; }
.searchbox .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.searchbox input { padding: 7px 10px 7px 32px; font-size: 14px; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.ghead {
  display: flex; align-items: baseline; gap: 8px; padding: 16px 22px 6px;
  font-size: 13px; color: var(--text-2);
}
.ghead b { font-size: 15px; color: var(--text); font-weight: 650; }
.item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 22px; min-height: 46px;
  cursor: pointer; transition: background 0.1s;
}
.item + .item { box-shadow: inset 0 1px 0 var(--line-2); }
.item:hover { background: var(--fill); }
.item.sel { background: var(--accent-weak); }
.item .check { padding-top: 3px; flex: none; display: grid; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; flex: none; width: 54px;
  font-size: 13px; font-weight: 600; color: var(--text-2); padding-top: 2px;
}
.tag i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.item .text { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.item .amt { flex: none; font-weight: 600; white-space: nowrap; padding-top: 1px; }
.item .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.acts { display: flex; gap: 2px; flex: none; margin: -3px -8px -3px 0; opacity: 0; transition: opacity 0.1s; }
.item:hover .acts, .item:focus-within .acts { opacity: 1; }
@media (hover: none) { .acts { opacity: 1; } }
.empty { text-align: center; padding: 56px 24px 60px; color: var(--text-2); }
.empty b { display: block; font-size: 16px; color: var(--text); margin-bottom: 4px; }
.lfoot { height: 12px; }

.selbar {
  position: sticky; bottom: 16px; margin: 6px auto 16px; width: fit-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px;
  background: #1d1d1f; color: #fff; border-radius: 999px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  animation: fade 0.14s ease-out; z-index: 5;
}
:root[data-theme="dark"] .selbar { background: #3a3a3e; }
.selbar b { font-weight: 600; margin-right: 8px; white-space: nowrap; font-size: 14px; }
.selbar button { border: 0; background: none; color: #fff; padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.selbar button:hover { background: rgba(255, 255, 255, 0.16); }
.selbar button.danger { color: #ff8a80; }
.selbar .ic { width: 16px; height: 16px; }

/* 수리 */
.stat {
  width: auto; flex: none; padding: 5px 26px 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background-color: var(--fill); border-color: transparent; cursor: pointer;
}
.stat.wait { color: var(--danger); }
.stat.doing { color: var(--warn); }
.stat.done { color: var(--text-2); font-weight: 500; }
.item.m { align-items: center; }
.item.m .days { flex: none; font-size: 13px; color: var(--text-2); white-space: nowrap; width: 62px; text-align: right; }
.item.m.done .text { color: var(--text-2); }
.item.m.pick { background: var(--accent-weak); }

/* 잔업 */
.item.o { align-items: center; }
.item.o .when { flex: none; width: 150px; font-size: 13.5px; }
.item.o .when small { display: block; color: var(--text-2); font-size: 12.5px; }
.item.o .hours { flex: none; font-weight: 650; width: 64px; text-align: right; }
.sums { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px 0; }
.sums span { background: var(--fill); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.sums b { font-weight: 650; margin-left: 5px; }

/* ---------- 홈 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.statc { cursor: pointer; text-align: left; transition: transform 0.12s, border-color 0.12s; width: 100%; font: inherit; color: inherit; }
.statc:hover { border-color: var(--line); transform: translateY(-1px); }
.statc .cap { font-size: 13px; font-weight: 600; color: var(--text-2); }
.statc .num { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; margin-top: 6px; }
.statc .num small { font-size: 17px; font-weight: 600; margin-left: 2px; }
.statc .note { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ctitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 13px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.period { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.period .label { font-weight: 600; margin: 0 4px; }
.period input[type="date"] { width: auto; padding: 6px 10px; }
.donut-wrap { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.donut { width: 176px; height: 176px; flex: none; }
.legend { flex: 1; min-width: 190px; }
.legend div { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend span { margin-left: auto; color: var(--text-2); }
.legend b { font-weight: 650; width: 44px; text-align: right; }
.legend .zero { color: var(--text-3); }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.nums div { font-size: 13px; color: var(--text-2); }
.nums b { display: block; font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.bars { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: 60px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 4px; background: var(--text-2); }
.bar b { text-align: right; font-weight: 600; }
.mini { margin: 10px -22px -12px; }
.mini .item { padding: 9px 22px; cursor: pointer; }
.mini .who { flex: none; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.mini .empty { padding: 26px 22px 30px; font-size: 14px; }

/* ---------- 설정 ---------- */
.settings { max-width: 720px; }
.sect h2 { margin-bottom: 4px; }
.sect > p { font-size: 13.5px; color: var(--text-2); }
.srow { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.srow:first-of-type { margin-top: 14px; }
.srow .name { flex: 1; min-width: 120px; font-weight: 500; }
.srow .name small { display: block; font-weight: 400; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.srow input[type="date"] { width: auto; }
.log { font-size: 13px; color: var(--text-2); margin-top: 10px; line-height: 1.7; }

/* ---------- 창·알림 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(3px); animation: dim 0.14s ease-out;
}
@keyframes dim { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: var(--pop-shadow);
  animation: rise 0.16s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.sheet.small { max-width: 380px; }
.sheet.small h2 { font-size: 18px; line-height: 1.4; }
.sheet.small p { margin-top: 6px; font-size: 14px; }
.sheet label.flabel { margin-top: 16px; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 24px; }
.sheet.palette { max-width: 620px; padding: 0; align-self: start; margin-top: 9vh; overflow: hidden; }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.palette .pin .ic { color: var(--text-3); }
.palette input { border: 0; background: none; padding: 0; font-size: 17px; box-shadow: none; }
.palette input:focus { box-shadow: none; background: none; }
.presults { max-height: 56vh; overflow: auto; padding: 6px; }
.pres { display: flex; gap: 12px; align-items: baseline; width: 100%; border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 10px; }
.pres.on, .pres:hover { background: var(--fill); }
.pres .k { flex: none; width: 62px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pres .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres .d { flex: none; font-size: 13px; color: var(--text-2); }
.pres mark { background: var(--accent-weak); color: var(--accent); border-radius: 3px; font-weight: 600; }
.pnote { padding: 26px; text-align: center; color: var(--text-2); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px;
  background: #1d1d1f; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); animation: fade 0.16s ease-out; max-width: calc(100vw - 32px);
}
:root[data-theme="dark"] .toast { background: #3a3a3e; }
.toast.bad { background: var(--danger); }
.toast button { border: 0; background: none; color: #6cb6ff; font-weight: 600; padding: 0; white-space: nowrap; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .composer { position: static; }
}
@media (max-width: 820px) {
  .app { display: block; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 14px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px);
    border-right: 0; border-bottom: 1px solid var(--line-2);
  }
  .side .brand { padding: 0; font-size: 15px; flex: 1; }
  .side .brand .over { display: none; }
  .searchbtn { width: 36px; padding: 0; justify-content: center; }
  .searchbtn span, .searchbtn kbd { display: none; }
  #nav, .sync span { display: none; }
  .side-foot { margin: 0; flex-direction: row; align-items: center; }
  .undo { width: auto; padding: 7px 10px; }
  .undo span { display: none; }
  .sync { padding: 0; }
  main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; }
  .card { padding: 18px; border-radius: 16px; }
  .listcard { padding: 0; }
  .lhead, .filters, .ghead, .item, .sums { padding-left: 16px; padding-right: 16px; }
  .mini { margin-left: -18px; margin-right: -18px; }
  .mini .item { padding-left: 18px; padding-right: 18px; }
  .searchbox { width: 100%; }
  .strip { gap: 5px; }
  .day { padding: 8px 2px 7px; border-radius: 12px; }
  .day .n { font-size: 17px; }
  .strip.w5 { grid-template-columns: repeat(3, 1fr); }
  .strip.w5 .day:first-child, .strip.w5 .day:last-child { display: none; }
  .stats { gap: 10px; }
  .statc .num { font-size: 26px; }
  .tag { width: 50px; }
  /* 휴대폰에서는 줄을 눌러 선택한 뒤 아래 막대에서 복사·수정·삭제 */
  #daily-body .acts, #weekly-body .acts { display: none; }
  .selbar { padding-left: 14px; max-width: calc(100% - 16px); }
  .selbar b { margin-right: 2px; font-size: 13px; }
  .selbar button { padding: 7px 8px; font-size: 13px; }
  .selbar .ic { display: none; }
  .selbar button[data-act="none"] .ic { display: block; }
  .item.o .when { width: 96px; }
  .item.m { flex-wrap: wrap; }
  .item.m .mmain { flex-basis: 100%; }
  .item.m .days { width: auto; margin-right: auto; }
  .vtools { margin-left: 0; width: 100%; }
  .pop { position: fixed; left: 14px; right: 14px; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); width: auto; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-2);
  }
  .tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; font-size: 10.5px; font-weight: 500; color: var(--text-3); }
  .tabbar button.on { color: var(--accent); }
  .tabbar .ic { width: 22px; height: 22px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .selbar { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
